config for coc

main
The_miro 2025-03-31 09:10:29 +02:00
parent b891bc764c
commit 9be046d33d
1 changed files with 24 additions and 13 deletions

View File

@ -13,17 +13,7 @@ Plug 'vim-airline/vim-airline-themes'
Plug 'voldikss/vim-floaterm' Plug 'voldikss/vim-floaterm'
Plug 'rust-lang/rust.vim' Plug 'rust-lang/rust.vim'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'neovim/nvim-lspconfig'
Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'hrsh7th/cmp-buffer'
Plug 'hrsh7th/cmp-path'
Plug 'hrsh7th/cmp-cmdline'
Plug 'hrsh7th/nvim-cmp'
Plug 'hrsh7th/cmp-vsnip'
Plug 'hrsh7th/vim-vsnip'
call plug#end() call plug#end()
colorscheme cyberqueer colorscheme cyberqueer
let g:airline_powerline_fonts = 1 let g:airline_powerline_fonts = 1
@ -94,8 +84,29 @@ let hostname=system('hostname -s | tr -d "\n"')
let ipaddr=system('hostname -i | tr -d "\n"') let ipaddr=system('hostname -i | tr -d "\n"')
let g:airline_section_x = 'IP:%{ipaddr} DNS:%{hostname}' let g:airline_section_x = 'IP:%{ipaddr} DNS:%{hostname}'
nnoremap <C-H> <C-W>h " :inoremap <TAB> <C-N>
nnoremap <C-J> <C-W>j " :inoremap <S-TAB> <TAB>
"
" #####################################################
let g:coc_global_extensions=[ 'coc-snippets', 'coc-powershell', 'coc-sh', 'coc-omnisharp', 'coc-clangd' ]
" Use <C-l> for trigger snippet expand.
imap <C-l> <Plug>(coc-snippets-expand)
" Use <C-j> for select text for visual placeholder of snippet.
vmap <C-j> <Plug>(coc-snippets-select)
" Use <C-j> for jump to next placeholder, it's default of coc.nvim
let g:coc_snippet_next = '<c-j>'
" Use <C-k> for jump to previous placeholder, it's default of coc.nvim
let g:coc_snippet_prev = '<c-k>'
" Use <C-j> for both expand and jump (make expand higher priority.)
imap <C-j> <Plug>(coc-snippets-expand-jump)
" Use <leader>x for convert visual selected code to snippet
xmap <leader>x <Plug>(coc-convert-snippet)
nnoremap <C-K> <C-W>k nnoremap <C-K> <C-W>k
nnoremap <C-L> <C-W>l nnoremap <C-L> <C-W>l