Tuesday, March 11, 2014

basic question on vim scripting

I'm playing a bit with a vim script, and I'm stuck on this problem:

if exists('b:current_line')
echom "normal! ".b:current_line."G"
exe "normal! ".b:current_line."G"
echom 'line is '.line('.')
endif

If I run the script and then do :messages, the output is this one:

normal! 6G
line is 1

and I can't understand why the cursor doesn't move... (I'm not even sure this is the correct way to move, as google isn't helping me much)

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: