From b3595b681f7d93808f3587a1fe5877ecfe10ded3 Mon Sep 17 00:00:00 2001 From: Thomas Ruoff Date: Thu, 15 Apr 2021 22:28:54 +0200 Subject: [PATCH] add nerdtree, remove gutentags --- vim/.vimrc | 79 +++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 55 insertions(+), 24 deletions(-) diff --git a/vim/.vimrc b/vim/.vimrc index 4d11fe3..4bd0844 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -2,12 +2,16 @@ " author: Thomas Ruoff " Basics {{{ +set encoding=utf-8 set hidden + set ttyfast set lazyredraw set updatetime=300 set synmaxcol=512 + set modeline + set nobackup set noswapfile @@ -20,6 +24,12 @@ set wildignore+=*.swp,*.bak,*.jpg,*.gif,*.png,*.git, set splitright set splitbelow +" Always show the status line +set laststatus=2 +set cmdheight=2 + +set shortmess+=c + " yank delete change and put operations go by default in `"+` register " so in the systems clipboard accessable by CTRL-V on all OS types if has('mac') @@ -103,38 +113,58 @@ Plug 'tpope/vim-projectionist' Plug 'mbbill/undotree' nnoremap u :UndotreeToggle -Plug 'w0rp/ale' - nmap [a (ale_previous_wrap) - nmap (ale_next_wrap) - let g:ale_linters = {} - let g:ale_linters.javascript = ['eslint'] - let g:ale_fixers = {} - let g:ale_fixers.javascript = ['eslint'] - let g:ale_fix_on_save = 1 - Plug 'neoclide/coc.nvim', {'branch': 'release'} " Remap keys for gotos nmap gd (coc-definition) nmap gy (coc-type-definition) nmap gi (coc-implementation) nmap gr (coc-references) - " Use `[c` and `]c` to navigate diagnostics + + " Use `[d` and `]d` to navigate diagnostics nmap [d (coc-diagnostic-prev) nmap ]d (coc-diagnostic-next) " Remap for rename current word nmap rn (coc-rename) " Remap for do codeAction of current line nmap ac (coc-codeaction) + " Applying codeAction to the selected region. + " Example: `aap` for current paragraph + xmap a (coc-codeaction-selected) + nmap a (coc-codeaction-selected) " Fix autofix problem of current line nmap qf (coc-fix-current) + " 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 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 + + " Formatting selected code. + xmap f (coc-format-selected) + nmap f (coc-format-selected) Plug 'itchyny/lightline.vim' if filereadable(expand("~/.vim/lightline.vim")) source ~/.vim/lightline.vim - augroup ale-statusline - autocmd! - autocmd User ALELint call lightline#update() - augroup END endif function! LightlineReload() @@ -167,17 +197,18 @@ Plug 'janko-m/vim-test' let test#strategy = "vimterminal" " vim 8 plugins -if v:version >= 800 - Plug 'ludovicchabant/vim-gutentags' - let g:gutentags_cache_dir="~/.tags" - let g:gutentags_file_list_command = { - \ 'markers': { - \ '.git': 'git ls-files', - \ '.hg': 'hg files', - \ }, - \ } -endif +" if v:version >= 800 +" Plug 'ludovicchabant/vim-gutentags' +" let g:gutentags_cache_dir="~/.tags" +" let g:gutentags_file_list_command = { +" \ 'markers': { +" \ '.git': 'git ls-files', +" \ '.hg': 'hg files', +" \ }, +" \ } +" endif +Plug 'preservim/nerdtree' " debug Plug 'tweekmonster/startuptime.vim'