Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Vim comes with a script that is supposed to make it behave like an advanced version of less.

As per this blog article, one can use vim as a pager by setting up this alias:

alias lessv='/usr/share/vim/vim71/macros/less.sh'

However, if I do this on windows:

type console.aspx |vim -u "C:\Program Files (x86)\Vim\vim73\macros\less.vim"

Vim just kind of hangs there and does not respond to keystrokes. I have to kill the vim process to get my command line back. Is there a way to make this work on windows?

share|improve this question

1 Answer 1

You have to create a DOS batch file equivalent of macros\less.sh. The macros\less.vim file is just a set of macros that remap keys to make Vim behave more like less; macros\less.vim has to be read by Vim, not executed by itself.

I don't know enough about batch file programming to give you a complete solution, but this much will handle the case of reading the output of a pipe:

"C:\Program Files\Vim\vim73\vim.exe" --cmd "let no_plugin_maps = 1" -c "runtime! macros/less.vim" -

Put that line into a file named less.bat. You may have to change the path to vim.exe for your installation, or replace it with just vim.exe if vim.exe is in your PATH.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.