mirror of
https://github.com/SqrtMinusOne/dotfiles.git
synced 2025-12-11 19:45:25 +03:00
feat(emacs): evil-collection -> general, vterm fixes, plantuml
This commit is contained in:
parent
56e87062d7
commit
0e769a951f
3 changed files with 218 additions and 123 deletions
|
|
@ -8,5 +8,6 @@
|
||||||
"mpv"
|
"mpv"
|
||||||
"python-isort"
|
"python-isort"
|
||||||
"python-yapf"
|
"python-yapf"
|
||||||
|
"plantuml"
|
||||||
"graphviz"
|
"graphviz"
|
||||||
"emacs-emacsql-sqlite3"))
|
"emacs-emacsql-sqlite3"))
|
||||||
|
|
|
||||||
163
.emacs.d/init.el
163
.emacs.d/init.el
|
|
@ -238,9 +238,16 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
|
||||||
"C-x h" 'previous-buffer
|
"C-x h" 'previous-buffer
|
||||||
"C-x l" 'next-buffer)
|
"C-x l" 'next-buffer)
|
||||||
|
|
||||||
|
(general-define-key
|
||||||
|
:keymaps 'evil-window-map
|
||||||
|
"x" 'kill-buffer-and-window)
|
||||||
|
|
||||||
(winner-mode 1)
|
(winner-mode 1)
|
||||||
(define-key evil-window-map (kbd "u") 'winner-undo)
|
|
||||||
(define-key evil-window-map (kbd "U") 'winner-redo)
|
(general-define-key
|
||||||
|
:keymaps 'evil-window-map
|
||||||
|
"u" 'winner-undo
|
||||||
|
"U" 'winner-redo)
|
||||||
|
|
||||||
(my-leader-def
|
(my-leader-def
|
||||||
:infix "b"
|
:infix "b"
|
||||||
|
|
@ -470,8 +477,9 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
|
||||||
"a" 'counsel-rg
|
"a" 'counsel-rg
|
||||||
"A" 'counsel-ag)
|
"A" 'counsel-ag)
|
||||||
|
|
||||||
(general-imap
|
(general-define-key
|
||||||
"C-y" 'counsel-yank-pop)
|
:states '(insert normal)
|
||||||
|
"C-y" 'counsel-yank-pop)
|
||||||
|
|
||||||
(my-leader-def "SPC" 'ivy-resume)
|
(my-leader-def "SPC" 'ivy-resume)
|
||||||
(my-leader-def "s" 'swiper-isearch
|
(my-leader-def "s" 'swiper-isearch
|
||||||
|
|
@ -915,19 +923,16 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(setq truncate-lines t)
|
(setq truncate-lines t)
|
||||||
(visual-line-mode nil)))
|
(visual-line-mode nil)))
|
||||||
(evil-collection-define-key 'normal 'dired-mode-map
|
|
||||||
"h" 'dired-up-directory
|
|
||||||
"l" 'dired-find-file
|
|
||||||
"=" 'dired-narrow
|
|
||||||
"-" 'dired-create-empty-file
|
|
||||||
"~" 'vterm
|
|
||||||
(kbd "<left>") 'dired-up-directory
|
|
||||||
(kbd "<right>") 'dired-find-file)
|
|
||||||
(general-define-key
|
(general-define-key
|
||||||
|
:states '(normal)
|
||||||
:keymaps 'dired-mode-map
|
:keymaps 'dired-mode-map
|
||||||
;; [remap dired-find-file] 'dired-single-buffer
|
"h" 'dired-up-directory
|
||||||
;; [remap dired-mouse-find-file-other-window] 'dired-single-buffer-mouse
|
"l" 'dired-find-file
|
||||||
;; [remap dired-up-directory] 'dired-single-up-directory
|
"=" 'dired-narrow
|
||||||
|
"-" 'dired-create-empty-file
|
||||||
|
"~" 'vterm
|
||||||
|
"<left>" 'dired-up-directory
|
||||||
|
"<right>" 'dired-find-file
|
||||||
"M-<return>" 'dired-open-xdg))
|
"M-<return>" 'dired-open-xdg))
|
||||||
|
|
||||||
(defun my/dired-home ()
|
(defun my/dired-home ()
|
||||||
|
|
@ -994,16 +999,18 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
|
||||||
(dired dir)))
|
(dired dir)))
|
||||||
|
|
||||||
(with-eval-after-load 'dired
|
(with-eval-after-load 'dired
|
||||||
(evil-collection-define-key 'normal 'dired-mode-map
|
(general-define-key
|
||||||
"s" nil
|
:states '(normal)
|
||||||
"ss" 'dired-maybe-insert-subdir
|
:keymaps 'dired-mode-map
|
||||||
"sl" 'dired-maybe-insert-subdir
|
"s" nil
|
||||||
"sq" 'dired-kill-subdir
|
"ss" 'dired-maybe-insert-subdir
|
||||||
"sk" 'dired-prev-subdir
|
"sl" 'dired-maybe-insert-subdir
|
||||||
"sj" 'dired-next-subdir
|
"sq" 'dired-kill-subdir
|
||||||
"sS" 'my/dired-open-this-subdir
|
"sk" 'dired-prev-subdir
|
||||||
"sQ" 'my/dired-kill-all-subdirs
|
"sj" 'dired-next-subdir
|
||||||
(kbd "TAB") 'dired-hide-subdir))
|
"sS" 'my/dired-open-this-subdir
|
||||||
|
"sQ" 'my/dired-kill-all-subdirs
|
||||||
|
(kbd "TAB") 'dired-hide-subdir))
|
||||||
|
|
||||||
(setq tramp-verbose 1)
|
(setq tramp-verbose 1)
|
||||||
|
|
||||||
|
|
@ -1043,6 +1050,9 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
|
||||||
(setq-local global-display-line-numbers-mode nil)
|
(setq-local global-display-line-numbers-mode nil)
|
||||||
(display-line-numbers-mode 0)))
|
(display-line-numbers-mode 0)))
|
||||||
|
|
||||||
|
(advice-add 'evil-collection-vterm-insert
|
||||||
|
:before #'vterm-reset-cursor-point)
|
||||||
|
|
||||||
(general-define-key
|
(general-define-key
|
||||||
:keymaps 'vterm-mode-map
|
:keymaps 'vterm-mode-map
|
||||||
"M-q" 'vterm-send-escape
|
"M-q" 'vterm-send-escape
|
||||||
|
|
@ -1062,13 +1072,22 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
|
||||||
"M-<up>" 'vterm-send-up
|
"M-<up>" 'vterm-send-up
|
||||||
"M-<down>" 'vterm-send-down)
|
"M-<down>" 'vterm-send-down)
|
||||||
|
|
||||||
(general-imap
|
(general-define-key
|
||||||
:keymaps 'vterm-mode-map
|
:keymaps 'vterm-mode-map
|
||||||
"C-r" 'vterm-send-C-r
|
:states '(normal insert)
|
||||||
"C-k" 'vterm-send-C-k
|
"<home>" 'vterm-beginning-of-line
|
||||||
"C-j" 'vterm-send-C-j
|
"<end>" 'vterm-end-of-line)
|
||||||
"M-l" 'vterm-send-right
|
|
||||||
"M-h" 'vterm-send-left))
|
(general-define-key
|
||||||
|
:keymaps 'vterm-mode-map
|
||||||
|
:states '(insert)
|
||||||
|
"C-r" 'vterm-send-C-r
|
||||||
|
"C-k" 'vterm-send-C-k
|
||||||
|
"C-j" 'vterm-send-C-j
|
||||||
|
"M-l" 'vterm-send-right
|
||||||
|
"M-h" 'vterm-send-left
|
||||||
|
"M-k" 'vterm-send-up
|
||||||
|
"M-j" 'vterm-send-down))
|
||||||
|
|
||||||
(add-to-list 'display-buffer-alist
|
(add-to-list 'display-buffer-alist
|
||||||
`(,"vterm-subterminal.*"
|
`(,"vterm-subterminal.*"
|
||||||
|
|
@ -1131,11 +1150,13 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
|
||||||
|
|
||||||
(evil-define-key '(normal insert visual) eshell-mode-map (kbd "<home>") 'eshell-bol)
|
(evil-define-key '(normal insert visual) eshell-mode-map (kbd "<home>") 'eshell-bol)
|
||||||
(evil-define-key '(normal insert visual) eshell-mode-map (kbd "C-r") 'counsel-esh-history)
|
(evil-define-key '(normal insert visual) eshell-mode-map (kbd "C-r") 'counsel-esh-history)
|
||||||
(evil-collection-define-key 'normal 'eshell-mode-map
|
(general-define-key
|
||||||
(kbd "C-h") 'evil-window-left
|
:states '(normal)
|
||||||
(kbd "C-l") 'evil-window-right
|
:keymaps 'eshell-mode-map
|
||||||
(kbd "C-k") 'evil-window-up
|
(kbd "C-h") 'evil-window-left
|
||||||
(kbd "C-j") 'evil-window-down))
|
(kbd "C-l") 'evil-window-right
|
||||||
|
(kbd "C-k") 'evil-window-up
|
||||||
|
(kbd "C-j") 'evil-window-down))
|
||||||
|
|
||||||
(use-package eshell
|
(use-package eshell
|
||||||
:ensure nil
|
:ensure nil
|
||||||
|
|
@ -1196,6 +1217,9 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
|
||||||
(my-leader-def "ar" 'jupyter-run-repl))
|
(my-leader-def "ar" 'jupyter-run-repl))
|
||||||
(use-package ob-hy
|
(use-package ob-hy
|
||||||
:straight t)
|
:straight t)
|
||||||
|
(setq org-plantuml-executable-path "/home/pavel/.guix-extra-profiles/emacs/emacs/bin/plantuml")
|
||||||
|
(setq org-plantuml-exec-mode 'plantuml)
|
||||||
|
(add-to-list 'org-src-lang-modes '("plantuml" . plantuml))
|
||||||
(org-babel-do-load-languages
|
(org-babel-do-load-languages
|
||||||
'org-babel-load-languages
|
'org-babel-load-languages
|
||||||
'((emacs-lisp . t)
|
'((emacs-lisp . t)
|
||||||
|
|
@ -1204,6 +1228,7 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
|
||||||
;; (typescript .t)
|
;; (typescript .t)
|
||||||
(hy . t)
|
(hy . t)
|
||||||
(shell . t)
|
(shell . t)
|
||||||
|
(plantuml . t)
|
||||||
(octave . t)
|
(octave . t)
|
||||||
(jupyter . t)))
|
(jupyter . t)))
|
||||||
|
|
||||||
|
|
@ -2444,7 +2469,7 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
|
||||||
:straight t
|
:straight t
|
||||||
:mode "(\\.\\(plantuml?\\|uml\\|puml\\)\\'"
|
:mode "(\\.\\(plantuml?\\|uml\\|puml\\)\\'"
|
||||||
:config
|
:config
|
||||||
(setq plantuml-executable-path "/usr/bin/plantuml")
|
(setq plantuml-executable-path "/home/pavel/.guix-extra-profiles/emacs/emacs/bin/plantuml")
|
||||||
(setq plantuml-default-exec-mode 'executable)
|
(setq plantuml-default-exec-mode 'executable)
|
||||||
(add-to-list 'auto-mode-alist '("\\.plantuml\\'" . plantuml-mode))
|
(add-to-list 'auto-mode-alist '("\\.plantuml\\'" . plantuml-mode))
|
||||||
(add-to-list 'auto-mode-alist '("\\.uml\\'" . plantuml-mode))
|
(add-to-list 'auto-mode-alist '("\\.uml\\'" . plantuml-mode))
|
||||||
|
|
@ -2804,12 +2829,16 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
|
||||||
(lambda (fun &rest r)
|
(lambda (fun &rest r)
|
||||||
(let ((shr-use-fonts nil))
|
(let ((shr-use-fonts nil))
|
||||||
(apply fun r))))
|
(apply fun r))))
|
||||||
(evil-collection-define-key 'normal 'elfeed-search-mode-map
|
(general-define-key
|
||||||
"o" #'my/elfeed-search-filter-source
|
:states '(normal)
|
||||||
"c" #'elfeed-search-clear-filter
|
:keymaps 'elfeed-search-mode-map
|
||||||
"gl" (lambda () (interactive) (elfeed-search-set-filter "+later")))
|
"o" #'my/elfeed-search-filter-source
|
||||||
(evil-collection-define-key 'normal 'elfeed-show-mode-map
|
"c" #'elfeed-search-clear-filter
|
||||||
"ge" #'my/elfeed-show-visit-eww))
|
"gl" (lambda () (interactive) (elfeed-search-set-filter "+later")))
|
||||||
|
(general-define-key
|
||||||
|
:states '(normal)
|
||||||
|
:keymaps 'elfeed-show-mode-map
|
||||||
|
"ge" #'my/elfeed-show-visit-eww))
|
||||||
|
|
||||||
(use-package elfeed-org
|
(use-package elfeed-org
|
||||||
:straight t
|
:straight t
|
||||||
|
|
@ -2862,8 +2891,10 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
|
||||||
(emms-add-elfeed elfeed-show-entry))
|
(emms-add-elfeed elfeed-show-entry))
|
||||||
|
|
||||||
(with-eval-after-load 'elfeed
|
(with-eval-after-load 'elfeed
|
||||||
(evil-collection-define-key 'normal 'elfeed-show-mode-map
|
(general-define-key
|
||||||
"gm" #'my/elfeed-add-emms-youtube))
|
:states '(normal)
|
||||||
|
:keymaps 'elfeed-show-mode-map
|
||||||
|
"gm" #'my/elfeed-add-emms-youtube))
|
||||||
|
|
||||||
(use-package emms
|
(use-package emms
|
||||||
:straight t
|
:straight t
|
||||||
|
|
@ -2988,12 +3019,16 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
|
||||||
(my-leader-def "asc" #'my/emms-cleanup-urls)
|
(my-leader-def "asc" #'my/emms-cleanup-urls)
|
||||||
|
|
||||||
(with-eval-after-load 'emms-browser
|
(with-eval-after-load 'emms-browser
|
||||||
(evil-collection-define-key 'normal 'emms-browser-mode-map
|
(general-define-key
|
||||||
"q" 'quit-window))
|
:states '(normal)
|
||||||
|
:keymaps 'emms-browser-mode-map
|
||||||
|
"q" 'quit-window))
|
||||||
|
|
||||||
(with-eval-after-load 'emms
|
(with-eval-after-load 'emms
|
||||||
(evil-collection-define-key 'normal 'emms-playlist-mode-map
|
(general-define-key
|
||||||
"q" 'quit-window))
|
:states '(normal)
|
||||||
|
:keymaps 'emms-playlist-mode-map
|
||||||
|
"q" 'quit-window))
|
||||||
|
|
||||||
(defun my/toggle-shr-use-fonts ()
|
(defun my/toggle-shr-use-fonts ()
|
||||||
"Toggle the shr-use-fonts variable in buffer"
|
"Toggle the shr-use-fonts variable in buffer"
|
||||||
|
|
@ -3088,8 +3123,10 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
|
||||||
(setq Man-width-max 180)
|
(setq Man-width-max 180)
|
||||||
(my-leader-def "hM" 'man)
|
(my-leader-def "hM" 'man)
|
||||||
|
|
||||||
(evil-collection-define-key 'normal 'Info-mode-map
|
(general-define-key
|
||||||
(kbd "RET") 'Info-follow-nearest-node)
|
:states '(normal)
|
||||||
|
:keymaps 'Info-mode-map
|
||||||
|
(kbd "RET") 'Info-follow-nearest-node)
|
||||||
|
|
||||||
(defun my/man-fix-width (&rest _)
|
(defun my/man-fix-width (&rest _)
|
||||||
(setq-local Man-width (- (window-width) 4)))
|
(setq-local Man-width (- (window-width) 4)))
|
||||||
|
|
@ -3147,7 +3184,9 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
|
||||||
:config
|
:config
|
||||||
(when (not (boundp 'my/docker-directories))
|
(when (not (boundp 'my/docker-directories))
|
||||||
(load (concat user-emacs-directory "prodigy-config")))
|
(load (concat user-emacs-directory "prodigy-config")))
|
||||||
(evil-collection-define-key 'normal 'prodigy-view-mode-map
|
(general-define-key
|
||||||
|
:states '(normal)
|
||||||
|
:keymaps 'prodigy-view-mode-map
|
||||||
(kbd "C-h") 'evil-window-left
|
(kbd "C-h") 'evil-window-left
|
||||||
(kbd "C-l") 'evil-window-right
|
(kbd "C-l") 'evil-window-right
|
||||||
(kbd "C-k") 'evil-window-up
|
(kbd "C-k") 'evil-window-up
|
||||||
|
|
@ -3172,14 +3211,16 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
|
||||||
:config
|
:config
|
||||||
(setq pomidor-sound-tick nil)
|
(setq pomidor-sound-tick nil)
|
||||||
(setq pomidor-sound-tack nil)
|
(setq pomidor-sound-tack nil)
|
||||||
(evil-collection-define-key 'normal 'pomidor-mode-map
|
(general-define-key
|
||||||
(kbd "q") #'quit-window
|
:states '(normal)
|
||||||
(kbd "Q") #'pomidor-quit
|
:keymaps 'pomidor-mode-map
|
||||||
(kbd "R") #'pomidor-reset
|
(kbd "q") #'quit-window
|
||||||
(kbd "h") #'pomidor-hold
|
(kbd "Q") #'pomidor-quit
|
||||||
(kbd "H") #'pomidor-unhold
|
(kbd "R") #'pomidor-reset
|
||||||
(kbd "RET") #'pomidor-stop
|
(kbd "h") #'pomidor-hold
|
||||||
(kbd "M-RET") #'pomidor-break))
|
(kbd "H") #'pomidor-unhold
|
||||||
|
(kbd "RET") #'pomidor-stop
|
||||||
|
(kbd "M-RET") #'pomidor-break))
|
||||||
|
|
||||||
(setq calendar-date-style 'iso) ;; YYYY/mm/dd
|
(setq calendar-date-style 'iso) ;; YYYY/mm/dd
|
||||||
(setq calendar-week-start-day 1)
|
(setq calendar-week-start-day 1)
|
||||||
|
|
|
||||||
177
Emacs.org
177
Emacs.org
|
|
@ -645,13 +645,20 @@ Some keybindings I used in vim to switch buffers and can't let go of.
|
||||||
"C-j" 'evil-window-down
|
"C-j" 'evil-window-down
|
||||||
"C-x h" 'previous-buffer
|
"C-x h" 'previous-buffer
|
||||||
"C-x l" 'next-buffer)
|
"C-x l" 'next-buffer)
|
||||||
|
|
||||||
|
(general-define-key
|
||||||
|
:keymaps 'evil-window-map
|
||||||
|
"x" 'kill-buffer-and-window)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
And winner-mode to keep the history of window states.
|
And winner-mode to keep the history of window states.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(winner-mode 1)
|
(winner-mode 1)
|
||||||
(define-key evil-window-map (kbd "u") 'winner-undo)
|
|
||||||
(define-key evil-window-map (kbd "U") 'winner-redo)
|
(general-define-key
|
||||||
|
:keymaps 'evil-window-map
|
||||||
|
"u" 'winner-undo
|
||||||
|
"U" 'winner-redo)
|
||||||
#+end_src
|
#+end_src
|
||||||
*** Buffer management
|
*** Buffer management
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
|
|
@ -968,8 +975,9 @@ References:
|
||||||
"a" 'counsel-rg
|
"a" 'counsel-rg
|
||||||
"A" 'counsel-ag)
|
"A" 'counsel-ag)
|
||||||
|
|
||||||
(general-imap
|
(general-define-key
|
||||||
"C-y" 'counsel-yank-pop)
|
:states '(insert normal)
|
||||||
|
"C-y" 'counsel-yank-pop)
|
||||||
|
|
||||||
(my-leader-def "SPC" 'ivy-resume)
|
(my-leader-def "SPC" 'ivy-resume)
|
||||||
(my-leader-def "s" 'swiper-isearch
|
(my-leader-def "s" 'swiper-isearch
|
||||||
|
|
@ -1687,19 +1695,16 @@ My config mostly follows ranger's and vifm's keybindings which I'm used to.
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(setq truncate-lines t)
|
(setq truncate-lines t)
|
||||||
(visual-line-mode nil)))
|
(visual-line-mode nil)))
|
||||||
(evil-collection-define-key 'normal 'dired-mode-map
|
|
||||||
"h" 'dired-up-directory
|
|
||||||
"l" 'dired-find-file
|
|
||||||
"=" 'dired-narrow
|
|
||||||
"-" 'dired-create-empty-file
|
|
||||||
"~" 'vterm
|
|
||||||
(kbd "<left>") 'dired-up-directory
|
|
||||||
(kbd "<right>") 'dired-find-file)
|
|
||||||
(general-define-key
|
(general-define-key
|
||||||
|
:states '(normal)
|
||||||
:keymaps 'dired-mode-map
|
:keymaps 'dired-mode-map
|
||||||
;; [remap dired-find-file] 'dired-single-buffer
|
"h" 'dired-up-directory
|
||||||
;; [remap dired-mouse-find-file-other-window] 'dired-single-buffer-mouse
|
"l" 'dired-find-file
|
||||||
;; [remap dired-up-directory] 'dired-single-up-directory
|
"=" 'dired-narrow
|
||||||
|
"-" 'dired-create-empty-file
|
||||||
|
"~" 'vterm
|
||||||
|
"<left>" 'dired-up-directory
|
||||||
|
"<right>" 'dired-find-file
|
||||||
"M-<return>" 'dired-open-xdg))
|
"M-<return>" 'dired-open-xdg))
|
||||||
|
|
||||||
(defun my/dired-home ()
|
(defun my/dired-home ()
|
||||||
|
|
@ -1795,16 +1800,18 @@ I add my own keybindings and some extra functionality.
|
||||||
(dired dir)))
|
(dired dir)))
|
||||||
|
|
||||||
(with-eval-after-load 'dired
|
(with-eval-after-load 'dired
|
||||||
(evil-collection-define-key 'normal 'dired-mode-map
|
(general-define-key
|
||||||
"s" nil
|
:states '(normal)
|
||||||
"ss" 'dired-maybe-insert-subdir
|
:keymaps 'dired-mode-map
|
||||||
"sl" 'dired-maybe-insert-subdir
|
"s" nil
|
||||||
"sq" 'dired-kill-subdir
|
"ss" 'dired-maybe-insert-subdir
|
||||||
"sk" 'dired-prev-subdir
|
"sl" 'dired-maybe-insert-subdir
|
||||||
"sj" 'dired-next-subdir
|
"sq" 'dired-kill-subdir
|
||||||
"sS" 'my/dired-open-this-subdir
|
"sk" 'dired-prev-subdir
|
||||||
"sQ" 'my/dired-kill-all-subdirs
|
"sj" 'dired-next-subdir
|
||||||
(kbd "TAB") 'dired-hide-subdir))
|
"sS" 'my/dired-open-this-subdir
|
||||||
|
"sQ" 'my/dired-kill-all-subdirs
|
||||||
|
(kbd "TAB") 'dired-hide-subdir))
|
||||||
#+end_src
|
#+end_src
|
||||||
** TRAMP
|
** TRAMP
|
||||||
TRAMP is a package that provides remote editing capacities. It is particularly useful for remote server management.
|
TRAMP is a package that provides remote editing capacities. It is particularly useful for remote server management.
|
||||||
|
|
@ -1891,6 +1898,9 @@ I use the package from the Guix repository to avoid building libvterm.
|
||||||
(setq-local global-display-line-numbers-mode nil)
|
(setq-local global-display-line-numbers-mode nil)
|
||||||
(display-line-numbers-mode 0)))
|
(display-line-numbers-mode 0)))
|
||||||
|
|
||||||
|
(advice-add 'evil-collection-vterm-insert
|
||||||
|
:before #'vterm-reset-cursor-point)
|
||||||
|
|
||||||
(general-define-key
|
(general-define-key
|
||||||
:keymaps 'vterm-mode-map
|
:keymaps 'vterm-mode-map
|
||||||
"M-q" 'vterm-send-escape
|
"M-q" 'vterm-send-escape
|
||||||
|
|
@ -1910,13 +1920,22 @@ I use the package from the Guix repository to avoid building libvterm.
|
||||||
"M-<up>" 'vterm-send-up
|
"M-<up>" 'vterm-send-up
|
||||||
"M-<down>" 'vterm-send-down)
|
"M-<down>" 'vterm-send-down)
|
||||||
|
|
||||||
(general-imap
|
(general-define-key
|
||||||
:keymaps 'vterm-mode-map
|
:keymaps 'vterm-mode-map
|
||||||
"C-r" 'vterm-send-C-r
|
:states '(normal insert)
|
||||||
"C-k" 'vterm-send-C-k
|
"<home>" 'vterm-beginning-of-line
|
||||||
"C-j" 'vterm-send-C-j
|
"<end>" 'vterm-end-of-line)
|
||||||
"M-l" 'vterm-send-right
|
|
||||||
"M-h" 'vterm-send-left))
|
(general-define-key
|
||||||
|
:keymaps 'vterm-mode-map
|
||||||
|
:states '(insert)
|
||||||
|
"C-r" 'vterm-send-C-r
|
||||||
|
"C-k" 'vterm-send-C-k
|
||||||
|
"C-j" 'vterm-send-C-j
|
||||||
|
"M-l" 'vterm-send-right
|
||||||
|
"M-h" 'vterm-send-left
|
||||||
|
"M-k" 'vterm-send-up
|
||||||
|
"M-j" 'vterm-send-down))
|
||||||
#+end_src
|
#+end_src
|
||||||
*** Subterminal
|
*** Subterminal
|
||||||
Open a terminal in the lower third of the frame with the =`= key.
|
Open a terminal in the lower third of the frame with the =`= key.
|
||||||
|
|
@ -1998,11 +2017,13 @@ A shell written in Emacs lisp. I don't use it as of now, but keep the config jus
|
||||||
|
|
||||||
(evil-define-key '(normal insert visual) eshell-mode-map (kbd "<home>") 'eshell-bol)
|
(evil-define-key '(normal insert visual) eshell-mode-map (kbd "<home>") 'eshell-bol)
|
||||||
(evil-define-key '(normal insert visual) eshell-mode-map (kbd "C-r") 'counsel-esh-history)
|
(evil-define-key '(normal insert visual) eshell-mode-map (kbd "C-r") 'counsel-esh-history)
|
||||||
(evil-collection-define-key 'normal 'eshell-mode-map
|
(general-define-key
|
||||||
(kbd "C-h") 'evil-window-left
|
:states '(normal)
|
||||||
(kbd "C-l") 'evil-window-right
|
:keymaps 'eshell-mode-map
|
||||||
(kbd "C-k") 'evil-window-up
|
(kbd "C-h") 'evil-window-left
|
||||||
(kbd "C-j") 'evil-window-down))
|
(kbd "C-l") 'evil-window-right
|
||||||
|
(kbd "C-k") 'evil-window-up
|
||||||
|
(kbd "C-j") 'evil-window-down))
|
||||||
|
|
||||||
(use-package eshell
|
(use-package eshell
|
||||||
:ensure nil
|
:ensure nil
|
||||||
|
|
@ -2172,6 +2193,12 @@ Open HTML in the ~begin_export~ block with xdg-open.
|
||||||
(f-write (plist-get (car (cdr elem)) :value) 'utf-8 temp-file-path)
|
(f-write (plist-get (car (cdr elem)) :value) 'utf-8 temp-file-path)
|
||||||
(start-process "org-html-preview" nil "xdg-open" temp-file-path))))))
|
(start-process "org-html-preview" nil "xdg-open" temp-file-path))))))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
*** PlantUML
|
||||||
|
#+begin_src emacs-lisp :tangle no :noweb-ref org-lang-setup
|
||||||
|
(setq org-plantuml-executable-path "/home/pavel/.guix-extra-profiles/emacs/emacs/bin/plantuml")
|
||||||
|
(setq org-plantuml-exec-mode 'plantuml)
|
||||||
|
(add-to-list 'org-src-lang-modes '("plantuml" . plantuml))
|
||||||
|
#+end_src
|
||||||
*** Setup
|
*** Setup
|
||||||
Enable languages
|
Enable languages
|
||||||
#+begin_src emacs-lisp :tangle no :noweb-ref org-lang-setup
|
#+begin_src emacs-lisp :tangle no :noweb-ref org-lang-setup
|
||||||
|
|
@ -2183,6 +2210,7 @@ Enable languages
|
||||||
;; (typescript .t)
|
;; (typescript .t)
|
||||||
(hy . t)
|
(hy . t)
|
||||||
(shell . t)
|
(shell . t)
|
||||||
|
(plantuml . t)
|
||||||
(octave . t)
|
(octave . t)
|
||||||
(jupyter . t)))
|
(jupyter . t)))
|
||||||
|
|
||||||
|
|
@ -2699,6 +2727,7 @@ Categories are broad labels to group agenda items.
|
||||||
Add a custom LaTeX template without default packages. Packages are indented to be imported with function from [[Import *.sty]].
|
Add a custom LaTeX template without default packages. Packages are indented to be imported with function from [[Import *.sty]].
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(defun my/setup-org-latex ()
|
(defun my/setup-org-latex ()
|
||||||
|
(setq org-latex-prefer-user-labels t)
|
||||||
(setq org-latex-compiler "xelatex") ;; Probably not necessary
|
(setq org-latex-compiler "xelatex") ;; Probably not necessary
|
||||||
(setq org-latex-pdf-process '("latexmk -outdir=%o %f")) ;; Use latexmk
|
(setq org-latex-pdf-process '("latexmk -outdir=%o %f")) ;; Use latexmk
|
||||||
(setq org-latex-listings 'minted) ;; Use minted to highlight source code
|
(setq org-latex-listings 'minted) ;; Use minted to highlight source code
|
||||||
|
|
@ -3712,13 +3741,22 @@ Section snippets. The code turned out to be more complicated than just writing t
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
*** PlantUML
|
*** PlantUML
|
||||||
|
| Guix dependency |
|
||||||
|
|-----------------|
|
||||||
|
| plantuml |
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package plantuml-mode
|
(use-package plantuml-mode
|
||||||
:straight t
|
:straight t
|
||||||
:mode "(\\.\\(plantuml?\\|uml\\|puml\\)\\'"
|
:mode "(\\.\\(plantuml?\\|uml\\|puml\\)\\'"
|
||||||
:config
|
:config
|
||||||
(setq plantuml-executable-path "/usr/bin/plantuml")
|
(setq plantuml-executable-path "/home/pavel/.guix-extra-profiles/emacs/emacs/bin/plantuml")
|
||||||
(setq plantuml-default-exec-mode 'executable)
|
(setq plantuml-default-exec-mode 'executable)
|
||||||
|
(setq plantuml-indent-level 2)
|
||||||
|
(setq my/plantuml-indent-regexp-return "^\s*return\s+.+$")
|
||||||
|
(add-to-list
|
||||||
|
'plantuml-indent-regexp-end
|
||||||
|
my/plantuml-indent-regexp-return)
|
||||||
(add-to-list 'auto-mode-alist '("\\.plantuml\\'" . plantuml-mode))
|
(add-to-list 'auto-mode-alist '("\\.plantuml\\'" . plantuml-mode))
|
||||||
(add-to-list 'auto-mode-alist '("\\.uml\\'" . plantuml-mode))
|
(add-to-list 'auto-mode-alist '("\\.uml\\'" . plantuml-mode))
|
||||||
(add-hook 'plantuml-mode-hook #'smartparens-mode))
|
(add-hook 'plantuml-mode-hook #'smartparens-mode))
|
||||||
|
|
@ -3726,7 +3764,6 @@ Section snippets. The code turned out to be more complicated than just writing t
|
||||||
(general-nmap
|
(general-nmap
|
||||||
:keymaps 'plantuml-mode-map
|
:keymaps 'plantuml-mode-map
|
||||||
"RET" 'plantuml-preview)
|
"RET" 'plantuml-preview)
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
*** LanguageTool
|
*** LanguageTool
|
||||||
LanguageTool is a great offline spell checker. For some reason, the download link is nowhere to be found on the home page, so it is listed in the references as well.
|
LanguageTool is a great offline spell checker. For some reason, the download link is nowhere to be found on the home page, so it is listed in the references as well.
|
||||||
|
|
@ -4253,12 +4290,16 @@ Using my own fork until the modifications are merged into master.
|
||||||
(lambda (fun &rest r)
|
(lambda (fun &rest r)
|
||||||
(let ((shr-use-fonts nil))
|
(let ((shr-use-fonts nil))
|
||||||
(apply fun r))))
|
(apply fun r))))
|
||||||
(evil-collection-define-key 'normal 'elfeed-search-mode-map
|
(general-define-key
|
||||||
"o" #'my/elfeed-search-filter-source
|
:states '(normal)
|
||||||
"c" #'elfeed-search-clear-filter
|
:keymaps 'elfeed-search-mode-map
|
||||||
"gl" (lambda () (interactive) (elfeed-search-set-filter "+later")))
|
"o" #'my/elfeed-search-filter-source
|
||||||
(evil-collection-define-key 'normal 'elfeed-show-mode-map
|
"c" #'elfeed-search-clear-filter
|
||||||
"ge" #'my/elfeed-show-visit-eww))
|
"gl" (lambda () (interactive) (elfeed-search-set-filter "+later")))
|
||||||
|
(general-define-key
|
||||||
|
:states '(normal)
|
||||||
|
:keymaps 'elfeed-show-mode-map
|
||||||
|
"ge" #'my/elfeed-show-visit-eww))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
[[https://github.com/remyhonig/elfeed-org][elfeed-org]] allows configuring Elfeed feeds with an Org file.
|
[[https://github.com/remyhonig/elfeed-org][elfeed-org]] allows configuring Elfeed feeds with an Org file.
|
||||||
|
|
@ -4329,8 +4370,10 @@ Now, a function to add YouTube link with metadata from elfeed to EMMS.
|
||||||
(emms-add-elfeed elfeed-show-entry))
|
(emms-add-elfeed elfeed-show-entry))
|
||||||
|
|
||||||
(with-eval-after-load 'elfeed
|
(with-eval-after-load 'elfeed
|
||||||
(evil-collection-define-key 'normal 'elfeed-show-mode-map
|
(general-define-key
|
||||||
"gm" #'my/elfeed-add-emms-youtube))
|
:states '(normal)
|
||||||
|
:keymaps 'elfeed-show-mode-map
|
||||||
|
"gm" #'my/elfeed-add-emms-youtube))
|
||||||
#+end_src
|
#+end_src
|
||||||
*** EMMS
|
*** EMMS
|
||||||
EMMS is the Emacs Multi-Media System. I control MPD from Emacs with its help.
|
EMMS is the Emacs Multi-Media System. I control MPD from Emacs with its help.
|
||||||
|
|
@ -4478,12 +4521,16 @@ Now, all these URLs reside in EMMS cache after being played. I don't want them t
|
||||||
**** Some keybindings
|
**** Some keybindings
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(with-eval-after-load 'emms-browser
|
(with-eval-after-load 'emms-browser
|
||||||
(evil-collection-define-key 'normal 'emms-browser-mode-map
|
(general-define-key
|
||||||
"q" 'quit-window))
|
:states '(normal)
|
||||||
|
:keymaps 'emms-browser-mode-map
|
||||||
|
"q" 'quit-window))
|
||||||
|
|
||||||
(with-eval-after-load 'emms
|
(with-eval-after-load 'emms
|
||||||
(evil-collection-define-key 'normal 'emms-playlist-mode-map
|
(general-define-key
|
||||||
"q" 'quit-window))
|
:states '(normal)
|
||||||
|
:keymaps 'emms-playlist-mode-map
|
||||||
|
"q" 'quit-window))
|
||||||
#+end_src
|
#+end_src
|
||||||
**** EMMS & mpd Fixes
|
**** EMMS & mpd Fixes
|
||||||
Some fixes until I submit a patch.
|
Some fixes until I submit a patch.
|
||||||
|
|
@ -4693,8 +4740,10 @@ Of course, Emacs can also display man and info pages.
|
||||||
(setq Man-width-max 180)
|
(setq Man-width-max 180)
|
||||||
(my-leader-def "hM" 'man)
|
(my-leader-def "hM" 'man)
|
||||||
|
|
||||||
(evil-collection-define-key 'normal 'Info-mode-map
|
(general-define-key
|
||||||
(kbd "RET") 'Info-follow-nearest-node)
|
:states '(normal)
|
||||||
|
:keymaps 'Info-mode-map
|
||||||
|
(kbd "RET") 'Info-follow-nearest-node)
|
||||||
|
|
||||||
(defun my/man-fix-width (&rest _)
|
(defun my/man-fix-width (&rest _)
|
||||||
(setq-local Man-width (- (window-width) 4)))
|
(setq-local Man-width (- (window-width) 4)))
|
||||||
|
|
@ -4779,7 +4828,9 @@ The actual service definitions are in the =~/.emacs.d/prodigy.org=, which tangle
|
||||||
:config
|
:config
|
||||||
(when (not (boundp 'my/docker-directories))
|
(when (not (boundp 'my/docker-directories))
|
||||||
(load (concat user-emacs-directory "prodigy-config")))
|
(load (concat user-emacs-directory "prodigy-config")))
|
||||||
(evil-collection-define-key 'normal 'prodigy-view-mode-map
|
(general-define-key
|
||||||
|
:states '(normal)
|
||||||
|
:keymaps 'prodigy-view-mode-map
|
||||||
(kbd "C-h") 'evil-window-left
|
(kbd "C-h") 'evil-window-left
|
||||||
(kbd "C-l") 'evil-window-right
|
(kbd "C-l") 'evil-window-right
|
||||||
(kbd "C-k") 'evil-window-up
|
(kbd "C-k") 'evil-window-up
|
||||||
|
|
@ -4817,14 +4868,16 @@ A simple pomodoro technique timer.
|
||||||
:config
|
:config
|
||||||
(setq pomidor-sound-tick nil)
|
(setq pomidor-sound-tick nil)
|
||||||
(setq pomidor-sound-tack nil)
|
(setq pomidor-sound-tack nil)
|
||||||
(evil-collection-define-key 'normal 'pomidor-mode-map
|
(general-define-key
|
||||||
(kbd "q") #'quit-window
|
:states '(normal)
|
||||||
(kbd "Q") #'pomidor-quit
|
:keymaps 'pomidor-mode-map
|
||||||
(kbd "R") #'pomidor-reset
|
(kbd "q") #'quit-window
|
||||||
(kbd "h") #'pomidor-hold
|
(kbd "Q") #'pomidor-quit
|
||||||
(kbd "H") #'pomidor-unhold
|
(kbd "R") #'pomidor-reset
|
||||||
(kbd "RET") #'pomidor-stop
|
(kbd "h") #'pomidor-hold
|
||||||
(kbd "M-RET") #'pomidor-break))
|
(kbd "H") #'pomidor-unhold
|
||||||
|
(kbd "RET") #'pomidor-stop
|
||||||
|
(kbd "M-RET") #'pomidor-break))
|
||||||
#+end_src
|
#+end_src
|
||||||
*** Calendar
|
*** Calendar
|
||||||
Emacs' built-in calendar. Can even calculate sunrise and sunset times.
|
Emacs' built-in calendar. Can even calculate sunrise and sunset times.
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue