From 53746f5a3e10bc5e1603daee0e75f13531568457 Mon Sep 17 00:00:00 2001 From: Suleyman Farajli Date: Sat, 10 Aug 2024 15:40:48 +0400 Subject: functionrc for shells added --- config/bash/bashrc | 4 ++++ config/shell/functionrc | 3 +++ config/shell/profile | 7 ++----- config/zsh/zshrc | 4 ++++ 4 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 config/shell/functionrc (limited to 'config') diff --git a/config/bash/bashrc b/config/bash/bashrc index 2692a4b..ca2435d 100644 --- a/config/bash/bashrc +++ b/config/bash/bashrc @@ -12,3 +12,7 @@ PS1='\e[01;31m$(code=${?##0};echo ${code:+[${code}]" "})\e[00m\u@\H \w % ' if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc" ];then source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc" fi + +if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/functionrc" ];then + source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/functionrc" +fi diff --git a/config/shell/functionrc b/config/shell/functionrc new file mode 100644 index 0000000..7be1e1e --- /dev/null +++ b/config/shell/functionrc @@ -0,0 +1,3 @@ +lfcd () { + cd "$(command lf -print-last-dir "$@")" +} diff --git a/config/shell/profile b/config/shell/profile index 640b2f4..c9de99a 100644 --- a/config/shell/profile +++ b/config/shell/profile @@ -18,8 +18,5 @@ export XDG_BIN_DIR="$HOME/.local/bin" export MAKEFLAGS="-j8" # Reduce compile times -lfcd () { - cd "$(command lf -print-last-dir "$@")" -} - -[ mkdir -p XDG_BIN_DIR ] && PATH="${XDG_BIN_DIR}":$PATH +mkdir -p "${XDG_BIN_DIR}" +PATH="${XDG_BIN_DIR}":$PATH diff --git a/config/zsh/zshrc b/config/zsh/zshrc index 4821fef..e9ee318 100755 --- a/config/zsh/zshrc +++ b/config/zsh/zshrc @@ -70,3 +70,7 @@ bindkey -s '^f' '^ucd "$(dirname "$(fzf --reverse)")"\n' if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc" ];then source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc" fi + +if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/functionrc" ];then + source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/functionrc" +fi -- cgit v1.2.3