From 38e1a1d10604ac0b649103697258b2973fbb2b3e Mon Sep 17 00:00:00 2001 From: Cameron Reed Date: Fri, 16 Feb 2024 12:52:07 -0700 Subject: [PATCH] Update zshrc --- common/users/cameron/home-manager/zsh.nix | 32 +++++++++++++++++++++++ hosts/nixos/configuration.nix | 1 - 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/common/users/cameron/home-manager/zsh.nix b/common/users/cameron/home-manager/zsh.nix index 3174a1a..7ff3b6e 100644 --- a/common/users/cameron/home-manager/zsh.nix +++ b/common/users/cameron/home-manager/zsh.nix @@ -48,6 +48,9 @@ key[Shift-Tab]="''${terminfo[kcbt]}" key[Control-Left]="''${terminfo[kLFT5]}" key[Control-Right]="''${terminfo[kRIT5]}" +# Emacs bindings +bindkey -e + # setup key accordingly [[ -n "''${key[Home]}" ]] && bindkey -- "''${key[Home]}" beginning-of-line [[ -n "''${key[End]}" ]] && bindkey -- "''${key[End]}" end-of-line @@ -114,6 +117,35 @@ if [ "$TERM" = "xterm-kitty" ]; then alias ssh='kitty +kitten ssh' alias clear='printf "\033c"' fi + + +BOOKMARKS_DIR="$HOME/bookmarks" +mkdir -p "$BOOKMARKS_DIR" +export CDPATH="$HOME:$BOOKMARKS_DIR" + +function bookmark() { + target="$(pwd)" + mark_name="''${1:-$(basename $(pwd))}" + + if [ -e "$BOOKMARKS_DIR/$mark_name" ]; then + echo "Bookmark for $mark_name already exists" + else + ln -s "$target" "$BOOKMARKS_DIR/$mark_name" + echo "Created bookmark $mark_name to $target" + fi +} + +function rmbookmark() { + if [ -z "$1" ]; then + echo "Usage: $0 [mark_name]" + else + if [ ! -L "$BOOKMARKS_DIR/$1" ]; then + echo "No bookmark with name $1" + else + rm "$BOOKMARKS_DIR/$1" + fi + fi +} ''; shellAliases = { diff --git a/hosts/nixos/configuration.nix b/hosts/nixos/configuration.nix index c855acf..ca81625 100644 --- a/hosts/nixos/configuration.nix +++ b/hosts/nixos/configuration.nix @@ -10,7 +10,6 @@ (common_dir + /bootloader/systemd-boot.nix) (common_dir + /users/users.nix) (common_dir + /login-manager/tuigreet.nix) - (common_dir + /desktop/sway.nix) (common_dir + /desktop/hyprland.nix) ];