chore: add fish abbreviations for xdg-user-dirs navigation
parent
17c7c9b717
commit
212e19f1c7
|
@ -5,3 +5,27 @@ end
|
|||
function bookmarks
|
||||
$EDITOR (string replace ':' '~/resources/bookmarks/' $argv[1])
|
||||
end
|
||||
|
||||
function xdg-base-directory
|
||||
function aux
|
||||
fenv "source ~/.config/user-dirs.dirs; echo $argv[1]" 2>/dev/null
|
||||
end
|
||||
switch (string replace '@' '' $argv[1])
|
||||
case "desktop"
|
||||
aux '$XDG_DESKTOP_DIR'
|
||||
case "documents"
|
||||
aux '$XDG_DOCUMENTS_DIR'
|
||||
case "downloads"
|
||||
aux '$XDG_DOWNLOAD_DIR'
|
||||
case "music"
|
||||
aux '$XDG_MUSIC_DIR'
|
||||
case "pictures"
|
||||
aux '$XDG_PICTURES_DIR'
|
||||
case "public"
|
||||
aux '$XDG_PUBLICSHARE_DIR'
|
||||
case "templates"
|
||||
aux '$XDG_TEMPLATES_DIR'
|
||||
case "videos"
|
||||
aux '$XDG_VIDEOS_DIR'
|
||||
end
|
||||
end
|
||||
|
|
18
radio.scm
18
radio.scm
|
@ -227,13 +227,29 @@
|
|||
#|Kakoune aliases for the shell|#
|
||||
("':e'" . "kak")
|
||||
("':q'" . "exit")))
|
||||
(environment-variables
|
||||
`(("fish_function_path"
|
||||
. (format #f "$fish_function_path~@{ ~a/functions~}"
|
||||
"$HOME/.guix-home/profile/share/fish"
|
||||
"$HOME/.config/fish/functions"))))
|
||||
(abbreviations
|
||||
(let ((code-projects "~/projects/code")
|
||||
(code-project-extensions
|
||||
'(c clj cpp el html kak md org pl py scm sh tex zig))
|
||||
(bookmarks
|
||||
'(emacs guile guix haunt misc)))
|
||||
'(emacs guile guix haunt misc))
|
||||
(xdg-user-directories
|
||||
'(desktop documents downloads
|
||||
music pictures public templates)))
|
||||
(list #|Quick access|#
|
||||
(abbreviation
|
||||
(name "@xdg-base-dir")
|
||||
(position 'anywhere)
|
||||
(pattern
|
||||
(apply format #f "@(~a~@{|~a~})"
|
||||
xdg-user-directories))
|
||||
(expansion
|
||||
(fish-function "xdg-base-directory")))
|
||||
(abbreviation
|
||||
(name "@extension")
|
||||
(position 'anywhere)
|
||||
|
|
Loading…
Reference in New Issue