nixos-janne/home-manager/emacs.el

65 lines
1.8 KiB
EmacsLisp

; Aesthetics
(use-package material-theme)
(load-theme 'material t)
(menu-bar-mode -1)
(tool-bar-mode -1)
(add-to-list 'default-frame-alist
'(vertical-scroll-bars . nil))
;; Window navigation
(windmove-default-keybindings)
;; Autocompletion with vertico
(use-package vertico
:custom
(vertico-count 20) ;; limit to a fixed size
:bind (:map vertico-map
;; Use page-up/down to scroll vertico buffer, like ivy does by default.
("<prior>" . 'vertico-scroll-down)
("<next>" . 'vertico-scroll-up))
:init
;; Activate vertico
(vertico-mode))
;; Convenient path selection
(use-package vertico-directory
:after vertico
:ensure nil ;; no need to install, it comes with vertico
:bind (:map vertico-map
("DEL" . vertico-directory-delete-char)))
(use-package orderless
:custom
;; Activate orderless completion
(completion-styles '(orderless basic))
;; Enable partial completion for file wildcard support
(completion-category-overrides '((file (styles partial-completion)))))
(use-package consult
:custom
;; Disable preview
(consult-preview-key nil)
:bind
(("C-x b" . 'consult-buffer) ;; Switch buffer, including recentf and bookmarks
("M-l" . 'consult-git-grep) ;; Search inside a project
("M-y" . 'consult-yank-pop) ;; Paste by selecting the kill-ring
("M-s" . 'consult-line) ;; Search current buffer, like swiper
))
(use-package embark
:bind
(("C-." . embark-act) ;; Begin the embark process
("C-;" . embark-dwim) ;; good alternative: M-.
("C-h B" . embark-bindings)) ;; alternative for `describe-bindings'
:config
(use-package embark-consult))
;; eglot
(require 'eglot)
(add-hook 'c-mode-hook 'eglot-ensure)
(add-hook 'c++-mode-hook 'eglot-ensure)
(add-hook 'c-or-c++-mode-hook 'eglot-ensure)
;; ORG-MODE
(setq org-replace-disputed-keys t)