Start removing LSP, add mono-complete, custom dashboard, assorted improvements
This commit is contained in:
parent
359c92028f
commit
51d1081917
@ -12,7 +12,6 @@ Skipping a bunch of regular expression searching in the file-name-handler-alist
|
|||||||
(defvar default-file-name-handler-alist file-name-handler-alist)
|
(defvar default-file-name-handler-alist file-name-handler-alist)
|
||||||
(setq file-name-handler-alist nil)
|
(setq file-name-handler-alist nil)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** Garbage Collection
|
*** Garbage Collection
|
||||||
|
|
||||||
The default Garbage Collector is triggered at 800 KB, way too conservative, let's bump to 512 MB.
|
The default Garbage Collector is triggered at 800 KB, way too conservative, let's bump to 512 MB.
|
||||||
@ -94,7 +93,6 @@ Ignore X resources.
|
|||||||
(advice-add #'x-apply-session-resources :override #'ignore)
|
(advice-add #'x-apply-session-resources :override #'ignore)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
|
||||||
*** UTF-8 Support
|
*** UTF-8 Support
|
||||||
#+begin_src emacs-lisp :tangle ./early-init.el
|
#+begin_src emacs-lisp :tangle ./early-init.el
|
||||||
(setq default-input-method nil)
|
(setq default-input-method nil)
|
||||||
@ -176,13 +174,14 @@ Finish up
|
|||||||
(unless (package-installed-p package)
|
(unless (package-installed-p package)
|
||||||
(package-install package)))
|
(package-install package)))
|
||||||
'(recentf
|
'(recentf
|
||||||
|
benchmark-init
|
||||||
dashboard
|
dashboard
|
||||||
olivetti
|
olivetti
|
||||||
ligature
|
;; ligature
|
||||||
highlight-quoted
|
highlight-quoted
|
||||||
doom-modeline
|
doom-modeline
|
||||||
hydra
|
;; hydra
|
||||||
multiple-cursors
|
;; multiple-cursors
|
||||||
evil
|
evil
|
||||||
evil-collection
|
evil-collection
|
||||||
evil-surround
|
evil-surround
|
||||||
@ -190,7 +189,7 @@ Finish up
|
|||||||
evil-commentary
|
evil-commentary
|
||||||
evil-goggles
|
evil-goggles
|
||||||
all-the-icons-ibuffer
|
all-the-icons-ibuffer
|
||||||
ace-window
|
;; ace-window
|
||||||
popper
|
popper
|
||||||
centaur-tabs
|
centaur-tabs
|
||||||
all-the-icons-completion
|
all-the-icons-completion
|
||||||
@ -202,7 +201,7 @@ Finish up
|
|||||||
all-the-icons-completion
|
all-the-icons-completion
|
||||||
orderless
|
orderless
|
||||||
consult
|
consult
|
||||||
consult-lsp
|
consult-eglot
|
||||||
dirvish
|
dirvish
|
||||||
smtpmail
|
smtpmail
|
||||||
sendmail
|
sendmail
|
||||||
@ -214,12 +213,12 @@ Finish up
|
|||||||
undo-fu-session
|
undo-fu-session
|
||||||
vundo
|
vundo
|
||||||
which-key
|
which-key
|
||||||
company
|
;; company
|
||||||
company
|
mono-complete
|
||||||
lsp-mode
|
;; lsp-mode
|
||||||
lsp-ui
|
;; lsp-ui
|
||||||
flycheck
|
;; flycheck
|
||||||
dap-mode
|
;; dap-mode
|
||||||
rustic
|
rustic
|
||||||
ob-rust
|
ob-rust
|
||||||
typescript-mode
|
typescript-mode
|
||||||
@ -236,18 +235,17 @@ Finish up
|
|||||||
restclient
|
restclient
|
||||||
magit))
|
magit))
|
||||||
|
|
||||||
(package-initialize)
|
|
||||||
(setopt package-vc-selected-packages
|
(setopt package-vc-selected-packages
|
||||||
'((dashboard . "554dc6f")
|
'((doom-themes :url "https://github.com/JosephFerano/doom-themes")))
|
||||||
(doom-themes :url "https://github.com/JosephFerano/doom-themes")))
|
(package-initialize)
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
** Benchmarking
|
** COMMENT Benchmarking
|
||||||
|
|
||||||
This is commented out since it adds ever so slightly to init time, but keep it around in case we
|
This is commented out since it adds ever so slightly to init time, but keep it around in case we
|
||||||
need to benchmark slow init times later.
|
need to benchmark slow init times later.
|
||||||
|
|
||||||
#+begin_src emacs-lisp :tangle no
|
#+begin_src emacs-lisp
|
||||||
(require 'benchmark-init)
|
(require 'benchmark-init)
|
||||||
(add-hook 'after-init-hook 'benchmark-init/deactivate)
|
(add-hook 'after-init-hook 'benchmark-init/deactivate)
|
||||||
#+end_src
|
#+end_src
|
||||||
@ -311,10 +309,39 @@ This shows up when building Emacs;
|
|||||||
#+end_quote
|
#+end_quote
|
||||||
** Visuals
|
** Visuals
|
||||||
*** Initial Buffer
|
*** Initial Buffer
|
||||||
#+begin_src emacs-lisp :tangle no
|
#+begin_src emacs-lisp
|
||||||
(setq initial-buffer-choice "~/.config/emacs/init.org")
|
(defun load-projects ()
|
||||||
|
(with-temp-buffer
|
||||||
|
(insert-file-contents project-list-file)
|
||||||
|
(goto-char (point-min))
|
||||||
|
(apply #'append (read (current-buffer)))))
|
||||||
|
|
||||||
|
(defun my-dashboard ()
|
||||||
|
"Show Welcome buffer"
|
||||||
|
(with-current-buffer (get-buffer-create "*Welcome*")
|
||||||
|
|
||||||
|
(erase-buffer)
|
||||||
|
(goto-char (point-min))
|
||||||
|
(insert-image (create-image "~/Documents/emacs-alt.png"))
|
||||||
|
(insert "\n\n\n")
|
||||||
|
(insert "Welcome to Emacs!\n\n")
|
||||||
|
(let* ((time-str (emacs-init-time))
|
||||||
|
(time (string-to-number (car (split-string time-str)))))
|
||||||
|
(insert (format "It took %.3f seconds to start up\n\n" time)))
|
||||||
|
(insert "Happy hacking!\n\n")
|
||||||
|
(insert "Projects:\n")
|
||||||
|
(dolist (proj (load-projects))
|
||||||
|
(insert (format "\t%s\n" proj)))
|
||||||
|
(setq cursor-type nil)
|
||||||
|
(switch-to-buffer (current-buffer))
|
||||||
|
(goto-char (point-min))
|
||||||
|
(display-line-numbers-mode 0)
|
||||||
|
(read-only-mode +1)))
|
||||||
|
|
||||||
|
(setq initial-buffer-choice #'my-dashboard)
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
*** Dashboard
|
*** COMMENT Dashboard
|
||||||
|
|
||||||
Use Dashboard.el. First load `all-the-icons` for nicer rendering
|
Use Dashboard.el. First load `all-the-icons` for nicer rendering
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
@ -425,9 +452,6 @@ Setup other stuff
|
|||||||
;; Don’t compact font caches during GC, in case doom modeline gets laggy issue
|
;; Don’t compact font caches during GC, in case doom modeline gets laggy issue
|
||||||
(setq inhibit-compacting-font-caches t)
|
(setq inhibit-compacting-font-caches t)
|
||||||
|
|
||||||
(require 'ligature)
|
|
||||||
(global-ligature-mode)
|
|
||||||
|
|
||||||
(require 'highlight-quoted)
|
(require 'highlight-quoted)
|
||||||
(add-hook 'emacs-lisp-mode-hook 'highlight-quoted-mode)
|
(add-hook 'emacs-lisp-mode-hook 'highlight-quoted-mode)
|
||||||
|
|
||||||
@ -447,11 +471,17 @@ Setup other stuff
|
|||||||
(dolist (mode '(dired-mode-hook lsp-help-mode-hook fundamental-mode-hook))
|
(dolist (mode '(dired-mode-hook lsp-help-mode-hook fundamental-mode-hook))
|
||||||
(add-hook mode (lambda () (setq truncate-lines t))))
|
(add-hook mode (lambda () (setq truncate-lines t))))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
Ligatures... are they that useful?
|
||||||
|
#+begin_src emacs-lisp :tangle no
|
||||||
|
(require 'ligature)
|
||||||
|
(global-ligature-mode)
|
||||||
|
#+end_src
|
||||||
** Text
|
** Text
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
;; (set-face-attribute 'default nil :family "Fira Code Nerd Font Mono" :height 110)
|
;; (set-face-attribute 'default nil :family "Fira Code Nerd Font Mono" :height 110)
|
||||||
(set-face-attribute 'default nil :family "Fira Code" :height 110)
|
(set-face-attribute 'default nil :family "FiraCode Nerd Font Mono" :height 110)
|
||||||
;; (set-face-attribute 'variable-pitch nil :family "Source Code Pro" :height 120)
|
;; (set-face-attribute 'variable-pitch nil :family "Source Code Pro" :height 120)
|
||||||
(setq-default c-basic-offset 4) ;; This is annoying
|
(setq-default c-basic-offset 4) ;; This is annoying
|
||||||
(setq-default indent-tabs-mode nil)
|
(setq-default indent-tabs-mode nil)
|
||||||
@ -520,7 +550,7 @@ weren't working, until I randomly saw this in someone's init.el
|
|||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
*** Hydra
|
*** Hydra
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp :tangle no
|
||||||
(require 'hydra)
|
(require 'hydra)
|
||||||
|
|
||||||
(defhydra hydra-navigate (global-map "<f2>")
|
(defhydra hydra-navigate (global-map "<f2>")
|
||||||
@ -536,7 +566,7 @@ weren't working, until I randomly saw this in someone's init.el
|
|||||||
#+end_src
|
#+end_src
|
||||||
*** Multiple Cursors
|
*** Multiple Cursors
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp :tangle no
|
||||||
(require 'multiple-cursors)
|
(require 'multiple-cursors)
|
||||||
#+end_src
|
#+end_src
|
||||||
*** Meow
|
*** Meow
|
||||||
@ -721,6 +751,7 @@ weren't working, until I randomly saw this in someone's init.el
|
|||||||
state))
|
state))
|
||||||
|
|
||||||
(evil-define-key 'normal joe/evil-space-mode-map
|
(evil-define-key 'normal joe/evil-space-mode-map
|
||||||
|
(kbd "K") #'eldoc
|
||||||
(kbd "SPC t") tab-prefix-map
|
(kbd "SPC t") tab-prefix-map
|
||||||
(kbd "SPC p") project-prefix-map
|
(kbd "SPC p") project-prefix-map
|
||||||
(kbd "SPC q") 'kill-buffer-and-window
|
(kbd "SPC q") 'kill-buffer-and-window
|
||||||
@ -772,9 +803,8 @@ weren't working, until I randomly saw this in someone's init.el
|
|||||||
(require 'evil-surround)
|
(require 'evil-surround)
|
||||||
(global-evil-surround-mode t)
|
(global-evil-surround-mode t)
|
||||||
|
|
||||||
;; (require 'evil-snipe)
|
(require 'evil-snipe)
|
||||||
;; (evil-snipe-mode +1)
|
(evil-snipe-override-mode +1)
|
||||||
;; (evil-snipe-override-mode +1)
|
|
||||||
|
|
||||||
(require 'evil-commentary)
|
(require 'evil-commentary)
|
||||||
(evil-commentary-mode t)
|
(evil-commentary-mode t)
|
||||||
@ -843,15 +873,21 @@ The theme of `C-x 4` bindings is that they operate on other windows, so this fun
|
|||||||
(define-key ctl-x-4-map (kbd "-") #'joe/window-split-horizontal)
|
(define-key ctl-x-4-map (kbd "-") #'joe/window-split-horizontal)
|
||||||
(define-key ctl-x-4-map (kbd "t") #'rotate-window)
|
(define-key ctl-x-4-map (kbd "t") #'rotate-window)
|
||||||
|
|
||||||
(require 'ace-window)
|
|
||||||
(global-set-key (kbd "C-x o") #'ace-window)
|
|
||||||
(global-set-key (kbd "C-x C-o") #'ace-swap-window)
|
|
||||||
|
|
||||||
(global-set-key (kbd "s-h") #'windmove-left)
|
(global-set-key (kbd "s-h") #'windmove-left)
|
||||||
(global-set-key (kbd "s-l") #'windmove-right)
|
(global-set-key (kbd "s-l") #'windmove-right)
|
||||||
(global-set-key (kbd "s-k") #'windmove-up)
|
(global-set-key (kbd "s-k") #'windmove-up)
|
||||||
(global-set-key (kbd "s-j") #'windmove-down)
|
(global-set-key (kbd "s-j") #'windmove-down)
|
||||||
|
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
Ace Window will show a hint if there are more than 2 windows, but I don't really use it
|
||||||
|
|
||||||
|
#+begin_src emacs-lisp :tangle no
|
||||||
|
|
||||||
|
(require 'ace-window)
|
||||||
|
(global-set-key (kbd "C-x o") #'ace-window)
|
||||||
|
(global-set-key (kbd "C-x C-o") #'ace-swap-window)
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
*** Popper
|
*** Popper
|
||||||
|
|
||||||
@ -863,7 +899,10 @@ The theme of `C-x 4` bindings is that they operate on other windows, so this fun
|
|||||||
"^\\*Flymake.*" flymake-mode
|
"^\\*Flymake.*" flymake-mode
|
||||||
"^\\*Flycheck.*" flycheck-error-list-mode
|
"^\\*Flycheck.*" flycheck-error-list-mode
|
||||||
"^\\*lsp-help\\*" lsp-help-mode
|
"^\\*lsp-help\\*" lsp-help-mode
|
||||||
|
"^\\*eldoc\\*" special-mode
|
||||||
"^\\*ert\\*" ert-results-mode
|
"^\\*ert\\*" ert-results-mode
|
||||||
|
"^\\*HTTP Response\\*" javascript-mode
|
||||||
|
"^\\*SQL.*" sql-interactive-mode
|
||||||
"^\\*cargo-test\\*" cargo-test-mode
|
"^\\*cargo-test\\*" cargo-test-mode
|
||||||
"^\\*cargo-run\\*" cargo-run-mode
|
"^\\*cargo-run\\*" cargo-run-mode
|
||||||
"^\\*rustic-compilation\\*" rustic-compilation-mode
|
"^\\*rustic-compilation\\*" rustic-compilation-mode
|
||||||
@ -911,15 +950,15 @@ The theme of `C-x 4` bindings is that they operate on other windows, so this fun
|
|||||||
(not (window-in-direction 'left)))
|
(not (window-in-direction 'left)))
|
||||||
(display-buffer-in-direction
|
(display-buffer-in-direction
|
||||||
buffer
|
buffer
|
||||||
`((window-height . 0.4)
|
`((window-height . 0.45)
|
||||||
(window-width . 0.4)
|
(window-width . 0.45)
|
||||||
(direction . right)
|
(direction . right)
|
||||||
(body-function . ,#'select-window))))
|
(body-function . ,#'select-window))))
|
||||||
(t
|
(t
|
||||||
(display-buffer-in-direction
|
(display-buffer-in-direction
|
||||||
buffer
|
buffer
|
||||||
`((window-height . 0.4)
|
`((window-height . 0.45)
|
||||||
(window-width . 0.4)
|
(window-width . 0.45)
|
||||||
(direction . below)
|
(direction . below)
|
||||||
(body-function . ,#'select-window))))))
|
(body-function . ,#'select-window))))))
|
||||||
|
|
||||||
@ -1005,7 +1044,10 @@ The theme of `C-x 4` bindings is that they operate on other windows, so this fun
|
|||||||
Other buffer group by `centaur-tabs-get-group-name' with project name."
|
Other buffer group by `centaur-tabs-get-group-name' with project name."
|
||||||
(list
|
(list
|
||||||
(cond
|
(cond
|
||||||
((derived-mode-p 'comint-mode)
|
((or (derived-mode-p 'comint-mode)
|
||||||
|
(derived-mode-p 'sql-interactive-mode)
|
||||||
|
(string-equal "*HTTP" (substring (buffer-name) 0 5))
|
||||||
|
(derived-mode-p 'compilation-mode))
|
||||||
"REPLs")
|
"REPLs")
|
||||||
((or (string-equal "*" (substring (buffer-name) 0 1))
|
((or (string-equal "*" (substring (buffer-name) 0 1))
|
||||||
(memq major-mode '(magit-process-mode
|
(memq major-mode '(magit-process-mode
|
||||||
@ -1016,9 +1058,6 @@ The theme of `C-x 4` bindings is that they operate on other windows, so this fun
|
|||||||
magit-blob-mode
|
magit-blob-mode
|
||||||
magit-blame-mode)))
|
magit-blame-mode)))
|
||||||
"*Buffers*")
|
"*Buffers*")
|
||||||
((memq major-mode '(helpful-mode
|
|
||||||
help-mode))
|
|
||||||
"Help")
|
|
||||||
(t
|
(t
|
||||||
"Emacs")))))
|
"Emacs")))))
|
||||||
|
|
||||||
@ -1207,7 +1246,7 @@ Vertico Embark Marginalia Consult Orderless
|
|||||||
*** Consult
|
*** Consult
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(require 'consult)
|
(require 'consult)
|
||||||
(require 'consult-lsp)
|
;; (require 'consult-lsp)
|
||||||
|
|
||||||
;; (defun joe/consult-line ()
|
;; (defun joe/consult-line ()
|
||||||
;; (interactive)
|
;; (interactive)
|
||||||
@ -1284,9 +1323,18 @@ Vertico Embark Marginalia Consult Orderless
|
|||||||
(kbd "M-e") #'dirvish-emerge-menu
|
(kbd "M-e") #'dirvish-emerge-menu
|
||||||
(kbd "M-j") #'dirvish-fd-jump)))
|
(kbd "M-j") #'dirvish-fd-jump)))
|
||||||
|
|
||||||
|
;; There's an issue with the keybinding precedence so we need to run this since
|
||||||
|
;; joe/evil-space-mode-map takes precedence above all else and '-' doesn't do
|
||||||
|
;; what it should
|
||||||
|
(defun joe/dirvish-up-dwim ()
|
||||||
|
(interactive)
|
||||||
|
(if (eq major-mode 'dired-mode)
|
||||||
|
(dired-up-directory)
|
||||||
|
(dirvish-dwim)))
|
||||||
|
|
||||||
(when (boundp 'evil-mode)
|
(when (boundp 'evil-mode)
|
||||||
(evil-define-key 'normal joe/evil-space-mode-map (kbd "_") #'project-dired)
|
(evil-define-key 'normal joe/evil-space-mode-map (kbd "_") #'project-dired)
|
||||||
(evil-define-key 'normal joe/evil-space-mode-map (kbd "-") #'dirvish-dwim))
|
(evil-define-key 'normal joe/evil-space-mode-map (kbd "-") #'joe/dirvish-up-dwim))
|
||||||
(global-set-key (kbd "C-x d") #'dirvish-dwim)
|
(global-set-key (kbd "C-x d") #'dirvish-dwim)
|
||||||
(global-set-key (kbd "C-x C-d") #'joe/dirvish-find-directory)
|
(global-set-key (kbd "C-x C-d") #'joe/dirvish-find-directory)
|
||||||
|
|
||||||
@ -1409,47 +1457,37 @@ startup. Reason we have to call this is so the vterm fucntion can call `vterm--i
|
|||||||
(evil-define-key 'insert comint-mode-map (kbd "C-n") 'comint-next-input)
|
(evil-define-key 'insert comint-mode-map (kbd "C-n") 'comint-next-input)
|
||||||
(evil-define-key 'insert comint-mode-map (kbd "C-p") 'comint-previous-input))
|
(evil-define-key 'insert comint-mode-map (kbd "C-p") 'comint-previous-input))
|
||||||
#+end_src
|
#+end_src
|
||||||
*** Company
|
*** Mono-complete
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
|
;; (evil-global-set-key 'insert (kbd "C-f") #'mono-complete-expand)
|
||||||
|
(require 'mono-complete)
|
||||||
|
(evil-global-set-key 'insert (kbd "M-/") #'mono-complete-expand-or-fallback)
|
||||||
|
(setq mono-complete-backends (list 'dabbrev 'filesystem))
|
||||||
|
(setq mono-complete-backends (list 'capf 'dabbrev 'filesystem))
|
||||||
|
|
||||||
(setq completion-in-region-function
|
(setq mono-complete-backend-capf-complete-fn #'eglot-completion-at-point)
|
||||||
(lambda (&rest args)
|
(setq mono-complete-preview-delay 0.1)
|
||||||
(apply (if vertico-mode
|
|
||||||
#'consult-completion-in-region
|
|
||||||
#'completion--in-region)
|
|
||||||
args)))
|
|
||||||
|
|
||||||
(require 'company)
|
(add-to-list 'face-remapping-alist '(mono-complete-preview-face . shadow))
|
||||||
|
(mono-complete-mode +1)
|
||||||
(with-eval-after-load 'company
|
#+end_src
|
||||||
(add-to-list 'completion-at-point-functions #'elisp-completion-at-point)
|
*** Eldoc
|
||||||
(require 'company)
|
#+begin_src emacs-lisp
|
||||||
(setq company-minimum-prefix-length 1)
|
(evil-global-set-key 'normal (kbd "K") #'eldoc)
|
||||||
(setq company-tooltip-align-annotations t)
|
(global-eldoc-mode -1)
|
||||||
(setq company-minimum-prefix-length 2)
|
|
||||||
(define-key company-active-map (kbd "C-n") nil)
|
|
||||||
(define-key company-active-map (kbd "C-p") nil)
|
|
||||||
(define-key company-active-map (kbd "<return>") nil)
|
|
||||||
(define-key company-active-map (kbd "RET") nil)
|
|
||||||
(define-key company-active-map (kbd "M-d") #'company-show-doc-buffer)
|
|
||||||
(define-key company-active-map (kbd "C-f") #'company-complete-selection)
|
|
||||||
(define-key company-active-map [tab] #'company-complete-common-or-cycle)
|
|
||||||
(define-key company-active-map (kbd "<backtab>") (lambda () (interactive) (company-complete-common-or-cycle -1)))
|
|
||||||
|
|
||||||
(setq company-idle-delay 0.15
|
|
||||||
company-tooltip-idle-delay 20
|
|
||||||
company-require-match nil
|
|
||||||
company-frontends '(company-preview-frontend company-echo-metadata-frontend)
|
|
||||||
;; company-frontends
|
|
||||||
;; '(company-pseudo-tooltip-unless-just-one-frontend
|
|
||||||
;; company-echo-metadata-frontend)
|
|
||||||
company-backends '((company-capf company-elisp company-files)))
|
|
||||||
(setq company-transformers '(company-sort-by-occurrence))
|
|
||||||
(global-company-mode))
|
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
*** LSP
|
*** Eglot
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(with-eval-after-load 'eglot
|
||||||
|
(global-eldoc-mode -1)
|
||||||
|
(flymake-mode -1)
|
||||||
|
(when (boundp 'evil-mode)
|
||||||
|
;; (evil-global-set-key 'normal (kbd "M-d") #'lsp-describe-thing-at-point)
|
||||||
|
(evil-global-set-key 'normal (kbd "SPC li") 'eglot-inlay-hints-mode)
|
||||||
|
(evil-global-set-key 'normal (kbd "<leader>cs") 'consult-eglot-symbols)))
|
||||||
|
#+end_src
|
||||||
|
*** COMMENT LSP
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(require 'lsp-mode)
|
(require 'lsp-mode)
|
||||||
(setq lsp-enable-which-key-integration t)
|
(setq lsp-enable-which-key-integration t)
|
||||||
@ -1472,10 +1510,11 @@ startup. Reason we have to call this is so the vterm fucntion can call `vterm--i
|
|||||||
(setq lsp-signature-render-documentation nil)
|
(setq lsp-signature-render-documentation nil)
|
||||||
(setq lsp-eldoc-render-all nil)
|
(setq lsp-eldoc-render-all nil)
|
||||||
|
|
||||||
|
;; All this changes because we are using eglot now
|
||||||
(when (boundp 'evil-mode)
|
(when (boundp 'evil-mode)
|
||||||
(evil-global-set-key 'normal (kbd "M-d") #'lsp-describe-thing-at-point)
|
(evil-global-set-key 'normal (kbd "M-d") #'lsp-describe-thing-at-point)
|
||||||
(evil-global-set-key 'normal (kbd "<leader>lh") 'lsp-headerline-breadcrumb-mode)
|
(evil-global-set-key 'normal (kbd "<leader>lh") 'lsp-headerline-breadcrumb-mode)
|
||||||
(evil-global-set-key 'normal (kbd "<leader>li") 'lsp-rust-analyzer-inlay-hints-mode)
|
(evil-global-set-key 'normal (kbd "SPC li") 'lsp-rust-analyzer-inlay-hints-mode)
|
||||||
(evil-global-set-key 'normal (kbd "<leader>cs") 'consult-lsp-symbols)
|
(evil-global-set-key 'normal (kbd "<leader>cs") 'consult-lsp-symbols)
|
||||||
(evil-global-set-key 'normal (kbd "<leader>cf") 'consult-lsp-file-symbols))
|
(evil-global-set-key 'normal (kbd "<leader>cf") 'consult-lsp-file-symbols))
|
||||||
|
|
||||||
@ -1496,7 +1535,7 @@ startup. Reason we have to call this is so the vterm fucntion can call `vterm--i
|
|||||||
(require 'lsp-ui)
|
(require 'lsp-ui)
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
*** Flycheck
|
*** COMMENT Flycheck
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(require 'flycheck)
|
(require 'flycheck)
|
||||||
@ -1556,7 +1595,7 @@ startup. Reason we have to call this is so the vterm fucntion can call `vterm--i
|
|||||||
(add-hook 'compilation-finish-functions 'joe/close-compilation-if-no-warn-err)
|
(add-hook 'compilation-finish-functions 'joe/close-compilation-if-no-warn-err)
|
||||||
#+end_src
|
#+end_src
|
||||||
** Debugging
|
** Debugging
|
||||||
*** DAP
|
*** COMMENT DAP
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(require 'dap-mode)
|
(require 'dap-mode)
|
||||||
;; (setq dap-auto-configure-features '(locals breakpoints expressions tooltip))
|
;; (setq dap-auto-configure-features '(locals breakpoints expressions tooltip))
|
||||||
@ -1630,12 +1669,35 @@ startup. Reason we have to call this is so the vterm fucntion can call `vterm--i
|
|||||||
*** Elisp
|
*** Elisp
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(global-set-key (kbd "C-x C-r") 'eval-region)
|
(global-set-key (kbd "C-x C-r") 'eval-region)
|
||||||
|
(evil-define-key 'insert emacs-lisp-mode-map (kbd "C-j") 'eval-print-last-sexp)
|
||||||
#+end_src
|
#+end_src
|
||||||
*** Web
|
*** Web
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(require 'typescript-mode)
|
(require 'typescript-mode)
|
||||||
(setq typescript-indent-level 2)
|
(setq typescript-indent-level 2)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
*** SQL
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(defun joe/mark-sql-defun ()
|
||||||
|
"Mark the current SQL function definition."
|
||||||
|
(interactive)
|
||||||
|
(let ((beg (save-excursion
|
||||||
|
(re-search-backward "^create or replace function [^(]+" nil t)
|
||||||
|
(match-end 0)))
|
||||||
|
(end (save-excursion
|
||||||
|
(re-search-forward "\\(language\\)" nil t)
|
||||||
|
(line-end-position))))
|
||||||
|
(when (and beg end)
|
||||||
|
(goto-char beg)
|
||||||
|
(set-mark end)))
|
||||||
|
(evil-visual-line)
|
||||||
|
(evil-visual-line))
|
||||||
|
(with-eval-after-load 'sql-mode
|
||||||
|
(define-key sql-mode-map (kbd "C-M-h") #'joe/mark-sql-defun)
|
||||||
|
(define-key sql-mode-map (kbd "<f8>") #'sql-connect)
|
||||||
|
(define-key sql-mode-map (kbd "<f8>") #'sql-connect))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
*** C
|
*** C
|
||||||
|
|
||||||
Design some basic functions for compiling. There's also a hook to close the popper window if there
|
Design some basic functions for compiling. There's also a hook to close the popper window if there
|
||||||
@ -1756,6 +1818,7 @@ and there's no need for a middle-man when it's already been implemented.
|
|||||||
(add-to-list 'org-structure-template-alist '("rs" . "src rust"))
|
(add-to-list 'org-structure-template-alist '("rs" . "src rust"))
|
||||||
(add-to-list 'org-structure-template-alist '("py" . "src python"))
|
(add-to-list 'org-structure-template-alist '("py" . "src python"))
|
||||||
(add-to-list 'org-structure-template-alist '("hs" . "src haskell"))
|
(add-to-list 'org-structure-template-alist '("hs" . "src haskell"))
|
||||||
|
(add-to-list 'org-structure-template-alist '("sh" . "src shell"))
|
||||||
(add-to-list 'org-structure-template-alist '("cc" . "src C :includes stdio.h stdlib.h"))
|
(add-to-list 'org-structure-template-alist '("cc" . "src C :includes stdio.h stdlib.h"))
|
||||||
(setq org-edit-src-content-indentation 0))
|
(setq org-edit-src-content-indentation 0))
|
||||||
(with-eval-after-load 'org (joe/org-init))
|
(with-eval-after-load 'org (joe/org-init))
|
||||||
|
@ -14,6 +14,7 @@ set -gx MANPAGER "sh -c 'col -bx | bat -l man -p'"
|
|||||||
set -gx DOTNET_CLI_TELEMETRY_OPTOUT 1
|
set -gx DOTNET_CLI_TELEMETRY_OPTOUT 1
|
||||||
|
|
||||||
bind \cx 'if test -z (commandline) ; fg %1 &>/dev/null; else ; clear; commandline "╰─>$ "; end'
|
bind \cx 'if test -z (commandline) ; fg %1 &>/dev/null; else ; clear; commandline "╰─>$ "; end'
|
||||||
|
bind \e/ accept-autosuggestion
|
||||||
|
|
||||||
abbr -a -g gs "git status --untracked-files"
|
abbr -a -g gs "git status --untracked-files"
|
||||||
abbr -a -g gl "git lop -10"
|
abbr -a -g gl "git lop -10"
|
||||||
@ -37,13 +38,13 @@ abbr -a -g gf "git fetch"
|
|||||||
abbr -a -g grh "git reset --hard"
|
abbr -a -g grh "git reset --hard"
|
||||||
abbr -a -g gcl "git clean -fd"
|
abbr -a -g gcl "git clean -fd"
|
||||||
abbr -a -g gd "git diff"
|
abbr -a -g gd "git diff"
|
||||||
|
abbr -a -g gb "git branch"
|
||||||
|
abbr -a -g gba "git branch -a"
|
||||||
# abbr -a -g gpu "git push -u origin"
|
# abbr -a -g gpu "git push -u origin"
|
||||||
# abbr -a -g glp "git lfs pull"
|
# abbr -a -g glp "git lfs pull"
|
||||||
# abbr -a -g glm "gss git merge ; glp"
|
# abbr -a -g glm "gss git merge ; glp"
|
||||||
# abbr -a -g gdh "git diff HEAD"
|
# abbr -a -g gdh "git diff HEAD"
|
||||||
# abbr -a -g gms "git merge --squash"
|
# abbr -a -g gms "git merge --squash"
|
||||||
# abbr -a -g gb "git branch"
|
|
||||||
# abbr -a -g gba "git branch -a"
|
|
||||||
# abbr -a -g gr "git rebase"
|
# abbr -a -g gr "git rebase"
|
||||||
# abbr -a -g gst "git stash"
|
# abbr -a -g gst "git stash"
|
||||||
# abbr -a -g gsl "git stash list"
|
# abbr -a -g gsl "git stash list"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user