Compare commits

...

4 Commits

Author SHA1 Message Date
Aryadev Chavali
102eef308f bunch of stuff that doesn't matter 2026-03-18 19:57:34 +00:00
Aryadev Chavali
f394d004ff Dedicated configuration for gdb, including gdb-many-windows
- I've setup a better window layout for gdb-many-windows:
    | command window | source code |
    | helper buffers | program i/o |
- Hydra to swap between the various helper buffers quickly
2026-01-28 07:52:46 +00:00
Aryadev Chavali
fcfe3504d8 Swap "gf" and "gF" for Evil Emacs 2026-01-28 07:52:26 +00:00
Aryadev Chavali
ef825d4544 +project/rgrep for nice recursive grep in a project 2026-01-28 07:51:53 +00:00
12 changed files with 121 additions and 57 deletions

View File

@@ -8,7 +8,7 @@ AlignEscapedNewlines: true
AllowShortFunctionsOnASingleLine: false
AllowShortLambdasOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakTemplateDeclarations: Yes
AlwaysBreakTemplateDeclarations: No
BasedOnStyle: LLVM
BreakBeforeBraces: Allman
ColumnLimit: 80

View File

@@ -0,0 +1 @@
(((min-height . 12) (min-width . 20) (min-height-ignore . 9) (min-width-ignore . 6) (min-height-safe . 3) (min-width-safe . 4) (min-pixel-height . 288) (min-pixel-width . 200) (min-pixel-height-ignore . 216) (min-pixel-width-ignore . 60) (min-pixel-height-safe . 72) (min-pixel-width-safe . 40)) hc (pixel-width . 1910) (pixel-height . 1025) (total-width . 191) (total-height . 43) (normal-height . 1.0) (normal-width . 1.0) (combination-limit) (leaf (pixel-width . 880) (pixel-height . 1025) (total-width . 88) (total-height . 43) (normal-height . 1.0) (normal-width . 0.46073298429319376) (parameters (context) (gdb-buffer-type . source)) (buffer " *gdb-placeholder*" (selected) (hscroll . 0) (fringes 10 0 nil nil) (margins nil) (scroll-bars nil 0 t nil 0 t nil) (vscroll . 0) (dedicated) (point . 1) (start . 1))) (vc (last . t) (pixel-width . 1030) (pixel-height . 1025) (total-width . 103) (total-height . 43) (normal-height . 1.0) (normal-width . 0.5392670157068062) (combination-limit) (leaf (pixel-width . 1030) (pixel-height . 360) (total-width . 103) (total-height . 15) (normal-height . 0.35121951219512193) (normal-width . 1.0) (parameters (context) (gdb-buffer-type . gdb-breakpoints-buffer)) (buffer " *gdb-placeholder*" (selected) (hscroll . 0) (fringes 10 0 nil nil) (margins nil) (scroll-bars nil 0 t nil 0 t nil) (vscroll . 0) (dedicated . t) (point . 1) (start . 1))) (leaf (pixel-width . 1030) (pixel-height . 336) (total-width . 103) (total-height . 14) (normal-height . 0.3278048780487805) (normal-width . 1.0) (parameters (context) (gdb-buffer-type . command)) (buffer " *gdb-placeholder*" (selected) (hscroll . 0) (fringes 10 0 nil nil) (margins nil) (scroll-bars nil 0 t nil 0 t nil) (vscroll . 0) (dedicated) (point . 1) (start . 1))) (leaf (last . t) (pixel-width . 1030) (pixel-height . 329) (total-width . 103) (total-height . 14) (normal-height . 0.32097560975609757) (normal-width . 1.0) (parameters (context) (gdb-buffer-type . gdb-inferior-io)) (buffer " *gdb-placeholder*" (selected . t) (hscroll . 0) (fringes 10 0 nil nil) (margins nil) (scroll-bars nil 0 t nil 0 t nil) (vscroll . 0) (dedicated . t) (point . 1) (start . 1)))))

View File

@@ -663,7 +663,9 @@ system directly, rather than me explain every setting.
"zC" #'hs-hide-level
"zO" #'hs-show-all
"M-," #'evil-jump-backward
"M-." #'evil-jump-forward)
"M-." #'evil-jump-forward
"gf" #'evil-find-file-at-point-with-line
"gF" #'find-file-at-point)
(:states '(normal motion visual)
:keymaps 'override
@@ -1015,40 +1017,48 @@ it takes a bit less time.
Here I:
- Bind ~project-prefix-map~ to "<leader>p"
- Bind a tags generation command to "<leader>pr" which mimics
projectile's one
- Define ~+project/generate-tags~ to generate ctags quickly (like
=projectile=), and bind it.
- Define ~+project/rgrep~, which does an [[*Grep][rgrep]] from the
project root.
#+begin_src emacs-lisp
(use-package project
:straight t
:defer t
:general
(:keymaps 'project-prefix-map
"r" #'+project/generate-tags)
(leader
"p" project-prefix-map)
(:keymaps 'project-prefix-map
"r" #'+project/generate-tags
"g" #'+project/rgrep)
:config
(setq project-vc-extra-root-markers '(".project"))
(defun +project/command (folder)
(format "ctags -Re -f %sTAGS %s*"
folder folder))
(defun +project/root ()
(if (project-current)
(project-root (project-current))
default-directory))
(defun +project/rgrep (regexp &optional files)
(interactive
(let* ((regexp (grep-read-regexp))
(files (grep-read-files regexp)))
(list regexp files)))
(rgrep regexp files (+project/root)))
(defun +project/generate-tags ()
(interactive)
(set-process-sentinel
(start-process-shell-command
"PROJECT-GENERATE-TAGS"
"*tags*"
(+project/command (+project/root)))
(lambda (p event)
(when (string= event "finished\n")
(message "Finished generating tags!")
(visit-tags-table (format "%sTAGS" (+project/root))))))))
(let ((folder (+project/root)))
(set-process-sentinel
(start-process-shell-command
"PROJECT-GENERATE-TAGS"
"*tags*"
(format "ctags -Re -f %sTAGS %s*" folder folder))
(lambda (p event)
(when (string= event "finished\n")
(message "Finished generating tags!")
(visit-tags-table (format "%sTAGS" folder))))))))
#+end_src
* Aesthetics
General look and feel of Emacs, perhaps the most important of all the
@@ -2509,15 +2519,11 @@ playing.
("SomaFM - The Trip" . "http://www.somafm.com/thetrip.pls"))))
#+end_src
** Grand Unified Debugger (GUD)
GUD is a system for debugging, hooking into processes and
providing an interface to the user all in Emacs. Here I define a
hydra which provides a ton of the useful =gud= keybindings that exist
in an Emacs-only map.
GUD is a system for debugging, hooking into processes and providing an
interface to the user all in Emacs. Here I define a hydra for the
various =gud= keybindings, to make debugging a bit less painful.
#+begin_src emacs-lisp
(use-package gud
:config
(evil-set-initial-state 'gdb-disassembly-mode 'motion)
(evil-set-initial-state 'gdb-registers-mode 'motion)
:after hydra
:hydra
(gud-hydra
@@ -2553,8 +2559,66 @@ in an Emacs-only map.
("TAB" #'gud-stepi "Stepi"
:column "Control Flow"))
:general
(code-leader "d" #'gud-hydra/body
"D" #'gdb))
(code-leader
"d" #'gud-hydra/body))
#+end_src
** GDB
GDB is a little wrapper on top of GUD for GDB specific functionality.
#+begin_src emacs-lisp
(use-package gud
:after hydra
:init
(setopt gdb-default-window-configuration-file
(no-littering-expand-etc-file-name "gdb-window-config")
gdb-restore-window-configuration-after-quit t)
:config
(evil-set-initial-state 'gdb-disassembly-mode 'motion)
(evil-set-initial-state 'gdb-registers-mode 'motion)
(evil-set-initial-state 'gdb-locals-mode 'motion)
(evil-set-initial-state 'gdb-frames-mode 'motion)
(evil-set-initial-state 'gdb-threads-mode 'motion)
(evil-set-initial-state 'gdb-breakpoints-mode 'motion)
(defun +gdb/switch-buffer (type)
(interactive)
(gdb-set-window-buffer
(gdb-get-buffer-create type gdb-thread-number)
t))
(cl-loop for type in '(gdb-locals-buffer
gdb-registers-buffer
gdb-stack-buffer
gdb-breakpoints-buffer
gdb-threads-buffer)
for name = (intern (concat "+gdb/--switch-" (symbol-name type)))
do (eval `(defun ,name ()
(interactive)
(+gdb/switch-buffer ',type))))
:hydra
(gdb-buffer-hydra
() "Hydra for the various buffers GDB generates"
("l" #'+gdb/--switch-gdb-locals-buffer "locals")
("r" #'+gdb/--switch-gdb-registers-buffer "registers")
("f" #'+gdb/--switch-gdb-stack-buffer "frames")
("b" #'+gdb/--switch-gdb-breakpoints-buffer "breakpoints")
("t" #'+gdb/--switch-gdb-threads-buffer "threads")
("ESC" nil "Exit" :exit t))
:general
(code-leader
"g" #'gdb)
(local-leader
:keymaps 'gud-mode-map
"m" #'gdb-many-windows)
(nmmap
:keymaps 'gdb-frames-mode-map
"RET" #'gdb-select-frame)
(nmmap
:keymaps '(gdb-locals-mode-map
gdb-registers-mode-map
gdb-frames-mode-map
gdb-breakpoints-mode-map
gdb-threads-mode-map)
"TAB" #'gdb-buffer-hydra/body))
#+end_src
** Jira
#+begin_src emacs-lisp

View File

@@ -38,20 +38,21 @@
(defvar bml/--minimum-padding 4
"Minimum size of padding string.")
(defun bml/--get-padding-size (other-size)
"Compute length of padding to ensure string of size OTHER-SIZE is on an
extreme end to CENTRE-SEGMENT."
(let ((centre-size (length (format-mode-line bml/centre-segment)))
(window-width ;; compute total width of window (including margins)
(thread-last (cons (window-width) (window-margins))
(mapcar (lambda (x) (if (null x) 0 x)))
(cl-reduce #'+))))
(floor (- (/ window-width 2) (/ centre-size 2) other-size))))
(defun bml/--get-left-padding-size ()
(let* ((left-segment-size (length (format-mode-line bml/left-segment)))
(centre-size (length (format-mode-line bml/centre-segment)))
(window-margins (window-margins))
(window-width (thread-last
(cons (window-width)
(if (null (car window-margins))
(list 0)
(list (car window-margins) (cdr window-margins))))
(cl-reduce #'+))))
(floor (- (/ window-width 2) (/ centre-size 2) left-segment-size))))
(defun bml/--generate-padding (segment)
(defun bml/--generate-left-padding ()
"Make padding string to separate center segment from SEGMENT."
(let* ((segment-size (length (format-mode-line segment)))
(padding-size (bml/--get-padding-size segment-size)))
(let ((padding-size (bml/--get-left-padding-size)))
(make-string (max padding-size bml/--minimum-padding) ?\s)))
(defun bml/setup-mode-line ()
@@ -60,8 +61,7 @@ extreme end to CENTRE-SEGMENT."
- segments are updated."
(setq-default mode-line-format
`(,bml/left-segment
(:eval (bml/--generate-padding
bml/left-segment))
(:eval (bml/--generate-left-padding))
,bml/centre-segment
;; NOTE: Emacs 30!
mode-line-format-right-align

View File

@@ -2,6 +2,6 @@
"NeoSolarized": { "branch": "master", "commit": "b94b1a9ad51e2de015266f10fdc6e142f97bd617" },
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
"telescope.nvim": { "branch": "master", "commit": "ad7d9580338354ccc136e5b8f0aa4f880434dcdc" },
"vim-tmux-navigator": { "branch": "master", "commit": "c45243dc1f32ac6bcf6068e5300f3b2b237e576a" }
"telescope.nvim": { "branch": "master", "commit": "5255aa27c422de944791318024167ad5d40aad20" },
"vim-tmux-navigator": { "branch": "master", "commit": "e41c431a0c7b7388ae7ba341f01a0d217eb3a432" }
}

View File

@@ -1,3 +1,5 @@
#!/usr/bin/env sh
feh --bg-fill --randomize $HOME/Pictures/Backgrounds;
choice=$(shuf < $HOME/Pictures/Backgrounds/dark.txt | head -1)
# feh --bg-fill --randomize $HOME/Pictures/Backgrounds;
feh --bg-fill $HOME/Pictures/Backgrounds/$choice;

View File

@@ -1,3 +1,3 @@
#!/usr/bin/env sh
scrot -f -s '%Y%m%d_%H%M%S.png' -e 'mv $f ~/Pictures/';
gscreenshot;

View File

@@ -1,9 +1,6 @@
#!/usr/bin/env sh
app=$(wmctrl -l |\
awk '{for (i=4; i<=NF; i++) printf "%s ", $i; print ""}' |\
dmenu -i -p "Switch to: ")
if [ ! -z "$app" ]
then
wmctrl -a $app
fi
awk '{for (i=4; i<=NF; i++) printf "%s ", $i; print ""}' |\
dmenu -l 4 -i -p "Switch to: ")
[ ! -z "$app" ] && $(wmctrl -a $app)

View File

@@ -4,8 +4,7 @@ processes="st btop
emacsclient -c -a emacs
$HOME/.local/scripts/browser
steam
discord
spotify"
"
printf '%s\n' "$processes" | \

View File

@@ -1,3 +1,3 @@
#!/usr/bin/env sh
echo "㊋ $(sensors | grep "Core" | sed 's/Core [0-9]:[ ]*+//;s/C.*//' | sort -r | head -1)C"
echo "㊋ $(sensors | grep "Tctl" | sed 's/Tctl:.*+//;s/C.*//')C"

View File

@@ -3,7 +3,7 @@
killall sxhkd;
sh .xprofile;
$HOME/.local/scripts/screentimer on;
$HOME/.local/scripts/screentimer off;
xrandr --output HDMI1 --auto --mode 1920x1080 --left-of eDP1;
xrandr --output eDP1 --auto --mode 1920x1080;
@@ -14,7 +14,6 @@ $(xss-lock --transfer-sleep-lock -- $HOME/.local/scripts/lock) &
sxhkd &
dunst &
dwmblocks &
# $HOME/.local/scripts/compositor &
$HOME/.local/scripts/background &
while :

View File

@@ -1,4 +1,4 @@
personal_ws-1.1 en 192
personal_ws-1.1 en 194
Architecting
Aryadev
Automorphism
@@ -113,6 +113,7 @@ incentivises
infinitum
injective
inlined
innovatively
instrinsics
intuitionism
intuitionist
@@ -179,6 +180,7 @@ telekinetically
tokenisation
tokenise
tokeniser
transformative
uncomputable
uncountably
undealt