Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An advice #5

Open
rgarrigue opened this issue Feb 16, 2015 · 3 comments
Open

An advice #5

rgarrigue opened this issue Feb 16, 2015 · 3 comments

Comments

@rgarrigue
Copy link

Hi

I'm trying to find a way to add some liquid/jekyll snippet to my vim, something that would for example paste a
{% highlight raw %}
cursor here
{% endhighlight %}
if I type something like ysnipraw

I tried vim-surround and vim-jekyll, none of those both pluggins do the job.

By any chance can you give me a hint ?

Thanks & regards

@parkr
Copy link
Owner

parkr commented Mar 6, 2015

This would be nice! Not sure how to do it...

@rgarrigue
Copy link
Author

I found a way here. I got some difficulties making it work reliably, gotta fix it whenever I got some free time again...

@lsrdg
Copy link

lsrdg commented Dec 10, 2016

I know this issue is quite old, and I'm not sure if you guys are still interested, but I did something quite similar to that to automate front matter creation (I didn't know about vim-jekyll!), and that gave me the idea below.

I'm sure this is not what you were looking for yet, but:

  • created a file called ysnipraw
  • added this line to init.vim:
imap ysnipraw <ESC>:0r ysnipraw<CR>o

Now writing ysnipraw inserts the snippet and places the cursor between the tags.

Note: the mapping above assumes that you and the snippet are on the same directory...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants