neovim: Configure Minimap
The Minimap plugin has to be activated on window resize, otherwise neovim-qt will cause issues during its initial resizing
This commit is contained in:
parent
a662702be3
commit
d94b3b6aec
|
@ -31,15 +31,33 @@ set autoindent
|
||||||
" Syntax highlighting
|
" Syntax highlighting
|
||||||
set syntax=on
|
set syntax=on
|
||||||
|
|
||||||
|
let g:special_filetype_pattern = 'neo-tree\|toggleterm\|minimap'
|
||||||
|
|
||||||
" Show line numbers on non-toolbar buffers
|
" Show line numbers on non-toolbar buffers
|
||||||
fun! ShowNumberIfNecessary()
|
fun! ShowNumberIfNecessary()
|
||||||
if &ft =~ 'neo-tree|toggleterm'
|
if &ft =~ g:special_filetype_pattern
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
setlocal nu
|
setlocal nu
|
||||||
endfun
|
endfun
|
||||||
autocmd BufEnter * call ShowNumberIfNecessary()
|
autocmd BufEnter * call ShowNumberIfNecessary()
|
||||||
autocmd TermOpen,TermEnter term://* setlocal nonumber
|
|
||||||
|
" Minimap
|
||||||
|
fun! ResizeMinimap()
|
||||||
|
if &ft =~ g:special_filetype_pattern
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
if index(g:minimap_block_filetypes, &ft) >= 0
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
if index(g:minimap_block_buftypes, &bt) >= 0
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
MinimapClose
|
||||||
|
Minimap
|
||||||
|
endfun
|
||||||
|
let g:minimap_width = 10
|
||||||
|
autocmd VimResized * call ResizeMinimap()
|
||||||
|
|
||||||
" Terminal remapping
|
" Terminal remapping
|
||||||
lua << EOF
|
lua << EOF
|
||||||
|
|
|
@ -32,6 +32,9 @@ return require('packer').startup(function(use)
|
||||||
-- A way saner buffer closing implementation
|
-- A way saner buffer closing implementation
|
||||||
use "ojroques/nvim-bufdel"
|
use "ojroques/nvim-bufdel"
|
||||||
|
|
||||||
|
-- Minimap
|
||||||
|
use "wfxr/minimap.vim"
|
||||||
|
|
||||||
-- Directory tree
|
-- Directory tree
|
||||||
use {
|
use {
|
||||||
"nvim-neo-tree/neo-tree.nvim",
|
"nvim-neo-tree/neo-tree.nvim",
|
||||||
|
|
Loading…
Reference in a new issue