" EasyAlign xmap ga (EasyAlign) nmap ga (EasyAlign) "lua require ('init') "let g:coq_settings = { 'auto_start': v:true } " "" vim-pydocstring let g:pydocstring_doq_path = '~/.config/nvim/env/bin/doq' "return to previous place in buffer """ Main Configurations "filetype plugin indent on "nmap M MoveMotionEndOfLinePlug " Use tab for trigger completion with characters ahead and navigate. " NOTE: Use command ':verbose imap ' to make sure tab is not mapped by " other plugin before putting this into your config. "inoremap "\ pumvisible() ? "\" : "\ check_back_space() ? "\" : "\ coc#refresh() "inoremap pumvisible() ? "\" : "\" "function! s:check_back_space() abort "let col = col('.') - 1 "return !col || getline('.')[col - 1] =~# '\s' "endfunction " Use to trigger completion. "if has('nvim') ""inoremap coc#refresh() "else ""inoremap coc#refresh() "endif " 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 `[g` and `]g` to navigate diagnostics " Use `:CocDiagnostics` to get all diagnostics of current buffer in location list. nmap [g (coc-diagnostic-prev) nmap ]g (coc-diagnostic-next) " GoTo code navigation. nmap gd (coc-definition) nmap gt (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 (index(['vim','help'], &filetype) >= 0) "execute 'h '.expand('') "elseif (coc#rpc#ready()) "call CocActionAsync('doHover') "else "execute '!' . &keywordprg . " " . expand('') "endif "endfunction " Highlight the symbol and its references when holding the cursor. "autocmd CursorHold * silent call CocActionAsync('highlight') " Symbol renaming. "nnoremap 9 (coc-rename) "nmap rn (coc-rename) " Formatting selected code. "xmap = (coc-format-selected) "nmap = (coc-format-selected) "augroup mygroup "autocmd! """ Setup formatexpr specified filetype(s). "autocmd FileType typescript,json,python,yaml setl formatexpr=CocAction('formatSelected') """ Update signature help on jump placeholder. "autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp') "augroup end "let g:python3_host_prog = "/usr/bin/python3.8" " coc.vim END " signify "let g:signify_sign_add = '│' "let g:signify_sign_delete = '│' "let g:signify_sign_change = '│' "hi DiffDelete guifg=#ff5555 guibg=none """ Custom Functions " Trim Whitespaces "function! TrimWhitespace() "let l:save = winsaveview() "%s/\\\@ sj:terminal:set nonumber nmap vl:terminal:set nonumber " NerdTree "nmap q :NERDTreeToggle "nnoremap e :NERDTreeFocus "nnoremap :NERDTreeFind """open NerdTree current directory""" "nmap \\ q " "CHADtree "let &tags = expand("%:p") "nnoremap e :CHADopen "nnoremap 3 :CHADopen --always-focus "nnoremap e :Vexplorer "nnoremap E :Ex "Tagbar "nmap w :TagbarToggle "nmap \| w "Source vim nmap R :so ~/.config/nvim/init.vim "nmap t :call TrimWhitespace() "nmap y vl:HackerNews bestJ "nmap p (pydocstring) "easy align xmap a gaip* nmap a gaip* "nmap s :Rg " ""quick grep search "all system files -- not useful "nmap d :Files "nnoremap h: :History: "nnoremap h/ :History/ ""latest files -- very useful! "nnoremap hh :History ""find file in line "nmap z :BLines "nmap H :RainbowParentheses!! "nnoremap """ :reg " "nmap g :Goyo "nmap j :set filetype=journal "nmap l :Limelight!! "xmap l :Limelight!! " "I actually don't like what this does. It makes the python indent all weird. "Figure out what plugin would cause indent to be like this, then delete it. "I still have an annoying indentation error when I'm typing as well. "autocmd FileType python nmap x :0,$!~/.config/nvim/env/bin/python -m yapf "nmap :tabn "nmap :tabp " view current buffers and type the number you want to go to. ":bd to delete a single buffer nnoremap :buffers:buffer "go back to file tree "nnoremap :Ex "splits nnoremap :vsplit "nnoremap "Navigate split buffers "Normal Mode nnoremap nnoremap nnoremap nnoremap "Terminal mode tnoremap tnoremap tnoremap tnoremap "add current cursor position to jumplist nnoremap m :autocmd CursorHold * normal! m' ""easymotion mappings "nnoremap f (easymotion-prefix)f "nnoremap s (easymotion-s2) "nnoremap f (easymotion-prefix)s "nnoremap (easymotion-sn) "nnoremap / (easymotion-sn) "nnoremap F (easymotion-prefix)F "nnoremap s (easymotion-prefix)s "map (easymotion-next) "map (easymotion-prev)" Terminal mode: "nmap f (easymotion-overwin-f) "nmap cf c(easymotion-overwin-f) "nmap s (easymotion-overwin-f2) " Turn on case-insensitive feature let g:EasyMotion_smartcase = 1 "fuzzy finder "I have to remap ctrlp's default in order to make my custom command to work let g:ctrlp_map = '' "open up all files including dotfiles nnoremap p :CtrlP /home/ldraney set wildignore+=*/.vim/* " "Rename tmux window tab after current file with path "autocmd BufReadPost,FileReadPost,BufNewFile * call system("tmux rename-window " . expand("%:t")) "tmap "tmap :q "delete "I don't know what this does... "autocmd BufWinEnter,WinEnter term://* startinsert "autocmd BufLeave term://* stopinsert ":!tmux split-window -h; tmux select-pane -L; tmux kill-pane; tmux select-layout even-horizontal "OVERCOMING ANNOYING LITTLE VIM THINGS "nnoremap "inoremap "nnoremap o o "highlight search settings "highlight link Searchlight Incsearch "hi Search guibg=white guifg=green "hi Search cterm=NONE ctermfg=grey ctermbg=blue """ PLUGIN CONFIGURATIONS