From 2c0cc201e96d2642121af62cf0336209a7d79475 Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Tue, 13 Sep 2022 23:09:03 -0400 Subject: [PATCH] tweaks to vim paste and git --- hosts/common.nix | 1 + modules/neovim/lua/keybinds.lua | 1 + modules/shell/git.nix | 3 +++ 3 files changed, 5 insertions(+) diff --git a/hosts/common.nix b/hosts/common.nix index a886392..e50cd98 100644 --- a/hosts/common.nix +++ b/hosts/common.nix @@ -72,6 +72,7 @@ home-manager.useUserPackages = true; # Allow specified unfree packages (identified elsewhere) + # Retrieves package object based on string name nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) config.unfreePackages; diff --git a/modules/neovim/lua/keybinds.lua b/modules/neovim/lua/keybinds.lua index ea8f6c2..e405bd1 100644 --- a/modules/neovim/lua/keybinds.lua +++ b/modules/neovim/lua/keybinds.lua @@ -75,3 +75,4 @@ key("n", "", ":noh", { silent = true }) --- Clear search in VimWiki key("n", "Y", "y$") --- Copy to end of line key("v", "", "y:%s/+//gc") --- Substitute selected key("v", "D", "y'>gp") --- Duplicate selected +key("x", "p", '"_dP') --- Paste but keep register diff --git a/modules/shell/git.nix b/modules/shell/git.nix index 4e77837..4b402c3 100644 --- a/modules/shell/git.nix +++ b/modules/shell/git.nix @@ -67,6 +67,9 @@ in { cdg = "cd (git rev-parse --show-toplevel)"; }; + # Required for fish commands + home.packages = with pkgs; [ fish fzf bat ]; + programs.fish.functions = lib.mkIf (builtins.elem pkgs.fzf home-packages && builtins.elem pkgs.bat home-packages) { git = { body = builtins.readFile ./fish/functions/git.fish; };