commit 43d02777c10f95e3697f55c039e1320594899308
parent af43f661d5ff394b0cfcf613eb1f3ccc8b251a99
Author: Ryan Jeffrey <ryan@ryanmj.xyz>
Date: Sat, 3 Oct 2020 08:17:39 -0700
zsh and emacs simplifications
Diffstat:
5 files changed, 54 insertions(+), 41 deletions(-)
diff --git a/.config/zsh/zshrc b/.config/zsh/zshrc
@@ -88,7 +88,7 @@ alias 9='cd -9'
COMPLETION_WAITING_DOTS="true"
# Reload piwal theme
-[[ -v SSH_CLIENT ]] && (cat ~/.cache/wal/sequences &)
+[[ -v SSH_CLIENT ]] || (cat ~/.cache/wal/sequences &)
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
@@ -99,7 +99,7 @@ export DICPATH='/usr/share/hunspell'
# User configuration
export LANG='en_US.UTF-8'
-export SCRIPTS="$HOME/src/scripts/"
+export SCRIPTS="$HOME/src/dotfiles/scripts/"
export GOARCH="amd64"
export GOOS="linux"
export CC="gcc"
@@ -112,9 +112,11 @@ export PATH="$PATH:$GOROOT/bin:/usr/lib/go/bin/:$SCRIPTS:$HOME/bin/"
export MUSIC='~/Music/'
export TERMINAL='xterm-256color'
export TERM='xterm-256color'
-export EDITOR='joestar'
+export EDITOR='emacsclient -t'
export BROWSER='brave'
export COLORTERM='truecolor'
+export NODE_PATH='~/src/node_modules'
+
# Editor and zsh
alias srz='source ~/.zshrc'
@@ -135,7 +137,6 @@ alias latex='lualatex'
alias cls='clear'
alias mkd='mkdir -pv'
alias mkdir='mkdir -pv'
-alias technic="$HOME/bin/techniclaunch.zsh"
alias dvdtube="youtube-dl -f 'bestvideo[height<=480,ext=mp4]+bestaudio/best[ext=mp3]/mp4'"
alias youaud='youtube-dl --output "%(title)s.%(ext)s" --extract-audio --audio-format mp3 --audio-quality 0'
alias otheru="youtube-dl -f 'bestvideo[height<=480,ext=mp4]+bestaudio[ext=mp3]/mp4' --write-all-thumbnails --merge-output-format mp4"
@@ -147,30 +148,16 @@ alias jcfg='cd ~/.config/joestar'
alias i3cfg='joe ~/.config/i3/config'
alias jrz='joe ~/.zshrc'
alias comicv='ls -v | sxiv -'
-
-
-# Easy extraction
-inflate () {
- if [ -f $1 ] ; then
- case $1 in
- *.tar.bz2) tar xvjf $1;;
- *.tar.gz) tar xvzf $1;;
- *.bz2) bunzip2 $1 ;;
- *.rar) unrar x $1 ;;
- *.gz) gunzip $1 ;;
- *.tar) tar xvf $1 ;;
- *.tbz2) tar xvjf $1;;
- *.tgz) tar xvzf $1;;
- *.zip) unzip $1 ;;
- *.Z) uncompress $1 ;;
- *.7z) 7z x $1;;
- *tar.xz) tar xf $1;;
- *) echo "don't know how to extract '$1'..." ;;
- esac
- else
- echo "'$1' is not a valid file!"
- fi
-}
+alias ec='emacsclient -c'
+alias et='emacsclient -t'
+alias erz='emacsclient -c ~/.zshrc'
+alias econf='emacsclient -c ~/.emacs.d/init.el ~/.emacs.d/lisp/config.org'
+alias ebsp='emacsclient -c ~/.config/bspwm/bspwmrc ~/.config/sxhkd/sxhkdrc'
+
+# Emacs vterm
+if [[ "$INSIDE_EMACS" = 'vterm' ]]; then
+ alias clear='vterm_printf "51;Evterm-clear-scrollback";tput clear'
+fi
setopt interactivecomments
diff --git a/.emacs.d/init.el b/.emacs.d/init.el
@@ -15,7 +15,7 @@
'("melpa" . "https://melpa.org/packages/") t)
(unless (package-installed-p 'quelpa)
- (with-temp-buffer
+ (with-temp-buffer
(url-insert-file-contents "https://github.com/quelpa/quelpa/raw/master/quelpa.el")
(eval-buffer)
(quelpa-self-upgrade)))
@@ -27,6 +27,8 @@
(setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3")
(org-babel-load-file "~/.emacs.d/lisp/config.org")
+
+
(put 'narrow-to-region 'disabled nil)
@@ -38,11 +40,10 @@
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(org-display-custom-times 1)
- '(org-export-with-sub-superscripts (quote {}))
- '(org-time-stamp-custom-formats (quote ("<%b %e %G>" . "<%m/%d/%y %a %H:%M>")))
+ '(org-export-with-sub-superscripts '{})
+ '(org-time-stamp-custom-formats '("<%b %e %G>" . "<%m/%d/%y %a %H:%M>"))
'(package-selected-packages
- (quote
- (rainbow-mode impatient-mode vterm rust-mode systemd yasnippet-snippets yasnippet gitignore-mode company flycheck wc-mode htmlize fic-mode emojify org-bullets use-package-hydra use-package-ensure-system-package use-package-el-get use-package-chords undo-tree quelpa-use-package mu4e-query-fragments mu4e-overview mu4e-maildirs-extension mu4e-jump-to-list mu4e-conversation mu4e-alert modus-vivendi-theme modus-operandi-theme ivy-ycmd ivy-avy highlight fish-mode elfeed-web elfeed-score elfeed-protocol elfeed-org elfeed-goodies csgo-conf-mode counsel))))
+ '(crontab-mode rainbow-mode impatient-mode vterm rust-mode systemd yasnippet-snippets yasnippet gitignore-mode company flycheck wc-mode htmlize fic-mode emojify org-bullets use-package-hydra use-package-ensure-system-package use-package-el-get use-package-chords undo-tree quelpa-use-package mu4e-query-fragments mu4e-overview mu4e-maildirs-extension mu4e-jump-to-list mu4e-conversation mu4e-alert modus-vivendi-theme modus-operandi-theme ivy-ycmd ivy-avy highlight fish-mode elfeed-web elfeed-score elfeed-protocol elfeed-org elfeed-goodies csgo-conf-mode counsel)))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
diff --git a/.emacs.d/lisp/config.org b/.emacs.d/lisp/config.org
@@ -1,4 +1,4 @@
-+TITLE: Ryan Jeffrey's Emacs config
+#+TITLE: Ryan Jeffrey's Emacs config
#+AUTHOR: Ryan Jeffrey
#+EMAIL: pwishie@gmail.com
#+OPTIONS: num:nil
@@ -102,6 +102,10 @@
(blink-cursor-mode 0)
(set-language-environment "UTF-8")
(setq redisplay-dont-pause t)
+
+(use-package crontab-mode
+ :ensure t)
+
#+END_SRC
** Filename-mode associations, modes for specific file types
@@ -109,11 +113,11 @@
(use-package conf-mode
:init
- (add-to-list 'auto-mode-alist '("\\config\\'" . conf-mode))
+ (add-to-list 'auto-mode-alist '("/sxhkdrc\\'" . conf-unix-mode))
+ (add-to-list 'auto-mode-alist '("\\config\\'" . conf-mode))
(add-to-list 'auto-mode-alist '("\\.Xdefaults'" . conf-xdefaults-mode))
(add-to-list 'auto-mode-alist '("\\.Xresources'" conf-xdefaults-mode))
- (add-to-list 'auto-mode-alist '("\\.Xdefaults'" . conf-xdefaults-mode))
- (add-to-list 'auto-mode-alist '("\\sxhkd\\'" . conf-unix-mode)))
+ (add-to-list 'auto-mode-alist '("\\.Xdefaults'" . conf-xdefaults-mode)))
(use-package systemd
@@ -223,10 +227,14 @@
#+End_src
** vterm
#+BEGIN_SRC emacs-lisp
-
(when module-file-suffix
(use-package vterm
- :ensure t))
+ :ensure t
+ :init (setq vterm-always-compile-module t)
+ :bind (:map vterm-mode-map
+ ("M-c" . 'vterm-copy-mode)
+ ("M-i" . 'ido-switch-buffer))))
+
#+END_SRC
* IDE
** all programming languages
@@ -263,7 +271,10 @@
** magit
#+begin_src emacs-lisp
(use-package magit
- :ensure t)
+ :ensure t
+ :init
+ (add-hook 'after-init-hook '(lambda ()
+ (global-magit-file-mode -1))))
#+end_src
** Misc
#+BEGIN_SRC emacs-lisp
diff --git a/crontab-ryan b/crontab-ryan
@@ -1,3 +1,3 @@
-0 */2 * * * DISPLAY=:0 XDG_RUNTIME_DIR=/run/user/`id -u` /usr/bin/wal -i $(/home/ryan/src/scripts/ranwal)
+0 */2 * * * DISPLAY=:0 XDG_RUNTIME_DIR=/run/user/`id -u` /usr/bin/wal -i $(/home/ryan/src/dotfiles/scripts/ranwal)
0 */12 * * * /usr/local/bin/emacsclient -e '(elfeed-update)'
diff --git a/scripts/ranwal b/scripts/ranwal
@@ -0,0 +1,14 @@
+#!/usr/bin/env zsh
+
+papes=(/home/ryan/Pictures/walls/*(.))
+
+function func() {
+ for file in $(find /home/ryan/Pictures/walls/ -type f)
+ do
+ [[ $(( $RANDOM % ${#papes[@]} )) -eq 1 ]] && echo "$file" && exit 0
+ done
+}
+
+while true; do
+ func
+done