nvim: Miscellaneous clean up

Make sure key bindings are local to the file type buffer.

Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
This commit is contained in:
Sanchayan Maity 2020-05-09 19:06:25 +05:30
parent 2ef8a772e5
commit fee71ae71e
5 changed files with 41 additions and 38 deletions

View file

@ -1,21 +1,21 @@
" Create folds based on files syntax
set foldmethod=syntax
setlocal foldmethod=syntax
" Scanning included files when ^n is troublesome
set complete-=i
set path+=/usr/include/**
setlocal complete-=i
setlocal path+=/usr/include/**
nmap <LocalLeader>ct :NeomakeSh ctags -R .<CR>
nmap <LocalLeader>cu :NeomakeSh cscope -bqR<CR>
nmap <LocalLeader>cr :cs reset<CR>
nmap <buffer> <LocalLeader>ct :NeomakeSh ctags -R .<CR>
nmap <buffer> <LocalLeader>cu :NeomakeSh cscope -bqR<CR>
nmap <buffer> <LocalLeader>cr :cs reset<CR>
nmap <silent> <LocalLeader>s <Plug>(quickr_cscope_symbols)
nmap <silent> <LocalLeader>g <Plug>(quickr_cscope_global)
nmap <silent> <LocalLeader>h <Plug>(quickr_cscope_global_split)
nmap <silent> <LocalLeader>v <Plug>(quickr_cscope_global_vert_split)
nmap <silent> <LocalLeader>d <Plug>(quickr_cscope_functions)
nmap <silent> <LocalLeader>c <Plug>(quickr_cscope_callers)
nmap <silent> <LocalLeader>t <Plug>(quickr_cscope_text)
nmap <silent> <LocalLeader>e <Plug>(quickr_cscope_egrep)
nmap <silent> <LocalLeader>f <Plug>(quickr_cscope_files)
nmap <silent> <LocalLeader>i <Plug>(quickr_cscope_includes)
nmap <silent> <LocalLeader>a <Plug>(quickr_cscope_assignments)
nmap <buffer> <silent> <LocalLeader>s <Plug>(quickr_cscope_symbols)
nmap <buffer> <silent> <LocalLeader>g <Plug>(quickr_cscope_global)
nmap <buffer> <silent> <LocalLeader>h <Plug>(quickr_cscope_global_split)
nmap <buffer> <silent> <LocalLeader>v <Plug>(quickr_cscope_global_vert_split)
nmap <buffer> <silent> <LocalLeader>d <Plug>(quickr_cscope_functions)
nmap <buffer> <silent> <LocalLeader>c <Plug>(quickr_cscope_callers)
nmap <buffer> <silent> <LocalLeader>t <Plug>(quickr_cscope_text)
nmap <buffer> <silent> <LocalLeader>e <Plug>(quickr_cscope_egrep)
nmap <buffer> <silent> <LocalLeader>f <Plug>(quickr_cscope_files)
nmap <buffer> <silent> <LocalLeader>i <Plug>(quickr_cscope_includes)
nmap <buffer> <silent> <LocalLeader>a <Plug>(quickr_cscope_assignments)

View file

@ -3,23 +3,24 @@
compiler stack
setlocal makeprg=stack\ build
setlocal keywordprg=:Hoogle
nmap <LocalLeader>b :Neomake!<CR>
nmap <LocalLeader>t :NeomakeSh stack exec -- hasktags -x -c .<CR>
nmap <LocalLeader>td :NeomakeSh stack exec -- haskdogs<CR>
nmap <LocalLeader>g :Ghcid<CR>
nmap <LocalLeader>k :GhcidKill<CR>
nmap <LocalLeader>c :HoogleClose<CR>
nmap <LocalLeader>o :exe ':Hoogle ' . expand('<cword>')<CR>
nmap <LocalLeader>i :exe ':HoogleInfo ' . expand('<cword>')<CR>
nmap <buffer> <LocalLeader>b :Neomake!<CR>
nmap <buffer> <LocalLeader>t :NeomakeSh stack exec -- hasktags -x -c .<CR>
nmap <buffer> <LocalLeader>td :NeomakeSh stack exec -- haskdogs<CR>
nmap <buffer> <LocalLeader>g :Ghcid<CR>
nmap <buffer> <LocalLeader>k :GhcidKill<CR>
nmap <buffer> <LocalLeader>c :HoogleClose<CR>
nmap <buffer> <LocalLeader>o :exe ':Hoogle ' . expand('<cword>')<CR>
nmap <buffer> <LocalLeader>i :exe ':HoogleInfo ' . expand('<cword>')<CR>
" Tabular helpers
vnoremap <Leader>= :Tabularize /=<CR>
vnoremap <Leader>- :Tabularize /-><CR>
vnoremap <Leader>< :Tabularize /<-<CR>
vnoremap <Leader>, :Tabularize /,<CR>
vnoremap <Leader># :Tabularize /#-}<CR>
vnoremap <Leader>: :Tabularize /::<CR>
vnoremap <Leader>[ :Tabularize /[<CR>
vnoremap <buffer> <Leader>= :Tabularize /=<CR>
vnoremap <buffer> <Leader>- :Tabularize /-><CR>
vnoremap <buffer> <Leader>< :Tabularize /<-<CR>
vnoremap <buffer> <Leader>, :Tabularize /,<CR>
vnoremap <buffer> <Leader># :Tabularize /#-}<CR>
vnoremap <buffer> <Leader>: :Tabularize /::<CR>
vnoremap <buffer> <Leader>[ :Tabularize /[<CR>
nmap <buffer><silent> ]] :call JumpHaskellFunction(0)<CR>
nmap <buffer><silent> [[ :call JumpHaskellFunction(1)<CR>

View file

@ -1,5 +1,5 @@
set textwidth=0
set wrapmargin=0
setlocal textwidth=0
setlocal wrapmargin=0
nmap <buffer> <silent> <LocalLeader>L :Plist<CR>
nmap <buffer> <silent> <LocalLeader>l :Pload<CR>

View file

@ -1,4 +1,4 @@
nmap pg :PlugUpgrade<CR>
nmap pd :PlugUpdate<CR>
nmap pw :PlugClean<CR>
nmap pr :so %<CR>
nmap <buffer> pg :PlugUpgrade<CR>
nmap <buffer> pd :PlugUpdate<CR>
nmap <buffer> pw :PlugClean<CR>
nmap <buffer> pr :so %<CR>

View file

@ -46,6 +46,8 @@ set wildignore+=*.sw? " Vim swap files
set wildignore+=*.luac " Lua byte code
set wildignore+=*.pyc " Python byte code
set wildignore+=*.orig " Merge resolution files
set wildignore+=**/node_modules/** " Ignore garbage node_modules
set wildignore+=**/output/** " Ignore Purescript output directory
if !&scrolloff
set scrolloff=3 " Show next 3 lines while scrolling.