diff --git a/home/base/desktop/editors/emacs/README.md b/home/base/desktop/editors/emacs/README.md index 69425cfd..ebf64661 100644 --- a/home/base/desktop/editors/emacs/README.md +++ b/home/base/desktop/editors/emacs/README.md @@ -1,11 +1,11 @@ # Emacs Editor - Framework: - - key bindings: + - key bindings: - Chinese(rime) support: - modal editing: - - : evil mode, enabled by default in doom-emacs. - - + - : evil mode, enabled by default in doom-emacs. + - ## Install or Update @@ -14,6 +14,7 @@ After deploying this nix flake, run the following command to install or update e ```bash doom sync ``` + ## Terminal Related zellij provides a more powerful and stable terminal experience, so here is zellij's terminal shortcuts I use frequently now: @@ -23,6 +24,7 @@ zellij provides a more powerful and stable terminal experience, so here is zelli | Floating Terminal | `Ctrl +

+ ` | | Horizontal Split Terminal | `Ctrl +

+ ` | | Vertical Split Terminal | `Ctrl +

+ ` | +| Open file tree sidebar | `SPC + o + p` | ## Visual Modes @@ -59,28 +61,34 @@ The same as neovim/vim: ## Splitting and Buffers -| Action | Shortcut | -| --------------------- | ------------- | -| Next Buffer (Tab) | `]b` | -| Previous Buffer (Tab) | `[b` | -| Save all buffers(Tab) | ` + b + S` | +| Action | Shortcut | +| --------------------- | ----------------- | +| Next Buffer (Tab) | `]b` | +| Previous Buffer (Tab) | `[b` | +| Save all buffers(Tab) | ` + b + S` | ## Editing and Formatting -| Action | Shortcut | -| ----------------------------------------------------- | -------------- | -| Format Document | ` + cf` | -| Code Actions | ` + ca` | -| Rename | ` + cr` | -| Opening LSP symbols | ` + cS` | -| Comment Line(support multiple lines) | ` + /` | -| Open filepath/URL at cursor | `gf` | -| Find files by keyword in path | ` + ` | -| Grep string in files (vertico + ripgrep) | ` + sd` | +| Action | Shortcut | +| ---------------------------------------- | ------------------- | +| Format Document | ` + cf` | +| Code Actions | ` + ca` | +| Rename | ` + cr` | +| Opening LSP symbols | ` + cS` | +| Comment Line(support multiple lines) | ` + /` | +| Open filepath/URL at cursor | `gf` | +| Find files by keyword in path | ` + ` | +| Grep string in files (vertico + ripgrep) | ` + sd` | + +## Text Manipulation + +| Action | | +| ---------------------------------- | --- | +| Join Selection of Lines With Space | `J` | ## Search & replace -``` bash +```bash SPC s p foo C-; E C-c C-p :%s/foo/bar/g RET Z Z ``` @@ -88,5 +96,5 @@ SPC s p foo C-; E C-c C-p :%s/foo/bar/g RET Z Z 1. `foo`: the keyword to search 1. `C-; E`: exports what you’re looking at into a new buffer in grep-mode 1. `C-c C-p` to run wgrep-change-to-wgrep-mode to make the search results writable. -1. `:%s/foo/bar/g RET`: replace in the current buffer(just like neovim/vim) +1. `:%s/foo/bar/g RET`: replace in the current buffer(just like neovim/vim) 1. `Z Z`: to write all the changes to their respective files diff --git a/home/base/desktop/editors/emacs/doom/config.el b/home/base/desktop/editors/emacs/doom/config.el index de384eb4..04334c22 100644 --- a/home/base/desktop/editors/emacs/doom/config.el +++ b/home/base/desktop/editors/emacs/doom/config.el @@ -83,3 +83,11 @@ ("TAB" . 'copilot-accept-completion) ("C-TAB" . 'copilot-accept-completion-by-word) ("C-" . 'copilot-accept-completion-by-word))) + +(use-package super-save + :ensure t + :config + (super-save-mode +1) + (setq super-save-auto-save-when-idle t) + (setq super-save-all-buffers t) + (setq super-save-delete-trailing-whitespace t)) diff --git a/home/base/desktop/editors/emacs/doom/packages.el b/home/base/desktop/editors/emacs/doom/packages.el index 0e1be04f..7c98d99c 100644 --- a/home/base/desktop/editors/emacs/doom/packages.el +++ b/home/base/desktop/editors/emacs/doom/packages.el @@ -8,6 +8,9 @@ (package! copilot :recipe (:host github :repo "copilot-emacs/copilot.el" :files ("*.el" "dist"))) +(package! super-save + :recipe (:host github :repo "bbatsov/super-save" :files ("*.el" "dist"))) + ;; To install SOME-PACKAGE from MELPA, ELPA or emacsmirror: ;; (package! some-package)