We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [normal-mode]

Command mode is the initial mode. Vim calls this Normal mode. Not to be confused with command-line-mode, which is what you get after you press :, /, ?, or !

Filter by
Sorted by
Tagged with
6
votes
1answer
2k views

Define word boundaries

I use, e.g., dw to delete a word based on word boundaries defined by changing character classes, so that this command applied on abc,def,ghi will result in ,def,ghi. (So far so good, and it worked for ...
9
votes
1answer
150 views

How can I prevent (or at least prompt to confirm) absurdly large numbers from being used to prefix commands?

It doesn't happen as often as you'd think, but it happens occasionally, and I don't even own a cat. Basically if you mash the number row or numpad and then happen to hit a keycombo that triggers a ...
10
votes
2answers
4k views

Go to last non-whitespace character of previous/next line?

I like the - and <C-M> normal-mode keys for going to the first non-whitespace character of the previous/next line. Are there coresponding keys for going to the last non-whitespace character on ...
7
votes
1answer
164 views

Is it possible to make a numerically-prefixed hotkey run a function that many times?

I find that if you enter a numeric prefix prior to executing an ex command, the convention that it applies is to set up the command to prep an operation across a line range. It is explained in the ...
6
votes
3answers
719 views

How can I delete a function call, leaving its inner content intact?

Let's say I have a line like this: a = x(y(z)); And I want to change it to: a = y(z); What's the most efficient way to do this?
18
votes
1answer
2k views

How can I map d[count]d?

N.B. This is not a duplicate of How does the "d3fg" command work? Please read it before voting to close! I've come to a bit of an impasse in my quest to get small deletions work like big ...
9
votes
4answers
2k views

How to delete content backwards until “=” at the previous line?

I use an example of javascript code: 1 var a = 1; 2 var b = |{}; The cursor is at the position of |( on the character "{" when the cursor shape is block), I find out that I want a ...
3
votes
2answers
135 views

How to increase the 2nd number on a line

One thing I need to do frequently is to increment the 2nd number on a line. Increasing the first is very comfortable by just pressing Control-a, but I just can't find a nice way to increase the 2nd. ...
11
votes
1answer
540 views

How do I shift the line indent to a specific value?

Many times I run across a situation where a line is not indented properly. Ether through a paste, bad / not preferred indent plugin, or most often extra spaces offsetting the indent value. I usually ...
3
votes
1answer
1k views

How to display invoked keystrokes and commands in normal mode? [duplicate]

How I can activate option which will display my pressed keystrokes or executed commands in normal mode on the screen? Especially it would be good, if it would give a slight info what specific ...
32
votes
2answers
2k views

Can I see the history of key presses in normal mode?

I know that Vim keeps history for ex commands, searches, jump locations, changes, and possibly others. With showcmd set, Vim also shows you what keys you have entered so far for a normal mode command,...
12
votes
7answers
2k views

Can vim automatically turn off Capslock when returning to normal mode?

After almost every time I type something in caps, I forget to turn off capslock when returning to normal mode. I then try to move the cursor and end up joining a bunch of lines and a lot of other ...