AndrewRadev / sideways.vim

A Vim plugin to move function arguments (and other delimited-by-something items) left and right.
http://www.vim.org/scripts/script.php?script_id=4171
MIT License
478 stars 9 forks source link

Feature request: Bash Scripts #53

Open polvoazul opened 3 years ago

polvoazul commented 3 years ago

It would be nice to have bash support (I suppose something similar to html would work). I'm trying to use customization but it would be nice to have official support :)

polvoazul commented 3 years ago

Extra points if it supports multiline commands with escaped new lines (i cant get these to work):

ls file1 file2 \
    a_large_filename
AndrewRadev commented 3 years ago

I had forgotten about it, but it seems like there already is support for shell scripts. The filetype has to be sh or zsh and it seems to work sensibly for me, try it out on the arguments in this:

ls --full-time --no-group --all | grep -C5 "foo"

Admittedly, it doesn't work for the \ case. I'll see if I can figure out a solution, but before that, does the basic support not activate for you? Could it be a filetype detection issue? Looking at the built-in Vim runtime files, I guess there is a bash filetype, so maybe I just need to copy or reuse the existing support.

AndrewRadev commented 3 years ago

I've added support for the bash filetype, too, so it might work for you now. The backslash support is going to take some more fiddling.