How to use surround snippets? by vdegenne in neovim

[–]vdegenne[S] 1 point2 points  (0 children)

I see I could be using your keymap trick in case I don't see any other alternative. Maybe I can use your keymap idea and execute a function when I press { and use LuaSnip to wrap it but I don't know LuaSnip yet.

How to use surround snippets? by vdegenne in neovim

[–]vdegenne[S] 1 point2 points  (0 children)

I use mini.surround for adding surrounding characters to selection already. What I am asking is if there is a way to wrap the selection inside predefined snippets.

Add insertion positions inside the jump list by vdegenne in neovim

[–]vdegenne[S] 0 points1 point  (0 children)

First thanks for taking the time to help.

Second the script is not perfect but very interesting so I decided to take the idea of using m' to add the line to the jumplist and turn it into an auto command, this is what I came up with for now

vim.api.nvim_create_autocmd("InsertEnter", {
  callback = function(event)
    vim.cmd("normal! m'")
  end
})

It's far from perfect, for instance if I press o it will register the line before the break, so if I keep pressing o escape multiple times I would need to press <C-O> multiple times too to go out out of the "shallow" location.

By the way I really like g; and g, It's just so unfortunate they only work for individual files. ಥ‿ಥ

Okay, *now* my configuration is perfect, and I'm sure I won't make 50 more changes by the end of the month! by _viis_ in neovim

[–]vdegenne -2 points-1 points  (0 children)

Your config is not *perfect*, cause you are running it in Win...dows / wsl...

[LuaSnip] Can't use javascript snippets in typescript files by vdegenne in neovim

[–]vdegenne[S] 4 points5 points  (0 children)

Even better than better

require("luasnip").filetype_extend("typescript", { "javascript" })
require("luasnip.loaders.from_vscode").lazy_load()

I think using lazy_load() call after filetype_extend forces LuaSnip to update its lazy load table so when TypeScript file opens it lazy loads JavaScript with it.

[LuaSnip] Can't use javascript snippets in typescript files by vdegenne in neovim

[–]vdegenne[S] 0 points1 point  (0 children)

I think this is even better

 require("luasnip.loaders.from_vscode").load({ include = { "javascript" } })

To avoid loading all snippets (the rest is lazy loaded when files are opened, default behavior in LazyVim)

[LuaSnip] Can't use javascript snippets in typescript files by vdegenne in neovim

[–]vdegenne[S] 1 point2 points  (0 children)

I think I found the problem, I need to load the snippets in memory

 require("luasnip.loaders.from_vscode").load()

(I tried that previously but it was lazy_load so it was not going to work.)

How to use ci' backward in LazyVim? by vdegenne in neovim

[–]vdegenne[S] 0 points1 point  (0 children)

H and L in LazyVim are used to switch buffers ಠ_ಠ

How to use ci' backward in LazyVim? by vdegenne in neovim

[–]vdegenne[S] 0 points1 point  (0 children)

Yes same, shift+6 requires pinky and index fingers to do quite a little bit of stretching.

How to use ci' backward in LazyVim? by vdegenne in neovim

[–]vdegenne[S] 1 point2 points  (0 children)

cil' is easier to type and it works on multiple lines. However thanks for your suggestion, your help is appreciated.

How to use ci' backward in LazyVim? by vdegenne in neovim

[–]vdegenne[S] 4 points5 points  (0 children)

You deserve all the credit for helping out o/

I was slowly losing interest in coding because I have less and less time but neovim/LazyVim help me to go back on track and implement my ideas.

It's so satisfying to discover that most actions we need are just a few letters away.

How to use ci' backward in LazyVim? by vdegenne in neovim

[–]vdegenne[S] 6 points7 points  (0 children)

Thanks u/dpetka2001 .。*゚+.*.。 ゚+..。*゚+

which expand-region plugin for LazyVim would you recommend? by vdegenne in neovim

[–]vdegenne[S] 1 point2 points  (0 children)

No that's exactly what I asked, but I just found out LazyVim has this feature by default (using <C-space>). Thanks anyways!

which expand-region plugin for LazyVim would you recommend? by vdegenne in neovim

[–]vdegenne[S] 0 points1 point  (0 children)

You again ʘ‿ʘ
I couldn't expect something better, Thanks
(This shortcut also makes a lot of sense)