diff --git a/home-manager/roles/neovim/vimrc b/home-manager/roles/neovim/vimrc index 096aeb88..0315f293 100644 --- a/home-manager/roles/neovim/vimrc +++ b/home-manager/roles/neovim/vimrc @@ -13,8 +13,8 @@ function! MyExplorer() endif endfunction -nnoremap e :call MyExplorer() -nnoremap v :Vista coc +no e :call MyExplorer() +no v :Vista coc set nofoldenable set background=light @@ -48,13 +48,13 @@ augroup focus au BufLeave * silent! wall augroup END -nnoremap :nohlsearch -vnoremap < >gv -nnoremap -nnoremap -nnoremap -nnoremap +no :nohlsearch +vno < >gv +no +no +no +no let mapleader="," @@ -70,10 +70,10 @@ set ignorecase set wildmenu set hlsearch -noremap gk -noremap gj -noremap g -noremap g +no gk +no gj +no g +no g let $NVIM_TUI_ENABLE_CURSOR_SHAPE=1 let g:haskell_enable_quantification = 1 " to enable highlighting of `forall` let g:haskell_enable_recursivedo = 1 " to enable highlighting of `mdo` and `rec` @@ -118,11 +118,11 @@ set signcolumn=yes " Use tab for trigger completion with characters ahead and navigate. " Use command ':verbose imap ' to make sure tab is not mapped by other plugin. -inoremap +ino \ pumvisible() ? "\" : \ check_back_space() ? "\" : \ coc#refresh() -inoremap pumvisible() ? "\" : "\" +ino pumvisible() ? "\" : "\" function! s:check_back_space() abort let col = col('.') - 1 @@ -130,26 +130,26 @@ function! s:check_back_space() abort endfunction " Use to trigger completion. -inoremap coc#refresh() +ino coc#refresh() " Use to confirm completion, `u` means break undo chain at current position. " Coc only does snippet and additional edit on confirm. -inoremap pumvisible() ? "\" : "\u\" +ino pumvisible() ? "\" : "\u\" -nnoremap gp :call CocAction('diagnosticPrevious') -nnoremap gn :call CocAction('diagnosticNext') +no gp :call CocAction('diagnosticPrevious') +no gn :call CocAction('diagnosticNext') " Remap keys for gotos -nnoremap gd :call CocAction('jumpDefinition') -nnoremap gt :call CocAction('jumpTypeDefinition') -nnoremap gr :call CocAction('jumpReferences') +no gd :call CocAction('jumpDefinition') +no gt :call CocAction('jumpTypeDefinition') +no gr :call CocAction('jumpReferences') -nnoremap gs :Git status -nnoremap gu :CocCommand git.chunkUndo -nnoremap gi :CocCommand git.chunkInfo -nnoremap ga :CocCommand git.chunkStage -nnoremap gb :CocCommand git.showCommit -nnoremap gc :Git commit +no gs :Git status +no gu :CocCommand git.chunkUndo +no gi :CocCommand git.chunkInfo +no ga :CocCommand git.chunkStage +no gb :CocCommand git.showCommit +no gc :Git commit function! s:show_documentation() if (index(['vim','help'], &filetype) >= 0) @@ -160,7 +160,7 @@ function! s:show_documentation() endif endfunction -nnoremap i :call show_documentation() +no i :call show_documentation() augroup mygroup @@ -171,14 +171,14 @@ augroup mygroup autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp') augroup end -nnoremap f :call CocAction('format') -nnoremap l :call CocAction('codeLensAction') +no f :call CocAction('format') +no l :call CocAction('codeLensAction') " FZF ctrl-p style search -nnoremap p :Files -nnoremap g :Rg -nnoremap h :History -nnoremap b :Buffers +no p :Files +no g :Rg +no h :History +no b :Buffers function MyClose() if &readonly @@ -197,19 +197,19 @@ function MyCloseAll() quitall endif endfunction -nnoremap q :call MyClose() -nnoremap k :call MyCloseAll() -nnoremap s :w +no q :call MyClose() +no k :call MyCloseAll() +no s :w -nnoremap :bp -nnoremap :bn -inoremap :bp -inoremap :bn +no :bp +no :bn +ino :bp +ino :bn " Use for select selections ranges, needs server support, like: coc-tsserver, coc-python -nnoremap (coc-range-select) -xmap (coc-range-select) -xmap (coc-range-select-backword) +no (coc-range-select) +xno (coc-range-select) +xno (coc-range-select-backword) " Use `:Fold` to fold current buffer @@ -218,19 +218,19 @@ command! -nargs=? Fold :call CocAction('fold', ) " use `:OR` for organize import of current buffer command! -nargs=0 OR :call CocAction('runCommand', 'editor.action.organizeImport') -imap [1~ -imap [4~ +ino [1~ +ino [4~ " Using CocList " Show all diagnostics -nnoremap d :CocFzfList diagnostics +no d :CocFzfList diagnostics " Show commands -nnoremap c :CocFzfList commands +no c :CocFzfList commands " Find symbol of current document -nnoremap o :Vista finder coc +no o :Vista finder coc " Find symbol of current document -nnoremap a :CocAction +no a :CocAction -imap +ino " Load this after theme hi Normal ctermbg=NONE