[vim] Stabilize cursor while saving and scrolling
This commit is contained in:
parent
f6270ee1e3
commit
cd07963085
1 changed files with 4 additions and 2 deletions
6
vimrc
6
vimrc
|
@ -120,6 +120,8 @@ set equalalways
|
|||
|
||||
" Show a few lines of context around the cursor.
|
||||
set scrolloff=5
|
||||
" Try to keep the cursor in the same column while scrolling
|
||||
set nostartofline
|
||||
|
||||
set autochdir
|
||||
set autoread
|
||||
|
@ -221,10 +223,10 @@ function! DeleteTrailingTWS()
|
|||
if &ft =~ 'diff'
|
||||
return
|
||||
end
|
||||
normal mb
|
||||
let l:view = winsaveview()
|
||||
silent %s/[ \t]*$//g
|
||||
silent %s/\s\+$//ge
|
||||
normal 'b
|
||||
call winrestview(l:view)
|
||||
endfunction
|
||||
"[Make the scripts executable]"
|
||||
function! ChangeScriptMode()
|
||||
|
|
Loading…
Reference in a new issue