nvim: Some minor cleanups, additions and refactor

Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
This commit is contained in:
Sanchayan Maity 2020-04-21 13:40:44 +05:30
parent 19be5a4442
commit 643cdfef11
3 changed files with 24 additions and 17 deletions

View file

@ -1,3 +1,9 @@
" Create folds based on files syntax
set foldmethod=syntax
" Scanning included files when ^n is troublesome
set complete-=i
set path+=/usr/include/**
nmap <LocalLeader>ct :NeomakeSh ctags -R .<CR> nmap <LocalLeader>ct :NeomakeSh ctags -R .<CR>
nmap <LocalLeader>cu :NeomakeSh cscope -bqR<CR> nmap <LocalLeader>cu :NeomakeSh cscope -bqR<CR>
nmap <LocalLeader>cr :cs reset<CR> nmap <LocalLeader>cr :cs reset<CR>

View file

@ -1,2 +1,7 @@
noremap <silent><buffer> p :call quickui#tools#preview_quickfix()<CR> noremap <silent><buffer> p :call quickui#tools#preview_quickfix()<CR>
noremap <buffer> [- :colder<CR>
noremap <buffer> ]+ :cnewer<CR>
" Close QF window if it is last window
autocmd WinEnter * if winnr('$') == 1 && &buftype == "quickfix" | q | endif

View file

@ -146,7 +146,6 @@ set splitright " Vertical split to right of current.
set nobackup " no backup files set nobackup " no backup files
set nowritebackup " only in case you don't want a backup file while editing set nowritebackup " only in case you don't want a backup file while editing
set noswapfile " no swap files set noswapfile " no swap files
set foldmethod=syntax " Create folds based on files syntax
set nofoldenable " Open folds by default set nofoldenable " Open folds by default
set undofile " Enable undo persistence across sessions set undofile " Enable undo persistence across sessions
set hidden set hidden
@ -181,6 +180,7 @@ set autoread " Autoload file if it changes on disk
set termguicolors " Enable colors for terminal set termguicolors " Enable colors for terminal
set fileformat=unix set fileformat=unix
set inccommand=split set inccommand=split
set switchbuf=useopen
set clipboard^=unnamed,unnamedplus set clipboard^=unnamed,unnamedplus
set backspace=indent,eol,start set backspace=indent,eol,start
@ -202,8 +202,6 @@ cnoremap <Esc> <Nop>
" Use Q to execute default register. " Use Q to execute default register.
nnoremap Q <Nop> nnoremap Q <Nop>
" Bind vanilla buffer switching
nnoremap <Leader>b :b<SPACE>
" For Fuzzy " For Fuzzy
nnoremap <Leader>ff :GFiles<CR> nnoremap <Leader>ff :GFiles<CR>
nnoremap <Leader>f? :GFiles?<CR> nnoremap <Leader>f? :GFiles?<CR>
@ -222,10 +220,10 @@ nnoremap <Leader>fo :Locate<SPACE>
nnoremap <Leader>fk :Maps<CR> nnoremap <Leader>fk :Maps<CR>
nnoremap <Leader>f/ :Rg<CR> nnoremap <Leader>f/ :Rg<CR>
nnoremap <Leader>fs :exe ':Rg ' . expand('<cword>')<CR> nnoremap <Leader>fs :exe ':Rg ' . expand('<cword>')<CR>
imap <C-x><C-w> <plug>(fzf-complete-word) imap <C-x><C-w> <Plug>(fzf-complete-word)
imap <C-x><C-p> <plug>(fzf-complete-path) imap <C-x><C-p> <Plug>(fzf-complete-path)
imap <C-x><C-f> <plug>(fzf-complete-file) imap <C-x><C-f> <Plug>(fzf-complete-file)
imap <C-x><C-l> <plug>(fzf-complete-line) imap <C-x><C-l> <Plug>(fzf-complete-line)
" Save " Save
nnoremap <Leader>w <Esc>:w<CR> nnoremap <Leader>w <Esc>:w<CR>
" Search and Replace " Search and Replace
@ -240,6 +238,9 @@ nnoremap [b :bprevious<CR>
nnoremap ]b :bnext<CR> nnoremap ]b :bnext<CR>
nnoremap [B :bfirst<CR> nnoremap [B :bfirst<CR>
nnoremap ]B :blast<CR> nnoremap ]B :blast<CR>
nnoremap <Leader>b :b<SPACE>
nnoremap <Leader>bl :ls<CR>:b<SPACE>
nnoremap <Leader>bd :bd<SPACE>
" For floating terminal " For floating terminal
nnoremap se :FloatermNew<CR> nnoremap se :FloatermNew<CR>
nnoremap [s :FloatermPrev<CR> nnoremap [s :FloatermPrev<CR>
@ -389,16 +390,6 @@ augroup rainbow_lisp
autocmd FileType lisp,clojure,scheme RainbowParentheses autocmd FileType lisp,clojure,scheme RainbowParentheses
augroup END augroup END
augroup quickfix
au!
" Close QF window if it is last window
au WinEnter * if winnr('$') == 1 && &buftype == "quickfix"|q|endif
" Existing bindings for QFGrep
" <Leader>g input pattern to do further filtering
" <Leader>v input pattern to do further inverted filtering
" <Leader>r restore the Quickfix/location list with original entries
augroup END
augroup terminal_job augroup terminal_job
au! au!
au TermOpen * startinsert au TermOpen * startinsert
@ -412,6 +403,10 @@ augroup END
" --------------------------- Plugin settings -------------------------------- " --------------------------- Plugin settings --------------------------------
" Use airline " Use airline
let g:airline#extensions#keymap#enabled = 0
let g:airline#extensions#whitespace#enabled = 0
let g:airline#extensions#wordcount#enabled = 0
let g:airline#extensions#term#enabled = 0
let g:airline#extensions#tabline#enabled = 1 let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#fnamemod = ':t' let g:airline#extensions#tabline#fnamemod = ':t'
let g:airline#extensions#tabline#left_sep = ' ' let g:airline#extensions#tabline#left_sep = ' '
@ -425,6 +420,7 @@ let g:airline_left_alt_sep = '|'
let g:airline_right_sep = ' ' let g:airline_right_sep = ' '
let g:airline_right_alt_sep = '|' let g:airline_right_alt_sep = '|'
let g:airline_section_y = '%{winnr()}' let g:airline_section_y = '%{winnr()}'
let g:airline_highlighting_cache = 1
" Let vim-gitgutter do its thing on large files " Let vim-gitgutter do its thing on large files
let g:gitgutter_max_signs=1000 let g:gitgutter_max_signs=1000