bind ctrl-h to move left in vim under insert mode with vundle - vim-plugin

i am from china, so may my english is poor.
i used to write
:map! <C-h> <Left>
:map! <C-l> <Right>
in my .vimrc file to bind the ctrl-h to move left under insert mode and ctrl-l to move right. and they work well.
but after i use the vundle plugin to manage my plugin. the ctrl-h does not work now.It prefer to del and move left under insert mode, that is not my wish. but ctrl-l always work fine.
is there something wrong with ctrl-h , I think vundle affect it, or bind ctrl-h before me.

you can check what who define it before your.
:verbose map <C-h>
:verbose map <C-l>

i have this mapping for the same goal. it works both in gvim, terminal (rxvt) and tty.
" move cursor in Insert Mode
inoremap <C-h> <C-o>h
inoremap <C-j> <C-o>j
inoremap <C-k> <C-o>k
inoremap <C-l> <C-o>l

Related

How to multiline toggle comments in IdeaVim

I started to use IdeaVim but I am missing the feature to proper toggle comments over multiple lines. On my vim config I am using nerdcommenter for this:
vmap ++ <plug>NERDCommenterToggle
nmap ++ <plug>NERDCommenterToggle
and my iTerm sends ++ to the terminal when I press CTRL + /
This works perfect and I can set a count before I toggle to comment out multiple lines.
I would like to have the same setup for my IdeaVim but I can not get it to work.
I tried to use commentary but when it seems that the gcc action ignores any number before it and always comments out the single line.

How to efficiently yank to system clipboard in WSL2 neovim?

I've installed win32yank through chocolatey and changed clipboard setting in init.vim:
set clipboard=unnamedplus
Everything works however I notice that copy and paste operations now have very slight but noticeable delay. Is there any alternative way to copy to system clipboard? (I'm using neovim in WSL2 Ubuntu)
Just remove clipboard option. It's harmful and useless.
What it essentially does, it prepends "quote-plus" to all yank/delete/put commands automatically. Instead of this, manually type "+ when you want to access system clipboard and don't when you don't.
I've expanded on Matt's feedback and put this in my vimrc:
let mapleader=" "
noremap <Leader>y "+y
noremap <Leader>p "+p
noremap <Leader>d "+d
Select a block of text, press and then either y/p/d for yanking, pasting and deleting lines into the system buffer. It automagically seems to work with win32yank.exe (which is in my PATH in WSL2).

.ideavimrc file mapping Esc key

I would like this vim mapping to work in ideavim.
inoremap <S-Space> <Esc>
It maps Shift Space with Esc in insert mode.
Any ideas what to put in my .ideavimrc?
You can put exactly this line into your ~/.ideavimrc and it will result in the expected mapping.
You can try it interactively as well by typing :inoremap <S-Space> <Esc>.
Edit: It's currently not possible. Vote for VIM-1026 at IdeaVim's bug tracker to get updates.

Setting ft=vb causing vim's parenthesis matching to stop working

I'm having a weird issue in which I can't get parentheses to match in VB files in vim or gvim.
For example, if I start vim and insert Iif(test, 0, 1), I can use % to jump between the two parentheses like normal. Then if I run :set ft=vb, it stops working. Actually, I get one more jump, then it stops working.
I have tested this on two different machines running Windows and Linux and I get the same results.
Does anyone know why this might be?
You're using the matchit plugin that comes with Vim. In $VIMRUNTIME/ftplugin/vb.vim, it defines custom pairs (e.g. If...End If) which override the default pairs. To re-enable those (in addition), put the following into ~/.vim/after/ftplugin/vb.vim:
let b:match_words .= ',(:)'
Cp. :help b:match_words.

How do I navigate the MiniBufExplorer without going into the MiniBufExplorer window?

How do I navigate the MiniBufExplorer without going into the MiniBufExplorer window?
In lines 170-174 of minibufexpl.vim:
" To enable the optional mapping of <C-TAB> and <C-S-TAB> to a
" function that will bring up the next or previous buffer in the
" current window, you can put the following into your .vimrc:
"
" let g:miniBufExplMapCTabSwitchBufs = 1
I added that to my .vimrc, restarted a blank Vim, then did the following commands to bring up multiple buffers (and consequently, the MiniBufExplorer):
:e somefile
:e someotherfile
Now, with my cursor inside the file window (not the MiniBufExplorer window), I try CtrlTab and CtrlShiftTab to no effect. Something I missed?
I think this is most likely a conflict with snipMate, which I believe you have since you mention the tab mapping works in select mode. I tried to do it manually map <C-Tab> :bn<cr>,
and it did not work either. I now use map <C-P> :bp<cr> and map <C-N> :bn<cr> to navigate through buffers, and I suppose other mappings would work just as well as long as there is no conflict.
Minibuf explorer shortcuts (may require additional configuration):
[C-TAB] and [C-S-TAB] - move to next and prev buffers
Vim regular buffer shortcuts:
:bn and :bp - move to next and prev buffers
:b# - move to buffer of number #
:h :buffers - for additional help
Did you leave the " at the beginning of the let line? If so, it's commented out, and will not work. Otherwise, you may have a mapping conflict between plugins. The :map command will list current mappings.
It's easier to deal with mappings if you install headlights though.