From b02fb749a6ec1631899777f04702f8e64ab2db72 Mon Sep 17 00:00:00 2001 From: Max Bucknell Date: Mon, 9 Mar 2015 13:19:33 +0000 Subject: [PATCH] Periodic vimrc update. --- vim/vimrc.symlink | 85 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 63 insertions(+), 22 deletions(-) diff --git a/vim/vimrc.symlink b/vim/vimrc.symlink index eabbc0b..430f56c 100644 --- a/vim/vimrc.symlink +++ b/vim/vimrc.symlink @@ -8,14 +8,22 @@ execute pathogen#infect() - """""""""""""""""""""" " Basic editing config """""""""""""""""""""" +set term=xterm-256color + set nocompatible colorscheme maxbucknell +" Line numbering +set relativenumber +set number + +" Set editor shell to bash, for Syntastic compatibility +set shell=bash + " Tab config options set expandtab set tabstop=2 @@ -29,15 +37,51 @@ set nowritebackup set noswapfile " I am lazy and I don't like holding shift. -map ; : +noremap ; : noremap ;; ; +" Paste! +noremap v "+gp +noremap V "+gP +noremap c "+y +noremap C "+Y + +" Quick exit insert mode +inoremap hh +inoremap + +" Bad arrow keys +inoremap +inoremap +inoremap +inoremap +noremap +noremap +noremap +noremap + +" Move lines up and down +noremap - ddp +noremap _ ddkP + +" Uppercase an entire word with +inoremap viwUa +nnoremap viwU + " Show me when my lines are too long call matchadd('ColorColumn', '\%81v', 100) +" Prevent K from being annoying +noremap K + +" Edit and Reload .vimrc files +nmap ev :e $MYVIMRC +nmap es :so $MYVIMRC + " Search options " Show partial matches while searching set incsearch + " Highlight other matches in the file set hlsearch @@ -61,7 +105,9 @@ function! HLNext (blinktime) endfunction " Disable match-paren -let loaded_matchparen = 1 +" Re-enabled for now, to remember why I turned it off +" let loaded_matchparen = 1 +set showmatch " Make searches case sensitive only if an upper case character has been typed set ignorecase smartcase @@ -94,9 +140,6 @@ syntax on " Also load indent files, to automatically do language-dependent indenting. filetype plugin indent on -" Change leader to , rather than \ -let mapleader="," - " Insert only one space when joining lines that contain sentence-terminating " punctuation like `.`. set nojoinspaces @@ -116,19 +159,6 @@ let g:vim_markdown_folding_disabled=1 " Always show status bar set laststatus=2 -" Swap v and ctrl-v because visual block mode rules -nnoremap v -nnoremap v -vnoremap v -vnoremap v - -" Dragvisuals key mappings -vmap DVB_Drag('left') -vmap DVB_Drag('right') -vmap DVB_Drag('down') -vmap DVB_Drag('up') -vmap D DVB_Duplicate() - " Pastetoggle to let Vim paste things without auto stuff set pastetoggle= @@ -150,13 +180,20 @@ augroup vimrcEx autocmd FileType json,c,xml,java,php,python setlocal shiftwidth=4 softtabstop=4 autocmd FileType ruby,haml,eruby,yaml,html,javascript,sass,cucumber setlocal ai sw=2 sts=2 et autocmd FileType make setlocal noet sw=8 sts=8 ts=8 + + " Create files when opened + autocmd BufNewFile * write augroup END """"""""""""" " STATUS LINE """"""""""""" -set statusline=%<[%n]:\ %f\ %5l,%3c\ (%{&ft}) +" set statusline=%<[%n]:\ %f\ %5l,%3c\ (%{&ft}) +set statusline=[%f] " filename +set statusline+=\ [%l,\ %c] "line and column number +set statusline+=\ %y " filetype +set statusline+=\ %{SyntasticStatuslineFlag()} " syntastic errors """"""""""""""""""""" @@ -164,13 +201,17 @@ set statusline=%<[%n]:\ %f\ %5l,%3c\ (%{&ft}) """"""""""""""""""""" let g:syntastic_enable_signs = 0 +let g:syntastic_check_on_open = 1 +let g:syntastic_javascript_checkers = ['eslint'] +let g:syntastic_stl_format='[%t errors, first: %F]' +nnoremap :SyntasticCheck """"""""""""""" " MISC KEY MAPS """"""""""""""" -map y "*y -nmap . +noremap y "*y +nnoremap . " Move around splits with nnoremap j