mirror of
https://github.com/notwa/rc
synced 2024-11-05 04:19:03 -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
|
||||
|
||||
function! TabFour()
|
||||
fu! TabFour()
|
||||
setlocal tabstop=8 expandtab shiftwidth=4 softtabstop=4
|
||||
endfunction
|
||||
endf
|
||||
|
||||
if has('autocmd')
|
||||
augroup tabs " 4 spaces as tabs for various languages
|
||||
|
@ -92,12 +92,17 @@ if has('autocmd')
|
|||
au BufRead,BufNewFile *.json call TabFour()
|
||||
augroup END
|
||||
|
||||
" attempt to preserve cursor position
|
||||
" FIXME: waits for input after running
|
||||
autocmd BufReadPost *
|
||||
\ if line("'\"") > 1 && line("'\"") <= line("$") |
|
||||
\ exe "normal! g`\"" |
|
||||
\ endif
|
||||
" FIXME: this requires input upon starting vim, annoying
|
||||
fu! ResCur() " attempt to preserve cursor position
|
||||
if line("'\"") > 1 && line("'\"") <= line("$")
|
||||
normal! g`"
|
||||
return 1
|
||||
endif
|
||||
endf
|
||||
augroup resCur
|
||||
au!
|
||||
"au BufWinEnter * call ResCur()
|
||||
augroup END
|
||||
endif
|
||||
|
||||
set backspace=eol,start,indent " make backspace useful
|
||||
|
|
Loading…
Reference in a new issue