feat(emacs): include early init
This commit is contained in:
parent
3866005db4
commit
6fe111be02
1
dots/.config/emacs/.gitignore
vendored
1
dots/.config/emacs/.gitignore
vendored
@ -2,3 +2,4 @@
|
|||||||
!.gitignore
|
!.gitignore
|
||||||
!init.el
|
!init.el
|
||||||
!lisp
|
!lisp
|
||||||
|
!early-init.el
|
||||||
|
1
dots/.config/emacs/early-init.el
Normal file
1
dots/.config/emacs/early-init.el
Normal file
@ -0,0 +1 @@
|
|||||||
|
(set-face-attribute 'default nil :family "FiraCode Nerd Font" :height 120)
|
@ -56,6 +56,7 @@
|
|||||||
(general-create-definer key-local-leader
|
(general-create-definer key-local-leader
|
||||||
:prefix ";")
|
:prefix ";")
|
||||||
|
|
||||||
|
|
||||||
(key-leader
|
(key-leader
|
||||||
:states 'normal
|
:states 'normal
|
||||||
"/" '(comment-line :which-key "Comment: Toggle Current Line")
|
"/" '(comment-line :which-key "Comment: Toggle Current Line")
|
||||||
@ -87,6 +88,13 @@
|
|||||||
(general-def
|
(general-def
|
||||||
"<escape>" #'keyboard-escape-quit)
|
"<escape>" #'keyboard-escape-quit)
|
||||||
|
|
||||||
|
|
||||||
|
;; Ensure emacs paths load the same as our shell
|
||||||
|
(use-package exec-path-from-shell
|
||||||
|
:config
|
||||||
|
(when (memq window-system '(mac ns x))
|
||||||
|
(exec-path-from-shell-initialize)))
|
||||||
|
|
||||||
;; Which key to hint key bindings
|
;; Which key to hint key bindings
|
||||||
(use-package which-key
|
(use-package which-key
|
||||||
:defer nil
|
:defer nil
|
||||||
@ -174,10 +182,10 @@
|
|||||||
(which-key-allow-evil-operators t)
|
(which-key-allow-evil-operators t)
|
||||||
(evil-undo-system 'undo-redo)
|
(evil-undo-system 'undo-redo)
|
||||||
(evil-want-fine-undo t)
|
(evil-want-fine-undo t)
|
||||||
(evil-show-paren-range 1000)
|
|
||||||
:config
|
:config
|
||||||
(evil-mode 1))
|
(evil-mode 1))
|
||||||
|
|
||||||
|
|
||||||
(use-package evil-surround
|
(use-package evil-surround
|
||||||
:config
|
:config
|
||||||
(global-evil-surround-mode 1))
|
(global-evil-surround-mode 1))
|
||||||
@ -465,12 +473,8 @@
|
|||||||
register-preview-function #'consult-register-format
|
register-preview-function #'consult-register-format
|
||||||
xref-show-xrefs-function #'consult-xref
|
xref-show-xrefs-function #'consult-xref
|
||||||
xref-show-definitions-function #'consult-xref
|
xref-show-definitions-function #'consult-xref
|
||||||
completion-in-region-function (lambda (&rest args)
|
consult-narrow-key "<"
|
||||||
(apply (if vertico-mode
|
completion-in-region-function #'consult-completion-in-region)
|
||||||
#'consult-completion-in-region
|
|
||||||
#'completion--in-region)
|
|
||||||
args))
|
|
||||||
consult-narrow-key "<")
|
|
||||||
:general
|
:general
|
||||||
(key-leader
|
(key-leader
|
||||||
:states 'normal
|
:states 'normal
|
||||||
@ -480,7 +484,6 @@
|
|||||||
"c r" '(consult-recent-file :which-key "Consult: Recent Files")))
|
"c r" '(consult-recent-file :which-key "Consult: Recent Files")))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;; Persist history over Emacs restarts. Vertico sorts by history position.
|
;; Persist history over Emacs restarts. Vertico sorts by history position.
|
||||||
(use-package savehist
|
(use-package savehist
|
||||||
:elpaca nil
|
:elpaca nil
|
||||||
@ -533,11 +536,56 @@
|
|||||||
:config
|
:config
|
||||||
(rainbow-mode t))
|
(rainbow-mode t))
|
||||||
|
|
||||||
|
;; Setup Language Servers
|
||||||
|
|
||||||
|
(general-create-definer key-lsp-leader
|
||||||
|
:prefix "SPC l")
|
||||||
|
|
||||||
|
(use-package lsp-mode
|
||||||
|
:init
|
||||||
|
;; set prefix for lsp-command-keymap (few alternatives - "C-l", "C-c l")
|
||||||
|
(setq lsp-keymap-prefix "SPC l")
|
||||||
|
:hook (;; replace XXX-mode with concrete major-mode(e. g. python-mode)
|
||||||
|
;; (XXX-mode . lsp)
|
||||||
|
;; if you want which-key integration
|
||||||
|
(lsp-mode . lsp-enable-which-key-integration))
|
||||||
|
:commands lsp)
|
||||||
|
|
||||||
|
;; optionally
|
||||||
|
(use-package lsp-ui :commands lsp-ui-mode)
|
||||||
|
|
||||||
|
;; optionally if you want to use debugger
|
||||||
|
(use-package dap-mode
|
||||||
|
:config
|
||||||
|
(require 'dap-cpptools)
|
||||||
|
(require 'dap-gdb-lldb)
|
||||||
|
(dap-register-debug-template "Rust::GDB Run Configuration"
|
||||||
|
(list :type "gdb"
|
||||||
|
:request "launch"
|
||||||
|
:name "GDB::Run"
|
||||||
|
:gdbpath "rust-gdb"
|
||||||
|
:target nil
|
||||||
|
:cwd nil))
|
||||||
|
(dap-ui-mode)
|
||||||
|
(dap-tooltip-mode)
|
||||||
|
(dap-ui-controls-mode)
|
||||||
|
(dap-mode))
|
||||||
|
|
||||||
|
|
||||||
|
;; (use-package dap-LANGUAGE) to load the dap adapter for your language
|
||||||
|
|
||||||
|
;; Rust integration
|
||||||
|
(use-package rustic
|
||||||
|
:general
|
||||||
|
(key-lsp-leader
|
||||||
|
:states 'normal))
|
||||||
|
;; "f r" ((rustic-cargo-run) :which-key "Cargo: Run")))
|
||||||
|
|
||||||
;; Opacity
|
;; Opacity
|
||||||
(menu-bar-mode -1) ; Disable menubar
|
(menu-bar-mode -1) ; Disable menubar
|
||||||
(scroll-bar-mode -1) ; Disable visible scrollbar
|
(scroll-bar-mode -1) ; Disable visible scrollbar
|
||||||
(tool-bar-mode -1) ; Disable toolbar
|
(tool-bar-mode -1) ; Disable toolbar
|
||||||
(tooltip-mode -1) ; Disable tooltips
|
(tooltip-mode) ; Enable tooltips
|
||||||
(set-fringe-mode 10) ; Breathing room
|
(set-fringe-mode 10) ; Breathing room
|
||||||
(setq visible-bell t) ; Enable visible bell
|
(setq visible-bell t) ; Enable visible bell
|
||||||
(blink-cursor-mode 0) ; Disable blinking cursor
|
(blink-cursor-mode 0) ; Disable blinking cursor
|
||||||
|
Loading…
Reference in New Issue
Block a user