config.el 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. ;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
  2. ;; TODO: Make doomemacs config look cleaner by separating files.
  3. ;;; Code:
  4. (setq user-full-name "Ludovico Piero"
  5. user-mail-address "ludovicopiero@pm.me")
  6. (setq doom-font (font-spec :family "Iosevka q" :size 15 :weight 'medium :slant 'normal)
  7. doom-variable-pitch-font (font-spec :family "Iosevka q" :size 15 :weight 'medium :slant 'normal)
  8. doom-big-font (font-spec :family "Iosevka q" :size 20))
  9. (after! doom-themes
  10. (setq doom-themes-enable-bold t
  11. doom-themes-enable-italic t))
  12. (setq shell-file-name "/home/ludovico/.nix-profile/bin/fish"
  13. vterm-max-scrollback 5000)
  14. (setq eshell-history-size 5000
  15. eshell-buffer-maximum-lines 5000
  16. eshell-hist-ignoredups t
  17. eshell-scroll-to-bottom-on-input t
  18. eshell-destroy-buffer-when-process-dies t
  19. eshell-visual-commands'("bash" "fish" "htop" "ssh" "top" "zsh"))
  20. (map! :leader
  21. :desc "Eshell" "e s" #'eshell
  22. :desc "Eshell popup toggle" "e t" #'+eshell/toggle
  23. :desc "Counsel eshell history" "e h" #'counsel-esh-history
  24. :desc "Vterm popup toggle" "v t" #'+vterm/toggle)
  25. ;; Default spelling dictionary is English
  26. (setq ispell-dictionary "english")
  27. ;; Set location of custom.el
  28. ;; (setq custom-file "~/.emacs.d/custom.el")
  29. ;; Enable Global word-wrap
  30. (+global-word-wrap-mode +1)
  31. ;; Always follow symlinks.
  32. (setq vc-follow-symlinks t)
  33. ;; Set Doom theme
  34. (setq doom-theme 'doom-dracula)
  35. (setq doom-themes-treemacs-config "doom-colors")
  36. (with-eval-after-load 'doom-themes
  37. (doom-themes-treemacs-config))
  38. (setq display-line-numbers-type 'relative)
  39. (setq org-directory "~/Documents/org/")
  40. ;; Change doom modeline to user letter instead of icon
  41. (use-package! doom-modeline
  42. :defer t
  43. :custom
  44. (doom-modeline-modal-icon nil))
  45. ;; Enables Nixos-installed packages to be loaded
  46. (require 'package)
  47. (setq package-enable-at-startup nil)
  48. (package-initialize)
  49. ;; Nix
  50. ;; otherwise nix-mode will block on instantiating stuff
  51. (setenv "NIX_REMOTE_SYSTEMS" "")
  52. ;; Set Nix Formatter
  53. (set-formatter! 'alejandra "alejandra --quiet" :modes 'nix-mode)
  54. (after! nix-mode
  55. (set-formatter! 'alejandra "alejandra --quiet" :modes '(nix-mode))
  56. (puthash 'alejandra "alejandra" format-all--executable-table))
  57. ;; Change nix lsp server to nil
  58. (use-package! lsp-mode
  59. :config
  60. (add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]\\.terragrunt-cache\\'")
  61. (add-to-list 'lsp-language-id-configuration '(nix-mode . "nix"))
  62. (lsp-register-client
  63. (make-lsp-client :new-connection (lsp-stdio-connection '("nil"))
  64. :major-modes '(nix-mode)
  65. :server-id 'nix)))
  66. ;; Rust
  67. ;; Change rust lsp server
  68. (use-package! rustic
  69. :defer t
  70. :custom
  71. (rustic-lsp-server 'rust-analyzer)
  72. :config
  73. (when (featurep 'evil)
  74. (add-hook! 'rustic-popup-mode-hook #'evil-emacs-state)))
  75. ;; Change doomemacs cursor
  76. (setq evil-normal-state-cursor 'block
  77. evil-visual-state-cursor 'block
  78. evil-insert-state-cursor 'block
  79. evil-motion-state-cursor 'block
  80. evil-replace-state-cursor 'block
  81. evil-operator-state-cursor 'block)
  82. ;; Treemacs
  83. (setq treemacs-width 30)
  84. ;; Copilot
  85. ;; (use-package! copilot
  86. ;; :hook (prog-mode . copilot-mode)
  87. ;; :bind (("C-TAB" . 'copilot-accept-completion-by-word)
  88. ;; ("C-<tab>" . 'copilot-accept-completion-by-word)
  89. ;; :map copilot-completion-map
  90. ;; ("<tab>" . 'copilot-accept-completion)
  91. ;; ("TAB" . 'copilot-accept-completion)))
  92. ;; remap ; to :
  93. (map! :map evil-normal-state-map
  94. ";" #'evil-ex)
  95. ;; Remove q macro keybind
  96. ;; (map! :map evil-normal-state-map
  97. ;; "q" nil
  98. ;; "1" #'evil-execute-macro)
  99. ;; lang:: cc
  100. ;; Set CC lsp server to clangd
  101. (after! lsp-clangd
  102. (setq lsp-clients-clangd-args
  103. '("-j=3"
  104. "--background-index"
  105. "--clang-tidy"
  106. "--completion-style=detailed"
  107. "--header-insertion=never"
  108. "--header-insertion-decorators=0"))
  109. (set-lsp-priority! 'clangd 2))
  110. ;; Elcord
  111. (elcord-mode)
  112. (setq elcord-quiet t) ;; Make elcord shut up
  113. (setq elcord-editor-icon 'doom_cute_icon)
  114. ;; This gonna disable auto comment when pressing `Enter`
  115. ;; (setq +default-want-RET-continue-comments nil)
  116. ;; (setq +evil-want-o/O-to-continue-comments nil)
  117. ;; (provide 'config)
  118. ;;; config.el ends here