I am looking for suggestions for a setup for my particular needs. I haven't done much linux since college and want to get back into it as a hobby. I have some not-too-powerful hardware (512 MB ram, single core). I want to do everything via text-based shells and editors, such as vim. My goal is to never touch the mouse.

I need the ability to have multiple shells open at once, one running a web server, one running vim, one running my application build pipeline, another one for ad-hoc shell commands such as wget, grepping and untarring, etc. I need to be able to open new shells and switch between shells quickly with the keyboard.

But even though I want multiple shells, I do not want a graphical desktop environment. I don't ever want to be tempted to use the mouse; part of my purpose is to force myself to learn the command-line way of doing various tasks.

I also want to be able to take advantage of my large monitor, running vim with a couple hundred columns dipslayed.

8 Answers
8

I read through your questions several times before I realized that I definitely have a recommendation for you: vim with tmux:http://tmux.sourceforge.net/

tmux is a screen 'multiplexor' that lets you have several windows and panes 'within 1'

It is a successor to the venerable 'screen' program, long a staple of many cli coders. One of its original winning features over vim was the ability to do split windows vertically as well as horizontally. However screen has moved forward and can now do that too.

Example:

Another part of the setup that I would recommend is a good set of aliases. These will make your typing and interaction a lot easier and quicker

Finally I make a few changes to my .bashrc file For example with shopt -s autocd when I type a directory name (that exists) my shell cd's into that directory immediately. Nifty! So here's my .bashrc changes:

Nice detailed answer. I've been using tmux for a bout a year now (and vi/vim for about 25) but I picked up some things here.
–
DanNov 27 '12 at 22:58

Great, great answer for a noob like me. About the only thing missing is what vim plugins you use... but that is another question for another day. :) Thanks again... alhtough it will take me forever to go through it and try everything out, I wanted to go ahead give you the accepted answer.
–
Kevin PauliNov 30 '12 at 21:02

Sure, I actually think I'm not using any plugins but I know there are many available including some for my area of ruby on rails.
–
Michael DurrantDec 1 '12 at 14:44

Much of what you say here may be useful, but one thing is off: vim can readily split panes both horiz and vertically.
–
dubiousjimDec 31 '12 at 0:08

I used ratpoison for a year in the past but XMonad felt more robust. I never had any problems in my 256MB, 512MB boxes with it. Ratpoison had some stability problems, but this is anecdotal and things might have changed since then.

I also used GNU screen but tmux has some features that screen hasn't.

If you already know vim, you'd better not learn a new tool. If you don't, Emacs can employ multiple shells (C-u M-x shell), use your favorite shell (M-x term), you can write, compile and debug your programs, read your mails, hangout in IRC, read web/info/man pages, run most REPL shells (e.g. M-x run-python), use git/hg/svn inside it, edit remote files with TRAMP, use dired to do almost all file operations, use grep/find/ack inside it. You can use Emacs with or without X. You don't need a terminal multiplexer like screen or tmux, but I prefer to run emacs as a server and use emacsclient from tmux if running it from shell.

I undertook a similar endeavor a couple of months ago, abandoning my mouse and exploring a multitude of set ups and window managers. Looks like you've already been offered plenty of helpful suggestions, but I figured a couple extra cents couldn't hurt. Here's my two:

Take a look at i3 window manager. It's light, with simple configuration and doesn't require a recompile after altering the config. Tiling functionality and tagged workspaces mean no mouse and endless possibilities based on preference and screen space. Programs can be assigned to tags and keys can be bound to just about anything. i3status or conky are easily piped to i3 for system info. Install dmenu and unplug your mouse.

Try a light distro. Arch, Gentoo, and Slackware all offer different options for setting up a light environment. Start small, and pay attention to dependencies. Install only what you need and learn to configure it properly.
Don't start X on boot. Learn to use all of the tools at your expense. Vim is a beast. If you already know it, use it. If not, learn it. Pay attention to the details. Learn what you have on your system and why it's there.

Seconding the "light distro" approach. It really forces you to get your hands dirty, even if they lay it out for you command by command (the Gentoo Install Handbook is excellent), because every system is different. The initial install doesn't even give you X, so you're stuck on the command line.
–
ND GeekNov 29 '12 at 15:42

I had a similar desire about six months ago. Primarily because I was working via SSH all day. As has already been suggested, use GNU screen. Its pretty terrible (IMHO) straight after installing it. However! It is highly customizable via the .screenrc file. There are plenty of online tutorials which provide code you can cut and paste to get it just as you like.

I went so far as to put together a few scripts for setting up such an environment - MALiCE - 'My Awesome Linux Coding Environment'. Its available on Github here:

This also documents a lots keyboard shortcuts as well as a sample .muttrc and .screenrc files - which are setup to work with things like gmail.

Note its not perfect but it may save you some time and effort to have a look at some of the config files and scripts. There's a strong vim bias.

I'd also recommend programs such as cmus (text-based media player - pretty good) and mutt (email client - again configured via text file .muttrc). There are also text-based IRC clients and believe it or not, text-based video decoders which will turn video into ASCII - a bit extreme but each to their own.

If you don't want a desktop at all then there are number of options. For example you could install slackware, which if I remember correctly boots to a command-line interface. You have to go out of your way to start the GUI.

The key to this is not the distribution, but the tools. Just stop using GUI tools, and tweak the CLI tools to look and behave exactly as you'd like. One way is to edit ~/.Xresources, and then load it with xrdb in ~/.xinitrc. There, you could also start a bunch of applications that you always use.

Obviously you need a good shell: I'd say zsh. You'll have to work extensively on ~/.zshrc. (But bash would work too, of course. Then, ~/.bashrc would be the place.)

Second, an editor. Emacs or vim, depending on which you currently use. A less advanced editor (e.g., nano) won't do. As with the shell, you'd do a lot of work on ~/.emacs or the corresponding init file(s).

You need to incorporate as much as you possibly can in your text editor. I'll give some examples from the Emacs world, simply because I'm an Emacs user. For mail, rmail. For file management, dired. For web browsing, W3M. For news, gnus (although I don't use it). For man pages, M-x man. And so on.

The reason you'd do this, and not use other CLI applications (e.g., just man for man pages, lynx for browsing, etc.) is:

1) the level of integration (kill, yank, make shortcuts; everything in a blink...)

As for X, you don't need to abandon it. Just because you want everything in CLI doesn't mean you don't want GFX at all (or - at least, I want CLI-only, and GFX). For example, although you modify images with (CLI) mogrify or convert, you'd still want to display it to check the result (for example, in gliv; just disable the menu bar not to be tempted to use the mouse). Another example is LaTeX and PDF documents.

As for the terminal, most people would say screen or tmux but you could also use the Linux virtual terminals (the console, or ttys). In X, urxvt has a Perl extension that enables tabs. For those (the ttys and urxvt) you could set up a uniform interface, for example Alt-J/K to switch between tabs, so you don't have to reach for the arrow keys (or whatever is default).

Good luck :) Feel free to mail me some pointers of your own when you're done (or almost there... you're never done), as I'm on the same track as you.