diff options
| -rw-r--r-- | dwm-6.2/config.def.h | 1 | ||||
| -rw-r--r-- | dwm-6.2/config.h | 6 | ||||
| -rw-r--r-- | dwm-6.2/dwm.c | 24 | ||||
| -rw-r--r-- | emacs/inits/14-movement.el | 85 | ||||
| -rw-r--r-- | emacs/inits/21-functional.el | 35 |
5 files changed, 69 insertions, 82 deletions
diff --git a/dwm-6.2/config.def.h b/dwm-6.2/config.def.h index 2d824d1..47f0981 100644 --- a/dwm-6.2/config.def.h +++ b/dwm-6.2/config.def.h @@ -2,6 +2,7 @@ /* appearance */ static const unsigned int borderpx = 1; /* border pixel of windows */ +static const unsigned int gappx = 6; /* gaps between windows */ static const unsigned int snap = 32; /* snap pixel */ static const unsigned int systraypinning = 0; /* 0: sloppy systray follows selected monitor, >0: pin systray to monitor X */ static const unsigned int systrayspacing = 2; /* systray spacing */ diff --git a/dwm-6.2/config.h b/dwm-6.2/config.h index 4f37f05..db80e04 100644 --- a/dwm-6.2/config.h +++ b/dwm-6.2/config.h @@ -2,6 +2,7 @@ /* appearance */ static const unsigned int borderpx = 1; /* border pixel of windows */ +static const unsigned int gappx = 6; /* gaps between windows */ static const unsigned int snap = 16; /* snap pixel */ static const unsigned int systraypinning = 0; /* 0: sloppy systray follows selected monitor, >0: pin systray to monitor X */ static const unsigned int systrayspacing = 2; /* systray spacing */ @@ -77,7 +78,8 @@ static const char *vol_up[] = { "pactl", "set-sink-volume", "0", "+5%", NULL }; static const char *vol_mt[] = { "pactl", "set-sink-mute", "0", "toggle", NULL }; #define XF86ScreenSaver 0x1008ff2d -static const char *lock[] = { "lock", NULL }; +static const char *lock[] = {"lock", NULL}; +static const char *toggle_autolock[] = { "toggle_autolock", NULL }; static Key keys[] = { /* modifier key function argument */ @@ -88,6 +90,8 @@ static Key keys[] = { { 0, XF86AudioRaiseVolume, spawn, {.v = vol_up } }, { 0, XF86AudioMute, spawn, {.v = vol_mt } }, { 0, XF86ScreenSaver, spawn, {.v = lock } }, + { MODKEY, XK_h, spawn, {.v = lock } }, + { MODKEY|ShiftMask, XK_h, spawn, {.v = toggle_autolock } }, /* { 0, XF86MonBrightnessDown, spawn, {.v = brightness_dn } }, { 0, XF86MonBrightnessUp, spawn, {.v = brightness_up } }, diff --git a/dwm-6.2/dwm.c b/dwm-6.2/dwm.c index 2cd02b3..370f484 100644 --- a/dwm-6.2/dwm.c +++ b/dwm-6.2/dwm.c @@ -53,8 +53,8 @@ #define ISVISIBLE(C) ((C->tags & C->mon->tagset[C->mon->seltags])) #define LENGTH(X) (sizeof X / sizeof X[0]) #define MOUSEMASK (BUTTONMASK|PointerMotionMask) -#define WIDTH(X) ((X)->w + 2 * (X)->bw) -#define HEIGHT(X) ((X)->h + 2 * (X)->bw) +#define WIDTH(X) ((X)->w + 2 * (X)->bw + gappx) +#define HEIGHT(X) ((X)->h + 2 * (X)->bw + gappx) #define TAGMASK ((1 << LENGTH(tags)) - 1) #define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad) @@ -1464,12 +1464,24 @@ void resizeclient(Client *c, int x, int y, int w, int h) { XWindowChanges wc; + unsigned int gapoffset; + unsigned int gapincr; - c->oldx = c->x; c->x = wc.x = x; - c->oldy = c->y; c->y = wc.y = y; - c->oldw = c->w; c->w = wc.width = w; - c->oldh = c->h; c->h = wc.height = h; wc.border_width = c->bw; + + /* Do nothing if layout is floating */ + if (c->isfloating || c->mon->lt[c->mon->sellt]->arrange == NULL) { + gapincr = gapoffset = 0; + } else { + gapoffset = gappx; + gapincr = 2 * gappx; + } + + c->oldx = c->x; c->x = wc.x = x + gapoffset; + c->oldy = c->y; c->y = wc.y = y + gapoffset; + c->oldw = c->w; c->w = wc.width = w - gapincr; + c->oldh = c->h; c->h = wc.height = h - gapincr; + XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc); configure(c); XSync(dpy, False); diff --git a/emacs/inits/14-movement.el b/emacs/inits/14-movement.el index 4752d02..22f5c54 100644 --- a/emacs/inits/14-movement.el +++ b/emacs/inits/14-movement.el @@ -1,4 +1,4 @@ -;; Time-stamp: <2021-01-09 01:19:05 (tslil@bison)> +;; Time-stamp: <2021-07-03 17h13 EDT (hobbies)> ;; ------------------------------------------------------------------- ;; Repeated key presses for region @@ -13,68 +13,59 @@ ;; ------------------------------------------------------------------- ;; Window switching + (use-package switch-window :ensure t :bind (("C-x o" . switch-window) - ("C-x C-o" . other-frame) - ("C-c o" . switch-window) - ("C-c n" . switch-window-then-maximize) - :map switch-window-extra-map - ("u" . switch-window-mvborder-up) - ("e" . switch-window-mvborder-down) - ("n" . switch-window-mvborder-left) - ("o" . switch-window-mvborder-right) - ("i" . nil) - ("j" . nil) - ("k" . nil) - ("l" . nil)) + ("C-x C-o" . other-frame) + ("C-c o" . switch-window) + ("C-c n" . switch-window-then-maximize) + :map switch-window-extra-map + ("u" . switch-window-mvborder-up) + ("e" . switch-window-mvborder-down) + ("n" . switch-window-mvborder-left) + ("o" . switch-window-mvborder-right) + ("i" . nil) + ("j" . nil) + ("k" . nil) + ("l" . nil)) :config (setq switch-window-input-style 'minibuffer - switch-window-shortcut-style 'qwerty - switch-window-multiple-frames nil - switch-window-qwerty-shortcuts - '("a" "r" "s" "t" "n" "e" "i" "o"))) + switch-window-shortcut-style 'qwerty + switch-window-multiple-frames nil + switch-window-qwerty-shortcuts + '("a" "r" "s" "t" "n" "e" "i" "o"))) ;; ------------------------------------------------------------------- ;; Character jumping + (use-package avy :ensure t :demand :bind (("C-," . avy-goto-char-timer) - ("C-." . avy-goto-char-in-line) - ("M-g s" . avy-goto-word-or-subword-1) - ("M-g w" . avy-goto-word-1) - ("M-g a" . avy-goto-word-0) - ("M-g M-g" . avy-goto-line)) + ("C-." . avy-goto-char-in-line) + ("M-g s" . avy-goto-word-or-subword-1) + ("M-g w" . avy-goto-word-1) + ("M-g a" . avy-goto-word-0) + ("M-g C-g" . avy-goto-line)) :config (setq avy-keys '(?a ?r ?s ?t ?g ?k ?n ?e ?i ?o ?q ?w ?f ?p) - avy-dispatch-alist '((?w . avy-action-kill-move) - (?W . avy-action-kill-stay) - (?j . avy-action-teleport) - (?m . avy-action-mark) - (?c . avy-action-copy) - (?y . avy-action-yank) - (?i . avy-action-ispell) - (?z . avy-action-zap-to-char)))) - -(use-package frog-jump-buffer - :ensure t - :bind (("M-SPC" . frog-jump-buffer)) - :config - (custom-set-faces - '(frog-menu-posframe-background-face ((t (:background "#282828")))) - '(frog-menu-action-keybinding-face ((t (:inherit link)))) - '(frog-menu-prompt-face ((t (:background "#b8bb26" :foreground "#282828")))) - '(frog-menu-border ((t (:background "dark orange")))) - '(frog-menu-candidates-face ((t (:inherit default))))) - (setq frog-jump-buffer-ignore-buffers '("\\` " "*") - frog-menu-posframe-border-width 3 - frog-menu-avy-keys '(?a ?r ?s ?t ?g ?k ?n ?e ?i ?o ?' - ?q ?w ?f ?p ?b ?j ?l ?u ?y ?\; - ?z ?x ?c ?d ?v ?m ?h ?, ?.))) + avy-dispatch-alist '((?w . avy-action-kill-move) + (?W . avy-action-kill-stay) + (?j . avy-action-teleport) + (?m . avy-action-mark) + (?c . avy-action-copy) + (?y . avy-action-yank) + (?i . avy-action-ispell) + (?z . avy-action-zap-to-char)))) ;; ------------------------------------------------------------------- ;; General stuff +;; (global-set-key (kbd "C-b") 'recenter-top-bottom) +;; (global-set-key (kbd "M-b") 'downcase-word) +;; (global-set-key (kbd "C-l") 'backward-char) +;; (global-set-key (kbd "M-l") 'backward-word) + (global-set-key (kbd "C-M-e") 'end-of-buffer) (global-set-key (kbd "C-M-a") 'beginning-of-buffer) @@ -99,7 +90,7 @@ (lambda () (interactive) (ignore-errors (backward-char 5)))) ;; Hardcore mode -(defconst hardcore-nav-mode t) +(defconst hardcore-nav-mode nil) (when hardcore-nav-mode (global-set-key (kbd "<XF86Back>") nil) (global-set-key (kbd "<XF86Forward>") nil) diff --git a/emacs/inits/21-functional.el b/emacs/inits/21-functional.el index 07aaede..f863145 100644 --- a/emacs/inits/21-functional.el +++ b/emacs/inits/21-functional.el @@ -1,24 +1,14 @@ -;; Time-stamp: <2019-02-02 18:55:41 (tslil@winslow)> +;; Time-stamp: <2021-07-07 19h56 EDT (hobbies)> ;; ----------------------------------------------------------------------------- ;; Haskell -(use-package ghc :ensure t :defer t) - -(use-package company-ghc :ensure t :defer t) - -(use-package company-ghci :ensure t :defer t) - -(use-package shm :ensure t - :functions structured-haskell-mode - :bind (:map shm-map - ("C-c C-s" . shm/case-split))) +(use-package lsp-haskell :ensure t :defer) (use-package haskell-mode :ensure t - :after (company-ghc company-ghci shm) :bind (:map haskell-mode-map - ("[f8]". haskell-navigate-imports) + ("C-c C-p". haskell-navigate-imports) ("C-c C-c" . haskell-compile) ("C-c C-z" . haskell-interactive-switch) ("C-c C-l" . haskell-process-load-file) @@ -32,30 +22,19 @@ (haskell-mode . (lambda () (subword-mode 1) (aggressive-indent-mode -1) - (require 'shm) - (require 'shm-case-split) - (require 'ghc) - (ghc-init) - (structured-haskell-mode) - ;; (haskell-indentation-mode) + (haskell-indentation-mode) (interactive-haskell-mode) (turn-on-haskell-doc-mode) (turn-on-haskell-decl-scan) - (add-to-list 'company-backends 'company-ghc) - (add-to-list 'company-backends 'company-ghci) - ;; (turn-on-haskell-unicode-input-method) - ;; (haskell-mode-stylish-buffer) - ))) + (lsp) + (haskell-mode-stylish-buffer)))) :config (setq haskell-doc-show-global-types t haskell-doc-show-prelude t haskell-doc-show-user-defined t haskell-doc-show-reserved t haskell-interactive-mode-eval-pretty t - haskell-process-type 'cabal-repl - company-ghc-show-info t - company-ghc-autoscan t - company-ghc-show-module t + haskell-process-type 'auto haskell-stylish-on-save t haskell-process-use-presentation-mode t haskell-process-suggest-imports t |
