let mapleader = "," set hidden " disable mouse set mouse= " GoTo code navigation. nmap gd (coc-definition) nmap gy (coc-type-definition) nmap gi (coc-implementation) nmap gr (coc-references) " Rename nmap rn (coc-rename) " Use K to show documentation in preview window. nnoremap K :call ShowDocumentation() nmap ac (coc-codeaction) nmap as (coc-codeaction-cursor) nmap cl (coc-codelens-action) nmap [G (coc-diagnostic-next-error) nmap ]G (coc-diagnostic-prev-error) nmap [g (coc-diagnostic-next) nmap ]g (coc-diagnostic-prev) function! ShowDocumentation() if CocAction('hasProvider', 'hover') call CocActionAsync('doHover') else call feedkeys('K', 'in') endif endfunction " Highlight the symbol and its references when holding the cursor. autocmd CursorHold * silent call CocActionAsync('highlight') " Formatting selected code. xmap f (coc-format-selected) nmap f (coc-format-selected) nmap F (coc-format) " " Copy to clipboard vnoremap y "+y nnoremap Y "+yg_ nnoremap y "+y nnoremap yy "+yy " " Paste from clipboard nnoremap p "+p nnoremap P "+P vnoremap p "+p vnoremap P "+P " " Tabbing https://webdevetc.com/blog/tabs-in-vim/ map tn :tabnew map t :tabnext map tm :tabmove map tc :tabclose map to :tabonly " Display line numbers set number relativenumber inoremap coc#pum#visible() ? coc#_select_confirm() \: "\u\\=coc#on_enter()\" map :mksession! .nvim_session " Quick write session with F3 map :source .nvim_session " And load session with F4 set undofile set undodir=~/.vim/undodir " Remember last posistion " split-term-vim let g:split_term_default_shell = "fish" set splitright " Airline let g:airline#extensions#tabline#enabled = 1 let g:airline#extensions#tabline#show_tab_nr = 1 let g:airline#extensions#tabline#tab_nr_type = 1 if has("autocmd") au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif endif