diff options
Diffstat (limited to 'emacs/site-lisp')
| -rwxr-xr-x | emacs/site-lisp/coding-config.el | 33 | ||||
| -rw-r--r-- | emacs/site-lisp/evil-config.el | 3 | ||||
| -rw-r--r-- | emacs/site-lisp/exwm-pref.el | 107 | ||||
| -rw-r--r-- | emacs/site-lisp/general-text.el | 2 | ||||
| -rw-r--r-- | emacs/site-lisp/irc-config.el | 24 | ||||
| -rw-r--r-- | emacs/site-lisp/modeline-config.el | 4 | ||||
| -rw-r--r-- | emacs/site-lisp/my-binds.el | 8 | ||||
| -rw-r--r-- | emacs/site-lisp/my-funcs.el | 28 |
8 files changed, 126 insertions, 83 deletions
diff --git a/emacs/site-lisp/coding-config.el b/emacs/site-lisp/coding-config.el index 9d228f0..25dd372 100755 --- a/emacs/site-lisp/coding-config.el +++ b/emacs/site-lisp/coding-config.el @@ -24,6 +24,8 @@ (use-package lsp-haskell) +(use-package pyvenv) + (use-package sideline :init (setq sideline-backends-right '())) @@ -51,16 +53,7 @@ (global-set-key (kbd "M-I") 'xref-find-definitions) (setq imenu-auto-rescan t) - -;; make ibuffer play with projectile -(use-package ibuffer - :bind - ("C-x C-b" . ibuffer) - :hook - (ibuffer . (lambda () - (ibuffer-projectile-set-filter-groups) - (unless (eq ibuffer-sorting-mode 'alphabetic) - (ibuffer-do-sort-by-alphabetic))))) +(setq imenu-flatten t) ;; make shells and whatnot slightly better (require 'comint) @@ -94,13 +87,15 @@ (require 'my-funcs) (add-hook 'prog-mode-hook (lambda () (hs-minor-mode 1) + (hl-todo-mode 1) (superword-mode 1) - (modify-syntax-entry ?_ "w") ) - (display-fill-column-indicator-mode 1) - (add-hook 'before-save-hook - (lambda () - (if (not (eq major-mode 'makefile-gmake-mode)) - (clean-prog-file (current-buffer)))))) + (modify-syntax-entry ?_ "w") + + (display-fill-column-indicator-mode 1) + (add-hook 'before-save-hook + (lambda () + (if (not (eq major-mode 'makefile-gmake-mode)) + (clean-prog-file (current-buffer))))))) ;; haskell flavor and tags (use-package haskell-mode @@ -125,3 +120,9 @@ "rg -i -M 120 --no-heading --line-number --color never '%s' %s") (global-set-key (kbd "C-s") 'counsel-grep-or-swiper) (global-set-key (kbd "C-S-s") 'isearch-forward) + +;; racket +(use-package racket-mode) + +;; rust +(use-package rustic) diff --git a/emacs/site-lisp/evil-config.el b/emacs/site-lisp/evil-config.el index b019146..38db735 100644 --- a/emacs/site-lisp/evil-config.el +++ b/emacs/site-lisp/evil-config.el @@ -30,8 +30,11 @@ (define-key evil-normal-state-map (kbd "M-.") 'xref-find-definitions) (define-key evil-normal-state-map (kbd "M-Z") 'suspend-frame) +(use-package treemacs-evil) + (define-key evil-motion-state-map (kbd "TAB") 'indent-for-tab-command) (evil-set-initial-state 'vterm-mode 'emacs) +(evil-set-initial-state 'eshell-mode 'emacs) ;;; sasha bindings (defun evil-window-split-and-switch () diff --git a/emacs/site-lisp/exwm-pref.el b/emacs/site-lisp/exwm-pref.el index fee729f..f03711c 100644 --- a/emacs/site-lisp/exwm-pref.el +++ b/emacs/site-lisp/exwm-pref.el @@ -6,9 +6,10 @@ (require 'exwm-randr) (require 'exwm-xim) (require 'exwm-systemtray) +(require 'exwm-manage) -(setq exwm-workspace-number 1) -;; (setq exwm-randr-workspace-monitor-plist '(0 "DP-0" 1 "HDMI-0" 2 "DVI-I-1")) +(setq exwm-workspace-number 2) +(setq exwm-randr-workspace-monitor-plist '(0 "DP-0" 1 "HDMI-0")) (setq exwm-workspace-show-all-buffers t) (setq exwm-layout-show-all-buffers t) @@ -22,9 +23,9 @@ ;; (require 'exwm-firefox) ;; (exwm-firefox-mode) -(setq persp-auto-resume-time 0) +(setq exwm-title-length 50) -(setq exwm-title-length 70) +(setq exwm-manage-force-tiling t) (defun b3n-exwm-set-buffer-name () (if (and exwm-title (string-match "\\`http[^ ]+" exwm-title)) @@ -33,6 +34,10 @@ (setq-local exwm-title (replace-regexp-in-string (concat (regexp-quote url) " - ") "" + exwm-title)) + (setq-local exwm-title (replace-regexp-in-string + " - Mozilla Firefox" + "" exwm-title)))) (setq-local exwm-title @@ -41,7 +46,7 @@ "<" ;; (if (<= (length exwm-title) exwm-title-length) exwm-title - ;; (concat (substring exwm-title 0 exwm-title-length) "…")) + ;; (concat (substring exwm-title 0 exwm-title-length) "…")) ">")) (exwm-workspace-rename-buffer exwm-title)) @@ -75,7 +80,7 @@ ;; super hacky, assumes that there are only two active workspaces (exwm-workspace-switch-create (exwm-workspace--workspace-from-frame-or-index (let* ((workspace-list (seq-filter 'exwm-workspace--active-p exwm-workspace--list)) - (active-workspaces workspace-list)) + (active-workspaces workspace-list)) (while (not (eq (car active-workspaces) (selected-frame))) (setq active-workspaces (cdr active-workspaces))) (setq active-workspaces (cdr active-workspaces)) @@ -98,6 +103,7 @@ ;;(exwm-config-default) (exwm-systemtray-mode) (push ?\C-\\ exwm-input-prefix-keys) ;;C-\ to switch input method +(push ?\C-u exwm-input-prefix-keys) ;; send C-u to all windows too ;; All buffers created in EXWM mode are named "*EXWM*". You may want to ;; change it in `exwm-update-class-hook' and `exwm-update-title-hook', which @@ -147,7 +153,7 @@ ;;fast workspace switch ([?\s-O] . exwm-other-assigned-workspace) - ;; ([?\M-O] . exwm-other-assigned-workspace) + ([?\M-O] . exwm-other-assigned-workspace) ;;quick calc switching ;; ([?\s-c] . switch-to-calc) @@ -179,42 +185,44 @@ (interactive (list (read-shell-command "$ "))) (start-process-shell-command command nil command))) ;; ([?\M-d] . (lambda (command) - ;; (interactive (list (read-shell-command "$ "))) - ;; (start-process-shell-command command nil command))) + ;; (interactive (list (read-shell-command "$ "))) + ;; (start-process-shell-command command nil command))) ;; browser ([?\s-e] . (lambda () (interactive) - (start-process-shell-command "vimb" nil "vimb"))) + (start-process-shell-command "firefox" nil "firefox"))) ;; ([?\M-e] . (lambda () - ;; (interactive) - ;; (start-process-shell-command "vimb" nil "vimb"))) + ;; (interactive) + ;; (start-process-shell-command "vimb" nil "vimb"))) ;;terminal - ([s-return] . 'eshell) - ;; ([M-return] . (lambda () - ;; (interactive) - ;;if we are already there, switch back - ;; (if (string= (buffer-name (current-buffer)) "*vterm*") - ;; (exwm-workspace-switch-to-buffer exwm-last-buffer) - ;; (progn - ;; (setq exwm-last-buffer (current-buffer)) - ;; (vterm))))) + ([s-return] . eshell) + ;; ((kbd "M-<return>") . eshell) + ;; ([?\M-return] . (lambda () + ;; (interactive) + ;;if we are already there, switch back + ;; (if (string= (buffer-name (current-buffer)) "*vterm*") + ;; (exwm-workspace-switch-to-buffer exwm-last-buffer) + ;; (progn + ;; (setq exwm-last-buffer (current-buffer)) + ;; (vterm))))) ;; return to the last window - ;; ([s-tab] . (lambda () + ;; ([?\s-tab] . (lambda () ;; (interactive) ;; (exwm-workspace-switch-to-buffer (other-buffer)))) ;; kill the current window and close the buffer if possible ([?\s-Q] . kill-buffer-and-window) + ([?\M-Q] . kill-buffer-and-window) ;; kill current buffer but leave window ([?\s-q] . (lambda () (interactive) (kill-buffer nil))) ;; suspend - ([?\s-`] . (lambda () - (interactive) - (start-process "" nil "loginctl" "suspend"))) + ;; ([?\s-`] . (lambda () + ;; (interactive) + ;; (start-process "" nil "loginctl" "suspend"))) )) ;; requires some custom shell scripts not included in my emacs config @@ -250,32 +258,39 @@ ;; list of cons cells (SRC . DEST), where SRC is the key sequence you press ;; and DEST is what EXWM actually sends to application. Note that both SRC ;; and DEST should be key sequences (vector or string). -;; (setq exwm-input-simulation-keys -;; '( -;; ;; movement -;; ([?\C-b] . [left]) -;; ([?\M-b] . [C-left]) -;; ([?\C-f] . [right]) -;; ([?\M-f] . [C-right]) -;; ([?\C-p] . [up]) -;; ([?\C-n] . [down]) -;; ([?\C-a] . [home]) -;; ([?\C-e] . [end]) -;; ([?\M-v] . [prior]) -;; ([?\C-v] . [next]) -;; ([?\C-d] . [delete]) -;; ([?\C-k] . [S-end delete]) -;; ;; cut/paste. -;; ;; ([?\C-w] . [?\C-x]) -;; ;; ([?\M-w] . [?\C-c]) -;; ;; ([?\C-y] . [?\C-v]) -;; ;; search -;; ([?\C-s] . [?\C-f]))) +(setq exwm-input-simulation-keys + '( + ;; movement + ([?\C-b] . [left]) + ([?\M-b] . [C-left]) + ([?\C-f] . [right]) + ([?\M-f] . [C-right]) + ([?\C-p] . [up]) + ([?\C-n] . [down]) + ([?\C-a] . [home]) + ([?\C-e] . [end]) + ([?\M-v] . [prior]) + ([?\C-v] . [next]) + ([?\C-d] . [delete]) + ([?\C-k] . [S-end delete]) + ;; cut/paste. + ;; ([?\C-w] . [?\C-x]) + ([?\M-w] . [?\C-c]) + ([?\C-y] . [?\C-v]) + ;; search + ([?\C-s] . [?\C-f]))) ;; You can hide the minibuffer and echo area when they're not used, by ;; uncommenting the following line. ;; (setq exwm-workspace-minibuffer-position 'bottom) + +;; specifically disable S-return in the minibuffer so you don't hit it on accident +;; This is here cause cause the other s-* bindings are here +(if vertico-mode + (define-key vertico-map (kbd "s-<return>") 'vertico-exit) + (define-key minibuffer-mode-map (kbd "s-<return>") 'minibuffer-complete-and-exit)) + ;; Do not forget to enable EXWM. It will start by itself when things are ;; ready. You can put it _anywhere_ in your configuration. (exwm-enable) diff --git a/emacs/site-lisp/general-text.el b/emacs/site-lisp/general-text.el index d03171a..e593487 100644 --- a/emacs/site-lisp/general-text.el +++ b/emacs/site-lisp/general-text.el @@ -20,7 +20,7 @@ (setq ispell-personal-dictionary "/home/tmu/.aspell.en.pws") (add-hook 'text-mode-hook (lambda () - (ispell-mode 1) + (ispell-minor-mode 1) (local-set-key (kbd "M-l") 'dict-map))) (electric-pair-mode 1) diff --git a/emacs/site-lisp/irc-config.el b/emacs/site-lisp/irc-config.el new file mode 100644 index 0000000..d9213ef --- /dev/null +++ b/emacs/site-lisp/irc-config.el @@ -0,0 +1,24 @@ + +;; erc stuff +(require 'erc) +(setq erc-modules '(services autojoin button completion fill imenu irccontrols list match menu + move-to-prompt netsplit networks readonly ring stamp track) + erc-nick "tccq" + erc-use-auth-source-for-nickserv-password t + erc-autojoin-channels-alist '(("libera.chat" + "#emacs" "#emacs-social" "#linux" "#archlinux" "#haskell" "#invidious")) + + erc-hide-list '("JOIN" "PART" "QUIT") + erc-current-nick-highlight-type 'nick + erc-keywords nil + erc-track-exclude-types '("JOIN" "PART" "QUIT" "NICK" "MODE") + erc-track-use-faces t + erc-track-faces-priority-list '(erc-current-nick-face erc-keyword-face) + erc-track-priority-faces-only 'all) + +(defun start-erc () + "Start erc and autojoin various channels" + (interactive) + (erc :server "irc.libera.chat" :port 6667)) + +(provide 'irc-config) diff --git a/emacs/site-lisp/modeline-config.el b/emacs/site-lisp/modeline-config.el index 873f855..b74a15d 100644 --- a/emacs/site-lisp/modeline-config.el +++ b/emacs/site-lisp/modeline-config.el @@ -2,8 +2,8 @@ (provide 'modeline-config) -(require 'battery) -(display-battery-mode 1) +;; (require 'battery) +;; (display-battery-mode 1) (use-package doom-modeline :init diff --git a/emacs/site-lisp/my-binds.el b/emacs/site-lisp/my-binds.el index d3455e4..bb80e62 100644 --- a/emacs/site-lisp/my-binds.el +++ b/emacs/site-lisp/my-binds.el @@ -17,8 +17,6 @@ (keymap-set dired-mode-map "C-o" 'dired-display-file) (keymap-set dired-mode-map "F" 'dired-do-find-marked-files) - -(global-set-key (kbd "M-l") 'forward-char) -(global-set-key (kbd "M-j") 'next-line) -(global-set-key (kbd "M-k") 'previous-line) -(global-set-key (kbd "M-h") 'backward-char) +;; searching +(global-set-key (kbd "M-s g") 'rgrep) +(global-set-key (kbd "M-s r") 'counsel-rg) diff --git a/emacs/site-lisp/my-funcs.el b/emacs/site-lisp/my-funcs.el index b1cfdec..8bed290 100644 --- a/emacs/site-lisp/my-funcs.el +++ b/emacs/site-lisp/my-funcs.el @@ -91,19 +91,21 @@ BEG and END define the region." (let ((transient-mark-mode nil)) (yank-advised-indent-function (region-beginning) (region-end))))) -(defadvice evil-paste-before (after yank-indent activate) - "If current mode is one of 'yank-indent-modes, indent yanked text (with prefix arg don't indent)." - (if (and (not (ad-get-arg 0)) - (member major-mode yank-indent-modes)) - (let ((transient-mark-mode nil)) - (yank-advised-indent-function (region-beginning) (region-end))))) - -(defadvice evil-paste-after (after yank-indent activate) - "If current mode is one of 'yank-indent-modes, indent yanked text (with prefix arg don't indent)." - (if (and (not (ad-get-arg 0)) - (member major-mode yank-indent-modes)) - (let ((transient-mark-mode nil)) - (yank-advised-indent-function (region-beginning) (region-end))))) +(if want-evil + (progn + (defadvice evil-paste-before (after yank-indent activate) + "If current mode is one of 'yank-indent-modes, indent yanked text (with prefix arg don't indent)." + (if (and (not (ad-get-arg 0)) + (member major-mode yank-indent-modes)) + (let ((transient-mark-mode nil)) + (yank-advised-indent-function (region-beginning) (region-end))))) + + (defadvice evil-paste-after (after yank-indent activate) + "If current mode is one of 'yank-indent-modes, indent yanked text (with prefix arg don't indent)." + (if (and (not (ad-get-arg 0)) + (member major-mode yank-indent-modes)) + (let ((transient-mark-mode nil)) + (yank-advised-indent-function (region-beginning) (region-end))))))) (defun fold-this-fold-forward (&optional arg) "Fold forward ARG number of sexps, defaulting to one." |
