diff --git a/home-manager/roles/neovim/default.nix b/home-manager/roles/neovim/default.nix index 4287f879..89a9243f 100644 --- a/home-manager/roles/neovim/default.nix +++ b/home-manager/roles/neovim/default.nix @@ -61,6 +61,8 @@ in vim-css-color + vista-vim + # === # Languages # haskell syntax highlighting diff --git a/home-manager/roles/neovim/vimrc b/home-manager/roles/neovim/vimrc index 36a835c9..48fc4933 100644 --- a/home-manager/roles/neovim/vimrc +++ b/home-manager/roles/neovim/vimrc @@ -14,6 +14,7 @@ function! MyExplorer() endfunction nnoremap e :call MyExplorer() +nnoremap v :Vista coc set nofoldenable set background=light @@ -135,13 +136,13 @@ inoremap coc#refresh() " Coc only does snippet and additional edit on confirm. inoremap pumvisible() ? "\" : "\u\" -nnoremap gp (coc-diagnostic-prev) -nnoremap gn (coc-diagnostic-next) +nnoremap gp :call CocAction('diagnosticPrevious') +nnoremap gn :call CocAction('diagnosticNext') " Remap keys for gotos -nnoremap gd (coc-definition) -nnoremap gy (coc-type-definition) -nnoremap gr (coc-references) +nnoremap gd :call CocAction('jumpDefinition') +nnoremap gt :call CocAction('jumpTypeDefinition') +nnoremap gr :call CocAction('jumpReferences') nnoremap gs :Git status nnoremap gu :CocCommand git.chunkUndo @@ -153,7 +154,7 @@ nnoremap gc :Git commit function! s:show_documentation() if (index(['vim','help'], &filetype) >= 0) elseif (coc#rpc#ready()) - call CocActionAsync('doHover') + call CocActionAsync('definitionHover') else execute '!' . &keywordprg . " " . expand('') endif @@ -182,13 +183,6 @@ nnoremap a (coc-codeaction-selected) nnoremap f :Format nnoremap l (coc-codelens-action) -" Create mappings for function text object, requires document symbols feature of languageserver. - -xmap if (coc-funcobj-i) -xmap af (coc-funcobj-a) -omap if (coc-funcobj-i) -omap af (coc-funcobj-a) - " FZF ctrl-p style search nnoremap p :Files nnoremap g :Rg @@ -243,11 +237,9 @@ nnoremap d :CocFzfList diagnostics " Show commands nnoremap c :CocFzfList commands " Find symbol of current document -nnoremap o :CocFzfList outline +nnoremap o :Vista finder coc " Find symbol of current document -nnoremap a :CocFzfList actions -" Do default action for next item. -nnoremap j :CocNext +nnoremap a :CocAction imap