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.

I'd like to configure both Vim and Emacs to be able to run bash scripts from within the editor, so that I can commit/push my code without having to leave the editor.

Could someone help me out with this?

Thanks!

share|improve this question
add comment

4 Answers

Within Vim, you can run any command using :!, e.g.,

:!ls

or

:!hg ci -m "Check-in comment"

See

:help :!
share|improve this answer
add comment

Emacs has a shell mode that can used to open a shell. Try Escxshell.

However, if you want to commit code from with emacs, there are modules which allow you to work with version control from within emacs. The installations I have worked with automatically detects files under version control. Version control shows up in the file status line.

share|improve this answer
add comment

The :! command is as old as venerable vi; to speed up the repeated application (beyond :!!), either set up custom mappings (:nnoremap ...), or use a plugin like vcscommand.vim - CVS/SVN/SVK/git/hg/bzr integration plugin, which provides a lot of VCS-related functionality.

share|improve this answer
add comment

Instead of some bash scripts you can use some scripts for Vim or Emacs that run as wrappers around Git, so you can use git commands without leaving the editor.

A great Git plugin for Vim is fugitive, some Emacs Git plugins are listed here.

If you're using both editors you can remap the keys of the Git commands to be consistent.

share|improve this answer
add comment

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.