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

Proper support for triple-quoted strings #134

Closed chris-morgan closed 9 years ago

chris-morgan commented 11 years ago

(See also #55.)

delimitMate_nesting_quotes makes it easier to work with triple-quoted strings in Python, but at the cost of making the single-quoted form much more difficult to work with.

Here is a better way of handling both cases:

|
'|'
''|
'''|'''
Raimondi commented 11 years ago

Let me know hot it works. Thanks for the feedback!

chris-morgan commented 11 years ago

That's certainly better; thanks for that. There's still one minor deficiency, though; it doesn't cope well with closing:

|
'|'
''|
'''|'''
'''a|'''
'''a'|''
'''a''|'
'''a'''|'''

I do not desire those extra three quotation marks to be added at the end there.

Raimondi commented 11 years ago

There is Shift-Tab (<Plug>delimitMateS-Tab to use in mappings) to jump over one char and Ctrl-g g (<Plug>delimitMateJumpMany) to jump over all the delimiters to the right of the cursor.

I don't use this feature myself. So, I'm not sure about what approach would be the most reasonable for it. I'm open to suggestions, though. Let me know if you think of something.

CleanCut commented 9 years ago

I'm not seeing any of the triple-quote handling in python-mode that's mentioned in this issue. What can I do to debug the issue? I'm using Vim 7.4.488 and today's clone of delimitMate.

Raimondi commented 9 years ago

Start with au FileType python let b:delimitMate_nesting_quotes = ['"'] to enable the feature.

CleanCut commented 9 years ago

@Raimondi Thanks! That worked, yay! Maybe I have finally found an auto-closing plugin I can stick with.

Basic settings like that ought to be on the main README.md!