Doing an action when pressing a key. These are also called key mappings or mappings. For questions about default key bindings, as well as creating or redefining key bindings.
Questions tagged [key-bindings]
1542 questions
118
votes
9 answers
What is the command for "Select All" in Vim and VsVim?
How do I select all the content of a file in Vim and VsVim? Like in other editors Ctrl-A does the job for select all.
Armaan
- 1,283
- 2
- 9
- 6
112
votes
1 answer
How to debug a mapping?
I see a lot of questions on here where a user has a mapping which doesn't work
and most of the time the reasons are pretty similar.
I suggest to make this question a reference for this kind of questions, to give a complete procedure to debug a…
statox
- 49,782
- 19
- 148
- 225
106
votes
2 answers
How can I find out what is set to? And is it possible to remap ?
How can I figure out which key is set as my , and how do I remap it?
krampstudio
- 1,245
- 2
- 9
- 7
36
votes
1 answer
What does z stand for in vim?
I was looking up at tips on screen shifting and came across the following tips:
zz = shift current line to middle of screen
zt = shift current line to top of screen
zb = shift current line to bottom of screen
My question is what is z? What does…
James Franco
- 1,101
- 1
- 9
- 15
31
votes
1 answer
Understanding CTRL-U combination
In this answer I faced the CTRL-U used in function call after : and before the actual function name.
:nnoremap :call append('.', repeat([''],v:count1))
Here is what help says:
CTRL-U Scroll window Upwards in the buffer.…
user3663882
- 713
- 1
- 8
- 11
28
votes
1 answer
Disable but keep
For switching back from Insert mode I'm used to . Now I'm looking to retrain myself to instead of . For that i need to disable to help with the retraining.
The problems is
:inoremap
also disables . For vim…
mxlian
- 545
- 5
- 10
28
votes
2 answers
File Type dependent key mapping
I'm trying to setup mappings for that, depending on the buffer's file type, trigger different functions. For example, if I'm in a Javascript buffer, I want to trigger :TernDef. If I'm in a C buffer, I want it to trigger :YcmCompleter…
domi91c
- 469
- 1
- 5
- 10
27
votes
1 answer
Can I map a Ctrl + upper-case letter separately from Ctrl + lower-case letter?
I am trying to figure out how to navigate windows little quicker, so I would like to map the following:
:nmap :wincmd f
The problem is this remaps the ^f (lower-case f) mapping, which is page down. Is there any way to remap only…
user1135541
- 1,103
- 8
- 22
26
votes
1 answer
What is the difference between "mapped key sequences" and "key codes"? (timeoutlen v ttimeoutlen)
The vim manual says we can use timeoutlen to specify the timeout length of mapped key sequences and can use ttimeoutlen to specify the timeout length of key codes:
A useful setting would be
:set timeout timeoutlen=3000 ttimeoutlen=100
(time out…
Niko Bellic
- 1,804
- 13
- 15
25
votes
5 answers
How to find out what a key is mapped to?
I know that running :map commands without arguments should give me a list of user-defined mappings, but, for example, when I press Ctrl-W Ctrl-I something happens, yet I have no idea what function was just happened as built-in mappings don't appear…
Mad Wombat
- 421
- 1
- 4
- 8
23
votes
4 answers
Clear a line faster than [0][d][$]
Is there a faster way to erase the text on a line than
pressing 0 to jump to the start, then
pressing d$ to delete until the end of the line?
Also, what if I wanted to delete everything except the indentation? Is there a way to do that?
Robin
- 905
- 1
- 6
- 14
18
votes
3 answers
Problem following links of vim's doc (:help) on the terminal
I'm having some trouble reading vim's documentation on the terminal because I can't follow the links that are given.
I quote:
Jump to a subject: Position the cursor on a tag (e.g. |bars|) and
hit CTRL-].
The problem is that i'm using a spanish…
Wylex
- 563
- 4
- 13
16
votes
4 answers
Swap values "true" and "false" via ctrl+a, ctrl+x
I think it would be useful to have possibility to swap true and false values in the code rapidly, with combination ctrl+a or ctrl+x. Is there some plugin for that or something else?
Alexander Myshov
- 2,118
- 15
- 18
15
votes
3 answers
Is it possible to create mappings with parameters?
I have created a few mappings like so:
:nnoremap xyzABC :call SomeFunc('ABC')
:nnoremap xyzDE :call SomeFunc('DE')
:nnoremap xyzFoo18 :call SomeFunc('Foo18')
:nnoremap …
René Nyffenegger
- 2,105
- 20
- 36
14
votes
1 answer
Is it possible to map control forward-slash with vim
I'm wondering if it is possible to map control + forward-slash in vim. The mapping would be for normal mode if that makes a difference.
I have tried but that didn't work.
I also tried looking at the :help keycodes docs but was unable to…
RobStallion
- 319
- 2
- 10