mirror of
https://github.com/notwa/rc
synced 2024-11-05 06:39:02 -08:00
refactor and disable resCur
This commit is contained in:
parent
764df407b5
commit
75a0479ac3
1 changed files with 13 additions and 8 deletions
21
vimrc
21
vimrc
|
@ -81,9 +81,9 @@ set nolinebreak
|
||||||
|
|
||||||
set tabstop=8 shiftwidth=8 smarttab " 8 space tabs
|
set tabstop=8 shiftwidth=8 smarttab " 8 space tabs
|
||||||
|
|
||||||
function! TabFour()
|
fu! TabFour()
|
||||||
setlocal tabstop=8 expandtab shiftwidth=4 softtabstop=4
|
setlocal tabstop=8 expandtab shiftwidth=4 softtabstop=4
|
||||||
endfunction
|
endf
|
||||||
|
|
||||||
if has('autocmd')
|
if has('autocmd')
|
||||||
augroup tabs " 4 spaces as tabs for various languages
|
augroup tabs " 4 spaces as tabs for various languages
|
||||||
|
@ -92,12 +92,17 @@ if has('autocmd')
|
||||||
au BufRead,BufNewFile *.json call TabFour()
|
au BufRead,BufNewFile *.json call TabFour()
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
" attempt to preserve cursor position
|
" FIXME: this requires input upon starting vim, annoying
|
||||||
" FIXME: waits for input after running
|
fu! ResCur() " attempt to preserve cursor position
|
||||||
autocmd BufReadPost *
|
if line("'\"") > 1 && line("'\"") <= line("$")
|
||||||
\ if line("'\"") > 1 && line("'\"") <= line("$") |
|
normal! g`"
|
||||||
\ exe "normal! g`\"" |
|
return 1
|
||||||
\ endif
|
endif
|
||||||
|
endf
|
||||||
|
augroup resCur
|
||||||
|
au!
|
||||||
|
"au BufWinEnter * call ResCur()
|
||||||
|
augroup END
|
||||||
endif
|
endif
|
||||||
|
|
||||||
set backspace=eol,start,indent " make backspace useful
|
set backspace=eol,start,indent " make backspace useful
|
||||||
|
|
Loading…
Reference in a new issue