Last active
April 3, 2016 10:02
-
-
Save yevhenpavliuk/a25d66d30fede4c72e90ed57d9547b4a to your computer and use it in GitHub Desktop.
ex-command-script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.KS | |
.IP "TTY_ARGV" 2n | |
The command, specified as an argument vector, that the TTY subwindow executes. | |
.KE | |
.KS | |
.IP "ICON_IMAGE" 2n | |
Sets or gets the remote image for icon's image. | |
.KE | |
.KS | |
.IP "XV_LABEL" 2n | |
Specifies a frame's header or an icon's label. | |
.KE | |
.KS | |
.IP "SERVER_SYNC" 2n | |
Synchronizes with the server once. | |
Does not set synchronous mode. | |
.KE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ex -S sort-ks-ke-blocks.vim ks-ke-blocks.txt | |
# ex - ks-ke-blocks.txt <sort-ks-ke-blocks.vim | |
# Doesn't work for me (I've tried only in Terminal on Mac OS X). | |
# I think it's because terminal removes control characters. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Add escapes at the end of each line (except the last) in KS-KE blocks. | |
global /^\.KS/,/^\.KE/-1 s/$/ | |
" global /^\.KS/,/^\.KE/-1 s/$/^[ | |
" Join lines in KS-KE blocks. | |
global /^\.KS/,/^\.KE/ join | |
% !sort | |
" Split lines joined by escape in KS-KE blocks. | |
% s/ / | |
/g | |
" % s/^[ /^M/g | |
write | |
quit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment