Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [keymap]

The tag has no usage guidance.

2
votes
1answer
52 views

Numpad characters don't work in keybindings mappings (but work in general)

For my terminal Vim 8.0, I have downloaded this plugin that makes changing font size on the fly easy: https://github.com/drmikehenry/vim-fontsize Following the instructions, here is how I decided to ...
1
vote
1answer
50 views

remap to a map calling getchar() internally

I want to extend the easymotion Plugin to take some action after the jump. To explain to those who are not familiar with this plugin, I will use the following simplified example. Say in a plugin ...
-2
votes
1answer
30 views

VIM and Carrot L (^L)?

I know when you see ^M you can insert it with Control+Enter; and ^I with Control+Tab. How do you generate a Form Feed ^L for use in :s and /?
2
votes
0answers
33 views

Function keys: won't work with macros (I tried a lot)

Specs: Vim 8.0 patch 500 gnome-terminal 3.18.3 on Ubuntu 16.04 running Unity Function keys in my vim slightly misbehave, however, in an annoying way: I can't completely use them in my macros. After ...
0
votes
1answer
29 views

Make conditional imap to text being enclosed in certain characters

How can I create mappings that work only if the cursor is enclosed by certain characters? As an example, I want to map ja to \alpha if the cursor is enclosed by $$ or by \[\] so as to make This jar ...
0
votes
1answer
63 views

Function Unable to Fail: Breaks Macros

Vim functions do not seem to be able to fail without spitting out 3 unnecessary lines. For example, take this set of functions and maps: " NEXT / PREVIOUS " ~~~~~~~~~~~~~~~ " n and N always search ...
0
votes
0answers
31 views

Why getchar() catches Ctrl-c depending on mapping?

Why getchar() catches Ctrl-c depending on mapping? I was using getchar() to catch Ctrl-c within a script a everything was passing correctly until I tried to charge it in vim without configuration (...
1
vote
0answers
24 views

How can I prevent <CR> from moving the cursor downward? [duplicate]

In the vim help doc, it says: *CTRL-M* *<CR>* [count] lines downward, on the first non-blank character |linewise|. That is, in the normal mode, <CR> has the same ...
2
votes
1answer
61 views

Create remap with variable

How do I remap key combinations with a free variable? For example, let's say I want to be able to insert a single letter without leaving normal mode. I would want something like nnoremap <leader&...
0
votes
1answer
41 views

importing skeleton on keybind

Task: on key press, lets say <C-G> print a basic skeleton, e.g.: 99 control '<++>' do 100 impact '<++>' 101 title '<++>' 102 desc '<++>' 103 describe <++>...
0
votes
2answers
45 views

What key presses/escape codes does vim expect for <ScrollWheelLeft> and <ScrollWheelRight>?

I'm working with a terminal emulator, and want to send the right key presses/escape sequences to vim, so it inteprets them as the left/right scroll wheel buttons. 64/65 works for up/down: <...
1
vote
1answer
45 views

How do I change, not add to, keymaps of default vim

My version is : NVIM v0.3.0-dev I'm trying to replace mappings with w mappings. Initially I came up with nnoremap <leader>w <c-w> nnoremap <leader>wb <c-w>s nnoremap <...
0
votes
1answer
83 views

How to remap :w to :up?

I have a file-watcher system which triggers some compilations upon time-stamp changes in the source file I am editing. I have the obsessive habit of using :w quite a few times during my editing ...
0
votes
0answers
44 views

Why numeric keypad has been treated same as number key in vim?

Noticed this issue with Highlight multiple words. After add highlights.vim and highlights.csv, I can highlight multiple word with different colours by command :Highlight 1 word, but numeric keypad is ...
0
votes
4answers
205 views

How to disable Help menu in insert mode?

I want to map <M-h> to ← in insert mode. I add imap <M-h> <Left> to .vimrc. But if I press <M-h>, Help menu will pop up. How to disable this and force <M-h> to ←...
0
votes
2answers
84 views

how to create a keymap for vim that has a regex argument

This pattern is very useful to me to get the count of a pattern in a vim file: :%s/pattern//gn How can I do a keymap so that I can simply invoke it + pattern while I'm in vim?
0
votes
2answers
91 views

Unmap all combinations starting with certain key

I am experimenting with default key mappings and am considering remapping the g key entirely. But first I would like to turn off all the existing mappings that g has. For now I am using this kind of ...
0
votes
2answers
73 views

Vim stops treating “<Plug>” as a keyword to call functions in insert mode

I have the following configuration in my vimrc file. inoremap <C-A> <Plug>InsertComment And somewhere in my vim folder I defined inoremap <silent> <Plug>InsertComment <...
0
votes
2answers
89 views

Comment and uncomment by the same key strokes

At the moment, my commenting and un-commenting is done by two different strokes listed below: nnoremap <leader>c 0<insert>//<Esc> nnoremap <leader><leader>c :s;^\s*//<...
1
vote
1answer
96 views

shortcut to open definition of variable in a vertical split

I use the vertical split command a lot :vsplit, and I also have click on ctrl] to look at the definition of a variable (after generating the Ctags). I would like to do a keyboard shortcut that does ...
4
votes
1answer
246 views

Map Alt-{ijkl} for tab split navigation

On my previous setup, I used the following binding to move between my splits nmap <silent> <A-Up> :wincmd k<CR> nmap <silent> <A-Down> :wincmd j<CR> nmap <...
1
vote
1answer
44 views

Converting from A to B using mapped key

I've posted a number of times to try and get closer to what I'm trying to do. My problem is I have got the commands I need to make the conversion happen, however I cannot successfully map it to a key. ...
1
vote
1answer
443 views

Map <C-/> on linux and windows [duplicate]

I knew that map / is _ on linux, but it not work on windows. What should I do to map it?
1
vote
1answer
344 views

Can't remap <C-C> in vim

(NB: I've moved this question from another SE site, let me know if thats not ok and I can take this down) I'm having issues remapping Ctrl+Shift+c to copy visually selected text to the + register. ...
3
votes
1answer
319 views

return <Plug> in a <expr> map

I know that in vim, map <expr> allows us to map a key sequence to a new sequence as specified by the return value of an expression. For example: function Wrap() if getline('.') == '' ...
1
vote
1answer
105 views

Is it possible to map one key to two commands, doing 2nd command only if first fails

I want to map the tab key to <c-w>w to switch windows when there is more than one window open. But if there is only one window but multiple tabs, I want it to detect that there is only one ...
5
votes
2answers
139 views

Vim custom key mapping not working in superuser mode

I have a custom key mapping jj to escape, it works for normal file edit but when I open the file as a superuser the key mapping doesn't work anymore, why? I use Antergos os.
0
votes
3answers
978 views

inoremap + nnoremap

I recently wanted to have a mapping that I could trigger from normal mode as well as from insert mode. Writing the same mapping for multiple modes annoyed me as it cluttered my .vimrc and requires me ...
2
votes
3answers
395 views

keymap for open .vimrc, edit, save and reload

I am trying to improve my vim skills lately, and therefore I edit my .vimrc a lot. Following How do I reload my vimrc without leaving Vim?, I wonder if there is a convenient way to define a keymap ...
0
votes
1answer
80 views

Vimscript: fetch list of keymappings containing a prefix?

I'm adding a buffer-local mapping to close netrw windows: " ~/.vim/ftplugin/netrw.vim nnoremap <buffer> q <C-W>c It works, but it hesitates because Netrw has created other mappings with ...
0
votes
1answer
505 views

oneliner map to fold all / unfold all

I'm trying to optimize this solution I came up with. The code bellow do works fine. So feel free to use it as a valid solution to this question. nnoremap <F2> :call ToogleFold()<CR> ...
0
votes
1answer
54 views

Remapped keys won't work when combined

I have these lines in my .vimrc: " Remap movement nnoremap j h nnoremap k j ...
5
votes
1answer
557 views

start vi automatically in hex mode

Once I run vi a.out, I can type :%!xxd, but I'm unable to automate the process like start vi automatically in hex mode create a key mapping from F1 to :%!xxd
1
vote
1answer
495 views

Using Text Objects with vimtex

I am having trouble figuring out how to use the text objects with the vimtex plugin. The mappings with leaders and the commands in normal and insert mode are fine. But to get environments, sections, ...
0
votes
2answers
56 views

Can i map control “b” (b pressed after control not together with it)?

I have this idea of binding b pressed after control (which would preserve original C-b behaviour to Denite buffer and C f to Denite file_rec. But nnoremap <silent> <C>f :Denite file_rec<...
6
votes
1answer
152 views

How do you set no timeout for a specific remap?

The question arise from a problem using a huge remapped configuration so bépo layout is virtually the same as the qwerty in normal mode, at least for single key press commands. Selecting text using ...
1
vote
1answer
105 views

Make mapping repeatable with repeat.vim

I'm trying to make a mapping that inserts an empty line below without moving the cursor and to make this repeatable with repeat.vim. I have modeled this from vimcasts. To get back to the original ...
0
votes
2answers
125 views

How to insert tabs in key remapping?

I wrote the following in my .vimrc file in order to automate getting an HTML file set up. :imap html<tab> \<html><enter> \<tab><head><enter> .... and so on. ...
4
votes
2answers
164 views

How do I swap key bindings without breaking plugins?

I'm thinking about exchanging some keys while in non insert-mode so that the bindings that I use most are easier to reach (i.e. on the home row). How can I swap two keys without breaking the ...
16
votes
1answer
970 views

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 ...
1
vote
1answer
241 views

How to execute xdg-open from NERDTree in Linux?

Netrw able to execute file with xdg-open by pressing x, how about NERDTree ? [Response to downvote] If xdg-open can so easy/direct to work (which is the reason of downvote), then what's the point ...
3
votes
2answers
868 views

How to map NUM keys?

I am using Vim version 7.4 from 2012-Dez-06 of Ubuntu 16.04 and I use PuTTY 0.67 on W10. I want to map the keys of the NUM pad in .vimrc. This doesn't work: map <k1> COMMAND map k1 COMMAND map &...
2
votes
0answers
136 views

How do you map the back tick character (`) with a modifier key like ctrl? [duplicate]

Is there a way I can map a digraph like ` , with modifier key like ctrl together in vim like this NERDTree bind. map <C-n> :NERDTreeToggle<CR> It seems to be a tad bit more ...
1
vote
2answers
95 views

Paste + Override Shortcut

I would like to have a Paste + Override shortcut, which should basically have the behaviour of going into Replace-mode, typing everything currently in the clipboard, exiting Replace-mode. How can I ...
5
votes
1answer
295 views

Map 'Jump to mark line' to 'Jump to mark position'

Let's say I've set a mark a via ma. Then 'a will bring me to the first non whitespace character of the line. However `a will bring me to the exact position of the mark a. I prefer the second ...
1
vote
1answer
601 views

Why does nmap work but nnoremap not work to set up vim-easy-align shortcut?

The vim-easy-align plugin says to assign the following keymaps: xmap ga <Plug>(EasyAlign) nmap ga <Plug>(EasyAlign) I thought these would work equally well with: xnoremap ga <Plug>...
0
votes
1answer
214 views

How to disable special characters in insert mode?

GVim supports special characters (ñ÷åòôùõéïéðÛáóäæç ... etc), by holding Alt in insert mode. While I'm sure this is handy for languages that use these characters, I've bound some Alt+Keys in insert ...
4
votes
2answers
745 views

How to map “make” to “make | copen”?

It would be fine if after :make command vim opened the new buffer with errors and put the cursor to it. Exactly like :make | copen command. How to map sequence :make | copen?
2
votes
1answer
198 views

Physical backspace button mapped to <Del>

In insert mode I want Backspace to delete the characters to the left of my cursor but it's acting just like Del and removing characters under my cursor. I saw somewhere I can use ctrl-k then a key to ...
1
vote
2answers
514 views

Map a command that accepts an argument

I'm writing a Fortran parallel code using MPI. I mapped ctrl-C to run make, in order to compile the program with proper options and dependencies. I also mapped ctrl-< to run the program executing ...