From 1b1ebaa302f872ff899ca6ec6a7775912a8194ad Mon Sep 17 00:00:00 2001 From: Luca Bilke Date: Thu, 11 Jul 2024 13:22:31 +0200 Subject: [PATCH] fix shortcuts in neovim --- .config/lf/shortcuts | 32 +++++++++++++-------------- .config/nvim/lua/config/shortcuts.lua | 32 +++++++++++++-------------- .config/nvim/lua/lib.lua | 2 +- .config/zsh/configs/hashes | 32 +++++++++++++-------------- .local/bin/shortcuts | 2 +- 5 files changed, 50 insertions(+), 50 deletions(-) diff --git a/.config/lf/shortcuts b/.config/lf/shortcuts index 3bddf01e5..957d95db6 100644 --- a/.config/lf/shortcuts +++ b/.config/lf/shortcuts @@ -1,22 +1,22 @@ # NOTE: Managed by shortcuts script -map gcf cd ~/.config -map gch cd ~/.cache -map gco cd ~/Documents/dev -map gdk cd ~/Desktop -map gdl cd ~/Downloads -map gdm cd ~/Documents -map gds cd ~/.local/share/stow/dots -map gdt cd ~/.local/share +map gcf cd /home/luca/.config +map gch cd /home/luca/.cache +map gco cd /home/luca/Documents/dev +map gdk cd /home/luca/Desktop +map gdl cd /home/luca/Downloads +map gdm cd /home/luca/Documents +map gds cd /home/luca/.local/share/stow/dots +map gdt cd /home/luca/.local/share map ge cd /etc -map gh cd ~ +map gh cd /home/luca map glo cd /usr/local -map gle cd ~/.local/libexec +map gle cd /home/luca/.local/libexec map glg cd /var/log map gmn cd /mnt -map gms cd ~/Music -map gpc cd ~/Pictures +map gms cd /home/luca/Music +map gpc cd /home/luca/Pictures map gr cd / -map gsc cd ~/.local/bin -map gst cd ~/.local/state -map gsv cd ~/.local/sv -map gvd cd ~/Videos +map gsc cd /home/luca/.local/bin +map gst cd /home/luca/.local/state +map gsv cd /home/luca/.local/sv +map gvd cd /home/luca/Videos diff --git a/.config/nvim/lua/config/shortcuts.lua b/.config/nvim/lua/config/shortcuts.lua index ee13f485f..8bbcdcb28 100644 --- a/.config/nvim/lua/config/shortcuts.lua +++ b/.config/nvim/lua/config/shortcuts.lua @@ -1,24 +1,24 @@ -- NOTE: Managed by shortcuts script return { - ["cf"] = "~/.config", - ["ch"] = "~/.cache", - ["co"] = "~/Documents/dev", - ["dk"] = "~/Desktop", - ["dl"] = "~/Downloads", - ["dm"] = "~/Documents", - ["ds"] = "~/.local/share/stow/dots", - ["dt"] = "~/.local/share", + ["cf"] = "/home/luca/.config", + ["ch"] = "/home/luca/.cache", + ["co"] = "/home/luca/Documents/dev", + ["dk"] = "/home/luca/Desktop", + ["dl"] = "/home/luca/Downloads", + ["dm"] = "/home/luca/Documents", + ["ds"] = "/home/luca/.local/share/stow/dots", + ["dt"] = "/home/luca/.local/share", ["e"] = "/etc", - ["h"] = "~", + ["h"] = "/home/luca", ["lo"] = "/usr/local", - ["le"] = "~/.local/libexec", + ["le"] = "/home/luca/.local/libexec", ["lg"] = "/var/log", ["mn"] = "/mnt", - ["ms"] = "~/Music", - ["pc"] = "~/Pictures", + ["ms"] = "/home/luca/Music", + ["pc"] = "/home/luca/Pictures", ["r"] = "/", - ["sc"] = "~/.local/bin", - ["st"] = "~/.local/state", - ["sv"] = "~/.local/sv", - ["vd"] = "~/Videos", + ["sc"] = "/home/luca/.local/bin", + ["st"] = "/home/luca/.local/state", + ["sv"] = "/home/luca/.local/sv", + ["vd"] = "/home/luca/Videos", } diff --git a/.config/nvim/lua/lib.lua b/.config/nvim/lua/lib.lua index 76a6ccfe9..6269b2f7d 100644 --- a/.config/nvim/lua/lib.lua +++ b/.config/nvim/lua/lib.lua @@ -6,7 +6,7 @@ function M.generate_shortcut_maps() local maps = {} for map, path in pairs(shortcuts) do maps[map] = function(state) - fs._navigate_internal(state, path, nil, nil, false) + fs.navigate(state, path, ".", function() end) end end return maps diff --git a/.config/zsh/configs/hashes b/.config/zsh/configs/hashes index 247d348e6..e99331812 100644 --- a/.config/zsh/configs/hashes +++ b/.config/zsh/configs/hashes @@ -1,22 +1,22 @@ # NOTE: Managed by shortcuts script -hash -d cf=~/.config -hash -d ch=~/.cache -hash -d co=~/Documents/dev -hash -d dk=~/Desktop -hash -d dl=~/Downloads -hash -d dm=~/Documents -hash -d ds=~/.local/share/stow/dots -hash -d dt=~/.local/share +hash -d cf=/home/luca/.config +hash -d ch=/home/luca/.cache +hash -d co=/home/luca/Documents/dev +hash -d dk=/home/luca/Desktop +hash -d dl=/home/luca/Downloads +hash -d dm=/home/luca/Documents +hash -d ds=/home/luca/.local/share/stow/dots +hash -d dt=/home/luca/.local/share hash -d e=/etc -hash -d h=~ +hash -d h=/home/luca hash -d lo=/usr/local -hash -d le=~/.local/libexec +hash -d le=/home/luca/.local/libexec hash -d lg=/var/log hash -d mn=/mnt -hash -d ms=~/Music -hash -d pc=~/Pictures +hash -d ms=/home/luca/Music +hash -d pc=/home/luca/Pictures hash -d r=/ -hash -d sc=~/.local/bin -hash -d st=~/.local/state -hash -d sv=~/.local/sv -hash -d vd=~/Videos +hash -d sc=/home/luca/.local/bin +hash -d st=/home/luca/.local/state +hash -d sv=/home/luca/.local/sv +hash -d vd=/home/luca/Videos diff --git a/.local/bin/shortcuts b/.local/bin/shortcuts index 39b0d8274..068bba4ee 100755 --- a/.local/bin/shortcuts +++ b/.local/bin/shortcuts @@ -18,7 +18,7 @@ write() { while IFS= read -r line; do shortcut=$(echo "$line" | cut -d' ' -f1) path=$(echo "$line" | cut -d' ' -f2) - path=$(eval "echo $path" | sed "s|${HOME}|~|g") + path=$(eval "echo $path") printf "hash -d %s=%s\n" "$shortcut" "$path" >>"$zsh" printf "map g%s cd %s\n" "$shortcut" "$path" >>"$lf"