Vim config improvements

pull/2/head
Bodaniel Jeanes 2011-02-18 11:45:40 +10:00
parent 5a7eb993cf
commit dbf283d415
2 changed files with 18 additions and 19 deletions

View File

@ -4,7 +4,7 @@ set guioptions+=Rr " Turn on scroll bars
if has("gui_macvim") if has("gui_macvim")
" macmenu Window.Toggle\ Full\ Screen\ Mode key=<D-CR> " macmenu Window.Toggle\ Full\ Screen\ Mode key=<D-CR>
set transparency=12 set transparency=7
" Fullscreen takes up entire screen " Fullscreen takes up entire screen
set fuoptions=maxhorz,maxvert set fuoptions=maxhorz,maxvert

View File

@ -63,7 +63,7 @@ function! s:CdIfDirectory(directory)
let directory = explicitDirectory || empty(a:directory) let directory = explicitDirectory || empty(a:directory)
if explicitDirectory if explicitDirectory
exe "cd " . a:directory exe "ChangeDirectory " . a:directory
endif endif
if directory if directory
@ -209,25 +209,10 @@ au! BufRead,BufNewFile *.txt call s:setupWrapping()
" allow backspacing over everything in insert mode " allow backspacing over everything in insert mode
set backspace=indent,eol,start set backspace=indent,eol,start
" Window manipulation
"map tt <C-w>
map <C-w><Backspace> <Esc>:wincmd h
map <C-w><Space> <Esc>:wincmd l
map <C-w><S-Backspace> <Esc>:wincmd H
map <C-w><S-Space> <Esc>:wincmd L
" Opens an edit command with the path of the currently edited file filled in " Opens an edit command with the path of the currently edited file filled in
" Normal mode: <Leader>e " Normal mode: <Leader>e
map <Leader>e :e <C-R>=expand("%:p:h") . "/" <CR> map <Leader>e :e <C-R>=expand("%:p:h") . "/" <CR>
" Colemak
"
" * Switch 'h' and 'n' (so 'up' is on top of 'down').
" * Use <Space> and <Backspace> for <Right> and <Left>, instead (and disable 'j'
" and 'l' which are where 'y' and 'u' are in in QWERTY)
"nmap h <Up>
"nmap k <Down>
" Nicer split controls " Nicer split controls
map <C-_> :split<CR> map <C-_> :split<CR>
map <C-\> :vsplit<CR> map <C-\> :vsplit<CR>
@ -276,6 +261,8 @@ function! s:align()
endif endif
endfunction endfunction
autocmd! FocusLost * :wa
" Prevents '<Plug>DiscretionaryEnd' being inserted when pressing <Enter> in " Prevents '<Plug>DiscretionaryEnd' being inserted when pressing <Enter> in
" insert mode on new files. Blame SuperTab " insert mode on new files. Blame SuperTab
let g:SuperTabCrMapping = 0 let g:SuperTabCrMapping = 0
@ -307,8 +294,11 @@ let g:syntastic_enable_signs = 1
let g:syntastic_auto_loc_list = 0 let g:syntastic_auto_loc_list = 0
" Indent Guides " Indent Guides
let g:indent_guides_color_change_percent = 10 let g:indent_guides_color_change_percent = 7
autocmd! VimEnter * :IndentGuidesEnable autocmd! VimEnter * IndentGuidesEnable
" snipMate config
let g:snips_author = 'Bodaniel Jeanes'
" Disable arrow keys " Disable arrow keys
nnoremap <up> <nop> nnoremap <up> <nop>
@ -320,10 +310,19 @@ inoremap <down> <nop>
inoremap <left> <nop> inoremap <left> <nop>
inoremap <right> <nop> inoremap <right> <nop>
" Easy window management
map <C-h> <C-w>h
map <C-k> <C-w>k
map <C-j> <C-w>j
map <C-l> <C-w>l
" Source vimrc after saving it " Source vimrc after saving it
autocmd! BufWritePost .vimrc,vimrc source $MYVIMRC | NERDTreeToggle | NERDTreeToggle autocmd! BufWritePost .vimrc,vimrc source $MYVIMRC | NERDTreeToggle | NERDTreeToggle
" Quick editing of common dot-files
map <Leader>vv :edit $MYVIMRC<CR> map <Leader>vv :edit $MYVIMRC<CR>
map <Leader>gg :edit $MYGVIMRC<CR> map <Leader>gg :edit $MYGVIMRC<CR>
map <Leader>.. :ChangeDirectory ~/.config<CR>:wincmd l<CR>:enew<CR>
if filereadable(expand('~/.vimrc.local')) if filereadable(expand('~/.vimrc.local'))
source ~/.vimrc.local source ~/.vimrc.local