Your keyboard is the problem
On many non-English keyboards, the backslash\
is only accessible through an AltGr key combination. This makes the default setting of the
character rather impractical for these non-English keyboard users.Moreover,
key combinations are subject to a default 1000ms time-out. This can be observed by the disappearance of the
key at the right edge of the command line.
So, non-English keyboard users need to be real quick typists for \cc to work. Failure to do so, results in an undesired cc
line change.Here is an example of a German keyboard layout with the backslash-bearing key on the top row, third from right:
Solution
Non-English keyboard users are advised to change the
key from the \
character to the more accessible , key. Vim beginners should also consider a slightly longer 1500ms time-out. Here is what needs to be added to ~/.vimrc
let mapleader=","
set timeout timeoutlen=1500
One final caveat; these changes only take effect after completely exiting Vim. Resourcing with :source $MYVIMRC
will not work!Done that, one can now use ,cc for commenting with NERD Commenter.
Comments
Post a Comment
https://gengwg.blogspot.com/