Skip to content

Commit

Permalink
nvim: switch to coc.nvim
Browse files Browse the repository at this point in the history
  • Loading branch information
DanNixon committed Jan 15, 2024
1 parent 4a88bd6 commit 5a58e26
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 17 deletions.
20 changes: 9 additions & 11 deletions modules/home-manager/terminal_environment/neovim/config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@
let g:tagbar_autofocus = 1
let g:tagbar_compact = 1
" Language server config
let g:LanguageClient_serverCommands = {
\ 'nix': ['nixd'],
\ 'rust': ['rust-analyzer'],
\ }
" Spelling config
let g:lexical#spell_key = '<leader>ss'
let g:lexical#thesaurus_key = '<leader>st'
Expand Down Expand Up @@ -55,9 +49,6 @@
set completeopt=menu,menuone,longest
set pumheight=15
" SuperTab option for context aware completion
let g:SuperTabDefaultCompletionType = "context"
" Set options to restore from last session
set viewoptions=cursor,slash,unix
Expand Down Expand Up @@ -85,6 +76,13 @@
" Highlight current line
set cursorline
let g:copilot_no_tab_map = v:true
inoremap <silent><expr> <TAB>
\ coc#pum#visible() ? coc#pum#next(1):
\ exists('b:_copilot.suggestions') ? copilot#Accept("\<CR>") :
\ CheckBackSpace() ? "\<Tab>" :
\ coc#refresh()
"""""""""""""""""""""""""""""""
" MISC COMMANDS AND FUNCTIONS "
"""""""""""""""""""""""""""""""
Expand All @@ -97,8 +95,8 @@
" KEY MAPPINGS "
""""""""""""""""
" Language server menu
nmap <Leader>l <Plug>(lcn-menu)
" Language server actions
" Handy shortcut for replacing words
map <Leader>r :%s/\<<C-r><C-w>\>/
Expand Down
4 changes: 4 additions & 0 deletions modules/home-manager/terminal_environment/neovim/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,9 @@
universal-ctags
nixd
];

coc = {
enable = true;
};
};
}
12 changes: 6 additions & 6 deletions modules/home-manager/terminal_environment/neovim/plugins.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
# Fuzzy finding
vimPlugins.fzf-vim

# Language server client
vimPlugins.LanguageClient-neovim

# Enhanced spelling and grammar checking
vimPlugins.vim-lexical

Expand All @@ -42,9 +39,6 @@
# Format text into one line per sentance
vimPlugins.vim-sentence-chopper

# Tab completion
vimPlugins.supertab

# Provides ctags based navigation of current file
vimPlugins.tagbar

Expand All @@ -62,5 +56,11 @@
vimPlugins.vim-polyglot
vimPlugins.vim-openscad
vimPlugins.vim-nftables

vimPlugins.coc-json
vimPlugins.coc-yaml
vimPlugins.coc-toml
vimPlugins.coc-sh
vimPlugins.coc-rust-analyzer
];
}

0 comments on commit 5a58e26

Please sign in to comment.