call plug#begin("~/.vim/plugged") " Theme Plug 'dracula/vim' " Language Client Plug 'neoclide/coc.nvim', {'branch': 'release'} let g:coc_global_extensions = ['coc-emmet', 'coc-css', 'coc-html', 'coc-json', 'coc-prettier', 'coc-tsserver', 'coc-eslint', 'coc-pyright', 'coc-go'] " TypeScript Highlighting Plug 'leafgarland/typescript-vim' Plug 'peitalin/vim-jsx-typescript' " File Explorer with Icons Plug 'preservim/nerdtree' Plug 'ryanoasis/vim-devicons' " File Search Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } Plug 'junegunn/fzf.vim' Plug 'vim-syntastic/syntastic' call plug#end() " Enable theming support if (has("termguicolors")) set termguicolors endif " Theme syntax enable "colorscheme dracula "colorscheme koehler "let g:NERDTreeShowHidden = 1 let g:NERDTreeMinimalUI = 1 "let g:NERDTreeIgnore = [] let g:NERDTreeStatusline = '' " Automaticaly close nvim if NERDTree is only thing left open autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif " Toggle nnoremap ,, viW nnoremap :NERDTreeToggle nnoremap :FZF let g:fzf_action = { \ 'ctrl-t': 'tab split', \ 'ctrl-s': 'split', \ 'ctrl-v': 'vsplit' \} " requires silversearcher-ag " used to ignore gitignore files let $FZF_DEFAULT_COMMAND="" " open new split panes to right and below set splitright set splitbelow " turn terminal to normal mode with escape tnoremap " use alt+hjkl to move between split/vsplit panels "tnoremap h "tnoremap j "tnoremap k "tnoremap l "nnoremap h "nnoremap j "nnoremap k "nnoremap l " navigate between tabs in vim //open new tab with NERDTree by t or T, goto tabs by gt (forward) or gT (backward) map :tabn " tabnext (== gt) map :tabp " tabprevious (==gT) nmap :wincmd k nmap :wincmd j nmap :wincmd h nmap :wincmd l " start terminal in insert mode au BufEnter * if &buftype == 'terminal' | :startinsert | endif " make vim remember last position if has("autocmd") au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif endif " open terminal on ctrl+; " uses zsh instead of bash function! OpenTerminal() split term://bash resize 10 endfunction "nnoremap :call OpenTerminal() set invrelativenumber set number "diable warning of coc_disable_startup_warning let g:coc_disable_startup_warning = 1 set nobackup set nowritebackup set mouse=a vnoremap "+y "nmap (coc-definition) nmap :call CocAction('jumpDefinition', 'tabe') nnoremap :call CocAction('jumpDefinition', 'tabe') nmap gy (coc-type-definition) nmap gi (coc-implementation) nmap gr (coc-references) set updatetime=100 autocmd CursorHold * silent call CocActionAsync('highlight') inoremap pumvisible() ? "\" : "\" "C-n: pick the highest in recommendations. C-p: pick the lowest imap imap nmap [c (coc-git-prevconflict) nmap ]c (coc-git-nextconflict) highlight DiffText cterm=bold ctermfg=10 ctermbg=88 gui=none guifg=bg guibg=Red set wrap "inoremap pumvisible() ? coc#select_confirm() : "\u\" ":.+1,$tabdo :q "let g:coc_disable_startup_warning = 1 "set linespace=3 "set nobackup "set nowritebackup ""let g:typescript_indent_disable = 1 "" CoC extensions "let g:coc_global_extensions = ['coc-tsserver'] "" map space to copy to clipboard "map "+y ""map F9 to toggle NERDTree "nmap :NERDTreeToggle "" map jj to escape insert mode "imap jj "" navigate between tabs in vim //open new tab with NERDTree by t or T, goto tabs by gt (forward) or gT (backward) "map :tabn " tabnext (== gt) "map :tabp " tabprevious (==gT) "map :tabnew "" GoTo code navigation. "nmap gd (coc-definition) "nmap gy (coc-type-definition) "nmap gi (coc-implementation) "nmap gr (coc-references) " "nmap rn (coc-rename) "nmap ac (coc-codeaction) "set updatetime=300 "" Highlight the symbol and its references when holding the cursor. "autocmd CursorHold * silent call CocActionAsync('highlight') " "" :CocInstall coc-tsserver coc-eslint coc-json " ""references "" https://github.com/neoclide/coc.nvim/wiki/Install-coc.nvim -- install CocVim "" https://github.com/neoclide/coc.nvim "" https://github.com/preservim/nerdtree "" https://github.com/leafgarland/typescript-vim " first install plug manager for vim " curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim " then try open vim , if nothing happens, go :PlugInstall " # : goto previous occurence of word under cursor " * : goto next occurence of word under cursor " z = zt " z- = redraw screen -> move current line under cursor to bottom " z. = redraw screen -> move current line under cursor to middle " NUMBER% : goto NUMBER % of screen . you can type 50% and zt. -> tada now u are at the middle of screen " NUMBER| : go to position NUMBERth of current line " :goto NUMBER -> goto postion NUMBERth from start of file " vim +143 vim +/search-term vim +?search-term