I am figuring out a way to apply linting to a visual selection of code. For example:
I only want to lint run :ALEFix
on that section of code, and not the 100s (or 1000s) of lines of other code in the file. My first thought was doing something like:
- Copy the visual selection.
y
- Option a new file and paste that in.
:vs tmp
- Run
:AleFix
on that shortened file. - Copy-all:
ggVG"*y
- Close that file
:q!
- Do
gv
to re-highlight the visual selection at the start. - Paste in the copy-buffer
p
What might be a better way to do that? And if the above seems like it might be the best way, what might be a clean function to do that with? (I'll try writing one myself as well...)