"""" Key Bindings :nmap :echo :imap :echo " move vertically by visual line (don't skip wrapped lines) nmap j gj nmap k gk let mapleader = ' ' let maplocalleader = ' ' " save file bind noremap :w " exit terminal mode :tnoremap " toggle relative number function! ToggleLineNumber() if &rnu == 1 set nornu else set rnu endif endfunction nnoremap tr :call ToggleLineNumber() " toggle Zen Mode nnoremap tz :Goyo " tree sitter text object key bindings lua < gd (coc-definition) nmap gy (coc-type-definition) nmap gi (coc-implementation) nmap gr (coc-references) " Use K to show documentation in preview window nnoremap K :call show_documentation() function! s:show_documentation() if CocAction('hasProvider', 'hover') call CocActionAsync('doHover') else call feedkeys('K', 'in') endif endfunction " Symbol renaming. nmap rn (coc-rename) " Formatting selected code. xmap f (coc-format-selected) " jump to next error nnoremap EN (coc-diagnostic-next) nnoremap EB (coc-diagnostic-prev) augroup mygroup autocmd! " Setup formatexpr specified filetype(s). autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected') " Update signature help on jump placeholder. autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp') augroup end " Applying codeAction to the selected region. " Example: `aap` for current paragraph xmap a (coc-codeaction-selected) nmap a (coc-codeaction-selected) " Remap keys for applying codeAction to the current buffer. nmap ac (coc-codeaction) " Apply AutoFix to problem on the current line. nmap qf (coc-fix-current) " ignore for ctrlp let g:ctrlp_custom_ignore = 'node_modules\|DS_Store\|git\|target\|dist\|build' " ignore for telescope if has('nvim') lua < \ pumvisible() ? "\" : \ CheckBackspace() ? "\" : \ coc#refresh() inoremap pumvisible() ? "\" : "\" " Make auto-select the first completion item and notify coc.nvim to " " format on enter, could be remapped by other vim plugin inoremap pumvisible() ? coc#_select_confirm() \: "\u\\=coc#on_enter()\" " Use to trigger completion. if has('nvim') inoremap coc#refresh() else inoremap coc#refresh() endif nnoremap ff Telescope find_files nnoremap fg Telescope live_grep nnoremap fb Telescope buffers nnoremap fh Telescope help_tags " transparent vim toggle bind nnoremap tt :TransparentToggle " prettier format bind nnoremap P :PrettierAsync " binds for swapping buffers nnoremap gT :bp nnoremap gt :bn nnoremap h :wincmd h nnoremap j :wincmd j nnoremap k :wincmd k nnoremap l :wincmd l " format clojure nnoremap F :AsyncRun! lein cljfmt fix