Thursday, January 24, 2019

Treat period as a word boundary in vim

If cw in vim is selecting past '.' to the next whitespace or non-alpha (for which I would usually use cW)

If you do set you may find:

iskeyword=@,48-57,_,192-255,.

If you do :set iskeyword-=.; it will remove it.

NB: This is probably file-type specfic (e.g. in RedHat while editing a .sh file, but not when invoking vim with no file)

If you don't want to set this globally, you can use :setlocal for certain filetypes (in ~/.vim/after/ftplugin/.vim)

Source: https://stackoverflow.com/questions/19571022/how-can-i-include-periods-when-selecting-a-word-in-vim