Updated neovim config

master
Jef Roosens 2021-04-22 00:33:26 +02:00
parent ed8e52b480
commit 2d36cb3c69
Signed by: Jef Roosens
GPG Key ID: B580B976584B5F30
3 changed files with 26 additions and 8 deletions

View File

@ -935,7 +935,7 @@ function! s:prepare(...)
call s:new_window() call s:new_window()
endif 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 if a:0 == 0
call s:finish_bindings() call s:finish_bindings()
endif endif
@ -957,6 +957,15 @@ function! s:prepare(...)
endif endif
endfunction endfunction
function! s:close_pane()
if b:plug_preview == 1
pc
let b:plug_preview = -1
else
bd
endif
endfunction
function! s:assign_name() function! s:assign_name()
" Assign buffer name " Assign buffer name
let prefix = '[Plugins]' let prefix = '[Plugins]'

View File

@ -42,13 +42,13 @@ vnoremap <Down> <nop>
" Tabs bindings " Tabs bindings
" TODO improve on these " TODO improve on these
" Create tab " Create tab
nnoremap <silent> <leader>o :tabnew<CR> nnoremap <silent> <leader>ee :tabnew<CR>
" Close current tab " Close current tab
nnoremap <silent> <leader>p :tabclose<CR> nnoremap <silent> <leader>ed :tabclose<CR>
" Go to next tab " Go to next tab
nnoremap <silent> <leader>i :tabnext<CR> nnoremap <silent> <leader>el :tabnext<CR>
" Go to previous tab " 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 " 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 " the dark theme, but when I'm sitting outside, the light theme can be much

View File

@ -1,3 +1,4 @@
" Default config
function! s:check_back_space() abort function! s:check_back_space() abort
let col = col('.') - 1 let col = col('.') - 1
return !col || getline('.')[col - 1] =~ '\s' 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 " Select first option if no option is selected on enter
inoremap <silent><expr> <cr> pumvisible() ? coc#_select_confirm() : "\<C-g>u\<CR>" 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 " Go to definition
nmap gd <Plug>(coc-definition) nmap gd <Plug>(coc-definition)
" Return from jump (e.g. go to definition)
nmap gb <C-o> nmap gb <C-o>
" Go to implementation
nmap gi <Plug>(coc-implementation) nmap gi <Plug>(coc-implementation)
" Show references of word
nmap gr <Plug>(coc-references) nmap gr <Plug>(coc-references)
" Refactor
nmap <leader>rf <Plug>(coc-refactor)
" Jump between diagnostic positions " Jump between diagnostic positions
nmap <silent> <leader>dk <Plug>(coc-diagnostic-prev) 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)
nmap <silent> <leader>dJ <Plug>(coc-diagnostic-next-error) nmap <silent> <leader>dJ <Plug>(coc-diagnostic-next-error)
" Code formatting
" vnoremap <silent>
" Show full diagnostics list " Show full diagnostics list
nmap <silent> <leader>dd :CocDiagnostics<CR> nmap <silent> <leader>dd :CocDiagnostics<CR>