files: kak: Add more commands for editing files within radix

pull/1/head
Luis Guilherme Coelho 2024-01-01 13:10:31 -03:00
parent 103dee93dd
commit 2c532eb239
No known key found for this signature in database
GPG Key ID: 1F2E76ACE3F531C8
1 changed files with 37 additions and 20 deletions

View File

@ -50,51 +50,69 @@ define-command -override cron \
execute-keys ': e ~/.config/cron/' execute-keys ': e ~/.config/cron/'
} }
define-command -override todo \
-docstring 'edit todo list' %{
edit '~/areas/meta/todo'
}
define-command -override guix-todo \
-docstring 'edit todo list' %{
edit '~/projects/code/org/guix-todo/todo.org'
}
declare-option str radix '~/projects/code/scm/radix'
define-command -override radix \ define-command -override radix \
-docstring 'edit files in radix repository' %{ -docstring 'edit files in the radix git repository' %{
execute-keys ':edit ~/projects/code/scm/radix/' execute-keys ":e %opt{radix}/"
} }
define-command -override home \ define-command -override home \
-docstring 'edit home declaration' %{ -docstring 'edit home declaration' %{
evaluate-commands 'radix' edit "%opt{radix}/home-environments/%sh{whoami}.scm"
execute-keys 'home-environments/radio.scm<ret>'
} }
define-command -override system \ define-command -override system \
-docstring 'edit system declaration' %{ -docstring 'edit system declaration' %{
evaluate-commands 'radix' edit "%opt{radix}/operating-systems/%sh{hostname}.scm"
execute-keys 'operating-systems/buer.scm<ret>'
} }
declare-option str radix_files "%opt{radix}/files"
define-command -override files \ define-command -override files \
-docstring 'edit dotfiles' %{ -docstring 'edit dotfiles' %{
evaluate-commands 'radix' execute-keys ":e %opt{radix_files}/"
execute-keys 'files/'
} }
declare-option str radix_modules "%opt{radix}/modules/radix"
define-command -override modules \ define-command -override modules \
-docstring 'edit radix modules' %{ -docstring 'edit radix modules' %{
evaluate-commands 'radix' execute-keys ":e %opt{radix_modules}"
execute-keys 'modules/radix' }
declare-option str radix_services "%opt{radix_modules}/services"
define-command -override services \
-docstring 'edit radix services' %{
execute-keys ":e %opt{radix_services}/"
}
declare-option str radix_home_services "%opt{radix_modules}/home/services"
define-command -override home-services \
-docstring 'edit radix home services' %{
execute-keys ":e %opt{radix_home_services}/"
} }
define-command -override colorscheme-config \ define-command -override colorscheme-config \
-docstring 'edit colorscheme configuration file' %{ -docstring 'edit colorscheme configuration file' %{
evaluate-commands 'files' edit "%opt{radix_files}/kak/autoload/colorscheme.kak"
execute-keys 'kak/autoload/colorscheme.kak<ret>'
} }
define-command -override config \ define-command -override config \
-docstring 'edit kakoune main configuration file' %{ -docstring 'edit kakoune main configuration file' %{
evaluate-commands 'files' edit "%opt{radix_files}/kak/kakrc"
execute-keys 'kak/kakrc<ret>'
} }
define-command -override rss \ define-command -override rss \
-docstring 'edit rss feeds file' %{ -docstring 'edit rss feeds file' %{
evaluate-commands 'files' edit "%opt{radix_files}/newsraft/feeds"
execute-keys 'newsraft/feeds<ret>'
} }
define-command -override remind \ define-command -override remind \
@ -114,7 +132,6 @@ define-command -params 1 -override tex-project \
edit "%arg{1}.tex" edit "%arg{1}.tex"
execute-keys '16gA<esc>' execute-keys '16gA<esc>'
} }
define-command -override open-buffer-picker \ define-command -override open-buffer-picker \
-docstring 'open-buffer-picker: Opens buffer picker.' %{ -docstring 'open-buffer-picker: Opens buffer picker.' %{
prompt buffer: -buffer-completion %{ buffer %val{text} } prompt buffer: -buffer-completion %{ buffer %val{text} }
@ -242,7 +259,7 @@ hook -group config global BufCreate 'kakrc' %{
hook -group config global BufCreate '.*\.(bash_profile|profile|bashrc|bash_aliases)' %{ hook -group config global BufCreate '.*\.(bash_profile|profile|bashrc|bash_aliases)' %{
set-option buffer filetype sh set-option buffer filetype sh
} # Set bash configuration file's filetype to sh } # Set filetype of bash configuration files to sh
hook global BufCreate '\*scratch\*' %{ hook global BufCreate '\*scratch\*' %{
execute-keys '%<a-d>' execute-keys '%<a-d>'
@ -252,8 +269,8 @@ hook global BufCreate .* %{
add-highlighter buffer/ number-lines -relative -hlcursor add-highlighter buffer/ number-lines -relative -hlcursor
} # Set relative line numbers and visual line break } # Set relative line numbers and visual line break
hook global BufWritePost "%val{config}/kakrc" %{ hook global BufWritePost ".*/kakrc" %{
source "%val{config}/kakrc" source "%val{buffile}"
} # Source kakrc on save } # Source kakrc on save
hook global BufOpenFile '.*\.clj' %{ hook global BufOpenFile '.*\.clj' %{