It is really a strange problem I discovered when creating colorschemes. After trying my best to narrow down the problem, I got the following minimum requirements to trigger this issue:
Vim version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jan 14 2015 20:16:36)
Included patches: 1-580
Compiled by Arch Linux
Huge version with GTK2 GUI.
Vimrc
Create a clean vimrc (and surely install Vundle and delimitMate).
set nocompatible
syntax on
set backspace=2
"start Vundle
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
"delimitMate (match pairs)
Plugin 'Raimondi/delimitMate'
let delimitMate_excluded_regions = "String"
call vundle#end()
filetype plugin indent on
"end Vundle
Command sequence
vim -u [the above vimrc file] foobar.py
Try input two quotes. The first one will result in a pair of quote. The second one will make the cursor out of the quote, instead of inserting a new quote.
i.e. you will get:
'|'
''|
Now change the String highlight group from linking to Constant (:hi link String Constant) to a separate group, by assigning whatever attributes:
:hi String term=bold
Now repeat the previous key sequence again. This time the second quote you input will result in a new quote!
i.e.:
'|'
''|'
The delimitMate_nesting_quotes will also behave differently in the two conditions.
It is really a strange problem I discovered when creating colorschemes. After trying my best to narrow down the problem, I got the following minimum requirements to trigger this issue:
Vim version
Vimrc
Create a clean vimrc (and surely install Vundle and delimitMate).
Command sequence
Try input two quotes. The first one will result in a pair of quote. The second one will make the cursor out of the quote, instead of inserting a new quote.
i.e. you will get:
'|'
''|
Now change the
String
highlight group from linking toConstant
(:hi link String Constant
) to a separate group, by assigning whatever attributes:Now repeat the previous key sequence again. This time the second quote you input will result in a new quote!
i.e.:
'|'
''|'
The
delimitMate_nesting_quotes
will also behave differently in the two conditions.