Linked Questions

3
votes
1answer
607 views

Remapping motion keys [duplicate]

I recently found the awesome plugin named CamelCaseMotion which is awesome. I used their suggested mappings in my .vimrc for the plugin like this: map <silent> w <Plug>CamelCaseMotion_w ...
1
vote
0answers
49 views

How can I detect which command triggers a shortcut in a third-party package? [duplicate]

I remap Shift + k to noh, but once I installed ale, it is no longer working since one of the command on the package uses the shortcut. At least as far as I know, I feel that it is related to ...
1
vote
0answers
28 views

Mapping influenced my return key to toggle the syntastic check mode [duplicate]

I've mapped control-m to start the Syntastic check mode (Active/Passive) nnoremap <c-m> :SyntasticToggleMode<Cr> But in normal mode, when I tap the return key, it also toggles the mode. ...
24
votes
3answers
7k views

What does `<Bar>` mean?

In answering a question just now, I mentioned using a normal mode key mapping that can be found at the Vim Tips Wiki. In the middle of explaining the key mapping, I realized that I had no idea what &...
18
votes
5answers
22k views

arrow keys don't work in insert mode

When I hit the arrow keys in insert mode I get characters instead of navigation: I'd like to be able to use the arrow keys to navigate. Things I've tried I have set nocompatible in my ~/.vimrc (...
16
votes
2answers
11k views

File Type dependent key mapping

I'm trying to setup mappings for <C-]> that, depending on the buffer's file type, trigger different functions. For example, if I'm in a Javascript buffer, I want <C-]> to trigger :TernDef. ...
22
votes
1answer
5k views

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 <silent> <C-F> :wincmd f<CR> The problem is this remaps the ^f (lower-...
8
votes
2answers
5k views

How to run internal vim terminal at current file's dir?

I edit file /home/me/projects/myproj/src/util.c And want to start terminal at /home/me/projects/myproj/src. Vim version > 8 so I can run :terminal but it always starts at folder in which I've opened ...
9
votes
1answer
2k views

Why does remapping <Esc> make the cursor jump?

In .vimrc: inoremap ii <esc> " ii to go back into command mode The problem is, after ii, cursor jumps 35 columns right. The only other line which affects Esc: ...
5
votes
2answers
847 views

What does <Plug> do in vim?

I came across <Plug> in this command of easy-motion nmap <Leader>w <Plug>(easymotion-overwin-w) I tried to search for the definition of but no luck. What does it mean? Does it have ...
6
votes
1answer
2k views

Separate C-m and Enter

I am using zsh, urxvt, tmux and in there vim. I am not 100% sure who causes the effect but I would like to bind something to ctrl and m but not to carriage return in vim. Does somebody how this is ...
10
votes
1answer
2k views

What does asterisk mean in vim mappings?

For example, easy clip has this mapping when you run smap k: s k * <C-o>"_ck The asterisk and <C-o> are highlighted.
7
votes
2answers
3k views

key mapping best practices

I found that I frequently needed a command in INSERT mode to open a line above the cursor (what O does in NORMAL mode) I put this in my .vimrc inoremap ao <esc>O It works well. I chose the ...
6
votes
1answer
2k views

Is it possible to map <C-S-Space> in neovim?

I usually use gvim and it understands the mapping similar to inoremap <C-Space> <C-n> inoremap <C-S-Space> <C-p> Now I'm testing nvim and I can use the Ctrl+Space. But Ctrl+...
4
votes
2answers
2k views

Strange behavior of <ctrl-j> remapping

I want ctrl-h, ctrl-j, ctrl-k and ctrl-l in insert mode to behave like the arrow keys. I have this (among other things) in my .vimrc: inoremap <C-j> <Down> inoremap <C-k> <Up&...
4
votes
1answer
1k views

Leader shortcuts ignored

In my vimrc I have nnoremap <Leader>h :bp<CR> nnoremap <Leader>l :bn<CR> But I have to source my vimrc to enable them with (:so $MYVIMRC). If I do a :map after starting vim I ...
6
votes
1answer
513 views

store regex searches in vimrc as mappings

In browsing markdown files, I find the following search useful /\v^(\*|#) However, when I try to map it I get an error nmap <c-j> /\v^(\*|#)<cr> E488: Trailing characters: #) What ...
6
votes
1answer
1k views

Mapping control-H in insert mode doesn't work; it always works like backspace

I tried mapping control-H, J, K, and L respectively in insert mode to move around splits. inoremap <C-h> <ESC><C-W><C-h>i inoremap <C-l> <ESC><C-W><C-l&...
4
votes
1answer
1k views

How to map shortcut to double square brackets?

When I type [[ or ]] in normal mode, cursor is jumping previous / next "class definition" during editing python (.py) file. I want to map these shortcuts to SHIFT + UP and SHIFT + DOWN. And I added ...
1
vote
1answer
2k views

mapping to quit using “<Ctrl> + q” not coming into effect [duplicate]

I am trying to map Ctrl + q to quit editing the file. I added the below line to my .vimrc nnoremap <C-q> :execute "q"<CR> On pressing the above key combination, nothing happens, vim ...
2
votes
2answers
998 views

inoremap only works after source

So I want to disable the arrow keys in insert mode. So I added the following lines at the end of ~/.vimrc: inoremap <up> <nop> inoremap <down> <nop> inoremap <left> <...
1
vote
1answer
2k views

Swap `j` and `gj` [duplicate]

I use vim a lot to edit tex files. When I have lines spanning multiple display lines, most of the time I want to navigate through them with gj not j (i.e. according to displayed lines, not physical ...
0
votes
2answers
2k views

vim split horizontal resize shortcut

I can resize horizontal split windows by ctrl-w-shift-< and ctrl-w-shift->. I would like to have a shortcut for that. Close to the topic, recently I learned about the following maps: nnoremap &...
0
votes
4answers
871 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 ←...
1
vote
1answer
1k 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. ...
0
votes
1answer
1k views

<Esc> key mapping seems to be not working in my vim 8.0 on my Ubuntu 16.04

I have inoremap jj <ESC> in my vimrc on my Ubuntu 16.04. I have no idea why my jj not working and its just typing literally <ESC> in my text file for my jj press. Any idea how can I get ...
2
votes
1answer
1k views

Mapping key to execute shell script from vim

I would like to execute a shell script, with parameters, from vim by mapping it to F6, however the current mapping I have in my .vimrc isn't working: " Map F6 to sync project changes to dev server ...
2
votes
1answer
238 views

Assign shortcut to a Split window resize Ctrl+w+|

I can expand a vertical split screen to occupy most of the area using Ctrl+w+| Now I would like to map that shortcut to Ctrl+m. I tried the following but it failed. nnoremap <C-m> <C-W&...
3
votes
1answer
269 views

Vimrc tries to execute command defined on leader

I'm trying to have something like this in my .vimrc: nnoremap <leader>has :w | ! reset; runhaskell % <cr> How ever, now it prompts an error when loading .vimrc and tells me: :! reset; ...
1
vote
1answer
433 views

Alt-I doesn't work to inset \item in vim-latex

Hello Vimmers and LaTeXers, I cannot get Alt-I to work in vim-latex. It is supposed to insert \item depending on the environment that you are in. Do I need to activate it somehow? Is there a setting ...

15 30 50 per page