diff --git a/.config/emacs/init.el b/.config/emacs/init.el index 3bf36c3..c21c56c 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -101,30 +101,31 @@ (menu-bar-mode -1) (tool-bar-mode -1) (scroll-bar-mode -1) -(cua-mode 1) (set-fringe-mode '(2 . 0)) ;;; rhjr/packages (use-package magit :defer t) +(use-package dabbrev + :defer t) + (use-package corfu - ;; Optional customizations - ;; :custom - ;; (corfu-cycle t) ;; Enable cycling for `corfu-next/previous' - ;; (corfu-quit-at-boundary nil) ;; Never quit at completion boundary - ;; (corfu-quit-no-match nil) ;; Never quit, even if there is no match - ;; (corfu-preview-current nil) ;; Disable current candidate preview - ;; (corfu-preselect 'prompt) ;; Preselect the prompt - ;; (corfu-on-exact-match 'insert) ;; Configure handling of exact matches + :custom + (corfu-auto t) + (corfu-cycle t) + (corfu-preview-current nil) + + :bind + (:map corfu-map + ("TAB" . corfu-next) + ([tab] . corfu-next) + ("S-TAB" . corfu-previous) + ([backtab] . corfu-previous)) :init (global-corfu-mode) - - ;; Enable optional extension modes: - ;; (corfu-history-mode) - ;; (corfu-popupinfo-mode) - ) + (corfu-history-mode)) (use-package consult :bind (("C-x b" . consult-buffer) @@ -211,27 +212,34 @@ ;; useful beyond Corfu. (read-extended-command-predicate #'command-completion-default-include-p)) -(use-package dabbrev - ;; Swap M-/ and C-M-/ - :bind (("M-/" . dabbrev-completion) - ("C-M-/" . dabbrev-expand)) - :config - (add-to-list 'dabbrev-ignored-buffer-regexps "\\` ") - (add-to-list 'dabbrev-ignored-buffer-modes 'authinfo-mode) - (add-to-list 'dabbrev-ignored-buffer-modes 'doc-view-mode) - (add-to-list 'dabbrev-ignored-buffer-modes 'pdf-view-mode) - (add-to-list 'dabbrev-ignored-buffer-modes 'tags-table-mode)) - ;;; rhjr/keybindings -(global-unset-key (kbd "C-y")) ;; redundant due to cua-mode -(global-unset-key (kbd "C-w")) -(global-unset-key (kbd "M-w")) -(global-unset-key (kbd "C-x u")) - (global-set-key (kbd "C-x C-g") 'bookmark-jump) -(global-set-key (kbd "C-z") 'undo) ;;; rhjr/programming +(defconst rhjr/c-style + `((c-basic-offset . 2) + (c-offsets-alist . + ((statement . 0) + (statement-cont . 0) + (substatement-open . 0) + (arglist-intro . 2) + (case-label . 2) + (label . 0)) + ) + + )) + +(defun rhjr/set-c-style () + "" + (interactive) + (setq tab-width 2 + indent-tabs-mode nil) + + (c-add-style "rhjr/c-style" rhjr/c-style t) + (c-set-style "rhjr/c-style")) + +(add-hook 'c-mode-common-hook #'rhjr/set-c-style) + (setq-default show-trailing-whitespace t) (add-hook 'before-save-hook 'delete-trailing-whitespace) @@ -240,10 +248,11 @@ ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. - '(package-selected-packages '(cape vertico orderless magit esup corfu consult))) + '(package-selected-packages + '(cape consult corfu corfu-candidate-overlay magit orderless vertico))) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. -) \ No newline at end of file + )