Skip to content

Instantly share code, notes, and snippets.

@daemonhorn
Last active January 16, 2024 15:04
Show Gist options
  • Save daemonhorn/6ff67dd21a0abed9f87cc2134bbd326a to your computer and use it in GitHub Desktop.
Save daemonhorn/6ff67dd21a0abed9f87cc2134bbd326a to your computer and use it in GitHub Desktop.
Make bash do the nice tcsh things

Overview

I want to forget about differences between my Linux machines (running bash), and my BSD machines (running tcsh), and have user-friendly cli experience. The knobs below will cause bash/readline/less to behave more like tcsh defaults.

  1. Searching through history with filters
echo '"\e[B": history-search-forward' >>~/.inputrc
echo '"\e[A": history-search-backward' >>~/.inputrc
  1. Pager re-init and thus manpages causing screen to clear on quit
echo 'export PAGER="less -X"' >>~/.bashrc
  1. Command competion using case-insensitive search
echo 'set colored-completion-prefix on' >>~/.inputrc
echo 'set completion-ignore-case on' >>~/.inputrc
  1. Make vim not do the silly visual edit mode (breaks copy/paste with mouse)
echo 'set mouse-=a' >> ~/.vimrc
  1. logout and log back in for changes to take effect. You could also adjust globally via /etc/ configuration files, but that might become a POLA issue for another user on a shared machine.

  2. More to come...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment