chore: move fish abbreviations to home declaration

pull/1/head
anemofilia 2023-09-23 12:04:11 -03:00
parent 4e27f8533b
commit 654a3f9ac9
No known key found for this signature in database
GPG Key ID: 5A8F3D62C87A2B33
3 changed files with 89 additions and 40 deletions

View File

@ -1,31 +0,0 @@
abbr --add m --set-cursor 'yt-dlp --prefer-free-formats --extract-audio "%"'
abbr --add v --set-cursor 'yt-dlp --prefer-free-formats "%"'
abbr --add zedit --set-cursor "zcat % | $EDITOR"
abbr --add tf --position anywhere --set-cursor 'setsid -f %>/dev/null 2>&1 & disown'
abbr --add zxz --set-cursor 'curl -F "file=@%" https://0.vern.cc | xsel -b'
abbr --add mpv --position anywhere --set-cursor 'mpv "%"'
abbr --add :links "$EDITOR ~/area/organization/links"
abbr --add :todo "$EDITOR ~/area/organization/todo"
# Research
abbr --add @research --position anywhere "~/area/research/assymptotically-periodic-functions/"
# Projects
set -l PROJECTS "$HOME/projects/code"
abbr --add @guix --position anywhere "$PROJECTS/scm/guix"
abbr --add @punk --position anywhere "$PROJECTS/cpp/Punk"
abbr --add @tomato --position anywhere "$PROJECTS/py/tomato-engine"
## Radix
set -l RADIX_REPO "$HOME/area/code/scm/radix"
abbr --add :system --position anywhere "$RADIX_REPO && $EDITOR /etc/config.scm"
abbr --add :home --position anywhere "$RADIX_REPO && $EDITOR radio.scm"
abbr --add @radix --position anywhere "$RADIX_REPO"
abbr --add @files --position anywhere "$RADIX_REPO/files"
abbr --add @modules --position anywhere "$RADIX_REPO/modules/radix"
# System and Home
abbr --add !system --position anywhere "doas guix system reconfigure /etc/config.scm"
abbr --add !home --position anywhere "guix home reconfigure ~/.config/guix/home.scm"

View File

@ -6,15 +6,11 @@
#:use-module (ice-9 rdelim) #:use-module (ice-9 rdelim)
#:use-module (radix combinators) #:use-module (radix combinators)
#:use-module (gnu packages shells) #:use-module (gnu packages shells)
#:export (abbreviations #:export (greeting
greeting
key-bindings key-bindings
prompt prompt
variables)) variables))
(define abbreviations
(local-file "../../../files/fish/abbreviations.fish"))
(define greeting (define greeting
(local-file "../../../files/fish/functions/greeting.fish")) (local-file "../../../files/fish/functions/greeting.fish"))

View File

@ -8,6 +8,7 @@
(radix packages wm) (radix packages wm)
(radix packages syndication) (radix packages syndication)
(radix home services) (radix home services)
(radix home services shells)
(radix utils) (radix utils)
((radix files awesome) #:prefix file:awesome-) ((radix files awesome) #:prefix file:awesome-)
((radix files emacs) #:prefix file:emacs-) ((radix files emacs) #:prefix file:emacs-)
@ -41,7 +42,7 @@
#|D|# desktop #|D|# desktop
#|G|# gnupg guix #|G|# gnupg guix
#|M|# mcron #|M|# mcron
#|S|# shells ssh shepherd #|S|# ssh shepherd
#|X|# xdg) #|X|# xdg)
(home-environment (home-environment
@ -199,8 +200,7 @@
#|Shell services|# #|Shell services|#
(service home-fish-service-type (service home-fish-service-type
(home-fish-configuration (home-fish-configuration
(config (list file:fish-abbreviations (config (list file:fish-key-bindings))
file:fish-key-bindings))
(aliases (aliases
`(#|Common aliases|# `(#|Common aliases|#
("df" . "df -h") ("df" . "df -h")
@ -238,7 +238,91 @@
#|Kakoune aliases for the shell|# #|Kakoune aliases for the shell|#
("':e'" . "kak") ("':e'" . "kak")
("':q'" . "exit"))))) ("':q'" . "exit")))
(abbreviations
(let ((code-projects "$HOME/projects/code"))
(list #|Quick access|#
(abbreviation
(name "@punk")
(position "anywhere")
(expansion
(format #f "~a/cpp/Punk"
code-projects)))
(abbreviation
(name "@guix")
(position "anywhere")
(expansion
(format #f "~a/scm/guix"
code-projects)))
(abbreviation
(name "@radix")
(position "anywhere")
(expansion
(format #f "~a/scm/radix"
code-projects)))
(abbreviation
(name "@files")
(position "anywhere")
(expansion
(format #f "~a/scm/radix/files"
code-projects)))
(abbreviation
(name "@modules")
(position "anywhere")
(expansion
(format #f "~a/scm/radix/modules/radix"
code-projects)))
(abbreviation
(name "@research")
(position "anywhere")
(expansion "$HOME/area/research"))
#|Quick edit|#
(abbreviation
(name ":system")
(expansion
(format #f "~a/scm/radix && $EDITOR buer.scm"
code-projects)))
(abbreviation
(name ":home")
(expansion
(format #f "~a/scm/radix && $EDITOR radio.scm"
code-projects)))
#|Media downloading|#
(abbreviation
(name "m")
(expansion
(format #f "yt-dlp --prefer-free-formats ~
--extract-audio \"%\"")))
(abbreviation
(name "v")
(expansion
"yt-dlp --prefer-free-formats \"%\""))
#|Guix reconfiguration|#
(abbreviation
(name "!home")
(expansion
(format #f "guix home reconfigure ~
$XDG_CONFIG_HOME/guix/home.scm")))
(abbreviation
(name "!system")
(expansion
"doas guix system reconfigure /etc/config.scm"))
#|Utils|#
(abbreviation
(name "zedit")
(expansion "zcat % | $EDITOR"))
(abbreviation
(name "tf")
(expansion
"setsid -f %>/dev/null 2>&1 & disown"))
(abbreviation
(name "zxz")
(expansion
"curl -F file=@% https://0x0.st | xsel -b")))))))
(simple-service 'environment-variables-service (simple-service 'environment-variables-service
home-environment-variables-service-type home-environment-variables-service-type