Let's say I want to jump to a particular position in a file in an existing Vim server:
This command jumps to the correct line, but not the correct column, leaving the cursor at the start of the line:
gvim.exe --servername VimServer --remote-silent +"normal! 5G5|"
If I add in an :execute
, however, the command works as desired:
gvim.exe --servername VimServer --remote-silent +"execute 'normal! 5G5|'"
Note that removing the 5G
line movement does not affect the issue. normal! 5|
jumps to the start of the current line. execute 'normal! 5|'
jumps to the fifth column.
I also tried a few other motions. These will all leave the cursor at the start of the (correct) line unless run with :execute
:
normal! w
normal! l
normal! j
normal! )
normal! %
What's going on?