conjoin : Remove continuation characters when joining lines in vim
script karma |
Rating 4/1,
Downloaded by 255 |
Comments, bugs, improvements
|
Vim wiki
|
created by |
Trevor Stone |
|
script type |
utility |
|
description |
conjoin is a plugin that handles line joining in the presence of line continuation characters. Vim's normal behavior for `J` and `:join` on the following shell script:
cat file.txt \
| sort \
| uniq -c
leaves the backslash continuation characters in place:
cat file.txt \ | sort \ | uniq -c
With conjoin, running join commands will produce
cat file.txt | sort | uniq -c
String literals concatenated over several lines in languages like Python and Java are merged too.
By default, conjoin will create mappings for `J` and `gJ` as well as a `:Join` command. If a mapping already exists, conjoin will call the prior mapping after removing continuation characters. This lets it work well with splitjoin (vimscript #3613) as long as splitjoin appears before conjoin in runtimepath.
conjoin comes with support for continuation characters in many programming languages. See `:help conjoin` or https://github.com/flwyd/vim-conjoin for details on defining your own. |
|
install details |
Unzip the script package and add the path to vim-conjoin to your runtimepath. Alternatively, use a plugin manager:
" vim-plug:
Plug 'flwyd/vim-conjoin'
" Vundle:
Plugin 'flwyd/vim-conjoin'
" vim-addon-manager
VAMActivate github:flwyd/vim-conjoin |
|
script versions (upload new version)
Click on the package to download.
ip used for rating: 3.142.83.171
|