steve0hh

Yet another programmer

Fork me onGitHub

Writing Complicated Shell Commands

07 Sep 2014

Helloworld! :)

Just wanted to post a tip that I’ve found very useful!

Prerequisite

You must have $EDITOR enviroment variable set in your bashrc/zsh

You can do so by adding the following line in your .bashrc

export EDITOR=editor

So for me, I would like to use vim as my editor, I would do

export EDITOR=vim

While editing some frigging long bash command

You just hit CTRL-x-e.

It’ll open your set $EDITOR for you and you just edit the command inside it.

After which you just save and esc.

It’ll automatically add the command to your terminal.

Hope you guys found something helpful here. :)

comments powered by Disqus