How to remap repeating commands i.e. ?How can I start vim and then execute a particular command that includes a , from the command line?Key mapping that will invoke the wildmenuSticky shift - or getting <shift> with letter combinationsHow to find out what a key is mapped to?How to remember the most basic commandsColon remap not working for registers(?)How to remap <C-W>hjkl to navigate tmux panes and vim splitsFactoring out commands in vimrc?Getting Shift-Tab to work in VIM Insert modeHow to get the number used before a command as an argument?
Clean sphere separation with a sphere created from a cube
Why is "breaking the mould" positively connoted?
Should homeowners insurance cover the cost of the home?
How can a hefty sand storm happen in a thin atmosphere like Martian?
Is any special diet an effective treatment of autism?
Is disk brake effectiveness mitigated by tyres losing traction under strong braking?
The Adventures of a Chocolate Cookie
Has the Hulk always been able to talk?
Has the United States ever had a non-Christian President?
Page count conversion from single to double-space for submissions
What happens to the electronic movements at absolute 0?
What Kind of Wooden Beam is this
How to remap repeating commands i.e. <number><command>?
When did England stop being a Papal fief?
Does running exec do anything?
Why are oscilloscope input impedances so low?
weird pluperfect subjunctive in Eutropius
How to draw a stack in drawstack/TiKz?
Sheared off exhasut pipe: How to fix without a welder?
All of my Firefox add-ons been disabled suddenly, how can I re-enable them?
When an imagined world resembles or has similarities with a famous world
Why does sound not move through a wall?
What does にとり mean?
Endgame puzzle: How to avoid stalemate and win?
How to remap repeating commands i.e. ?
How can I start vim and then execute a particular command that includes a , from the command line?Key mapping that will invoke the wildmenuSticky shift - or getting <shift> with letter combinationsHow to find out what a key is mapped to?How to remember the most basic commandsColon remap not working for registers(?)How to remap <C-W>hjkl to navigate tmux panes and vim splitsFactoring out commands in vimrc?Getting Shift-Tab to work in VIM Insert modeHow to get the number used before a command as an argument?
By default, vim lets you type 5G (5 then shift + g) to go to line 5. Instead, I don't want to have to press the shift key. Pressing <S-g> does something different than just 5<S-g>. How can I remap a command that takes a number for repeated executions?
Something like: nnoremap <number>g <number>G
key-bindings normal-mode
New contributor
DJTripleThreat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
By default, vim lets you type 5G (5 then shift + g) to go to line 5. Instead, I don't want to have to press the shift key. Pressing <S-g> does something different than just 5<S-g>. How can I remap a command that takes a number for repeated executions?
Something like: nnoremap <number>g <number>G
key-bindings normal-mode
New contributor
DJTripleThreat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
By default, vim lets you type 5G (5 then shift + g) to go to line 5. Instead, I don't want to have to press the shift key. Pressing <S-g> does something different than just 5<S-g>. How can I remap a command that takes a number for repeated executions?
Something like: nnoremap <number>g <number>G
key-bindings normal-mode
New contributor
DJTripleThreat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
By default, vim lets you type 5G (5 then shift + g) to go to line 5. Instead, I don't want to have to press the shift key. Pressing <S-g> does something different than just 5<S-g>. How can I remap a command that takes a number for repeated executions?
Something like: nnoremap <number>g <number>G
key-bindings normal-mode
key-bindings normal-mode
New contributor
DJTripleThreat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
DJTripleThreat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
DJTripleThreat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 2 hours ago
DJTripleThreatDJTripleThreat
1062
1062
New contributor
DJTripleThreat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
DJTripleThreat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
DJTripleThreat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
nnoremap g G
But this will not work well, as there are a lot of key mapping beginning with g. So Vim has to wait a timeout (default 1000 msec) to be sure that no other key is pressed after the g. The g could be the start of 'gg' or 'g$' or ...
So after you pressed 5g nothing will happen for one second. Than the cursor jumps to line 5.
If you want to know about the other key mappings starting with 'g' just enter ':help g' and then hit <tab>. Lots of stuff.
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "599"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
DJTripleThreat is a new contributor. Be nice, and check out our Code of Conduct.
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%2fvi.stackexchange.com%2fquestions%2f19841%2fhow-to-remap-repeating-commands-i-e-numbercommand%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
nnoremap g G
But this will not work well, as there are a lot of key mapping beginning with g. So Vim has to wait a timeout (default 1000 msec) to be sure that no other key is pressed after the g. The g could be the start of 'gg' or 'g$' or ...
So after you pressed 5g nothing will happen for one second. Than the cursor jumps to line 5.
If you want to know about the other key mappings starting with 'g' just enter ':help g' and then hit <tab>. Lots of stuff.
add a comment |
nnoremap g G
But this will not work well, as there are a lot of key mapping beginning with g. So Vim has to wait a timeout (default 1000 msec) to be sure that no other key is pressed after the g. The g could be the start of 'gg' or 'g$' or ...
So after you pressed 5g nothing will happen for one second. Than the cursor jumps to line 5.
If you want to know about the other key mappings starting with 'g' just enter ':help g' and then hit <tab>. Lots of stuff.
add a comment |
nnoremap g G
But this will not work well, as there are a lot of key mapping beginning with g. So Vim has to wait a timeout (default 1000 msec) to be sure that no other key is pressed after the g. The g could be the start of 'gg' or 'g$' or ...
So after you pressed 5g nothing will happen for one second. Than the cursor jumps to line 5.
If you want to know about the other key mappings starting with 'g' just enter ':help g' and then hit <tab>. Lots of stuff.
nnoremap g G
But this will not work well, as there are a lot of key mapping beginning with g. So Vim has to wait a timeout (default 1000 msec) to be sure that no other key is pressed after the g. The g could be the start of 'gg' or 'g$' or ...
So after you pressed 5g nothing will happen for one second. Than the cursor jumps to line 5.
If you want to know about the other key mappings starting with 'g' just enter ':help g' and then hit <tab>. Lots of stuff.
answered 1 hour ago
RalfRalf
3,8651319
3,8651319
add a comment |
add a comment |
DJTripleThreat is a new contributor. Be nice, and check out our Code of Conduct.
DJTripleThreat is a new contributor. Be nice, and check out our Code of Conduct.
DJTripleThreat is a new contributor. Be nice, and check out our Code of Conduct.
DJTripleThreat is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Vi and Vim Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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%2fvi.stackexchange.com%2fquestions%2f19841%2fhow-to-remap-repeating-commands-i-e-numbercommand%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