1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-06-30 19:07:11 -07:00

binds and cleanup

This commit is contained in:
Connor Olding 2015-03-09 10:02:16 -07:00
parent 1f91a521cf
commit 7283d558fa

View File

@ -1,4 +1,6 @@
" vim:cc=79,39 " vim:cc=79,39
" make vim unusable for anyone else
set nocompatible " screw vi set nocompatible " screw vi
if has('multi_byte') if has('multi_byte')
@ -21,7 +23,6 @@ if has("win32")
" something/vim/after " something/vim/after
let $MYVIMRC=expand('<sfile>') let $MYVIMRC=expand('<sfile>')
let rcvim=expand('<sfile>:p:h:h').'/vim' let rcvim=expand('<sfile>:p:h:h').'/vim'
let &backupdir=rcvim.'/backup'
if !exists('win32_once') if !exists('win32_once')
let win32_once=1 let win32_once=1
@ -29,14 +30,14 @@ if has("win32")
let &runtimepath=rcvim.','.&runtimepath.','.rcvim.'/after' let &runtimepath=rcvim.','.&runtimepath.','.rcvim.'/after'
endif endif
else else
set backupdir=~/.vim/backup " put tilde files elsewhere let rcvim='~/.vim'
endif endif
try let &backupdir=rcvim.'/backup' " stash tilde files elsewhere
call mkdir(&backupdir, "p") " the double slash at the end dumps the path of the file for uniqueness
catch E739 let &directory=rcvim.'/swp//' " screw swap files too
" it probably succeeded anyway try | call mkdir(&backupdir, "p") | catch /E739/ | endtry
endtry try | call mkdir(&directory, "p") | catch /E739/ | endtry
if (&term =~ "^xterm") " enable colors on any xterm if (&term =~ "^xterm") " enable colors on any xterm
let &t_Co=256 let &t_Co=256
@ -60,10 +61,7 @@ if has('gui_running')
cd $HOME " might not be ideal... cd $HOME " might not be ideal...
endif endif
try try | colorscheme Tomorrow-Night | catch /E185/ | endtry
colorscheme Tomorrow-Night
catch E185
endtry
set colorcolumn=79 set colorcolumn=79
@ -95,7 +93,7 @@ set smartcase " except when uppercase is used
set infercase " use existing case when ins-completing set infercase " use existing case when ins-completing
set foldmethod=marker set foldmethod=marker
set foldlevelstart=99 " start with everything unfolded set foldclose= " start with everything unfolded
if 0 if 0
set autoindent " when creating newline, use same indent set autoindent " when creating newline, use same indent
@ -115,7 +113,7 @@ set ffs=unix,dos " ffs indeed
set tabstop=8 shiftwidth=8 smarttab " 8 space tabs set tabstop=8 shiftwidth=8 smarttab " 8 space tabs
fu! TabFour() fu! TabFour()
setlocal tabstop=8 expandtab shiftwidth=4 softtabstop=4 setlocal tabstop=8 shiftwidth=4 expandtab softtabstop=4
endf endf
fu! TabTwo() fu! TabTwo()
@ -154,9 +152,8 @@ endif
set backspace=eol,start,indent " make backspace useful set backspace=eol,start,indent " make backspace useful
if has('wildmenu') " tab completion in command-line
set wildmenu " tab completion in command-line if has('wildmenu') | set wildmenu | endif
endif
" easy indent/unindent " easy indent/unindent
nn <tab> >> nn <tab> >>
@ -170,35 +167,31 @@ vn <silent> <s-tab> <gv
"nn <c-cr> dd "nn <c-cr> dd
" oh wait, terminals don't do that... " oh wait, terminals don't do that...
nn <F5> :w<cr> fu! Inn(q)
nn <F8> :e<cr> let args=split(a:q, '^\s*\(<[^>]\+>\s\+\)\+\zs')
nn <F10> :q<cr> exec 'nn '.args[0].' '.args[1]
nn <c-F5> :w!<cr> exec 'ino '.args[0].' <c-o>'.args[1]
nn <c-F8> :e!<cr> endf
nn <c-F10> :q!<cr> com! -nargs=+ Inn call Inn(<q-args>)
nn <s-F5> :wall<cr>
"nn <s-F8> :eall<cr>
nn <s-F10> :qall<cr>
" bad habits Inn <F5> :w<cr>
no <up> <nop> Inn <F8> :e<cr>
no <down> <nop> Inn <F10> :bd<cr>
no <left> <nop> Inn <c-F5> :w!<cr>
no <right> <nop> Inn <c-F8> :e!<cr>
ino <up> <nop> Inn <c-F10> :bd!<cr>
ino <down> <nop> Inn <s-F5> :wall<cr>
ino <left> <nop> Inn <s-F8> :tab ball<cr>
ino <right> <nop> Inn <s-F10> :qall<cr>
" good habits " good habits
nn <c-up> <c-y> Inn <c-up> <c-y>
nn <c-down> <c-e> Inn <c-down> <c-e>
ino <c-up> <c-o><c-y> Inn <silent> <c-s-up> :m-2<cr>
ino <c-down> <c-o><c-e> Inn <silent> <c-s-down> :m+1<cr>
nn <silent> <c-s-up> :m-2<cr>
nn <silent> <c-s-down> :m+1<cr> " hide search highlighting
ino <silent> <c-s-up> <c-o>:m-2<cr> Inn <silent> <c-]> :nohls<enter>
ino <silent> <c-s-down> <c-o>:m+1<cr>
" rebind annoying things " rebind annoying things
" reflow text " reflow text
@ -206,19 +199,17 @@ nn Q gq
" split lines (opposite of J) " split lines (opposite of J)
nn K i<cr><esc>k$ nn K i<cr><esc>k$
vn K <nop> vn K <nop>
" hide search highlighting
nn <silent> <c-]> :nohls<enter>
ino <silent> <c-]> <c-o>:nohls<enter>
" follow tag " follow tag
nn <bar> <c-]> nn <bar> <c-]>
" delete line " delete line
nn D dd nn D dd
" this frees up x and X for use " this frees up x and X for use if you like
set <s-Del>=[3;2~ set <s-Del>=[3;2~
nn <s-Del> X nn <s-Del> X
" unfollow your leaders " unfollow your leaders
"ino <c-\> <C-o><Leader>
nn <Leader>p "0p nn <Leader>p "0p
nn <Leader>P "0P nn <Leader>P "0P
nn <Leader>e :tabe nn <Leader>e :tabe
@ -235,7 +226,4 @@ else
endif endif
endif endif
try try | execute pathogen#infect() | catch /E117/ | endtry
execute pathogen#infect()
catch E117
endtry