When I'm editing a cmake file in (neo)vim I'm getting bad behavior block inserting comment characters.
Given this section of text
install_license_file(
PACKAGE tomcrypt
TARGET tomcrypt::tomcrypt
VERSION "1.18"
TYPE "PD"
FILE "/usr/share/doc/libtomcrypt1/copyright"
)
If I put the cursor at the start of install_license_file
and then do this sequence
ctrl-v
6j
I
#
I end up with this
#install_license_file(
PACKAGE tomcrypt
TARGET tomcrypt::tomcrypt
VERSION "1.18"
TYPE "PD"
FILE "/usr/share/doc/libtomcrypt1/copyright"
)
but I'm trying to get this
#install_license_file(
# PACKAGE tomcrypt
# TARGET tomcrypt::tomcrypt
# VERSION "1.18"
# TYPE "PD"
# FILE "/usr/share/doc/libtomcrypt1/copyright"
#)
What's causing the unexpected behavior?
** UPDATE **
- if I completely clear out my
init.vim
and the system levelsysinit.vim
(Arch Linux) it works as expected but then if I doset shiftwidth=2
I get the bad behavior. - if I start with
nvim -u NONE
I get the expected behavior even afterset shiftwidth=2
What's causing the unexpected behavior?
probably a bad configuration, see how do I debug my vimrc:verbose xmap I
to see if you have a mapping forI
in visual mode that might be affecting this behavior? Since removinginit.vim
doesn't seem to solve it by itself, then it's probably some plug-in or package that you installed or that was shipped with your Vim?I
. Note that this set of keystrokes works fine if I take the same file and rename tofile.py
instead offile.cmake
(or even just doset filetype=python
):verbose imap #
? I'm trying to figure out which part specifically is causing the issue, it looks like a mapping is what would do that, so maybe it's one for inserting the#
? Yeah it's definitely something associated with the filetype...impac
,vmapc
,etc) I still get the same bad behavior