Compare commits
3 Commits
b667b54963
...
e6d2f7548a
Author | SHA1 | Date | |
---|---|---|---|
e6d2f7548a | |||
f4853bdbc5 | |||
a8cdbea488 |
9
binds.el
9
binds.el
|
@ -16,6 +16,8 @@
|
||||||
(evil-mode 1)
|
(evil-mode 1)
|
||||||
(evil-commentary-mode 1)
|
(evil-commentary-mode 1)
|
||||||
(global-undo-tree-mode 1)
|
(global-undo-tree-mode 1)
|
||||||
|
(evil-set-initial-state 'Custom-mode 'normal)
|
||||||
|
(evil-set-initial-state 'vterm-mode 'insert)
|
||||||
|
|
||||||
;; Agda input mode ∀ buffers
|
;; Agda input mode ∀ buffers
|
||||||
(load-file (let ((coding-system-for-read 'utf-8))
|
(load-file (let ((coding-system-for-read 'utf-8))
|
||||||
|
@ -27,10 +29,6 @@
|
||||||
(set-input-method "Agda"))))
|
(set-input-method "Agda"))))
|
||||||
(add-hook 'evil-insert-state-exit-hook (lambda () (set-input-method nil)))
|
(add-hook 'evil-insert-state-exit-hook (lambda () (set-input-method nil)))
|
||||||
|
|
||||||
;; No evil in certain modes
|
|
||||||
(add-hook 'vterm-mode-hook 'turn-off-evil-mode)
|
|
||||||
(add-hook 'zotero-browser-mode-hook 'turn-off-evil-mode)
|
|
||||||
|
|
||||||
;; Windowing
|
;; Windowing
|
||||||
(define-prefix-command 'create-windows)
|
(define-prefix-command 'create-windows)
|
||||||
(global-set-key (kbd "C-a") 'create-windows)
|
(global-set-key (kbd "C-a") 'create-windows)
|
||||||
|
@ -60,7 +58,7 @@
|
||||||
(evil-define-key '(normal insert visual replace operator motion emacs) 'global (kbd "C-t") nil)
|
(evil-define-key '(normal insert visual replace operator motion emacs) 'global (kbd "C-t") nil)
|
||||||
(evil-define-key '(normal insert visual replace operator motion emacs) 'global (kbd "C-d") nil)
|
(evil-define-key '(normal insert visual replace operator motion emacs) 'global (kbd "C-d") nil)
|
||||||
(evil-define-key '(normal insert visual replace operator motion emacs) 'global (kbd "C-<return>") nil)
|
(evil-define-key '(normal insert visual replace operator motion emacs) 'global (kbd "C-<return>") nil)
|
||||||
(global-set-key (kbd "C-<return>") 'vterm)
|
(global-set-key (kbd "C-<return>") 'multi-vterm)
|
||||||
(global-set-key (kbd "C-t") 'treemacs)
|
(global-set-key (kbd "C-t") 'treemacs)
|
||||||
(global-set-key (kbd "C-d") 'evil-quit)
|
(global-set-key (kbd "C-d") 'evil-quit)
|
||||||
|
|
||||||
|
@ -70,7 +68,6 @@
|
||||||
(define-key vterm-mode-map (kbd "C-j") nil)
|
(define-key vterm-mode-map (kbd "C-j") nil)
|
||||||
(define-key vterm-mode-map (kbd "C-k") nil)
|
(define-key vterm-mode-map (kbd "C-k") nil)
|
||||||
(define-key vterm-mode-map (kbd "C-l") nil)
|
(define-key vterm-mode-map (kbd "C-l") nil)
|
||||||
(define-key vterm-mode-map (kbd "C-d") nil)
|
|
||||||
|
|
||||||
(require 'org)
|
(require 'org)
|
||||||
(define-key org-mode-map (kbd "C-<return>") nil)
|
(define-key org-mode-map (kbd "C-<return>") nil)
|
||||||
|
|
82
exwm.el
82
exwm.el
|
@ -1,15 +1,85 @@
|
||||||
|
(require 'dash)
|
||||||
(require 'exwm)
|
(require 'exwm)
|
||||||
(require 'exwm-config)
|
(require 'exwm-systemtray)
|
||||||
|
|
||||||
(display-battery-mode)
|
(exwm-systemtray-enable)
|
||||||
|
|
||||||
|
(display-battery-mode 1)
|
||||||
|
(display-time-mode 1)
|
||||||
|
|
||||||
|
(defvar newbuf "*dashboard*")
|
||||||
|
|
||||||
(defun discord ()
|
(defun discord ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(start-process "discord" nil "discord"))
|
(call-process "discord" nil 0 nil))
|
||||||
|
|
||||||
;; TODO: if running, switch focus, otherwise start
|
|
||||||
(defun firefox ()
|
(defun firefox ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(start-process "firefox" nil "firefox"))
|
(let ((buff (--filter (string= "Firefox" (buffer-name it))
|
||||||
|
(buffer-list))))
|
||||||
|
(if buff
|
||||||
|
(apply 'switch-to-buffer buff)
|
||||||
|
(call-process "firefox" nil 0 nil))))
|
||||||
|
|
||||||
(exwm-config-example)
|
(defun rofi ()
|
||||||
|
(interactive)
|
||||||
|
(call-process "rofi" nil 0 nil "-show" "run"))
|
||||||
|
|
||||||
|
(defun pass ()
|
||||||
|
(interactive)
|
||||||
|
(call-process "/home/deppy/bin/cpypsk" nil 0 nil))
|
||||||
|
|
||||||
|
(defun scrot ()
|
||||||
|
(interactive)
|
||||||
|
(call-process "maim" nil 0 nil
|
||||||
|
"-s"
|
||||||
|
(concat "/home/deppy/img/scrot/" (format-time-string "%s" (current-time)) ".png")))
|
||||||
|
|
||||||
|
(setq exwm-input-global-keys
|
||||||
|
`((,(kbd "s-E") . exwm-exit)
|
||||||
|
(,(kbd "s-Q") . evil-quit)
|
||||||
|
;; Windowing
|
||||||
|
(,(kbd "s-h") . (lambda () (interactive) (evil-window-decrease-width 1)))
|
||||||
|
(,(kbd "s-j") . (lambda () (interactive) (select-window (next-window))))
|
||||||
|
(,(kbd "s-k") . (lambda () (interactive) (select-window (previous-window))))
|
||||||
|
(,(kbd "s-l") . (lambda () (interactive) (evil-window-increase-width 1)))
|
||||||
|
|
||||||
|
;; Maybe use window-right, window-left, etc, and add things to split in all directions too?
|
||||||
|
(,(kbd "s-J") . (lambda () (interactive)
|
||||||
|
(window-swap-states (selected-window) (next-window))))
|
||||||
|
(,(kbd "s-K") . (lambda () (interactive)
|
||||||
|
(window-swap-states (selected-window) (previous-window))))
|
||||||
|
(,(kbd "s-L") . (lambda () (interactive)
|
||||||
|
(select-window (split-window-right))
|
||||||
|
(switch-to-buffer ,newbuf)))
|
||||||
|
(,(kbd "s-H") . (lambda () (interactive)
|
||||||
|
(let ((cwin (selected-window))
|
||||||
|
(nwin (split-window-right)))
|
||||||
|
(window-swapstated cwin nwin)
|
||||||
|
(select-window nwin)
|
||||||
|
(switch-to-buffer ,newbuf))))
|
||||||
|
|
||||||
|
(,(kbd "s-r") . exwm-reset)
|
||||||
|
(,(kbd "s-f") . exwm-layout-set-fullscreen)
|
||||||
|
|
||||||
|
;; Applications
|
||||||
|
(,(kbd "s-<backspace>") . firefox)
|
||||||
|
(,(kbd "s-<return>") . multi-vterm)
|
||||||
|
(,(kbd "s-d") . rofi)
|
||||||
|
(,(kbd "s-p") . pass)
|
||||||
|
(,(kbd "<print>") . scrot)
|
||||||
|
|
||||||
|
;; Workspaces
|
||||||
|
,@(mapcar (lambda (i)
|
||||||
|
`(,(kbd (format "s-%d" i)) .
|
||||||
|
(lambda ()
|
||||||
|
(interactive)
|
||||||
|
(exwm-workspace-switch-create ,i))))
|
||||||
|
(number-sequence 0 9))))
|
||||||
|
|
||||||
|
(add-hook 'exwm-update-class-hook
|
||||||
|
(lambda () (exwm-workspace-rename-buffer exwm-class-name)))
|
||||||
|
|
||||||
|
(setq exwm-manage-force-tiling 1)
|
||||||
|
|
||||||
|
(exwm-init)
|
||||||
|
|
106
init.el
106
init.el
|
@ -1,3 +1,77 @@
|
||||||
|
;;; -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
;;; BEGIN OPTIMIZATION
|
||||||
|
|
||||||
|
;; Optimizations (mostly taken from doom)
|
||||||
|
(defvar init-done-hook nil)
|
||||||
|
|
||||||
|
;; Don't garbage collect during init
|
||||||
|
(add-hook 'init-done-hook
|
||||||
|
`(lambda () (setq gc-cons-threshold
|
||||||
|
,(default-toplevel-value 'gc-cons-threshold))))
|
||||||
|
(setq gc-cons-threshold most-positive-fixnum)
|
||||||
|
|
||||||
|
;; Don't use file type handlers during init
|
||||||
|
(let ((old-value (default-toplevel-value 'file-name-handler-alist)))
|
||||||
|
(setq file-name-handler-alist nil)
|
||||||
|
(set-default-toplevel-value 'file-name-handler-alist file-name-handler-alist)
|
||||||
|
(put 'file-name-handler-alist 'initial-value old-value)
|
||||||
|
(add-hook 'init-done-hook
|
||||||
|
(lambda ()
|
||||||
|
(setq file-name-handler-alist
|
||||||
|
;; Merge instead of overwrite because there may have been changes to
|
||||||
|
;; `file-name-handler-alist' since startup we want to preserve.
|
||||||
|
(delete-dups (append file-name-handler-alist old-value))))))
|
||||||
|
|
||||||
|
;; Don't resize during init
|
||||||
|
(setq frame-inhibit-implied-resize t)
|
||||||
|
(setq inhibit-startup-screen t
|
||||||
|
inhibit-startup-echo-area-message user-login-name)
|
||||||
|
(advice-add #'display-startup-echo-area-message :override #'ignore)
|
||||||
|
(advice-add #'display-startup-screen :override #'ignore)
|
||||||
|
|
||||||
|
;; Don't use advanced modes for scratch buffer
|
||||||
|
(setq initial-major-mode 'fundamental-mode
|
||||||
|
initial-scratch-message nil)
|
||||||
|
|
||||||
|
;; Don't cause rewrites when loading file
|
||||||
|
(define-advice load-file (:override (file) silence) (load file nil 'nomessage))
|
||||||
|
(define-advice startup--load-user-init-file (:before (&rest _) undo-silence)
|
||||||
|
(advice-remove #'load-file #'load-file@silence))
|
||||||
|
|
||||||
|
;; Disable modeline
|
||||||
|
(put 'mode-line-format 'initial-value (default-toplevel-value 'mode-line-format))
|
||||||
|
(setq-default mode-line-format nil)
|
||||||
|
(dolist (buf (buffer-list))
|
||||||
|
(with-current-buffer buf (setq mode-line-format nil)))
|
||||||
|
|
||||||
|
;; Inhibit redraws
|
||||||
|
(setq-default inhibit-redisplay t
|
||||||
|
inhibit-message t)
|
||||||
|
(defun reset-inhibited-vars-h ()
|
||||||
|
(setq-default inhibit-redisplay nil
|
||||||
|
;; Inhibiting `message' only prevents redraws and
|
||||||
|
inhibit-message nil)
|
||||||
|
(redraw-frame))
|
||||||
|
(add-hook 'after-init-hook #'reset-inhibited-vars-h)
|
||||||
|
|
||||||
|
(define-advice startup--load-user-init-file (:after (&rest _) undo-inhibit-vars)
|
||||||
|
(when init-file-had-error
|
||||||
|
(reset-inhibited-vars-h))
|
||||||
|
(unless (default-toplevel-value 'mode-line-format)
|
||||||
|
(setq-default mode-line-format (get 'mode-line-format 'initial-value))))
|
||||||
|
|
||||||
|
;; Don't load toolbar
|
||||||
|
(advice-add #'tool-bar-setup :override #'ignore)
|
||||||
|
(define-advice startup--load-user-init-file (:before (&rest _) defer-tool-bar-setup)
|
||||||
|
(advice-remove #'tool-bar-setup #'ignore)
|
||||||
|
(add-transient-hook! 'tool-bar-mode (tool-bar-setup)))
|
||||||
|
|
||||||
|
;; Don't bother with MACOS exclusive options
|
||||||
|
(setq command-line-ns-option-alist nil)
|
||||||
|
|
||||||
|
;;; END OPTIMIZATION
|
||||||
|
|
||||||
;; Packages
|
;; Packages
|
||||||
(require 'package)
|
(require 'package)
|
||||||
(setq package-archives '(("gnu" . "https://elpa.gnu.org/packages/")
|
(setq package-archives '(("gnu" . "https://elpa.gnu.org/packages/")
|
||||||
|
@ -29,20 +103,33 @@
|
||||||
;; Exwm
|
;; Exwm
|
||||||
(include "exwm.el")
|
(include "exwm.el")
|
||||||
|
|
||||||
;; Don't touch
|
|
||||||
(custom-set-variables
|
(custom-set-variables
|
||||||
;; custom-set-variables was added by Custom.
|
;; custom-set-variables was added by Custom.
|
||||||
;; If you edit it by hand, you could mess it up, so be careful.
|
;; If you edit it by hand, you could mess it up, so be careful.
|
||||||
;; Your init file should contain only one such instance.
|
;; Your init file should contain only one such instance.
|
||||||
;; If there is more than one, they won't work right.
|
;; If there is more than one, they won't work right.
|
||||||
'(elcord-display-buffer-details nil)
|
'(display-time-24hr-format t)
|
||||||
'(elcord-mode t nil (elcord))
|
'(display-time-default-load-average nil)
|
||||||
'(elcord-quiet t)
|
'(display-time-interval 15)
|
||||||
'(elcord-use-major-mode-as-main-icon t)
|
'(display-time-mode t)
|
||||||
'(evil-undo-system 'undo-tree)
|
'(evil-undo-system 'undo-tree)
|
||||||
|
'(image-converter 'imagemagick)
|
||||||
|
'(image-file-name-extensions
|
||||||
|
'("png" "jpeg" "jpg" "gif" "tiff" "tif" "xbm" "xpm" "pbm" "pgm" "ppm" "pnm" "svg" "ora"))
|
||||||
|
'(image-use-external-converter t)
|
||||||
|
'(imagemagick-enabled-types
|
||||||
|
'(3FR ARW AVS BMP BMP2 BMP3 CAL CALS CMYK CMYKA CR2 CRW CUR CUT DCM DCR DCX DDS DJVU DNG DPX EXR FAX FITS GBR GIF GIF87 GRB HRZ ICB ICO ICON J2C JNG JP2 JPC JPEG JPG JPX K25 KDC MIFF MNG MRW MSL MSVG MTV NEF ORF OTB PBM PCD PCDS PCL PCT PCX PDB PEF PGM PICT PIX PJPEG PNG PNG24 PNG32 PNG8 PNM PPM PSD PTIF PWP RAF RAS RBG RGB RGBA RGBO RLA RLE SCR SCT SFW SGI SR2 SRF SUN SVG SVGZ TGA TIFF TIFF64 TILE TIM TTF UYVY VDA VICAR VID VIFF VST WBMP WPG X3F XBM XC XCF XPM XV XWD YCbCr YCbCrA YUV ORA))
|
||||||
'(org-agenda-files '("/home/deppy/doc/org/todo.org"))
|
'(org-agenda-files '("/home/deppy/doc/org/todo.org"))
|
||||||
'(package-selected-packages
|
'(package-selected-packages
|
||||||
'(exwm elcord org-superstar org-fragtog org-pretty-tags visual-fill writeroom-mode haskell-emacs treemacs-evil treemacs solarized-theme doom-modeline all-the-icons-dired page-break-lines all-the-icons dashboard org-evil zotero vterm magit undo-fu latex-math-preview use-package haskell-mode evil-surround undo-tree evil-org evil))
|
'(multi-vterm dmenu markdown-preview-mode markdown-mode exwm org-superstar org-fragtog org-pretty-tags visual-fill writeroom-mode haskell-emacs treemacs-evil treemacs solarized-theme doom-modeline all-the-icons-dired page-break-lines all-the-icons dashboard org-evil zotero vterm magit undo-fu latex-math-preview use-package haskell-mode evil-surround undo-tree evil-org evil))
|
||||||
|
'(shell-file-name "/bin/bash")
|
||||||
|
'(treemacs-collapse-dirs 3)
|
||||||
|
'(treemacs-filewatch-mode t)
|
||||||
|
'(treemacs-follow-mode t)
|
||||||
|
'(treemacs-fringe-indicator-mode t)
|
||||||
|
'(treemacs-git-mode t)
|
||||||
|
'(treemacs-no-delete-other-windows nil)
|
||||||
|
'(treemacs-select-when-already-in-treemacs 'next-or-back)
|
||||||
'(warning-suppress-log-types '((comp)))
|
'(warning-suppress-log-types '((comp)))
|
||||||
'(warning-suppress-types '((comp)))
|
'(warning-suppress-types '((comp)))
|
||||||
'(writeroom-mode-line t)
|
'(writeroom-mode-line t)
|
||||||
|
@ -61,3 +148,10 @@
|
||||||
'(bookmark-face ((t (:foreground "#fdf6e3"))))
|
'(bookmark-face ((t (:foreground "#fdf6e3"))))
|
||||||
'(mode-line ((t (:underline nil :overline nil))))
|
'(mode-line ((t (:underline nil :overline nil))))
|
||||||
'(mode-line-inactive ((t (:underline nil :overline nil)))))
|
'(mode-line-inactive ((t (:underline nil :overline nil)))))
|
||||||
|
|
||||||
|
;; Reset values
|
||||||
|
(run-hooks 'init-done-hook)
|
||||||
|
|
||||||
|
;; Performance post-init
|
||||||
|
(setq gc-cons-threshold (* 512 1024 1024))
|
||||||
|
(run-with-idle-timer 1 t 'garbage-collect)
|
||||||
|
|
|
@ -17,6 +17,3 @@
|
||||||
(python . t)
|
(python . t)
|
||||||
(java . t)
|
(java . t)
|
||||||
(haskell . t)))
|
(haskell . t)))
|
||||||
|
|
||||||
(require 'elcord)
|
|
||||||
(elcord-mode)
|
|
||||||
|
|
7
style.el
7
style.el
|
@ -23,7 +23,7 @@
|
||||||
;; Tool bar mode
|
;; Tool bar mode
|
||||||
(menu-bar-mode -1)
|
(menu-bar-mode -1)
|
||||||
(tool-bar-mode -1)
|
(tool-bar-mode -1)
|
||||||
(toggle-scroll-bar -1)
|
(scroll-bar-mode -1)
|
||||||
|
|
||||||
;; Images
|
;; Images
|
||||||
(setq image-use-external-converter t)
|
(setq image-use-external-converter t)
|
||||||
|
@ -79,3 +79,8 @@
|
||||||
(writeroom-mode)))
|
(writeroom-mode)))
|
||||||
(setq org-format-latex-options '(:scale 1.5))
|
(setq org-format-latex-options '(:scale 1.5))
|
||||||
(setq org-agenda-start-on-weekday 1)
|
(setq org-agenda-start-on-weekday 1)
|
||||||
|
|
||||||
|
|
||||||
|
(add-hook 'markdown-mode-hook (lambda ()
|
||||||
|
(visual-line-mode)
|
||||||
|
(writeroom-mode)))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user