I am in visual selection and encouter a problem finding the previous
tab or space
norm vF y
My aim is to visual select a word and then copy it.
Thanks
A couple items: first, you may want to read up on text
objects...there are "inner word" and "inner WORD" text objects
that may simplify your selection:
norm yiw
without needing to move around the end-point anchors of a visual
selection.
Additionally, for scripting purposes, you may be interested in
expand('<cword>')
For more info, you can read at
:help iw
:help text-object
:help expand()
-tim
I will use expand('<cword>') but how can I expand something like
that :
namespace::func
namespace:~bar
You already have the better way to accomplish your task (using one of
the word text objects, :help text-objects) however in general ":normal
vF " ought to work to select text from the cursor up to and including
the previous space. What was it doing instead?
eg : cursor is on (
void\tfoo:bar (
void foo:bar (
'norm hvF ' works only in case 2, I would like the same command to
work on both cases.
Thanks
On Jan 5, 9:33 am, epanda <callingel...@hotmail.fr> wrote:
> eg : cursor is on (
>
> void\tfoo:bar (
> void foo:bar (
>
> 'norm hvF ' works only in case 2, I would like the same command to
> work on both cases.
Oh, so it would fail when non-space whitespace was the word separator.
Then, how about ":norm vb" or ":norm v?\s"? Of course, if all you want
is to select a full word, the best would be using <cword> or <cWORD>
or the iw text object the iW text object.