Skip to main content

Use man efficiently

·1 min

Linux ships with a lot of documentation in the form of man pages, that are too complex and time consuming to read for quick access to oneliners, too many times i have encountered myself with the problem of finding a pipe command to do a specific task and the man is not helpful in this cases, here my personal configuration to make man pages and command more pleasant to use:

  • install the following packages
# on archlinux
pacman -S man vim nvim tealdeer wikiman arch-wiki-docs

# on debian
apt install -y man vim tealdeer
  • update tealdeer database
tldr --update
  • configure vim or neovim as manpager

inside .bashrc

# for nvim
export MANPAGER="nvim +Man!"

# for vim
export MANPAGER="vim -M +MANPAGER - "

Quick script to set manpager based on distro

source /etc/os-release
if [[ "$ID"="archlinux" ]]; then
	export MANPAGER="nvim +Man!"
else
	export MANPAGER="vim -M +MANPAGER - "
fi

Now man can be browsed with vim keybindings and for quick oneliners the tldr command can be used