vim-minisnip icon indicating copy to clipboard operation
vim-minisnip copied to clipboard

Auto indent snippets after inserting

Open gpanders opened this issue 5 years ago • 0 comments

It would be nice if snippets were auto-indented to match the "target" file's indenting scheme after they are inserted, for example using vim's native = feature. A use case for this might be Python snippets, where some source files use tabs and others use spaces. Snippets files should be agnostic to whatever indenting level/style is used in the source file they are used in.

One way to do this would be to just run = over the inserted snippet. This works fairly well in my limited tests, but it does fail the included vader tests for the indented multiline snippets (vim will remove extraneous indents with =). I made a PR for this here but I wanted to maybe open this up for discussion.

gpanders avatar Nov 13 '19 18:11 gpanders