From 4253ae326cf2447ae0eb317f1ffe9613b0ae6757 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Wed, 5 Jun 2024 20:05:34 +0200 Subject: [PATCH] Wed Jun 5 08:05:34 PM CEST 2024 --- home/hyprland/default.nix | 13 ++++++++----- home/hyprland/files/vim-hypr-nav.sh | 5 +++-- home/nvim/default.nix | 9 +++------ home/zsh/default.nix | 1 + 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/home/hyprland/default.nix b/home/hyprland/default.nix index ec62ba3..858c645 100644 --- a/home/hyprland/default.nix +++ b/home/hyprland/default.nix @@ -62,7 +62,10 @@ in { indicator = true; }; - home.packages = with pkgs; [ wl-clipboard ]; + home.packages = [ + pkgs.wl-clipboard + pkgs.jq + ]; services.cliphist = { enable = true; }; @@ -217,10 +220,10 @@ in { "$mainMod,XF86AudioLowerVolume, exec, ${playerctl} previous" '', Print, exec, grim -g "$(slurp -d)" - | wl-copy'' - "$mainMod, H, exec, ${./files/vim-hypr-nav.sh} l" - "$mainMod, L, exec, ${./files/vim-hypr-nav.sh} r" - "$mainMod, K, exec, ${./files/vim-hypr-nav.sh} u" - "$mainMod, J, exec, ${./files/vim-hypr-nav.sh} d" + "$mainMod, H, exec, ${./files/vim-hypr-nav.sh} l 2>> ~/error >> ~/output" + "$mainMod, L, exec, ${./files/vim-hypr-nav.sh} r 2>> ~/error >> ~/output" + "$mainMod, K, exec, ${./files/vim-hypr-nav.sh} u 2>> ~/error >> ~/output" + "$mainMod, J, exec, ${./files/vim-hypr-nav.sh} d 2>> ~/error >> ~/output" "$mainMod CONTROL_L, H, swapwindow, l" "$mainMod CONTROL_L, L, swapwindow, r" "$mainMod CONTROL_L, K, swapwindow, u" diff --git a/home/hyprland/files/vim-hypr-nav.sh b/home/hyprland/files/vim-hypr-nav.sh index 1eca3b0..4c25c49 100755 --- a/home/hyprland/files/vim-hypr-nav.sh +++ b/home/hyprland/files/vim-hypr-nav.sh @@ -1,6 +1,6 @@ #!/bin/sh -# -# vim-hypr-nav - Use the same bindings to move focus between hyprland windows + +# vim-hypr-nav - Use the same bindings to move focus between hyprland windows # and vim splits. Requires the accompanying vim plugin and jq. dir="$1" @@ -42,6 +42,7 @@ get_descendant_vim_pid() { if focused_pid="$(hyprctl activewindow -j | jq -e '.pid')"; then terms="$(find /dev/pts -type c -not -name ptmx | sed s#^/dev/## | tr '\n' ,)" if vim_pid="$(get_descendant_vim_pid "$focused_pid" "$terms")"; then + echo $terms $focused_pid $vim_pid servername_file="${XDG_RUNTIME_DIR:-/tmp}/vim-hypr-nav.$vim_pid.servername" read -r program servername <"$servername_file" diff --git a/home/nvim/default.nix b/home/nvim/default.nix index cfe11a0..deb8ded 100644 --- a/home/nvim/default.nix +++ b/home/nvim/default.nix @@ -14,6 +14,7 @@ unzip dotnet-sdk_8 cargo + neovim-unwrapped ]; home.file."${config.xdg.configHome}/nvim" = { @@ -49,11 +50,7 @@ HeaderFilterRegex: ''' FormatStyle: none ''; - - programs.neovim = { - enable = true; - viAlias = true; - vimAlias = true; - defaultEditor = true; + home.sessionVariables = { + EDITOR = "nvim"; }; } diff --git a/home/zsh/default.nix b/home/zsh/default.nix index e84f2cd..3dd0430 100644 --- a/home/zsh/default.nix +++ b/home/zsh/default.nix @@ -74,6 +74,7 @@ compress = "tar --use-compress-program = lbzip2 -cvf"; wget = ''wget --hsts-file = "$XDG_DATA_HOME/wget-hsts"''; python = "python3"; + vim = "nvim"; v = '' nvim -c ':lua require("oil").open()' && cd "$(cat /tmp/oil_dir 2> /dev/null || pwd)"''; cpr =