-1

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!

4 Answers 4

1

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

:!ls

or

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

See

:help :!
1

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.

1

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.

0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .