-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
General support for joining lines with line continuation characters #114
Comments
Yeah, that makes sense, I've thought about it myself. I guess it should be a global definition, of which there's currently none. I'll see what I can do about it. |
I'd also be quite keen on this kind of functionality for shell scripts e.g. transforming:- codeclimate() {
docker run --interactive --tty --rm --env CODE_PATH="$PWD" --volume "$PWD":/code --volume /var/run/docker.sock:/var/run/docker.sock --volume /tmp/cc:/tmp/cc codeclimate/codeclimate "$@"
} To:- codeclimate() {
docker run \
--interactive \
--tty \
--rm \
--env CODE_PATH="$PWD" \
--volume "$PWD":/code \
--volume /var/run/docker.sock:/var/run/docker.sock \
--volume /tmp/cc:/tmp/cc codeclimate/codeclimate "$@"
} And back. Currently just do a |
I wrote https://github.com/flwyd/vim-conjoin to remove line continuation characters for several dozen filetypes (though I wasn't aware of Lua's Conjoin only removes characters when joining lines, it doesn't add line continuations when splitting, so it doesn't help the shell script example in comment 3. |
Sorry for ignoring this issue for quite a while. I think I kept postponing it, because I wanted to implement a general "global" setup. Instead, to provide at least something that's helpful, I've pushed a branch, line-continuations which implement splitting for the It only splits one at a time, so for large command-lines, it could take some @gaving, if you're still around, I'd appreciate your thoughts on your use case. @kiryph The implementation might be reusable, since the way the plugin is implemented, it just triggers certain callbacks. If the bash example works well, I could manually add support for several other filetypes rather than generalizing. What do you think? |
Update: I've merged the branch, since I've found it pretty useful for bash myself. |
@AndrewRadev Just seen this, look forward to trying it out! |
I miss support for the commonly found line continuation style with a trailing backslash when joining lines. For example in cmake:
I would like to have following behavior: when joining those lines, the backslashes are automatically removed.
Many languages use this style:
and most likely many more which I am however not familiar with.
I know this does not apply to all languages, e.g. Lua which uses
\z
:The text was updated successfully, but these errors were encountered: