From 7d38b4076ef625721ad7d60cdafa35c00f1367cb Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Sun, 30 Jul 2023 13:41:04 +0900 Subject: [PATCH] Extract common aliases as to bin bash --- home/.bashrc | 7 ------- home/.config/home-manager/home.nix | 5 ++--- home/.config/homemade/.aliases.sh | 5 ----- home/.config/zsh/.zshrc | 2 -- home/.local/share/homemade/bin/la.bash | 3 +++ home/.local/share/homemade/bin/zj.bash | 3 +++ 6 files changed, 8 insertions(+), 17 deletions(-) delete mode 100644 home/.config/homemade/.aliases.sh create mode 100755 home/.local/share/homemade/bin/la.bash create mode 100755 home/.local/share/homemade/bin/zj.bash diff --git a/home/.bashrc b/home/.bashrc index 9b02d387..c4d6c559 100644 --- a/home/.bashrc +++ b/home/.bashrc @@ -119,11 +119,6 @@ fi # colored GCC warnings and errors #export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' -# some more ls aliases -alias ll='ls -alF' -alias la='ls -A' -alias l='ls -CF' - # Add an "alert" alias for long running commands. Use like so: # sleep 10; alert alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' @@ -179,5 +174,3 @@ function set_win_title() { starship_precmd_user_func="set_win_title" eval "$(zoxide init bash)" - -. "$XDG_CONFIG_HOME/homemade/.aliases.sh" diff --git a/home/.config/home-manager/home.nix b/home/.config/home-manager/home.nix index 6f25fe57..4717fb23 100644 --- a/home/.config/home-manager/home.nix +++ b/home/.config/home-manager/home.nix @@ -131,9 +131,6 @@ # Not under "starship/starship.toml" xdg.configFile."starship.toml".source = ../starship.toml; - # I call "homemade" for own created tools - xdg.configFile."homemade/.aliases.sh".source = ../homemade/.aliases.sh; - # basic shell dotfiles should be put in ~/ except part of zsh files home.file.".bashrc".source = ../../../home/.bashrc; home.file.".bash_logout".source = ../../../home/.bash_logout; @@ -152,6 +149,8 @@ # - Keep *.bash in shellscript naming in this repo for maintainability, the extname should be trimmed in the symlinks xdg.dataFile."homemade/bin/bench_shells".source = ../../../home/.local/share/homemade/bin/bench_shells.bash; xdg.dataFile."homemade/bin/updeps".source = ../../../home/.local/share/homemade/bin/updeps.bash; + xdg.dataFile."homemade/bin/la".source = ../../../home/.local/share/homemade/bin/la.bash; + xdg.dataFile."homemade/bin/zj".source = ../../../home/.local/share/homemade/bin/zj.bash; home.sessionPath = [ "${config.xdg.dataHome}/homemade/bin" ]; diff --git a/home/.config/homemade/.aliases.sh b/home/.config/homemade/.aliases.sh deleted file mode 100644 index 8246c6ee..00000000 --- a/home/.config/homemade/.aliases.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -alias la='exa --long --all --group-directories-first' - -alias zj='zellij attach "$(basename "$PWD")" || zellij --session "$(basename "$PWD")"' diff --git a/home/.config/zsh/.zshrc b/home/.config/zsh/.zshrc index ca6369fe..bb533365 100644 --- a/home/.config/zsh/.zshrc +++ b/home/.config/zsh/.zshrc @@ -14,8 +14,6 @@ typeset -g HISTORY_SUBSTRING_SEARCH_FUZZY='true' bindkey '^[[A' history-substring-search-up bindkey '^[[B' history-substring-search-down -. "$XDG_CONFIG_HOME/homemade/.aliases.sh" - setopt correct unsetopt BEEP # These pickup disanling does not work... diff --git a/home/.local/share/homemade/bin/la.bash b/home/.local/share/homemade/bin/la.bash new file mode 100755 index 00000000..c5d5cc53 --- /dev/null +++ b/home/.local/share/homemade/bin/la.bash @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +exa --long --all --group-directories-first "$@" diff --git a/home/.local/share/homemade/bin/zj.bash b/home/.local/share/homemade/bin/zj.bash new file mode 100755 index 00000000..83f818a6 --- /dev/null +++ b/home/.local/share/homemade/bin/zj.bash @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +zellij attach "$(basename "$PWD")" || zellij --session "$(basename "$PWD")"