How to break a long mapping line into several short lines in vimrc mapping
Clash Royale CLAN TAG#URR8PPP
up vote
5
down vote
favorite
I have a very long vimrc mapping to deal with for example
nnoremap <space>e :exe "!tmux send-keys -t.- 'cd $TEST' Enter"<Cr> :exe "!tmux send-keys -t.- 'source $TEST_NT/bin/activate' Enter"<Cr>
how can I break this long line into several short lines so that I can see everything in one screen
Something like the following style:
nnoremap <space>e
:exe "!tmux send-keys -t.- 'cd $TEST' Enter"<Cr>
:exe "!tmux send-keys -t.- 'source $TEST_NT/bin/activate' Enter"<Cr>
vimrc key-bindings
add a comment |Â
up vote
5
down vote
favorite
I have a very long vimrc mapping to deal with for example
nnoremap <space>e :exe "!tmux send-keys -t.- 'cd $TEST' Enter"<Cr> :exe "!tmux send-keys -t.- 'source $TEST_NT/bin/activate' Enter"<Cr>
how can I break this long line into several short lines so that I can see everything in one screen
Something like the following style:
nnoremap <space>e
:exe "!tmux send-keys -t.- 'cd $TEST' Enter"<Cr>
:exe "!tmux send-keys -t.- 'source $TEST_NT/bin/activate' Enter"<Cr>
vimrc key-bindings
add a comment |Â
up vote
5
down vote
favorite
up vote
5
down vote
favorite
I have a very long vimrc mapping to deal with for example
nnoremap <space>e :exe "!tmux send-keys -t.- 'cd $TEST' Enter"<Cr> :exe "!tmux send-keys -t.- 'source $TEST_NT/bin/activate' Enter"<Cr>
how can I break this long line into several short lines so that I can see everything in one screen
Something like the following style:
nnoremap <space>e
:exe "!tmux send-keys -t.- 'cd $TEST' Enter"<Cr>
:exe "!tmux send-keys -t.- 'source $TEST_NT/bin/activate' Enter"<Cr>
vimrc key-bindings
I have a very long vimrc mapping to deal with for example
nnoremap <space>e :exe "!tmux send-keys -t.- 'cd $TEST' Enter"<Cr> :exe "!tmux send-keys -t.- 'source $TEST_NT/bin/activate' Enter"<Cr>
how can I break this long line into several short lines so that I can see everything in one screen
Something like the following style:
nnoremap <space>e
:exe "!tmux send-keys -t.- 'cd $TEST' Enter"<Cr>
:exe "!tmux send-keys -t.- 'source $TEST_NT/bin/activate' Enter"<Cr>
vimrc key-bindings
asked Sep 5 at 23:03
SLN
1666
1666
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
7
down vote
accepted
You can split your long line by inserting a Vim line continuation character (backslash) at the beginning of each continued line:
nnoremap <space>e
:exe "!tmux send-keys -t.- 'cd $TEST' Enter"<Cr>
:exe "!tmux send-keys -t.- 'source $TEST_NT/bin/activate' Enter"<Cr>
This is explained here: :help line-continuation
.
You should note the comment on leading whitespace, i.e.:
All leading whitespace characters in the line before a backslash are ignored.
Note however that trailing whitespace in the line before it cannot be
inserted freely; it depends on the position where a command is split up
whether additional whitespace is allowed or not.
1
You beat me by a couple of seconds. If you add the VimDoc link, then I'll delete my answer.
â Karl Yngve LervÃ¥g
Sep 6 at 6:45
1
@KarlYngveLervåg: Hmm, hmm. I am reluctant to add a link to online documentation. If I did that now, I would have to do that forever, and I simply dread the effort. I expect you to answer "fair enough" ;-).
â nst0022
Sep 6 at 10:57
1
I saved you the work.
â Karl Yngve LervÃ¥g
Sep 6 at 11:40
1
Fair enough :-).
â nst0022
Sep 6 at 14:47
Thanks both of you:)
â SLN
Sep 6 at 16:24
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
7
down vote
accepted
You can split your long line by inserting a Vim line continuation character (backslash) at the beginning of each continued line:
nnoremap <space>e
:exe "!tmux send-keys -t.- 'cd $TEST' Enter"<Cr>
:exe "!tmux send-keys -t.- 'source $TEST_NT/bin/activate' Enter"<Cr>
This is explained here: :help line-continuation
.
You should note the comment on leading whitespace, i.e.:
All leading whitespace characters in the line before a backslash are ignored.
Note however that trailing whitespace in the line before it cannot be
inserted freely; it depends on the position where a command is split up
whether additional whitespace is allowed or not.
1
You beat me by a couple of seconds. If you add the VimDoc link, then I'll delete my answer.
â Karl Yngve LervÃ¥g
Sep 6 at 6:45
1
@KarlYngveLervåg: Hmm, hmm. I am reluctant to add a link to online documentation. If I did that now, I would have to do that forever, and I simply dread the effort. I expect you to answer "fair enough" ;-).
â nst0022
Sep 6 at 10:57
1
I saved you the work.
â Karl Yngve LervÃ¥g
Sep 6 at 11:40
1
Fair enough :-).
â nst0022
Sep 6 at 14:47
Thanks both of you:)
â SLN
Sep 6 at 16:24
add a comment |Â
up vote
7
down vote
accepted
You can split your long line by inserting a Vim line continuation character (backslash) at the beginning of each continued line:
nnoremap <space>e
:exe "!tmux send-keys -t.- 'cd $TEST' Enter"<Cr>
:exe "!tmux send-keys -t.- 'source $TEST_NT/bin/activate' Enter"<Cr>
This is explained here: :help line-continuation
.
You should note the comment on leading whitespace, i.e.:
All leading whitespace characters in the line before a backslash are ignored.
Note however that trailing whitespace in the line before it cannot be
inserted freely; it depends on the position where a command is split up
whether additional whitespace is allowed or not.
1
You beat me by a couple of seconds. If you add the VimDoc link, then I'll delete my answer.
â Karl Yngve LervÃ¥g
Sep 6 at 6:45
1
@KarlYngveLervåg: Hmm, hmm. I am reluctant to add a link to online documentation. If I did that now, I would have to do that forever, and I simply dread the effort. I expect you to answer "fair enough" ;-).
â nst0022
Sep 6 at 10:57
1
I saved you the work.
â Karl Yngve LervÃ¥g
Sep 6 at 11:40
1
Fair enough :-).
â nst0022
Sep 6 at 14:47
Thanks both of you:)
â SLN
Sep 6 at 16:24
add a comment |Â
up vote
7
down vote
accepted
up vote
7
down vote
accepted
You can split your long line by inserting a Vim line continuation character (backslash) at the beginning of each continued line:
nnoremap <space>e
:exe "!tmux send-keys -t.- 'cd $TEST' Enter"<Cr>
:exe "!tmux send-keys -t.- 'source $TEST_NT/bin/activate' Enter"<Cr>
This is explained here: :help line-continuation
.
You should note the comment on leading whitespace, i.e.:
All leading whitespace characters in the line before a backslash are ignored.
Note however that trailing whitespace in the line before it cannot be
inserted freely; it depends on the position where a command is split up
whether additional whitespace is allowed or not.
You can split your long line by inserting a Vim line continuation character (backslash) at the beginning of each continued line:
nnoremap <space>e
:exe "!tmux send-keys -t.- 'cd $TEST' Enter"<Cr>
:exe "!tmux send-keys -t.- 'source $TEST_NT/bin/activate' Enter"<Cr>
This is explained here: :help line-continuation
.
You should note the comment on leading whitespace, i.e.:
All leading whitespace characters in the line before a backslash are ignored.
Note however that trailing whitespace in the line before it cannot be
inserted freely; it depends on the position where a command is split up
whether additional whitespace is allowed or not.
edited Sep 6 at 11:40
Karl Yngve Lervåg
5,9971029
5,9971029
answered Sep 6 at 6:40
nst0022
1184
1184
1
You beat me by a couple of seconds. If you add the VimDoc link, then I'll delete my answer.
â Karl Yngve LervÃ¥g
Sep 6 at 6:45
1
@KarlYngveLervåg: Hmm, hmm. I am reluctant to add a link to online documentation. If I did that now, I would have to do that forever, and I simply dread the effort. I expect you to answer "fair enough" ;-).
â nst0022
Sep 6 at 10:57
1
I saved you the work.
â Karl Yngve LervÃ¥g
Sep 6 at 11:40
1
Fair enough :-).
â nst0022
Sep 6 at 14:47
Thanks both of you:)
â SLN
Sep 6 at 16:24
add a comment |Â
1
You beat me by a couple of seconds. If you add the VimDoc link, then I'll delete my answer.
â Karl Yngve LervÃ¥g
Sep 6 at 6:45
1
@KarlYngveLervåg: Hmm, hmm. I am reluctant to add a link to online documentation. If I did that now, I would have to do that forever, and I simply dread the effort. I expect you to answer "fair enough" ;-).
â nst0022
Sep 6 at 10:57
1
I saved you the work.
â Karl Yngve LervÃ¥g
Sep 6 at 11:40
1
Fair enough :-).
â nst0022
Sep 6 at 14:47
Thanks both of you:)
â SLN
Sep 6 at 16:24
1
1
You beat me by a couple of seconds. If you add the VimDoc link, then I'll delete my answer.
â Karl Yngve LervÃ¥g
Sep 6 at 6:45
You beat me by a couple of seconds. If you add the VimDoc link, then I'll delete my answer.
â Karl Yngve LervÃ¥g
Sep 6 at 6:45
1
1
@KarlYngveLervåg: Hmm, hmm. I am reluctant to add a link to online documentation. If I did that now, I would have to do that forever, and I simply dread the effort. I expect you to answer "fair enough" ;-).
â nst0022
Sep 6 at 10:57
@KarlYngveLervåg: Hmm, hmm. I am reluctant to add a link to online documentation. If I did that now, I would have to do that forever, and I simply dread the effort. I expect you to answer "fair enough" ;-).
â nst0022
Sep 6 at 10:57
1
1
I saved you the work.
â Karl Yngve LervÃ¥g
Sep 6 at 11:40
I saved you the work.
â Karl Yngve LervÃ¥g
Sep 6 at 11:40
1
1
Fair enough :-).
â nst0022
Sep 6 at 14:47
Fair enough :-).
â nst0022
Sep 6 at 14:47
Thanks both of you:)
â SLN
Sep 6 at 16:24
Thanks both of you:)
â SLN
Sep 6 at 16:24
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fvi.stackexchange.com%2fquestions%2f17302%2fhow-to-break-a-long-mapping-line-into-several-short-lines-in-vimrc-mapping%23new-answer', 'question_page');
);
Post as a guest
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
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
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