4 ms·
All you need is set -o vi ;)
by roel_v 11y ago
All you need is set -o vi ;)
- zwischenzug 11y agoI'm a heavy vi user, but I just couldn't get used to that! Maybe I should use ed first. BTW I recently came across a contractor that routinely used ed because 'I want to know what's going on!'
- a3n 11y agoNo, all you need is a file called ~/.inputrc with at least the following contents: set editing-mode vi This causes any program that has its own command line (like bash, psql, etc) and uses the readline library (like bash, psql, etc) to have an editable command line with vi edit behavior. In man bash, search for /^READLINE (READLINE at the beginning of a line). Side note: if you want a nice TOC of bash or anything else, run this from the command line: man -P cat bash |grep -E "^[^ ]" Or if you're into the whole minimalism thing: man -P "grep -E '^[^ ]'" bash Or if you're into the whole reusability/automation thing: $ cat ~/bin/toc #! /usr/bin/env bash man -P "grep -E '^[^ ]'" $1 And then $ toc bash
- shabble 11y agoThe biggest issue[1] I've found with vi(m)-like modes in shells and readline is the lack of any feedback as to which mode you're in. That, and my tendency to use C-c as an alternative to esc in vim has...unfortunate consequences in the shell, although I could potentially rebind it. [1] Actually, the biggest is 'discovered it set by default on a server you occasionally adminster, and taking far too long to realise why you're typing largely gibberish'
- a3n 11y agoesc esc esc generally assures me that I'm in normal mode, even on the command line. :)
- agumonkey 11y agoWhen I'll make my vi clone, I'll call it lo, because all you need is lovi.