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

autocomplete incorrect in if, while and etc. #60

Closed andersoncustodio closed 13 years ago

andersoncustodio commented 13 years ago

When you type if ($ var <) -> if ($ var <>)

Raimondi commented 13 years ago

Could you explain a bit more? I'm not sure what's going on.

bdrewery commented 13 years ago

The problem is that < is being expanded to <>, when you expect to only get < for 'less than', within conditional statements.

Raimondi commented 13 years ago

The problem might be that you're adding <:> to matchpairs as a global action, only add <:> to matchpairs using a filetype autocmd for those filetypes that need it:

autocmd FileType html,vim setlocal matchpairs+=<:>

And/or set _delimitMatematchpairs to the values you need to be completed:

autocmd FileType html let b:delimitMate_matchpairs = '(:),[:],{:}'

If you need the completion in the filetype where you need to type that expression, press Ctrl-V then < to avoid expansions.

andersoncustodio commented 13 years ago

Thanks!

Sorry for the sloppy explanation, I do not know English, I used the Google translator.

Raimondi commented 13 years ago

También hablo español, si ayuda en algo :)