mirror of
https://codeberg.org/andyscott/dotfiles.git
synced 2024-12-23 02:13:11 -05:00
Compare commits
No commits in common. "3ade66ba4bb078ed59bb1dca853eb1f8a1588218" and "916b4e75d718461e2e75243ce5f4a018e199812e" have entirely different histories.
3ade66ba4b
...
916b4e75d7
2 changed files with 133 additions and 401 deletions
|
@ -20,7 +20,6 @@ bspc rule -a KeePassXC state=floating
|
||||||
|
|
||||||
bspc rule -a firefox desktop='^1' follow=on
|
bspc rule -a firefox desktop='^1' follow=on
|
||||||
bspc rule -a Chromium desktop='^2' follow=on
|
bspc rule -a Chromium desktop='^2' follow=on
|
||||||
bspc rule -a Vivaldi-stable desktop='^2' follow=on
|
|
||||||
bspc rule -a Evince desktop='4' follow=on
|
bspc rule -a Evince desktop='4' follow=on
|
||||||
bspc rule -a Soffice desktop='^4' follow=on
|
bspc rule -a Soffice desktop='^4' follow=on
|
||||||
bspc rule -a Simple-scan='^4' follow=on
|
bspc rule -a Simple-scan='^4' follow=on
|
||||||
|
@ -50,16 +49,15 @@ bspc desktop -f 1
|
||||||
grep -x sxhkd > /dev/null || sxhkd &
|
grep -x sxhkd > /dev/null || sxhkd &
|
||||||
/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &
|
/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &
|
||||||
xss-lock -n /usr/lib/xsecurelock/dimmer -l -- xsecurelock &
|
xss-lock -n /usr/lib/xsecurelock/dimmer -l -- xsecurelock &
|
||||||
xidlehook --not-when-audio --not-when-fullscreen --timer 120 "killall -q redshift && xrandr --output eDP-1 --brightness .1" "xrandr --output eDP-1 --brightness 1 && redshift -r & disown" --timer 480 "xset s activate" "xrandr --output eDP-1 --brightness 1 && redshift -r & disown" &
|
xidlehook --not-when-audio --not-when-fullscreen --timer 120 "killall -q redshift && xrandr --output eDP-1 --brightness .1" "xrandr --output eDP-1 --brightness 1 && redshift -r & disown" --timer 480 "xset s activate" "xrandr --output eDP-1 --brightness 1" &
|
||||||
xsettingsd &
|
xsettingsd &
|
||||||
sh ~/.fehbg &
|
sh ~/.fehbg &
|
||||||
pa-notify -t 3 &
|
|
||||||
#$HOME/.local/bin/single-polybar-launcher &
|
#$HOME/.local/bin/single-polybar-launcher &
|
||||||
$HOME/.local/bin/tint2-launcher &
|
$HOME/.local/bin/tint2-launcher &
|
||||||
redshift -r &
|
redshift -r &
|
||||||
picom &
|
picom &
|
||||||
dunst &
|
dunst &
|
||||||
dex -a &
|
dex -a &
|
||||||
cbatticon -u 20 -i standard -c "systemctl hibernate" &
|
pa-notify -t 3 &
|
||||||
birdtray &
|
birdtray &
|
||||||
sleep 10 && nextcloud --background &
|
sleep 30 && nextcloud --background &
|
||||||
|
|
524
emacs.d/init.el
524
emacs.d/init.el
|
@ -1,4 +1,4 @@
|
||||||
; Disable package.el early so it won't start loading packages before init is loaded
|
;; Disable package.el early so it won't start loading packages before init is loaded
|
||||||
(setq package-enable-at-startup nil)
|
(setq package-enable-at-startup nil)
|
||||||
|
|
||||||
;; No thanks
|
;; No thanks
|
||||||
|
@ -14,8 +14,8 @@
|
||||||
;; Visible bell
|
;; Visible bell
|
||||||
(setq visible-bell t)
|
(setq visible-bell t)
|
||||||
|
|
||||||
; Font - Does nothing if mixed-pitch package is used
|
; Font
|
||||||
;(set-face-attribute 'default nil :font "ibm plex mono light" :height 100)
|
(set-face-attribute 'default nil :font "Hack" :height 110)
|
||||||
|
|
||||||
;; Make ESC quit prompts
|
;; Make ESC quit prompts
|
||||||
(global-set-key (kbd "<escape>") 'keyboard-escape-quit)
|
(global-set-key (kbd "<escape>") 'keyboard-escape-quit)
|
||||||
|
@ -50,18 +50,18 @@
|
||||||
(global-set-key (kbd "S-C-<down>") 'shrink-window)
|
(global-set-key (kbd "S-C-<down>") 'shrink-window)
|
||||||
(global-set-key (kbd "S-C-<up>") 'enlarge-window)
|
(global-set-key (kbd "S-C-<up>") 'enlarge-window)
|
||||||
|
|
||||||
;; scrolling
|
;; Improve scrolling
|
||||||
(setq mouse-wheel-scroll-amount '(4 ((shift) . 1))) ; 1: lines to scroll, 2: while holding shift
|
(setq mouse-wheel-scroll-amount '(1 ((shift) . 1))) ; one line at a time
|
||||||
(setq mouse-wheel-progressive-speed nil) ; acceleration
|
(setq mouse-wheel-progressive-speed nil) ; don't accelerate scrolling
|
||||||
(setq mouse-wheel-follow-mouse 't) ; scroll window under cursor
|
(setq mouse-wheel-follow-mouse 't) ; scroll window under mouse
|
||||||
(setq scroll-step 1) ; keyboard scrolling
|
(setq scroll-step 1) ; keyboard scroll one line at a time
|
||||||
|
|
||||||
;; Tabs
|
;; Tabs
|
||||||
(setq-default indent-tabs-mode nil)
|
(setq-default indent-tabs-mode nil)
|
||||||
(setq-default tab-width 4)
|
(setq-default tab-width 4)
|
||||||
(setq indent-line-function 'insert-tab)
|
(setq indent-line-function 'insert-tab)
|
||||||
|
|
||||||
;; Line numbers
|
;;Line numbers
|
||||||
(setq column-number-mode t)
|
(setq column-number-mode t)
|
||||||
(dolist (mode '(text-mode-hook
|
(dolist (mode '(text-mode-hook
|
||||||
prog-mode-hook
|
prog-mode-hook
|
||||||
|
@ -72,6 +72,10 @@
|
||||||
(setq-default fill-column 80)
|
(setq-default fill-column 80)
|
||||||
(add-hook 'prog-mode-hook #'display-fill-column-indicator-mode)
|
(add-hook 'prog-mode-hook #'display-fill-column-indicator-mode)
|
||||||
|
|
||||||
|
; No line numbers in org-mode
|
||||||
|
(dolist (mode '(org-mode-hook))
|
||||||
|
(add-hook mode (lambda () (display-line-numbers-mode 0))))
|
||||||
|
|
||||||
;; Install and load straight.el
|
;; Install and load straight.el
|
||||||
(defvar bootstrap-version)
|
(defvar bootstrap-version)
|
||||||
(let ((bootstrap-file
|
(let ((bootstrap-file
|
||||||
|
@ -120,13 +124,17 @@
|
||||||
;; (use-package everforest
|
;; (use-package everforest
|
||||||
;; :straight (:type git :repo "https://git.sr.ht/~theorytoe/everforest-theme"))
|
;; :straight (:type git :repo "https://git.sr.ht/~theorytoe/everforest-theme"))
|
||||||
|
|
||||||
|
;; (use-package gruvbox-theme
|
||||||
|
;; :config
|
||||||
|
;; (load-theme 'gruvbox-dark-soft t))
|
||||||
|
|
||||||
(add-to-list 'custom-theme-load-path "~/.cache/emacs/custom/everforest-theme")
|
(add-to-list 'custom-theme-load-path "~/.cache/emacs/custom/everforest-theme")
|
||||||
(load-theme 'everforest-hard-dark t)
|
(load-theme 'everforest-hard-dark t)
|
||||||
|
|
||||||
;; Help distinguish work buffers from others like sidebars and terminal
|
;; Help distinguish work buffers from others like sidebars and terminal
|
||||||
;; (use-package solaire-mode
|
(use-package solaire-mode
|
||||||
;; :init
|
:init
|
||||||
;; (solaire-global-mode t))
|
(solaire-global-mode t))
|
||||||
|
|
||||||
;; Icons
|
;; Icons
|
||||||
(use-package all-the-icons)
|
(use-package all-the-icons)
|
||||||
|
@ -170,254 +178,66 @@
|
||||||
:config
|
:config
|
||||||
(setq which-key-idle-delay 0.3))
|
(setq which-key-idle-delay 0.3))
|
||||||
|
|
||||||
;; Save history over restarts
|
;; Navigation: Ivy/Counsel/Swiper
|
||||||
(use-package savehist
|
(use-package ivy
|
||||||
:init
|
:init
|
||||||
(savehist-mode))
|
(ivy-mode 1)
|
||||||
|
:config
|
||||||
;; Completion with vertico/consult
|
(setq ivy-use-virtual-buffers t)
|
||||||
|
(setq ivy-wrap t)
|
||||||
(use-package vertico
|
(setq ivy-count-format "(%d/%d) ")
|
||||||
:init
|
|
||||||
(vertico-mode)
|
|
||||||
|
|
||||||
;; Different scroll margin
|
|
||||||
;; (set vertico-scroll-margin 0)
|
|
||||||
|
|
||||||
;; Show more candidates
|
|
||||||
;; (setq vertico-count 20)
|
|
||||||
|
|
||||||
;; Grow and shrink the Vertico minibuffer
|
|
||||||
;; (setq vertico-resize t)
|
|
||||||
|
|
||||||
;; Optionally enable cycling for `vertico-next' and `vertico-previous'.
|
|
||||||
;; (setq vertico-cycle t)
|
|
||||||
)
|
|
||||||
|
|
||||||
(use-package emacs
|
|
||||||
:init
|
|
||||||
;; Add prompt indicator to `completing-read-multiple'.
|
|
||||||
(defun crm-indicator (args)
|
|
||||||
(cons (format "[CRM%s] %s"
|
|
||||||
(replace-regexp-in-string
|
|
||||||
"\\`\\[.*?]\\*\\|\\[.*?]\\*\\'" ""
|
|
||||||
crm-separator)
|
|
||||||
(car args))
|
|
||||||
(cdr args)))
|
|
||||||
(advice-add #'completing-read-multiple :filter-args #'crm-indicator)
|
|
||||||
;; Do not allow the cursor in the minibuffer prompt
|
|
||||||
(setq minibuffer-prompt-properties
|
|
||||||
'(read-only t cursor-intangible t face minibuffer-prompt))
|
|
||||||
(add-hook 'minibuffer-setup-hook #'cursor-intangible-mode)
|
|
||||||
;; Emacs 28: Hide commands in M-x which do not work in the current mode.
|
|
||||||
;; Vertico commands are hidden in normal buffers.
|
|
||||||
(setq read-extended-command-predicate
|
|
||||||
#'command-completion-default-include-p)
|
|
||||||
(setq enable-recursive-minibuffers t))
|
(setq enable-recursive-minibuffers t))
|
||||||
|
|
||||||
(use-package consult
|
(use-package ivy-rich
|
||||||
:bind (;; C-c bindings (mode-specific-map)
|
:after ivy
|
||||||
("C-c h" . consult-history)
|
:hook (counsel-mode . ivy-rich-mode)
|
||||||
("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 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
|
|
||||||
;; 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 f" . 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 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" . consult-history) ;; orig. next-matching-history-element
|
|
||||||
("M-r" . 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
|
:config
|
||||||
|
(setq ivy-rich-parse-remote-buffer nil))
|
||||||
|
|
||||||
;; Optionally configure preview. The default value
|
(use-package counsel
|
||||||
;; is 'any, such that any key triggers the preview.
|
:after ivy
|
||||||
;; (setq consult-preview-key 'any)
|
:config
|
||||||
(setq consult-preview-key (kbd "M-."))
|
(counsel-mode 1)
|
||||||
;; (setq consult-preview-key (list (kbd "<S-down>") (kbd "<S-up>")))
|
(setq ivy-initial-inputs-alist nil))
|
||||||
;; 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-file-register
|
|
||||||
consult--source-recent-file consult--source-project-recent-file
|
|
||||||
;; :preview-key (kbd "M-.")
|
|
||||||
:preview-key '(:debounce 0.4 any))
|
|
||||||
|
|
||||||
;; Optionally configure the narrowing key.
|
(use-package swiper
|
||||||
;; Both < and C-+ work reasonably well.
|
:after ivy
|
||||||
(setq consult-narrow-key "<") ;; (kbd "C-+")
|
:bind (("C-s" . swiper)))
|
||||||
|
|
||||||
;; Optionally make narrowing help available in the minibuffer.
|
(use-package treemacs
|
||||||
;; You may want to use `embark-prefix-help-command' or which-key instead.
|
:bind
|
||||||
;; (define-key consult-narrow-map (vconcat consult-narrow-key "?") #'consult-narrow-help)
|
(:map global-map
|
||||||
|
("M-0" . treemacs-select-window)
|
||||||
|
("C-x t 1" . treemacs-delete-other-windows)
|
||||||
|
("C-x t t" . treemacs)
|
||||||
|
("C-x t B" . treemacs-bookmark)
|
||||||
|
("C-x t C-t" . treemacs-find-file)
|
||||||
|
("C-x t M-t" . treemacs-find-tag)))
|
||||||
|
|
||||||
;; By default `consult-project-function' uses `project-root' from project.el.
|
(use-package lsp-treemacs
|
||||||
;; Optionally configure a different project root function.
|
:config
|
||||||
;; There are multiple reasonable alternatives to chose from.
|
(lsp-treemacs-sync-mode 1))
|
||||||
;;;; 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 consult-flycheck)
|
;; Git
|
||||||
|
|
||||||
(use-package consult-git-log-grep
|
(use-package magit
|
||||||
|
:bind ("C-M-;" . magit-status)
|
||||||
|
:commands (magit-status magit-get-current-branch)
|
||||||
:custom
|
:custom
|
||||||
(consult-git-log-grep-open-function #'magit-show-commit))
|
(magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1))
|
||||||
|
|
||||||
(use-package consult-company
|
;; Project management
|
||||||
:bind
|
|
||||||
(:map company-mode-map
|
|
||||||
([remap completion-at-point] . consult-company)))
|
|
||||||
|
|
||||||
(use-package consult-lsp
|
(use-package projectile
|
||||||
:bind
|
|
||||||
(:map lsp-mode-map
|
|
||||||
([remap xref-find-apropos] . consult-lsp-symbols)))
|
|
||||||
|
|
||||||
;; (use-package consult-projectile)
|
|
||||||
|
|
||||||
(use-package consult-yasnippet)
|
|
||||||
|
|
||||||
;; Alternate completion style
|
|
||||||
|
|
||||||
(use-package orderless
|
|
||||||
:init
|
:init
|
||||||
;; Configure a custom style dispatcher (see the Consult wiki)
|
(projectile-mode +1)
|
||||||
;; (setq orderless-style-dispatchers '(+orderless-dispatch)
|
:bind-keymap
|
||||||
;; orderless-component-separator #'orderless-escapable-split-on-space)
|
(("C-M-p" . projectile-find-file)
|
||||||
(setq completion-styles '(orderless basic)
|
("C-c p" . projectile-command-map))
|
||||||
completion-category-defaults nil
|
:bind (:map projectile-mode-map
|
||||||
completion-category-overrides '((file (styles partial-completion)))))
|
("C-c p" . projectile-command-map)))
|
||||||
|
|
||||||
;; Contextual actions
|
;; LSP & debugging
|
||||||
|
|
||||||
(use-package marginalia
|
|
||||||
:config
|
|
||||||
(marginalia-mode))
|
|
||||||
|
|
||||||
(use-package embark
|
|
||||||
:bind
|
|
||||||
(("C-." . embark-act) ;; pick some comfortable binding
|
|
||||||
("C-;" . embark-dwim) ;; good alternative: M-.
|
|
||||||
("C-h B" . embark-bindings)) ;; alternative for `describe-bindings'
|
|
||||||
:init
|
|
||||||
;; Optionally replace the key help with a completing-read interface
|
|
||||||
(setq prefix-help-command #'embark-prefix-help-command)
|
|
||||||
:config
|
|
||||||
;; Hide the mode line of the Embark live/completions buffers
|
|
||||||
(add-to-list 'display-buffer-alist
|
|
||||||
'("\\`\\*Embark Collect \\(Live\\|Completions\\)\\*"
|
|
||||||
nil
|
|
||||||
(window-parameters (mode-line-format . none)))))
|
|
||||||
|
|
||||||
(use-package embark-consult
|
|
||||||
:hook
|
|
||||||
(embark-collect-mode . consult-preview-at-point-mode))
|
|
||||||
|
|
||||||
;; Org-mode
|
|
||||||
|
|
||||||
; No line numbers in org-mode
|
|
||||||
(dolist (mode '(org-mode-hook))
|
|
||||||
(add-hook mode (lambda () (display-line-numbers-mode 0))))
|
|
||||||
|
|
||||||
(setq org-startup-indented t ; Indentation
|
|
||||||
org-pretty-entities t ; Rich text/Special chars
|
|
||||||
org-hide-emphasis-markers t ; Hide markup - see org-appear
|
|
||||||
org-startup-with-inline-images t ; Image previews
|
|
||||||
org-image-actual-width '(300))
|
|
||||||
|
|
||||||
(use-package org-appear
|
|
||||||
:hook (org-mode . org-appear-mode))
|
|
||||||
|
|
||||||
(use-package mixed-pitch
|
|
||||||
:hook
|
|
||||||
(text-mode . mixed-pitch-mode)
|
|
||||||
:config
|
|
||||||
(set-face-attribute 'default nil :font "IBM Plex Mono Light" :height 105)
|
|
||||||
(set-face-attribute 'fixed-pitch nil :font "IBM Plex Mono Light")
|
|
||||||
(set-face-attribute 'variable-pitch nil :font "DejaVu Sans"))
|
|
||||||
;(add-hook 'mixed-pitch-mode-hook #'solaire-mode-reset)
|
|
||||||
|
|
||||||
(use-package org-superstar
|
|
||||||
:hook
|
|
||||||
(org-mode . org-superstar-mode)
|
|
||||||
:config
|
|
||||||
(setq org-superstar-special-todo-items t))
|
|
||||||
|
|
||||||
;; LSP
|
|
||||||
|
|
||||||
(use-package lsp-mode
|
(use-package lsp-mode
|
||||||
:init
|
:init
|
||||||
|
@ -437,20 +257,8 @@
|
||||||
(web-mode . lsp)
|
(web-mode . lsp)
|
||||||
(zig-mode . lsp)
|
(zig-mode . lsp)
|
||||||
(lsp-mode . lsp-enable-which-key-integration))
|
(lsp-mode . lsp-enable-which-key-integration))
|
||||||
:custom
|
|
||||||
(lsp-eldoc-render-all t)
|
|
||||||
(lsp-idle-delay 0.6)
|
|
||||||
;; (lsp-rust-analyzer-cargo-watch-command "clippy")
|
|
||||||
;; (lsp-rust-analyzer-server-display-inlay-hints t)
|
|
||||||
;; (lsp-rust-analyzer-display-lifetime-elision-hints-enable "skip_trivial")
|
|
||||||
;; (lsp-rust-analyzer-display-chaining-hints t)
|
|
||||||
;; (lsp-rust-analyzer-display-lifetime-elision-hints-use-parameter-names nil)
|
|
||||||
;; (lsp-rust-analyzer-display-closure-return-type-hints t)
|
|
||||||
;; (lsp-rust-analyzer-display-parameter-hints nil)
|
|
||||||
;; (lsp-rust-analyzer-display-reborrow-hints nil)
|
|
||||||
:config
|
:config
|
||||||
(setq lsp-prefer-flymake nil)) ; prefer lsp-ui (flycheck) to flymake
|
(setq lsp-prefer-flymake nil)) ;prefer lsp-ui (flycheck) to flymake
|
||||||
; (setq lsp-disabled-clients '(clangd))) ; prefer ccls to clangd
|
|
||||||
; :bind
|
; :bind
|
||||||
; (:map lsp-mode-map
|
; (:map lsp-mode-map
|
||||||
; ("TAB" . completion-at-point)))
|
; ("TAB" . completion-at-point)))
|
||||||
|
@ -465,7 +273,7 @@
|
||||||
(setq lsp-ui-doc-position 'bottom-and-right)
|
(setq lsp-ui-doc-position 'bottom-and-right)
|
||||||
(setq lsp-ui-doc-include-signature t)
|
(setq lsp-ui-doc-include-signature t)
|
||||||
(setq lsp-ui-sideline-enable t)
|
(setq lsp-ui-sideline-enable t)
|
||||||
(setq lsp-ui-sideline-show-hover t)
|
(setq lsp-ui-sideline-show-hover nil)
|
||||||
(setq lsp-ui-flycheck-enable t)
|
(setq lsp-ui-flycheck-enable t)
|
||||||
(setq lsp-ui-flycheck-list-position 'right)
|
(setq lsp-ui-flycheck-list-position 'right)
|
||||||
(setq lsp-ui-flycheck-live-reporting t)
|
(setq lsp-ui-flycheck-live-reporting t)
|
||||||
|
@ -474,28 +282,6 @@
|
||||||
(setq lsp-ui-peek-peek-height 25)
|
(setq lsp-ui-peek-peek-height 25)
|
||||||
(lsp-ui-doc-show))
|
(lsp-ui-doc-show))
|
||||||
|
|
||||||
|
|
||||||
;; Text completion
|
|
||||||
|
|
||||||
(use-package company
|
|
||||||
:config
|
|
||||||
(global-company-mode 1)
|
|
||||||
(setq company-global-modes '(not gud-mode))
|
|
||||||
:custom
|
|
||||||
(company-idle-delay 0)
|
|
||||||
(company-minimum-prefix-length 1)
|
|
||||||
(company-tooltip-align-annotations t)
|
|
||||||
:bind
|
|
||||||
(:map company-active-map
|
|
||||||
("RET" . nil)
|
|
||||||
("[return]" . nil)
|
|
||||||
("TAB" . company-complete-selection)
|
|
||||||
("<tab>" . company-complete-selection)
|
|
||||||
("C-n" . company-select-next)
|
|
||||||
("C-p" . company-select-previous)))
|
|
||||||
|
|
||||||
;; Debugging
|
|
||||||
|
|
||||||
(use-package dap-mode
|
(use-package dap-mode
|
||||||
:after lsp-mode
|
:after lsp-mode
|
||||||
:commands dap-debug
|
:commands dap-debug
|
||||||
|
@ -507,14 +293,6 @@
|
||||||
(require 'dap-python)
|
(require 'dap-python)
|
||||||
;(require 'dap-node)
|
;(require 'dap-node)
|
||||||
(require 'dap-lldb)
|
(require 'dap-lldb)
|
||||||
(require 'dap-gdb-lldb)
|
|
||||||
(dap-gdb-lldb-setup)
|
|
||||||
(dap-register-debug-template
|
|
||||||
"Rust :: LLDB Run Configuration"
|
|
||||||
(list :type "lldb"
|
|
||||||
:request "launch"
|
|
||||||
:name "LLDB::Run"
|
|
||||||
:gdbpath "rust-lldb"))
|
|
||||||
:bind
|
:bind
|
||||||
(:map dap-mode-map
|
(:map dap-mode-map
|
||||||
("<f5>" . dap-debug)
|
("<f5>" . dap-debug)
|
||||||
|
@ -523,37 +301,21 @@
|
||||||
("S-<f5>" . dap-disconnect)
|
("S-<f5>" . dap-disconnect)
|
||||||
("C-S-<f5>" . dap-debug-restart)))
|
("C-S-<f5>" . dap-debug-restart)))
|
||||||
|
|
||||||
(use-package realgud)
|
(use-package company
|
||||||
|
|
||||||
(use-package realgud-lldb)
|
|
||||||
|
|
||||||
;; Treemacs
|
|
||||||
(use-package treemacs
|
|
||||||
:bind
|
|
||||||
(:map global-map
|
|
||||||
("M-0" . treemacs-select-window)
|
|
||||||
("C-x t 1" . treemacs-delete-other-windows)
|
|
||||||
("C-x t t" . treemacs)
|
|
||||||
("C-x t B" . treemacs-bookmark)
|
|
||||||
("C-x t C-t" . treemacs-find-file)
|
|
||||||
("C-x t M-t" . treemacs-find-tag)))
|
|
||||||
|
|
||||||
(use-package lsp-treemacs
|
|
||||||
:config
|
:config
|
||||||
(lsp-treemacs-sync-mode 1))
|
(global-company-mode 1)
|
||||||
|
|
||||||
;; Syntax checking
|
|
||||||
(use-package flycheck
|
|
||||||
:hook (lsp-mode . flycheck-mode)
|
|
||||||
:config
|
|
||||||
(setq flycheck-python-flake8-executable "flake8"))
|
|
||||||
|
|
||||||
;; Git
|
|
||||||
(use-package magit
|
|
||||||
:bind ("C-M-;" . magit-status)
|
|
||||||
:commands (magit-status magit-get-current-branch)
|
|
||||||
:custom
|
:custom
|
||||||
(magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1))
|
(company-idle-delay 0)
|
||||||
|
(company-minimum-prefix-length 1)
|
||||||
|
(company-tooltip-align-annotations t)
|
||||||
|
:bind
|
||||||
|
(:map company-active-map
|
||||||
|
("RET" . nil)
|
||||||
|
("[return]" . nil)
|
||||||
|
("TAB" . company-complete-selection)
|
||||||
|
("<tab>" . company-complete-selection)
|
||||||
|
("C-n" . company-select-next)
|
||||||
|
("C-p" . company-select-previous)))
|
||||||
|
|
||||||
;;; Languages/Tools
|
;;; Languages/Tools
|
||||||
|
|
||||||
|
@ -577,13 +339,13 @@
|
||||||
(setq-default c-default-style "k&r")
|
(setq-default c-default-style "k&r")
|
||||||
(setq-default c-basic-offset 2)
|
(setq-default c-basic-offset 2)
|
||||||
|
|
||||||
;; (use-package ccls
|
;(use-package ccls
|
||||||
;; :hook ((c-mode c++-mode objc-mode cuda-mode) .
|
; :hook ((c-mode c++-mode objc-mode cuda-mode) .
|
||||||
;; (lambda () (require 'ccls) (lsp))))
|
; (lambda () (require 'ccls) (lsp))))
|
||||||
|
|
||||||
;(use-package modern-cpp-font-lock
|
;(use-package modern-cpp-font-lock
|
||||||
; :config
|
; :config
|
||||||
; (modern-c++-font-lock-global-mode))
|
; (modern-c++-font-lock-global-mode))
|
||||||
|
|
||||||
;; Golang
|
;; Golang
|
||||||
|
|
||||||
|
@ -597,35 +359,35 @@
|
||||||
|
|
||||||
;; JavaScript/TypeScript, HTML, CSS
|
;; JavaScript/TypeScript, HTML, CSS
|
||||||
|
|
||||||
(setq css-indent-level 2)
|
;; (setq css-indent-level 2)
|
||||||
(setq css-indent-offset 2)
|
;; (setq css-indent-offset 2)
|
||||||
(setq js-indent-level 2)
|
;; (setq js-indent-level 2)
|
||||||
|
|
||||||
(add-to-list 'auto-mode-alist '("\\.mjs\\'" . js-mode))
|
;; (add-to-list 'auto-mode-alist '("\\.mjs\\'" . js-mode))
|
||||||
|
|
||||||
(use-package js2-mode
|
;; (use-package js2-mode
|
||||||
:config
|
;; :config
|
||||||
(add-to-list 'interpreter-mode-alist '("#!/usr/bin/env node" . js2-mode))
|
;; (add-to-list 'interpreter-mode-alist '("#!/usr/bin/env node" . js2-mode))
|
||||||
;(setq js2-strict-missing-semi-warning t)
|
;; ;(setq js2-strict-missing-semi-warning t)
|
||||||
(setq js2-mode-show-strict-warnings t)
|
;; (setq js2-mode-show-strict-warnings t)
|
||||||
:hook (js-mode . js2-minor-mode))
|
;; :hook (js-mode . js2-minor-mode))
|
||||||
|
|
||||||
(use-package typescript-mode
|
;; (use-package typescript-mode
|
||||||
:config
|
;; :config
|
||||||
(setq typescript-indent-level 2)
|
;; (setq typescript-indent-level 2)
|
||||||
:mode ("\\.ts\\'" . typescript-mode)
|
;; :mode ("\\.ts\\'" . typescript-mode)
|
||||||
("\\.tsx\\'" . typescript-mode))
|
;; ("\\.tsx\\'" . typescript-mode))
|
||||||
|
|
||||||
;; (use-package restclient
|
;; (use-package restclient
|
||||||
;; :init
|
;; :init
|
||||||
;; (use-package company-restclient)
|
;; (use-package company-restclient)
|
||||||
;; :mode ("\\.http\\'" . restclient-mode))
|
;; :mode ("\\.http\\'" . restclient-mode))
|
||||||
|
|
||||||
(use-package rainbow-mode
|
;; (use-package rainbow-mode
|
||||||
:hook
|
;; :hook
|
||||||
((js-mode . rainbow-mode)
|
;; ((js-mode . rainbow-mode)
|
||||||
(typescript-mode . rainbow-mode)
|
;; (typescript-mode . rainbow-mode)
|
||||||
(web-mode . rainbow-mode)))
|
;; (web-mode . rainbow-mode)))
|
||||||
|
|
||||||
;; (use-package skewer-mode
|
;; (use-package skewer-mode
|
||||||
;; :init
|
;; :init
|
||||||
|
@ -642,25 +404,25 @@
|
||||||
|
|
||||||
;; (use-package simple-httpd)
|
;; (use-package simple-httpd)
|
||||||
|
|
||||||
(use-package web-mode
|
;; (use-package web-mode
|
||||||
:config
|
;; :config
|
||||||
(setq web-mode-code-indent-offset 2)
|
;; (setq web-mode-code-indent-offset 2)
|
||||||
(setq web-mode-markup-indent-offset 2)
|
;; (setq web-mode-markup-indent-offset 2)
|
||||||
(setq web-mode-attribute-indent-offset 2)
|
;; (setq web-mode-attribute-indent-offset 2)
|
||||||
:mode
|
;; :mode
|
||||||
(("\\.phtml\\'" . web-mode)
|
;; (("\\.phtml\\'" . web-mode)
|
||||||
("\\.tpl\\.php\\'" . web-mode)
|
;; ("\\.tpl\\.php\\'" . web-mode)
|
||||||
("\\.jsp\\'" . web-mode)
|
;; ("\\.jsp\\'" . web-mode)
|
||||||
("\\.as[cp]x\\'" . web-mode)
|
;; ("\\.as[cp]x\\'" . web-mode)
|
||||||
("\\.erb\\'" . web-mode)
|
;; ("\\.erb\\'" . web-mode)
|
||||||
("\\.mustache\\'" . web-mode)
|
;; ("\\.mustache\\'" . web-mode)
|
||||||
("\\.djhtml\\'" . web-mode)
|
;; ("\\.djhtml\\'" . web-mode)
|
||||||
("\\.jst.ejs\\'" . web-mode)
|
;; ("\\.jst.ejs\\'" . web-mode)
|
||||||
("\\.html?\\'" . web-mode)))
|
;; ("\\.html?\\'" . web-mode)))
|
||||||
|
|
||||||
(use-package jsdoc
|
;; (use-package jsdoc
|
||||||
:straight (jsdoc :type git :host github :repo "isamert/jsdoc.el")
|
;; :straight (jsdoc :type git :host github :repo "isamert/jsdoc.el")
|
||||||
:bind ("C-c C-n" . jsdoc))
|
;; :bind ("C-c C-n" . jsdoc))
|
||||||
|
|
||||||
;; LaTeX
|
;; LaTeX
|
||||||
|
|
||||||
|
@ -702,41 +464,7 @@
|
||||||
|
|
||||||
;; Rust
|
;; Rust
|
||||||
|
|
||||||
(use-package rustic
|
;(use-package rust-mode)
|
||||||
:ensure
|
|
||||||
:bind (:map rustic-mode-map
|
|
||||||
("M-j" . lsp-ui-imenu)
|
|
||||||
("M-?" . lsp-find-references)
|
|
||||||
("C-c C-c l" . flycheck-list-errors)
|
|
||||||
("C-c C-c a" . lsp-execute-code-action)
|
|
||||||
("C-c C-c r" . lsp-rename)
|
|
||||||
("C-c C-c q" . lsp-workspace-restart)
|
|
||||||
("C-c C-c Q" . lsp-workspace-shutdown)
|
|
||||||
("C-c C-c s" . lsp-rust-analyzer-status)
|
|
||||||
("C-c C-c e" . lsp-rust-analyzer-expand-macro)
|
|
||||||
("C-c C-c d" . dap-hydra)
|
|
||||||
("C-c C-c h" . lsp-ui-doc-glance)))
|
|
||||||
:config
|
|
||||||
;; uncomment for less flashiness
|
|
||||||
;; (setq lsp-eldoc-hook nil)
|
|
||||||
;; (setq lsp-enable-symbol-highlighting nil)
|
|
||||||
;; (setq lsp-signature-auto-activate nil)
|
|
||||||
|
|
||||||
;; comment to disable rustfmt on save
|
|
||||||
;; (add-hook 'rustic-mode-hook 'rk/rustic-mode-hook))
|
|
||||||
|
|
||||||
;; (defun rk/rustic-mode-hook ()
|
|
||||||
;; ;; so that run C-c C-c C-r works without having to confirm, but don't try to
|
|
||||||
;; ;; save rust buffers that are not file visiting. Once
|
|
||||||
;; ;; https://github.com/brotzeit/rustic/issues/253 has been resolved this should
|
|
||||||
;; ;; no longer be necessary.
|
|
||||||
;; (when buffer-file-name
|
|
||||||
;; (setq-local buffer-save-without-query t))
|
|
||||||
;; (add-hook 'before-save-hook 'lsp-format-buffer nil t))
|
|
||||||
|
|
||||||
;; TOML config files
|
|
||||||
|
|
||||||
(use-package toml-mode)
|
|
||||||
|
|
||||||
;; Zig
|
;; Zig
|
||||||
|
|
||||||
|
@ -749,6 +477,12 @@
|
||||||
; :major-modes '(zig-mode)
|
; :major-modes '(zig-mode)
|
||||||
; :server-id 'zls))
|
; :server-id 'zls))
|
||||||
|
|
||||||
|
;; Syntax checking
|
||||||
|
(use-package flycheck
|
||||||
|
:hook (lsp-mode . flycheck-mode)
|
||||||
|
:config
|
||||||
|
(setq flycheck-python-flake8-executable "flake8"))
|
||||||
|
|
||||||
;; Templating
|
;; Templating
|
||||||
(use-package yasnippet
|
(use-package yasnippet
|
||||||
:bind
|
:bind
|
||||||
|
|
Loading…
Reference in a new issue