feat: emacs - GUI mode by default, increase font size

This commit is contained in:
Ryan Yin
2024-01-06 19:38:56 +08:00
parent daa883caf8
commit 72bd225ca2
4 changed files with 25 additions and 17 deletions

View File

@@ -183,8 +183,8 @@ reload-emacs-cmd := if os() == "macos" {
emacs-test: emacs-test:
rm -rf $"($env.HOME)/.config/doom" rm -rf $"($env.HOME)/.config/doom"
rsync -avz --copy-links --chmod=D2755,F744 home/base/desktop/editors/emacs/doom/ $"($env.HOME)/.config/doom" rsync -avz --copy-links --chmod=D2755,F744 home/base/desktop/editors/emacs/doom/ $"($env.HOME)/.config/doom"
doom sync
doom clean doom clean
doom sync
emacs-clean: emacs-clean:
rm -rf $"($env.HOME)/.config/doom/" rm -rf $"($env.HOME)/.config/doom/"
@@ -195,4 +195,5 @@ emacs-purge:
doom sync doom sync
emacs-reload: emacs-reload:
doom sync
{{reload-emacs-cmd}} {{reload-emacs-cmd}}

View File

@@ -36,13 +36,15 @@ when in doubt, run `doom sync`!
Here is the cheetsheet related to my DoomEmacs configs. Please read vim's common cheetsheet at [../README.md](../README.md) before reading the following. Here is the cheetsheet related to my DoomEmacs configs. Please read vim's common cheetsheet at [../README.md](../README.md) before reading the following.
### Terminal Related ### Basics
> Terminal(vterm) is useful in GUI mode, I use Zellij instead in terminal mode.
| Action | Shortcut | | Action | Shortcut |
| ---------------------- | ------------- | | ---------------------- | ------------- |
| Open file tree sidebar | `SPC + o + p` | | Popup Terminal(vterm) | `SPC + o + t` |
| Popup Terminal | `SPC + o + t` |
| Open Terminal | `SPC + o + T` | | Open Terminal | `SPC + o + T` |
| Open file tree sidebar | `SPC + o + p` |
| Exit | `M-x C-c` | | Exit | `M-x C-c` |
### Window Navigation ### Window Navigation
@@ -109,6 +111,10 @@ And bookmarks:
| Find files by keyword in path | `<Space> + <Space>` | | Find files by keyword in path | `<Space> + <Space>` |
| Grep string in files (vertico + ripgrep) | `<Space> + sd` | | Grep string in files (vertico + ripgrep) | `<Space> + sd` |
### Image Preview(GUI mode only)
Use `-`, `+` to resize the image, `r` to rotate the image.
### Search & replace ### Search & replace
```bash ```bash

View File

@@ -19,7 +19,8 @@ with lib; let
export PATH="${config.xdg.configHome}/emacs/bin:$PATH" export PATH="${config.xdg.configHome}/emacs/bin:$PATH"
''; '';
shellAliases = { shellAliases = {
e = "emacsclient --create-frame --tty"; e = "emacsclient --create-frame"; # gui
et = "emacsclient --create-frame --tty"; # termimal
}; };
librime-dir = "${config.xdg.dataHome}/librime"; librime-dir = "${config.xdg.dataHome}/librime";
parinfer-rust-lib-dir = "${config.xdg.dataHome}/parinfer-rust"; parinfer-rust-lib-dir = "${config.xdg.dataHome}/parinfer-rust";
@@ -82,7 +83,7 @@ in {
# Do not use emacs-nox here, which makes the mouse wheel work abnormally in terminal mode. # Do not use emacs-nox here, which makes the mouse wheel work abnormally in terminal mode.
# pgtk (pure gtk) build add native support for wayland. # pgtk (pure gtk) build add native support for wayland.
# https://www.gnu.org/savannah-checkouts/gnu/emacs/emacs.html#Releases # https://www.gnu.org/savannah-checkouts/gnu/emacs/emacs.html#Releases
emacsPkg = pkgs.emacs29-pgtk; emacsPkg = (pkgs.emacsPackagesFor pkgs.emacs29-pgtk).emacsWithPackages (epkgs: [epkgs.vterm]);
in { in {
home.packages = [emacsPkg]; home.packages = [emacsPkg];
services.emacs = { services.emacs = {
@@ -97,7 +98,7 @@ in {
let let
# macport adds some native features based on GNU Emacs 29 # macport adds some native features based on GNU Emacs 29
# https://bitbucket.org/mituharu/emacs-mac/src/master/README-mac # https://bitbucket.org/mituharu/emacs-mac/src/master/README-mac
emacsPkg = pkgs.emacs29-macport; emacsPkg = (pkgs.emacsPackagesFor pkgs.emacs29-macport).emacsWithPackages (epkgs: [epkgs.vterm]);
in { in {
home.packages = [emacsPkg]; home.packages = [emacsPkg];
launchd.enable = true; launchd.enable = true;

View File

@@ -21,10 +21,10 @@
;; See 'C-h v doom-font' for documentation and more examples of what they ;; See 'C-h v doom-font' for documentation and more examples of what they
;; accept. For example: ;; accept. For example:
;; ;;
(setq doom-font (font-spec :family "JetBrainsMono Nerd Font" :size 15 :weight 'light) (setq doom-font (font-spec :family "JetBrainsMono Nerd Font" :size 17 :weight 'light)
doom-variable-pitch-font (font-spec :family "DejaVu Sans" :size 16) doom-variable-pitch-font (font-spec :family "DejaVu Sans" :size 18)
doom-symbol-font (font-spec :family "JuliaMono") doom-symbol-font (font-spec :family "JuliaMono")
doom-big-font (font-spec :family "JetBrainsMono Nerd Font" :size 26)) doom-big-font (font-spec :family "JetBrainsMono Nerd Font" :size 28))
;; ;;
;; If you or Emacs can't find your font, use 'M-x describe-font' to look them ;; If you or Emacs can't find your font, use 'M-x describe-font' to look them
;; up, `M-x eval-region' to execute elisp code, and 'M-x doom/reload-font' to ;; up, `M-x eval-region' to execute elisp code, and 'M-x doom/reload-font' to
@@ -76,13 +76,13 @@
;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how ;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how
;; they are implemented. ;; they are implemented.
(use-package! nerd-icons (use-package! nerd-icons)
;; :custom ;; :custom
;; The Nerd Font you want to use in GUI ;; The Nerd Font you want to use in GUI
;; "Symbols Nerd Font Mono" is the default and is recommended ;; "Symbols Nerd Font Mono" is the default and is recommended
;; but you can use any other Nerd Font if you want ;; but you can use any other Nerd Font if you want
;; (nerd-icons-font-family "Symbols Nerd Font Mono") ;; (nerd-icons-font-family "Symbols Nerd Font Mono")
)
(use-package! lsp-bridge (use-package! lsp-bridge
:config :config