Updated neovim config
parent
ed8e52b480
commit
2d36cb3c69
|
@ -935,7 +935,7 @@ function! s:prepare(...)
|
|||
call s:new_window()
|
||||
endif
|
||||
|
||||
nnoremap <silent> <buffer> q :if b:plug_preview==1<bar>pc<bar>endif<bar>bd<cr>
|
||||
nnoremap <silent> <buffer> q :call <SID>close_pane()<cr>
|
||||
if a:0 == 0
|
||||
call s:finish_bindings()
|
||||
endif
|
||||
|
@ -957,6 +957,15 @@ function! s:prepare(...)
|
|||
endif
|
||||
endfunction
|
||||
|
||||
function! s:close_pane()
|
||||
if b:plug_preview == 1
|
||||
pc
|
||||
let b:plug_preview = -1
|
||||
else
|
||||
bd
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:assign_name()
|
||||
" Assign buffer name
|
||||
let prefix = '[Plugins]'
|
||||
|
|
|
@ -42,13 +42,13 @@ vnoremap <Down> <nop>
|
|||
" Tabs bindings
|
||||
" TODO improve on these
|
||||
" Create tab
|
||||
nnoremap <silent> <leader>o :tabnew<CR>
|
||||
nnoremap <silent> <leader>ee :tabnew<CR>
|
||||
" Close current tab
|
||||
nnoremap <silent> <leader>p :tabclose<CR>
|
||||
nnoremap <silent> <leader>ed :tabclose<CR>
|
||||
" Go to next tab
|
||||
nnoremap <silent> <leader>i :tabnext<CR>
|
||||
nnoremap <silent> <leader>el :tabnext<CR>
|
||||
" Go to previous tab
|
||||
nnoremap <silent> <leader>u :tabprevious<CR>
|
||||
nnoremap <silent> <leader>eh :tabprevious<CR>
|
||||
|
||||
" This function allows me to switch between a dark & light theme. I mainly use
|
||||
" the dark theme, but when I'm sitting outside, the light theme can be much
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
" Default config
|
||||
function! s:check_back_space() abort
|
||||
let col = col('.') - 1
|
||||
return !col || getline('.')[col - 1] =~ '\s'
|
||||
|
@ -18,14 +19,20 @@ inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
|
|||
" Select first option if no option is selected on enter
|
||||
inoremap <silent><expr> <cr> pumvisible() ? coc#_select_confirm() : "\<C-g>u\<CR>"
|
||||
|
||||
" Project refactoring keybinding
|
||||
nnoremap <silent> <leader>pwr :CocSearch <C-R>=expand("<cword>")<CR><CR>
|
||||
|
||||
" Own config
|
||||
" Project refactoring keybinding
|
||||
nmap <silent> <leader>pwr :CocSearch <C-R>=expand("<cword>")<CR><CR>
|
||||
" Go to definition
|
||||
nmap gd <Plug>(coc-definition)
|
||||
" Return from jump (e.g. go to definition)
|
||||
nmap gb <C-o>
|
||||
" Go to implementation
|
||||
nmap gi <Plug>(coc-implementation)
|
||||
" Show references of word
|
||||
nmap gr <Plug>(coc-references)
|
||||
" Refactor
|
||||
nmap <leader>rf <Plug>(coc-refactor)
|
||||
|
||||
" Jump between diagnostic positions
|
||||
nmap <silent> <leader>dk <Plug>(coc-diagnostic-prev)
|
||||
|
@ -33,6 +40,8 @@ nmap <silent> <leader>dK <Plug>(coc-diagnostic-prev-error)
|
|||
nmap <silent> <leader>dj <Plug>(coc-diagnostic-next)
|
||||
nmap <silent> <leader>dJ <Plug>(coc-diagnostic-next-error)
|
||||
|
||||
" Code formatting
|
||||
" vnoremap <silent>
|
||||
|
||||
" Show full diagnostics list
|
||||
nmap <silent> <leader>dd :CocDiagnostics<CR>
|
||||
|
||||
|
|
Loading…
Reference in New Issue