On 2011-10-13, Gill, Jack wrote:
> Newbie question:
> 
> Will Vim allow me to batch edit a text file, forcing characters per line to no
> more than 90, and placing a CR/LF at the end of that line?


Here's one way to do it.

    vim -E -s -u NONE -c 'set tw=90' -c 'set ff=dos' -c 'normal gggqG' -c 'wq' 
filename

That runs Vim in batch mode on the text file 'filename' with no
configuration files, sets the text width to 90 columns and the file
format for CR/LF line endings, reformats the entire file, then
writes the file and quits.

To see what each of those arguments/commands do, see the help
entries for each.

    :help -E
    :help -s
    :help -u
    :help -c
    :help tw
    :help ff
    :help :normal
    :help gg
    :help gq
    :help G

Regards,
Gary

-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to