Created
September 26, 2011 10:38
-
-
Save ynkdir/1241997 to your computer and use it in GitHub Desktop.
ファイルを開き直したときのカーソルのあやしい移動
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ファイルを開き直したときのカーソルのあやしい移動 | |
# make test file | |
$ vim -u NONE -c "call setline('.', range(1, 100))" -c "wq" foo.txt | |
$ vim -u NONE | |
:edit foo.txt " open file | |
:$ " move to last line | |
:split " split | |
:edit " re-open | |
" window 1 => cursor is on line 1 | |
" window 2 => cursor is on last line | |
$ vim -u NONE | |
:edit foo.txt " open file | |
:$ " move to last line | |
:split " split | |
:edit % " re-open | |
" window 1 => cursor is on last line | |
" window 2 => cursor is on last line | |
$ vim -u NONE | |
:edit foo.txt " open file | |
:$ " move to last line | |
:new % " re-open with split | |
" window 1 => cursor is on last line | |
" window 2 => cursor is on last line | |
$ vim -u NONE | |
:autocmd BufReadPre * : " add event handler | |
:edit foo.txt " open file | |
:$ " move to last line | |
:split " split | |
:edit " re-open | |
" window 1 => cursor is on line 1 | |
" window 2 => cursor is on line 1 | |
$ vim -u NONE | |
:autocmd BufReadPre * : " add event handler | |
:edit foo.txt " open file | |
:$ " move to last line | |
:split " split | |
:edit % " re-open | |
" window 1 => cursor is on last line | |
" window 2 => cursor is on line 1 | |
$ vim -u NONE | |
:autocmd BufReadPre * : " add event handler | |
:edit foo.txt " open file | |
:$ " move to last line | |
:new % " re-open with split | |
" window 1 => cursor is on line 1 | |
" window 2 => cursor is on line 1 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment