Raimondi / delimitMate

Vim plugin, provides insert mode auto-completion for quotes, parens, brackets, etc.
http://www.vim.org/scripts/script.php?script_id=2754
1.98k stars 117 forks source link

Ignoring << bit left shift/stream operators in C/C++ #230

Closed shoban closed 8 years ago

shoban commented 8 years ago

When typing out <<, delimitMate adds >>. In the following example, | is the cursor.

std::cout << "Hello World"| >>

This can often be very annoying. I can only think of two ways of handling this:

  1. Use <S-BS> to delete the delimiter on the right.
  2. Remove <:> from delimitMate_matchpairs.

Is there a better way of ignoring/handling this?

shoban commented 8 years ago

This is not an issue in itself. I don't know where to post this question.

Thanks for this awesome plugin otherwise!

Raimondi commented 8 years ago

You can put this in your vimrc:

au FileType cpp let b:delimitMate_matchpairs = '(:),{:},[:]'

That would affect cpp files only. If you want to set a global value for all filetypes, then put this in your vimrc:

let delimitMate_matchpairs = '(:),{:},[:]'
shoban commented 8 years ago

Thanks @Raimondi! This is the second method that I described in the issue. It would be great to have a feature where certain patterns (defined by regex?) to be ignored by the plugin.