On Tuesday, May 14, 2013 7:18:34 AM UTC-5, Charles Smith wrote:
But I guess it's just not possible to invoke a vim function from
within \{} - or maybe it's a lost art
What gave you that idea?
You tried using CTRL-R to get the expression register in a mapping, which can
be done,
On May 13, 12:14 am, Marc Weber marco-owe...@gmx.de wrote:
Excerpts from Charles Smith's message of Sun May 12 12:08:15 +0200 2013:
In order to be able to go to the next command in python, I'd like to
have a mapping as follows, but I can't get it to work:
map ]0 /^\s\{0,^R=wincol()}\S^M
Basically, my intent is to make up for the lack of brace-delineated
blocks - in C or perl, I could just put my cursor on the opening
brace, hit % and be at the end. Since I have no braces in python,
this is a poor-man's version of that.
On May 13, 9:20 am, Charles Smith
:h indent()
returns indentation of current line.
Thus
:map X /^c-r=repeat(' ', indent(line('.')))cr\Scr
or such might do it.
A second solution would be using folding.
In the end - you should try using better search terms.
Eg googling for indendation based movement vim
Thanks Marc.
Unfortunately, I couldn't get your suggestion to work:
:map ]0 /^^R=repeat(' ', indent(line('.')))\S
=repeat(' ', indent(line('.')))\S
E15: Invalid expression: repeat(' ', indent(line('.')))\S
and using the original mapping, modified to use the indent() function
:map ]0
Reread my message. I told you many ways to reach your goal.
One was clear:
http://vim.wikia.com/wiki/Move_to_next/previous_line_with_same_indentation
I didn't test my mapping, yes - you may have to understand the pieces to
make it work - so if you have trouble understanding the pieces ask
Right, Marc, I see you're a busy man. Hopefully somebody else will
feel intrigued by the problem and jump in.
On May 13, 12:46 pm, Marc Weber marco-owe...@gmx.de wrote:
Reread my message. I told you many ways to reach your goal.
One was
In order to be able to go to the next command in python, I'd like to
have a mapping as follows, but I can't get it to work:
map ]0 /^\s\{0,^R=wincol()}\S^M
I'm not getting the evaluation correct. Can someone help?
Excerpts from Charles Smith's message of Sun May 12 12:08:15 +0200 2013:
In order to be able to go to the next command in python, I'd like to
have a mapping as follows, but I can't get it to work:
map ]0 /^\s\{0,^R=wincol()}\S^M
Can you retry telling us what you mean by next command?
In order to be able to go to the next command in python, I'd like to
have a mapping as follows, but I can't get it to work:
map ]0 /^\s\{0,^R=wincol()}\S^M
I'm not getting the evaluation correct. Can someone help?
10 matches
Mail list logo