grigoryvp Asked: 2009-06-23 00:47:43 +0800 CST2009-06-23 00:47:43 +0800 CST 2009-06-23 00:47:43 +0800 CST Can vim execute buffer without addons? 772 If editing some script in vim, a file with .py or .sh extension, is it any build-in vim command that allows to run such file? I know it's a lot of IDE-like addons for VIM that allows to execute files vim edit, but is it possible without addons? vim vi 1 Answers Voted Best Answer kubanczyk 2009-06-23T01:25:40+08:002009-06-23T01:25:40+08:00 I hope I'm not offending you by answering, that to run the current file (not buffer) you just :!% UPD: To run buffer to interpreter's standard input (without saving to a file first): :w !/bin/sh The latter can be also used with python, with perl -w, etc. By the way, a super useful technique is to filter a buffer through external command: 1G!Ggrep -v unwanted_regex All these are vi compatible.
I hope I'm not offending you by answering, that to run the current file (not buffer) you just
UPD: To run buffer to interpreter's standard input (without saving to a file first):
The latter can be also used with
python
, withperl -w
, etc.By the way, a super useful technique is to filter a buffer through external command:
All these are vi compatible.