Friday, February 25, 2011

Re: Opening a line with vimscript - autoindent ignored

* Tim Johnson <tim@johnsons-web.com> [110225 07:55]:
> using vim 7.2 huge on mint 10.0
> I have a vimscript to handle code expansion from keywords.
> Here is the relevant snippet
> """"""""""""""""""""""""""""""""""""""""""""""""""""
> elseif wrd == "lv0"
> exe "normal! bdwaargs = load.args(kws) ## dict,member='kwd',module='config'\<Esc>0wo"
> exe "normal! acontent = load.view(args) ## '()' => string \<Esc>0w"
> """"""""""""""""""""""""""""""""""""""""""""""""""""
> If this is executed, I get something like this:
>
> args = load.args(kws) ## dict,member='kwd',module='config'
> content = load.view(args) ## '()' => string
>
> The second line is not indented.
> `autoindent' is set. If I were to type the two lines of code, and were
> I to hit <Esc> at the end of the first line and then
> o
> The alignment would be retained.
I think to answer my own question, I have been 'overthinking' the
problem.
elseif wrd == "lv0"
exe "normal! bdwaargs = load.args(kws) ## dict,member='kwd',module='config'"
exe "normal! ocontent = load.view(args) ## '()' => string\<Esc>^"
Not entirely sure just why <duh!>, but among other things the 'a' on the
should not have been there, as well as moving 'o' to the second command.
Any further comments are still welcome.
--
Tim
tim at johnsons-web.com or akwebsoft.com
http://www.akwebsoft.com

--
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

No comments:

Post a Comment