Showing posts with label Vim. Show all posts
Showing posts with label Vim. Show all posts

2013-09-27

Vim configuration

My Vim configuration. Probably the only non-obvious thing is to use list to show whitespaces and listchars to display each tab as ">-". See Vim Wikia Highlight unwanted spaces for more information.

set guifont=Consolas:h10:cANSI
set ignorecase
set list
set listchars=tab:>-
set nobackup
set nowritebackup
set printfont=Courier:h8
set shiftwidth=2
set tabstop=2

2011-04-16

Running Batch Files in Vim Ex-Mode

To modify a file using vim in ex-mode, you should be able to do this: vim -esn < modify.ex File.txt. The -esn option starts vim in ex-mode, a non-interactive session and no backup is created. The modify.ex file can contain a sequence of editing commands, ending with wq to write and close the file. However, in a Windows cmd session, the editing commands in modify.ex are executed but vim doesn't exit.

My workaround is to run a command (-c option) which uses vim's source command to run modify.ex: vim -esn -c "source modify.ex" File.txt.