Tons of changes

This commit is contained in:
2024-06-22 02:26:08 +01:00
parent 3ef303fb67
commit a89353eeb8
9 changed files with 209 additions and 90 deletions

View File

@@ -9,21 +9,32 @@
#+latex_class_options: [a4paper,12pt] #+latex_class_options: [a4paper,12pt]
* Introduction * Introduction
:PROPERTIES:
:header-args:emacs-lisp: :tangle config.el :results none
:END:
Welcome to my Emacs configuration. You may be confused by the fact Welcome to my Emacs configuration. You may be confused by the fact
it's a readable document rather than some code; this file serves as it's a readable document rather than some code; this file serves as
both documentation *and* code. Here's an example of some Emacs Lisp both documentation *and* code. Here's an example of some Emacs Lisp
code: code:
#+begin_src emacs-lisp #+begin_src emacs-lisp
;; Copyright (C) 2024 Aryadev Chavali ;;; config.el --- Compiled configuration from config.org -*- lexical-binding: t; -*-
;; All rights reserved. You may not distribute or modify this code
;; without explicit legal permission from the author "Aryadev Chavali"
;; Copyright (C) 2024 Aryadev Chavali
;; Author: Aryadev Chavali <aryadev@aryadevchavali.com>
;; You may distribute and modify this code under the terms of the MIT
;; license. You should have received a copy of the MIT license with
;; this file. If not, please write to: aryadev@aryadevchavali.com.
;;; Commentary:
;; Welcome to my Emacs configuration. This file is considered ;; Welcome to my Emacs configuration. This file is considered
;; volatile i.e. any edits made to this file will be overwritten if ;; volatile i.e. any edits made to this file will be overwritten if
;; and when the configuration is compiled again. ;; and when the configuration is compiled again.
;; To propagate edits from this file to the literate document, call ;; To propagate edits from this file to the literate document, call
;; (org-babel-detangle) while in the file. ;; (org-babel-detangle) while in the file.
;;; Code:
#+end_src #+end_src
This is an Emacs Lisp code block, something you will see a *LOT* of This is an Emacs Lisp code block, something you will see a *LOT* of
@@ -55,6 +66,7 @@ Let's setup a few things:
+ Backup files (~backup-directory-alist~) + Backup files (~backup-directory-alist~)
+ Refreshing buffers when a change occurs (~auto-revert-mode~) + Refreshing buffers when a change occurs (~auto-revert-mode~)
+ Yes or no questions being less painful (~y-or-n-p~) + Yes or no questions being less painful (~y-or-n-p~)
+ Make the clipboard work seamlessly with the clipboard
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package emacs (use-package emacs
@@ -66,7 +78,8 @@ Let's setup a few things:
save-buffer-coding-system 'utf-8-unix save-buffer-coding-system 'utf-8-unix
backup-directory-alist `(("." . ,(no-littering-expand-var-file-name "saves/"))) backup-directory-alist `(("." . ,(no-littering-expand-var-file-name "saves/")))
global-auto-revert-non-file-buffers t global-auto-revert-non-file-buffers t
auto-revert-verbose nil) auto-revert-verbose nil
select-enable-clipboard t)
:config :config
(fset 'yes-or-no-p 'y-or-n-p) (fset 'yes-or-no-p 'y-or-n-p)
(global-auto-revert-mode)) (global-auto-revert-mode))
@@ -219,7 +232,7 @@ Make font size bigger on my laptop and smaller on my desktop.
:config :config
(+oreo/sys-name-cond (+oreo/sys-name-cond
("newboy" (set-face-attribute 'default nil :height 145)) ("newboy" (set-face-attribute 'default nil :height 145))
("oldboy" (set-face-attribute 'default nil :height 130)))) ("oldboy" (set-face-attribute 'default nil :height 135))))
#+end_src #+end_src
** Startup screen ** Startup screen
The default startup screen is quite bad in all honesty. While for a The default startup screen is quite bad in all honesty. While for a
@@ -514,11 +527,15 @@ Setup the evil package, with some opinionated keybindings:
more more
- Switch ~evil-goto-mark~ and ~evil-goto-mark-line~ as I'd rather have - Switch ~evil-goto-mark~ and ~evil-goto-mark-line~ as I'd rather have
the global one closer to the home row the global one closer to the home row
- Push the mark when exiting visual mode
- On entering visual mode, the mark is set, so by pushing it when
exiting we can use the mark-ring for other stuff
- Use 'T' character as an action for transposing objects - Use 'T' character as an action for transposing objects
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package evil (use-package evil
:demand t :demand t
:straight t :straight t
:hook (evil-visual-state-entry-hook . push-mark)
:general :general
(leader (leader
"w" '(evil-window-map :which-key "Window") "w" '(evil-window-map :which-key "Window")
@@ -532,10 +549,14 @@ Setup the evil package, with some opinionated keybindings:
"zC" #'hs-hide-level "zC" #'hs-hide-level
"zO" #'hs-show-all "zO" #'hs-show-all
"'" #'evil-goto-mark "'" #'evil-goto-mark
"`" #'evil-goto-mark-line "`" #'evil-goto-mark-line)
"C-w" #'evil-window-map
(general-def
:keymaps 'override
:states '(normal motion visual)
"gu" #'evil-upcase "gu" #'evil-upcase
"gU" #'evil-downcase "gU" #'evil-downcase
"M-y" #'yank-pop
"T" nil) "T" nil)
(nmmap (nmmap
@@ -735,11 +756,9 @@ looking for a command.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package amx (use-package amx
:straight t :straight t
:defer t :hook (after-init-hook . amx-mode)
:init :init
(setq amx-backend 'ivy) (setq amx-backend 'ivy))
:config
(amx-mode))
#+end_src #+end_src
*** Orderless *** Orderless
Orderless sorting method for completion, probably one of the best Orderless sorting method for completion, probably one of the best
@@ -767,10 +786,7 @@ around.
"RET" #'choose-completion) "RET" #'choose-completion)
:config :config
(with-eval-after-load "evil" (with-eval-after-load "evil"
(setq evil-emacs-state-modes (cl-remove-if (evil-set-initial-state 'completions-list-mode 'normal)))
#'(lambda (x) (eq 'completions-list-mode x))
evil-emacs-state-modes))
(add-to-list 'evil-normal-state-modes 'completions-list-mode)))
#+end_src #+end_src
*** Company *** Company
Company is the auto complete system I use. I don't like having heavy Company is the auto complete system I use. I don't like having heavy
@@ -1100,6 +1116,9 @@ really need this in my config at all times. Enable when needed.
:defer t) :defer t)
#+end_src #+end_src
** Hl-line ** Hl-line
:PROPERTIES:
:header-args:emacs-lisp: :tangle no
:END:
Highlights the current line. Highlights the current line.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package hl-line (use-package hl-line
@@ -1335,26 +1354,13 @@ at last.
:config :config
(save-place-mode)) (save-place-mode))
#+end_src #+end_src
** Rot13
ROT13 encoding is a pretty simple cipher; fun to make decoders and
encoders for. Emacs has default support for it, to the point where it
can display files with the encoding without changing the underlying
text. That's what this is mainly for.
#+begin_src emacs-lisp
(use-package rot13
:defer t
:general
(mode-leader
"r" #'toggle-rot13-mode))
#+end_src
** Licensing ** Licensing
Loads [[file:elisp/license.el][license.el]] for inserting licenses. Loads [[file:elisp/license.el][license.el]] for inserting licenses.
Licenses are important for distribution and attribution to be defined Licenses are important for distribution and attribution to be defined
clearly. clearly.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package license (use-package license
:defer t :demand t
:load-path "elisp/" :load-path "elisp/"
:general :general
(insert-leader (insert-leader
@@ -1400,9 +1406,21 @@ directories particularly efficiently.
:load-path "elisp/" :load-path "elisp/"
:general :general
(file-leader (file-leader
"P" #'+search/find-file "p" #'+search/find-file
"S" #'+search/search-all)) "S" #'+search/search-all))
#+end_src #+end_src
** Separedit
Edit anything anywhere all at once!
#+begin_src emacs-lisp
(use-package separedit
:defer t
:straight t
:general
(leader "e" #'separedit)
:init
(setq separedit-default-mode 'org-mode
separedit-remove-trailing-spaces-in-comment t))
#+end_src
* Applications * Applications
Emacs is basically an operating system whose primary datatype is text. Emacs is basically an operating system whose primary datatype is text.
Applications are interfaces/environments which serve a variety of Applications are interfaces/environments which serve a variety of
@@ -1554,7 +1572,8 @@ Here I setup dired with a few niceties
:init :init
(setq-default dired-listing-switches "-AFBlu --group-directories-first" (setq-default dired-listing-switches "-AFBlu --group-directories-first"
dired-omit-files "^\\." dired-omit-files "^\\."
dired-dwim-target t) dired-dwim-target t
dired-kill-when-opening-new-dired-buffer t)
(with-eval-after-load "evil-collection" (with-eval-after-load "evil-collection"
(evil-collection-dired-setup)) (evil-collection-dired-setup))
:general :general
@@ -1649,16 +1668,15 @@ easier than even using the mark based system.
** Eshell ** Eshell
*** Why Eshell? *** Why Eshell?
Eshell is an integrated shell environment for Emacs, written in Emacs Eshell is an integrated shell environment for Emacs, written in Emacs
Lisp. I argue that it is the best shell/command interpreter to use in Lisp. I argue henceforth that it is the best shell/command
Emacs. interpreter to use in Emacs.
Eshell is unlike the alternatives in Emacs as it's a /shell/ first, Eshell is unlike the other alternatives in Emacs as it's a /shell/
not a terminal emulator. It has the ability to spoof some aspects of a first, not a terminal emulator, with the ability to spoof some aspects
terminal emulator (through the shell parser), but it is NOT a terminal of a terminal emulator (through the shell parser).
emulator.
The killer benefits of eshell (which would appeal to Emacs users) are The killer benefits of eshell (which would appeal particularly to an
a direct result of eshell being written in Emacs lisp: Emacs user) are a direct result of eshell being written in Emacs Lisp:
- incredible integration with Emacs utilities (such as ~dired~, - incredible integration with Emacs utilities (such as ~dired~,
~find-file~, any read functions, etc) ~find-file~, any read functions, etc)
- very extensible, easy to write new commands which leverage Emacs - very extensible, easy to write new commands which leverage Emacs
@@ -1700,11 +1718,8 @@ them.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package eshell (use-package eshell
:defer t :defer t
:general
(shell-leader
"t" #'eshell)
:display :display
("\\*e?shell\\*" ("\\*.*eshell\\*"
(display-buffer-at-bottom) (display-buffer-at-bottom)
(window-height . 0.33)) (window-height . 0.33))
:init :init
@@ -1715,12 +1730,14 @@ them.
'eshell-mode-hook 'eshell-mode-hook
(proc (proc
(interactive) (interactive)
(nmap
:keymaps 'eshell-mode-map
"0" #'eshell-bol)
(general-def (general-def
:states '(normal insert) :states '(normal insert)
:keymaps 'eshell-mode-map :keymaps 'eshell-mode-map
"0" #'eshell-bol "C-j" #'eshell-next-matching-input-from-input
"M-j" #'eshell-next-matching-input-from-input "C-k" #'eshell-previous-matching-input-from-input)
"M-k" #'eshell-previous-matching-input-from-input)
(local-leader (local-leader
:keymaps 'eshell-mode-map :keymaps 'eshell-mode-map
"c" (proc (interactive) (eshell/clear) "c" (proc (interactive) (eshell/clear)
@@ -1743,8 +1760,7 @@ internals, just standard old Emacs packages.
:load-path "elisp/" :load-path "elisp/"
:config :config
(defun +eshell/banner-message () (defun +eshell/banner-message ()
(concat (shell-command-to-string "~/.local/scripts/cowfortune") (concat (shell-command-to-string "cowfortune") "\n"))
"\n"))
(setq eshell-prompt-regexp (format "^%s" +eshell-prompt/user-prompt) (setq eshell-prompt-regexp (format "^%s" +eshell-prompt/user-prompt)
eshell-prompt-function #'+eshell-prompt/make-prompt eshell-prompt-function #'+eshell-prompt/make-prompt
eshell-banner-message '(+eshell/banner-message))) eshell-banner-message '(+eshell/banner-message)))
@@ -1762,11 +1778,24 @@ if I loaded this ~:after~ eshell then the first instance has no
knowledge of the new additions. knowledge of the new additions.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package eshell-additions (use-package eshell-additions
:defer t
:load-path "elisp/" :load-path "elisp/"
:general :general
(shell-leader
"t" #'+eshell/open)
(leader (leader
"T" #'+eshell/at-cwd)) "T" #'+eshell/at-cwd))
#+end_src #+end_src
*** Eshell syntax highlighting
This package external package adds syntax highlighting to eshell
(disabling it for remote work). Doesn't require a lot of config
thankfully.
#+begin_src emacs-lisp
(use-package eshell-syntax-highlighting
:straight t
:after eshell
:hook (eshell-mode-hook . eshell-syntax-highlighting-mode))
#+end_src
** WAIT Elfeed ** WAIT Elfeed
:PROPERTIES: :PROPERTIES:
:header-args:emacs-lisp: :tangle no :header-args:emacs-lisp: :tangle no
@@ -2122,7 +2151,7 @@ limit), so set it for specific modes need the help.
(text-mode-hook . whitespace-mode) (text-mode-hook . whitespace-mode)
:init :init
(setq whitespace-style '(face empty spaces tabs newline trailing lines-char (setq whitespace-style '(face empty spaces tabs newline trailing lines-char
tab-mark missing-newline-at-eof) tab-mark)
whitespace-line-column 80)) whitespace-line-column 80))
#+end_src #+end_src
** Set auto-fill-mode for all text-modes ** Set auto-fill-mode for all text-modes
@@ -2233,7 +2262,7 @@ has very little overhead to work there.
(display-buffer-at-bottom) (display-buffer-at-bottom)
(window-height . 0.25)) (window-height . 0.25))
:init :init
(setq-default flycheck-check-syntax-automatically '(save new-line mode-enabled)) (setq-default flycheck-check-syntax-automatically '(save idle-change new-line mode-enabled))
:config :config
(with-eval-after-load "evil-collection" (with-eval-after-load "evil-collection"
(evil-collection-flycheck-setup))) (evil-collection-flycheck-setup)))
@@ -2454,8 +2483,21 @@ quickly generate them in C/C++ projects.
:straight t :straight t
:defer t :defer t
:general :general
(nmmap (file-leader
"K" #'devdocs-lookup)) "d" #'devdocs-lookup))
#+end_src
** rainbow-delimiters
Makes colours delimiters (parentheses) based on their depth in an
expression. Rainbow flag in your Lisp source code.
#+begin_src emacs-lisp
(use-package rainbow-delimiters
:defer t
:straight t
:general
(mode-leader "r" #'rainbow-delimiters-mode)
:hook
(lisp-mode-hook . rainbow-delimiters-mode)
(emacs-lisp-mode-hook . rainbow-delimiters-mode))
#+end_src #+end_src
* Org mode * Org mode
Org is, at its most basic, a markup language. =org-mode= is a major Org is, at its most basic, a markup language. =org-mode= is a major
@@ -2681,7 +2723,7 @@ them. This allows me to search my configuration pretty quickly.
+org/search-config-headings) +org/search-config-headings)
:general :general
(file-leader (file-leader
"p" #'+org/search-config-headings) "P" #'+org/search-config-headings)
(search-leader (search-leader
:keymaps 'org-mode-map :keymaps 'org-mode-map
"I" #'+org/search-headings) "I" #'+org/search-headings)
@@ -2972,22 +3014,16 @@ OBJECTS=$(CODE:$(SRC)/%.c=$(DIST)/%.o)
DEPDIR:=$(DIST)/dependencies DEPDIR:=$(DIST)/dependencies
DEPS:=$(CODE:$(SRC)/%.c=$(DEPDIR):%.d) $(DEPDIR)/main.d DEPS:=$(CODE:$(SRC)/%.c=$(DEPDIR):%.d) $(DEPDIR)/main.d
TERM_YELLOW:=$(shell echo -e \"\\e[0;33m\")
TERM_GREEN:=$(shell echo -e \"\\e[0;32m\")
TERM_RESET:=$(shell echo -e \"\\e[0;0m\")
.PHONY: all .PHONY: all
all: $(OUT) all: $(OUT)
$(OUT): $(DIST)/$(OUT) $(OUT): $(DIST)/$(OUT)
$(DIST)/$(OUT): $(OBJECTS) $(DIST)/main.o | $(DIST) $(DIST)/$(OUT): $(OBJECTS) $(DIST)/main.o | $(DIST)
@$(CC) $(CFLAGS) $^ -o $@ $(LIBS) $(CC) $(CFLAGS) $^ -o $@ $(LIBS)
@echo \"$(TERM_GREEN)$@$(TERM_RESET): $^\"
$(DIST)/%.o: $(SRC)/%.c | $(DIST) $(DEPDIR) $(DIST)/%.o: $(SRC)/%.c | $(DIST) $(DEPDIR)
@$(CC) $(CFLAGS) $(DEPFLAGS) $(DEPDIR)/$*.d -c $< -o $@ $(LIBS) $(CC) $(CFLAGS) $(DEPFLAGS) $(DEPDIR)/$*.d -c $< -o $@ $(LIBS)
@echo \"$(TERM_YELLOW)$@$(TERM_RESET): $<\"
.PHONY: run .PHONY: run
run: $(DIST)/$(OUT) run: $(DIST)/$(OUT)
@@ -2995,13 +3031,13 @@ run: $(DIST)/$(OUT)
.PHONY: .PHONY:
clean: clean:
@rm -rfv $(DIST)/* rm -rfv $(DIST)/*
$(DIST): $(DIST):
@mkdir -p $(DIST) mkdir -p $(DIST)
$(DEPDIR): $(DEPDIR):
@mkdir -p $(DEPDIR) mkdir -p $(DEPDIR)
-include $(DEPS) -include $(DEPS)
" "
@@ -3152,7 +3188,7 @@ my dotfiles).
:general :general
(code-leader (code-leader
:keymaps '(c-mode-map c++-mode-map) :keymaps '(c-mode-map c++-mode-map)
"f" #'+code/clang-format-region-or-buffer) "f" #'clang-format-buffer)
:config :config
(define-minor-mode clang-format-mode (define-minor-mode clang-format-mode
"On save formats the current buffer via clang-format." "On save formats the current buffer via clang-format."
@@ -3492,29 +3528,24 @@ Here I just setup Sly to use ~sbcl~.
(display-buffer-at-bottom) (display-buffer-at-bottom)
(window-height . 0.25)) (window-height . 0.25))
:config :config
(evil-set-initial-state 'sly-db-mode 'emacs) (evil-set-initial-state 'sly-db-mode 'normal)
(with-eval-after-load "org" (with-eval-after-load "org"
(setq-default org-babel-lisp-eval-fn #'sly-eval)) (setq-default org-babel-lisp-eval-fn #'sly-eval))
(with-eval-after-load "company" (with-eval-after-load "company"
(add-hook 'sly-mrepl-hook #'company-mode)) (add-hook 'sly-mrepl-hook #'company-mode))
:general :general
(shell-leader (shell-leader
"s" #'sly-mrepl) "s" #'sly)
(nmap (nmap
:keymaps 'lisp-mode-map :keymaps 'lisp-mode-map
"gr" #'sly-eval-buffer "gr" #'sly-eval-buffer
"gd" #'sly-edit-definition "gd" #'sly-edit-definition
"gR" #'sly-who-calls) "gR" #'sly-who-calls)
(local-leader (local-leader
:keymaps '(sly-mrepl-mode-map lisp-mode-map) :keymaps 'lisp-mode-map
"a" '(sly-apropos :which-key "Apropos") "a" '(sly-apropos :which-key "Apropos")
"d" '(sly-describe-symbol :which-key "Describe symbol") "d" '(sly-describe-symbol :which-key "Describe symbol")
"D" '(sly-documentation-lookup :which-key "Lookup on lispworks")) "D" '(sly-documentation-lookup :which-key "Lookup on lispworks")
(local-leader
:keymaps 'sly-mrepl-mode-map
"s" '(sly-mrepl-shortcut :which-key "Shortcut"))
(local-leader
:keymaps 'lisp-mode-map
"l" '(sly-load-file :which-key "Load file") "l" '(sly-load-file :which-key "Load file")
"c" '(sly-compile-defun :which-key "Compile defun") "c" '(sly-compile-defun :which-key "Compile defun")
"C" '(sly-compile-file :which-key "Compile file") "C" '(sly-compile-file :which-key "Compile file")
@@ -3526,10 +3557,68 @@ Here I just setup Sly to use ~sbcl~.
"e" #'sly-eval-last-expression "e" #'sly-eval-last-expression
"f" #'sly-eval-defun "f" #'sly-eval-defun
"r" #'sly-eval-region) "r" #'sly-eval-region)
(nmap
:keymaps 'sly-mrepl-mode-map
"M-j" #'sly-mrepl-next-input-or-button
"M-k" #'sly-mrepl-previous-input-or-button)
(local-leader
:keymaps 'sly-mrepl-mode-map
"s" '(sly-mrepl-shortcut :which-key "Shortcut"))
(nmap
:keymaps 'sly-db-mode-map
"\C-i" 'sly-db-cycle
"g?" 'describe-mode
"S" 'sly-db-show-frame-source
"e" 'sly-db-eval-in-frame
"d" 'sly-db-pprint-eval-in-frame
"D" 'sly-db-disassemble
"i" 'sly-db-inspect-in-frame
"gj" 'sly-db-down
"gk" 'sly-db-up
(kbd "C-j") 'sly-db-down
(kbd "C-k") 'sly-db-up
"]]" 'sly-db-details-down
"[[" 'sly-db-details-up
(kbd "M-j") 'sly-db-details-down
(kbd "M-k") 'sly-db-details-up
"gg" 'sly-db-beginning-of-backtrace
"G" 'sly-db-end-of-backtrace
"t" 'sly-db-toggle-details
"gr" 'sly-db-restart-frame
"I" 'sly-db-invoke-restart-by-name
"R" 'sly-db-return-from-frame
"c" 'sly-db-continue
"s" 'sly-db-step
"n" 'sly-db-next
"o" 'sly-db-out
"b" 'sly-db-break-on-return
"a" 'sly-db-abort
"q" 'sly-db-quit
"A" 'sly-db-break-with-system-debugger
"B" 'sly-db-break-with-default-debugger
"P" 'sly-db-print-condition
"C" 'sly-db-inspect-condition
"g:" 'sly-interactive-eval
"0" 'sly-db-invoke-restart-0
"1" 'sly-db-invoke-restart-1
"2" 'sly-db-invoke-restart-2
"3" 'sly-db-invoke-restart-3
"4" 'sly-db-invoke-restart-4
"5" 'sly-db-invoke-restart-5
"6" 'sly-db-invoke-restart-6
"7" 'sly-db-invoke-restart-7
"8" 'sly-db-invoke-restart-8
"9" 'sly-db-invoke-restart-9)
(nmap (nmap
:keymaps 'sly-inspector-mode-map :keymaps 'sly-inspector-mode-map
"q" #'sly-inspector-quit)) "q" #'sly-inspector-quit))
#+end_src #+end_src
*** Sly-ASDF
#+begin_src emacs-lisp
(use-package sly-asdf
:straight t
:after sly)
#+end_src
*** Emacs lisp *** Emacs lisp
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package elisp-mode (use-package elisp-mode
@@ -3545,10 +3634,10 @@ Here I just setup Sly to use ~sbcl~.
(">=" . "") (">=" . "")
("defun" . "ƒ") ("defun" . "ƒ")
("loop" . "Σ") ("loop" . "Σ")
("some" . "")
("every" . "")
("mapcar" . "") ("mapcar" . "")
("loop" . "")) ("reduce" . "")
("some" . "")
("every" . ""))
(emacs-lisp-mode-hook (emacs-lisp-mode-hook
("lambda" . "λ") ("lambda" . "λ")
("t" . "") ("t" . "")

View File

@@ -35,7 +35,6 @@
(setq-default (setq-default
default-frame-alist '((menu-bar-lines . 0) default-frame-alist '((menu-bar-lines . 0)
(tool-bar-lines . 0) (tool-bar-lines . 0)
(tab-bar-lines . 0)
(scroll-bar-lines . 0) (scroll-bar-lines . 0)
(left-fringe . 0) (left-fringe . 0)
(right-fringe . 0) (right-fringe . 0)

View File

@@ -53,5 +53,30 @@
(eshell/cd dir) (eshell/cd dir)
(eshell-send-input)))) (eshell-send-input))))
(defun +eshell/--current-instances ()
(cl-loop for buffer being the buffers
if (with-current-buffer buffer
(eq major-mode 'eshell-mode))
collect
(cons (buffer-name buffer) buffer)))
(defun +eshell/open (&optional ARG)
"If no arg is given, run EShell as per usual.
If an arg is given, then interactively open a new Eshell instance
or a currently opened one, naming it in the process."
(interactive "P")
(if (null ARG)
(eshell)
(let* ((current-instances (+eshell/--current-instances))
(answer (completing-read "Enter name: " (mapcar #'car current-instances)))
(result (assoc answer current-instances)))
(cond
(result (switch-to-buffer (cdr result)))
((not (string= answer ""))
(let ((eshell-buffer-name (format "*%s-eshell*" answer)))
(eshell)))
(t
(eshell))))))
(provide 'eshell-additions) (provide 'eshell-additions)
;;; eshell-additions.el ends here ;;; eshell-additions.el ends here

View File

@@ -51,8 +51,8 @@
'(link-visited ((t (:foreground "violet" :inherit (link))))) '(link-visited ((t (:foreground "violet" :inherit (link)))))
'(match ((t (:background "RoyalBlue3")))) '(match ((t (:background "RoyalBlue3"))))
'(minibuffer-prompt ((t (:foreground "cyan")))) '(minibuffer-prompt ((t (:foreground "cyan"))))
'(mode-line ((t (:box t :foreground "LightSkyBlue" :background "black")))) '(mode-line ((t (:box t :foreground "LightSkyBlue" :background "black" :inherit (default)))))
'(mode-line-inactive ((t (:box nil :weight light :foreground "CadetBlue" :background "grey7")))) '(mode-line-inactive ((t (:box nil :weight light :foreground "CadetBlue" :background "grey7" :inherit (default)))))
'(mode-line-buffer-id ((t (:weight bold)))) '(mode-line-buffer-id ((t (:weight bold))))
'(mode-line-emphasis ((t (:weight bold)))) '(mode-line-emphasis ((t (:weight bold))))
'(next-error ((t (:inherit (region))))) '(next-error ((t (:inherit (region)))))
@@ -67,6 +67,16 @@
'(pdf-isearch-batch ((t (:foreground "black" :background "white")))) '(pdf-isearch-batch ((t (:foreground "black" :background "white"))))
'(query-replace ((t (:inherit (isearch))))) '(query-replace ((t (:inherit (isearch)))))
'(region ((t (:extend t :background "grey25")))) '(region ((t (:extend t :background "grey25"))))
'(rainbow-delimiters-depth-1-face ((t (:extend t :foreground "red"))))
'(rainbow-delimiters-depth-2-face ((t (:extend t :foreground "darkorange"))))
'(rainbow-delimiters-depth-3-face ((t (:extend t :foreground "yellow"))))
'(rainbow-delimiters-depth-4-face ((t (:extend t :foreground "green"))))
'(rainbow-delimiters-depth-5-face ((t (:extend t :foreground "DeepSkyBlue"))))
'(rainbow-delimiters-depth-6-face ((t (:extend t :foreground "purple"))))
'(rainbow-delimiters-depth-7-face ((t (:extend t :foreground "violet"))))
'(rainbow-delimiters-mismatched-face ((t (:extend t :foreground "white" :background "red1"))))
'(rainbow-delimiters-unmatched-face ((t (:inherit rainbow-delimiters-mismatched-face))))
'(rainbow-delimiters-base-error-face ((t (:inherit rainbow-delimiters-mismatched-face))))
'(shadow ((((class color grayscale) (min-colors 88) (background light)) (:foreground "grey50")) '(shadow ((((class color grayscale) (min-colors 88) (background light)) (:foreground "grey50"))
(((class color grayscale) (min-colors 88) (background dark)) (:foreground "grey70")) (((class color grayscale) (min-colors 88) (background dark)) (:foreground "grey70"))
(((class color) (min-colors 8) (background light)) (:foreground "green")) (((class color) (min-colors 8) (background light)) (:foreground "green"))

View File

@@ -42,7 +42,8 @@ Returns a list of files with the directory preprended to them."
names))) names)))
(defun +search/get-all-candidates () (defun +search/get-all-candidates ()
(string-join (cl-reduce
#'(lambda (x y) (append x y))
(mapcar #'(lambda (directory) (mapcar #'(lambda (directory)
(+search/get-candidates (expand-file-name directory))) (+search/get-candidates (expand-file-name directory)))
+search/directories))) +search/directories)))
@@ -58,8 +59,7 @@ Returns a list of files with the directory preprended to them."
(string-join (string-join
(mapcar (mapcar
#'(lambda (x) (concat "\"" x "\"")) #'(lambda (x) (concat "\"" x "\""))
(cl-remove-if #'directory-name-p (+search/get-all-candidates))) (cl-remove-if #'directory-name-p (+search/get-all-candidates)))))
" "))
(defun +search/search-all () (defun +search/search-all ()
(interactive) (interactive)

View File

@@ -5,8 +5,7 @@ notmuch tag +inbox +unread -new -- tag:new
notmuch tag -new -unread -inbox +sent from:"aryadev@aryadevchavali.com" notmuch tag -new -unread -inbox +sent from:"aryadev@aryadevchavali.com"
notmuch tag -inbox -unread +spam \ notmuch tag -inbox -unread +spam \
path:'general/Junk/**' \ path:'general/Junk/**'
from:'*@bolt-rider.com*'
notmuch tag -inbox +warwick from:'*@warwick.ac.uk*' notmuch tag -inbox +warwick from:'*@warwick.ac.uk*'
notmuch tag -inbox +receipts \ notmuch tag -inbox +receipts \

View File

@@ -5,9 +5,6 @@ if [[ $internet == "connected" ]]
then then
con=$(nmcli | grep "connected to" | sed "s/.*: connected to \(.*\)/\1/g") con=$(nmcli | grep "connected to" | sed "s/.*: connected to \(.*\)/\1/g")
echo "" $con echo "" $con
elif [[ $internet == "disconnected" ]]
then
echo ""
else else
echo " Not Connected" echo " Not Connected"
fi fi

View File

@@ -1,3 +1,3 @@
#!/usr/bin/env sh #!/usr/bin/env sh
youtube-dl -x --audio-format mp3 -o '%(artist)s - %(track)s.%(ext)s' $1 youtube-dl -f bestvideo+bestaudio mp3 -o '%(track)s.%(ext)s' $1

View File

@@ -44,7 +44,7 @@ autoload -U compinit
setopt autocd setopt autocd
export ZSH_THEME="af-magic" export ZSH_THEME="af-magic"
PS1="%B%F{128}(%n@%m)%B%F{64}[%(4~|...|)%3~] PS1="%B%F{4}[%(4~|...|)%3~]
%F{white}>> %b%f%k" %F{white}>> %b%f%k"
setopt BANG_HIST setopt BANG_HIST