xolox / vim-notes

Easy note taking in Vim
http://peterodding.com/code/vim/notes/
1.6k stars 110 forks source link

Ignore tag-like strings when used within embedded highlighting blocks #83

Closed kshenoy closed 10 years ago

kshenoy commented 10 years ago

I have a note for perl snippets and any array used within a snippet is identified as a tag. For eg.

{{{perl @matches = $str_to_match =~ /<pattern>/}}}

Would it be possible to ignore any such code?

Also, do you have a demonstration of a use-case of how to use tags?

xolox commented 10 years ago

I'm trying to reproduce this. I copy/pasted your code block, saved the note, then typed @ but the automatic completion doesn't suggest @matches, so it seems to me like snippets are already being ignored.

Oh wait, you're probably referring to the automatic completion being triggered while you type @ inside a snippet? This is similar to issue #79. Hopefully I'll get back to this issue soon, I would like to see this solved myself (it's just that it's a bit tricky, which is why I haven't done it yet) ...

xolox commented 10 years ago

I just published vim-notes 0.27 which should resolve this issue. Can you confirm? Thanks for the feedback!

kshenoy commented 10 years ago

Thanks, it works perfectly now :)

Btw are tags case sensitive? Is DemoTag the same as demotag?

Also, I understand you chose something like tabstop=3 and shiftwidth=3 for aesthetics. Would you consider making them customizable?

xolox commented 10 years ago

@kshenoy: sorry for the late reply, I missed your last post here.

Btw are tags case sensitive? Is DemoTag the same as demotag?

Looking through the code it seems that tags are case sensitive in the current implementation, however I would consider this an unfriendly implementation detail so I'm open to changing it. Please create a new issue if you're interested in this.

Also, I understand you chose something like tabstop=3 and shiftwidth=3 for aesthetics. Would you consider making them customizable?

Correct, it was mostly aesthetics. I've never gotten the request before, but you're free to request this feature in a new issue. If more people are interested they'll let me know in that issue and I will know that this may be useful to add. Without looking at the code I can't easily tell how easy this is to change, but it may not be difficult to parametrize.