template.nvim icon indicating copy to clipboard operation
template.nvim copied to clipboard

multiple cursors position, like snippets ?

Open kinooyume opened this issue 2 years ago • 1 comments

I don't know how much work it would need, but it could be nice to be able to set multiple cursors positions and jumping through them, similar to how we can do that with snippets. Something like {{_cursor$n_}} ( {{_cursor$1_}}, {{_cursor$2_}}, ..)

My use case is that I want to use a template for some blog posts, and to quickly iterator through some metadata. Ideally, I prefer to not rely on snippets for that as it concern the creation of a new file only.

If anyone is interest, a quick workaround using macro:

  • put some characters that you can search in your template ($$ for example)
  • search for this character through # or
  • record a macro that go to the next occurrence and enter insert mode, example with a macro set to q : qqnciw<C-o>q

kinooyume avatar Jun 09 '23 09:06 kinooyume

if support jump between these cursor pos then need provide a function or command , you can bind it with a key . can implement it .

glepnir avatar Jun 09 '23 09:06 glepnir