refactoring and updates
This commit is contained in:
parent
ad9acea3b0
commit
59fc2f2d9c
3 changed files with 114 additions and 31 deletions
65
config.el
65
config.el
|
@ -43,9 +43,25 @@
|
|||
(set-keyboard-coding-system 'utf-8)
|
||||
(prefer-coding-system 'utf-8)
|
||||
|
||||
(setq delete-by-moving-to-trash t)
|
||||
|
||||
;; org dir == obsidian vault
|
||||
(setq org-directory "~/documents/Obsidian/Primary")
|
||||
|
||||
;; Performance optimizations
|
||||
(setq gc-cons-threshold (* 256 1024 1024))
|
||||
(setq read-process-output-max (* 4 1024 1024))
|
||||
(setq comp-deferred-compilation t)
|
||||
(setq comp-async-jobs-number 8)
|
||||
|
||||
;; Garbage collector optimization
|
||||
(setq gcmh-idle-delay 5)
|
||||
(setq gcmh-high-cons-threshold (* 1024 1024 1024))
|
||||
|
||||
;; Version control optimization
|
||||
(setq vc-handled-backends '(Git))
|
||||
|
||||
|
||||
(use-package! direnv
|
||||
:config
|
||||
(direnv-mode))
|
||||
|
@ -68,13 +84,6 @@
|
|||
(setq shell-file-name (executable-find "bash"))
|
||||
(setq dired-vc-rename-file t) ; renaming and changing files in dired now integrates with magit
|
||||
|
||||
(after! vterm
|
||||
(setq-default vterm-shell (executable-find "fish"))
|
||||
(setq-default explicit-shell-file-name (executable-find "fish"))
|
||||
(setq vterm-kill-buffer-on-exit t)
|
||||
(after! meow
|
||||
(meow-vterm-enable)))
|
||||
|
||||
;; remove org agenda from the splash screen
|
||||
(assoc-delete-all "Open org-agenda" +doom-dashboard-menu-sections)
|
||||
|
||||
|
@ -149,6 +158,8 @@
|
|||
|
||||
;; set project paths and ignore buffers
|
||||
(after! projectile
|
||||
(setq projectile-enable-caching t)
|
||||
(setq projectile-indexing-method 'hybrid)
|
||||
(setq projectile-project-search-path '(("~/projects" . 4) ("~/source" . 2) ("~/music" . 3)))
|
||||
(setq projectile-globally-ignored-buffers
|
||||
'("*scratch*"
|
||||
|
@ -251,17 +262,6 @@
|
|||
(after! gcode-mode
|
||||
(add-hook! 'gcode-mode-hook 'eldoc-mode))
|
||||
|
||||
(use-package! tramp
|
||||
:defer t
|
||||
:config
|
||||
;; To “turn off” the backup feature for remote files and stop TRAMP from saving to the backup directory.
|
||||
;; See https://www.gnu.org/software/tramp/#Auto_002dsave-File-Lock-and-Backup
|
||||
(add-to-list 'backup-directory-alist
|
||||
(cons tramp-file-name-regexp nil))
|
||||
(customize-set-variable 'tramp-backup-directory-alist backup-directory-alist)
|
||||
(setq backup-enable-predicate
|
||||
(lambda (name) nil)))
|
||||
|
||||
;; override aggressive key shortcuts for alt-l/r
|
||||
(use-package! drag-stuff
|
||||
:defer t)
|
||||
|
@ -284,6 +284,8 @@
|
|||
;; load additional config files
|
||||
(load! "obsidian-config.el")
|
||||
(load! "mu4e-config.el")
|
||||
(load! "vterm.el")
|
||||
(load! "tramp.el")
|
||||
|
||||
;; import all my customized keybindings based on doom evil mode, but with meow instead.
|
||||
(load! "bindings.el")
|
||||
|
@ -301,6 +303,7 @@
|
|||
:config
|
||||
(global-colorful-mode t)
|
||||
(add-to-list 'global-colorful-modes 'helpful-mode)
|
||||
(add-to-list 'global-colorful-modes 'nix-mode)
|
||||
(setq css-fontify-colors nil
|
||||
web-mode-enable-css-colorization nil))
|
||||
|
||||
|
@ -324,16 +327,16 @@
|
|||
(end (region-end)))
|
||||
(font-lock-flush beg end))))
|
||||
|
||||
;; (defun +workspaces-associate-frame-fn (frame &optional _new-frame-p)
|
||||
;; "Create a blank, new perspective and associate it with FRAME."
|
||||
;; (when persp-mode
|
||||
;; (with-selected-frame frame
|
||||
;; (if (not (cdr-safe (persp-frame-list-without-daemon)))
|
||||
;; (+workspace-switch +workspaces-main t)
|
||||
;; (+workspace-switch (format "#%s" (+workspace--generate-id)) t))
|
||||
;; (unless (doom-real-buffer-p (current-buffer))
|
||||
;; (switch-to-buffer (doom-fallback-buffer)))
|
||||
;; (set-frame-parameter frame 'workspace (+workspace-current-name))
|
||||
;; ;; ensure every buffer has a buffer-predicate
|
||||
;; (persp-set-frame-buffer-predicate frame))
|
||||
;; (run-at-time 0.1 nil #'+workspace/display)))
|
||||
(defun +workspaces-associate-frame-fn (frame &optional _new-frame-p)
|
||||
"Create a blank, new perspective and associate it with FRAME."
|
||||
(when persp-mode
|
||||
(with-selected-frame frame
|
||||
(if (not (cdr-safe (persp-frame-list-without-daemon)))
|
||||
(+workspace-switch +workspaces-main t)
|
||||
(+workspace-switch (format "#%s" (+workspace--generate-id)) t))
|
||||
(unless (doom-real-buffer-p (current-buffer))
|
||||
(switch-to-buffer (doom-fallback-buffer)))
|
||||
(set-frame-parameter frame 'workspace (+workspace-current-name))
|
||||
;; ensure every buffer has a buffer-predicate
|
||||
(persp-set-frame-buffer-predicate frame))
|
||||
(run-at-time 0.1 nil #'+workspace/display)))
|
||||
|
|
34
tramp.el
Normal file
34
tramp.el
Normal file
|
@ -0,0 +1,34 @@
|
|||
;;; tramp.el -*- lexical-binding: t; -*-
|
||||
|
||||
|
||||
(use-package! tramp
|
||||
:defer t
|
||||
:config
|
||||
;; To “turn off” the backup feature for remote files and stop TRAMP from saving to the backup directory.
|
||||
;; See https://www.gnu.org/software/tramp/#Auto_002dsave-File-Lock-and-Backup
|
||||
(add-to-list 'backup-directory-alist
|
||||
(cons tramp-file-name-regexp nil))
|
||||
(customize-set-variable 'tramp-backup-directory-alist backup-directory-alist)
|
||||
(setq backup-enable-predicate
|
||||
(lambda (name) nil)))
|
||||
|
||||
|
||||
;;;; TRAMP optimizations
|
||||
(after! tramp
|
||||
(setq tramp-default-method "ssh" ; Use SSH by default
|
||||
tramp-verbose 1 ; Reduce verbosity
|
||||
tramp-use-ssh-controlmaster-options nil ; Don't use control master
|
||||
tramp-chunksize 500 ; Bigger chunks for better performance
|
||||
tramp-connection-timeout 10 ; Shorter timeout
|
||||
;; Use SSH configuration
|
||||
tramp-use-ssh-controlmaster-options nil
|
||||
;; Cache remote files
|
||||
remote-file-name-inhibit-cache nil
|
||||
;; Enable file-name-handler cache
|
||||
tramp-cache-read-persistent-data t))
|
||||
|
||||
;; Additional performance settings
|
||||
(setq vc-ignore-dir-regexp
|
||||
(format "%s\\|%s"
|
||||
vc-ignore-dir-regexp
|
||||
tramp-file-name-regexp))
|
46
vterm.el
Normal file
46
vterm.el
Normal file
|
@ -0,0 +1,46 @@
|
|||
;;; vterm.el -*- lexical-binding: t; -*-
|
||||
|
||||
|
||||
|
||||
;; Vterm adjustemts
|
||||
(setq vterm-environment '("TERM=xterm-256color"))
|
||||
(set-language-environment "UTF-8")
|
||||
(set-default-coding-systems 'utf-8)
|
||||
|
||||
;; open vterm in dired location
|
||||
(after! vterm
|
||||
(setq vterm-buffer-name-string "vterm %s")
|
||||
|
||||
(setq-default vterm-shell (executable-find "fish"))
|
||||
(setq-default explicit-shell-file-name (executable-find "fish"))
|
||||
(setq vterm-kill-buffer-on-exit t)
|
||||
(after! meow (meow-vterm-enable))
|
||||
|
||||
;; Modify the default vterm opening behavior
|
||||
(defadvice! +vterm-use-current-directory-a (fn &rest args)
|
||||
"Make vterm open in the directory of the current buffer."
|
||||
:around #'vterm
|
||||
(let ((default-directory (or (and (buffer-file-name)
|
||||
(file-name-directory (buffer-file-name)))
|
||||
(and (eq major-mode 'dired-mode)
|
||||
(dired-current-directory))
|
||||
default-directory)))
|
||||
(apply fn args)))
|
||||
|
||||
;; Also modify Doom's specific vterm functions
|
||||
(defadvice! +vterm-use-current-directory-b (fn &rest args)
|
||||
"Make Doom's vterm commands open in the directory of the current buffer."
|
||||
:around #'+vterm/here
|
||||
(let ((default-directory (or (and (buffer-file-name)
|
||||
(file-name-directory (buffer-file-name)))
|
||||
(and (eq major-mode 'dired-mode)
|
||||
(dired-current-directory))
|
||||
default-directory)))
|
||||
(apply fn args))))
|
||||
|
||||
(defun open-vterm-in-current-context ()
|
||||
"Open vterm in the context of the current buffer/window."
|
||||
(interactive)
|
||||
(when-let ((buf (current-buffer)))
|
||||
(with-current-buffer buf
|
||||
(call-interactively #'+vterm/here))))
|
Loading…
Add table
Add a link
Reference in a new issue