Move Sway and Emacs configuration around

This commit is contained in:
Alex Palaistras 2022-01-05 13:16:18 +00:00
parent 9546c2be0b
commit fb36dac9ca
10 changed files with 347 additions and 371 deletions

View File

@ -1,3 +1,5 @@
! Default configuration for Emacs.
Emacs*Background: #2d2d2d
Emacs*MenuBar: 0
Emacs*MenuBar: off
Emacs*ToolBar: off
Emacs*ScrollBars: off

View File

@ -1,5 +1,12 @@
;;; config.el -*- lexical-binding: t; -*-
;;;
;;; Includes and required libraries.
;;;
(load! "custom/custom")
(after! doom-cli (load! "custom/cli"))
;;;
;;; UI configuration.
;;;
@ -143,13 +150,15 @@
(setq projectile-globally-ignored-directories (append (default-value 'projectile-globally-ignored-directories) '("vendor"))))
(after! ranger
(setq ranger-cleanup-eagerly t
(setq ranger-cleanup-on-disable t
ranger-return-to-ranger t
ranger-hide-cursor t))
(after! sh-script
(setq sh-basic-offset 4))
(after! sql
(load! "custom/sql")
(setq sql-postgres-login-params (append (default-value 'sql-postgres-login-params) '(port :default 5432)))
(map! :localleader
:map sql-mode-map
@ -270,309 +279,310 @@
;;; less accessible, e.g. by using capital keys.
;;;
(map! :desc "Jump back in position history" "<mouse-8>" #'better-jumper-jump-backward
:desc "Jump forward in position history" "<mouse-9>" #'better-jumper-jump-forward)
(when (featurep! :editor evil)
(map! :desc "Jump back in position history" "<mouse-8>" #'better-jumper-jump-backward
:desc "Jump forward in position history" "<mouse-9>" #'better-jumper-jump-forward)
(map! :desc "Go to previous buffer" :n "<S-up>" #'evil-prev-buffer
:desc "Go to next buffer" :n "<S-down>" #'evil-next-buffer)
(map! :desc "Go to previous buffer" :n "<S-up>" #'evil-prev-buffer
:desc "Go to next buffer" :n "<S-down>" #'evil-next-buffer)
(map! :leader
:desc "M-x" ":" #'execute-extended-command
:desc "Open shell here" ";"
(cond ((featurep! :term eshell) #'+eshell/toggle)
((featurep! :term shell) #'+shell/toggle)
((featurep! :term term) #'+term/toggle)
((featurep! :term vterm) #'+vterm/toggle)
(t nil))
(map! :leader
:desc "M-x" ":" #'execute-extended-command
:desc "Open shell here" ";"
(cond ((featurep! :term eshell) #'+eshell/toggle)
((featurep! :term shell) #'+shell/toggle)
((featurep! :term term) #'+term/toggle)
((featurep! :term vterm) #'+vterm/toggle)
(t nil))
(:when (featurep! :ui popup)
:desc "Toggle last popup" "~" #'+popup/toggle)
(:when (featurep! :ui popup)
:desc "Toggle last popup" "~" #'+popup/toggle)
:desc "Switch to last buffer" "TAB"
(cond ((featurep! :ui workspaces) #'+custom/alternate-buffer-in-persp)
(t #'evil-switch-to-windows-last-buffer))
:desc "Switch to last buffer" "TAB"
(cond ((featurep! :ui workspaces) #'+custom/alternate-buffer-in-persp)
(t #'evil-switch-to-windows-last-buffer))
:desc "Resume last search" "SPC"
(cond ((featurep! :completion ivy) #'ivy-resume)
((featurep! :completion helm) #'helm-resume)
(t nil))
:desc "Resume last search" "SPC"
(cond ((featurep! :completion ivy) #'ivy-resume)
((featurep! :completion helm) #'helm-resume)
(t nil))
:desc "Search in project" "/" (cmd!! #'+default/search-project nil)
:desc "Search for symbol in project" "*" (cmd!! #'+default/search-project-for-symbol-at-point nil)
:desc "Search in project" "/" (cmd!! #'+default/search-project nil)
:desc "Search for symbol in project" "*" (cmd!! #'+default/search-project-for-symbol-at-point nil)
"." nil
"," nil
"<" nil
"`" nil
"'" nil
"RET" nil
"." nil
"," nil
"<" nil
"`" nil
"'" nil
"RET" nil
:desc "Switch to 1st window" "1" #'winum-select-window-1
:desc "Switch to 2nd window" "2" #'winum-select-window-2
:desc "Switch to 3rd window" "3" #'winum-select-window-3
:desc "Switch to 4th window" "4" #'winum-select-window-4
:desc "Switch to 5th window" "5" #'winum-select-window-5
:desc "Switch to 6th window" "6" #'winum-select-window-6
:desc "Switch to 7th window" "7" #'winum-select-window-7
:desc "Switch to 8th window" "8" #'winum-select-window-8
:desc "Switch to 9th window" "9" #'winum-select-window-9
:desc "Switch to side window" "0"
(cond ((featurep! :ui neotree) #'+neotree/expand-or-open)
((featurep! :ui treemacs) #'treemacs-select-window)
(t nil))
:desc "Switch to 1st window" "1" #'winum-select-window-1
:desc "Switch to 2nd window" "2" #'winum-select-window-2
:desc "Switch to 3rd window" "3" #'winum-select-window-3
:desc "Switch to 4th window" "4" #'winum-select-window-4
:desc "Switch to 5th window" "5" #'winum-select-window-5
:desc "Switch to 6th window" "6" #'winum-select-window-6
:desc "Switch to 7th window" "7" #'winum-select-window-7
:desc "Switch to 8th window" "8" #'winum-select-window-8
:desc "Switch to 9th window" "9" #'winum-select-window-9
:desc "Switch to side window" "0"
(cond ((featurep! :ui neotree) #'+neotree/expand-or-open)
((featurep! :ui treemacs) #'treemacs-select-window)
(t nil))
"x" nil
"X" nil
"x" nil
"X" nil
:desc "Universal argument" "u" #'universal-argument
:desc "window" "w" evil-window-map
:desc "help" "h" help-map
:desc "Universal argument" "u" #'universal-argument
:desc "window" "w" evil-window-map
:desc "help" "h" help-map
(:prefix-map ("b" . "buffer")
:desc "Toggle narrowing" "-" #'doom/toggle-narrow-buffer
:desc "Previous buffer" "[" #'previous-buffer
:desc "Next buffer" "]" #'next-buffer
(:when (featurep! :ui workspaces)
:desc "Switch workspace buffer" "b" #'persp-switch-to-buffer
:desc "Switch buffer" "B" #'switch-to-buffer)
(:unless (featurep! :ui workspaces)
:desc "Switch buffer" "b" #'switch-to-buffer)
:desc "Kill buffer" "d" #'kill-current-buffer
:desc "Kill all buffers" "D" #'doom/kill-all-buffers
:desc "List buffers" "i" #'ibuffer
"k" nil
"K" nil
"l" nil
:desc "Set bookmark" "m" #'bookmark-set
:desc "Delete bookmark" "M" #'bookmark-delete
:desc "Next buffer" "n" #'next-buffer
:desc "New empty buffer" "N" #'evil-buffer-new
:desc "Kill other buffers" "O" #'doom/kill-other-buffers
:desc "Previous buffer" "p" #'previous-buffer
:desc "Paste and replace buffer" "P" #'+custom/paste-buffer
"r" nil
:desc "Revert buffer" "R" #'+custom/safe-revert-buffer
:desc "Save buffer" "s" #'basic-save-buffer
:desc "Save all buffers" "S" #'evil-write-all
:desc "Reopen killed buffer" "u" #'+custom/reopen-killed-buffer
(:when (featurep! :emacs undo +tree)
:desc "Open undo tree" "U" #'undo-tree-visualize)
:desc "Pop up scratch buffer" "x" #'doom/open-scratch-buffer
:desc "Switch to scratch buffer" "X" #'doom/switch-to-scratch-buffer
:desc "Yank buffer" "Y" #'+custom/yank-buffer
:desc "Bury buffer" "z" #'bury-buffer
:desc "Kill buried buffers" "Z" #'doom/kill-buried-buffers)
(:prefix-map ("b" . "buffer")
:desc "Toggle narrowing" "-" #'doom/toggle-narrow-buffer
:desc "Previous buffer" "[" #'previous-buffer
:desc "Next buffer" "]" #'next-buffer
(:when (featurep! :ui workspaces)
:desc "Switch workspace buffer" "b" #'persp-switch-to-buffer
:desc "Switch buffer" "B" #'switch-to-buffer)
(:unless (featurep! :ui workspaces)
:desc "Switch buffer" "b" #'switch-to-buffer)
:desc "Kill buffer" "d" #'kill-current-buffer
:desc "Kill all buffers" "D" #'doom/kill-all-buffers
:desc "List buffers" "i" #'ibuffer
"k" nil
"K" nil
"l" nil
:desc "Set bookmark" "m" #'bookmark-set
:desc "Delete bookmark" "M" #'bookmark-delete
:desc "Next buffer" "n" #'next-buffer
:desc "New empty buffer" "N" #'evil-buffer-new
:desc "Kill other buffers" "O" #'doom/kill-other-buffers
:desc "Previous buffer" "p" #'previous-buffer
:desc "Paste and replace buffer" "P" #'+custom/paste-buffer
"r" nil
:desc "Revert buffer" "R" #'+custom/safe-revert-buffer
:desc "Save buffer" "s" #'basic-save-buffer
:desc "Save all buffers" "S" #'evil-write-all
:desc "Reopen killed buffer" "u" #'+custom/reopen-killed-buffer
(:when (featurep! :emacs undo +tree)
:desc "Open undo tree" "U" #'undo-tree-visualize)
:desc "Pop up scratch buffer" "x" #'doom/open-scratch-buffer
:desc "Switch to scratch buffer" "X" #'doom/switch-to-scratch-buffer
:desc "Yank buffer" "Y" #'+custom/yank-buffer
:desc "Bury buffer" "z" #'bury-buffer
:desc "Kill buried buffers" "Z" #'doom/kill-buried-buffers)
"c" nil
(:after lsp-mode
"c" nil)
"c" nil
(:after lsp-mode
"c" nil)
(:prefix-map ("f" . "file")
"c" nil
:desc "Copy this file" "C" #'+custom/copy-this-file
:desc "Delete this file" "D" #'doom/delete-this-file
:desc "Find file as root" "e" #'doom/sudo-find-file
:desc "Open current file as root" "E" #'doom/sudo-this-file
:desc "Find file" "f" #'find-file
:desc "Find file from here" "F" #'+default/find-file-under-here
"l" nil
"p" nil
"P" nil
:desc "Recent files" "r" #'recentf-open-files
:desc "Rename/move file" "R" #'doom/move-this-file
:desc "Save file" "s" #'save-buffer
:desc "Save file as..." "S" #'write-file
"u" nil
"U" nil
:desc "Yank file path" "y" #'+default/yank-buffer-path
:desc "Yank file path from project" "Y" #'+default/yank-buffer-path-relative-to-project)
(:prefix-map ("f" . "file")
"c" nil
:desc "Copy this file" "C" #'+custom/copy-this-file
:desc "Delete this file" "D" #'doom/delete-this-file
:desc "Find file as root" "e" #'doom/sudo-find-file
:desc "Open current file as root" "E" #'doom/sudo-this-file
:desc "Find file" "f" #'find-file
:desc "Find file from here" "F" #'+default/find-file-under-here
"l" nil
"p" nil
"P" nil
:desc "Recent files" "r" #'recentf-open-files
:desc "Rename/move file" "R" #'doom/move-this-file
:desc "Save file" "s" #'save-buffer
:desc "Save file as..." "S" #'write-file
"u" nil
"U" nil
:desc "Yank file path" "y" #'+default/yank-buffer-path
:desc "Yank file path from project" "Y" #'+default/yank-buffer-path-relative-to-project)
(:prefix-map ("g" . "git")
:desc "Revert file" "R" #'vc-revert
:desc "Copy link to remote" "y" #'+vc/browse-at-remote-kill
:desc "Copy link to homepage" "Y" #'+vc/browse-at-remote-kill-homepage
(:when (featurep! :ui hydra)
:desc "Merge" "m" #'+vc/smerge-hydra/body)
(:when (featurep! :ui vc-gutter)
"]" nil
"[" nil
"." nil
:desc "Jump to next hunk" "n" #'git-gutter:next-hunk
:desc "Jump to previous hunk" "p" #'git-gutter:previous-hunk
:desc "Revert hunk" "r" #'git-gutter:revert-hunk
:desc "Git stage hunk" "s" #'git-gutter:stage-hunk
:desc "Git time machine" "t" #'git-timemachine-toggle)
(:when (featurep! :tools magit)
"/" nil
"'" nil
:desc "Git switch branch" "b" #'magit-branch-checkout
:desc "Git status" "g" #'magit-status
"D" nil
:desc "Git blame" "B" #'magit-blame-addition
:desc "Git clone" "C" #'magit-clone
:desc "Git fetch" "f" #'magit-fetch
:desc "Git pull" "F" #'magit-pull
:desc "Git buffer log" "L" #'magit-log
:desc "Git stage file" "S" #'magit-stage-file
:desc "Git unstage file" "U" #'magit-unstage-file
"f" nil
(:prefix ("o" . "open in browser")
:desc "Browse file or region" "o" #'browse-at-remote
:desc "Browse homepage" "h" #'+vc/browse-at-remote-homepage
(:when (featurep! :tools magit +forge)
:desc "Browse remote" "r" #'forge-browse-remote
:desc "Browse commit" "c" #'forge-browse-commit
:desc "Browse an issue" "i" #'forge-browse-issue
:desc "Browse a pull request" "p" #'forge-browse-pullreq
:desc "Browse issues" "I" #'forge-browse-issues
:desc "Browse pull requests" "P" #'forge-browse-pullreqs))
(:prefix ("l" . "list")
(:when (featurep! :tools gist)
:desc "List gists" "g" #'+gist:list)
:desc "List repositories" "r" #'magit-list-repositories
:desc "List submodules" "s" #'magit-list-submodules
(:when (featurep! :tools magit +forge)
:desc "List issues" "i" #'forge-list-issues
:desc "List pull requests" "p" #'forge-list-pullreqs
:desc "List notifications" "n" #'forge-list-notifications))
(:prefix ("c" . "create")
:desc "Initialize repo" "r" #'magit-init
"R" nil
:desc "Commit" "c" #'magit-commit-create
:desc "Fixup" "f" #'magit-commit-fixup
:desc "Branch" "b" #'magit-branch-and-checkout
(:when (featurep! :tools magit +forge)
:desc "Issue" "i" #'forge-create-issue
:desc "Pull request" "p" #'forge-create-pullreq))))
(:prefix-map ("g" . "git")
:desc "Revert file" "R" #'vc-revert
:desc "Copy link to remote" "y" #'+vc/browse-at-remote-kill
:desc "Copy link to homepage" "Y" #'+vc/browse-at-remote-kill-homepage
(:when (featurep! :ui hydra)
:desc "Merge" "m" #'+vc/smerge-hydra/body)
(:when (featurep! :ui vc-gutter)
"]" nil
"[" nil
"." nil
:desc "Jump to next hunk" "n" #'git-gutter:next-hunk
:desc "Jump to previous hunk" "p" #'git-gutter:previous-hunk
:desc "Revert hunk" "r" #'git-gutter:revert-hunk
:desc "Git stage hunk" "s" #'git-gutter:stage-hunk
:desc "Git time machine" "t" #'git-timemachine-toggle)
(:when (featurep! :tools magit)
"/" nil
"'" nil
:desc "Git switch branch" "b" #'magit-branch-checkout
:desc "Git status" "g" #'magit-status
"D" nil
:desc "Git blame" "B" #'magit-blame-addition
:desc "Git clone" "C" #'magit-clone
:desc "Git fetch" "f" #'magit-fetch
:desc "Git pull" "F" #'magit-pull
:desc "Git buffer log" "L" #'magit-log
:desc "Git stage file" "S" #'magit-stage-file
:desc "Git unstage file" "U" #'magit-unstage-file
"f" nil
(:prefix ("o" . "open in browser")
:desc "Browse file or region" "o" #'browse-at-remote
:desc "Browse homepage" "h" #'+vc/browse-at-remote-homepage
(:when (featurep! :tools magit +forge)
:desc "Browse remote" "r" #'forge-browse-remote
:desc "Browse commit" "c" #'forge-browse-commit
:desc "Browse an issue" "i" #'forge-browse-issue
:desc "Browse a pull request" "p" #'forge-browse-pullreq
:desc "Browse issues" "I" #'forge-browse-issues
:desc "Browse pull requests" "P" #'forge-browse-pullreqs))
(:prefix ("l" . "list")
(:when (featurep! :tools gist)
:desc "List gists" "g" #'+gist:list)
:desc "List repositories" "r" #'magit-list-repositories
:desc "List submodules" "s" #'magit-list-submodules
(:when (featurep! :tools magit +forge)
:desc "List issues" "i" #'forge-list-issues
:desc "List pull requests" "p" #'forge-list-pullreqs
:desc "List notifications" "n" #'forge-list-notifications))
(:prefix ("c" . "create")
:desc "Initialize repo" "r" #'magit-init
"R" nil
:desc "Commit" "c" #'magit-commit-create
:desc "Fixup" "f" #'magit-commit-fixup
:desc "Branch" "b" #'magit-branch-and-checkout
(:when (featurep! :tools magit +forge)
:desc "Issue" "i" #'forge-create-issue
:desc "Pull request" "p" #'forge-create-pullreq))))
"i" nil
(:prefix-map ("m" . "localleader")
(:when (and (featurep! :tools lsp) (not (featurep! :tools lsp +eglot)))
(:prefix ("l" . "lsp")
:desc "Execute code action" "a" #'lsp-execute-code-action
:desc "Organize imports" "o" #'lsp-organize-imports
(:when (featurep! :completion ivy)
:desc "Jump to symbol in current workspace" "j" #'lsp-ivy-workspace-symbol
:desc "Jump to symbol in any workspace" "J" #'lsp-ivy-global-workspace-symbol)
(:when (featurep! :completion helm)
:desc "Jump to symbol in current workspace" "j" #'helm-lsp-workspace-symbol
:desc "Jump to symbol in any workspace" "J" #'helm-lsp-global-workspace-symbol)
(:when (featurep! :completion vertico)
:desc "Jump to symbol in current workspace" "j" #'consult-lsp-symbols
:desc "Jump to symbol in any workspace" "J" (cmd!! #'consult-lsp-symbols 'all-workspaces))
(:when (featurep! :ui treemacs +lsp)
:desc "List errors" "X" #'lsp-treemacs-errors-list
:desc "Show incoming call hierarchy" "y" #'lsp-treemacs-call-hierarchy
:desc "Show outgoing call hierarchy" "Y" (cmd!! #'lsp-treemacs-call-hierarchy t)
:desc "Show references tree" "R" (cmd!! #'lsp-treemacs-references t)
:desc "Show symbols" "S" #'lsp-treemacs-symbols)
:desc "Rename" "r" #'lsp-rename)))
"n" nil
"o" nil
"i" nil
(:prefix-map ("m" . "localleader")
(:when (and (featurep! :tools lsp) (not (featurep! :tools lsp +eglot)))
(:prefix ("l" . "lsp")
:desc "Execute code action" "a" #'lsp-execute-code-action
:desc "Organize imports" "o" #'lsp-organize-imports
(:when (featurep! :completion ivy)
:desc "Jump to symbol in current workspace" "j" #'lsp-ivy-workspace-symbol
:desc "Jump to symbol in any workspace" "J" #'lsp-ivy-global-workspace-symbol)
(:when (featurep! :completion helm)
:desc "Jump to symbol in current workspace" "j" #'helm-lsp-workspace-symbol
:desc "Jump to symbol in any workspace" "J" #'helm-lsp-global-workspace-symbol)
(:when (featurep! :completion vertico)
:desc "Jump to symbol in current workspace" "j" #'consult-lsp-symbols
:desc "Jump to symbol in any workspace" "J" (cmd!! #'consult-lsp-symbols 'all-workspaces))
(:when (featurep! :ui treemacs +lsp)
:desc "List errors" "X" #'lsp-treemacs-errors-list
:desc "Show incoming call hierarchy" "y" #'lsp-treemacs-call-hierarchy
:desc "Show outgoing call hierarchy" "Y" (cmd!! #'lsp-treemacs-call-hierarchy t)
:desc "Show references tree" "R" (cmd!! #'lsp-treemacs-references t)
:desc "Show symbols" "S" #'lsp-treemacs-symbols)
:desc "Rename" "r" #'lsp-rename)))
"n" nil
"o" nil
(:prefix-map ("p" . "project")
(:when (featurep! :ui workspaces)
:desc "Switch to last project" "TAB" #'+workspace/other
:desc "Switch to next project" "]" #'+workspace/switch-right
:desc "Switch to previous project" "[" #'+workspace/switch-left
:desc "Switch to 1st project" "1" #'+workspace/switch-to-0
:desc "Switch to 2nd project" "2" #'+workspace/switch-to-1
:desc "Switch to 3rd project" "3" #'+workspace/switch-to-2
:desc "Switch to 4th project" "4" #'+workspace/switch-to-3
:desc "Switch to 5th project" "5" #'+workspace/switch-to-4
:desc "Switch to 6th project" "6" #'+workspace/switch-to-5
:desc "Switch to 7th project" "7" #'+workspace/switch-to-6
:desc "Switch to 8th project" "8" #'+workspace/switch-to-7
:desc "Switch to 9th project" "9" #'+workspace/switch-to-8)
"." nil
">" nil
"!" nil
:desc "Open shell in project root" ";" (cond ((featurep! :term vterm) #'+vterm/here) (t nil))
:desc "Run cmd in project root" "!" #'projectile-run-shell-command-in-root
:desc "Async cmd in project root" "&" #'projectile-run-async-shell-command-in-root
:desc "Add new project" "a" #'projectile-add-known-project
"b" nil
"c" nil
"C" nil
"d" nil
:desc "Delete project workspace" "D" #'+workspace/delete
"e" nil
:desc "Find file in project" "f" #'projectile-find-file
"F" nil
"g" nil
"i" nil
"k" nil
:desc "List project workspaces" "l" #'+workspace/display
:desc "New project workspace" "n" #'+workspace/new
"o" nil
:desc "Switch project" "p" #'projectile-switch-project
:desc "Find recent project files" "r" #'projectile-recentf
:desc "Rename project workspace" "R" #'+workspace/rename
"s" nil
:desc "Save project files" "S" #'projectile-save-project-buffers
:desc "Toggle file tree" "t"
(cond ((featurep! :ui neotree) #'+neotree/open)
((featurep! :ui treemacs) #'+treemacs/toggle)
(t nil))
"T" nil
:desc "Switch project workspace" "w" #'+workspace/switch-to
:desc "Remove project" "x" #'projectile-remove-known-project
"X" nil)
(:prefix-map ("p" . "project")
(:when (featurep! :ui workspaces)
:desc "Switch to last project" "TAB" #'+workspace/other
:desc "Switch to next project" "]" #'+workspace/switch-right
:desc "Switch to previous project" "[" #'+workspace/switch-left
:desc "Switch to 1st project" "1" #'+workspace/switch-to-0
:desc "Switch to 2nd project" "2" #'+workspace/switch-to-1
:desc "Switch to 3rd project" "3" #'+workspace/switch-to-2
:desc "Switch to 4th project" "4" #'+workspace/switch-to-3
:desc "Switch to 5th project" "5" #'+workspace/switch-to-4
:desc "Switch to 6th project" "6" #'+workspace/switch-to-5
:desc "Switch to 7th project" "7" #'+workspace/switch-to-6
:desc "Switch to 8th project" "8" #'+workspace/switch-to-7
:desc "Switch to 9th project" "9" #'+workspace/switch-to-8)
"." nil
">" nil
"!" nil
:desc "Open shell in project root" ";" (cond ((featurep! :term vterm) #'+vterm/here) (t nil))
:desc "Run cmd in project root" "!" #'projectile-run-shell-command-in-root
:desc "Async cmd in project root" "&" #'projectile-run-async-shell-command-in-root
:desc "Add new project" "a" #'projectile-add-known-project
"b" nil
"c" nil
"C" nil
"d" nil
:desc "Delete project workspace" "D" #'+workspace/delete
"e" nil
:desc "Find file in project" "f" #'projectile-find-file
"F" nil
"g" nil
"i" nil
"k" nil
:desc "List project workspaces" "l" #'+workspace/display
:desc "New project workspace" "n" #'+workspace/new
"o" nil
:desc "Switch project" "p" #'projectile-switch-project
:desc "Find recent project files" "r" #'projectile-recentf
:desc "Rename project workspace" "R" #'+workspace/rename
"s" nil
:desc "Save project files" "S" #'projectile-save-project-buffers
:desc "Toggle file tree" "t"
(cond ((featurep! :ui neotree) #'+neotree/open)
((featurep! :ui treemacs) #'+treemacs/toggle)
(t nil))
"T" nil
:desc "Switch project workspace" "w" #'+workspace/switch-to
:desc "Remove project" "x" #'projectile-remove-known-project
"X" nil)
(:prefix-map ("q" . "quit/session")
:desc "Restart emacs server" "d" #'+default/restart-server
:desc "Delete frame" "f" #'delete-frame
:desc "Clear current frame" "F" #'doom/kill-all-buffers
:desc "Kill Emacs (and daemon)" "K" #'save-buffers-kill-emacs
:desc "Quit Emacs" "q" #'save-buffers-kill-terminal
:desc "Quit Emacs without saving" "Q" #'evil-quit-all-with-error-code
:desc "Quick save current session" "s" #'doom/quicksave-session
:desc "Restore last session" "l" #'doom/quickload-session
:desc "Save session to file" "S" #'doom/save-session
:desc "Restore session from file" "L" #'doom/load-session
:desc "Restart & restore Emacs" "r" #'doom/restart-and-restore
:desc "Restart Emacs" "R" #'doom/restart)
(:prefix-map ("q" . "quit/session")
:desc "Restart emacs server" "d" #'+default/restart-server
:desc "Delete frame" "f" #'delete-frame
:desc "Clear current frame" "F" #'doom/kill-all-buffers
:desc "Kill Emacs (and daemon)" "K" #'save-buffers-kill-emacs
:desc "Quit Emacs" "q" #'save-buffers-kill-terminal
:desc "Quit Emacs without saving" "Q" #'evil-quit-all-with-error-code
:desc "Quick save current session" "s" #'doom/quicksave-session
:desc "Restore last session" "l" #'doom/quickload-session
:desc "Save session to file" "S" #'doom/save-session
:desc "Restore session from file" "L" #'doom/load-session
:desc "Restart & restore Emacs" "r" #'doom/restart-and-restore
:desc "Restart Emacs" "R" #'doom/restart)
(:prefix-map ("s" . "search")
:desc "Jump to bookmark" "b" #'bookmark-jump
:desc "Search current directory" "d" #'+default/search-cwd
:desc "Search other directory" "D" #'+default/search-other-cwd
"f" nil
:desc "Jump to symbol" "i" #'imenu
:desc "Jump to visible link" "l" #'link-hint-open-link
:desc "Jump to link" "L" #'ffap-menu
:desc "Jump list" "j" #'evil-show-jumps
:desc "Jump to mark" "m" #'evil-show-marks
:desc "Look up online" "o" #'+lookup/online
:desc "Look up online (w/ prompt)" "O" #'+lookup/online-select
:desc "Look up in local docsets" "k" #'+lookup/in-docsets
:desc "Look up in all docsets" "K" #'+lookup/in-all-docsets
"p" nil
"P" nil
:desc "Replace in buffer" "r" #'+custom/query-replace-buffer
:desc "Replace in project" "R" #'projectile-replace
:desc "Search buffer" "s" #'+default/search-buffer
:desc "Dictionary" "t" #'+lookup/dictionary-definition
:desc "Thesaurus" "T" #'+lookup/synonyms)
(:prefix-map ("s" . "search")
:desc "Jump to bookmark" "b" #'bookmark-jump
:desc "Search current directory" "d" #'+default/search-cwd
:desc "Search other directory" "D" #'+default/search-other-cwd
"f" nil
:desc "Jump to symbol" "i" #'imenu
:desc "Jump to visible link" "l" #'link-hint-open-link
:desc "Jump to link" "L" #'ffap-menu
:desc "Jump list" "j" #'evil-show-jumps
:desc "Jump to mark" "m" #'evil-show-marks
:desc "Look up online" "o" #'+lookup/online
:desc "Look up online (w/ prompt)" "O" #'+lookup/online-select
:desc "Look up in local docsets" "k" #'+lookup/in-docsets
:desc "Look up in all docsets" "K" #'+lookup/in-all-docsets
"p" nil
"P" nil
:desc "Replace in buffer" "r" #'+custom/query-replace-buffer
:desc "Replace in project" "R" #'projectile-replace
:desc "Search buffer" "s" #'+default/search-buffer
:desc "Dictionary" "t" #'+lookup/dictionary-definition
:desc "Thesaurus" "T" #'+lookup/synonyms)
"r" nil
"r" nil
(:prefix-map ("t" . "toggle")
"b" nil
"f" nil
"F" nil
"g" nil
(:when (featurep! :ui indent-guides)
:desc "Indent guides" "i" #'highlight-indent-guides-mode)
:desc "Indent style" "I" #'doom/toggle-indent-style
:desc "Line numbers" "l" #'doom/toggle-line-numbers
"p" nil
"r" nil
"s" nil
"t" nil
"w" nil
:desc "Soft line wrapping" "w" #'visual-line-mode
(:when (featurep! :editor word-wrap)
:desc "Soft line wrapping" "w" #'+word-wrap-mode)
:desc "Zoom" "z" #'+hydra/text-zoom/body))
(:prefix-map ("t" . "toggle")
"b" nil
"f" nil
"F" nil
"g" nil
(:when (featurep! :ui indent-guides)
:desc "Indent guides" "i" #'highlight-indent-guides-mode)
:desc "Indent style" "I" #'doom/toggle-indent-style
:desc "Line numbers" "l" #'doom/toggle-line-numbers
"p" nil
"r" nil
"s" nil
"t" nil
"w" nil
:desc "Soft line wrapping" "w" #'visual-line-mode
(:when (featurep! :editor word-wrap)
:desc "Soft line wrapping" "w" #'+word-wrap-mode)
:desc "Zoom" "z" #'+hydra/text-zoom/body)))

View File

@ -1,6 +0,0 @@
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(auth-source-save-behavior nil))

View File

@ -1,7 +0,0 @@
;;; cli.el -*- lexical-binding: t; -*-
(defcligroup! "Custom"
"Custom, user-defined commands."
(defcli! standalone (mode-or-file &rest args)
"Spawn an emacsclient window with a standalone buffer for the given mode or file."
(throw 'exit (list "emacsclient" "--create-frame" "--eval" (concat "(custom--with-standalone-buffer" (apply #'concat (mapcar (lambda (c) (concat "\"" c "\"")) (cons mode-or-file args))) ")")))))

View File

@ -1,4 +1,4 @@
;;; functions.el -*- lexical-binding: t; -*-
;;; custom.el -*- lexical-binding: t; -*-
(defun +custom/alternate-buffer-in-persp (&optional window)
"Switch back and forth between current and last buffer in the current window."
@ -24,11 +24,6 @@ to the `killed-buffer-list' when killing the buffer."
(when buffer-file-name
(push buffer-file-name +custom--killed-buffer-list)))
(defun +custom/font-scale (size)
"Scale font of given SIZE by the default font scale in the environment."
(let ((scaled (round (* size (string-to-number (getenv "GDK_DPI_SCALE"))))))
(if (floatp size) (float scaled) scaled)))
(defun +custom/reopen-killed-buffer ()
"Reopen the most recently killed file buffer, if one exists."
(interactive)
@ -61,6 +56,11 @@ to the `killed-buffer-list' when killing the buffer."
(call-interactively 'query-replace))
(goto-char orig-point)))
(defun +custom/font-scale (size)
"Scale font of given SIZE by the default font scale in the environment."
(let ((scaled (round (* size (string-to-number (getenv "GDK_DPI_SCALE"))))))
(if (floatp size) (float scaled) scaled)))
(defun +custom/copy-this-file (new-path &optional force-p)
"Copy current buffer's file to NEW-PATH, switching to the file immediately."
(interactive
@ -68,55 +68,3 @@ to the `killed-buffer-list' when killing the buffer."
current-prefix-arg))
(doom/copy-this-file new-path force-p)
(find-file new-path))
(defun custom--with-standalone-buffer (mode-or-file &rest args)
"Create and start MODE-OR-FILE in standalone buffer."
(setq-default mode-line-format nil
left-margin-width 0
right-margin-width 0
large-file-warning-threshold nil
confirm-kill-emacs nil
confirm-kill-processes nil)
(if (not (file-exists-p mode-or-file))
(progn (switch-to-buffer (generate-new-buffer (concat "*standalone-" mode-or-file "*")))
(apply (intern mode-or-file) args))
(find-file mode-or-file))
(persp-mode -1)
(solaire-mode -1)
(evil-emacs-state +1)
(add-hook! 'kill-buffer-hook :append :local #'save-buffers-kill-terminal))
(defvar +sql--startable-product-list nil
"List of start-able SQL products.")
(defvar +sql--highlightable-product-list nil
"List of highlight-able SQL products.")
(defun +sql--populate-product-list ()
"Update list of SQL products."
(setq +sql--highlightable-product-list sql-product-alist
+sql--startable-product-list
(cl-remove-if-not (lambda (product) (sql-get-product-feature (car product) :sqli-program)) sql-product-alist)))
(defun +sql--get-product-names (products)
"Get alist of SQL product names and symbols."
(mapcar
(lambda (product)
(cons (sql-get-product-feature (car product) :name) (car product)))
products))
(defun +sql/set-product ()
"Set dialect-specific highlighting for buffer"
(interactive)
(cond ((featurep! :completion ivy)
(ivy-read "SQL products: "
(+sql--get-product-names +sql--startable-product-list)
:require-match t
:action #'(lambda (product) (sql-set-product (cdr product)))
:caller '+sql/open-repl))))
(defun +sql/start ()
"Set SQL dialect-specific highlighting and start inferior SQLi process."
(interactive)
(+sql/set-product)
(sql-product-interactive))

View File

@ -0,0 +1,36 @@
;;; custom/sql.el -*- lexical-binding: t; -*-
(defvar +sql--startable-product-list nil
"List of start-able SQL products.")
(defvar +sql--highlightable-product-list nil
"List of highlight-able SQL products.")
(defun +sql--populate-product-list ()
"Update list of SQL products."
(setq +sql--highlightable-product-list sql-product-alist
+sql--startable-product-list
(cl-remove-if-not (lambda (product) (sql-get-product-feature (car product) :sqli-program)) sql-product-alist)))
(defun +sql--get-product-names (products)
"Get alist of SQL product names and symbols."
(mapcar
(lambda (product)
(cons (sql-get-product-feature (car product) :name) (car product)))
products))
(defun +sql/set-product ()
"Set dialect-specific highlighting for buffer"
(interactive)
(cond ((featurep! :completion ivy)
(ivy-read "SQL products: "
(+sql--get-product-names +sql--startable-product-list)
:require-match t
:action #'(lambda (product) (sql-set-product (cdr product)))
:caller '+sql/open-repl))))
(defun +sql/start ()
"Set SQL dialect-specific highlighting and start inferior SQLi process."
(interactive)
(+sql/set-product)
(sql-product-interactive))

View File

@ -1,8 +1,5 @@
;;; .doom.d/init.el -*- lexical-binding: t; -*-
(load! "custom/functions")
(after! doom-cli (load! "custom/cli"))
(doom! :completion
company
(vertico +icons)

View File

@ -18,11 +18,10 @@ indicate_hidden = yes # Show how many messages are currently hidden (because
shrink = no # Shrink window if it's smaller than the width.
transparency = 15 # The transparency of the window. Range: [0; 100].
notification_height = 0 # The height of the entire notification.
separator_height = 2 # Draw a line of "separator_height" pixel height between two notifications.
padding = 15 # Padding between text and separator.
horizontal_padding = 15 # Horizontal padding.
text_icon_padding = 0 # Padding between text and icon.
separator_height = 2 # Draw a line of "separator_height" pixel height between two notifications.
padding = 15 # Padding between text and separator.
horizontal_padding = 15 # Horizontal padding.
text_icon_padding = 0 # Padding between text and icon.
frame_width = 2 # Width in pixels of frame around the notification window.
frame_color = "#d8d8d8" # Defines color of the frame around the notification window.

View File

@ -0,0 +1,2 @@
[Unit]
After=graphical-session.target

View File

@ -1,5 +0,0 @@
#!/bin/sh
#
# A shortcut for running a standalone buffer in the default Emacs server instance.
exec /usr/bin/emacsclient --create-frame --eval "(custom--with-standalone-buffer $(printf ' "%s"' "$@"))"