configurations: emacs

This commit is contained in:
Mateusz Słodkowicz 2024-11-03 14:03:17 +01:00
parent 729dce48c5
commit ec15512b0e
Signed by: materus
SSH Key Fingerprint: SHA256:rzVduzTiiszuYfLPYD0SDZV+g8lxhpcRgpbOZA1X0Uo
7 changed files with 68 additions and 34 deletions

View File

@ -170,7 +170,7 @@
dub dub
]); ]);
editor.emacs.enable = false; editor.emacs.enable = true;
}; };
xdg.desktopEntries.brave-browser = xdg.desktopEntries.brave-browser =

View File

@ -14,7 +14,6 @@ let
avy avy
corfu corfu
vterm vterm
centaur-tabs
projectile projectile
company company
clipetty clipetty
@ -61,9 +60,13 @@ let
nix-mode nix-mode
no-littering no-littering
right-click-context right-click-context
moe-theme dracula-theme
doom-themes doom-themes
orderless orderless
popper
undo-tree
bash-completion
consult
]; ];
default-config = '' default-config = ''
@ -96,6 +99,7 @@ let
(setenv "PATH" (concat (getenv "PATH") ":${emacsEnv}/bin")) (setenv "PATH" (concat (getenv "PATH") ":${emacsEnv}/bin"))
(setq exec-path (append exec-path '("${emacsEnv}/bin"))) (setq exec-path (append exec-path '("${emacsEnv}/bin")))
(call-process-shell-command "${pkgs.xorg.xmodmap}/bin/xmodmap -e \"keycode 148 = Hyper_L\" -e \"remove Mod4 = Hyper_L\" -e \"add Mod3 = Hyper_L\" &" nil 0) (call-process-shell-command "${pkgs.xorg.xmodmap}/bin/xmodmap -e \"keycode 148 = Hyper_L\" -e \"remove Mod4 = Hyper_L\" -e \"add Mod3 = Hyper_L\" &" nil 0)
(call-process-shell-command "${pkgs.xorg.xmodmap}/bin/xmodmap -e \"keycode 66 = Hyper_L\" -e \"remove Mod4 = Hyper_L\" -e \"add Mod3 = Hyper_L\" &" nil 0)
''; '';
in in
{ {

View File

@ -36,3 +36,9 @@
(startup-redirect-eln-cache (startup-redirect-eln-cache
(convert-standard-filename (convert-standard-filename
(expand-file-name "var/eln-cache/" user-emacs-directory)))) (expand-file-name "var/eln-cache/" user-emacs-directory))))
(setq auto-save-default nil)
(setq backup-directory-alist
`((".*" . ,(concat user-emacs-directory "var/backups/"))))
(setq auto-save-file-name-transforms
`((".*" ,(concat user-emacs-directory "var/recovery/") t)))

View File

@ -37,16 +37,15 @@
(setq custom-file (concat user-emacs-directory "etc/custom.el")) (setq custom-file (concat user-emacs-directory "etc/custom.el"))
(setq auto-save-default nil)
(setq backup-directory-alist
`((".*" . ,(concat user-emacs-directory "var/backups/"))))
(setq auto-save-file-name-transforms
`((".*" ,(concat user-emacs-directory "var/recovery/") t)))
;;. Graphical ;;. Graphical
(setq frame-resize-pixelwise t) (setq frame-resize-pixelwise t)
(setq window-resize-pixelwise t)
(when (display-graphic-p) (when (display-graphic-p)
(set-frame-font "Hack Nerd Font" nil t) (set-frame-font "Hack Nerd Font" nil t)
) )

View File

@ -70,6 +70,9 @@
(straight-use-package 'nix-mode) (straight-use-package 'nix-mode)
(straight-use-package 'no-littering) (straight-use-package 'no-littering)
(straight-use-package 'right-click-context) (straight-use-package 'right-click-context)
(straight-use-package 'moe-theme) (straight-use-package 'dracula-theme)
(straight-use-package 'doom-themes) (straight-use-package 'doom-themes)
(straight-use-package 'orderless) (straight-use-package 'orderless)
(straight-use-package 'undo-tree)
(straight-use-package 'bash-completion)
(straight-use-package 'consult)

View File

@ -6,9 +6,8 @@
(require 'elcord) (require 'elcord)
(require 'dashboard) (require 'dashboard)
(require 'minions) (require 'minions)
(require 'doom-themes) (require 'dracula-theme)
(require 'nerd-icons) (require 'nerd-icons)
(require 'centaur-tabs)
(require 'projectile) (require 'projectile)
(require 'treemacs) (require 'treemacs)
(require 'treemacs-projectile) (require 'treemacs-projectile)
@ -16,20 +15,43 @@
(require 'vertico) (require 'vertico)
(require 'orderless) (require 'orderless)
(require 'marginalia) (require 'marginalia)
(require 'undo-tree)
(require 'consult)
(cua-mode 0)
;Keybinds
(keymap-set cua--cua-keys-keymap "C-z" 'undo-tree-undo)
(keymap-set cua--cua-keys-keymap "C-y" 'undo-tree-redo)
(keymap-set global-map "TAB" #'indent-rigidly-right-to-tab-stop)
(keymap-set global-map "<backtab>" #'indent-rigidly-left-to-tab-stop)
(keymap-set global-map "C-<tab>" #'indent-for-tab-commandn)
(keymap-set vertico-map "TAB" #'vertico-insert)
(define-key key-translation-map (kbd "<XF86Calculator>") 'event-apply-hyper-modifier )
(define-key key-translation-map (kbd "<Calculator>") 'event-apply-hyper-modifier )
(define-key key-translation-map (kbd "") 'event-apply-hyper-modifier )
(global-set-key (kbd "C-H-t") 'treemacs)
(setq completion-in-region-function
(lambda (&rest args)
(apply (if vertico-mode
#'consult-completion-in-region
#'completion--in-region)
args)))
(tool-bar-mode -1) (tool-bar-mode -1)
(if (daemonp) (if (daemonp)
(add-hook 'after-make-frame-functions (add-hook 'after-make-frame-functions
(lambda (frame) (lambda (frame)
(with-selected-frame frame (load-theme 'doom-horizon t)))) (with-selected-frame frame (load-theme 'dracula t))))
(load-theme 'doom-horizon t)) (load-theme 'dracula t))
(setq-default cursor-type '(bar . 1)) (setq-default cursor-type '(bar . 1))
@ -64,38 +86,33 @@
(setq initial-buffer-choice (lambda () (get-buffer "*dashboard*"))) ; Show dashboard when emacs is running as daemon (setq initial-buffer-choice (lambda () (get-buffer "*dashboard*"))) ; Show dashboard when emacs is running as daemon
) )
;Enable Centaur tabs
(centaur-tabs-mode t)
(setq centaur-tabs-set-bar 'over)
(setq centaur-tabs-set-modified-marker t)
;(setq centaur-tabs-modified-marker "*")
;Enable treemacs (setq-default display-line-numbers-width 4)
(global-set-key (kbd "C-H-t") 'treemacs)
(cua-mode 1)
;(global-set-key (kbd "C-∇") (kbd "C-H"))
;(global-set-key (kbd "H-∇") (lambda () (interactive) (insert-char #x2207)))
;; Enable vertico ;; Enable vertico
(vertico-mode 1) (vertico-mode 1)
(marginalia-mode 1) (marginalia-mode 1)
;(setq completion-styles '(orderless basic) ;(setq completion-styles '(orderless basic)
; completion-category-defaults nil ; completion-category-defaults nil
; completion-category-overrides '((file (styles partial-completion)))) ; completion-category-overrides '((file (styles partial-completion))))
;CUA (electric-pair-mode 1)
(cua-mode 1)
(global-set-key (kbd "C-y") 'undo-redo)
(global-set-key (kbd "C-<tab>") 'indent-rigidly-right-to-tab-stop) (global-undo-tree-mode 1)
(global-set-key (kbd "<backtab>") 'indent-rigidly-left-to-tab-stop) (global-tab-line-mode 1)
(setq-default tab-width 4)
(define-key key-translation-map (kbd "<XF86Calculator>") 'event-apply-hyper-modifier )
(define-key key-translation-map (kbd "<Calculator>") 'event-apply-hyper-modifier )
(define-key key-translation-map (kbd "") 'event-apply-hyper-modifier )
;(global-set-key (kbd "C-∇") (kbd "C-H"))
;(global-set-key (kbd "H-∇") (lambda () (interactive) (insert-char #x2207)))
(load (concat materus/cfg "/lsp/default")) (load (concat materus/cfg "/lsp/default"))

View File

@ -1,4 +1,9 @@
(setq-default materus/nix-packages (require 'evil nil 'noerror)) (setq-default materus/nix-packages (require 'evil nil 'noerror))
(unless materus/nix-packages (load (concat user-emacs-directory "etc/materus/packages"))) (unless materus/nix-packages (load (concat user-emacs-directory "etc/materus/packages")))
(load (concat user-emacs-directory "etc/materus/internals")) (load (concat user-emacs-directory "etc/materus/internals"))
(load (concat user-emacs-directory "etc/materus/start")) (load (concat user-emacs-directory "etc/materus/start"))
(when (file-exists-p custom-file)
(load custom-file))