diff options
| -rw-r--r-- | desktop/.config/foot/foot.ini | 2 | ||||
| -rw-r--r-- | desktop/.config/kanshi/config | 11 | ||||
| -rw-r--r-- | desktop/.config/kglobalshortcutsrc | 356 | ||||
| -rwxr-xr-x | desktop/.config/sway/config | 8 | ||||
| -rw-r--r-- | emacs/.config/emacs/early-init.el | 5 | ||||
| -rw-r--r-- | emacs/.config/emacs/emacs-custom.el | 20 | ||||
| -rw-r--r-- | emacs/.config/emacs/init.el | 963 | ||||
| -rw-r--r-- | emacs/.config/emacs/lisp/kj-bindings.el | 2 | ||||
| -rw-r--r-- | emacs/.config/emacs/lisp/kj-development.el | 65 | ||||
| -rw-r--r-- | emacs/.config/emacs/lisp/kj-eshell.el | 2 | ||||
| -rw-r--r-- | emacs/.config/emacs/lisp/kj-history.el | 2 | ||||
| -rw-r--r-- | emacs/.config/emacs/lisp/kj-init.el | 443 | ||||
| -rw-r--r-- | emacs/.config/emacs/lisp/kj-lib.el | 14 | ||||
| -rw-r--r-- | emacs/.config/emacs/lisp/kj-multiple-cursors.el | 20 | ||||
| -rw-r--r-- | emacs/.config/emacs/lisp/kj-org.el | 251 | ||||
| -rw-r--r-- | emacs/.config/emacs/lisp/kj-timer.el | 49 | ||||
| -rw-r--r-- | emacs/.config/emacs/templates | 5 | ||||
| -rw-r--r-- | zsh/.zshenv | 2 | ||||
| -rw-r--r-- | zsh/.zshrc | 39 |
19 files changed, 1073 insertions, 1186 deletions
diff --git a/desktop/.config/foot/foot.ini b/desktop/.config/foot/foot.ini new file mode 100644 index 0000000..df415f6 --- /dev/null +++ b/desktop/.config/foot/foot.ini @@ -0,0 +1,2 @@ +[main] +font=Iosevka Term:size=16 diff --git a/desktop/.config/kanshi/config b/desktop/.config/kanshi/config index a765604..ce53adf 100644 --- a/desktop/.config/kanshi/config +++ b/desktop/.config/kanshi/config @@ -3,6 +3,17 @@ profile dock-office { output "HP Inc. HP Z27n G2 6CM9450CCQ" enable } +profile dock-emk { + output eDP-1 disable + output "HP Inc. HP E27u G4 CN41253JBX" enable position 1440,800 + output "HP Inc. HP Z27n G2 6CM9011FFS" enable position 0,0 transform 90 +} + +profile dock-dropin { + output eDP-1 disable + output "Dell Inc. DELL P3223QE JY37DP3" enable +} + profile dock-google { output eDP-1 disable output "Lenovo Group Limited LEN P32p-20 VNA6N4GT" enable diff --git a/desktop/.config/kglobalshortcutsrc b/desktop/.config/kglobalshortcutsrc deleted file mode 100644 index a8fd78b..0000000 --- a/desktop/.config/kglobalshortcutsrc +++ /dev/null @@ -1,356 +0,0 @@ -[$Version] -update_info=bismuth_shortcuts_category.upd:bismuth-shortcuts-category,bismuth_shortcuts_from_kwin.upd:bismuth-shortcuts-from-kwin - -[ActivityManager] -_k_friendly_name=Activity Manager -switch-to-activity-148e5128-f06e-426c-aab6-2d2f301bac72=none,none,Switch to activity "Default" -switch-to-activity-15940a25-4119-4457-a45c-ae3dc105ff3b=none,none,Switch to activity "Default" -switch-to-activity-63183cf3-006c-4635-9900-a772919d18df=none,none,Switch to activity "Develop" -switch-to-activity-b1843570-40e0-4b21-9eb9-f17152093ed6=none,none,Switch to activity "Default" - -[KDE Keyboard Layout Switcher] -Switch keyboard layout to Chinese=none,none,Switch keyboard layout to Chinese -Switch keyboard layout to English (Dvorak)=none,none,Switch keyboard layout to English (Dvorak) -Switch keyboard layout to English (US)=none,none,Switch keyboard layout to English (US) -Switch to Next Keyboard Layout=Meta+Alt+K,Meta+Alt+K,Switch to Next Keyboard Layout -_k_friendly_name=Keyboard Layout Switcher - -[bismuth] -_k_friendly_name=Window Tiling -decrease_master_size=Meta+H,,Decrease Master Area Size -decrease_master_win_count=Meta+[,Meta+[,Decrease Master Area Window Count -decrease_window_height=Meta+Ctrl+K,Meta+Ctrl+K,Decrease Window Height -decrease_window_width=Meta+Ctrl+H,Meta+Ctrl+H,Decrease Window Width -focus_bottom_window=none,Meta+J,Focus Bottom Window -focus_left_window=none,Meta+H,Focus Left Window -focus_next_window=Meta+J,,Focus Next Window -focus_prev_window=Meta+K,,Focus Previous Window -focus_right_window=none,Meta+L,Focus Right Window -focus_upper_window=none,Meta+K,Focus Upper Window -increase_master_size=Meta+T,,Increase Master Area Size -increase_master_win_count=Meta+],Meta+],Increase Master Area Window Count -increase_window_height=Meta+Ctrl+J,Meta+Ctrl+J,Increase Window Height -increase_window_width=Meta+Ctrl+L,Meta+Ctrl+L,Increase Window Width -move_window_to_bottom_pos=Meta+Shift+J,Meta+Shift+J,Move Window Down -move_window_to_left_pos=Meta+Shift+H,Meta+Shift+H,Move Window Left -move_window_to_next_pos=none,,Move Window to the Next Position -move_window_to_prev_pos=none,,Move Window to the Previous Position -move_window_to_right_pos=Meta+Shift+L,Meta+Shift+L,Move Window Right -move_window_to_upper_pos=Meta+Shift+K,Meta+Shift+K,Move Window Up -next_layout=Meta+\\\\,Meta+\\\\,Switch to the Next Layout -prev_layout=Meta+|,Meta+|,Switch to the Previous Layout -push_window_to_master=Meta+Return,Meta+Return,Push Active Window to Master Area -rotate=Meta+R,Meta+R,Rotate -rotate_part=Meta+Shift+R,Meta+Shift+R,Rotate Part -rotate_reverse=none,,Rotate (Reverse) -toggle_float_layout=Meta+Shift+F,Meta+Shift+F,Toggle Floating Layout -toggle_monocle_layout=Meta+M,Meta+M,Toggle Monocle Layout -toggle_quarter_layout=none,,Toggle Quarter Layout -toggle_spiral_layout=none,,Toggle Spiral Layout -toggle_spread_layout=none,,Toggle Spread Layout -toggle_stair_layout=none,,Toggle Stair Layout -toggle_three_column_layout=none,,Toggle Three Column Layout -toggle_tile_layout=none,Meta+T,Toggle Tile Layout -toggle_window_floating=Meta+F,Meta+F,Toggle Active Window Floating - -[emacsclient-3.desktop] -_k_friendly_name=emacsclient -c -_launch=none,none,emacsclient -c - -[emacsclient.desktop] -_k_friendly_name=Emacs (Client) -_launch=none,none,Emacs (Client) -new-instance=none,none,New Instance -new-window=none,none,New Window - -[kaccess] -Toggle Screen Reader On and Off=Meta+Alt+S,Meta+Alt+S,Toggle Screen Reader On and Off -_k_friendly_name=Accessibility - -[kcm_touchpad] -Disable Touchpad=Touchpad Off,Touchpad Off, -Enable Touchpad=Touchpad On,Touchpad On, -Toggle Touchpad=Touchpad Toggle\tMeta+Ctrl+Zenkaku Hankaku,Touchpad Toggle\tMeta+Ctrl+Zenkaku Hankaku, -_k_friendly_name=Touchpad - -[kded5] -Show System Activity=Ctrl+Esc,Ctrl+Esc,Show System Activity -_k_friendly_name=KDE Daemon -display=Display\tMeta+P,Display\tMeta+P,Switch Display - -[khotkeys] -_k_friendly_name=Custom Shortcuts Service -{d03619b6-9b3c-48cc-9d9c-a2aadb485550}=none,none,Search - -[kmix] -_k_friendly_name=Audio Volume -decrease_microphone_volume=Microphone Volume Down,Microphone Volume Down,Decrease Microphone Volume -decrease_volume=Volume Down,Volume Down,Decrease Volume -increase_microphone_volume=Microphone Volume Up,Microphone Volume Up,Increase Microphone Volume -increase_volume=Volume Up,Volume Up,Increase Volume -mic_mute=Microphone Mute\tMeta+Volume Mute,Microphone Mute\tMeta+Volume Mute,Mute Microphone -mute=Volume Mute,Volume Mute,Mute - -[ksmserver] -Halt Without Confirmation=none,,Halt Without Confirmation -Lock Session=Meta+L\tScreensaver,Meta+L\tScreensaver,Lock Session -Log Out=Ctrl+Alt+Del,Ctrl+Alt+Del,Log Out -Log Out Without Confirmation=none,,Log Out Without Confirmation -Reboot Without Confirmation=none,,Reboot Without Confirmation -_k_friendly_name=Session Management - -[kwin] -Activate Window Demanding Attention=Meta+Ctrl+A,Meta+Ctrl+A,Activate Window Demanding Attention -Decrease Opacity=none,,Decrease Opacity of Active Window by 5% -Edit Tiles=none,Meta+T,Toggle Tiles Editor -Expose=Ctrl+F9,Ctrl+F9,Toggle Present Windows (Current desktop) -ExposeAll=Ctrl+F10\tLaunch (C),Ctrl+F10\tLaunch (C),Toggle Present Windows (All desktops) -ExposeClass=Ctrl+F7,Ctrl+F7,Toggle Present Windows (Window class) -ExposeClassCurrentDesktop=none,none,Toggle Present Windows (Window class on current desktop) -Increase Opacity=none,,Increase Opacity of Active Window by 5% -Kill Window=Meta+Ctrl+Esc,Meta+Ctrl+Esc,Kill Window -Move Tablet to Next Output=none,none,Move the tablet to the next output -MoveMouseToCenter=Meta+F6,Meta+F6,Move Mouse to Center -MoveMouseToFocus=Meta+F5,Meta+F5,Move Mouse to Focus -MoveZoomDown=none,none,Move Zoomed Area Downwards -MoveZoomLeft=none,none,Move Zoomed Area to Left -MoveZoomRight=none,none,Move Zoomed Area to Right -MoveZoomUp=none,none,Move Zoomed Area Upwards -Overview=Meta+W,Meta+W,Toggle Overview -Setup Window Shortcut=none,,Setup Window Shortcut -Show Desktop=Meta+D,Meta+D,Peek at Desktop -ShowDesktopGrid=Meta+Space\tMeta+F8,Meta+F8,Show Desktop Grid -Suspend Compositing=Alt+Shift+F12,Alt+Shift+F12,Suspend Compositing -Switch One Desktop Down=Meta+Ctrl+Down,Meta+Ctrl+Down,Switch One Desktop Down -Switch One Desktop Up=Meta+Ctrl+Up,Meta+Ctrl+Up,Switch One Desktop Up -Switch One Desktop to the Left=Meta+Ctrl+Left,Meta+Ctrl+Left,Switch One Desktop to the Left -Switch One Desktop to the Right=Meta+Ctrl+Right,Meta+Ctrl+Right,Switch One Desktop to the Right -Switch Window Down=Meta+Alt+Down,Meta+Alt+Down,Switch to Window Below -Switch Window Left=Meta+Alt+Left,Meta+Alt+Left,Switch to Window to the Left -Switch Window Right=Meta+Alt+Right,Meta+Alt+Right,Switch to Window to the Right -Switch Window Up=Meta+Alt+Up,Meta+Alt+Up,Switch to Window Above -Switch to Desktop 1=Ctrl+F1\tMeta+1,Ctrl+F1,Switch to Desktop 1 -Switch to Desktop 10=none,,Switch to Desktop 10 -Switch to Desktop 11=none,,Switch to Desktop 11 -Switch to Desktop 12=none,,Switch to Desktop 12 -Switch to Desktop 13=none,,Switch to Desktop 13 -Switch to Desktop 14=none,,Switch to Desktop 14 -Switch to Desktop 15=none,,Switch to Desktop 15 -Switch to Desktop 16=none,,Switch to Desktop 16 -Switch to Desktop 17=none,,Switch to Desktop 17 -Switch to Desktop 18=none,,Switch to Desktop 18 -Switch to Desktop 19=none,,Switch to Desktop 19 -Switch to Desktop 2=Ctrl+F2\tMeta+2,Ctrl+F2,Switch to Desktop 2 -Switch to Desktop 20=none,,Switch to Desktop 20 -Switch to Desktop 3=Ctrl+F3\tMeta+3,Ctrl+F3,Switch to Desktop 3 -Switch to Desktop 4=Ctrl+F4\tMeta+4,Ctrl+F4,Switch to Desktop 4 -Switch to Desktop 5=Meta+5,,Switch to Desktop 5 -Switch to Desktop 6=Meta+6,,Switch to Desktop 6 -Switch to Desktop 7=Meta+7,,Switch to Desktop 7 -Switch to Desktop 8=Meta+8,,Switch to Desktop 8 -Switch to Desktop 9=Meta+9,,Switch to Desktop 9 -Switch to Next Desktop=none,,Switch to Next Desktop -Switch to Next Screen=none,,Switch to Next Screen -Switch to Previous Desktop=none,,Switch to Previous Desktop -Switch to Previous Screen=none,,Switch to Previous Screen -Switch to Screen 0=none,,Switch to Screen 0 -Switch to Screen 1=none,,Switch to Screen 1 -Switch to Screen 2=none,,Switch to Screen 2 -Switch to Screen 3=none,,Switch to Screen 3 -Switch to Screen 4=none,,Switch to Screen 4 -Switch to Screen 5=none,,Switch to Screen 5 -Switch to Screen 6=none,,Switch to Screen 6 -Switch to Screen 7=none,,Switch to Screen 7 -Switch to Screen Above=none,,Switch to Screen Above -Switch to Screen Below=none,,Switch to Screen Below -Switch to Screen to the Left=none,,Switch to Screen to the Left -Switch to Screen to the Right=none,,Switch to Screen to the Right -Toggle Night Color=none,none,Toggle Night Color -Toggle Window Raise/Lower=none,,Toggle Window Raise/Lower -Walk Through Desktop List=none,,Walk Through Desktop List -Walk Through Desktop List (Reverse)=none,,Walk Through Desktop List (Reverse) -Walk Through Desktops=none,,Walk Through Desktops -Walk Through Desktops (Reverse)=none,,Walk Through Desktops (Reverse) -Walk Through Windows=Alt+Tab,Alt+Tab,Walk Through Windows -Walk Through Windows (Reverse)=Alt+Shift+Backtab,Alt+Shift+Backtab,Walk Through Windows (Reverse) -Walk Through Windows Alternative=none,,Walk Through Windows Alternative -Walk Through Windows Alternative (Reverse)=none,,Walk Through Windows Alternative (Reverse) -Walk Through Windows of Current Application=Alt+`,Alt+`,Walk Through Windows of Current Application -Walk Through Windows of Current Application (Reverse)=Alt+~,Alt+~,Walk Through Windows of Current Application (Reverse) -Walk Through Windows of Current Application Alternative=none,,Walk Through Windows of Current Application Alternative -Walk Through Windows of Current Application Alternative (Reverse)=none,,Walk Through Windows of Current Application Alternative (Reverse) -Window Above Other Windows=none,,Keep Window Above Others -Window Below Other Windows=none,,Keep Window Below Others -Window Close=Alt+F4,Alt+F4,Close Window -Window Fullscreen=none,,Make Window Fullscreen -Window Grow Horizontal=none,,Expand Window Horizontally -Window Grow Vertical=none,,Expand Window Vertically -Window Lower=none,,Lower Window -Window Maximize=Meta+PgUp,Meta+PgUp,Maximize Window -Window Maximize Horizontal=none,,Maximize Window Horizontally -Window Maximize Vertical=none,,Maximize Window Vertically -Window Minimize=Meta+PgDown,Meta+PgDown,Minimize Window -Window Move=none,,Move Window -Window Move Center=none,,Move Window to the Center -Window No Border=none,,Toggle Window Titlebar and Frame -Window On All Desktops=none,,Keep Window on All Desktops -Window One Desktop Down=Meta+Ctrl+Shift+Down,Meta+Ctrl+Shift+Down,Window One Desktop Down -Window One Desktop Up=Meta+Ctrl+Shift+Up,Meta+Ctrl+Shift+Up,Window One Desktop Up -Window One Desktop to the Left=Meta+Ctrl+Shift+Left,Meta+Ctrl+Shift+Left,Window One Desktop to the Left -Window One Desktop to the Right=Meta+Ctrl+Shift+Right,Meta+Ctrl+Shift+Right,Window One Desktop to the Right -Window One Screen Down=none,,Window One Screen Down -Window One Screen Up=none,,Window One Screen Up -Window One Screen to the Left=none,,Window One Screen to the Left -Window One Screen to the Right=none,,Window One Screen to the Right -Window Operations Menu=Alt+F3,Alt+F3,Window Operations Menu -Window Pack Down=none,,Move Window Down -Window Pack Left=none,,Move Window Left -Window Pack Right=none,,Move Window Right -Window Pack Up=none,,Move Window Up -Window Quick Tile Bottom=Meta+Down,Meta+Down,Quick Tile Window to the Bottom -Window Quick Tile Bottom Left=none,,Quick Tile Window to the Bottom Left -Window Quick Tile Bottom Right=none,,Quick Tile Window to the Bottom Right -Window Quick Tile Left=Meta+Left,Meta+Left,Quick Tile Window to the Left -Window Quick Tile Right=Meta+Right,Meta+Right,Quick Tile Window to the Right -Window Quick Tile Top=Meta+Up,Meta+Up,Quick Tile Window to the Top -Window Quick Tile Top Left=none,,Quick Tile Window to the Top Left -Window Quick Tile Top Right=none,,Quick Tile Window to the Top Right -Window Raise=none,,Raise Window -Window Resize=none,,Resize Window -Window Shade=none,,Shade Window -Window Shrink Horizontal=none,,Shrink Window Horizontally -Window Shrink Vertical=none,,Shrink Window Vertically -Window to Desktop 1=none,,Window to Desktop 1 -Window to Desktop 10=none,,Window to Desktop 10 -Window to Desktop 11=none,,Window to Desktop 11 -Window to Desktop 12=none,,Window to Desktop 12 -Window to Desktop 13=none,,Window to Desktop 13 -Window to Desktop 14=none,,Window to Desktop 14 -Window to Desktop 15=none,,Window to Desktop 15 -Window to Desktop 16=none,,Window to Desktop 16 -Window to Desktop 17=none,,Window to Desktop 17 -Window to Desktop 18=none,,Window to Desktop 18 -Window to Desktop 19=none,,Window to Desktop 19 -Window to Desktop 2=none,,Window to Desktop 2 -Window to Desktop 20=none,,Window to Desktop 20 -Window to Desktop 3=none,,Window to Desktop 3 -Window to Desktop 4=none,,Window to Desktop 4 -Window to Desktop 5=none,,Window to Desktop 5 -Window to Desktop 6=none,,Window to Desktop 6 -Window to Desktop 7=none,,Window to Desktop 7 -Window to Desktop 8=none,,Window to Desktop 8 -Window to Desktop 9=none,,Window to Desktop 9 -Window to Next Desktop=none,,Window to Next Desktop -Window to Next Screen=Meta+Shift+Right,Meta+Shift+Right,Window to Next Screen -Window to Previous Desktop=none,,Window to Previous Desktop -Window to Previous Screen=Meta+Shift+Left,Meta+Shift+Left,Window to Previous Screen -Window to Screen 0=none,,Window to Screen 0 -Window to Screen 1=none,,Window to Screen 1 -Window to Screen 2=none,,Window to Screen 2 -Window to Screen 3=none,,Window to Screen 3 -Window to Screen 4=none,,Window to Screen 4 -Window to Screen 5=none,,Window to Screen 5 -Window to Screen 6=none,,Window to Screen 6 -Window to Screen 7=none,,Window to Screen 7 -_k_friendly_name=KWin -view_actual_size=none,Meta+0,Zoom to Actual Size -view_zoom_in=Meta++,Meta++,Zoom In -view_zoom_out=Meta+-,Meta+-,Zoom Out - -[mediacontrol] -_k_friendly_name=Media Controller -mediavolumedown=none,none,Media volume down -mediavolumeup=none,none,Media volume up -nextmedia=Media Next,Media Next,Media playback next -pausemedia=Media Pause,Media Pause,Pause media playback -playmedia=none,none,Play media playback -playpausemedia=Media Play,Media Play,Play/Pause media playback -previousmedia=Media Previous,Media Previous,Media playback previous -stopmedia=Media Stop,Media Stop,Stop media playback - -[org.kde.dolphin.desktop] -_k_friendly_name=Dolphin -_launch=none,Meta+E,Dolphin - -[org.kde.kcalc.desktop] -_k_friendly_name=KCalc -_launch=Launch (1),Launch (1),KCalc - -[org.kde.konsole.desktop] -NewTab=none,none,Open a New Tab -NewWindow=none,none,Open a New Window -_k_friendly_name=Konsole -_launch=Ctrl+Alt+T,Ctrl+Alt+T,Konsole - -[org.kde.krunner.desktop] -RunClipboard=Alt+Shift+F2,Alt+Shift+F2,Run command on clipboard contents -_k_friendly_name=KRunner -_launch=Alt+Space\tAlt+F2\tSearch,Alt+Space\tAlt+F2\tSearch,KRunner - -[org.kde.plasma.emojier.desktop] -_k_friendly_name=Emoji Selector -_launch=Meta+.\tMeta+Ctrl+Alt+Shift+Space,Meta+.\tMeta+Ctrl+Alt+Shift+Space,Emoji Selector - -[org.kde.spectacle.desktop] -ActiveWindowScreenShot=Meta+Print,Meta+Print,Capture Active Window -CurrentMonitorScreenShot=none,none,Capture Current Monitor -FullScreenScreenShot=Shift+Print,Shift+Print,Capture Entire Desktop -OpenWithoutScreenshot=none,none,Launch Spectacle without capturing -RectangularRegionScreenShot=Meta+Shift+Print,Meta+Shift+Print,Capture Rectangular Region -WindowUnderCursorScreenShot=Meta+Ctrl+Print,Meta+Ctrl+Print,Capture Window Under Cursor -_k_friendly_name=Spectacle -_launch=Print,Print,Launch Spectacle - -[org_kde_powerdevil] -Decrease Keyboard Brightness=Keyboard Brightness Down,Keyboard Brightness Down,Decrease Keyboard Brightness -Decrease Screen Brightness=Monitor Brightness Down,Monitor Brightness Down,Decrease Screen Brightness -Hibernate=Hibernate,Hibernate,Hibernate -Increase Keyboard Brightness=Keyboard Brightness Up,Keyboard Brightness Up,Increase Keyboard Brightness -Increase Screen Brightness=Monitor Brightness Up,Monitor Brightness Up,Increase Screen Brightness -PowerDown=Power Down,Power Down,Power Down -PowerOff=Power Off,Power Off,Power Off -Sleep=Sleep,Sleep,Suspend -Toggle Keyboard Backlight=Keyboard Light On/Off,Keyboard Light On/Off,Toggle Keyboard Backlight -Turn Off Screen=none,none,Turn Off Screen -_k_friendly_name=Power Management - -[plasmashell] -_k_friendly_name=Plasma -activate task manager entry 1=none,Meta+1,Activate Task Manager Entry 1 -activate task manager entry 10=Meta+0,Meta+0,Activate Task Manager Entry 10 -activate task manager entry 2=none,Meta+2,Activate Task Manager Entry 2 -activate task manager entry 3=none,Meta+3,Activate Task Manager Entry 3 -activate task manager entry 4=none,Meta+4,Activate Task Manager Entry 4 -activate task manager entry 5=none,Meta+5,Activate Task Manager Entry 5 -activate task manager entry 6=none,Meta+6,Activate Task Manager Entry 6 -activate task manager entry 7=none,Meta+7,Activate Task Manager Entry 7 -activate task manager entry 8=none,Meta+8,Activate Task Manager Entry 8 -activate task manager entry 9=none,Meta+9,Activate Task Manager Entry 9 -activate widget 28=Alt+F1,none,Activate Application Launcher Widget -activate widget 3=none,none,Activate Application Launcher Widget -clear-history=none,,Clear Clipboard History -clipboard_action=Meta+Ctrl+X,Meta+Ctrl+X,Automatic Action Popup Menu -cycle-panels=Meta+Alt+P,Meta+Alt+P,Move keyboard focus between panels -cycleNextAction=none,,Next History Item -cyclePrevAction=none,,Previous History Item -edit_clipboard=none,,Edit Contents… -manage activities=Meta+Q,Meta+Q,Show Activity Switcher -next activity=Meta+Tab,Meta+Tab,Walk through activities -previous activity=Meta+Shift+Tab,Meta+Shift+Tab,Walk through activities (Reverse) -repeat_action=Meta+Ctrl+R,Meta+Ctrl+R,Manually Invoke Action on Current Clipboard -show dashboard=Ctrl+F12,Ctrl+F12,Show Desktop -show-barcode=none,,Show Barcode… -show-on-mouse-pos=Meta+V,Meta+V,Show Items at Mouse Position -stop current activity=Meta+S,Meta+S,Stop Current Activity -switch to next activity=none,,Switch to Next Activity -switch to previous activity=none,,Switch to Previous Activity -toggle do not disturb=none,,Toggle do not disturb - -[systemsettings.desktop] -_k_friendly_name=System Settings -_launch=Tools,Tools,System Settings -kcm-kscreen=none,none,Display Configuration -kcm-lookandfeel=none,none,Global Theme -kcm-users=none,none,Users -powerdevilprofilesconfig=none,none,Energy Saving -screenlocker=none,none,Screen Locking diff --git a/desktop/.config/sway/config b/desktop/.config/sway/config index 4e8b396..890a06e 100755 --- a/desktop/.config/sway/config +++ b/desktop/.config/sway/config @@ -17,7 +17,7 @@ set $menu rofi -show run | xargs swaymsg exec -- default_border pixel 2 default_floating_border none -font pango:monospace 0 +# font pango:monospace 0 titlebar_padding 1 titlebar_border_thickness 0 @@ -78,6 +78,7 @@ bindsym $mod+Shift+z exec --no-startup-id 'swaylock' # Start your launcher bindsym $mod+d exec $menu bindsym $mod+t exec emacsclient -c + bindsym $mod+s exec grim -g $(slurp) # Drag floating windows by holding down $mod and left mouse button. # Resize them with right mouse button + $mod. @@ -144,11 +145,6 @@ bindsym $mod+Shift+z exec --no-startup-id 'swaylock' bindsym $mod+b splith bindsym $mod+v splitv - # Switch the current container between different layout styles - bindsym $mod+s layout stacking - bindsym $mod+w layout tabbed - bindsym $mod+e layout toggle split - # Make the current focus fullscreen bindsym $mod+f fullscreen diff --git a/emacs/.config/emacs/early-init.el b/emacs/.config/emacs/early-init.el index 8184bbb..3a8ac4b 100644 --- a/emacs/.config/emacs/early-init.el +++ b/emacs/.config/emacs/early-init.el @@ -1,6 +1,6 @@ ;;; -*- lexical-binding: t; -*- -(setq package-enable-at-startup nil) +;; (setq package-enable-at-startup nil) ;; Optimization: file name handlers not needed during startup. (defvar kj/file-name-handler-alist--old file-name-handler-alist) @@ -27,6 +27,7 @@ default-frame-alist '((tool-bar-lines . 0) (menu-bar-lines . 0) - (undecorated . t) + ;;; To prevent window border. + ;;;(undecorated . t) (vertical-scroll-bars . nil) (horizontal-scroll-bars . nil))) diff --git a/emacs/.config/emacs/emacs-custom.el b/emacs/.config/emacs/emacs-custom.el index 5d1cf73..29c4e38 100644 --- a/emacs/.config/emacs/emacs-custom.el +++ b/emacs/.config/emacs/emacs-custom.el @@ -4,13 +4,21 @@ ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(custom-safe-themes - '("0340489fa0ccbfa05661bc5c8c19ee0ff95ab1d727e4cc28089b282d30df8fc8" - "e3999eba4f25d912d7d61cbaaed1b551957e61da047279da89499d3bd1f1d007" - "8d412c0ed46b865312d6df5c1dfd1821d349dd3cba00049cf88c4ad34403597e" - "88267200889975d801f6c667128301af0bc183f3450c4b86138bfb23e8a78fb1" - default)) + '("fbf73690320aa26f8daffdd1210ef234ed1b0c59f3d001f342b9c0bbf49f531c" "0340489fa0ccbfa05661bc5c8c19ee0ff95ab1d727e4cc28089b282d30df8fc8" "e3999eba4f25d912d7d61cbaaed1b551957e61da047279da89499d3bd1f1d007" "8d412c0ed46b865312d6df5c1dfd1821d349dd3cba00049cf88c4ad34403597e" "88267200889975d801f6c667128301af0bc183f3450c4b86138bfb23e8a78fb1" default)) + '(package-selected-packages + '(modus-themes kj-emacs dslide org-download anki-editor yasnippet org-pomodoro eshell-syntax-highlighting esh-help pcmpl-args exercism tidal haskell-mode diff-hl dts-mode clojure-mode unobtrusive-magit-theme ledger-mode nix-mode rustic tempel puni magit gcmh smudge helpful pdf-tools pcre2el repeat-help selected ace-mc expand-region idle-highlight-mode diredfl anzu direnv ob-async mixed-pitch deadgrep wgrep coterm doom-themes with-editor zenburn-theme yasnippet-snippets yaml-mode which-key undo-tree tabbar session rust-mode puppet-mode pod-mode notmuch muttrc-mode mutt-alias lsp-mode initsplit ido-completing-read+ htmlize graphviz-dot-mode goto-chg gitignore-mode gitconfig-mode gitattributes-mode git-modes folding flycheck ess eproject editorconfig diminish csv-mode color-theme-modern browse-kill-ring boxquote bm bar-cursor apache-mode projectile embark-consult)) + '(package-vc-selected-packages '((kj-emacs :url "/home/orbekk/git/kj-emacs.git"))) '(safe-local-variable-values - '((eval sly-connect "localhost" 9090) (sly-port . 9090) + '((checkdoc-allow-quoting-nil-and-t . t) + (eval outline-hide-sublevels 3) + (eval outline-hide-sublevels 2) + (Package . CL-WHO) + (Package . HUNCHENTOOT) + (Base . 10) + (Package . CL-USER) + (Syntax . COMMON-LISP) + (eval sly-connect "localhost" 9090) + (sly-port . 9090) (checkdoc-package-keywords-flag)))) (custom-set-faces ;; custom-set-faces was added by Custom. diff --git a/emacs/.config/emacs/init.el b/emacs/.config/emacs/init.el index ddc40f1..007f7b6 100644 --- a/emacs/.config/emacs/init.el +++ b/emacs/.config/emacs/init.el @@ -1,9 +1,13 @@ ;;; -*- lexical-binding: t; -*- +;;;; Elpaca package setup +;; ;; NixOS emacs doesn't include a build time. Assume a recent version. +;; (setq elpaca-core-date 20240101) +;; (setq elpaca-directory "~/.cache/emacs/elpaca") +;; (load-file (expand-file-name "elpaca-installer.el" user-emacs-directory)) -;; NixOS emacs doesn't include a build time. Assume a recent version. -(setq elpaca-core-date 20240101) -(setq elpaca-directory "~/.cache/emacs/elpaca") -(load-file (expand-file-name "elpaca-installer.el" user-emacs-directory)) +(with-eval-after-load 'package + (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)) +(setopt use-package-always-ensure t) (add-hook 'emacs-startup-hook (lambda () @@ -13,15 +17,19 @@ (time-subtract after-init-time before-init-time))) gcs-done))) -(add-hook 'elpaca-after-init-hook 'kj/restore-file-name-handler-alist) +;;;; Workaround for module loading order. +(let ((file (expand-file-name "lisp/kj-google.el" user-emacs-directory))) + (when (file-exists-p file) + (load-file file))) -(elpaca elpaca-use-package - ;; Enable :elpaca use-package keyword. - (elpaca-use-package-mode) - ;; Assume :elpaca t unless otherwise specified. - (setq elpaca-use-package-by-default t)) -(elpaca-wait) +;; (elpaca elpaca-use-package +;; ;; Enable :ensure use-package keyword. +;; (elpaca-use-package-mode) +;; ;; Assume :ensure t unless otherwise specified. +;; (setq elpaca-use-package-by-default t)) +;; (elpaca-wait) +;;;; GC and performance (use-package gcmh :hook (elpaca-after-init . kj/enable-gcmh) @@ -30,11 +38,934 @@ (message "Enabling gcmh") (gcmh-mode 1))) -;; Include user configuration. +(setopt inhibit-compacting-font-caches t) +(add-hook 'elpaca-after-init-hook 'kj/restore-file-name-handler-alist) + +;;;; Utility functions +(defmacro define-repeating-key (keymap key cmd &optional desc) + `(let ((def + ,(if desc + `'(,desc . ,cmd) + `',cmd))) + (define-key ,keymap ,key def) + (put ',cmd 'repeat-map ',keymap))) + +(defun kj/default-directory-remote-p () + (file-remote-p default-directory)) +;;;; Basic settings and customizations +(defvar kj/cache-dir "~/.cache/emacs") + +(setopt user-full-name "KJ Orbekk" + user-mail-address "kj@orbekk.com" + + initial-scratch-message nil + + switch-to-buffer-obey-display-actions t + switch-to-buffer-in-dedicated-window 'pop + even-window-sizes 'width-only + custom-file (expand-file-name "emacs-custom.el" user-emacs-directory) + bookmark-file (expand-file-name "boomarks" kj/cache-dir) + use-short-answers t + outline-minor-mode-cycle t + outline-minor-mode-highlight 'override + fast-but-imprecise-scrolling t + visible-bell t + auto-save-list-file-prefix (expand-file-name + "auto-save-list/.saves-" kj/cache-dir) + alert-default-style 'libnotify + + use-dialog-box nil + display-time-24hr-format t + + next-screen-context-lines 10) + +(load custom-file :noerror t) + +;; This should be on by default, but it doesn't work until reloaded for some reason. +(auto-compression-mode 1) + +;; Disable annoying warnings. +(setq warning-minimum-level :error) + +(use-package transient + :config + (setq transient-levels-file (expand-file-name "transient/levels.el" kj/cache-dir) + transient-values-file (expand-file-name "transient/values.el" kj/cache-dir) + transient-history-file (expand-file-name "transient/history.el" kj/cache-dir))) + +;;;;; Modes +(use-package markdown-mode + :ensure t + :mode ("README\\.md\\'" . gfm-mode) + :init (setq markdown-command "multimarkdown")) + +(use-package emacs + :ensure nil + :custom + (auto-revert-avoid-polling t) + (auto-revert-interval 5) + (auto-revert-check-vc-info t) + :init + ;; (dolist (hook '(markdown-mode-hook + ;; org-mode-hook)) + ;; (add-to-list hook #'visual-line-mode)) + (global-hl-line-mode 1) + (global-auto-revert-mode 1)) + +;;;; Navigation + +(use-package avy + :bind + (("C-c l" . avy-goto-char) + ("C-c n" . avy-goto-line)) + :config + (setq avy-keys '(?a ?o ?e ?u ?i ?d ?h ?t ?n ?s)) + (defun avy-action-embark (pt) + (unwind-protect + (save-excursion + (goto-char pt) + (embark-act)) + (select-window + (cdr (ring-ref avy-ring 0)))) + t) + (setf (alist-get ?. avy-dispatch-alist) 'avy-action-embark) + (define-key isearch-mode-map (kbd "M-j") 'avy-isearch)) + +(winner-mode 1) + +(use-package ace-window + :bind + (("C-c e" . ace-window)) + :config + (setq aw-dispatch-always t) + (setq aw-keys '(?a ?o ?e ?u ?i ?d ?h ?t ?n ?s)) + ;; Make ace window more visible + ;; (custom-set-faces! + ;; '(aw-leading-char-face + ;; :foreground "white" :background "red" + ;; :weight bold :height 2.5 :box (:line-width 10 :color "red"))) + ) + +(defun kj/balance-main-window () + (balance-windows (window-main-window))) + +;; Prefer horizontal splits. +(setq split-height-threshold 100) + +(defun kj/split-window-below () + (interactive) + (split-window-below) + (kj/balance-main-window) + (other-window 1)) + +(defun kj/split-window-right () + (interactive) + (split-window-right) + (kj/balance-main-window) + (other-window 1)) + +(global-set-key (kbd "C-x 3") #'kj/split-window-right) +(global-set-key (kbd "C-x 2") #'kj/split-window-below) + +;;;; Completion +(use-package embark + :ensure t + + :bind + (("C-." . embark-act) + ("C-;" . embark-dwim) + ("C-h C-b" . embark-bindings)) + + :init + (setq prefix-help-command #'embark-prefix-help-command) + + :config + (defun find-file-keeping-default-directory (filename) + (let ((dir default-directory)) + (with-current-buffer (find-file filename) + (setq-local default-directory dir)))) + (define-key embark-file-map "@" 'find-file-keeping-default-directory) + + ;; Hide the mode line of the Embark live/completions buffers + (add-to-list 'display-buffer-alist + '("\\`\\*Embark Collect \\(Live\\|Completions\\)\\*" + . + (window-parameters (mode-line-format . none))))) + +(use-package vertico + :init + (vertico-mode)) + +(use-package marginalia + :bind + (:map minibuffer-local-map + ("M-n" . marginalia-cycle)) + :init + (marginalia-mode)) + +(use-package embark-consult + :ensure t + :after (embark consult) + :demand t + :hook (embark-mode . consult-preview-at-point-mode)) + +(defun kj/consult-ripgrep-here (&optional dir initial) + (interactive "P") + (unless dir + (setq dir default-directory)) + (consult-ripgrep dir initial)) + +;; Example configuration for Consult +(use-package consult + ;; Replace bindings. Lazily loaded due by `use-package'. + :bind (;; C-c bindings (mode-specific-map) + ("C-c h" . kj/consult-history) + ;;("C-c m" . consult-mode-command) + ("C-c k" . consult-kmacro) + ;; C-x bindings (ctl-x-map) + ("C-x M-:" . consult-complex-command) ;; orig. repeat-complex-command + ("C-x b" . consult-buffer) ;; orig. switch-to-buffer + ("C-x C-b" . consult-buffer) ;; orig. switch-to-buffer + ("C-x 4 b" . consult-buffer-other-window) ;; orig. switch-to-buffer-other-window + ("C-x 5 b" . consult-buffer-other-frame) ;; orig. switch-to-buffer-other-frame + ("C-x r b" . consult-bookmark) ;; orig. bookmark-jump + ("C-x p b" . consult-project-buffer) ;; orig. project-switch-to-buffer + ("C-c f r" . consult-recent-file) + ;; Custom M-# bindings for fast register access + ("M-#" . consult-register-load) + ("M-'" . consult-register-store) ;; orig. abbrev-prefix-mark (unrelated) + ("C-M-#" . consult-register) + ;; Other custom bindings + ("M-y" . consult-yank-pop) ;; orig. yank-pop + ("<help> a" . consult-apropos) ;; orig. apropos-command + ;; M-g bindings (goto-map) + ("M-g e" . consult-compile-error) + ("M-g f" . consult-flymake) ;; Alternative: consult-flycheck + ("M-g g" . consult-goto-line) ;; orig. goto-line + ("M-g M-g" . consult-goto-line) ;; orig. goto-line + ("M-g o" . consult-outline) ;; Alternative: consult-org-heading + ("M-g m" . consult-mark) + ("M-g k" . consult-global-mark) + ("M-g i" . consult-imenu) + ("M-g I" . consult-imenu-multi) + ;; M-s bindings (search-map) + ("M-s d" . consult-find) + ("M-s D" . consult-locate) + ;; ("M-s g" . consult-grep) + ("M-s G" . consult-git-grep) + ("M-s r" . consult-ripgrep) + ("M-s R" . kj/consult-ripgrep-here) + ("M-s l" . consult-line) + ("M-s L" . consult-line-multi) + ("M-s m" . consult-multi-occur) + ("M-s k" . consult-keep-lines) + ("M-s u" . consult-focus-lines) + ;; Isearch integration + ("M-s e" . consult-isearch-history) + :map isearch-mode-map + ("M-e" . consult-isearch-history) ;; orig. isearch-edit-string + ("M-s e" . consult-isearch-history) ;; orig. isearch-edit-string + ("M-s l" . consult-line) ;; needed by consult-line to detect isearch + ("M-s L" . consult-line-multi) ;; needed by consult-line to detect isearch + ;; Minibuffer history + :map minibuffer-local-map + ("M-s" . kj/consult-history) ;; orig. next-matching-history-element + ("M-r" . kj/consult-history)) ;; orig. previous-matching-history-element + + ;; Enable automatic preview at point in the *Completions* buffer. This is + ;; relevant when you use the default completion UI. + ;; :hook (completion-list-mode . consult-preview-at-point-mode) + + ;; The :init configuration is always executed (Not lazy) + :init + + ;; Optionally configure the register formatting. This improves the register + ;; preview for `consult-register', `consult-register-load', + ;; `consult-register-store' and the Emacs built-ins. + (setq register-preview-delay 0.5 + register-preview-function #'consult-register-format) + + ;; Optionally tweak the register preview window. + ;; This adds thin lines, sorting and hides the mode line of the window. + (advice-add #'register-preview :override #'consult-register-window) + + ;; Use Consult to select xref locations with preview + (setq xref-show-xrefs-function #'consult-xref + xref-show-definitions-function #'consult-xref) + + ;; Configure other variables and modes in the :config section, + ;; after lazily loading the package. + :config + + ;; Use consult for completion. + (setq completion-in-region-function #'consult-completion-in-region) + + ;; Optionally configure preview. The default value + ;; is 'any, such that any key triggers the preview. + (setq consult-preview-key '(:debounce 0.3 any)) + ;; (setq consult-preview-key (kbd "M-.")) + ;; (setq consult-preview-key (list (kbd "<S-down>") (kbd "<S-up>"))) + ;; For some commands and buffer sources it is useful to configure the + ;; :preview-key on a per-command basis using the `consult-customize' macro. + ;; (consult-customize + ;; consult-theme + ;; :preview-key '(:debounce 0.2 any) + ;; consult-ripgrep consult-git-grep consult-grep + ;; consult-bookmark consult-recent-file consult-xref + ;; consult--source-bookmark consult--source-recent-file + ;; consult--source-project-recent-file + ;; :preview-key (kbd "M-.")) + + ;; Optionally configure the narrowing key. + ;; Both < and C-+ work reasonably well. + (setq consult-narrow-key "<") ;; (kbd "C-+") + + (setq consult-ripgrep-args + "rg --null --line-buffered --color=never --max-columns=1000 --path-separator / --smart-case --no-heading --with-filename --line-number --search-zip --hidden") + + ;; Optionally make narrowing help available in the minibuffer. + ;; You may want to use `embark-prefix-help-command' or which-key instead. + ;; (define-key consult-narrow-map (vconcat consult-narrow-key "?") #'consult-narrow-help) + + ;; By default `consult-project-function' uses `project-root' from project.el. + ;; Optionally configure a different project root function. + ;; There are multiple reasonable alternatives to chose from. + ;;;; 1. project.el (the default) + ;;(setq consult-project-function #'consult--default-project-function) + ;;;; 2. projectile.el (projectile-project-root) + (autoload 'projectile-project-root "projectile") + (setq consult-project-function (lambda (_) (projectile-project-root))) + ;;;; 3. vc.el (vc-root-dir) + ;; (setq consult-project-function (lambda (_) (vc-root-dir))) + ;;;; 4. locate-dominating-file + ;; (setq consult-project-function (lambda (_) (locate-dominating-file "." ".git"))) + ) + +(use-package orderless + :init + (setq completion-styles '(orderless basic) + completion-category-defaults nil + completion-category-overrides '((file (styles partial-completion))))) + + +;;;; Appearance + +(use-package emacs + :ensure nil + :init + (column-number-mode) + (set-fringe-mode 10)) + +(use-package rainbow-delimiters + :defer t + :hook (prog-mode . rainbow-delimiters-mode)) + +(use-package emacs + :ensure nil + :init + (setq-default show-trailing-whitespace t) + (dolist (mode '(calendar-mode-hook + eshell-mode-hook + term-mode-hook + comint-mode-hook + completion-list-mode)) + (add-hook mode + (defun kj/disable-trailing-whitespace () + (setq show-trailing-whitespace nil))))) + +(use-package ws-butler + :hook (prog-mode . ws-butler-mode)) + +(use-package all-the-icons + :if (display-graphic-p)) + +(use-package emojify + :bind + (("C-c C-i C-e" . emojify-insert-emoji)) + :hook (after-init . global-emojify-mode) + :config + (emojify-set-emoji-styles '(unicode))) + +;;;;; Mode line +(use-package emacs + :ensure nil + :defer 5 + :init + (require 'battery) + (when (and battery-status-function + (not (string-match-p "unknown" + (battery-format "%B" + (funcall battery-status-function))))) + (display-battery-mode 1))) +(setopt display-time-default-load-average nil) + +(display-time-mode 1) + +(use-package doom-modeline + :ensure t + :disabled + :init (doom-modeline-mode 1) + :config + (setq doom-modeline-buffer-encoding 'nondefault)) + +(use-package emacs + :ensure nil + :defer 1 + :init + (defvar kj/minor-mode-alist-overrides + '((ws-butler "") + (gcmh-mode "") + (editorconfig-mode "") + (yas-minor-mode "") + (selected-minor-mode "") + (anzu-mode "") + (projectile-mode "") + (eldoc-mode "") + (mixed-pitch-mode "") + (which-key-mode ""))) + (defun kj/clean-mode-line () + (dolist (override kj/minor-mode-alist-overrides) + (if-let ((e (assoc (car override) minor-mode-alist))) + (setf (nth 1 e) (nth 1 override))))) + (add-to-list 'change-major-mode-hook 'kj/clean-mode-line)) + + +;;;;; Theme + +(use-package wombat-theme :ensure nil + :disabled + :init + (load-theme 'wombat) + :config + (custom-theme-set-faces + 'wombat + '(default ((t :background "#111111"))) + '(ansi-color-black ((t :background "#000000"))) + '(hl-line ((t :inherit () :background "#242424"))))) + +(use-package modus-themes + :init + :disabled + (load-theme 'modus-operandi-tinted) + (load-theme 'modus-vivendi-tinted t t) + :config + (custom-theme-set-faces + 'modus-vivendi-tinted + '(avy-lead-face ((t :inherit (bold modus-themes-subtle-blue)))) + '(avy-lead-face-0 ((t :inherit (bold modus-themes-subtle-cyan)))) + '(avy-lead-face-1 ((t :inherit (bold modus-themes-subtle-green)))) + '(avy-lead-face-2 ((t :inherit (bold modus-themes-subtle-magenta)))))) + +(use-package emacs :ensure nil + :init + (load-theme 'modus-operandi)) + +(use-package doom-themes) + +;;;; Shell and terminal +(setq shell-prompt-pattern "^[^#$%>\n]*[#$%>❯] *" + explicit-shell-file-name "zsh" + explicit-zsh-args '("--login" "--interactive") + comint-use-prompt-regexp t) +(defun kj/shell-buffer-name () + (concat "*shell:" default-directory "*")) + +(defun kj/shell-here () + (interactive) + (let ((buffer + (shell (kj/shell-buffer-name)))) + (with-current-buffer buffer + (let* ((proc (get-buffer-process (current-buffer))) + (sentinel (process-sentinel proc))) + (set-process-sentinel + proc + `(lambda (proc signal) + (funcall ',sentinel proc signal) + (and (memq (process-status proc) '(exit signal)) + (buffer-live-p (process-buffer proc)) + (message "Shell died, killing buffer %s" + (process-buffer proc)) + (kill-buffer (process-buffer proc))))))))) + +(use-package coterm + :config + (coterm-mode 1)) +(add-to-list 'comint-output-filter-functions + 'comint-osc-process-output) + +;; Update buffer name to reflect directory. +(advice-add 'cd :after + (defun kj/maybe-rename-shell (&rest args) + (and (derived-mode-p 'shell-mode) + (rename-buffer + (kj/shell-buffer-name))))) + +;;;; My Utilities +;;;;; Pass integration +(defun kj/pass-buffer () + (get-buffer-create "*pass*")) + +(defun kj/pass-echo (message) + (with-current-buffer (kj/pass-buffer) + (goto-char (point-max)) + (insert (propertize (concat message "\n") + 'face 'bold)))) + +(defun kj/pass-process (command &rest args) + (kj/pass-echo (format "$ %s" (string-join (cons command args) " "))) + (apply #'start-process "pass" (kj/pass-buffer) command args)) + +(defun kj/list-passwords () + (let* ((path (expand-file-name "~/.password-store")) + (pred (lambda (p) + (not (string-search (concat path "/.git") p)))) + (files (directory-files-recursively path "\\.gpg$" t pred t)) + (extract (lambda (p) + (string-remove-prefix (concat path "/") + (string-remove-suffix ".gpg" p)))) + (passwords (mapcar extract files))) + passwords)) + +(defun kj/pass-to-clipboard () + (interactive) + (let* ((password (completing-read "Password: " (kj/list-passwords))) + (process (kj/pass-process "pass" "show" "-c" password)) + (filter (lambda (proc m) (message "%s" (string-trim m))))) + (set-process-filter process filter))) + +(defun kj/pass-show () + (interactive) + (let* ((password (completing-read "Password: " (kj/list-passwords)))) + (kj/pass-echo "Showing password") + (kj/pass-process "pass" "show" password) + (display-buffer (kj/pass-buffer)))) + +(use-package with-editor) +(defun kj/pass-edit () + (interactive) + (let ((password (completing-read "Edit password: " (kj/list-passwords)))) + (with-editor + (kj/pass-process "pass" "edit" password)))) + +(defun kj/pass-generate (&optional args) + (interactive + (list (transient-args 'kj/pass-generate-transient))) + (let ((password (completing-read "Password name: " (kj/list-passwords) nil nil))) + (apply #'kj/pass-process "pass" "generate" `(,@args ,password)))) + +(keymap-global-set "C-c p" #'kj/pass) + +(use-package transient :ensure nil + :defer 1 + :init + (transient-define-prefix kj/pass-generate-transient () + "Generate" + [("-n" "No symbols" "--no-symbols") + ("-c" "Clipboard" "--clip")] + ["" + ("g" "generate" kj/pass-generate)]) + (transient-define-prefix + kj/transient () + "KJ Transient" + [;; "Arguments" + ;; ("-s" "Switch" "--switch") + ;; ("-a" "Another switch" "--another") + ;; ("-m" "Argument test" "--message=") + ] + ["Pass" + ("c" "Clipboard" kj/pass-to-clipboard) + ("s" "Show" kj/pass-show) + ("e" "Edit" kj/pass-edit) + ("g" "Generate" kj/pass-generate-transient)] + ["Repositories" + ("l" "List Repositories" magit-list-repositories) + ("C" "Clone my project" kj/clone-project)])) + +(keymap-global-set "C-c m" #'kj/transient) + +;;;; Applications +;;;;; Tramp +(use-package tramp :ensure nil) + +;;;;; Magit +;; (use-package magit :ensure nil) +;; (use-package transient) +(use-package magit + :after transient + :bind (:map magit-repolist-mode-map + ("c" . magit-clone) + ("i" . magit-init) + ("C" . kj/clone-project)) + :custom + (magit-repository-directories `((,kj/git-directory . 1)) "My git repositories") + (magit-repolist-columns '(("Name" 25 magit-repolist-column-ident nil) + ("Version" 25 magit-repolist-column-version + ((:sort magit-repolist-version<))) + ("B<U" 3 magit-repolist-column-unpulled-from-upstream + ((:right-align t) (:sort <))) + ("B>U" 3 magit-repolist-column-unpushed-to-upstream + ((:right-align t) (:sort <))) + ("F" 3 magit-repolist-column-flag + ((:right-align t) (:sort <))) + ("Path" 99 magit-repolist-column-path nil))) + :config + (defun kj/clone-project () + (interactive) + (let ((magit-clone-set-remote.pushDefault t)) + (magit-clone-regular (kj/read-repository) kj/git-directory nil)))) + +;;;;; Anki +;; (package-vc-install +;; '(anki-editor . (:url "https://github.com/anki-editor/anki-editor"))) +(use-package anki-editor :ensure nil + :after org + :bind (:map org-mode-map + ("<f12>" . anki-editor-cloze-region-auto-incr) + ("<f11>" . anki-editor-cloze-region-dont-incr) + ("<f6>" . anki-editor-push-tree)) + :hook (org-capture-after-finalize . anki-editor-reset-cloze-number) ; Reset cloze-number after each capture. + :config + (setq anki-editor-create-decks t ;; Allow anki-editor to create a new deck if it doesn't exist + anki-editor-org-tags-as-anki-tags t) + + (defun anki-editor-cloze-region-auto-incr (&optional arg) + "Cloze region without hint and increase card number." + (interactive) + (anki-editor-cloze-region my-anki-editor-cloze-number "") + (setq my-anki-editor-cloze-number (1+ my-anki-editor-cloze-number)) + (forward-sexp)) + (defun anki-editor-cloze-region-dont-incr (&optional arg) + "Cloze region without hint using the previous card number." + (interactive) + (anki-editor-cloze-region (1- my-anki-editor-cloze-number) "") + (forward-sexp)) + (defun anki-editor-reset-cloze-number (&optional arg) + "Reset cloze number to ARG or 1" + (interactive) + (setq my-anki-editor-cloze-number (or arg 1))) + (defun anki-editor-push-tree () + "Push all notes under a tree." + (interactive) + (anki-editor-push-notes '(4)) + (anki-editor-reset-cloze-number)) + ;; Initialize + (anki-editor-reset-cloze-number)) + +;;;; Org mode +(use-package org + :config + (org-babel-do-load-languages 'org-babel-load-languages + '((emacs-lisp . t) + (sql . t) + (shell . t))) + (setq org-confirm-babel-evaluate nil + org-return-follows-link t + ) + + (setopt org-capture-templates + '(("s" "Sailing entry" plain (file+datetree "~/org/roam/sailing.org") + "%^{LOCATION|Brooklyn}p\n%^{VESSEL|J80}p%^{SKIPPER}p%?") + ("a" "Anki templates") + ("ai" "Inbox basic" entry + (file+headline "~/org/anki/inbox.org" "Inbox") + "* %T %^g\n:PROPERTIES:\n:ANKI_NOTE_TYPE: Basic\n:END:\n** Front\n%?\n** Back\n%x\n") + ("as" "Sailing basic" entry + (file+headline "~/org/anki/sailing.org" "Sailing") + "* %T\n:PROPERTIES:\n:ANKI_NOTE_TYPE: Basic\n:END:\n** Front\n%?\n** Back\n%x\n") + ("az" "Sailing cloze" entry + (file+headline "~/org/anki/sailing.org" "Sailing") + "* %T\n:PROPERTIES:\n:ANKI_NOTE_TYPE: Cloze\n:END:\n** Text\n%x%?\n** Extra\n"))) + + ;; Install the link type + (org-add-link-type "notmuch" 'org-notmuch-open) + (add-hook 'org-store-link-functions 'org-notmuch-store-link) + + (add-hook 'org-mode-hook + (defun kj/org-setup-media-handler () + (yank-media-handler "image/.*" #'kj/org--image-yank-media-handler))) + + (defun kj/org--image-yank-media-handler (mimetype data) + "Save image DATA of mime-type MIMETYPE and insert link at point. + It is saved as per `org-yank-image-save-type'. The name for the + image is prompted and the extension is automatically added to the + end." + (let* ((ext (symbol-name (mailcap-mime-type-to-extension mimetype))) + (iname (format-time-string "clipboard-%Y-%m-%d-%H:%M")) + (filename (file-name-with-extension iname ext)) + (absname (expand-file-name + filename + default-directory)) + link) + (with-temp-file absname + (insert data)) + (setq link (org-link-make-string + (concat "./" filename))) + (insert link))) + + (defun kj/org-screenshot () + (interactive) + (let* ((filename (format-time-string "screenshot-%Y-%m-%d-%H:%M:%S.png")) + (path (expand-file-name filename default-directory)) + (link (org-link-make-string (concat "file:" filename))) + (async-shell-command-display-buffer nil)) + (async-shell-command (format "grim -g \"$(slurp)\" %S" path)) + (insert link))) + + (defun org-notmuch-store-link () + "Store a link to a notmuch search or message." + (when (eq major-mode 'notmuch-show-mode) + (let* ((message-id (notmuch-show-get-prop :id)) + (subject (notmuch-show-get-subject)) + (to (notmuch-show-get-to)) + (from (notmuch-show-get-from)) + desc link) + (org-store-link-props :type "notmuch" :from from :to to + :subject subject :message-id message-id) + (setq desc (org-email-link-description)) + (setq link (concat "notmuch:" "id:" message-id)) + (org-add-link-props :link link :description desc) + link))) + + (defun org-notmuch-open (path) + "Follow a notmuch message link specified by PATH." + (org-notmuch-follow-link path)) + + (defun org-notmuch-follow-link (search) + "Follow a notmuch link to SEARCH. + +Can link to more than one message, if so all matching messages are shown." + (require 'notmuch) + (notmuch-show (org-link-unescape search))) + + (org-add-link-type "notmuch-search" 'org-notmuch-search-open) + (add-hook 'org-store-link-functions 'org-notmuch-search-store-link) + + (defun org-notmuch-search-store-link () + "Store a link to a notmuch search or message." + (when (eq major-mode 'notmuch-search-mode) + (let ((link (concat "notmuch-search:" + (org-link-escape notmuch-search-query-string))) + (desc (concat "Notmuch search: " notmuch-search-query-string))) + (org-store-link-props :type "notmuch-search" + :link link + :description desc) + link))) + + (defun org-notmuch-search-open (path) + "Follow a notmuch message link specified by PATH." + (message path) + (org-notmuch-search-follow-link path)) + + (defun org-notmuch-search-follow-link (search) + "Follow a notmuch link by displaying SEARCH in notmuch-search mode." + (require 'notmuch) + (notmuch-search (org-link-unescape search))) + + ;; If you use `org' and don't want your org files in the default location below, + ;; change `org-directory'. It must be set before org loads! + (setq org-directory "~/org/") + (setq org-todo-keywords + '((sequence + "TODO(t)" "ACTIVE(a!)" "WAIT(w@/!)" "|" "DONE(d!)" "CANCELED(c@)"))) + (setq org-refile-use-outline-path nil) + (setq org-refile-targets '((nil . (:maxlevel . 2)))) + (setq org-log-into-drawer t) + (setq org-agenda-log-mode-items '(closed clock state)) + (setq org-agenda-start-day nil) + (setq org-agenda-block-separator nil) + (setq org-agenda-compact-blocks t) + (setq org-agenda-start-with-log-mode nil) + (setq org-habit-show-all-today t) + (setq org-agenda-time-grid '((daily today require-timed) (800 1600) "......" "----------------------")) + (setq org-roam-directory (concat org-directory "roam/")) + (setq-default org-agenda-files '()) + (dolist (file '("tasks.org" + "running-2022.org" + "sailing.org")) + (add-to-list 'org-agenda-files (concat org-roam-directory file))) + (setq org-roam-db-location (concat org-roam-directory "/org-roam.db")) + (setq org-export-with-toc nil) + (setq deft-directory org-directory) + (setq deft-recursive t) + ;; Org html export + (setq org-html-htmlize-output-type 'css) + ;; Website publish settings. + (defvar kj/publish-tag "publish") + (defvar kj/publish-directory "/ssh:orbekk@dragon.orbekk.com:/storage/srv/kj.orbekk.com") + (add-to-list 'org-modules 'org-habit) + + (defvar org-publish-project-alist) + (defun kj/find-agenda-files-containing-tag (tag) + (setq org-agenda-archives-mode nil) + (let* ((org-agenda-archives-mode nil) + (candidates (org-agenda-files nil 'ifmode)) + (matcher (cdr (org-make-tags-matcher tag))) + (files)) + ;; (message "Results:") + (dolist (file candidates files) + (org-check-agenda-file file) + (with-current-buffer (org-get-agenda-file-buffer file) + ;; (message "%S" (org-scan-tags 'agenda matcher nil)) + (when (org-scan-tags 'agenda matcher nil) + (push file files)))))) + + (defun kj/org-publish (&optional project force) + (interactive) + (setq project (or project "all")) + (setq force (or force current-prefix-arg)) + (setq org-agenda-files (list org-roam-directory)) + (let* ((static-files-re (string-join '("css" "txt" "jpg" "png" "gif" "svg") "\\|")) + (files-to-include (kj/find-agenda-files-containing-tag kj/publish-tag)) + ;; Disable org babel exports during publish entirely to speed up publish. + ;; This messes up babel output handling. + ;; (org-export-use-babel nil) + (org-babel-default-header-args + (kj/assq-replace '((:exports . "both") + (:eval . "never-export")) + org-babel-default-header-args)) + (org-publish-project-alist + `( + ("static" + :base-directory ,(concat org-roam-directory "/static") + :base-extension ,static-files-re + :recursive t + :publishing-directory ,(concat kj/publish-directory "/static") + :publishing-function org-publish-attachment) + ("source" + :base-directory ,org-roam-directory + :base-extension "org" + :exclude ".*" + :include ,files-to-include + :recursive t + :publishing-directory ,kj/publish-directory + :publishing-function org-publish-attachment) + ("html" + :base-directory ,org-roam-directory + :base-extension "org" + :recursive t + :exclude ".*" + :include ,files-to-include + :publishing-directory ,kj/publish-directory + :publishing-function org-html-publish-to-html + + :with-broken-links t + :with-toc nil + :with-latex t + :with-drawers t + :with-title t + :section-numbers nil + + ;; HTML options + :html-toplevel-hlevel 2 + :html-preamble "" + :html-postamble "" + :html-html5-fancy t + :html-doctype "html5" + :html-head "<link rel=\"stylesheet\" type=\"text/css\" href=\"https://gongzhitaao.org/orgcss/org.css\"/>" + :html-head-include-scripts nil + :html-head-include-default-style nil + :html-container article) + + ("all" :components ("static" "source" "html"))))) + + (org-publish project force))) + ; (setq org-appear-autolinks t) + ; (use-package! org-appear + ; :hook (org-mode . org-appear-mode)) + + (setq org-log-done 'time) + (setq org-todo-keywords + '((sequence + "TODO(t)" ; A task that needs doing & is ready to do + "PROJ(p)" ; A project, which usually contains other tasks + "LOOP(r)" ; A recurring task + "STRT(s)" ; A task that is in progress + "WAIT(w)" ; Something external is holding up this task + "HOLD(h)" ; This task is paused/on hold because of me + "IDEA(i)" ; An unconfirmed and unapproved task or notion + "|" + "DONE(d!)" ; Task successfully completed + "KILL(k)") ; Task was cancelled, aborted or is no longer applicable + (sequence + "[ ](T)" ; A task that needs doing + "[-](S)" ; Task is in progress + "[?](W)" ; Task is being held up or paused + "|" + "[X](D)") ; Task was completed + (sequence + "|" + "OKAY(o)" + "YES(y)" + "NO(n)"))) + + (setq org-journal-file-type 'weekly) + (setq org-journal-dir org-roam-directory) + (setq org-journal-file-format "journal-%Y-%m-%d.org") + (setq org-journal-enable-agenda-integration t) + (defun kj/org-journal-init () + (interactive) + (save-excursion + (goto-char (point-min)) + (org-id-get-create) + (org-set-property "category" "journal"))) + + (defun kj/org-journal-file-header (time) + (format-time-string "#+title: Week of %F (%W)\n" + (org-journal--convert-time-to-file-type-time time))) + (setq org-journal-file-header #'kj/org-journal-file-header) + (add-hook 'org-journal-after-header-create-hook 'kj/org-journal-init) + + ;; Org + (add-to-list 'org-export-backends 'md) + + (require 'org-tempo)) + +(defun org-archive-done-tasks () + (interactive) + (org-map-entries + (lambda () + (org-archive-subtree) + (setq org-map-continue-from (org-element-property :begin (org-element-at-point)))) + "/DONE" 'file)) + +(use-package org-pomodoro + :ensure t + :after org + :commands (org-pomodoro) + :config + (setq + org-pomodoro-manual-break t + org-pomodoro-time-format "%m" + org-pomodoro-format "🍅%s" + org-pomodoro-play-sounds nil + alert-user-configuration (quote ((((:category . "org-pomodoro")) notifications nil)))) + :bind + (("C-c o p" . org-pomodoro))) + +(use-package dslide) + +;;;; Include modules in lisp/ (defvar kj/module-directory (expand-file-name "lisp" user-emacs-directory)) (push kj/module-directory load-path) -(require 'kj-lib) (require 'kj-init) -(cl-loop for path in (directory-files kj/module-directory) - if (string-match "\\([^/]*\\).el" path) - do (require (intern (match-string-no-properties 1 path)))) +(use-package emacs :ensure nil + :defer 1 + :init + (cl-loop for path in (directory-files kj/module-directory) + if (string-match "\\([^/]*\\).el" path) + do (require (intern (match-string-no-properties 1 path))))) + +;;;; Enable commands +(put 'narrow-to-region 'disabled nil) +(put 'downcase-region 'disabled nil) +(put 'upcase-region 'disabled nil) +(put 'list-timers 'disabled nil) +(put 'set-goal-column 'disabled nil) +(put 'scroll-left 'disabled nil) + +;;;; Local variables +;; Local Variables: +;; eval: (outline-minor-mode 1) +;; eval: (outline-hide-sublevels 2) +;; outline-regexp: ";;;;*" +;; End: diff --git a/emacs/.config/emacs/lisp/kj-bindings.el b/emacs/.config/emacs/lisp/kj-bindings.el index e01b659..ff89033 100644 --- a/emacs/.config/emacs/lisp/kj-bindings.el +++ b/emacs/.config/emacs/lisp/kj-bindings.el @@ -1,6 +1,6 @@ ;;; -*- lexical-binding: t; -*- -(use-package emacs :elpaca nil +(use-package emacs :ensure nil :bind (("C-w" . kj/kill-word-or-region) ("C-c s" . kj/shell-here) diff --git a/emacs/.config/emacs/lisp/kj-development.el b/emacs/.config/emacs/lisp/kj-development.el index aefba85..6101e28 100644 --- a/emacs/.config/emacs/lisp/kj-development.el +++ b/emacs/.config/emacs/lisp/kj-development.el @@ -1,16 +1,28 @@ ;;; -*- lexical-binding: t; -*- (setq tab-stop-list (number-sequence 4 200 4)) -(use-package eglot :elpaca nil +(use-package eglot :ensure t :config - (setq eglot-events-buffer-size 0)) + ;;;(setq eglot-events-buffer-size 0) + ) + +(use-package puni + :defer t + :init + (puni-global-mode) + (electric-pair-mode 1) + :config + (keymap-set puni-mode-map "C-w" nil) + :bind + (("C-<right>" . puni-slurp-forward) + ("C-<left>" . puni-slurp-backward))) (add-hook 'prog-mode-hook 'subword-mode) ;; Only used to get better eglot snippets. (use-package yasnippet :config - (add-to-list 'yas-snippet-dirs (expand-file-name "yasnippets" user-emacs-directory)) + ;;(add-to-list 'yas-snippet-dirs (expand-file-name "yasnippets" user-emacs-directory)) (yas-global-mode)) (use-package tempel @@ -68,11 +80,6 @@ ;; (add-hook 'eglot-managed-mode-hook (lambda () (eldoc-mode -1))) ) -(use-package markdown-mode - :ensure t - :mode ("README\\.md\\'" . gfm-mode) - :init (setq markdown-command "multimarkdown")) - (use-package nix-mode :mode "\\.nix\\'") @@ -97,8 +104,8 @@ (use-package yaml-mode :mode "\\.\(yml|yaml\)\\'") -;; (use-package ansi-color -;; :hook (compilation-filter . ansi-color-compilation-filter)) +(use-package ansi-color :ensure nil + :hook (compilation-filter . ansi-color-compilation-filter)) (use-package diff-hl :config @@ -116,8 +123,40 @@ (use-package ess) -(use-package sly - :custom - (inferior-lisp-program "sbcl")) +;; (use-package sly +;; :custom +;; (inferior-lisp-program "sbcl")) + +(use-package emacs :ensure nil + :defer 1 + :after consult + :init + (when-let ((slime-helper (expand-file-name "~/.cache/quicklisp/slime-helper.el")) + ((file-exists-p slime-helper))) + (load slime-helper) + (setopt inferior-lisp-program "sbcl") + (defvar kj/slime-history-ring nil) + (defvar kj/slime-history-index nil) + (add-to-list 'consult-mode-histories + '(slime-repl-mode slime-repl-input-history + slime-repl-input-history-position + beginning-of-line)) + (slime-setup '(slime-fancy slime-asdf)))) + +(use-package exercism) +(defun kj/run-exercism-test () + (interactive) + (let* ((directory default-directory) + (exercise + (and (string-match (rx (* anychar) "/" (group (+ (not "/"))) "/" eol) + directory) + (match-string 1 directory))) + (test-file (concat directory exercise "-test.lisp"))) + (unless (file-exists-p test-file) + (error "Not found: %s" test-file)) + (slime-switch-to-output-buffer) + (slime-cd directory) + (slime-load-file test-file) + (slime-eval (list (intern (concat exercise "-test:run-tests")))))) (provide 'kj-development) diff --git a/emacs/.config/emacs/lisp/kj-eshell.el b/emacs/.config/emacs/lisp/kj-eshell.el index 5617658..6de46cf 100644 --- a/emacs/.config/emacs/lisp/kj-eshell.el +++ b/emacs/.config/emacs/lisp/kj-eshell.el @@ -1,5 +1,5 @@ ;;; -*- lexical-binding: t; -*- -(use-package eshell :elpaca nil +(use-package eshell :ensure nil :bind (:map eshell-mode-map ("M-r" . consult-history)) diff --git a/emacs/.config/emacs/lisp/kj-history.el b/emacs/.config/emacs/lisp/kj-history.el index 9805aa1..790e35c 100644 --- a/emacs/.config/emacs/lisp/kj-history.el +++ b/emacs/.config/emacs/lisp/kj-history.el @@ -11,7 +11,7 @@ ;; Command (group (1+ (not "\n"))))) -(use-package emacs :elpaca nil +(use-package emacs :ensure nil :after consult :config (defun kj/get-shell-history () diff --git a/emacs/.config/emacs/lisp/kj-init.el b/emacs/.config/emacs/lisp/kj-init.el index 98738e9..1cf70b0 100644 --- a/emacs/.config/emacs/lisp/kj-init.el +++ b/emacs/.config/emacs/lisp/kj-init.el @@ -1,248 +1,11 @@ ;;; -*- lexical-binding: t; -*- -(setq user-full-name "KJ Orbekk" - user-mail-address "kj@orbekk.com") - -(defvar kj/cache-dir "~/.cache/emacs") - -(setq initial-scratch-message nil) - -(setq switch-to-buffer-obey-display-actions t) -(setq switch-to-buffer-in-dedicated-window 'pop) -(setq even-window-sizes 'width-only) - -(setq custom-file (expand-file-name "emacs-custom.el" user-emacs-directory)) -(load custom-file :noerror t) - -(setq bookmark-file (expand-file-name "boomarks" kj/cache-dir)) - -(setq fast-but-imprecise-scrolling t) - -(setq use-short-answers t) - -(global-hl-line-mode 1) -(global-auto-revert-mode 1) - -(setq outline-minor-mode-cycle t - outline-minor-mode-highlight 'override) - -(setq visible-bell t - ring-bell-function 'ignore) - -(setq auto-save-list-file-prefix (expand-file-name "auto-save-list/.saves-" kj/cache-dir)) - -(use-package wombat-theme :elpaca nil - :disabled - :init - (load-theme 'wombat) - :config - (custom-theme-set-faces - 'wombat - '(default ((t :background "#111111"))) - '(ansi-color-black ((t :background "#000000"))) - '(hl-line ((t :inherit () :background "#242424"))))) - -(use-package modus-themes - :init - (load-theme 'modus-operandi-tinted) - (load-theme 'modus-vivendi-tinted t t) - :config - (custom-theme-set-faces - 'modus-vivendi-tinted - '(avy-lead-face ((t :inherit (bold modus-themes-subtle-blue)))) - '(avy-lead-face-0 ((t :inherit (bold modus-themes-subtle-cyan)))) - '(avy-lead-face-1 ((t :inherit (bold modus-themes-subtle-green)))) - '(avy-lead-face-2 ((t :inherit (bold modus-themes-subtle-magenta)))))) - -(use-package doom-themes) - -(setq alert-default-style 'libnotify) - -(use-package all-the-icons - :if (display-graphic-p)) -(setq inhibit-compacting-font-caches t) -(setq use-dialog-box nil) -(setq display-time-24hr-format t) - -(display-battery-mode 1) -(display-time-mode 1) - -(use-package doom-modeline - :ensure t - :init (doom-modeline-mode 1) - :config - (setq doom-modeline-buffer-encoding 'nondefault)) - -(use-package emojify - :bind - (("C-c C-i C-e" . emojify-insert-emoji)) - :hook (after-init . global-emojify-mode) - :config - (emojify-set-emoji-styles '(unicode))) - -(setq-default show-trailing-whitespace t) -(dolist (mode '(calendar-mode-hook - eshell-mode-hook - term-mode-hook - comint-mode-hook - completion-list-mode)) - (add-hook mode - (defun kj/disable-trailing-whitespace () - (setq show-trailing-whitespace nil)))) - -;; Deletes trailing whitespace on changed lines only. -(use-package ws-butler - :diminish ws-butler-mode - :hook (prog-mode . ws-butler-mode)) - -;; `M-x shell` settings -(setq shell-prompt-pattern "^[^#$%>\n]*[#$%>❯] *" - explicit-shell-file-name "zsh" - explicit-zsh-args '("--login" "--interactive")) -(defun kj/shell-buffer-name () - (concat "*shell:" default-directory "*")) - -(defun kj/shell-here () - (interactive) - (let ((buffer - (shell (kj/shell-buffer-name)))) - (with-current-buffer buffer - (let* ((proc (get-buffer-process (current-buffer))) - (sentinel (process-sentinel proc))) - (set-process-sentinel - proc - `(lambda (proc signal) - (funcall ',sentinel proc signal) - (and (memq (process-status proc) '(exit signal)) - (buffer-live-p (process-buffer proc)) - (message "Shell died, killing buffer %s" - (process-buffer proc)) - (kill-buffer (process-buffer proc))))))))) - -;;; Shell setup. -(use-package coterm - :config - (coterm-mode 1)) -(add-to-list 'comint-output-filter-functions - 'comint-osc-process-output) - -;; Update buffer name to reflect directory. -(advice-add 'cd :after - (defun kj/maybe-rename-shell (&rest args) - (and (derived-mode-p 'shell-mode) - (rename-buffer - (kj/shell-buffer-name))))) - -(use-package rainbow-delimiters - :defer t - :hook (prog-mode . rainbow-delimiters-mode) - ) - -(column-number-mode) -(set-fringe-mode 10) -(setq next-screen-context-lines 10) - -(use-package avy - :bind - (("C-c l" . avy-goto-char) - ("C-c n" . avy-goto-line)) - :config - (setq avy-keys '(?a ?o ?e ?u ?i ?d ?h ?t ?n ?s)) - (defun avy-action-embark (pt) - (unwind-protect - (save-excursion - (goto-char pt) - (embark-act)) - (select-window - (cdr (ring-ref avy-ring 0)))) - t) - -(setf (alist-get ?. avy-dispatch-alist) 'avy-action-embark)) -(define-key isearch-mode-map (kbd "M-j") 'avy-isearch) - -(winner-mode +1) - -(use-package ace-window - :bind - (("C-c e" . ace-window)) - :config - (setq aw-dispatch-always t) - (setq aw-keys '(?a ?o ?e ?u ?i ?d ?h ?t ?n ?s)) - ;; Make ace window more visible - ;; (custom-set-faces! - ;; '(aw-leading-char-face - ;; :foreground "white" :background "red" - ;; :weight bold :height 2.5 :box (:line-width 10 :color "red"))) - ) - -(defun kj/balance-main-window () - (balance-windows (window-main-window))) - -;; Prefer horizontal splits. -(setq split-height-threshold 100) - -(defun kj/split-window-below () - (interactive) - (split-window-below) - (kj/balance-main-window) - (other-window 1)) - -(defun kj/split-window-right () - (interactive) - (split-window-right) - (kj/balance-main-window) - (other-window 1)) - -(global-set-key (kbd "C-x 3") #'kj/split-window-right) -(global-set-key (kbd "C-x 2") #'kj/split-window-below) - -(use-package vertico - :init - (vertico-mode)) - ;; Rebind C-x? (global-set-key (kbd "C-t") 'ctrl-x-map) (define-key global-map (kbd "C-t") ctl-x-map) ;; (define-key key-translation-map "\C-t" "\C-t") ;; (define-key key-translation-map "\C-x" "\C-t") -(use-package marginalia - :bind - (:map minibuffer-local-map - ("M-n" . marginalia-cycle)) - :init - (marginalia-mode)) - -(use-package embark - :ensure t - - :bind - (("C-." . embark-act) - ("C-;" . embark-dwim) - ("C-h C-b" . embark-bindings)) - - :init - (setq prefix-help-command #'embark-prefix-help-command) - - :config - (defun find-file-keeping-default-directory (filename) - (let ((dir default-directory)) - (with-current-buffer (find-file filename) - (setq-local default-directory dir)))) - (define-key embark-file-map "@" 'find-file-keeping-default-directory) - - ;; Hide the mode line of the Embark live/completions buffers - (add-to-list 'display-buffer-alist - '("\\`\\*Embark Collect \\(Live\\|Completions\\)\\*" - . - (window-parameters (mode-line-format . none))))) - -(use-package embark-consult - :ensure t - :after (embark consult) - :demand t - :hook (embark-mode . consult-preview-at-point-mode)) - ;; For editing grep buffers. (use-package wgrep) (use-package deadgrep @@ -263,156 +26,12 @@ (setq global-mark-ring-max 500 mark-ring-max 16) -(defun kj/consult-ripgrep-here (&optional dir initial) - (interactive "P") - (unless dir - (setq dir default-directory)) - (consult-ripgrep dir initial)) - -;; Example configuration for Consult -(use-package consult - ;; Replace bindings. Lazily loaded due by `use-package'. - :bind (;; C-c bindings (mode-specific-map) - ("C-c h" . kj/consult-history) - ;;("C-c m" . consult-mode-command) - ("C-c k" . consult-kmacro) - ;; C-x bindings (ctl-x-map) - ("C-x M-:" . consult-complex-command) ;; orig. repeat-complex-command - ("C-x b" . consult-buffer) ;; orig. switch-to-buffer - ("C-x C-b" . consult-buffer) ;; orig. switch-to-buffer - ("C-x 4 b" . consult-buffer-other-window) ;; orig. switch-to-buffer-other-window - ("C-x 5 b" . consult-buffer-other-frame) ;; orig. switch-to-buffer-other-frame - ("C-x r b" . consult-bookmark) ;; orig. bookmark-jump - ("C-x p b" . consult-project-buffer) ;; orig. project-switch-to-buffer - ("C-c f r" . consult-recent-file) - ;; Custom M-# bindings for fast register access - ("M-#" . consult-register-load) - ("M-'" . consult-register-store) ;; orig. abbrev-prefix-mark (unrelated) - ("C-M-#" . consult-register) - ;; Other custom bindings - ("M-y" . consult-yank-pop) ;; orig. yank-pop - ("<help> a" . consult-apropos) ;; orig. apropos-command - ;; M-g bindings (goto-map) - ("M-g e" . consult-compile-error) - ("M-g f" . consult-flymake) ;; Alternative: consult-flycheck - ("M-g g" . consult-goto-line) ;; orig. goto-line - ("M-g M-g" . consult-goto-line) ;; orig. goto-line - ("M-g o" . consult-outline) ;; Alternative: consult-org-heading - ("M-g m" . consult-mark) - ("M-g k" . consult-global-mark) - ("M-g i" . consult-imenu) - ("M-g I" . consult-imenu-multi) - ;; M-s bindings (search-map) - ("M-s d" . consult-find) - ("M-s D" . consult-locate) - ;; ("M-s g" . consult-grep) - ("M-s G" . consult-git-grep) - ("M-s r" . consult-ripgrep) - ("M-s R" . kj/consult-ripgrep-here) - ("M-s l" . consult-line) - ("M-s L" . consult-line-multi) - ("M-s m" . consult-multi-occur) - ("M-s k" . consult-keep-lines) - ("M-s u" . consult-focus-lines) - ;; Isearch integration - ("M-s e" . consult-isearch-history) - :map isearch-mode-map - ("M-e" . consult-isearch-history) ;; orig. isearch-edit-string - ("M-s e" . consult-isearch-history) ;; orig. isearch-edit-string - ("M-s l" . consult-line) ;; needed by consult-line to detect isearch - ("M-s L" . consult-line-multi) ;; needed by consult-line to detect isearch - ;; Minibuffer history - :map minibuffer-local-map - ("M-s" . kj/consult-history) ;; orig. next-matching-history-element - ("M-r" . kj/consult-history)) ;; orig. previous-matching-history-element - - ;; Enable automatic preview at point in the *Completions* buffer. This is - ;; relevant when you use the default completion UI. - ;; :hook (completion-list-mode . consult-preview-at-point-mode) - - ;; The :init configuration is always executed (Not lazy) - :init - - ;; Optionally configure the register formatting. This improves the register - ;; preview for `consult-register', `consult-register-load', - ;; `consult-register-store' and the Emacs built-ins. - (setq register-preview-delay 0.5 - register-preview-function #'consult-register-format) - - ;; Optionally tweak the register preview window. - ;; This adds thin lines, sorting and hides the mode line of the window. - (advice-add #'register-preview :override #'consult-register-window) - - ;; Use Consult to select xref locations with preview - (setq xref-show-xrefs-function #'consult-xref - xref-show-definitions-function #'consult-xref) - - ;; Configure other variables and modes in the :config section, - ;; after lazily loading the package. - :config - - ;; Use consult for completion. - (setq completion-in-region-function #'consult-completion-in-region) - - ;; Optionally configure preview. The default value - ;; is 'any, such that any key triggers the preview. - (setq consult-preview-key '(:debounce 0.3 any)) - ;; (setq consult-preview-key (kbd "M-.")) - ;; (setq consult-preview-key (list (kbd "<S-down>") (kbd "<S-up>"))) - ;; For some commands and buffer sources it is useful to configure the - ;; :preview-key on a per-command basis using the `consult-customize' macro. - ;; (consult-customize - ;; consult-theme - ;; :preview-key '(:debounce 0.2 any) - ;; consult-ripgrep consult-git-grep consult-grep - ;; consult-bookmark consult-recent-file consult-xref - ;; consult--source-bookmark consult--source-recent-file - ;; consult--source-project-recent-file - ;; :preview-key (kbd "M-.")) - - ;; Optionally configure the narrowing key. - ;; Both < and C-+ work reasonably well. - (setq consult-narrow-key "<") ;; (kbd "C-+") - - (setq consult-ripgrep-args - "rg --null --line-buffered --color=never --max-columns=1000 --path-separator / --smart-case --no-heading --with-filename --line-number --search-zip --hidden") - - ;; Optionally make narrowing help available in the minibuffer. - ;; You may want to use `embark-prefix-help-command' or which-key instead. - ;; (define-key consult-narrow-map (vconcat consult-narrow-key "?") #'consult-narrow-help) - - ;; By default `consult-project-function' uses `project-root' from project.el. - ;; Optionally configure a different project root function. - ;; There are multiple reasonable alternatives to chose from. - ;;;; 1. project.el (the default) - ;;(setq consult-project-function #'consult--default-project-function) - ;;;; 2. projectile.el (projectile-project-root) - (autoload 'projectile-project-root "projectile") - (setq consult-project-function (lambda (_) (projectile-project-root))) - ;;;; 3. vc.el (vc-root-dir) - ;; (setq consult-project-function (lambda (_) (vc-root-dir))) - ;;;; 4. locate-dominating-file - ;; (setq consult-project-function (lambda (_) (locate-dominating-file "." ".git"))) - ) - -(use-package orderless - :init - (setq completion-styles '(orderless basic) - completion-category-defaults nil - completion-category-overrides '((file (styles partial-completion))))) - (use-package which-key :init (which-key-mode)) (use-package seq) -(use-package transient - :config - (setq transient-levels-file (expand-file-name "transient/levels.el" kj/cache-dir) - transient-values-file (expand-file-name "transient/values.el" kj/cache-dir) - transient-history-file (expand-file-name "transient/history.el" kj/cache-dir))) - (defconst kj/git-directory (expand-file-name "~/git")) (defun kj/read-repository () (let ((repos @@ -423,29 +42,6 @@ (completing-read "Repository: " repos) (concat "ssh://dragon.orbekk.com:/storage/projects/")))) -(use-package magit - :bind (:map magit-repolist-mode-map - ("c" . magit-clone) - ("i" . magit-init) - ("C" . kj/clone-project)) - :custom - (magit-repository-directories `((,kj/git-directory . 1)) "My git repositories") - (magit-repolist-columns '(("Name" 25 magit-repolist-column-ident nil) - ("Version" 25 magit-repolist-column-version - ((:sort magit-repolist-version<))) - ("B<U" 3 magit-repolist-column-unpulled-from-upstream - ((:right-align t) (:sort <))) - ("B>U" 3 magit-repolist-column-unpushed-to-upstream - ((:right-align t) (:sort <))) - ("F" 3 magit-repolist-column-flag - ((:right-align t) (:sort <))) - ("Path" 99 magit-repolist-column-path nil))) - :config - (defun kj/clone-project () - (interactive) - (let ((magit-clone-set-remote.pushDefault t)) - (magit-clone-regular (kj/read-repository) kj/git-directory nil)))) - (use-package mixed-pitch :hook (text-mode . mixed-pitch-mode) @@ -468,7 +64,7 @@ ;; (set-face-attribute 'variable-pitch nil :font "Noto Serif")) ;;; Compilation settings -(use-package compile :elpaca nil +(use-package compile :ensure nil :config (setq compilation-ask-about-save nil) (setq compilation-scroll-output 'first-error) @@ -486,6 +82,7 @@ (use-package projectile :ensure t :defer 1 + :custom (projectile-track-known-projects-automatically nil) :init (setq projectile-known-projects-file (expand-file-name "projectile-bookmarks.eld" kj/cache-dir)) (projectile-mode 1) @@ -495,7 +92,7 @@ :bind (:map projectile-mode-map ("C-x p" . projectile-command-map))) -(use-package emacs :elpaca nil +(use-package emacs :ensure nil :config (setq ediff-diff-options "-w" ; turn off whitespace checking ediff-split-window-function #'split-window-horizontally @@ -616,7 +213,7 @@ ;; (define-key meow-insert-state-keymap "\C-[" #'meow-insert-exit) ;; ) -(use-package emacs :elpaca nil +(use-package emacs :ensure nil :hook (dired-mode . dired-omit-mode) :init (setq dired-dwim-target t ; suggest a target for moving/copying intelligently @@ -785,7 +382,7 @@ char-fold-symmetric t isearch-lax-whitespace t search-default-mode 'char-fold-to-regexp) -(use-package char-fold :elpaca nil +(use-package char-fold :ensure nil :config (setopt char-fold-include (cons '(?- "_" "-") char-fold-include))) @@ -801,9 +398,11 @@ ;; Disable VC over tramp. ;;(setq-default vc-handled-backends nil) (defun kj/vc-off-if-remote () - (if (file-remote-p (buffer-file-name)) + (if (and (buffer-file-name )(file-remote-p (buffer-file-name))) (setq-local vc-handled-backends nil))) (add-hook 'find-file-hook 'kj/vc-off-if-remote) +(advice-add 'consult-buffer :before + (lambda (&rest r) (kj/vc-off-if-remote))) (use-package selected :demand t @@ -877,7 +476,7 @@ (load-file google-config-file))) ;; Special symbols -(use-package emacs :elpaca nil +(use-package emacs :ensure nil :defer 1 :config (defvar kj/iso-transl-char-map @@ -935,13 +534,13 @@ (mode . ,kj/help-modes) (inhibit-same-window . nil))) -(use-package helpful - :bind - (([remap describe-key] . 'helpful-key) - ([remap describe-variable] . 'helpful-variable) - ([remap describe-symbol] . 'helpful-symbol) - ([remap describe-command] . 'helpful-command) - ([remap describe-function] . 'helpful-callable))) +;; (use-package helpful +;; :bind +;; (([remap describe-key] . 'helpful-key) +;; ([remap describe-variable] . 'helpful-variable) +;; ([remap describe-symbol] . 'helpful-symbol) +;; ([remap describe-command] . 'helpful-command) +;; ([remap describe-function] . 'helpful-callable))) ;; Spotify (use-package smudge @@ -1014,10 +613,8 @@ (gethash 'name (car (gethash 'artists track))) (gethash 'name track)))))))))) -;; Enabled commands -(put 'narrow-to-region 'disabled nil) -(put 'downcase-region 'disabled nil) -(put 'upcase-region 'disabled nil) -(put 'list-timers 'disabled nil) - (provide 'kj-init) + +;; Local Variables: +;; eval: (outline-minor-mode 1) +;; End: diff --git a/emacs/.config/emacs/lisp/kj-lib.el b/emacs/.config/emacs/lisp/kj-lib.el deleted file mode 100644 index 169209d..0000000 --- a/emacs/.config/emacs/lisp/kj-lib.el +++ /dev/null @@ -1,14 +0,0 @@ -;;; -*- lexical-binding: t; -*- - -(defmacro define-repeating-key (keymap key cmd &optional desc) - `(let ((def - ,(if desc - `'(,desc . ,cmd) - `',cmd))) - (define-key ,keymap ,key def) - (put ',cmd 'repeat-map ',keymap))) - -(defun kj/default-directory-remote-p () - (file-remote-p default-directory)) - -(provide 'kj-lib) diff --git a/emacs/.config/emacs/lisp/kj-multiple-cursors.el b/emacs/.config/emacs/lisp/kj-multiple-cursors.el deleted file mode 100644 index 962193d..0000000 --- a/emacs/.config/emacs/lisp/kj-multiple-cursors.el +++ /dev/null @@ -1,20 +0,0 @@ -;;; -*- lexical-binding: t; -*- - -(use-package multiple-cursors - :config - (defvar kj/multiple-cursors-map (make-sparse-keymap "cursors")) - (define-repeating-key kj/multiple-cursors-map "." mc/mark-next-like-this "→ this") - (define-repeating-key kj/multiple-cursors-map "," mc/mark-previous-like-this "← this") - (define-repeating-key kj/multiple-cursors-map ">" mc/skip-to-next-like-this "⇥ this") - (define-repeating-key kj/multiple-cursors-map "<" mc/skip-to-previous-like-this "⇤ this") - (define-repeating-key kj/multiple-cursors-map "<" mc/skip-to-previous-like-this "⇤ this") - (define-repeating-key kj/multiple-cursors-map "*" mc/mark-all-like-this "all like this") - (define-repeating-key kj/multiple-cursors-map "w" mc/mark-next-like-this-word "word") - (define-repeating-key kj/multiple-cursors-map "s" mc/mark-next-like-this-symbol "symbol") - (define-repeating-key kj/multiple-cursors-map "(" mc/mark-all-symbols-like-this-in-defun "symbol defun") - (define-repeating-key kj/multiple-cursors-map (kbd "DEL") mc/unmark-next-like-this "DEL last") - (define-repeating-key kj/multiple-cursors-map (kbd "<delete>") mc/unmark-previous-like-this "DEL first") - (define-key kj/multiple-cursors-map (kbd "C-g") '("quit" . ignore)) - (global-set-key (kbd "C-c m") (cons "cursors" kj/multiple-cursors-map))) - -(provide 'kj-multiple-cursors) diff --git a/emacs/.config/emacs/lisp/kj-org.el b/emacs/.config/emacs/lisp/kj-org.el deleted file mode 100644 index b6fda9c..0000000 --- a/emacs/.config/emacs/lisp/kj-org.el +++ /dev/null @@ -1,251 +0,0 @@ -;;; -*- lexical-binding: t; -*- - -(use-package org - :config - (org-babel-do-load-languages 'org-babel-load-languages - '((emacs-lisp . t) - (sql . t) - (shell . t))) - (setq org-confirm-babel-evaluate nil - org-return-follows-link t - ) - - ;; Install the link type - (org-add-link-type "notmuch" 'org-notmuch-open) - (add-hook 'org-store-link-functions 'org-notmuch-store-link) - - (defun org-notmuch-store-link () - "Store a link to a notmuch search or message." - (when (eq major-mode 'notmuch-show-mode) - (let* ((message-id (notmuch-show-get-prop :id)) - (subject (notmuch-show-get-subject)) - (to (notmuch-show-get-to)) - (from (notmuch-show-get-from)) - desc link) - (org-store-link-props :type "notmuch" :from from :to to - :subject subject :message-id message-id) - (setq desc (org-email-link-description)) - (setq link (concat "notmuch:" "id:" message-id)) - (org-add-link-props :link link :description desc) - link))) - - (defun org-notmuch-open (path) - "Follow a notmuch message link specified by PATH." - (org-notmuch-follow-link path)) - - (defun org-notmuch-follow-link (search) - "Follow a notmuch link to SEARCH. - -Can link to more than one message, if so all matching messages are shown." - (require 'notmuch) - (notmuch-show (org-link-unescape search))) - - (org-add-link-type "notmuch-search" 'org-notmuch-search-open) - (add-hook 'org-store-link-functions 'org-notmuch-search-store-link) - - (defun org-notmuch-search-store-link () - "Store a link to a notmuch search or message." - (when (eq major-mode 'notmuch-search-mode) - (let ((link (concat "notmuch-search:" - (org-link-escape notmuch-search-query-string))) - (desc (concat "Notmuch search: " notmuch-search-query-string))) - (org-store-link-props :type "notmuch-search" - :link link - :description desc) - link))) - - (defun org-notmuch-search-open (path) - "Follow a notmuch message link specified by PATH." - (message path) - (org-notmuch-search-follow-link path)) - - (defun org-notmuch-search-follow-link (search) - "Follow a notmuch link by displaying SEARCH in notmuch-search mode." - (require 'notmuch) - (notmuch-search (org-link-unescape search))) - - ;; If you use `org' and don't want your org files in the default location below, - ;; change `org-directory'. It must be set before org loads! - (setq org-directory "~/org/") - (setq org-todo-keywords - '((sequence - "TODO(t)" "ACTIVE(a!)" "WAIT(w@/!)" "|" "DONE(d!)" "CANCELED(c@)"))) - (setq org-refile-use-outline-path nil) - (setq org-refile-targets '((nil . (:maxlevel . 2)))) - (setq org-log-into-drawer t) - (setq org-agenda-log-mode-items '(closed clock state)) - (setq org-agenda-start-day nil) - (setq org-agenda-block-separator nil) - (setq org-agenda-compact-blocks t) - (setq org-agenda-start-with-log-mode nil) - (setq org-habit-show-all-today t) - (setq org-agenda-time-grid '((daily today require-timed) (800 1600) "......" "----------------------")) - (setq org-roam-directory (concat org-directory "roam/")) - (setq-default org-agenda-files '()) - (dolist (file '("tasks.org" - "running-2022.org")) - (add-to-list 'org-agenda-files (concat org-roam-directory file))) - (setq org-roam-db-location (concat org-roam-directory "/org-roam.db")) - (setq org-export-with-toc nil) - (setq deft-directory org-directory) - (setq deft-recursive t) - ;; Org html export - (setq org-html-htmlize-output-type 'css) - ;; Website publish settings. - (defvar kj/publish-tag "publish") - (defvar kj/publish-directory "/ssh:orbekk@dragon.orbekk.com:/storage/srv/kj.orbekk.com") - (add-to-list 'org-modules 'org-habit) - - (defvar org-publish-project-alist) - (defun kj/find-agenda-files-containing-tag (tag) - (setq org-agenda-archives-mode nil) - (let* ((org-agenda-archives-mode nil) - (candidates (org-agenda-files nil 'ifmode)) - (matcher (cdr (org-make-tags-matcher tag))) - (files)) - ;; (message "Results:") - (dolist (file candidates files) - (org-check-agenda-file file) - (with-current-buffer (org-get-agenda-file-buffer file) - ;; (message "%S" (org-scan-tags 'agenda matcher nil)) - (when (org-scan-tags 'agenda matcher nil) - (push file files)))))) - - (defun kj/org-publish (&optional project force) - (interactive) - (setq project (or project "all")) - (setq force (or force current-prefix-arg)) - (setq org-agenda-files (list org-roam-directory)) - (let* ((static-files-re (string-join '("css" "txt" "jpg" "png" "gif" "svg") "\\|")) - (files-to-include (kj/find-agenda-files-containing-tag kj/publish-tag)) - ;; Disable org babel exports during publish entirely to speed up publish. - ;; This messes up babel output handling. - ;; (org-export-use-babel nil) - (org-babel-default-header-args - (kj/assq-replace '((:exports . "both") - (:eval . "never-export")) - org-babel-default-header-args)) - (org-publish-project-alist - `( - ("static" - :base-directory ,(concat org-roam-directory "/static") - :base-extension ,static-files-re - :recursive t - :publishing-directory ,(concat kj/publish-directory "/static") - :publishing-function org-publish-attachment) - ("source" - :base-directory ,org-roam-directory - :base-extension "org" - :exclude ".*" - :include ,files-to-include - :recursive t - :publishing-directory ,kj/publish-directory - :publishing-function org-publish-attachment) - ("html" - :base-directory ,org-roam-directory - :base-extension "org" - :recursive t - :exclude ".*" - :include ,files-to-include - :publishing-directory ,kj/publish-directory - :publishing-function org-html-publish-to-html - - :with-broken-links t - :with-toc nil - :with-latex t - :with-drawers t - :with-title t - :section-numbers nil - - ;; HTML options - :html-toplevel-hlevel 2 - :html-preamble "" - :html-postamble "" - :html-html5-fancy t - :html-doctype "html5" - :html-head "<link rel=\"stylesheet\" type=\"text/css\" href=\"static/org.css\"/>" - :html-head-include-scripts nil - :html-head-include-default-style nil - :html-container article) - - ("all" :components ("static" "source" "html"))))) - - (org-publish project force))) - ; (setq org-appear-autolinks t) - ; (use-package! org-appear - ; :hook (org-mode . org-appear-mode)) - - (setq org-log-done 'time) - (setq org-todo-keywords - '((sequence - "TODO(t)" ; A task that needs doing & is ready to do - "PROJ(p)" ; A project, which usually contains other tasks - "LOOP(r)" ; A recurring task - "STRT(s)" ; A task that is in progress - "WAIT(w)" ; Something external is holding up this task - "HOLD(h)" ; This task is paused/on hold because of me - "IDEA(i)" ; An unconfirmed and unapproved task or notion - "|" - "DONE(d!)" ; Task successfully completed - "KILL(k)") ; Task was cancelled, aborted or is no longer applicable - (sequence - "[ ](T)" ; A task that needs doing - "[-](S)" ; Task is in progress - "[?](W)" ; Task is being held up or paused - "|" - "[X](D)") ; Task was completed - (sequence - "|" - "OKAY(o)" - "YES(y)" - "NO(n)"))) - - (setq org-journal-file-type 'weekly) - (setq org-journal-dir org-roam-directory) - (setq org-journal-file-format "journal-%Y-%m-%d.org") - (setq org-journal-enable-agenda-integration t) - (defun kj/org-journal-init () - (interactive) - (save-excursion - (goto-char (point-min)) - (org-id-get-create) - (org-set-property "category" "journal"))) - - (defun kj/org-journal-file-header (time) - (format-time-string "#+title: Week of %F (%W)\n" - (org-journal--convert-time-to-file-type-time time))) - (setq org-journal-file-header #'kj/org-journal-file-header) - (add-hook 'org-journal-after-header-create-hook 'kj/org-journal-init) - - ;; Org - (add-to-list 'org-export-backends 'md) - - (require 'org-tempo)) - -(defun org-archive-done-tasks () - (interactive) - (org-map-entries - (lambda () - (org-archive-subtree) - (setq org-map-continue-from (org-element-property :begin (org-element-at-point)))) - "/DONE" 'file)) - -(use-package org-pomodoro - :ensure t - :after org - :commands (org-pomodoro) - :config - (setq - org-pomodoro-manual-break t - org-pomodoro-time-format "%m" - org-pomodoro-format "🍅%s" - org-pomodoro-play-sounds nil - alert-user-configuration (quote ((((:category . "org-pomodoro")) notifications nil)))) - :bind - (("C-c o p" . org-pomodoro))) - -(use-package org-tidy - :after org - :hook (org-mode . org-tidy-mode)) - -(provide 'kj-org) diff --git a/emacs/.config/emacs/lisp/kj-timer.el b/emacs/.config/emacs/lisp/kj-timer.el deleted file mode 100644 index b3c64fe..0000000 --- a/emacs/.config/emacs/lisp/kj-timer.el +++ /dev/null @@ -1,49 +0,0 @@ -;;; kj-timer.el -- countdown timer -*- lexical-binding: t -*- - -(defvar kj/current-timer nil) -(defvar kj/roster nil) -(defvar kj/timer-seconds) - -(defun kj/display-timer (seconds current &optional next) - (with-current-buffer (get-buffer-create "*timer*") - (let* ((stopped (< seconds 0)) - (seconds (if stopped 0 (truncate seconds)))) - (erase-buffer) - (insert - (propertize (format "%02d:%02d" (/ seconds 60) - (% seconds 60)) - 'face - (append '(:height 1000) - (when stopped - '(:inherit 'org-imminent-deadline)))) - "\n" (propertize (concat current " · " (if next next "done")) - 'face '(:foreground "gray" :height 500))) - (set-left-margin (point-min) (point-max) 10)))) - -(defun kj/run-single-timer (seconds current next) - (let* ((stop-time (+ (float-time) seconds)) - (display-fn (lambda () - (kj/display-timer - (- stop-time (float-time)) - current next)))) - (setq kj/current-timer (run-at-time t 0.5 display-fn)))) - -(defun kj/timer (seconds &rest roster) - (with-current-buffer (get-buffer-create "*timer*") - (display-buffer (current-buffer)) - (setq cursor-type nil) - (use-local-map (define-keymap "SPC" 'kj/timer-next)) - (setq kj/roster roster) - (setq kj/timer-seconds seconds) - (kj/timer-next))) - -(defun kj/timer-next () - (interactive) - (unless kj/roster - (error "The timers are done.")) - (when kj/current-timer - (cancel-timer kj/current-timer)) - (kj/run-single-timer kj/timer-seconds (nth 0 kj/roster) (nth 1 kj/roster)) - (setq kj/roster (cdr kj/roster))) - -(provide 'kj-timer) diff --git a/emacs/.config/emacs/templates b/emacs/.config/emacs/templates index cb4219c..e83697e 100644 --- a/emacs/.config/emacs/templates +++ b/emacs/.config/emacs/templates @@ -18,6 +18,11 @@ emacs-lisp-mode ";;; " (file-name-nondirectory (or (buffer-file-name) (buffer-name))) " ends here" n) +prog-mode + +(dns "DO_NOT_SUBMIT") +(ldns "LOG(DO_NOT_SUBMIT) << ") + c++-mode (ns "namespace " (s ns) "{" n r n "} // namespace " (s ns)) diff --git a/zsh/.zshenv b/zsh/.zshenv index 6e878b1..7d9861c 100644 --- a/zsh/.zshenv +++ b/zsh/.zshenv @@ -3,7 +3,7 @@ HISTFILE=~/.zsh_history HISTSIZE=1000000 SAVEHIST=$HISTSIZE export TZ=America/New_York -export ALTERNATE_EDITOR=vim +export ALTERNATE_EDITOR=emacs export EDITOR=emacsclient export TERMINAL=urxvt export LEDGER_FILE=$HOME/org/hledger/2021.journal @@ -2,35 +2,33 @@ setopt inc_append_history share_history histignorealldups if [[ ${INSIDE_EMACS} == *comint* ]]; then PAGER=cat - TERM=xterm-256color unsetopt zle -fi -if [[ ${TERM} = "dumb" ]]; then - # This fixes TRAMP. - unsetopt zle - PS1='$ ' - return 0 -fi - -eval "$(starship init zsh)" +else + PS1='%F{cyan}%~ %(?.%F{green}.%F{red})%#%f ' + source ~/.zsh/syntax-highlighting/zsh-syntax-highlighting.zsh +fi; +# if [[ ${TERM} = "dumb" ]]; then +# # This fixes TRAMP. +# unsetopt zle +# PS1='$ ' +# return 0 +# fi # Resources: # https://github.com/mika/zsh-pony bindkey -e -autoload -Uz compinit; compinit -autoload -Uz promptinit; promptinit - zstyle ':completion:*' menu select zstyle ':completion::complete:*' gain-privileges 1 zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} +autoload -Uz compinit; compinit +autoload -Uz promptinit; promptinit + # Don't skip over symbols, e.g., when deleting a word from a path. WORDCHARS='' -# source ~/.zsh/powerlevel10k/powerlevel10k.zsh-theme - # cd to a directory used as a commant setopt autocd @@ -39,8 +37,6 @@ setopt interactivecomments alias ls="ls --color" alias e="emacsclient -n" -# Never got used to this. -# (( $+commands[exa] )) && alias ls="exa" if (( $+commands[fzf] )); then if (( $+commands[fzf-share] )); then @@ -54,15 +50,6 @@ if (( $+commands[fzf] )); then fi fi -if (( $+commands[zoxide] )); then - eval "$(zoxide init zsh)" -fi - -# Issues when typing 'ssh root@' with fast syntax hilighting. -if [[ -n ${INSIDE_EMACS} ]]; then - source ~/.zsh/syntax-highlighting/zsh-syntax-highlighting.zsh -fi - # allow editing of command line autoload -U edit-command-line zle -N edit-command-line |
