From 4c996a631153b042eda9644ef28cfdb528660cfb Mon Sep 17 00:00:00 2001 From: FollieHiyuki Date: Thu, 6 May 2021 18:11:51 +0300 Subject: [PATCH] shell: set MANPATH in man() function instead --- home/.bashrc-bloated | 2 +- home/.config/fish/conf.d/aliases.fish | 1 + home/.config/fish/conf.d/env.fish | 1 - home/.config/fish/functions/man.fish | 6 ++++++ home/.config/zsh/.zshenv | 2 -- home/.config/zsh/aliases.zsh | 1 + 6 files changed, 9 insertions(+), 4 deletions(-) diff --git a/home/.bashrc-bloated b/home/.bashrc-bloated index 2b96d14..ef070ad 100644 --- a/home/.bashrc-bloated +++ b/home/.bashrc-bloated @@ -365,7 +365,6 @@ fi # PATH export PATH=$HOME/.local/bin:$HOME/.local/bin/fzf:$NODENV_ROOT/bin:$PYENV_ROOT/bin:$POETRY_HOME/bin:$CARGO_HOME/bin:$GOPATH/bin:$NPM_CONFIG_PREFIX/bin:$PATH -export MANPATH=$HOME/.local/share/man:$MANPATH # _________________ # ___ |__ /__(_)_____ ________ @@ -416,6 +415,7 @@ alias ....='cd ../../..' # colorize man pages man() { + MANPATH=$HOME/.local/share/man:$MANPATH \ LESS_TERMCAP_mb=$'\e[01;31m' \ LESS_TERMCAP_md=$'\e[01;36m' \ LESS_TERMCAP_me=$'\e[0m' \ diff --git a/home/.config/fish/conf.d/aliases.fish b/home/.config/fish/conf.d/aliases.fish index bfcda25..2017938 100644 --- a/home/.config/fish/conf.d/aliases.fish +++ b/home/.config/fish/conf.d/aliases.fish @@ -5,6 +5,7 @@ # /_/ |_/_/ /_/ \__,_/ /____/ # # remap +abbr x extract abbr p pulsemixer alias startx='startx $HOME/.config/X11/xinitrc' alias fehwpp="feh --no-fehbg --bg-fill --randomize ~/Pictures/Wallpapers/*" diff --git a/home/.config/fish/conf.d/env.fish b/home/.config/fish/conf.d/env.fish index 27476e4..befc6b7 100644 --- a/home/.config/fish/conf.d/env.fish +++ b/home/.config/fish/conf.d/env.fish @@ -382,4 +382,3 @@ end # PATH set -gx fish_user_paths $HOME/.local/bin $HOME/.local/bin/fzf $NODENV_ROOT/bin $PYENV_ROOT/bin $POETRY_HOME/bin $CARGO_HOME/bin $GOPATH/bin $NPM_CONFIG_PREFIX/bin -set -gx MANPATH $HOME/.local/share/man:$MANPATH diff --git a/home/.config/fish/functions/man.fish b/home/.config/fish/functions/man.fish index 08904f1..d46b2bd 100644 --- a/home/.config/fish/functions/man.fish +++ b/home/.config/fish/functions/man.fish @@ -1,4 +1,10 @@ function man -d "man with colors" + if test -d $HOME/.local/share/man + set -x MANPATH "$HOME/.local/share/man:$__fish_data_dir/man:$MANPATH" + else + set -x MANPATH "$__fish_data_dir/man:$MANPATH" + end + set -x LESS_TERMCAP_mb (printf "\e[01;31m") # begin blink set -x LESS_TERMCAP_md (printf "\e[01;36m") # begin bold set -x LESS_TERMCAP_me (printf "\e[0m") # reset bold/blink diff --git a/home/.config/zsh/.zshenv b/home/.config/zsh/.zshenv index 55a8bb3..b14ea6b 100644 --- a/home/.config/zsh/.zshenv +++ b/home/.config/zsh/.zshenv @@ -403,5 +403,3 @@ fi typeset -U PATH path path=("$HOME/.local/bin" "$HOME/.local/bin/fzf" "$NODENV_ROOT/bin" "$PYENV_ROOT/bin" "$POETRY_HOME/bin" "$CARGO_HOME/bin" "$GOPATH/bin" "$NPM_CONFIG_PREFIX/bin" "$path[@]") export PATH - -export MANPATH="$HOME/.local/share/man:$MANPATH" diff --git a/home/.config/zsh/aliases.zsh b/home/.config/zsh/aliases.zsh index e4c2282..edb9e7f 100644 --- a/home/.config/zsh/aliases.zsh +++ b/home/.config/zsh/aliases.zsh @@ -41,6 +41,7 @@ alias ....='cd ../../..' # colorize man pages man() { + MANPATH=$HOME/.local/share/man:$MANPATH \ LESS_TERMCAP_mb=$'\e[01;31m' \ LESS_TERMCAP_md=$'\e[01;36m' \ LESS_TERMCAP_me=$'\e[0m' \