customizing
This commit is contained in:
68
init.el
68
init.el
@@ -215,7 +215,7 @@
|
|||||||
(create-lockfiles nil) ;; Prevent the creation of lock files when editing.
|
(create-lockfiles nil) ;; Prevent the creation of lock files when editing.
|
||||||
(delete-by-moving-to-trash t) ;; Move deleted files to the trash instead of permanently deleting them.
|
(delete-by-moving-to-trash t) ;; Move deleted files to the trash instead of permanently deleting them.
|
||||||
(delete-selection-mode 1) ;; Enable replacing selected text with typed text.
|
(delete-selection-mode 1) ;; Enable replacing selected text with typed text.
|
||||||
(display-line-numbers-type 'relative) ;; Use relative line numbering in programming modes.
|
(display-line-numbers-type 'absolute) ;; Use absolute line numbering in programming modes.
|
||||||
(global-auto-revert-non-file-buffers t) ;; Automatically refresh non-file buffers.
|
(global-auto-revert-non-file-buffers t) ;; Automatically refresh non-file buffers.
|
||||||
(history-length 25) ;; Set the length of the command history.
|
(history-length 25) ;; Set the length of the command history.
|
||||||
(indent-tabs-mode nil) ;; Disable the use of tabs for indentation (use spaces instead).
|
(indent-tabs-mode nil) ;; Disable the use of tabs for indentation (use spaces instead).
|
||||||
@@ -252,10 +252,10 @@
|
|||||||
;; Configure font settings based on the operating system.
|
;; Configure font settings based on the operating system.
|
||||||
;; Ok, this kickstart is meant to be used on the terminal, not on GUI.
|
;; Ok, this kickstart is meant to be used on the terminal, not on GUI.
|
||||||
;; But without this, I fear you could start Graphical Emacs and be sad :(
|
;; But without this, I fear you could start Graphical Emacs and be sad :(
|
||||||
(set-face-attribute 'default nil :family "JetBrainsMono Nerd Font" :height 100)
|
(set-face-attribute 'default nil :family "JetBrainsMono NFM" :height 150)
|
||||||
(when (eq system-type 'darwin) ;; Check if the system is macOS.
|
(when (eq system-type 'darwin) ;; Check if the system is macOS.
|
||||||
(setq mac-command-modifier 'meta) ;; Set the Command key to act as the Meta key.
|
(setq mac-command-modifier 'meta) ;; Set the Command key to act as the Meta key.
|
||||||
(set-face-attribute 'default nil :family "JetBrainsMono Nerd Font" :height 130))
|
(set-face-attribute 'default nil :family "JetBrainsMono NFM" :height 150))
|
||||||
|
|
||||||
;; Save manual customizations to a separate file instead of cluttering `init.el'.
|
;; Save manual customizations to a separate file instead of cluttering `init.el'.
|
||||||
;; You can M-x customize, M-x customize-group, or M-x customize-themes, etc.
|
;; You can M-x customize, M-x customize-group, or M-x customize-themes, etc.
|
||||||
@@ -1024,19 +1024,19 @@
|
|||||||
|
|
||||||
;; Custom example. Formatting with prettier tool.
|
;; Custom example. Formatting with prettier tool.
|
||||||
(evil-define-key 'normal 'global (kbd "<leader> m p")
|
(evil-define-key 'normal 'global (kbd "<leader> m p")
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(shell-command (concat "prettier --write " (shell-quote-argument (buffer-file-name))))
|
(shell-command (concat "prettier --write " (shell-quote-argument (buffer-file-name))))
|
||||||
(revert-buffer t t t)))
|
(revert-buffer t t t)))
|
||||||
|
|
||||||
;; LSP commands keybindings
|
;; LSP commands keybindings
|
||||||
(evil-define-key 'normal lsp-mode-map
|
(evil-define-key 'normal lsp-mode-map
|
||||||
;; (kbd "gd") 'lsp-find-definition ;; evil-collection already provides gd
|
;; (kbd "gd") 'lsp-find-definition ;; evil-collection already provides gd
|
||||||
(kbd "gr") 'lsp-find-references ;; Finds LSP references
|
(kbd "gr") 'lsp-find-references ;; Finds LSP references
|
||||||
(kbd "<leader> c a") 'lsp-execute-code-action ;; Execute code actions
|
(kbd "<leader> c a") 'lsp-execute-code-action ;; Execute code actions
|
||||||
(kbd "<leader> r n") 'lsp-rename ;; Rename symbol
|
(kbd "<leader> r n") 'lsp-rename ;; Rename symbol
|
||||||
(kbd "gI") 'lsp-find-implementation ;; Find implementation
|
(kbd "gI") 'lsp-find-implementation ;; Find implementation
|
||||||
(kbd "<leader> l f") 'lsp-format-buffer) ;; Format buffer via lsp
|
(kbd "<leader> l f") 'lsp-format-buffer) ;; Format buffer via lsp
|
||||||
|
|
||||||
|
|
||||||
(defun ek/lsp-describe-and-jump ()
|
(defun ek/lsp-describe-and-jump ()
|
||||||
@@ -1053,20 +1053,24 @@
|
|||||||
(evil-define-key 'normal 'global (kbd "K")
|
(evil-define-key 'normal 'global (kbd "K")
|
||||||
(if (>= emacs-major-version 31)
|
(if (>= emacs-major-version 31)
|
||||||
#'eldoc-box-help-at-point
|
#'eldoc-box-help-at-point
|
||||||
#'ek/lsp-describe-and-jump))
|
#'ek/lsp-describe-and-jump))
|
||||||
|
|
||||||
;; Commenting functionality for single and multiple lines
|
;; Commenting functionality for single and multiple lines
|
||||||
(evil-define-key 'normal 'global (kbd "gcc")
|
(evil-define-key 'normal 'global (kbd "gcc")
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(if (not (use-region-p))
|
(if (not (use-region-p))
|
||||||
(comment-or-uncomment-region (line-beginning-position) (line-end-position)))))
|
(comment-or-uncomment-region (line-beginning-position) (line-end-position)))))
|
||||||
|
|
||||||
(evil-define-key 'visual 'global (kbd "gc")
|
(evil-define-key 'visual 'global (kbd "gc")
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(if (use-region-p)
|
(if (use-region-p)
|
||||||
(comment-or-uncomment-region (region-beginning) (region-end)))))
|
(comment-or-uncomment-region (region-beginning) (region-end)))))
|
||||||
|
|
||||||
|
(evil-define-key 'normal 'global (kbd "C-s") #'write-file)
|
||||||
|
(evil-define-key 'normal 'global (kbd "C-SPC") #'completion-at-point)
|
||||||
|
|
||||||
|
|
||||||
;; Enable evil mode
|
;; Enable evil mode
|
||||||
(evil-mode 1))
|
(evil-mode 1))
|
||||||
@@ -1120,6 +1124,24 @@
|
|||||||
(global-evil-matchit-mode 1))
|
(global-evil-matchit-mode 1))
|
||||||
|
|
||||||
|
|
||||||
|
;; FLASH
|
||||||
|
;; like flash.nvim
|
||||||
|
(use-package flash
|
||||||
|
:commands (flash-jump flash-jump-continue
|
||||||
|
flash-treesitter)
|
||||||
|
;; :bind ("s-j" . flash-jump)
|
||||||
|
:custom
|
||||||
|
(flash-multi-window t)
|
||||||
|
:init
|
||||||
|
;; Evil integration (simple setup)
|
||||||
|
(with-eval-after-load 'evil
|
||||||
|
(require 'flash-evil)
|
||||||
|
(flash-evil-setup t)) ; t = also set up f/t/F/T char motions
|
||||||
|
:config
|
||||||
|
;; Search integration (labels during C-s, /, ?)
|
||||||
|
(require 'flash-isearch)
|
||||||
|
(flash-isearch-mode 1))
|
||||||
|
|
||||||
;; UNDO TREE
|
;; UNDO TREE
|
||||||
;; The `undo-tree' package provides an advanced and visual way to
|
;; The `undo-tree' package provides an advanced and visual way to
|
||||||
;; manage undo history. It allows you to navigate and visualize your
|
;; manage undo history. It allows you to navigate and visualize your
|
||||||
@@ -1144,7 +1166,7 @@
|
|||||||
:config
|
:config
|
||||||
;; Set the directory where `undo-tree' will save its history files.
|
;; Set the directory where `undo-tree' will save its history files.
|
||||||
;; This keeps undo history across sessions, stored in a cache directory.
|
;; This keeps undo history across sessions, stored in a cache directory.
|
||||||
(setq undo-tree-history-directory-alist '(("." . "~/.emacs.d/.cache/undo"))))
|
(setq undo-tree-history-directory-alist '(("." . "~/.config/emacs/.cache/undo"))))
|
||||||
|
|
||||||
|
|
||||||
;;; RAINBOW DELIMITERS
|
;;; RAINBOW DELIMITERS
|
||||||
|
|||||||
Reference in New Issue
Block a user