Periodic vimrc update.

This commit is contained in:
Max Bucknell 2015-03-09 13:19:33 +00:00
parent 0367aa8fb9
commit b02fb749a6

View file

@ -8,14 +8,22 @@
execute pathogen#infect() execute pathogen#infect()
"""""""""""""""""""""" """"""""""""""""""""""
" Basic editing config " Basic editing config
"""""""""""""""""""""" """"""""""""""""""""""
set term=xterm-256color
set nocompatible set nocompatible
colorscheme maxbucknell colorscheme maxbucknell
" Line numbering
set relativenumber
set number
" Set editor shell to bash, for Syntastic compatibility
set shell=bash
" Tab config options " Tab config options
set expandtab set expandtab
set tabstop=2 set tabstop=2
@ -29,15 +37,51 @@ set nowritebackup
set noswapfile set noswapfile
" I am lazy and I don't like holding shift. " I am lazy and I don't like holding shift.
map ; : noremap ; :
noremap ;; ; noremap ;; ;
" Paste!
noremap <leader>v "+gp
noremap <leader>V "+gP
noremap <leader>c "+y
noremap <leader>C "+Y
" Quick exit insert mode
inoremap hh <esc>
inoremap <esc> <nop>
" Bad arrow keys
inoremap <up> <nop>
inoremap <down> <nop>
inoremap <left> <nop>
inoremap <right> <nop>
noremap <up> <nop>
noremap <down> <nop>
noremap <left> <nop>
noremap <right> <nop>
" Move lines up and down
noremap - ddp
noremap _ ddkP
" Uppercase an entire word with <c-u>
inoremap <c-u> <esc>viwUa
nnoremap <c-u> viwU
" Show me when my lines are too long " Show me when my lines are too long
call matchadd('ColorColumn', '\%81v', 100) call matchadd('ColorColumn', '\%81v', 100)
" Prevent K from being annoying
noremap K <nop>
" Edit and Reload .vimrc files
nmap <silent> <Leader>ev :e $MYVIMRC<CR>
nmap <silent> <Leader>es :so $MYVIMRC<CR>
" Search options " Search options
" Show partial matches while searching " Show partial matches while searching
set incsearch set incsearch
" Highlight other matches in the file " Highlight other matches in the file
set hlsearch set hlsearch
@ -61,7 +105,9 @@ function! HLNext (blinktime)
endfunction endfunction
" Disable match-paren " 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 " Make searches case sensitive only if an upper case character has been typed
set ignorecase smartcase set ignorecase smartcase
@ -94,9 +140,6 @@ syntax on
" Also load indent files, to automatically do language-dependent indenting. " Also load indent files, to automatically do language-dependent indenting.
filetype plugin indent on filetype plugin indent on
" Change leader to , rather than \
let mapleader=","
" Insert only one space when joining lines that contain sentence-terminating " Insert only one space when joining lines that contain sentence-terminating
" punctuation like `.`. " punctuation like `.`.
set nojoinspaces set nojoinspaces
@ -116,19 +159,6 @@ let g:vim_markdown_folding_disabled=1
" Always show status bar " Always show status bar
set laststatus=2 set laststatus=2
" Swap v and ctrl-v because visual block mode rules
nnoremap v <C-V>
nnoremap <C-V> v
vnoremap v <C-V>
vnoremap <C-V> v
" Dragvisuals key mappings
vmap <expr> <LEFT> DVB_Drag('left')
vmap <expr> <RIGHT> DVB_Drag('right')
vmap <expr> <DOWN> DVB_Drag('down')
vmap <expr> <UP> DVB_Drag('up')
vmap <expr> D DVB_Duplicate()
" Pastetoggle to let Vim paste things without auto stuff " Pastetoggle to let Vim paste things without auto stuff
set pastetoggle=<F2> set pastetoggle=<F2>
@ -150,13 +180,20 @@ augroup vimrcEx
autocmd FileType json,c,xml,java,php,python setlocal shiftwidth=4 softtabstop=4 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 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 autocmd FileType make setlocal noet sw=8 sts=8 ts=8
" Create files when opened
autocmd BufNewFile * write
augroup END augroup END
""""""""""""" """""""""""""
" STATUS LINE " 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_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 <space> :SyntasticCheck<cr>
""""""""""""""" """""""""""""""
" MISC KEY MAPS " MISC KEY MAPS
""""""""""""""" """""""""""""""
map <leader>y "*y noremap <leader>y "*y
nmap <leader>. <c-^> nnoremap <leader>. <c-^>
" Move around splits with <c-hjkl> " Move around splits with <c-hjkl>
nnoremap <c-j> <c-w>j nnoremap <c-j> <c-w>j