How to pass selected text in Vim as external program argument?
up vote
0
down vote
favorite
I want select some string in visual mode (v
) and send it to any external program (e.g. tmux send-keys
)
I tried use xargs:
- switch to
v
(visual mode) - select some words
- press
:
getting:'<,'>
- Write
:'<,'>w ! xargs -I {} tmux send-keys -t:0 {}
. Getting whole line passed totmux
xargs
works as expected.
But entire line is always passing instead of my selection.
vim
add a comment |
up vote
0
down vote
favorite
I want select some string in visual mode (v
) and send it to any external program (e.g. tmux send-keys
)
I tried use xargs:
- switch to
v
(visual mode) - select some words
- press
:
getting:'<,'>
- Write
:'<,'>w ! xargs -I {} tmux send-keys -t:0 {}
. Getting whole line passed totmux
xargs
works as expected.
But entire line is always passing instead of my selection.
vim
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I want select some string in visual mode (v
) and send it to any external program (e.g. tmux send-keys
)
I tried use xargs:
- switch to
v
(visual mode) - select some words
- press
:
getting:'<,'>
- Write
:'<,'>w ! xargs -I {} tmux send-keys -t:0 {}
. Getting whole line passed totmux
xargs
works as expected.
But entire line is always passing instead of my selection.
vim
I want select some string in visual mode (v
) and send it to any external program (e.g. tmux send-keys
)
I tried use xargs:
- switch to
v
(visual mode) - select some words
- press
:
getting:'<,'>
- Write
:'<,'>w ! xargs -I {} tmux send-keys -t:0 {}
. Getting whole line passed totmux
xargs
works as expected.
But entire line is always passing instead of my selection.
vim
vim
asked Nov 14 at 17:55
xotonic
13
13
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
Shell windows usually do not support selecting text on anything but the client side, meaning only your terminal window or SSH client will know that you have selected text. Therefore, you will likely be hard pressed to find something that can can tell BASH and contained programs what you have selected.
New contributor
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Shell windows usually do not support selecting text on anything but the client side, meaning only your terminal window or SSH client will know that you have selected text. Therefore, you will likely be hard pressed to find something that can can tell BASH and contained programs what you have selected.
New contributor
add a comment |
up vote
0
down vote
Shell windows usually do not support selecting text on anything but the client side, meaning only your terminal window or SSH client will know that you have selected text. Therefore, you will likely be hard pressed to find something that can can tell BASH and contained programs what you have selected.
New contributor
add a comment |
up vote
0
down vote
up vote
0
down vote
Shell windows usually do not support selecting text on anything but the client side, meaning only your terminal window or SSH client will know that you have selected text. Therefore, you will likely be hard pressed to find something that can can tell BASH and contained programs what you have selected.
New contributor
Shell windows usually do not support selecting text on anything but the client side, meaning only your terminal window or SSH client will know that you have selected text. Therefore, you will likely be hard pressed to find something that can can tell BASH and contained programs what you have selected.
New contributor
New contributor
answered Nov 14 at 18:55
Sith Siri
413
413
New contributor
New contributor
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1375402%2fhow-to-pass-selected-text-in-vim-as-external-program-argument%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown