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

smart quotes: regexp like with smart_matchpairs? / no closing quote before `"` #164

Closed blueyed closed 9 years ago

blueyed commented 10 years ago

Currently delimitMate#IsSmartQuote uses a fixed pattern for the word_before / word_at check: '\w\|[^[:punct:][:space:]]'.

I suggest making this configurable like with smart_matchpairs and have a similar default: I was looking into it, because I would like to have no second quote before $.

Raimondi commented 9 years ago

Let me know how that works for you.

bdrewery commented 9 years ago

I can't get this to work. I want to disable having " become "" before $something in shell scripts.

blueyed commented 9 years ago

@bdrewery How are you trying to achieve it? What are you using for g:delimitMate_smart_quotes?

bdrewery commented 9 years ago

I directly modified the default and added $ (and \$) into the 2 [] lists and could not get it to do what I wanted.

For example:

let default_smart_quotes = '\%(\w\|[^$[:punct:][:space:]' . quotes . ']\|\%(\\\\\)*\\\)\%#\|\%#\%(\w\|[^$[:space:][:punct:]' . quotes . ']\)'

I'm sure I'm doing it wrong. It's confusing :)

Also, the directions for modifying the default delimitMate_smart_quotes seem stale since there is now a non-user-modifiable quotes_list list thrown in.

It would be simpler if there was just a list the user could modify of characters that will never have a quote started in front of it. I don't want to define the long default with my 1 $ change for shell scripts with b: and risk losing good updates to the default in the future.

blueyed commented 9 years ago

@Raimondi ping Can you shed some light into this, please? What do you think about the above idea to simplify it?