1
0
Fork 0

fix shortcuts in neovim

This commit is contained in:
Luca Bilke 2024-07-11 13:22:31 +02:00
parent c068deca98
commit 177da7b447
5 changed files with 50 additions and 50 deletions

View File

@ -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

View File

@ -1,24 +1,24 @@
-- NOTE: Managed by shortcuts script
return {
["<c-a>cf"] = "~/.config",
["<c-a>ch"] = "~/.cache",
["<c-a>co"] = "~/Documents/dev",
["<c-a>dk"] = "~/Desktop",
["<c-a>dl"] = "~/Downloads",
["<c-a>dm"] = "~/Documents",
["<c-a>ds"] = "~/.local/share/stow/dots",
["<c-a>dt"] = "~/.local/share",
["<c-a>cf"] = "/home/luca/.config",
["<c-a>ch"] = "/home/luca/.cache",
["<c-a>co"] = "/home/luca/Documents/dev",
["<c-a>dk"] = "/home/luca/Desktop",
["<c-a>dl"] = "/home/luca/Downloads",
["<c-a>dm"] = "/home/luca/Documents",
["<c-a>ds"] = "/home/luca/.local/share/stow/dots",
["<c-a>dt"] = "/home/luca/.local/share",
["<c-a>e"] = "/etc",
["<c-a>h"] = "~",
["<c-a>h"] = "/home/luca",
["<c-a>lo"] = "/usr/local",
["<c-a>le"] = "~/.local/libexec",
["<c-a>le"] = "/home/luca/.local/libexec",
["<c-a>lg"] = "/var/log",
["<c-a>mn"] = "/mnt",
["<c-a>ms"] = "~/Music",
["<c-a>pc"] = "~/Pictures",
["<c-a>ms"] = "/home/luca/Music",
["<c-a>pc"] = "/home/luca/Pictures",
["<c-a>r"] = "/",
["<c-a>sc"] = "~/.local/bin",
["<c-a>st"] = "~/.local/state",
["<c-a>sv"] = "~/.local/sv",
["<c-a>vd"] = "~/Videos",
["<c-a>sc"] = "/home/luca/.local/bin",
["<c-a>st"] = "/home/luca/.local/state",
["<c-a>sv"] = "/home/luca/.local/sv",
["<c-a>vd"] = "/home/luca/Videos",
}

View File

@ -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

View File

@ -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

View File

@ -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"