emacs: clean doom config

greenclip now is supported nicely inside `exwm`
This commit is contained in:
FollieHiyuki 2021-03-01 22:48:10 +03:00
parent 72ca87a115
commit 9e16310d4e
No known key found for this signature in database
GPG Key ID: 813CF484F4993419
5 changed files with 65 additions and 39 deletions

View File

@ -83,6 +83,11 @@
projectile-auto-discover nil)) projectile-auto-discover nil))
;; Ivy / Counsel ;; Ivy / Counsel
(after! counsel
(setq counsel-linux-app-format-function #'counsel-linux-app-format-function-name-only))
(map! "C-M-j" 'counsel-switch-buffer)
(map! :map minibuffer-local-map
"C-r" 'counsel-minibuffer-history)
(use-package! all-the-icons-ivy-rich (use-package! all-the-icons-ivy-rich
:after counsel-projectile :after counsel-projectile
:init (all-the-icons-ivy-rich-mode 1) :init (all-the-icons-ivy-rich-mode 1)
@ -90,11 +95,6 @@
(setq all-the-icons-ivy-rich-icon-size 1.0)) (setq all-the-icons-ivy-rich-icon-size 1.0))
(use-package! ivy-rich (use-package! ivy-rich
:after all-the-icons-ivy-rich) :after all-the-icons-ivy-rich)
(after! counsel
(setq counsel-linux-app-format-function #'counsel-linux-app-format-function-name-only))
(map! "C-M-j" 'counsel-switch-buffer)
(map! :map minibuffer-local-map
"C-r" 'counsel-minibuffer-history)
;; Completion + lsp ;; Completion + lsp
(after! company (after! company
@ -114,46 +114,51 @@
(after! which-key (after! which-key
(setq which-key-idle-delay 0.5)) (setq which-key-idle-delay 0.5))
;; Org mode ;; Org
(setq org-directory "~/Documents/Org/" (setq org-directory "~/Documents/Org/"
org-journal-dir "~/Documents/Org/journal/" org-default-notes-file "~/Documents/Org/notes.org"
org-agenda-files '("~/Documents/Org/agenda.org") org-agenda-files '("~/Documents/Org/agenda/agenda.org" "~/Documents/Org/agenda/archive.org")
org-noter-notes-search-path '("~/Documents/Org/notes/") org-confirm-babel-evaluate nil
org-default-notes-file (expand-file-name "notes.org" org-directory)
org-ellipsis "" org-ellipsis ""
org-hide-emphasis-markers t) org-hide-emphasis-markers t)
(defun follie/comfy-org-editing () (defun follie/comfy-org-editing ()
(setq visual-fill-column-width 160 (setq visual-fill-column-width 120
visual-fill-column-center-text t) visual-fill-column-center-text t)
(visual-fill-column-mode 1) (visual-fill-column-mode 1)
;;(org-superstar-mode 1)
(display-line-numbers-mode -1)) (display-line-numbers-mode -1))
(add-hook 'org-mode-hook 'follie/comfy-org-editing) (add-hook 'org-mode-hook 'follie/comfy-org-editing)
(defun follie/org-toggle-emphasis-markers ()
"Toggle emphasis markers in an Org buffer"
(interactive)
(if org-hide-emphasis-markers
(setq org-hide-emphasis-markers nil)
(setq org-hide-emphasis-markers t))
(org-mode-restart))
(map! :map org-mode-map
:localleader :desc "org-toggle-emphasis-markers"
"z" #'follie/org-toggle-emphasis-markers)
;; Org-tree-slide
(use-package! org-tree-slide (use-package! org-tree-slide
:commands org-tree-slide-mode :commands org-tree-slide-mode
:config :config
;;(org-tree-slide-presentation-profile)
(advice-remove 'org-tree-slide--display-tree-with-narrow #'+org-present--narrow-to-subtree-a) (advice-remove 'org-tree-slide--display-tree-with-narrow #'+org-present--narrow-to-subtree-a)
(setq +org-present-text-scale 2 (setq +org-present-text-scale 2
org-tree-slide-skip-outline-level 0 org-tree-slide-skip-outline-level 0
org-tree-slide-modeline-display nil org-tree-slide-modeline-display nil
org-tree-slide-header t org-tree-slide-header nil
org-tree-slide-slide-in-effect t org-tree-slide-slide-in-effect t
org-tree-slide-breadcrumbs ""
org-tree-slide-activate-message "Presentation starto..." org-tree-slide-activate-message "Presentation starto..."
org-tree-slide-deactivate-message "Thanks for listening!")) org-tree-slide-deactivate-message "Thanks for listening!"))
;; Org-noter
(setq org-noter-notes-search-path '("~/Documents/Org/noter/"))
;; Org-journal
(setq org-journal-dir "~/Documents/Org/journal/")
;; Spell checker ;; Spell checker
(after! flyspell (after! flyspell
(setq flyspell-lazy-idle-seconds 2)) (setq flyspell-lazy-idle-seconds 2))
;; Asynchronous bytecode compilation
(use-package! async
:defer t
:init
(dired-async-mode 1)
(async-bytecomp-package-mode 1)
:custom (async-bytecomp-allowed-packages '(all)))
;; Magit ;; Magit
(after! magit (after! magit
(setq magit-diff-refine-hunk 'all)) (setq magit-diff-refine-hunk 'all))

View File

@ -147,7 +147,8 @@
(exwm-workspace-switch-create ,i)))) (exwm-workspace-switch-create ,i))))
(number-sequence 0 9)))) (number-sequence 0 9))))
;; Additional bindings for convenience ;; Additional bindings for convenience
(exwm-input-set-key (kbd "s-s") 'eshell) (exwm-input-set-key (kbd "s-s") '+eshell/toggle)
(exwm-input-set-key (kbd "s-v") '+vterm/here)
(exwm-input-set-key (kbd "s-SPC") 'counsel-linux-app) (exwm-input-set-key (kbd "s-SPC") 'counsel-linux-app)
(exwm-input-set-key (kbd "s-t") 'exwm-floating-toggle-floating) (exwm-input-set-key (kbd "s-t") 'exwm-floating-toggle-floating)
(exwm-input-set-key (kbd "s-f") 'exwm-layout-toggle-fullscreen) (exwm-input-set-key (kbd "s-f") 'exwm-layout-toggle-fullscreen)
@ -205,6 +206,7 @@
;; EMMS ;; EMMS
;; (use-package! emms ;; (use-package! emms
;; :after exwm
;; :init ;; :init
;; (setq emms-seek-seconds 10) ;; (setq emms-seek-seconds 10)
;; :config ;; :config
@ -302,23 +304,43 @@
;; Control dunst ;; Control dunst
(defun close-desktop-notifications () (defun close-desktop-notifications ()
"Close all current notifications"
(interactive) (interactive)
(start-process-shell-command "dunstctl" nil "dunstctl close-all")) (start-process-shell-command "dunstctl" nil "dunstctl close-all"))
(defun toggle-desktop-notifications () (defun toggle-desktop-notifications ()
"Toggle desktop notification on/off"
(interactive) (interactive)
(start-process-shell-command "dunstctl" nil "dunstctl set-paused toggle")) (start-process-shell-command "dunstctl" nil "dunstctl set-paused toggle"))
;; Clipboard managing with greenclip ;; Clipboard management
(defun greenclip--select-item (str)
"Copy selected item to clipboard"
(setq str (replace-regexp-in-string "\u00a0" "\n" str))
;; (kill-new str)
(condition-case nil
(cond
((fboundp 'ns-set-pasteboard)
(ns-set-pasteboard str))
((fboundp 'gui-set-selection)
(gui-set-selection 'CLIPBOARD str))
(t
(error "No clipboard support")))
(error
(with-temp-buffer
(insert str)
(if (file-executable-p "xsel")
(call-process-region (point-min) (point-max) "xsel" nil nil nil "--clipboard" "--input")
(call-process-region (point-min) (point-max) "xclip" nil nil nil "-selection clipboard" "--input"))))))
(defun ivy-greenclip () (defun ivy-greenclip ()
"Select an item from clipboard history and re-copy it" "Select an item from X clipboard history"
(interactive) (interactive)
(let* ((history (split-string (shell-command-to-string "greenclip print") "[\r\n]+"))) (let* ((history (split-string (shell-command-to-string "greenclip print") "[\r\n]+")))
(ivy-read "Copy item from entry: " (ivy-read "Clipboard item: "
history history
:action (lambda (item) :action (lambda (str)
;; Kind of work, though fish-shell is not happy (greenclip--select-item str)))))
(shell-command (concat "greenclip print '" item "'")))))) (defun greenclip-clear-history ()
(defun greenclip-clean () "Clear clipboard history cache"
"Clean clipboard history cache"
(interactive) (interactive)
(start-process-shell-command "greenclip" nil "pkill greenclip && greenclip clear && greenclip daemon")) (start-process-shell-command "greenclip" nil "pkill greenclip && greenclip clear")
(follie/run-in-background "greenclip daemon"))

View File

@ -21,13 +21,13 @@
:completion :completion
(company ; the ultimate code completion backend (company ; the ultimate code completion backend
+childframe) +childframe)
;;helm ; the *other* search engine for love and life ;;helm ; the *other* search engine for love and life
;;ido ; the other *other* search engine... ;;ido ; the other *other* search engine...
(ivy ; a search engine for love and life (ivy ; a search engine for love and life
+fuzzy +fuzzy
;;+prescient ;;+prescient
+icons) +icons)
:ui :ui
;;deft ; notational velocity for Emacs ;;deft ; notational velocity for Emacs

View File

@ -63,10 +63,8 @@
;;(package! ivy-emms) ;;(package! ivy-emms)
;;(package! edwina) ;;(package! edwina)
;; Additional modes
(package! vimrc-mode)
;; Improvements ;; Improvements
(package! vimrc-mode)
(package! magit-delta) (package! magit-delta)
(package! all-the-icons-ivy-rich) (package! all-the-icons-ivy-rich)
(package! nerd-fonts (package! nerd-fonts

View File

@ -9,6 +9,7 @@ set -g fish_cursor_default block
set -g fish_cursor_insert line set -g fish_cursor_insert line
set -g fish_cursor_replace_one underscore set -g fish_cursor_replace_one underscore
set -g fish_cursor_visual block set -g fish_cursor_visual block
set -g fish_vi_force_cursor
# no greeting # no greeting
set -g fish_greeting set -g fish_greeting