How do you insert literal control chars in vim on Mac?
Clash Royale CLAN TAG#URR8PPP
up vote
3
down vote
favorite
How do you insert literal control characters in vi on Mac?
For example what is the Mac equivalent of
Unix ^V^M
Windows ^Q^M (in vim)
to insert a r into a substitution string?
macos command-line open-source vi
add a comment |Â
up vote
3
down vote
favorite
How do you insert literal control characters in vi on Mac?
For example what is the Mac equivalent of
Unix ^V^M
Windows ^Q^M (in vim)
to insert a r into a substitution string?
macos command-line open-source vi
add a comment |Â
up vote
3
down vote
favorite
up vote
3
down vote
favorite
How do you insert literal control characters in vi on Mac?
For example what is the Mac equivalent of
Unix ^V^M
Windows ^Q^M (in vim)
to insert a r into a substitution string?
macos command-line open-source vi
How do you insert literal control characters in vi on Mac?
For example what is the Mac equivalent of
Unix ^V^M
Windows ^Q^M (in vim)
to insert a r into a substitution string?
macos command-line open-source vi
edited Sep 2 at 1:35


bmike♦
149k45265583
149k45265583
asked Sep 2 at 1:17
user3557732
464
464
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
6
down vote
It's the same like in Unix/Linux:
^V^M
But, if you want to use the character in a substitution string, then you should write it like it is, r
, e.g.
:%s/blabla/r/
Thank you. The trick for others who are trying to de-Windows their brains, is to use the actual ^ (control) key not the command key that you think is the mac version of the control key (because it usually is) and to use the actual M key for ^M not the Enter key that works equally well in vim on Windows.
– user3557732
Sep 2 at 11:47
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
6
down vote
It's the same like in Unix/Linux:
^V^M
But, if you want to use the character in a substitution string, then you should write it like it is, r
, e.g.
:%s/blabla/r/
Thank you. The trick for others who are trying to de-Windows their brains, is to use the actual ^ (control) key not the command key that you think is the mac version of the control key (because it usually is) and to use the actual M key for ^M not the Enter key that works equally well in vim on Windows.
– user3557732
Sep 2 at 11:47
add a comment |Â
up vote
6
down vote
It's the same like in Unix/Linux:
^V^M
But, if you want to use the character in a substitution string, then you should write it like it is, r
, e.g.
:%s/blabla/r/
Thank you. The trick for others who are trying to de-Windows their brains, is to use the actual ^ (control) key not the command key that you think is the mac version of the control key (because it usually is) and to use the actual M key for ^M not the Enter key that works equally well in vim on Windows.
– user3557732
Sep 2 at 11:47
add a comment |Â
up vote
6
down vote
up vote
6
down vote
It's the same like in Unix/Linux:
^V^M
But, if you want to use the character in a substitution string, then you should write it like it is, r
, e.g.
:%s/blabla/r/
It's the same like in Unix/Linux:
^V^M
But, if you want to use the character in a substitution string, then you should write it like it is, r
, e.g.
:%s/blabla/r/
edited Sep 2 at 1:46
answered Sep 2 at 1:30
t0r0X
1668
1668
Thank you. The trick for others who are trying to de-Windows their brains, is to use the actual ^ (control) key not the command key that you think is the mac version of the control key (because it usually is) and to use the actual M key for ^M not the Enter key that works equally well in vim on Windows.
– user3557732
Sep 2 at 11:47
add a comment |Â
Thank you. The trick for others who are trying to de-Windows their brains, is to use the actual ^ (control) key not the command key that you think is the mac version of the control key (because it usually is) and to use the actual M key for ^M not the Enter key that works equally well in vim on Windows.
– user3557732
Sep 2 at 11:47
Thank you. The trick for others who are trying to de-Windows their brains, is to use the actual ^ (control) key not the command key that you think is the mac version of the control key (because it usually is) and to use the actual M key for ^M not the Enter key that works equally well in vim on Windows.
– user3557732
Sep 2 at 11:47
Thank you. The trick for others who are trying to de-Windows their brains, is to use the actual ^ (control) key not the command key that you think is the mac version of the control key (because it usually is) and to use the actual M key for ^M not the Enter key that works equally well in vim on Windows.
– user3557732
Sep 2 at 11:47
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%2fapple.stackexchange.com%2fquestions%2f335369%2fhow-do-you-insert-literal-control-chars-in-vim-on-mac%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