diff --git a/docs/aerospace-keybindings.md b/docs/aerospace-keybindings.md new file mode 100644 index 0000000..0afaa25 --- /dev/null +++ b/docs/aerospace-keybindings.md @@ -0,0 +1,66 @@ +# aerospace keybindings + +## main + +| Key | Command(s) and actions | +|-----------------|-----------------------------------------------| +| alt-a | mode apps | +| alt-h | focus left | +| alt-j | focus down | +| alt-k | focus up | +| alt-l | focus right | +| alt-m | mode move | +| alt-s | mode service | +| alt-shift-1 | workspace 1 | +| alt-shift-2 | workspace 2 | +| alt-shift-tab | workspace-back-and-forth | +| ctrl-shift-1 | move-node-to-workspace 1 | +| ctrl-shift-2 | move-node-to-workspace 2 | +| ctrl-shift-tab | move-workspace-to-monitor --wrap-around prev | + +## apps + +| Key | Command(s) and actions | +|------|----------------------------------------------------------------------| +| b | exec-and-forget open -a /Applications/Brave Browser.app; mode main | +| c | exec-and-forget open -a /Applications/Ferdium.app; mode main | +| esc | reload-config; mode main | +| g | exec-and-forget open -a /Applications/Ghostty.app; mode main | +| o | exec-and-forget open -a /Applications/Obsidian.app; mode main | +| s | exec-and-forget open -a /Applications/Slack.app; mode main | +| t | exec-and-forget open -a /Applications/TIDAL.app; mode main | +| w | exec-and-forget open -a /Applications/WezTerm.app; mode main | + +## move + +| Key | Command(s) and actions | +|--------------|--------------------------------------------------| +| 1 | move-node-to-workspace 1 --focus-follows-window | +| 2 | move-node-to-workspace 2 --focus-follows-window | +| ctrl-h | resize smart -70 | +| ctrl-l | resize smart +70 | +| esc | reload-config; mode main | +| h | move left | +| j | move down | +| k | move up | +| l | move right | +| r | flatten-workspace-tree; mode main | +| shift-h | join-with left | +| shift-j | join-with down | +| shift-k | join-with up | +| shift-l | join-with right | +| shift-left | resize smart +70 | +| shift-right | resize smart -70 | + +## service + +| Key | Command(s) and actions | +|------------|-------------------------------------------| +| backspace | close-all-windows-but-current; mode main | +| esc | reload-config; mode main | +| f | layout floating tiling; mode main | +| r | flatten-workspace-tree; mode main | + +File generated: 2025-01-15 13:32:41 + +Config file: [config/aerospace/aerospace.toml](./../config/aerospace/aerospace.toml) diff --git a/local/bin/dfm b/local/bin/dfm index bf86ae4..2100e78 100755 --- a/local/bin/dfm +++ b/local/bin/dfm @@ -436,6 +436,7 @@ section_helpers() "colors:Show colors" "env:Show environment variables" "functions:Show functions" + "aerospace:Show aerospace keybindings" "nvim:Show nvim keybindings" 'path:Show $PATH dir by dir' "tmux:Show tmux keybindings" @@ -494,6 +495,7 @@ section_helpers() "env") env | sort ;; "functions") declare -F ;; + "aerospace") cat "$DOTFILES/docs/aerospace-keybindings.md" ;; "nvim") cat "$DOTFILES/docs/nvim-keybindings.md" ;; "tmux") cat "$DOTFILES/docs/tmux-keybindings.md" ;; "wezterm") cat "$DOTFILES/docs/wezterm-keybindings.md" ;; @@ -507,6 +509,7 @@ section_docs() MENU=( "all:Update all keybindings documentations" + "aerospace:Update aerospace keybindings documentation" "tmux:Update tmux keybindings documentation" "nvim:Update nvim keybindings documentation" "wezterm:Update wezterm keybindings documentation" @@ -514,10 +517,12 @@ section_docs() case "$1" in all) + $0 docs aerospace $0 docs tmux $0 docs nvim $0 docs wezterm ;; + aerospace) bash "$DOTFILES/scripts/create-aerospace-keymaps.php" ;; tmux) bash "$DOTFILES/local/bin/x-dfm-docs-xterm-keybindings" ;; nvim) bash "$DOTFILES/scripts/create-nvim-keymaps.sh" ;; wezterm) bash "$DOTFILES/scripts/create-wezterm-keymaps.sh" ;; diff --git a/scripts/create-aerospace-keymaps.php b/scripts/create-aerospace-keymaps.php new file mode 100755 index 0000000..ee7591f --- /dev/null +++ b/scripts/create-aerospace-keymaps.php @@ -0,0 +1,67 @@ +#!/usr/bin/env php + $value) { + $k = str_pad($key, $k_len + 1); + $v = str_pad($value, $v_len + 1); + $output[] = sprintf("| %s | %s |", $k, $v); + } + + return implode("\n", $output); +} + +$contents = []; +$contents[] = "# aerospace keybindings"; + +$contents[] = process_section("main", $main); + +ksort($config); + +foreach ($config as $mode => $bindings) { + $contents[] = process_section($mode, $bindings); +} + +$contents[] = "\nFile generated: " . date("Y-m-d H:i:s") . "\n"; + +$config_file_name = 'config/aerospace/aerospace.toml'; +$config_file_source = './../config/aerospace/aerospace.toml'; +$contents[] = "Config file: [$config_file_name]($config_file_source)\n"; + +$file = implode("\n", $contents); +file_put_contents($dest, $file);