dotfiles

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 7b74f9d8c2c658399596ac0babbd4fe1c1d10506
parent c80905abce76f3b119603a99297710fcd19ead1e
Author: Luke Smith <luke@lukesmith.xyz>
Date:   Tue, 19 Feb 2019 13:13:05 -0500

bm* files, shortcuts and alias to .config

Diffstat:
D.aliasrc | 32--------------------------------
M.bashrc | 4++--
A.config/aliasrc | 32++++++++++++++++++++++++++++++++
R.bmdirs -> .config/bmdirs | 0
R.bmfiles -> .config/bmfiles | 0
M.config/vifm/vifmrc | 2+-
M.readme.mom | 10+++++-----
M.scripts/SCRIPTS.md | 2+-
M.scripts/tools/shortcuts | 10+++++-----
9 files changed, 46 insertions(+), 46 deletions(-)

diff --git a/.aliasrc b/.aliasrc @@ -1,32 +0,0 @@ -#!/bin/sh -alias ka="killall" \ - mpv="mpv --input-ipc-server=/tmp/mpvsoc$(date +%s)" \ - magit="nvim -c Magit" \ - p="sudo pacman" \ - SS="sudo systemctl" \ - f="vifm" \ - g="git" \ - trem="transmission-remote" \ - e="$EDITOR" \ - v="$EDITOR" \ - x="sxiv -ft *" \ - sdn="sudo shutdown -h now" \ - gua="git remote | xargs -L1 git push --all" \ - ls="ls -hN --color=auto --group-directories-first" \ - grep="grep --color=auto" \ - diff="diff --color=auto" \ - ccat="highlight --out-format=ansi" \ - yt="youtube-dl --add-metadata -i -o '%(upload_date)s-%(title)s.%(ext)s'" \ - yta="yt -x -f bestaudio/best" \ - YT="youtube-viewer" \ - ref="shortcuts >/dev/null; source ~/.shortcuts" \ - upc="sudo pacman -Syu; pkill -RTMIN+8 i3blocks" \ - lsp="pacman -Qett --color=always | less" \ - ffmpeg="ffmpeg -hide_banner" - -command -v nvim >/dev/null && alias vim="nvim" vimdiff="nvim -d" # Use neovim for vim if present. - -shdl() { curl -O $(curl -s http://sci-hub.tw/"$@" | grep location.href | grep -o http.*pdf) ;} -se() { du -a ~/.scripts/* ~/.config/* | awk '{print $2}' | fzf | xargs -r $EDITOR ;} -sv() { vcopy "$(du -a ~/.scripts/* ~/.config/* | awk '{print $2}' | fzf)" ;} -vf() { fzf | xargs -r -I % $EDITOR % ;} diff --git a/.bashrc b/.bashrc @@ -4,5 +4,5 @@ shopt -s autocd #Allows you to cd into directory merely by typing the directory HISTSIZE= HISTFILESIZE= # Infinite history. export PS1="\[$(tput bold)\]\[$(tput setaf 1)\][\[$(tput setaf 3)\]\u\[$(tput setaf 2)\]@\[$(tput setaf 4)\]\h \[$(tput setaf 5)\]\W\[$(tput setaf 1)\]]\[$(tput setaf 7)\]\\$ \[$(tput sgr0)\]" -[ -f "$HOME/.shortcuts" ] && source "$HOME/.shortcuts" # Load shortcut aliases -[ -f "$HOME/.aliasrc" ] && source "$HOME/.aliasrc" +[ -f "$HOME/.config/shortcutrc" ] && source "$HOME/.config/shortcutrc" # Load shortcut aliases +[ -f "$HOME/.config/aliasrc" ] && source "$HOME/.config/aliasrc" diff --git a/.config/aliasrc b/.config/aliasrc @@ -0,0 +1,32 @@ +#!/bin/sh +alias ka="killall" \ + mpv="mpv --input-ipc-server=/tmp/mpvsoc$(date +%s)" \ + magit="nvim -c Magit" \ + p="sudo pacman" \ + SS="sudo systemctl" \ + f="vifm" \ + g="git" \ + trem="transmission-remote" \ + e="$EDITOR" \ + v="$EDITOR" \ + x="sxiv -ft *" \ + sdn="sudo shutdown -h now" \ + gua="git remote | xargs -L1 git push --all" \ + ls="ls -hN --color=auto --group-directories-first" \ + grep="grep --color=auto" \ + diff="diff --color=auto" \ + ccat="highlight --out-format=ansi" \ + yt="youtube-dl --add-metadata -i -o '%(upload_date)s-%(title)s.%(ext)s'" \ + yta="yt -x -f bestaudio/best" \ + YT="youtube-viewer" \ + ref="shortcuts >/dev/null; source ~/.config/shortcutrc" \ + upc="sudo pacman -Syu; pkill -RTMIN+8 i3blocks" \ + lsp="pacman -Qett --color=always | less" \ + ffmpeg="ffmpeg -hide_banner" + +command -v nvim >/dev/null && alias vim="nvim" vimdiff="nvim -d" # Use neovim for vim if present. + +shdl() { curl -O $(curl -s http://sci-hub.tw/"$@" | grep location.href | grep -o http.*pdf) ;} +se() { du -a ~/.scripts/* ~/.config/* | awk '{print $2}' | fzf | xargs -r $EDITOR ;} +sv() { vcopy "$(du -a ~/.scripts/* ~/.config/* | awk '{print $2}' | fzf)" ;} +vf() { fzf | xargs -r -I % $EDITOR % ;} diff --git a/.bmdirs b/.config/bmdirs diff --git a/.bmfiles b/.config/bmfiles diff --git a/.config/vifm/vifmrc b/.config/vifm/vifmrc @@ -1,5 +1,5 @@ " vim: filetype=vim -source ~/.vifmshortcuts +source ~/.config/vifm/vifmshortcuts map <C-h> <C-w>h map <C-j> <C-w>j diff --git a/.readme.mom b/.readme.mom @@ -305,7 +305,7 @@ buttons, screen brightness, email, web browsing buttons, etc.) to what you would expect. .HEADING 1 "Bookmarking Files and Directories" .PP -Note the files \f(CW~/.bmdirs\fP and \f(CW~/.bmfiles\fP. +Note the files \f(CW~/.config/bmdirs\fP and \f(CW~/.config/bmfiles\fP. These files hold bookmarked directories and files respectively, along with shortcut keys to their left. LARBS, specfically the \f(CWshortcuts\fP script, will automatically read these files and autogenerate aliases and shortcuts for bash/zsh and ranger from them. .PP @@ -326,11 +326,11 @@ Create a new tab in \f(CW~/Documents\fP \f(CWYd\fP \(en Copy/yank (cp) a copy of the selected file(s) to \f(CWDocuments\fP .LIST OFF -Shortcuts like these are generated for all key sequence/directory pairs in \f(CW~/.bmdirs\fP. -Additionally, you may also add editable files to \f(CW~/.bmfiles\fP. +Shortcuts like these are generated for all key sequence/directory pairs in \f(CW~/.config/bmdirs\fP. +Additionally, you may also add editable files to \f(CW~/.config/bmfiles\fP. Each key sequence you pair with a file will become an alias to edit it in either bash or ranger. .PP -Whenever you edit and save one of the bookmark files, vim will automatically rerun the shortcut script, thus uupdating the shortcuts that will be used in new instances of bash and ranger. +Whenever you edit and save one of the bookmark files, vim will automatically rerun the shortcut script, thus updating the shortcuts that will be used in new instances of bash and ranger. It just werks. Note that it is your responsibility to ensure that none of the bindings you add conflict with another necessary function or command. .HEADING 1 "Frequently Asked Questions (FAQs)" @@ -366,7 +366,7 @@ Install \f(CWneomutt\fP, \f(CWofflineimap\fP and \f(CWmsmtp\fP if you haven't al Create a GPG private/public key pair if you haven't already. Type \f(CWmod+shift+e\fP and you can select a tutorial for how to do this. .ITEM Download the mutt-wizard repository to the mutt config directory: -\f(CWgit clone https://github.com/lukesmithxyz/mutt-wizard ~/.config/mutt\fP +\f(CWgit clone https://github.com/lukesmithxyz/mutt-wizard ~/.config/mutt\fP. \fBREAD THE README.\fP .PP .ITEM diff --git a/.scripts/SCRIPTS.md b/.scripts/SCRIPTS.md @@ -54,7 +54,7 @@ in vim or another program. - `opout` -- "Open output", opens the corresponding `.pdf` file if run on a `.md`, `.tex` or `.rmd` file, or if given an `.html` file, will open it in the browser. Bound to `<leader>p` in my vim config to reveal typical output. - `pauseallmpv` -- Pauses all mpv instances by sending the `,` key to each. Used by several scripts, but can be used alone as well. It will not pause an audio only mpv instance. If you know how to add a hack to do this, feel free to PR it or email me an addition. - `remaps` -- Remaps capslock to escape when pressed and super/mod when held. Maps the menu key to super as well. Runs the US international keyboard setup. If you want another keyboard setup, edit this fine. -- `shortcuts` -- For updating bash and ranger shortcuts. Reads `~/.key_directories` and `~/.key_files` for pairs of keypresses and directories and files, then autoproduces bash aliases and ranger shortcuts for them which output to `~/.shortcuts` and `~/.config/ranger/shortcuts.conf` respectively. These are read automatically by my bash and ranger configs. You don't have to run this script manually though, as it's run by vim whenever you edit one of the `~/.key_*` files. +- `shortcuts` -- For updating bash and ranger shortcuts. Reads `~/.config/bmdirs` and `~/.config/bmfiles` for pairs of keypresses and directories and files, then autoproduces bash aliases and ranger shortcuts for them which output to `~/.config/shortcutrc` and `~/.config/ranger/shortcuts.conf` respectively. These are read automatically by my bash and ranger configs. You don't have to run this script manually though, as it's run by vim whenever you edit one of the `~/.bm*` files. - `speedvid` -- Speed up a given video file (`$1`) by a given ammount (`$2`). - `tpb` -- Search Pirate Bay for the certain search terms given as arguments. - `texclear` -- Remove all `.tex` related build files. This is run by my vim when I stop editing any `.tex` file. diff --git a/.scripts/tools/shortcuts b/.scripts/tools/shortcuts @@ -1,10 +1,10 @@ #!/bin/bash # Output locations. Unactivated progs should go to /dev/null. -shell_shortcuts="$HOME/.shortcuts" +shell_shortcuts="$HOME/.config/shortcutrc" ranger_shortcuts="$HOME/.config/ranger/shortcuts.conf" qute_shortcuts="/dev/null" -fish_shortcuts="$HOME/.config/fish/shortcuts.fish" -vifm_shortcuts="$HOME/.vifmshortcuts" +fish_shortcuts="/dev/null" +vifm_shortcuts="$HOME/.config/vifm/vifmshortcuts" # Remove, prepare files rm -f "$ranger_shortcuts" "$qute_shortcuts" 2>/dev/null @@ -13,14 +13,14 @@ printf "# vim: filetype=sh\\nalias " > "$shell_shortcuts" printf "\" vim: filetype=vim\\n" > "$vifm_shortcuts" # Format the `bmdirs` file in the correct syntax and sent it to all three configs. -sed "s/\s*#.*$//;/^\s*$/d" "$HOME/.bmdirs" | tee >(awk '{print $1"=\"cd "$2" && ls -a\" \\"}' >> "$shell_shortcuts") \ +sed "s/\s*#.*$//;/^\s*$/d" "$HOME/.config/bmdirs" | tee >(awk '{print $1"=\"cd "$2" && ls -a\" \\"}' >> "$shell_shortcuts") \ >(awk '{print "abbr", $1, "\"cd " $2 "; and ls -a\""}' >> "$fish_shortcuts") \ >(awk '{print "map g" $1, ":cd", $2 "<CR>\nmap t" $1, "<tab>:cd", $2 "<CR><tab>\nmap M" $1, "<tab>:cd", $2 "<CR><tab>:mo<CR>\nmap Y" $1, "<tab>:cd", $2 "<CR><tab>:co<CR>" }' >> "$vifm_shortcuts") \ >(awk '{print "config.bind(\";"$1"\", \"set downloads.location.directory "$2" ;; hint links download\")"}' >> "$qute_shortcuts") \ | awk '{print "map g"$1" cd "$2"\nmap t"$1" tab_new "$2"\nmap m"$1" shell mv -v %s "$2"\nmap Y"$1" shell cp -rv %s "$2}' >> "$ranger_shortcuts" # Format the `configs` file in the correct syntax and sent it to both configs. -sed "s/\s*#.*$//;/^\s*$/d" "$HOME/.bmfiles" | tee >(awk '{print $1"=\"$EDITOR "$2"\" \\"}' >> "$shell_shortcuts") \ +sed "s/\s*#.*$//;/^\s*$/d" "$HOME/.config/bmfiles" | tee >(awk '{print $1"=\"$EDITOR "$2"\" \\"}' >> "$shell_shortcuts") \ >(awk '{print "abbr", $1, "\"$EDITOR "$2"\""}' >> "$fish_shortcuts") \ >(awk '{print "map", $1, ":e", $2 "<CR>" }' >> "$vifm_shortcuts") \ | awk '{print "map "$1" shell $EDITOR "$2}' >> "$ranger_shortcuts"