more emacs tweaks
This commit is contained in:
parent
2d1a11ea40
commit
a3412c9fdf
@ -1,7 +1,9 @@
|
|||||||
;;; -*- lexical-binding: t; -*-
|
;;; -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
(global-set-key (kbd "C-c f") #'consult-fd)
|
(global-set-key (kbd "C-c f") #'consult-fd)
|
||||||
|
(global-set-key (kbd "C-c C-f") #'find-file-at-point)
|
||||||
(global-set-key (kbd "C-c r") #'recentf)
|
(global-set-key (kbd "C-c r") #'recentf)
|
||||||
|
(global-set-key (kbd "C-c 0") (lambda () (interactive) (other-window 1) (kill-buffer-and-window)))
|
||||||
(global-set-key (kbd "C-c g") #'consult-ripgrep)
|
(global-set-key (kbd "C-c g") #'consult-ripgrep)
|
||||||
(global-set-key (kbd "C-c i") #'consult-info)
|
(global-set-key (kbd "C-c i") #'consult-info)
|
||||||
(global-set-key (kbd "C-c s") #'ispell-word)
|
(global-set-key (kbd "C-c s") #'ispell-word)
|
||||||
@ -18,7 +20,7 @@
|
|||||||
(global-set-key (kbd "C-c l D") #'eglot-find-declaration)
|
(global-set-key (kbd "C-c l D") #'eglot-find-declaration)
|
||||||
(global-set-key (kbd "C-c l i") #'eglot-find-implementation)
|
(global-set-key (kbd "C-c l i") #'eglot-find-implementation)
|
||||||
(global-set-key (kbd "C-c l t") #'eglot-find-typeDefinition)
|
(global-set-key (kbd "C-c l t") #'eglot-find-typeDefinition)
|
||||||
(global-set-key (kbd "C-x C-;") (lambda () (interactive) (if (region-active-p) (comment-region) (comment-line))))
|
;; (global-set-key (kbd "C-x C-;") (lambda () (interactive) (if (region-active-p) (comment-region) (comment-line))))
|
||||||
|
|
||||||
(global-set-key (kbd "C-c b") #'ibuffer)
|
(global-set-key (kbd "C-c b") #'ibuffer)
|
||||||
(global-set-key (kbd "C-c x") #'kill-current-buffer)
|
(global-set-key (kbd "C-c x") #'kill-current-buffer)
|
||||||
@ -26,7 +28,7 @@
|
|||||||
(global-set-key (kbd "C-c k") #'eldoc)
|
(global-set-key (kbd "C-c k") #'eldoc)
|
||||||
(global-set-key (kbd "C-c m") #'man)
|
(global-set-key (kbd "C-c m") #'man)
|
||||||
(global-set-key (kbd "C-c o c") (lambda () (interactive) (dired user-init-dir)))
|
(global-set-key (kbd "C-c o c") (lambda () (interactive) (dired user-init-dir)))
|
||||||
(global-set-key (kbd "C-c o t") #'eshell)
|
(global-set-key (kbd "C-c o t") (lambda () (interactive) (eshell 'N)))
|
||||||
(global-set-key (kbd "C-c o m") #'magit)
|
(global-set-key (kbd "C-c o m") #'magit)
|
||||||
|
|
||||||
;; multi-cursor
|
;; multi-cursor
|
||||||
|
|||||||
@ -50,6 +50,13 @@
|
|||||||
:defer t
|
:defer t
|
||||||
:straight '(:type git :host github :repo "nemethf/eglot-x"))
|
:straight '(:type git :host github :repo "nemethf/eglot-x"))
|
||||||
|
|
||||||
|
(use-package sly
|
||||||
|
:ensure t
|
||||||
|
:defer t
|
||||||
|
:hook common-lisp-mode
|
||||||
|
:config
|
||||||
|
(setq inferior-lisp-program "sbcl"))
|
||||||
|
|
||||||
(dolist (mode '(c-ts-mode-hook
|
(dolist (mode '(c-ts-mode-hook
|
||||||
rust-ts-mode-hook
|
rust-ts-mode-hook
|
||||||
odin-ts-mode-hook
|
odin-ts-mode-hook
|
||||||
|
|||||||
@ -94,11 +94,48 @@
|
|||||||
;; (vertico-count 20) ;; Show more candidates
|
;; (vertico-count 20) ;; Show more candidates
|
||||||
;; (vertico-resize t) ;; Grow and shrink the Vertico minibuffer
|
;; (vertico-resize t) ;; Grow and shrink the Vertico minibuffer
|
||||||
(vertico-cycle t) ;; Enable cycling for `vertico-next/previous'
|
(vertico-cycle t) ;; Enable cycling for `vertico-next/previous'
|
||||||
(vertico-multiform-mode)
|
|
||||||
:init
|
:init
|
||||||
|
(vertico-multiform-mode)
|
||||||
(vertico-mode)
|
(vertico-mode)
|
||||||
(define-key vertico-map (kbd "DEL") #'vertico-directory-delete-char))
|
(define-key vertico-map (kbd "DEL") #'vertico-directory-delete-char))
|
||||||
|
|
||||||
|
(defvar +vertico-transform-functions nil)
|
||||||
|
|
||||||
|
(cl-defmethod vertico--format-candidate :around
|
||||||
|
(cand prefix suffix index start &context ((not +vertico-transform-functions) null))
|
||||||
|
(dolist (fun (ensure-list +vertico-transform-functions))
|
||||||
|
(setq cand (funcall fun cand)))
|
||||||
|
(cl-call-next-method cand prefix suffix index start))
|
||||||
|
|
||||||
|
(defun +vertico-highlight-directory (file)
|
||||||
|
"If FILE ends with a slash, highlight it as a directory."
|
||||||
|
(if (string-suffix-p "/" file)
|
||||||
|
(propertize file 'face 'marginalia-file-priv-dir) ; or face 'dired-directory
|
||||||
|
file))
|
||||||
|
|
||||||
|
;; function to highlight enabled modes similar to counsel-M-x
|
||||||
|
(defun +vertico-highlight-enabled-mode (cmd)
|
||||||
|
"If MODE is enabled, highlight it as font-lock-constant-face."
|
||||||
|
(let ((sym (intern cmd)))
|
||||||
|
(if (or (eq sym major-mode)
|
||||||
|
(and
|
||||||
|
(memq sym minor-mode-list)
|
||||||
|
(boundp sym)))
|
||||||
|
(propertize cmd 'face 'font-lock-constant-face)
|
||||||
|
cmd)))
|
||||||
|
|
||||||
|
;; add-to-list works if 'file isn't already in the alist
|
||||||
|
;; setq can be used but will overwrite all existing values
|
||||||
|
(add-to-list 'vertico-multiform-categories
|
||||||
|
'(file
|
||||||
|
;; this is also defined in the wiki, uncomment if used
|
||||||
|
;; (vertico-sort-function . vertico-sort-directories-first)
|
||||||
|
(+vertico-transform-functions . +vertico-highlight-directory)))
|
||||||
|
(add-to-list 'vertico-multiform-commands
|
||||||
|
'(execute-extended-command
|
||||||
|
(+vertico-transform-functions . +vertico-highlight-enabled-mode)))
|
||||||
|
|
||||||
|
|
||||||
;; Enable rich annotations using the Marginalia package
|
;; Enable rich annotations using the Marginalia package
|
||||||
(use-package marginalia
|
(use-package marginalia
|
||||||
;; Bind `marginalia-cycle' locally in the minibuffer. To make the binding
|
;; Bind `marginalia-cycle' locally in the minibuffer. To make the binding
|
||||||
|
|||||||
@ -91,7 +91,7 @@
|
|||||||
(use-package parinfer-rust-mode
|
(use-package parinfer-rust-mode
|
||||||
:ensure t
|
:ensure t
|
||||||
:defer t
|
:defer t
|
||||||
:hook emacs-lisp-mode
|
:hook ((emacs-lisp-mode common-lisp-mode lisp-mode scheme-mode) . parinfer-rust-mode)
|
||||||
:config
|
:config
|
||||||
(electric-pair-mode -1))
|
(electric-pair-mode -1))
|
||||||
|
|
||||||
@ -99,5 +99,11 @@
|
|||||||
:ensure t
|
:ensure t
|
||||||
:defer t)
|
:defer t)
|
||||||
|
|
||||||
|
;; (use-package zoxide
|
||||||
|
;; :ensure t
|
||||||
|
;; :defer t
|
||||||
|
;; :hook eshell-mode
|
||||||
|
;; :straight '(:type git host: sourcehut :repo "vonfry/zoxide.el"))
|
||||||
|
|
||||||
(provide 'utils)
|
(provide 'utils)
|
||||||
;;; utils.el ends here
|
;;; utils.el ends here
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user