From 82b36c590c689202580a9f6699843d164e0b83c6 Mon Sep 17 00:00:00 2001 From: punkfairie Date: Sun, 3 Nov 2024 15:00:19 -0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(fish):=20Add=20abbrs/aliases?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- home/profile/default.nix | 8 +++++--- home/programs/fish.nix | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/home/profile/default.nix b/home/profile/default.nix index 8db1d4f..b38defa 100644 --- a/home/profile/default.nix +++ b/home/profile/default.nix @@ -5,17 +5,19 @@ "${config.home.homeDirectory}/.local/bin" ]; - sessionVariables = { + sessionVariables = rec { HACK = "${config.home.homeDirectory}/hackin"; # TODO: remove this when neovim is installed. EDITOR = "nvim"; - VISUAL = "${config.home.sessionVariables.VISUAL}"; - SUDO_EDITOR = "${config.home.sessionVariables.VISUAL}"; + VISUAL = "${EDITOR}"; + SUDO_EDITOR = "${EDITOR}"; }; shellAliases = { c = "clear"; + e = "${config.home.sessionVariables.EDITOR}"; + v = "${config.home.sessionVariables.EDITOR}"; }; }; diff --git a/home/programs/fish.nix b/home/programs/fish.nix index 7b506b6..39cc6e8 100644 --- a/home/programs/fish.nix +++ b/home/programs/fish.nix @@ -29,5 +29,37 @@ src = autopair; } ]; + + shellInit = # fish + '' + set -g fish_key_bindings fish_vi_key_bindings + ''; + + shellAbbrs = { + cp = { + position = "command"; + expansion = "cp -iv"; + }; + + mkdir = { + position = "command"; + expansion = "mkdir -pv"; + }; + + mv = { + position = "command"; + expansion = "mv -iv"; + }; + + rm = { + position = "command"; + expansion = "rm -r"; + }; + + grep = { + position = "command"; + expansion = "grep --color=auto"; + }; + }; }; }