[Spacemacs, index] Whitespace

This commit is contained in:
Lucien Cartier-Tilet 2021-04-26 16:48:23 +02:00
parent dd22ca398c
commit 5144dcb279
Signed by: phundrak
GPG Key ID: BD7789E705CB8DCA
2 changed files with 188 additions and 190 deletions

View File

@ -4,7 +4,7 @@
;; Maintainer: Lucien Cartier-Tilet
;; Version: 0.1.0
;; Package-Requires: ((emacs "27.1"))
;; Homepage: https://labs.phundrak.com/emacs
;; Homepage: https://labs.phundrak.com/phundrak/dotfiles
;; This file is not part of GNU Emacs
@ -34,7 +34,7 @@
user-login-name "phundrak"
user-mail-address "lucien@phundrak.com")
(setq epa-pinentry-mode 'loopback)
(setq indent-tabs-mode nil)
(defvar phundrak/default-font-size 90
"Default font size.")
@ -50,7 +50,7 @@
;; Display battery in modeline when using a laptop
(unless (equal "Battery status not available"
(battery))
(battery))
(display-battery-mode 1))
(set-face-attribute 'default nil :font "Cascadia Code" :height phundrak/default-font-size)
@ -58,11 +58,11 @@
(setq frame-title-format
'(""
"%b"
(:eval
(let ((project-name (projectile-project-name)))
(unless (string= "-" project-name)
(format (if (buffer-modified-p) " ◉ %s" "  ●  %s") project-name))))))
"%b"
(:eval
(let ((project-name (projectile-project-name)))
(unless (string= "-" project-name)
(format (if (buffer-modified-p) " ◉ %s" "  ●  %s") project-name))))))
;; Make ESC quit prompts
(global-set-key (kbd "<escape>") 'keyboard-escape-quit)
@ -74,13 +74,13 @@
(global-display-line-numbers-mode t)
;; Disable line numbers for some modes
(dolist (mode '(org-mode-hook
term-mode-hook
shell-mode-hook
eshell-mode-hook
vterm-mode-hook
special-mode-hook
helpful-mode-hook
woman-mode-hook))
term-mode-hook
shell-mode-hook
eshell-mode-hook
vterm-mode-hook
special-mode-hook
helpful-mode-hook
woman-mode-hook))
(add-hook mode (lambda () (display-line-numbers-mode 0))))
(setq x-stretch-cursor t ; stretch cursor to the glyphs width
@ -115,8 +115,8 @@ the user."
;; Initialize package sources
;; (require 'package)
(setq package-archives '(("melpa" . "https://melpa.org/packages/")
("org" . "https://orgmode.org/elpa/")
("elpa" . "https://elpa.gnu.org/packages/")))
("org" . "https://orgmode.org/elpa/")
("elpa" . "https://elpa.gnu.org/packages/")))
(defvar bootstrap-version)
(let ((bootstrap-file
@ -147,11 +147,11 @@ the user."
:defer t
:after bind-map
:straight (spaceleader :type git
:host github
:repo "mohkale/spaceleader")
:host github
:repo "mohkale/spaceleader")
:config
(setq leader-key "SPC"
leader-major-mode-prefix ","))
leader-major-mode-prefix ","))
(use-package evil
:straight (:build t)
@ -238,30 +238,30 @@ the user."
:defer t
:diminish
:bind (("C-s" . swiper)
:map ivy-minibuffer-map
("TAB" . ivy-alt-done)
("C-l" . ivy-alt-done)
("C-t" . ivy-next-line)
("C-s" . ivy-previous-line)
:map ivy-switch-buffer-map
("C-t" . ivy-next-line)
("C-s" . ivy-previous-line)
("C-l" . ivy-done)
("C-d" . ivy-switch-buffer-kill)
:map ivy-reverse-i-search-map
("C-t" . ivy-next-line)
("C-s" . ivy-previous-line)
("C-d" . ivy-reverse-i-search-kill))
:map ivy-minibuffer-map
("TAB" . ivy-alt-done)
("C-l" . ivy-alt-done)
("C-t" . ivy-next-line)
("C-s" . ivy-previous-line)
:map ivy-switch-buffer-map
("C-t" . ivy-next-line)
("C-s" . ivy-previous-line)
("C-l" . ivy-done)
("C-d" . ivy-switch-buffer-kill)
:map ivy-reverse-i-search-map
("C-t" . ivy-next-line)
("C-s" . ivy-previous-line)
("C-d" . ivy-reverse-i-search-kill))
:config
(ivy-mode 1)
(setq ivy-wrap t
ivy-height 17
ivy-fixed-height-minibuffer t
ivy-read-action-functions #'ivy-hydra-read-action
ivy-read-action-format-function #'ivy-read-action-format-columns
projectile-completion-system 'ivy
ivy-on-del-error-function #'ignore
ivy-use-selectable-prompt t))
ivy-height 17
ivy-fixed-height-minibuffer t
ivy-read-action-functions #'ivy-hydra-read-action
ivy-read-action-format-function #'ivy-read-action-format-columns
projectile-completion-system 'ivy
ivy-on-del-error-function #'ignore
ivy-use-selectable-prompt t))
(use-package ivy-prescient
:defer t
@ -275,14 +275,14 @@ the user."
(use-package ivy-posframe
:hook (ivy-mode . ivy-posframe-mode)
:straight (ivy-posframe :type git
:host github
:repo "tumashu/ivy-posframe")
:host github
:repo "tumashu/ivy-posframe")
:config
(setq ivy-fixed-height-minibuffer nil
ivy-posframe-border-width 10
ivy-posframe-parameters
`((min-width . 90)
(min-height . ,ivy-height))))
ivy-posframe-border-width 10
ivy-posframe-parameters
`((min-width . 90)
(min-height . ,ivy-height))))
(use-package ivy-rich
:straight (:build t)
@ -296,37 +296,38 @@ the user."
:straight (:build t)
:defer t
:hook (company-mode . evil-normalize-keymaps)
:init
:init (global-company-mode)
:config
(setq company-minimum-prefix-length 2
company-toolsip-limit 14
company-tooltip-align-annotations t
company-require-match 'never
company-global-modes '(not erc-mode message-mode help-mode gud-mode)
company-frontends
'(company-pseudo-tooltip-frontend ; always show candidates in overlay tooltip
company-echo-metadata-frontend) ; show selected candidate docs in echo area
company-toolsip-limit 14
company-tooltip-align-annotations t
company-require-match 'never
company-global-modes '(not erc-mode message-mode help-mode gud-mode)
company-frontends
'(company-pseudo-tooltip-frontend ; always show candidates in overlay tooltip
company-echo-metadata-frontend) ; show selected candidate docs in echo area
;; Buffer-local backends will be computed when loading a major
;; mode, so only specify a global default here.
company-backends '(company-capf)
;; Buffer-local backends will be computed when loading a major
;; mode, so only specify a global default here.
company-backends '(company-capf)
;; These auto-complete the current selection when
;; `company-auto-complete-chars' is typed. This is too
;; magical. We already have the much more explicit RET and
;; TAB.
company-auto-complete nil
company-auto-complete-chars nil
;; These auto-complete the current selection when
;; `company-auto-complete-chars' is typed. This is too
;; magical. We already have the much more explicit RET and
;; TAB.
company-auto-complete nil
company-auto-complete-chars nil
;; Only search the current buffer for `company-dabbrev' (a
;; backend that suggests text you open buffers). This prevents
;; Company from causing lag once you have a lot of buffers
;; open.
company-dabbrev-other-buffers nil
;; Only search the current buffer for `company-dabbrev' (a
;; backend that suggests text you open buffers). This prevents
;; Company from causing lag once you have a lot of buffers
;; open.
company-dabbrev-other-buffers nil
;; Make `company-dabbrev' fully case-sensitive, to improve UX
;; with domai-specific words with particular casing.
company-dabbrev-ignore-case nil
company-dabbrev-downcase nil))
;; Make `company-dabbrev' fully case-sensitive, to improve UX
;; with domai-specific words with particular casing.
company-dabbrev-ignore-case nil
company-dabbrev-downcase nil))
(use-package company-dict
:defer t
@ -339,11 +340,11 @@ the user."
:defer t
:config
(setq company-box-show-single-candidate t
company-box-backends-colors nil
company-box-max-candidates 50
company-box-icons-alist 'company-box-icons-all-the-icons
company-box-icons-all-the-icons
(let ((all-the-icons-scale-factor 0.8))
company-box-backends-colors nil
company-box-max-candidates 50
company-box-icons-alist 'company-box-icons-all-the-icons
company-box-icons-all-the-icons
(let ((all-the-icons-scale-factor 0.8))
`((Unknown . ,(all-the-icons-material "find_in_page" :face 'all-the-icons-purple))
(Text . ,(all-the-icons-material "text_fields" :face 'all-the-icons-green))
(Method . ,(all-the-icons-material "functions" :face 'all-the-icons-red))
@ -386,9 +387,9 @@ the user."
:after company
:init
(eldoc-add-command 'company-complete-selection
'company-complete-common
'company-capf
'company-abort))
'company-complete-common
'company-capf
'company-abort))
(leader/set-keys-for-major-mode 'emacs-lisp-mode
"e" '("eval" . "evaluate expression")
@ -429,10 +430,10 @@ the user."
:straight (:build t)
:defer t
:bind (("M-x" . counsel-M-x)
("C-x b" . counsel-ibuffer)
("C-x C-f" . counsel-find-file)
:map minibuffer-local-map
("C-r" . 'counsel-minibuffer-history)))
("C-x b" . counsel-ibuffer)
("C-x C-f" . counsel-find-file)
:map minibuffer-local-map
("C-r" . 'counsel-minibuffer-history)))
(use-package helpful
:straight (:build t)
@ -448,8 +449,7 @@ the user."
(use-package bind-map
:straight (:build t)
:ensure t
:defer )
:defer t)
(use-package hydra
:straight (:build t)
@ -471,7 +471,6 @@ the user."
("C-c p" . projectile-command-map)
:init
;; NOTE: Set this to the folder where you keep your Git repos!
(setq projectile-switch-project-action #'projectile-dired))
(use-package counsel-projectile
@ -518,10 +517,11 @@ the user can match one and open it."
(use-package pdf-tools
:defer t
:magic ("%PDF" . pdf-view-mode)
:straight (pdf-tools :build t
:type git
:host github
:repo "vedang/pdf-tools")
:type git
:host github
:repo "vedang/pdf-tools")
:mode (("\\.pdf\\'" . pdf-view-mode))
:config
(progn
@ -570,42 +570,41 @@ the user can match one and open it."
:ensure t
:config
(setq dashboard-banner-logo-title "Phundraks Vanilla Emacs"
dashboard-startup-banner 'logo
dashboard-center-content t
dashboard-show-shortcuts t
dashboard-set-navigator t
dashboard-set-heading-icons t
dashboard-set-file-icons t
initial-buffer-choice (lambda () (get-buffer "*dashboard*"))
dashboard-projects-switch-function 'counsel-projectile-switch-project-by-name)
dashboard-startup-banner 'logo
dashboard-center-content t
dashboard-show-shortcuts t
dashboard-set-navigator t
dashboard-set-heading-icons t
dashboard-set-file-icons t
initial-buffer-choice (lambda () (get-buffer "*dashboard*"))
dashboard-projects-switch-function 'counsel-projectile-switch-project-by-name)
(setq dashboard-navigator-buttons
`(
((,(all-the-icons-faicon "language" :height 1.1 :v-adjust 0.0)
"Linguistics website"
""
(lambda (&rest _) (browse-url "https://langue.phundrak.com")))
`(((,(all-the-icons-faicon "language" :height 1.1 :v-adjust 0.0)
"Linguistics website"
""
(lambda (&rest _) (browse-url "https://langue.phundrak.com")))
(,(all-the-icons-faicon "firefox" :height 1.1 :v-adjust 0.0)
"Config Website"
""
(lambda (&rest _) (browse-url "https://config.phundrak.com"))))
(,(all-the-icons-faicon "firefox" :height 1.1 :v-adjust 0.0)
"Config Website"
""
(lambda (&rest _) (browse-url "https://config.phundrak.com"))))
((,(all-the-icons-octicon "git-branch" :height 1.1 :v-adjust 0.0)
"Dotfiles sources"
""
(lambda (&rest _) (browse-url "https://labs.phundrak.com/phundrak/dotfiles")))
("!" "Issues" "Show issues" (lambda (&rest _)
(browse-url "https://labs.phundrak.com/phundrak/dotfiles/issues"))
warning))
((,(all-the-icons-faicon "level-up" :height 1.1 :v-adjust 0.0)
"Update packages"
""
(lambda (&rest _) (progn
(require 'straight)
(straight-pull-all)))))))
((,(all-the-icons-octicon "git-branch" :height 1.1 :v-adjust 0.0)
"Dotfiles sources"
""
(lambda (&rest _) (browse-url "https://labs.phundrak.com/phundrak/dotfiles")))
("!" "Issues" "Show issues" (lambda (&rest _)
(browse-url "https://labs.phundrak.com/phundrak/dotfiles/issues"))
warning))
((,(all-the-icons-faicon "level-up" :height 1.1 :v-adjust 0.0)
"Update packages"
""
(lambda (&rest _) (progn
(require 'straight)
(straight-pull-all)))))))
(setq dashboard-items '((recents . 15)
(projects . 10)))
(projects . 10)))
(dashboard-setup-startup-hook)
:init
(add-hook 'after-init-hook 'dashboard-refresh-buffer))
@ -623,59 +622,59 @@ the user can match one and open it."
:init
(provide 'html2text)
(when (or (not (require 'mu4e-meta nil t))
(version< mu4e-mu-version "1.4"))
(version< mu4e-mu-version "1.4"))
(setq mu4e-maidir "~/.mail"
mu4e-trash-folder "/Trash"
mu4e-refile-folder "/Archive"
mu4e-sent-folder "/Sent"
mu4e-drafts-folder "/Drafts"
mu4e-user-mail-address-list nil))
mu4e-trash-folder "/Trash"
mu4e-refile-folder "/Archive"
mu4e-sent-folder "/Sent"
mu4e-drafts-folder "/Drafts"
mu4e-user-mail-address-list nil))
(setq mu4e-attachment-dir
(lambda (&rest _)
(expand-file-name ".attachments" (mu4e-roo-maildir))))
(lambda (&rest _)
(expand-file-name ".attachments" (mu4e-roo-maildir))))
:config
(setq mu4e-get-mail-command "mbsync -a"
mu4e-update-interval 60
mu4e-compose-format-flowed t
mu4e-view-show-addresses t
mu4e-sent-messages-behaviour 'sent
mu4e-hide-index-messages t
;; try to show images
mu4e-view-show-images t
mu4e-view-image-max-width 600
;; configuration for sending mail
message-send-mail-function #'smtpmail-send-it
smtpmail-stream-type 'starttls
message-kill-buffer-on-exit t ; close after sending
;; start with the first (default) context
mu4e-context-policy 'pick-first
;; compose with the current context, or ask
mu4e-compose-context-policy 'ask-if-none
;; use ivy
mu4e-completing-read-function #'ivy-completing-read
;; no need to ask
mu4e-confirm-quit t
mu4e-header-fields
'((:account . 12)
(:human-date . 12)
(:flags . 4)
(:from . 25)
(:subject)))
mu4e-update-interval 60
mu4e-compose-format-flowed t
mu4e-view-show-addresses t
mu4e-sent-messages-behaviour 'sent
mu4e-hide-index-messages t
;; try to show images
mu4e-view-show-images t
mu4e-view-image-max-width 600
;; configuration for sending mail
message-send-mail-function #'smtpmail-send-it
smtpmail-stream-type 'starttls
message-kill-buffer-on-exit t ; close after sending
;; start with the first (default) context
mu4e-context-policy 'pick-first
;; compose with the current context, or ask
mu4e-compose-context-policy 'ask-if-none
;; use ivy
mu4e-completing-read-function #'ivy-completing-read
;; no need to ask
mu4e-confirm-quit t
mu4e-header-fields
'((:account . 12)
(:human-date . 12)
(:flags . 4)
(:from . 25)
(:subject)))
;; set mail user agent
(setq mail-user-agent 'mu4e-user-agent)
;; Use fancy icons
(setq mu4e-use-fancy-chars t
mu4e-headers-draft-mark `("D" . ,(all-the-icons-faicon "pencil":height 0.8))
mu4e-headers-flagged-mark `("F" . ,(all-the-icons-faicon "flag":height 0.8))
mu4e-headers-new-mark `("N" . ,(all-the-icons-faicon "rss":height 0.8))
mu4e-headers-passed-mark `("P" . ,(all-the-icons-faicon "check":height 0.8))
mu4e-headers-replied-mark `("R" . ,(all-the-icons-faicon "reply":height 0.8))
mu4e-headers-seen-mark `("S" . ,(all-the-icons-faicon "eye":height 0.8))
mu4e-headers-unread-mark `("u" . ,(all-the-icons-faicon "eye-slash":height 0.8))
mu4e-headers-trashed-mark `("T" . ,(all-the-icons-faicon "trash":height 0.8))
mu4e-headers-attach-mark `("a" . ,(all-the-icons-faicon "paperclip":height 0.8))
mu4e-headers-draft-mark `("D" . ,(all-the-icons-faicon "pencil":height 0.8))
mu4e-headers-flagged-mark `("F" . ,(all-the-icons-faicon "flag":height 0.8))
mu4e-headers-new-mark `("N" . ,(all-the-icons-faicon "rss":height 0.8))
mu4e-headers-passed-mark `("P" . ,(all-the-icons-faicon "check":height 0.8))
mu4e-headers-replied-mark `("R" . ,(all-the-icons-faicon "reply":height 0.8))
mu4e-headers-seen-mark `("S" . ,(all-the-icons-faicon "eye":height 0.8))
mu4e-headers-unread-mark `("u" . ,(all-the-icons-faicon "eye-slash":height 0.8))
mu4e-headers-trashed-mark `("T" . ,(all-the-icons-faicon "trash":height 0.8))
mu4e-headers-attach-mark `("a" . ,(all-the-icons-faicon "paperclip":height 0.8))
mu4e-headers-encrypted-mark `("x" . ,(all-the-icons-faicon "lock":height 0.8))
mu4e-headers-signed-mark `("s" . ,(all-the-icons-faicon "certificate":height 0.8)))
@ -736,8 +735,8 @@ the user can match one and open it."
:hook (mu4e-compose-pre . org-msg-mode)
:config
(setq org-msg-startup "inlineimages"
org-msg-greeting-name-limit 3
org-msg-default-alternatives '(html text)))
org-msg-greeting-name-limit 3
org-msg-default-alternatives '(html text)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;; Org
@ -747,8 +746,8 @@ the user can match one and open it."
:hook (org-mode . org-appear-mode)
:config
(setq org-appear-autoemphasis t
org-appear-autolinks t
org-appear-autosubmarkers t)
org-appear-autolinks t
org-appear-autosubmarkers t)
(run-at-time nil nil #'org-appear--set-elements)
:defer t)
@ -758,14 +757,13 @@ the user can match one and open it."
:hook (org-mode . org-superstar-mode)
:config
(setq org-superstar-leading-bullet ?\s
org-superstar-leading-fallback ?\s
org-hide-leading-stars nil
org-superstar-todo-bullet-alist
'(("TODO" . 9744)
("[ ]" . 9744)
("DONE" . 9745)
("[X]" . 9745))))
org-superstar-leading-fallback ?\s
org-hide-leading-stars nil
org-superstar-todo-bullet-alist
'(("TODO" . 9744)
("[ ]" . 9744)
("DONE" . 9745)
("[X]" . 9745))))
(use-package org-fancy-priorities
:straight (:build t)
@ -773,8 +771,8 @@ the user can match one and open it."
:hook (org-agenda-mode . org-fancy-priorities-mode)
:config
(setq org-fancy-priorities-list `(,(all-the-icons-faicon "flag" :height 1.1 :v-adjust 0.0)
,(all-the-icons-faicon "arrow-up" :height 1.1 :v-adjust 0.0)
,(all-the-icons-faicon "square" :height 1.1 :v-adjust 0.0))))
,(all-the-icons-faicon "arrow-up" :height 1.1 :v-adjust 0.0)
,(all-the-icons-faicon "square" :height 1.1 :v-adjust 0.0))))
(use-package evil-nerd-commenter
:straight (:build t)
@ -794,7 +792,7 @@ the user can match one and open it."
(split-window-right)
(windmove-right)
(when (and (boundp 'golden-ratio-mode)
(symbol-value golden-ratio-mode))
(symbol-value golden-ratio-mode))
(golden-ratio)))
(defun split-window-below-and-focus ()
@ -802,7 +800,7 @@ the user can match one and open it."
(split-window-below)
(windmove-down)
(when (and (boundp 'golden-ratio-mode)
(symbol-value golden-ratio-mode))
(symbol-value golden-ratio-mode))
(golden-ratio)))
(defun ibuffer-list-buffers-and-focus ()
@ -810,7 +808,7 @@ the user can match one and open it."
(ibuffer-list-buffers)
(windmove-down)
(when (and (boundp 'golden-ratio-mode)
(symbol-value golden-ratio-mode))
(symbol-value golden-ratio-mode))
(golden-ratio)))
(defun eshell-new ()
@ -835,8 +833,8 @@ the user can match one and open it."
"bD" #'kill-buffer
"bh" #'dashboard-refresh-buffer
"bs" (lambda ()
(interactive)
(switch-to-buffer "*scratch*"))
(interactive)
(switch-to-buffer "*scratch*"))
"c" "code"
"cl" #'evilnc-comment-or-uncomment-lines
@ -872,10 +870,10 @@ the user can match one and open it."
"w-" #'split-window-below-and-focus
"w/" #'split-window-right-and-focus
"wb" (lambda ()
(interactive)
(progn
(kill-this-buffer)
(delete-window)))
(interactive)
(progn
(kill-this-buffer)
(delete-window)))
"wd" #'delete-window
"wD" #'delete-other-windows
"wo" #'other-window

View File

@ -30,8 +30,8 @@ find interesting. Ill describe them in more details below.
- [[file:tmux.org][Tmux configuration]]
As you can see, I personally use [[https://fishshell.com/][fish]] as my shell of choice, and [[https://www.gnu.org/software/emacs/][Emacs]] 28.0
using [[http://spacemacs.org][Spacemacs]] (still with Emacs keybinding in insert mode but with Evil in
normal mode) as my main text editor.
using [[http://spacemacs.org][Spacemacs]] (still with Emacs keybinding in insert mode but with Evil in
normal mode) as my main text editor.
When it comes to my graphical UI, I do not have any desktop environment.
Instead, I have a tiling window manager, [[https://awesomewm.org/][Awesome]]. I used to use [[https://github.com/Airblader/i3][i3-gaps]], an [[https://i3wm.org/][i3]]