From 56c24ccb16bea75544eb7f047c7c4731d9cc70d0 Mon Sep 17 00:00:00 2001 From: Thomas Ruoff Date: Tue, 30 Aug 2016 08:28:20 +0200 Subject: [PATCH 1/4] backspace to switch to last open buffer --- vimrc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vimrc b/vimrc index 3449871..aa92a06 100644 --- a/vimrc +++ b/vimrc @@ -171,6 +171,9 @@ nnoremap :noh nnoremap j gj nnoremap k gk +"" open last buffer +nnoremap + " Easier split navigation " Use ctrl-[hjkl] to select the active split! From d1ac1a1e0a9f1d3ce4beb89fa75612807d7e16bc Mon Sep 17 00:00:00 2001 From: Thomas Ruoff Date: Tue, 30 Aug 2016 08:30:29 +0200 Subject: [PATCH 2/4] use lighter config for local linter --- vimrc | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/vimrc b/vimrc index aa92a06..6f1539f 100644 --- a/vimrc +++ b/vimrc @@ -48,8 +48,7 @@ Plug 'chriskempson/base16-vim' Plug 'pangloss/vim-javascript', { 'for': 'javascript' } Plug 'marijnh/tern_for_vim', { 'do': 'npm install', 'for': 'javascript' } -Plug 'mtscout6/syntastic-local-eslint.vim', { 'for': 'javascript' } -Plug 'mxw/vim-jsx', { 'for': 'javascript.jsx' } +Plug 'mxw/vim-jsx', { 'for': 'javascript' } Plug 'suan/vim-instant-markdown', { 'for': 'markdown' } Plug 'xuhdev/vim-latex-live-preview', { 'for': 'tex' } @@ -266,14 +265,37 @@ set undoreload=10000 " Plugin Configuration " -"" syntastic -let g:syntastic_javascript_checkers = ['eslint'] +"" syntastic let g:syntastic_always_populate_loc_list = 1 let g:syntastic_auto_loc_list = 0 let g:syntastic_check_on_open = 1 let g:syntastic_check_on_wq = 0 +" local linter support + +let g:syntastic_javascript_checkers = [] + +function CheckJavaScriptLinter(filepath, linter) + if exists('b:syntastic_checkers') + return + endif + if filereadable(a:filepath) + let b:syntastic_checkers = [a:linter] + let {'b:syntastic_' . a:linter . '_exec'} = a:filepath + endif +endfunction + +function SetupJavaScriptLinter() + let l:current_folder = expand('%:p:h') + let l:bin_folder = fnamemodify(syntastic#util#findFileInParent('package.json', l:current_folder), ':h') + let l:bin_folder = l:bin_folder . '/node_modules/.bin/' + call CheckJavaScriptLinter(l:bin_folder . 'standard', 'standard') + call CheckJavaScriptLinter(l:bin_folder . 'eslint', 'eslint') +endfunction + +autocmd FileType javascript call SetupJavaScriptLinter() + "" lightline if filereadable(expand("~/.vim/lightline.vim")) source ~/.vim/lightline.vim @@ -315,7 +337,7 @@ let g:tex_flavor = "latex" let g:livepreview_previewer = 'zathura' " JSX -" let g:jsx_ext_required = 0 " Allow JSX in normal JS files +let g:jsx_ext_required = 0 " Allow JSX in normal JS files " " Autocmd Rules From f010ce664de6988b3d40ea793b67b8a188980e49 Mon Sep 17 00:00:00 2001 From: Thomas Ruoff Date: Tue, 30 Aug 2016 08:21:57 +0200 Subject: [PATCH 3/4] switch to ack.vim, as ag.vim is deprepcated --- vimrc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vimrc b/vimrc index 6f1539f..e70cc9f 100644 --- a/vimrc +++ b/vimrc @@ -38,7 +38,7 @@ Plug 'rhysd/conflict-marker.vim' Plug 'airblade/vim-gitgutter' Plug 'inside/vim-search-pulse' -Plug 'rking/ag.vim' +Plug 'mileszs/ack.vim' Plug 'BufOnly.vim' @@ -265,6 +265,10 @@ set undoreload=10000 " Plugin Configuration " +"" ACK +if executable('ag') + let g:ackprg = 'ag --vimgrep' +endif "" syntastic let g:syntastic_always_populate_loc_list = 1 From 6f72e870734e3b471e5db876265200f272d83367 Mon Sep 17 00:00:00 2001 From: Thomas Ruoff Date: Tue, 30 Aug 2016 08:22:27 +0200 Subject: [PATCH 4/4] add debugging shortcurt --- vimrc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vimrc b/vimrc index e70cc9f..0ed8dd2 100644 --- a/vimrc +++ b/vimrc @@ -237,6 +237,11 @@ vnoremap 0 :!node nnoremap + nnoremap - +" debugging, use leader-DD to start, do a slow action, then leader-DQ to +" finish. Your output will be in profile.log +nnoremap DD :exe ":profile start profile.log":exe ":profile func *":exe ":profile file *" +nnoremap DQ :exe ":profile pause":noautocmd qall! + "" abbreviations cnoreabbrev W! w! cnoreabbrev Q! q!