Skip to content

Latest commit

 

History

21 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Vim plugin to align text by a delimiter

WidthAlign aligns the last occurrence of a delimiter within each line of the selected range by inserting spaces before the delimiter so that all delimiters appear in the same screen column.

Lines that do not contain the delimiter are left unchanged. Alignment is based on the displayed column, so tabs are handled correctly.

Commands

    :[range]WidthAlign [delimiter]

Align the last occurrence of {delimiter} in each line of the range. Without range works on the whole file. The default delimiter is "\".

Examples

    :WidthAlign

Align all lines with trailing backslashes.

    :5,20WidthAlign =

Align assignment operators between lines 5 and 20 inclusive.

    :'<,'>WidthAlign #

Align trailing comments.

    :'<,'>WidthAlign ->

Align the last "->" on each line.

Installation

mkdir -p ~/.vim/pack/width-align/start
cd ~/.vim/pack/width-align/start
git clone https://github.com/termctrlseq/width-align.vim
vim -u NONE -c "helptags width-align/doc" -c q

About

Vim plugin that aligns the last occurrence of a delimiter within each line

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages