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:
Peter Cai 2022-08-08 18:42:56 -04:00
parent a662702be3
commit d94b3b6aec
2 changed files with 23 additions and 2 deletions

View File

@ -31,15 +31,33 @@ set autoindent
" Syntax highlighting
set syntax=on
let g:special_filetype_pattern = 'neo-tree\|toggleterm\|minimap'
" Show line numbers on non-toolbar buffers
fun! ShowNumberIfNecessary()
if &ft =~ 'neo-tree|toggleterm'
if &ft =~ g:special_filetype_pattern
return
endif
setlocal nu
endfun
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
lua << EOF

View File

@ -32,6 +32,9 @@ return require('packer').startup(function(use)
-- A way saner buffer closing implementation
use "ojroques/nvim-bufdel"
-- Minimap
use "wfxr/minimap.vim"
-- Directory tree
use {
"nvim-neo-tree/neo-tree.nvim",