Questions tagged [key-bindings]

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.

Filter by
Sorted by
Tagged with
11
votes
2answers
296 views

Quickly switch between fonts at runtime

While fonts can be manually selected in GVim from the menu, I have a few preferred fonts I would like to switch between depending on the task at hand (small bitmap, larger OTF... etc). Is there a way ...
6
votes
1answer
304 views

Disable vim-surround in a netrw buffer

Is there a way to disable a plugin (or a set of keymaps) on a specific filetype? vim-surround causes a delay in netrw when pressing d to create a new directory. I'm thinking that this might be ...
2
votes
1answer
91 views

How to jump to the location which [I points to?

I've installed node plugin, which give possibility to display all lines that contain the keyword under the cursor using [I hotkey. It looks like this: Is there possibility to jump to them?
1
vote
1answer
673 views

Vim printing strange characters when hit "home", "end" stc

Why vim keep printing strange characters when I hit non-characters key? Insert prints [2~ Delete prints [3~ Page Up prints [5~ Page Down prints [6~ Home prints OH End prints OF Arrow Up prints OA ...
8
votes
1answer
3k views

How to change the value of timeout for one key command?

What I want To temporarily change the timeout value for certain key commands Where I've looked From :help 'timeout' I have : The timeout only happens when the 'timeout' and 'ttimeout' options tell so. ...
6
votes
1answer
2k views

Triggering UltiSnips with enter

Is there any possible way to do expand trigger in UltiSnips with enter? I've tried <Enter>, <Return>, and <CR>. It works to trigger but doesn't work for new line. And I've tried to &...
4
votes
2answers
846 views

How to force quit if input was stdin?

I have q mapped to :qenter Q mapped to <esc>:qa!enter which means quit, unless something needs to be saved just quit My meanings for these keys clashes with vim's idea that stdin needs to be ...
10
votes
2answers
2k views

Create mappings that only apply to diff mode

In my vimrc I have <C-H>, <C-J>, <C-K> and <C-L> mapped to navigate between split windows in normal mode. When I use diff mode I only ever have windows in vertical splits, so ...
5
votes
2answers
236 views

Translating Keymaps to Ex Commands

Say that I have some semi-complex keymaps like the following: nnoremap <Leader>s :%s/\s\+$//e nnoremap <Leader>u mz:r!uuidgen<CR>dW"_dd`zp" nnoremap <Leader>d g/\v"([^"]|\n)*"\...
1
vote
1answer
38 views

Cycle between keyword & user defined completion with C-N

I use the following mapping to initiate keyword completion, followed by user defined completion: inoremap <expr> <c-n> pumvisible() ? "\<c-x>\<c-o>" : "\<c-n>" How can ...
2
votes
1answer
114 views

Where to find the time interval for a key combination to work?

the key combination dw is to delete a word. I've also defined my own key combination, e.g. <leader>j to move to a window below. My question is how much time is left between the first and second ...
3
votes
2answers
2k views

How to remap “ctrl+w+shift+f” to “gf” in vim to go to line of file under cursor in split window?

In a compilation log file whenever I get error it shows full path from root directory and line number. After opening file in vim say following is the content of file, .. .. Dir1/Dir2/src/ipv4.c 1223 ...
4
votes
1answer
1k views

remap not working; <NL> in appears in other binding

I'm trying to remap Control + [hjkl] to navigate among splits, by setting this in my rc file: " splits navigation nnoremap <C-h> <C-w>h nnoremap <C-j> <C-w>j nnoremap <C-k&...
5
votes
1answer
79 views

Is it possible to use registers in Operator-pending mode? If not, why?

In Normal and Visual modes you can execute a motion or other operation using the contents of a register with @. This @ key does not work however in Operator-pending mode. Is there another way to use ...
3
votes
2answers
145 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. ...
4
votes
0answers
572 views

j and k keys not working like they should [duplicate]

I'm using gVim on my Windows 8.1 computer with a standard QWERTY keyboard, and neither the j and k keys, nor the Up and Down arrow keys let me move up and down in my text field while in normal mode. h ...
9
votes
2answers
615 views

How can I create a pseudo insert mode with a different keymap?

I am in the slightly unusual position of using two different keyboard layouts on a regular basis (Programmers-Dvorak and Turkish-F). These layouts are quite different from each-other and I am only ...
3
votes
4answers
675 views

Can Escape be disabled in insert mode?

I'm trying to retrain my fingers to refrain from using Escape so often. Can I disable Escape when I'm in insert mode, leaving just Control+[ and Control+C as the only ways to return to normal mode? ...
2
votes
1answer
457 views

Why doesn't `nmap <tab> v>` work?

In my vimrc file, nmap <tab> v> doesn't work. But other key binding, such as nmap <s-tab> v< vmap <tab> >gv vmap <s-tab> <gv Do work. I tried to search for <...
32
votes
1answer
11k views

What are the differences between the map, noremap, abbrev and noreabbrev commands?

These commands transform one set of keystrokes to another in some way, but I am somewhat fuzzy on which one is most appropriate for some situation. In addition, there are the ! variants of them as ...
87
votes
2answers
41k views

How can I find out what <Leader> is set to? And is it possible to remap <Leader>?

How can I figure out which key is set as my <Leader>, and how do I remap it?
9
votes
2answers
665 views

Is there a way to alias `:w'` to `:w`, to avoid creating files named '?

Occasionally, my pinky will graze the ' key while reaching for enter, resulting in :w'<Enter>. I've tried: cabbrev w' :w cabbrev w\' :w cabbrev "w'" :w None of them work. Is there a way to ...
27
votes
2answers
8k views

How can I redefine plugin key mappings?

I have installed a plugin that doesn't provide a mechanism to disable the key mappings it defines. I want to redefine one of the mappings (<leader>cc) defined by the plugin for my own pursope, I'...
8
votes
1answer
540 views

Run shell commands on current file based on file extension

I'm currently doing a lot of work with both Ruby and JavaScript. I know that I can run my Ruby files with :! ruby % and likewise my JavaScript with :! node %, and that I can bind either of those to, ...
10
votes
1answer
215 views

Is there a <C-w> for WORDs?

Pressing Ctrl-w in Insert mode will delete the previous word. It is equivalent to Ctrl-Backspace in Windows, and Opt-Delete in OS X, and really speeds up typing. Vim has the separate concepts of word ...
19
votes
1answer
297 views

Figure out which plugin is responsible for a key binding

I was about to answer a question but realized that my answer depends on a key binding provided by a plugin I have installed. Even worse, I don't know which plugin provides it. The only way I know to ...

1
22 23 24 25
26