diff --git a/vimrcs/basic.vim b/vimrcs/basic.vim index 66c75335..c69ab0ec 100644 --- a/vimrcs/basic.vim +++ b/vimrcs/basic.vim @@ -44,7 +44,7 @@ " => General """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Sets how many lines of history VIM has to remember -set history=700 +set history=500 " Enable filetype plugins filetype plugin on @@ -232,7 +232,7 @@ map l map bd :Bclose " Close all the buffers -map ba :1,1000 bd! +map ba :bufdo bd " Useful mappings for managing tabs map tn :tabnew @@ -262,12 +262,12 @@ catch endtry " Return to last edit position when opening files (You want this!) -autocmd BufReadPost * - \ if line("'\"") > 0 && line("'\"") <= line("$") | - \ exe "normal! g`\"" | - \ endif +" autocmd BufReadPost * +" \ if line("'\"") > 0 && line("'\"") <= line("$") | +" \ exe "normal! g`\"" | +" \ endif " Remember info about open buffers on close -set viminfo^=% +" set viminfo^=% """""""""""""""""""""""""""""" @@ -310,21 +310,21 @@ autocmd BufWrite *.coffee :call DeleteTrailingWS() """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" => Ack searching and cope displaying -" requires ack.vim - it's much better than vimgrep/grep +" => Ag searching and cope displaying +" requires ag.vim - it's much better than vimgrep/grep """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" When you press gv you Ack after the selected text +" When you press gv you Ag after the selected text vnoremap gv :call VisualSelection('gv', '') -" Open Ack and put the cursor in the right position -map g :Ack +" Open Ag and put the cursor in the right position +map g :Ag " When you press r you can search and replace the selected text vnoremap r :call VisualSelection('replace', '') " Do :help cope if you are unsure what cope is. It's super useful! " -" When you search with Ack, display your results in cope by doing: +" When you search with Ag, display your results in cope by doing: " cc " " To go to the next search result do: @@ -389,7 +389,7 @@ function! VisualSelection(direction, extra_filter) range if a:direction == 'b' execute "normal ?" . l:pattern . "^M" elseif a:direction == 'gv' - call CmdLine("Ack \"" . l:pattern . "\" " ) + call CmdLine("Ag \"" . l:pattern . "\" " ) elseif a:direction == 'replace' call CmdLine("%s" . '/'. l:pattern . '/') elseif a:direction == 'f' diff --git a/vimrcs/plugins_config.vim b/vimrcs/plugins_config.vim index 41876803..c6538ba5 100644 --- a/vimrcs/plugins_config.vim +++ b/vimrcs/plugins_config.vim @@ -116,3 +116,13 @@ nnoremap z :Goyo " => Syntastic (syntax checker) """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" let g:syntastic_python_checkers=['pyflakes'] +let g:syntastic_javascript_checkers = ['jshint'] + +" Custom CoffeeScript SyntasticCheck +func! SyntasticCheckCoffeescript() + let l:filename = substitute(expand("%:p"), '\(\w\+\)\.coffee', '.coffee.\1.js', '') + execute "e " . l:filename + execute "SyntasticCheck" + execute "Errors" +endfunc +nnoremap l :call SyntasticCheckCoffeescript()