20160117 why not vim - plembo/onemoretech GitHub Wiki

title: Why not vim? link: https://onemoretech.wordpress.com/2016/01/17/why-not-vim/ author: phil2nc description: post_id: 10493 created: 2016/01/17 20:57:54 created_gmt: 2016/01/18 01:57:54 comment_status: closed post_name: why-not-vim status: publish post_type: post

Why not vim?

Why not, indeed. For me one of the interesting things about trying out a new graphical programmer's editor is how I'm always reminded of a pledge I made years ago to just bite the bullet and become a vim master. After all, real men (and women) use vim, don't they? Pretty much all modern graphical programmer's editors can do useful stuff like running the current document as a script at the command line or executing routine git commands. Of course you can do both of those in tried and true vim as well. In fact, you can even do them in its graphical incarnation, gvim. The key to running scripts inside vim is to first make sure that the editor will run its commands in the directory where the currently loaded file resides. That's done by setting autochdir in .vimrc before getting started.

set autochdir

Executing any shell command in vim is as easy as hitting the colon key and then typing a bang (!) and the current file variable (%). If the file needs an interpreter (like a perl or python script), you should also specify the interpreter command. For example:

:!perl %

That's all there is to it!

Copyright 2004-2019 Phil Lembo