tmux Split Window Shell Alias

This is a super handy shell alias I found on Reddit.

Just came up with the simplest shell alias today. I often find myself wanting to edit a file quickly, but also wanting to keep my current shell open. So I created this little alias:

alias e='tmux split-window -h vim $@'

So you can do:

e some-file

.. to start editing the file without closing your current shell, where the pane will be closed as soon as you exit your editor. Just replace vim with your favorite editor, obviously.

Opening an editor in a new pane for quick editing : tmux

I’ve employed edit instead of e. With Vim, once you’ve opened the Vim split you can use the fzf plugin to search for a file and open it in that window. That means if you don’t want to enter the path you can quickly open the split, and then find the file with fzf.

About

I'm a technology professional who's been passionate about computers since my Grandad introduced me to an Intel 386 back in the 90s when I was a kid. Those moments inspired a passion within for technology, and I've been playing around with anything with a circuit board ever since. Whenever I have a moment you can probably find me working on something computer-related, and this is where I like to write about those moments.