Compare commits
71 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
bef0b60ccd | ||
aa492b3d97 | |||
92625e74b2 | |||
12ea7ea83b | |||
|
de84a69444 | ||
|
01144ec015 | ||
|
3dc6159640 | ||
|
c9c3fec128 | ||
19971c6298 | |||
6e50938657 | |||
f8fb29ea86 | |||
eec86113a1 | |||
610320f14b | |||
1f466570db | |||
854ecc91cb | |||
|
c180067e8e | ||
1308e25186 | |||
ff65ec54dd | |||
3477f92973 | |||
32b9334fba | |||
c91fc6bd3b | |||
e2e7c55ff3 | |||
428340fe0e | |||
b14c6240de | |||
0460cd7b98 | |||
0d47d81980 | |||
744d6e33bb | |||
c076a7ae9e | |||
b2a3bb723a | |||
9d05b29000 | |||
f5af1d9952 | |||
e54bebad64 | |||
ca2981a954 | |||
b3761b361f | |||
4510552267 | |||
5fd630c948 | |||
0ba4593214 | |||
ef0e3c01c7 | |||
521cbd0c2d | |||
3b1c3037f3 | |||
0af1e2d9d1 | |||
8a26df4c74 | |||
75a18fd7c6 | |||
65252ffe9f | |||
ce711ca6d5 | |||
925065127f | |||
a456bf734c | |||
0e928f9f34 | |||
7dd3ac24fc | |||
e0d6ead5f5 | |||
e1d80ce73f | |||
f1d3ef2616 | |||
1c0cd58364 | |||
7f7a2c7725 | |||
73808aad2a | |||
5433ec428d | |||
06814fbb4a | |||
5829a06604 | |||
2cab93bad9 | |||
29d1870eb3 | |||
60930b0206 | |||
51db0dbd95 | |||
337228c244 | |||
8bf03bbed6 | |||
1369ee6d15 | |||
02aa2898a5 | |||
bbc5f85972 | |||
cc9072dbc5 | |||
72412817c7 | |||
c678ce8f14 | |||
0440bdc0dd |
3
.gitignore
vendored
3
.gitignore
vendored
@ -1 +1,4 @@
|
|||||||
.stfolder
|
.stfolder
|
||||||
|
main.retry
|
||||||
|
/private
|
||||||
|
.env
|
||||||
|
9
.gitmodules
vendored
Normal file
9
.gitmodules
vendored
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
[submodule "kak/.config/kak/plugins/fzf.kak"]
|
||||||
|
path = kak/.config/kak/plugins/fzf.kak
|
||||||
|
url = https://github.com/andreyorst/fzf.kak
|
||||||
|
[submodule "kak/.config/kak/plugins/plug.kak"]
|
||||||
|
path = kak/.config/kak/plugins/plug.kak
|
||||||
|
url = https://github.com/andreyorst/plug.kak
|
||||||
|
[submodule "kak/.config/kak/plugins/smarttab.kak"]
|
||||||
|
path = kak/.config/kak/plugins/smarttab.kak
|
||||||
|
url = https://github.com/andreyorst/smarttab.kak
|
65
README.md
65
README.md
@ -1,38 +1,41 @@
|
|||||||
Sync
|
# Sync
|
||||||
=========
|
Syncs austenwares.com offical bash/zsh/tmux/vim/... config files
|
||||||
|
|
||||||
Sync syncs tmux/vim/bash config files with one command
|
### Installation
|
||||||
|
|
||||||
Usage:
|
- Using stow oneliner
|
||||||
|
|
||||||
```sh
|
git clone https://gitea.austenwares.com/stonewareslord/sync
|
||||||
usage: sync.sh [-h] [-t] [-c] [-b] [-s] [-d]
|
stow -t ~ sync/{[git i3 shell tmux vim ...]}
|
||||||
|
# For private
|
||||||
|
git clone https://gitea.austenwares.com/stonewareslord/private
|
||||||
|
stow -t ~ private/{[private ...]}
|
||||||
|
|
||||||
optional arguements:
|
- Stow one-liner
|
||||||
-h Show this help message and exit
|
|
||||||
-t Syncs tmux configuration file
|
command -v stow >/dev/null || echo "You do not have GNU stow installed" && git clone https://gitea.austenwares.com/stonewareslord/sync && stow -t ~ git i3 shell tmux vim
|
||||||
-c Syncs other configuration files
|
|
||||||
-b Syncs Vim bundles
|
- Installing zsh
|
||||||
-s Syncs computer with server applications in server.txt
|
|
||||||
-d Syncs computer with desktop applications in desktop.txt
|
test -d ~/.zsh-git/liquidprompt || git clone https://github.com/nojhan/liquidprompt ~/.zsh-git/liquidprompt && git -C ~/.zsh-git/liquidprompt pull
|
||||||
|
|
||||||
|
- Installing vim
|
||||||
|
|
||||||
|
vim +'call Initialize()'
|
||||||
|
|
||||||
|
### Requirements
|
||||||
|
|
||||||
|
- Mutt
|
||||||
|
|
||||||
|
```
|
||||||
|
neomutt # or mutt
|
||||||
|
isync
|
||||||
|
msmtp
|
||||||
|
notmuch
|
||||||
|
w3m
|
||||||
|
docker # For generating html snapshots
|
||||||
```
|
```
|
||||||
|
|
||||||
Or, install vim bundles and vimrc, customizing which bundles you use first (requires `curl` and `vim` packages):
|
### Credits
|
||||||
|
|
||||||
```sh
|
I had to copy the fasd script from https://github.com/clvv/fasd since I'm not sure how to make stow work with submodules.
|
||||||
mkdir -p ~/.vim/plugin/ ~/.vim/backup/ ~/.vim/undo/ ~/.vim/tmp/ ~/.vim/bundle/ ~/.vim/bundle/ ; if [ ! -f ~/.vim/plugin/sessionman.vim ] ; then curl -o ~/.vim/plugin/sessionman.vim http://www.vim.org/scripts/download_script.php?src_id=15599 ; fi ; if [ ! -d ~/.vim/bundle/vundle/ ] ; then git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle ; fi ; curl -o ~/.vimrc -k https://austenwares.com/gitlab/stonewareslord/Sync/raw/master/vimrc ; vim ~/.vimrc +"execute \"normal /Bundle 'gmarik\/vundle'\<CR>\"" +"execute \"normal :nohlsearch\<CR>:function Save()\<CR>w\<CR>BundleInstall\<CR>qa\<CR>endfunction\<CR>\"" +"nnoremap <F2> :call Save()<CR>:so ~/.vimrc<CR>:BundleInstall<CR>" ; echo "Installation should be complete. Run \"vim\" to check"
|
|
||||||
```
|
|
||||||
|
|
||||||
Usage: run this command and it will automatically load the bundle list with descriptions of each. Delete the ones you don't want to install and press `F2` in normal mode to install al at once.
|
|
||||||
|
|
||||||
Or, temporarily load the bashrc (requires `curl` package):
|
|
||||||
|
|
||||||
```sh
|
|
||||||
curl -k -o /tmp/tmprc https://98.26.78.121/gitlab/stonewareslord/Sync/raw/master/tmprc && . /tmp/tmprc ; rm /tmp/tmprc
|
|
||||||
```
|
|
||||||
|
|
||||||
Or, clone the sync project and add all origins automatically:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
mkdir sync&&cd sync&&git init&&git remote add testorigin https://98.26.78.121/gitlab/stonewareslord/Sync.git&&git config http.sslVerify false&&git pull testorigin master&&. bashrc&&git remote rm testorigin&&initify stonewareslord Sync -r
|
|
||||||
```
|
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
git clone https://github.com/clvv/fasd /tmp/fasd
|
|
||||||
\cd /tmp/fasd
|
|
||||||
sudo make install
|
|
||||||
\cd -
|
|
@ -1,44 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
mkdir ~/ffmpeg_sources
|
|
||||||
cd ~/ffmpeg_sources
|
|
||||||
wget -O fdk-aac.zip https://github.com/mstorsjo/fdk-aac/zipball/master
|
|
||||||
unzip fdk-aac.zip
|
|
||||||
cd mstorsjo-fdk-aac*
|
|
||||||
autoreconf -fiv
|
|
||||||
./configure --prefix="$HOME/ffmpeg_build" --disable-shared
|
|
||||||
make
|
|
||||||
sudo make install
|
|
||||||
make distclean
|
|
||||||
cd ~/ffmpeg_sources
|
|
||||||
wget http://webm.googlecode.com/files/libvpx-v1.3.0.tar.bz2
|
|
||||||
tar xjvf libvpx-v1.3.0.tar.bz2
|
|
||||||
cd libvpx-v1.3.0
|
|
||||||
PATH="$PATH:$HOME/bin" ./configure --prefix="$HOME/ffmpeg_build" --disable-examples
|
|
||||||
PATH="$PATH:$HOME/bin" make
|
|
||||||
sudo make install
|
|
||||||
make clean
|
|
||||||
cd ~/ffmpeg_sources
|
|
||||||
wget http://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2
|
|
||||||
tar xjvf ffmpeg-snapshot.tar.bz2
|
|
||||||
cd ffmpeg
|
|
||||||
PATH="$PATH:$HOME/bin" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure \
|
|
||||||
--prefix="$HOME/ffmpeg_build" \
|
|
||||||
--extra-cflags="-I$HOME/ffmpeg_build/include" \
|
|
||||||
--extra-ldflags="-L$HOME/ffmpeg_build/lib" \
|
|
||||||
--bindir="$HOME/bin" \
|
|
||||||
--enable-gpl \
|
|
||||||
--enable-libass \
|
|
||||||
--enable-libfdk-aac \
|
|
||||||
--enable-libfreetype \
|
|
||||||
--enable-libmp3lame \
|
|
||||||
--enable-libopus \
|
|
||||||
--enable-libtheora \
|
|
||||||
--enable-libvorbis \
|
|
||||||
--enable-libvpx \
|
|
||||||
--enable-libx264 \
|
|
||||||
--enable-nonfree \
|
|
||||||
--enable-x11grab
|
|
||||||
PATH="$PATH:$HOME/bin" make
|
|
||||||
sudo make install
|
|
||||||
make distclean
|
|
||||||
hash -r
|
|
@ -1,3 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
sudo sh -c "echo \"kernel.yama.ptrace_scope = 0\" > /etc/sysctl.d/10-ptrace.conf"
|
|
||||||
sudo sysctl -p /etc/sysctl.d/10-ptrace.conf
|
|
@ -1,13 +0,0 @@
|
|||||||
sudo apt-get remove -y vim-tiny vim-common vim-gui-common vim vim-runtime gvim
|
|
||||||
sudo apt-get install -y mercurial libncurses5-dev libgnome2-dev libgnomeui-dev libgtk2.0-dev libatk1.0-dev libbonoboui2-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev python3-dev luajit liblua5.3-dev
|
|
||||||
sudo apt-get build-dep -y vim
|
|
||||||
mkdir -p /tmp/vim
|
|
||||||
cd /tmp/vim
|
|
||||||
rm -rf vim
|
|
||||||
# Old method of cloning
|
|
||||||
#(date && hg clone https://vim.googlecode.com/hg/ vim) 2>&1 |tee log
|
|
||||||
# Checkout the latest non alpha or beta tag
|
|
||||||
git clone https://github.com/vim/vim && cd vim && git checkout $(git tag|sort -n|grep -v '[ab]'|tail -n1)
|
|
||||||
./configure --with-features=huge --enable-rubyinterp --enable-pythoninterp --enable-perlinterp --enable-gui=gtk2 --enable-cscope --prefix=/usr --enable-luainterp=dynamic --enable-python3interp=dynamic --with-python3-config-dir="$(python3-config --configdir)" | tee -a log
|
|
||||||
make | tee -a log
|
|
||||||
sudo make install | tee -a log
|
|
@ -1,13 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
SUDO=""
|
|
||||||
if command -v sudo > /dev/null; then
|
|
||||||
SUDO="$(command -v sudo)"
|
|
||||||
fi
|
|
||||||
echo "Installing wemux..."
|
|
||||||
test -d /usr/local/share/wemux || $SUDO git clone git://github.com/zolrath/wemux.git /usr/local/share/wemux && $SUDO git --git-dir=/usr/local/share/wemux pull
|
|
||||||
$SUDO rm -r /usr/local/bin/wemux /usr/local/etc/wemux.conf
|
|
||||||
$SUDO ln -s /usr/local/share/wemux/wemux /usr/local/bin/wemux
|
|
||||||
$SUDO mkdir -p /usr/local/etc
|
|
||||||
$SUDO cp /usr/local/share/wemux/wemux.conf.example /usr/local/etc/wemux.conf
|
|
||||||
printf 'options="-u2"\n' | $SUDO tee -a /usr/local/etc/wemux.conf >/dev/null
|
|
||||||
printf "host_list=(root $USER)\n" | $SUDO tee -a /usr/local/etc/wemux.conf >/dev/null
|
|
@ -1,20 +0,0 @@
|
|||||||
#!/bin/zsh
|
|
||||||
if [ ! "$1" = "-y" ]; then
|
|
||||||
# They want to assume yes, require no user input
|
|
||||||
echo "Make sure this is in your .vimrc"
|
|
||||||
echo "Plug 'https://github.com/Valloric/YouCompleteMe'"
|
|
||||||
echo -n "Press enter to continue..."
|
|
||||||
read a
|
|
||||||
fi
|
|
||||||
rm -rf ~/ycm_build
|
|
||||||
mkdir ~/ycm_build
|
|
||||||
cd ~/ycm_build
|
|
||||||
touch .nobackup
|
|
||||||
cmake -G "Unix Makefiles" . ~/.vim/plugged/YouCompleteMe/third_party/ycmd/cpp
|
|
||||||
cmake --build . --target ycm_core
|
|
||||||
#cd ~/.vim/plugged/YouCompleteMe/third_party/ycmd/third_party/gocode
|
|
||||||
#go build
|
|
||||||
#cd ~/.vim/plugged/YouCompleteMe/third_party/ycmd/third_party/tern_runtime
|
|
||||||
#npm install --production
|
|
||||||
cd -
|
|
||||||
echo "It should be done."
|
|
@ -1,17 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Make sure this is in your .vimrc
|
|
||||||
# Plug 'https://github.com/Valloric/YouCompleteMe'
|
|
||||||
pushd ~/.vim/plugged/YouCompleteMe
|
|
||||||
echo "Compiling with clang support..."
|
|
||||||
ARGS="--clang-completer"
|
|
||||||
if command -v cargo 2>&1 > /dev/null && command -v rustc 2>&1 > /dev/null; then
|
|
||||||
echo "Compiling with rust support..."
|
|
||||||
ARGS="$ARGS --racer-completer"
|
|
||||||
fi
|
|
||||||
if command -v go 2>&1 > /dev/null; then
|
|
||||||
echo "Compiling with go support..."
|
|
||||||
ARGS="$ARGS --gocode-completer"
|
|
||||||
fi
|
|
||||||
./install.py $ARGS
|
|
||||||
popd
|
|
||||||
echo "It should be done."
|
|
636
fasd/.local/bin/fasd
Executable file
636
fasd/.local/bin/fasd
Executable file
@ -0,0 +1,636 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
# Fasd (this file) can be sourced or executed by any POSIX compatible shell.
|
||||||
|
|
||||||
|
# Fasd is originally written based on code from z (https://github.com/rupa/z)
|
||||||
|
# by rupa deadwyler under the WTFPL license. Most if not all of the code has
|
||||||
|
# been rewritten.
|
||||||
|
|
||||||
|
# Copyright (C) 2011, 2012 by Wei Dai. All rights reserved.
|
||||||
|
#
|
||||||
|
# Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
# a copy of this software and associated documentation files (the
|
||||||
|
# "Software"), to deal in the Software without restriction, including
|
||||||
|
# without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
# distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
# permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
# the following conditions:
|
||||||
|
#
|
||||||
|
# The above copyright notice and this permission notice shall be included
|
||||||
|
# in all copies or substantial portions of the Software.
|
||||||
|
#
|
||||||
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||||
|
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||||
|
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
fasd() {
|
||||||
|
|
||||||
|
# make zsh do word splitting inside this function
|
||||||
|
[ "$ZSH_VERSION" ] && emulate sh && setopt localoptions
|
||||||
|
|
||||||
|
case $1 in
|
||||||
|
--init) shift
|
||||||
|
while [ "$1" ]; do
|
||||||
|
case $1 in
|
||||||
|
env)
|
||||||
|
{ # source rc files if present
|
||||||
|
[ -s "/etc/fasdrc" ] && . "/etc/fasdrc"
|
||||||
|
[ -s "$HOME/.fasdrc" ] && . "$HOME/.fasdrc"
|
||||||
|
|
||||||
|
# set default options
|
||||||
|
[ -z "$_FASD_DATA" ] && _FASD_DATA="$HOME/.fasd"
|
||||||
|
[ -z "$_FASD_BLACKLIST" ] && _FASD_BLACKLIST="--help"
|
||||||
|
[ -z "$_FASD_SHIFT" ] && _FASD_SHIFT="sudo busybox"
|
||||||
|
[ -z "$_FASD_IGNORE" ] && _FASD_IGNORE="fasd ls echo"
|
||||||
|
[ -z "$_FASD_SINK" ] && _FASD_SINK=/dev/null
|
||||||
|
[ -z "$_FASD_TRACK_PWD" ] && _FASD_TRACK_PWD=1
|
||||||
|
[ -z "$_FASD_MAX" ] && _FASD_MAX=2000
|
||||||
|
[ -z "$_FASD_BACKENDS" ] && _FASD_BACKENDS=native
|
||||||
|
[ -z "$_FASD_FUZZY" ] && _FASD_FUZZY=2
|
||||||
|
[ -z "$_FASD_VIMINFO" ] && _FASD_VIMINFO="$HOME/.viminfo"
|
||||||
|
[ -z "$_FASD_RECENTLY_USED_XBEL" ] && \
|
||||||
|
_FASD_RECENTLY_USED_XBEL="$HOME/.local/share/recently-used.xbel"
|
||||||
|
|
||||||
|
if [ -z "$_FASD_AWK" ]; then
|
||||||
|
# awk preferences
|
||||||
|
local awk; for awk in mawk gawk original-awk nawk awk; do
|
||||||
|
$awk "" && _FASD_AWK=$awk && break
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
} >> "${_FASD_SINK:-/dev/null}" 2>&1
|
||||||
|
;;
|
||||||
|
|
||||||
|
auto) cat <<EOS
|
||||||
|
{ if [ "\$ZSH_VERSION" ] && compctl; then # zsh
|
||||||
|
eval "\$(fasd --init posix-alias zsh-hook zsh-ccomp zsh-ccomp-install \\
|
||||||
|
zsh-wcomp zsh-wcomp-install)"
|
||||||
|
elif [ "\$BASH_VERSION" ] && complete; then # bash
|
||||||
|
eval "\$(fasd --init posix-alias bash-hook bash-ccomp bash-ccomp-install)"
|
||||||
|
else # posix shell
|
||||||
|
eval "\$(fasd --init posix-alias posix-hook)"
|
||||||
|
fi
|
||||||
|
} >> "$_FASD_SINK" 2>&1
|
||||||
|
|
||||||
|
EOS
|
||||||
|
;;
|
||||||
|
|
||||||
|
posix-alias) cat <<EOS
|
||||||
|
alias a='fasd -a'
|
||||||
|
alias s='fasd -si'
|
||||||
|
alias sd='fasd -sid'
|
||||||
|
alias sf='fasd -sif'
|
||||||
|
alias d='fasd -d'
|
||||||
|
alias f='fasd -f'
|
||||||
|
# function to execute built-in cd
|
||||||
|
fasd_cd() {
|
||||||
|
if [ \$# -le 1 ]; then
|
||||||
|
fasd "\$@"
|
||||||
|
else
|
||||||
|
local _fasd_ret="\$(fasd -e 'printf %s' "\$@")"
|
||||||
|
[ -z "\$_fasd_ret" ] && return
|
||||||
|
[ -d "\$_fasd_ret" ] && cd "\$_fasd_ret" || printf %s\\n "\$_fasd_ret"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
alias z='fasd_cd -d'
|
||||||
|
alias zz='fasd_cd -d -i'
|
||||||
|
|
||||||
|
EOS
|
||||||
|
;;
|
||||||
|
|
||||||
|
tcsh-alias) cat <<EOS
|
||||||
|
;alias a 'fasd -a';
|
||||||
|
alias s 'fasd -si';
|
||||||
|
alias sd 'fasd -sid';
|
||||||
|
alias sf 'fasd -sif';
|
||||||
|
alias d 'fasd -d';
|
||||||
|
alias f 'fasd -f';
|
||||||
|
alias z 'cd "\`fasd -d -e printf\\ %s \\!*\`" >& /dev/null || fasd -d';
|
||||||
|
EOS
|
||||||
|
;;
|
||||||
|
|
||||||
|
zsh-hook) cat <<EOS
|
||||||
|
# add zsh hook
|
||||||
|
_fasd_preexec() {
|
||||||
|
{ eval "fasd --proc \$(fasd --sanitize \$2)"; } >> "$_FASD_SINK" 2>&1
|
||||||
|
}
|
||||||
|
autoload -Uz add-zsh-hook
|
||||||
|
add-zsh-hook preexec _fasd_preexec
|
||||||
|
|
||||||
|
EOS
|
||||||
|
;;
|
||||||
|
|
||||||
|
bash-hook) cat <<EOS
|
||||||
|
_fasd_prompt_func() {
|
||||||
|
eval "fasd --proc \$(fasd --sanitize \$(history 1 | \\
|
||||||
|
sed "s/^[ ]*[0-9]*[ ]*//"))" >> "$_FASD_SINK" 2>&1
|
||||||
|
}
|
||||||
|
|
||||||
|
# add bash hook
|
||||||
|
case \$PROMPT_COMMAND in
|
||||||
|
*_fasd_prompt_func*) ;;
|
||||||
|
*) PROMPT_COMMAND="_fasd_prompt_func;\$PROMPT_COMMAND";;
|
||||||
|
esac
|
||||||
|
|
||||||
|
EOS
|
||||||
|
;;
|
||||||
|
|
||||||
|
posix-hook) cat <<EOS
|
||||||
|
_fasd_ps1_func() {
|
||||||
|
{ eval "fasd --proc \$(fasd --sanitize \$(fc -nl -1))"; } \\
|
||||||
|
>> "$_FASD_SINK" 2>&1
|
||||||
|
}
|
||||||
|
case \$PS1 in
|
||||||
|
*_fasd_ps1_func*) ;;
|
||||||
|
*) export PS1="\\\$(_fasd_ps1_func)\$PS1";;
|
||||||
|
esac
|
||||||
|
|
||||||
|
EOS
|
||||||
|
;;
|
||||||
|
|
||||||
|
tcsh-hook) cat <<EOS
|
||||||
|
;alias fasd-prev-cmd 'fasd --sanitize \`history -h 1\`';
|
||||||
|
set pprecmd="\`alias precmd\`";
|
||||||
|
alias precmd '\$pprecmd; eval "fasd --proc \`fasd-prev-cmd\`" >& /dev/null';
|
||||||
|
EOS
|
||||||
|
|
||||||
|
;;
|
||||||
|
|
||||||
|
zsh-ccomp) cat <<EOS
|
||||||
|
# zsh command mode completion
|
||||||
|
_fasd_zsh_cmd_complete() {
|
||||||
|
local compl
|
||||||
|
read -c compl
|
||||||
|
(( \$+compstate )) && compstate[insert]=menu # no expand if compsys loaded
|
||||||
|
reply=(\${(f)"\$(fasd --complete "\$compl")"})
|
||||||
|
}
|
||||||
|
|
||||||
|
EOS
|
||||||
|
;;
|
||||||
|
|
||||||
|
zsh-wcomp) cat <<EOS
|
||||||
|
(( \$+functions[compdef] )) && {
|
||||||
|
# zsh word mode completion
|
||||||
|
_fasd_zsh_word_complete() {
|
||||||
|
[ "\$2" ] && local _fasd_cur="\$2"
|
||||||
|
[ -z "\$_fasd_cur" ] && local _fasd_cur="\${words[CURRENT]}"
|
||||||
|
local fnd="\${_fasd_cur//,/ }"
|
||||||
|
local typ=\${1:-e}
|
||||||
|
fasd --query \$typ "\$fnd" 2>> "$_FASD_SINK" | \\
|
||||||
|
sort -nr | sed 's/^[^ ]*[ ]*//' | while read -r line; do
|
||||||
|
compadd -U -V fasd "\$line"
|
||||||
|
done
|
||||||
|
compstate[insert]=menu # no expand
|
||||||
|
}
|
||||||
|
_fasd_zsh_word_complete_f() { _fasd_zsh_word_complete f ; }
|
||||||
|
_fasd_zsh_word_complete_d() { _fasd_zsh_word_complete d ; }
|
||||||
|
_fasd_zsh_word_complete_trigger() {
|
||||||
|
local _fasd_cur="\${words[CURRENT]}"
|
||||||
|
eval \$(fasd --word-complete-trigger _fasd_zsh_word_complete \$_fasd_cur)
|
||||||
|
}
|
||||||
|
# define zle widgets
|
||||||
|
zle -C fasd-complete complete-word _generic
|
||||||
|
zstyle ':completion:fasd-complete:*' completer _fasd_zsh_word_complete
|
||||||
|
zstyle ':completion:fasd-complete:*' menu-select
|
||||||
|
|
||||||
|
zle -C fasd-complete-f complete-word _generic
|
||||||
|
zstyle ':completion:fasd-complete-f:*' completer _fasd_zsh_word_complete_f
|
||||||
|
zstyle ':completion:fasd-complete-f:*' menu-select
|
||||||
|
|
||||||
|
zle -C fasd-complete-d complete-word _generic
|
||||||
|
zstyle ':completion:fasd-complete-d:*' completer _fasd_zsh_word_complete_d
|
||||||
|
zstyle ':completion:fasd-complete-d:*' menu-select
|
||||||
|
}
|
||||||
|
|
||||||
|
EOS
|
||||||
|
;;
|
||||||
|
|
||||||
|
zsh-ccomp-install) cat <<EOS
|
||||||
|
# enable command mode completion
|
||||||
|
compctl -U -K _fasd_zsh_cmd_complete -V fasd -x 'C[-1,-*e],s[-]n[1,e]' -c - \\
|
||||||
|
'c[-1,-A][-1,-D]' -f -- fasd fasd_cd
|
||||||
|
|
||||||
|
EOS
|
||||||
|
;;
|
||||||
|
|
||||||
|
zsh-wcomp-install) cat <<EOS
|
||||||
|
(( \$+functions[compdef] )) && {
|
||||||
|
# enable word mode completion
|
||||||
|
orig_comp="\$(zstyle -L ':completion:\\*' completer 2>> "$_FASD_SINK")"
|
||||||
|
if [ "\$orig_comp" ]; then
|
||||||
|
case \$orig_comp in
|
||||||
|
*_fasd_zsh_word_complete_trigger*);;
|
||||||
|
*) eval "\$orig_comp _fasd_zsh_word_complete_trigger";;
|
||||||
|
esac
|
||||||
|
else
|
||||||
|
zstyle ':completion:*' completer _complete _fasd_zsh_word_complete_trigger
|
||||||
|
fi
|
||||||
|
unset orig_comp
|
||||||
|
}
|
||||||
|
|
||||||
|
EOS
|
||||||
|
;;
|
||||||
|
|
||||||
|
bash-ccomp) cat <<EOS
|
||||||
|
# bash command mode completion
|
||||||
|
_fasd_bash_cmd_complete() {
|
||||||
|
# complete command after "-e"
|
||||||
|
local cur=\${COMP_WORDS[COMP_CWORD]}
|
||||||
|
[[ \${COMP_WORDS[COMP_CWORD-1]} == -*e ]] && \\
|
||||||
|
COMPREPLY=( \$(compgen -A command \$cur) ) && return
|
||||||
|
# complete using default readline complete after "-A" or "-D"
|
||||||
|
case \${COMP_WORDS[COMP_CWORD-1]} in
|
||||||
|
-A|-D) COMPREPLY=( \$(compgen -o default \$cur) ) && return;;
|
||||||
|
esac
|
||||||
|
# get completion results using expanded aliases
|
||||||
|
local RESULT=\$( fasd --complete "\$(alias -p \$COMP_WORDS \\
|
||||||
|
2>> "$_FASD_SINK" | sed -n "\\\$s/^.*'\\\\(.*\\\\)'/\\\\1/p")
|
||||||
|
\${COMP_LINE#* }" | while read -r line; do
|
||||||
|
quote_readline "\$line" 2>/dev/null || \\
|
||||||
|
printf %q "\$line" 2>/dev/null && \\
|
||||||
|
printf \\\\n
|
||||||
|
done)
|
||||||
|
local IFS=\$'\\n'; COMPREPLY=( \$RESULT )
|
||||||
|
}
|
||||||
|
_fasd_bash_hook_cmd_complete() {
|
||||||
|
for cmd in \$*; do
|
||||||
|
complete -F _fasd_bash_cmd_complete \$cmd
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
EOS
|
||||||
|
;;
|
||||||
|
|
||||||
|
bash-ccomp-install) cat <<EOS
|
||||||
|
# enable bash command mode completion
|
||||||
|
_fasd_bash_hook_cmd_complete fasd a s d f sd sf z zz
|
||||||
|
|
||||||
|
EOS
|
||||||
|
;;
|
||||||
|
esac; shift
|
||||||
|
done
|
||||||
|
;;
|
||||||
|
|
||||||
|
# if "$_fasd_cur" or "$2" is a query, then output shell code to be eval'd
|
||||||
|
--word-complete-trigger)
|
||||||
|
shift; [ "$2" ] && local _fasd_cur="$2" || return
|
||||||
|
case $_fasd_cur in
|
||||||
|
,*) printf %s\\n "$1 e $_fasd_cur";;
|
||||||
|
f,*) printf %s\\n "$1 f ${_fasd_cur#?}";;
|
||||||
|
d,*) printf %s\\n "$1 d ${_fasd_cur#?}";;
|
||||||
|
*,,) printf %s\\n "$1 e $_fasd_cur";;
|
||||||
|
*,,f) printf %s\\n "$1 f ${_fasd_cur%?}";;
|
||||||
|
*,,d) printf %s\\n "$1 d ${_fasd_cur%?}";;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
|
||||||
|
--sanitize) shift; printf %s\\n "$*" | \
|
||||||
|
sed 's/\([^\]\)$( *[^ ]* *\([^)]*\)))*/\1\2/g
|
||||||
|
s/\([^\]\)[|&;<>$`{}]\{1,\}/\1 /g'
|
||||||
|
;;
|
||||||
|
|
||||||
|
--proc) shift # process commands
|
||||||
|
# stop if we don't own $_FASD_DATA or $_FASD_RO is set
|
||||||
|
[ -f "$_FASD_DATA" -a ! -O "$_FASD_DATA" ] || [ "$_FASD_RO" ] && return
|
||||||
|
|
||||||
|
# blacklists
|
||||||
|
local each; for each in $_FASD_BLACKLIST; do
|
||||||
|
case " $* " in *\ $each\ *) return;; esac
|
||||||
|
done
|
||||||
|
|
||||||
|
# shifts
|
||||||
|
while true; do
|
||||||
|
case " $_FASD_SHIFT " in
|
||||||
|
*\ $1\ *) shift;;
|
||||||
|
*) break;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
# ignores
|
||||||
|
case " $_FASD_IGNORE " in
|
||||||
|
*\ $1\ *) return;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
shift; fasd --add "$@" # add all arguments except command
|
||||||
|
;;
|
||||||
|
|
||||||
|
--add|-A) shift # add entries
|
||||||
|
# stop if we don't own $_FASD_DATA or $_FASD_RO is set
|
||||||
|
[ -f "$_FASD_DATA" -a ! -O "$_FASD_DATA" ] || [ "$_FASD_RO" ] && return
|
||||||
|
|
||||||
|
# find all valid path arguments, convert them to simplest absolute form
|
||||||
|
local paths="$(while [ "$1" ]; do
|
||||||
|
[ -e "$1" ] && printf %s\\n "$1"; shift
|
||||||
|
done | sed '/^[^/]/s@^@'"$PWD"'/@
|
||||||
|
s@/\.\.$@/../@;s@/\(\./\)\{1,\}@/@g;:0
|
||||||
|
s@[^/][^/]*//*\.\./@/@;t 0
|
||||||
|
s@^/*\.\./@/@;s@//*@/@g;s@/\.\{0,1\}$@@;s@^$@/@' 2>> "$_FASD_SINK" \
|
||||||
|
| tr '\n' '|')"
|
||||||
|
|
||||||
|
# add current pwd if the option is set
|
||||||
|
[ "$_FASD_TRACK_PWD" = "1" -a "$PWD" != "$HOME" ] && paths="$paths|$PWD"
|
||||||
|
|
||||||
|
[ -z "${paths##\|}" ] && return # stop if we have nothing to add
|
||||||
|
|
||||||
|
# maintain the file
|
||||||
|
local tempfile
|
||||||
|
tempfile="$(mktemp "$_FASD_DATA".XXXXXX)" || return
|
||||||
|
$_FASD_AWK -v list="$paths" -v now="$(date +%s)" -v max="$_FASD_MAX" -F"|" '
|
||||||
|
BEGIN {
|
||||||
|
split(list, files, "|")
|
||||||
|
for(i in files) {
|
||||||
|
path = files[i]
|
||||||
|
if(path == "") continue
|
||||||
|
paths[path] = path # array for checking
|
||||||
|
rank[path] = 1
|
||||||
|
time[path] = now
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$2 >= 1 {
|
||||||
|
if($1 in paths) {
|
||||||
|
rank[$1] = $2 + 1 / $2
|
||||||
|
time[$1] = now
|
||||||
|
} else {
|
||||||
|
rank[$1] = $2
|
||||||
|
time[$1] = $3
|
||||||
|
}
|
||||||
|
count += $2
|
||||||
|
}
|
||||||
|
END {
|
||||||
|
if(count > max)
|
||||||
|
for(i in rank) print i "|" 0.9*rank[i] "|" time[i] # aging
|
||||||
|
else
|
||||||
|
for(i in rank) print i "|" rank[i] "|" time[i]
|
||||||
|
}' "$_FASD_DATA" 2>> "$_FASD_SINK" >| "$tempfile"
|
||||||
|
if [ $? -ne 0 -a -f "$_FASD_DATA" ]; then
|
||||||
|
env rm -f "$tempfile"
|
||||||
|
else
|
||||||
|
env mv -f "$tempfile" "$_FASD_DATA"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
--delete|-D) shift # delete entries
|
||||||
|
# stop if we don't own $_FASD_DATA or $_FASD_RO is set
|
||||||
|
[ -f "$_FASD_DATA" -a ! -O "$_FASD_DATA" ] || [ "$_FASD_RO" ] && return
|
||||||
|
|
||||||
|
# turn valid arguments into entry-deleting sed commands
|
||||||
|
local sed_cmd="$(while [ "$1" ]; do printf %s\\n "$1"; shift; done | \
|
||||||
|
sed '/^[^/]/s@^@'"$PWD"'/@;s@/\.\.$@/../@;s@/\(\./\)\{1,\}@/@g;:0
|
||||||
|
s@[^/][^/]*//*\.\./@/@;t 0
|
||||||
|
s@^/*\.\./@/@;s@//*@/@g;s@/\.\{0,1\}$@@
|
||||||
|
s@^$@/@;s@\([.[\/*^$]\)@\\\1@g;s@^\(.*\)$@/^\1|/d@' 2>> "$_FASD_SINK")"
|
||||||
|
|
||||||
|
# maintain the file
|
||||||
|
local tempfile
|
||||||
|
tempfile="$(mktemp "$_FASD_DATA".XXXXXX)" || return
|
||||||
|
|
||||||
|
sed "$sed_cmd" "$_FASD_DATA" 2>> "$_FASD_SINK" >| "$tempfile"
|
||||||
|
|
||||||
|
if [ $? -ne 0 -a -f "$_FASD_DATA" ]; then
|
||||||
|
env rm -f "$tempfile"
|
||||||
|
else
|
||||||
|
env mv -f "$tempfile" "$_FASD_DATA"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
--query) shift # query the db, --query [$typ ["$fnd" [$mode]]]
|
||||||
|
[ -f "$_FASD_DATA" ] || return # no db yet
|
||||||
|
[ "$1" ] && local typ="$1"
|
||||||
|
[ "$2" ] && local fnd="$2"
|
||||||
|
[ "$3" ] && local mode="$3"
|
||||||
|
|
||||||
|
# cat all backends
|
||||||
|
local each _fasd_data; for each in $_FASD_BACKENDS; do
|
||||||
|
_fasd_data="$_fasd_data
|
||||||
|
$(fasd --backend $each)"
|
||||||
|
done
|
||||||
|
[ "$_fasd_data" ] || _fasd_data="$(cat "$_FASD_DATA")"
|
||||||
|
|
||||||
|
# set mode specific code for calculating the prior
|
||||||
|
case $mode in
|
||||||
|
rank) local prior='times[i]';;
|
||||||
|
recent) local prior='sqrt(100000/(1+t-la[i]))';;
|
||||||
|
*) local prior='times[i] * frecent(la[i])';;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ "$fnd" ]; then # dafault matching
|
||||||
|
local bre="$(printf %s\\n "$fnd" | sed 's/\([*\.\\\[]\)/\\\1/g
|
||||||
|
s@ @[^|]*@g;s/\$$/|/')"
|
||||||
|
bre='^[^|]*'"$bre"'[^|/]*|'
|
||||||
|
local _ret="$(printf %s\\n "$_fasd_data" | grep "$bre")"
|
||||||
|
[ "$_ret" ] && _ret="$(printf %s\\n "$_ret" | while read -r line; do
|
||||||
|
[ -${typ:-e} "${line%%\|*}" ] && printf %s\\n "$line"
|
||||||
|
done)"
|
||||||
|
if [ "$_ret" ]; then
|
||||||
|
_fasd_data="$_ret"
|
||||||
|
else # no case mathcing
|
||||||
|
_ret="$(printf %s\\n "$_fasd_data" | grep -i "$bre")"
|
||||||
|
[ "$_ret" ] && _ret="$(printf %s\\n "$_ret" | while read -r line; do
|
||||||
|
[ -${typ:-e} "${line%%\|*}" ] && printf %s\\n "$line"
|
||||||
|
done)"
|
||||||
|
if [ "$_ret" ]; then
|
||||||
|
_fasd_data="$_ret"
|
||||||
|
elif [ "${_FASD_FUZZY:-0}" -gt 0 ]; then # fuzzy matching
|
||||||
|
local fuzzy_bre="$(printf %s\\n "$fnd" | \
|
||||||
|
sed 's/\([*\.\\\[]\)/\\\1/g;s/\$$/|/
|
||||||
|
s@\(\\\{0,1\}[^ ]\)@\1[^|/]\\{0,'"$_FASD_FUZZY"'\\}@g
|
||||||
|
s@ @[^|]*@g')"
|
||||||
|
fuzzy_bre='^[^|]*'"$fuzzy_bre"'[^|/]*|'
|
||||||
|
_ret="$(printf %s\\n "$_fasd_data" | grep -i "$fuzzy_bre")"
|
||||||
|
[ "$_ret" ] && _ret="$(printf %s\\n "$_ret" | while read -r line; do
|
||||||
|
[ -${typ:-e} "${line%%\|*}" ] && printf %s\\n "$line"
|
||||||
|
done)"
|
||||||
|
[ "$_ret" ] && _fasd_data="$_ret" || _fasd_data=
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
else # no query arugments
|
||||||
|
_fasd_data="$(printf %s\\n "$_fasd_data" | while read -r line; do
|
||||||
|
[ -${typ:-e} "${line%%\|*}" ] && printf %s\\n "$line"
|
||||||
|
done)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# query the database
|
||||||
|
[ "$_fasd_data" ] && printf %s\\n "$_fasd_data" | \
|
||||||
|
$_FASD_AWK -v t="$(date +%s)" -F"|" '
|
||||||
|
function frecent(time) {
|
||||||
|
dx = t-time
|
||||||
|
if( dx < 3600 ) return 6
|
||||||
|
if( dx < 86400 ) return 4
|
||||||
|
if( dx < 604800 ) return 2
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
{
|
||||||
|
if(!paths[$1]) {
|
||||||
|
times[$1] = $2
|
||||||
|
la[$1] = $3
|
||||||
|
paths[$1] = 1
|
||||||
|
} else {
|
||||||
|
times[$1] += $2
|
||||||
|
if($3 > la[$1]) la[$1] = $3
|
||||||
|
}
|
||||||
|
}
|
||||||
|
END {
|
||||||
|
for(i in paths) printf "%-10s %s\n", '"$prior"', i
|
||||||
|
}' - 2>> "$_FASD_SINK"
|
||||||
|
;;
|
||||||
|
|
||||||
|
--backend)
|
||||||
|
case $2 in
|
||||||
|
native) cat "$_FASD_DATA";;
|
||||||
|
viminfo)
|
||||||
|
< "$_FASD_VIMINFO" sed -n '/^>/{s@~@'"$HOME"'@
|
||||||
|
s/^..//
|
||||||
|
p
|
||||||
|
}' | $_FASD_AWK -v t="$(date +%s)" '{
|
||||||
|
t -= 60
|
||||||
|
print $0 "|1|" t
|
||||||
|
}'
|
||||||
|
;;
|
||||||
|
recently-used)
|
||||||
|
local nl="$(printf '\\\nX')"; nl="${nl%X}" # slash newline for sed
|
||||||
|
tr -d '\n' < "$_FASD_RECENTLY_USED_XBEL" | \
|
||||||
|
sed 's@file:/@'"$nl"'@g;s@count="@'"$nl"'@g' | sed '1d;s/".*$//' | \
|
||||||
|
tr '\n' '|' | sed 's@|/@'"$nl"'@g' | $_FASD_AWK -F'|' '{
|
||||||
|
sum = 0
|
||||||
|
for( i=2; i<=NF; i++ ) sum += $i
|
||||||
|
print $1 "|" sum
|
||||||
|
}'
|
||||||
|
;;
|
||||||
|
current)
|
||||||
|
for path in *; do
|
||||||
|
printf "$PWD/%s|1\\n" "$path"
|
||||||
|
done
|
||||||
|
;;
|
||||||
|
spotlight)
|
||||||
|
mdfind '(kMDItemFSContentChangeDate >= $time.today) ||
|
||||||
|
kMDItemLastUsedDate >= $time.this_month' \
|
||||||
|
| sed '/Library\//d
|
||||||
|
/\.app$/d
|
||||||
|
s/$/|2/'
|
||||||
|
;;
|
||||||
|
*) eval "$2";;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
|
||||||
|
*) # parsing logic and processing
|
||||||
|
local fnd= last= _FASD_BACKENDS="$_FASD_BACKENDS" _fasd_data= comp= exec=
|
||||||
|
while [ "$1" ]; do case $1 in
|
||||||
|
--complete) [ "$2" = "--" ] && shift; set -- $2; local lst=1 r=r comp=1;;
|
||||||
|
--query|--add|--delete|-A|-D) fasd "$@"; return $?;;
|
||||||
|
--version) [ -z "$comp" ] && echo "1.0.1" && return;;
|
||||||
|
--) while [ "$2" ]; do shift; fnd="$fnd $1"; last="$1"; done;;
|
||||||
|
-*) local o="${1#-}"; while [ "$o" ]; do case $o in
|
||||||
|
s*) local show=1;;
|
||||||
|
l*) local lst=1;;
|
||||||
|
i*) [ -z "$comp" ] && local interactive=1 show=1;;
|
||||||
|
r*) local mode=rank;;
|
||||||
|
t*) local mode=recent;;
|
||||||
|
e*) o="${o#?}"; if [ "$o" ]; then # there are characters after "-e"
|
||||||
|
local exec="$o" # anything after "-e"
|
||||||
|
else # use the next argument
|
||||||
|
local exec="${2:?"-e: Argument needed "}"
|
||||||
|
shift
|
||||||
|
fi; break;;
|
||||||
|
b*) o="${o#?}"; if [ "$o" ]; then
|
||||||
|
_FASD_BACKENDS="$o"
|
||||||
|
else
|
||||||
|
_FASD_BACKENDS="${2:?"-b: Argument needed"}"
|
||||||
|
shift
|
||||||
|
fi; break;;
|
||||||
|
B*) o="${o#?}"; if [ "$o" ]; then
|
||||||
|
_FASD_BACKENDS="$_FASD_BACKENDS $o"
|
||||||
|
else
|
||||||
|
_FASD_BACKENDS="$_FASD_BACKENDS ${2:?"-B: Argument needed"}"
|
||||||
|
shift
|
||||||
|
fi; break;;
|
||||||
|
a*) local typ=e;;
|
||||||
|
d*) local typ=d;;
|
||||||
|
f*) local typ=f;;
|
||||||
|
R*) local r=r;;
|
||||||
|
[0-9]*) local _fasd_i="$o"; break;;
|
||||||
|
h*) [ -z "$comp" ] && echo "fasd [options] [query ...]
|
||||||
|
[f|a|s|d|z] [options] [query ...]
|
||||||
|
options:
|
||||||
|
-s list paths with scores
|
||||||
|
-l list paths without scores
|
||||||
|
-i interactive mode
|
||||||
|
-e <cmd> set command to execute on the result file
|
||||||
|
-b <name> only use <name> backend
|
||||||
|
-B <name> add additional backend <name>
|
||||||
|
-a match files and directories
|
||||||
|
-d match directories only
|
||||||
|
-f match files only
|
||||||
|
-r match by rank only
|
||||||
|
-t match by recent access only
|
||||||
|
-R reverse listing order
|
||||||
|
-h show a brief help message
|
||||||
|
-[0-9] select the nth entry
|
||||||
|
|
||||||
|
fasd [-A|-D] [paths ...]
|
||||||
|
-A add paths
|
||||||
|
-D delete paths" >&2 && return;;
|
||||||
|
esac; o="${o#?}"; done;;
|
||||||
|
*) fnd="$fnd $1"; last="$1";;
|
||||||
|
esac; shift; done
|
||||||
|
|
||||||
|
# guess whether the last query is selected from tab completion
|
||||||
|
case $last in
|
||||||
|
/?*) if [ -z "$show$lst" -a -${typ:-e} "$last" -a "$exec" ]; then
|
||||||
|
$exec "$last"
|
||||||
|
return
|
||||||
|
fi;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
local R; [ -z "$r" ] && R=r || R= # let $R be the opposite of $r
|
||||||
|
fnd="${fnd# }"
|
||||||
|
|
||||||
|
local res
|
||||||
|
res="$(fasd --query 2>> "$_FASD_SINK")" # query the database
|
||||||
|
[ $? -gt 0 ] && return
|
||||||
|
if [ 0 -lt ${_fasd_i:-0} ] 2>> "$_FASD_SINK"; then
|
||||||
|
res="$(printf %s\\n "$res" | sort -n${R} | \
|
||||||
|
sed -n "$_fasd_i"'s/^[^ ]*[ ]*//p')"
|
||||||
|
elif [ "$interactive" ] || [ "$exec" -a -z "$fnd$lst$show" -a -t 1 ]; then
|
||||||
|
if [ "$(printf %s "$res" | sed -n '$=')" -gt 1 ]; then
|
||||||
|
res="$(printf %s\\n "$res" | sort -n${R})"
|
||||||
|
printf %s\\n "$res" | sed = | sed 'N;s/\n/ /' | sort -nr >&2
|
||||||
|
printf "> " >&2
|
||||||
|
local i; read i; [ 0 -lt "${i:-0}" ] 2>> "$_FASD_SINK" || return 1
|
||||||
|
fi
|
||||||
|
res="$(printf %s\\n "$res" | sed -n "${i:-1}"'s/^[^ ]*[ ]*//p')"
|
||||||
|
elif [ "$lst" ]; then
|
||||||
|
[ "$res" ] && printf %s\\n "$res" | sort -n${r} | sed 's/^[^ ]*[ ]*//'
|
||||||
|
return
|
||||||
|
elif [ "$show" ]; then
|
||||||
|
[ "$res" ] && printf %s\\n "$res" | sort -n${r}
|
||||||
|
return
|
||||||
|
elif [ "$fnd" ] && [ "$exec" -o ! -t 1 ]; then # exec or subshell
|
||||||
|
res="$(printf %s\\n "$res" | sort -n | sed -n '$s/^[^ ]*[ ]*//p')"
|
||||||
|
else # no args, show
|
||||||
|
[ "$res" ] && printf %s\\n "$res" | sort -n${r}
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
if [ "$res" ]; then
|
||||||
|
fasd --add "$res"
|
||||||
|
[ -z "$exec" ] && exec='printf %s\n'
|
||||||
|
$exec "$res"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
fasd --init env
|
||||||
|
|
||||||
|
case $- in
|
||||||
|
*i*) ;; # assume being sourced, do nothing
|
||||||
|
*) # assume being executed as an executable
|
||||||
|
if [ -x "$_FASD_SHELL" -a -z "$_FASD_SET" ]; then
|
||||||
|
_FASD_SET=1 exec $_FASD_SHELL "$0" "$@"
|
||||||
|
else
|
||||||
|
fasd "$@"
|
||||||
|
fi;;
|
||||||
|
esac
|
||||||
|
|
@ -1,3 +1,5 @@
|
|||||||
|
[include]
|
||||||
|
path = .config/gitconfig.custom
|
||||||
[alias]
|
[alias]
|
||||||
i = "!git br&&git st"
|
i = "!git br&&git st"
|
||||||
# coa = "!for i in $(git branch -a|cut -b3-|grep remotes|sed -e 's/remotes\///'|cut -d/ -f1 --complement|cut -d\ -f1);do git checkout $i;done"
|
# coa = "!for i in $(git branch -a|cut -b3-|grep remotes|sed -e 's/remotes\///'|cut -d/ -f1 --complement|cut -d\ -f1);do git checkout $i;done"
|
||||||
@ -13,7 +15,7 @@
|
|||||||
st = status
|
st = status
|
||||||
br = branch -av
|
br = branch -av
|
||||||
hist = log --all --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ci) %C(bold blue)<%an>%Creset' --abbrev-commit
|
hist = log --all --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ci) %C(bold blue)<%an>%Creset' --abbrev-commit
|
||||||
d = difftool
|
dt = difftool
|
||||||
cbranch = !sh -c 'git commit -m \"$2\"&&git branch $1&&git reset --hard HEAD~1&&git co \"$1\"' -
|
cbranch = !sh -c 'git commit -m \"$2\"&&git branch $1&&git reset --hard HEAD~1&&git co \"$1\"' -
|
||||||
nbranch = !sh -c 'git branch $1&&git reset --hard HEAD~1&&git co \"$1\"' -
|
nbranch = !sh -c 'git branch $1&&git reset --hard HEAD~1&&git co \"$1\"' -
|
||||||
size = "!git diff --cached --binary | wc -c | numfmt --to=iec-i"
|
size = "!git diff --cached --binary | wc -c | numfmt --to=iec-i"
|
||||||
@ -24,6 +26,9 @@
|
|||||||
noignore = update-index --no-assume-unchanged
|
noignore = update-index --no-assume-unchanged
|
||||||
rename-branch = branch -m
|
rename-branch = branch -m
|
||||||
find-file = "!for branch in $(git for-each-ref --format=\"%(refname)\" refs/heads); do if git ls-tree -r --name-only $branch | grep \"$1\" > /dev/null; then echo \"${branch}:\"; git ls-tree -r --name-only $branch | nl -bn -w3 | grep \"$1\"; fi; done; :"
|
find-file = "!for branch in $(git for-each-ref --format=\"%(refname)\" refs/heads); do if git ls-tree -r --name-only $branch | grep \"$1\" > /dev/null; then echo \"${branch}:\"; git ls-tree -r --name-only $branch | nl -bn -w3 | grep \"$1\"; fi; done; :"
|
||||||
|
# n => no pager
|
||||||
|
ndiff = !git --no-pager diff
|
||||||
|
permission-reset = "!git diff -p -R --no-color | grep -E \"^(diff|(old|new) mode)\" --color=never | git apply"
|
||||||
[push]
|
[push]
|
||||||
default = matching
|
default = matching
|
||||||
[core]
|
[core]
|
||||||
@ -49,3 +54,8 @@
|
|||||||
clean = git-lfs clean -- %f
|
clean = git-lfs clean -- %f
|
||||||
smudge = git-lfs smudge -- %f
|
smudge = git-lfs smudge -- %f
|
||||||
process = git-lfs filter-process
|
process = git-lfs filter-process
|
||||||
|
[pager]
|
||||||
|
branch = false
|
||||||
|
[user]
|
||||||
|
name = Austen Adler
|
||||||
|
email = agadler@austenadler.com
|
@ -1,13 +1,18 @@
|
|||||||
!URxvt.boldFont: -misc-fixed-medium-r-semicondensed--13-100-100-100-c-60-iso8859-1
|
!URxvt.boldFont: -misc-fixed-medium-r-semicondensed--13-100-100-100-c-60-iso8859-1
|
||||||
|
URxvt.font: xft:Less Perfect DOS VGA
|
||||||
!URxvt.font: -*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
!URxvt.font: -*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
||||||
|
!URxvt.font: xft:Misc Fixed:size=14
|
||||||
!URxvt.boldFont: -*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
!URxvt.boldFont: -*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
||||||
!URxvt.font: xft:Fixed:style=SemiCondensed:size=10
|
!URxvt.font: xft:Fixed:style=SemiCondensed:size=10
|
||||||
!URxvt.font: xft:Inconsolata:size=12
|
!URxvt.font: xft:Inconsolata:size=12
|
||||||
!URxvt.font: xft:Terminus:size=12
|
!URxvt.font: xft:Terminus:size=12
|
||||||
!URxvt.font: xft:Neep:size=13
|
!URxvt.font: xft:jmk Neep
|
||||||
!URxvt.font: xft:Courier New:size=12
|
!URxvt.font: xft:Courier New:size=12
|
||||||
!URxvt.font: xft:Gohu GohuFont:size=12
|
!URxvt.font: xft:Gohu GohuFont:size=12
|
||||||
URxvt.font: xft:Misc Termsynu:size=13
|
!URxvt.font: xft:Misc Termsynu:size=13
|
||||||
|
!URxvt.font: xft:Unifont:size=13
|
||||||
|
!URxvt.font: xft:Monospace:size=11
|
||||||
|
!URxvt.font: xft:FixedsysTTF Semi-Bold:size=11
|
||||||
!URxvt.faceName: -*-*-*-*-*-*-10-*-*-*-*-*-*-*
|
!URxvt.faceName: -*-*-*-*-*-*-10-*-*-*-*-*-*-*
|
||||||
!URxvt.font: xft:Fixed:style=SemiCondensed:size=16
|
!URxvt.font: xft:Fixed:style=SemiCondensed:size=16
|
||||||
|
|
||||||
@ -20,7 +25,7 @@ URxvt.keysym.Control-Up: \033[1;5A
|
|||||||
URxvt.keysym.Control-Down: \033[1;5B
|
URxvt.keysym.Control-Down: \033[1;5B
|
||||||
URxvt.keysym.Control-Left: \033[1;5D
|
URxvt.keysym.Control-Left: \033[1;5D
|
||||||
URxvt.keysym.Control-Right: \033[1;5C
|
URxvt.keysym.Control-Right: \033[1;5C
|
||||||
URxvt.perl-ext-common: default,keyboard-select
|
URxvt.perl-ext-common: "default, keyboard-select -searchable-scrollback"
|
||||||
URxvt.keysym.M-Escape: perl:keyboard-select:activate
|
URxvt.keysym.M-Escape: perl:keyboard-select:activate
|
||||||
|
|
||||||
*backarrowKey: false
|
*backarrowKey: false
|
@ -18,15 +18,16 @@ bindsym $mod+shift+apostrophe bar mode dock
|
|||||||
# Rename a workspace
|
# Rename a workspace
|
||||||
bindsym $mod+shift+d exec i3-input -F 'rename workspace to "%s"' -P 'Rename to: '
|
bindsym $mod+shift+d exec i3-input -F 'rename workspace to "%s"' -P 'Rename to: '
|
||||||
# Rofi shortcuts
|
# Rofi shortcuts
|
||||||
bindsym $mod+p exec "~/.i3/run.sh run"
|
bindsym $mod+d exec "~/.config/i3/run.sh run"
|
||||||
# Clipboard manager
|
# Clipboard manager
|
||||||
bindsym ctrl+Mod1+v exec "~/.i3/run.sh clip"
|
#bindsym ctrl+Mod1+v exec "~/.config/i3/run.sh clip"
|
||||||
# Pass shortcut
|
# Pass shortcut
|
||||||
#bindsym $mod+shift+p exec "keepass --auto-type"
|
#bindsym $mod+shift+p exec "keepass --auto-type"
|
||||||
bindsym $mod+shift+p exec "rofi-pass --last-used"
|
#bindsym $mod+shift+p exec "rofi-pass --last-used"
|
||||||
# Misc shortcuts
|
# Misc shortcuts
|
||||||
bindsym --release Num_Lock exec "xdotool key --clearmodifiers Shift+Insert;numlockx on"
|
bindsym --release Num_Lock exec "xdotool key --clearmodifiers Shift+Insert;numlockx on"
|
||||||
bindsym Print exec "~/.i3/run.sh screenshot"
|
bindsym $mod+p exec "~/.config/i3/run.sh screenshot"
|
||||||
|
bindsym $mod+shift+p sticky toggle
|
||||||
# Split in vertical orientation
|
# Split in vertical orientation
|
||||||
bindsym $mod+v split h
|
bindsym $mod+v split h
|
||||||
# Split in horizontal orientation
|
# Split in horizontal orientation
|
||||||
@ -53,6 +54,8 @@ bindsym XF86AudioLowerVolume exec "amixer set Master 7%- unmute"
|
|||||||
bindsym XF86AudioMute exec "amixer -D pulse set Master 1+ toggle;amixer set Master 0%"
|
bindsym XF86AudioMute exec "amixer -D pulse set Master 1+ toggle;amixer set Master 0%"
|
||||||
# Toggle toucpad
|
# Toggle toucpad
|
||||||
bindsym $mod+backslash exec "synclient TouchpadOff=$(synclient -l | grep -c 'TouchpadOff.*=.*0')"
|
bindsym $mod+backslash exec "synclient TouchpadOff=$(synclient -l | grep -c 'TouchpadOff.*=.*0')"
|
||||||
|
# Toggle tap to click
|
||||||
|
bindsym $mod+shift+backslash exec "synclient TapButton2=$(($(synclient -l | grep -c 'TapButton1.*=.*0') * 3));synclient TapButton1=$(synclient -l | grep -c 'TapButton1.*=.*0')"
|
||||||
# Movement
|
# Movement
|
||||||
bindsym $mod+o workspace back_and_forth
|
bindsym $mod+o workspace back_and_forth
|
||||||
bindsym $mod+bracketleft workspace prev
|
bindsym $mod+bracketleft workspace prev
|
||||||
@ -73,6 +76,11 @@ bindsym $mod+shift+Left move left
|
|||||||
bindsym $mod+shift+Down move down
|
bindsym $mod+shift+Down move down
|
||||||
bindsym $mod+shift+Up move up
|
bindsym $mod+shift+Up move up
|
||||||
bindsym $mod+shift+Right move right
|
bindsym $mod+shift+Right move right
|
||||||
|
# Moving to corners
|
||||||
|
bindsym $mod+ctrl+h exec "~/.config/i3/run.sh move left"
|
||||||
|
bindsym $mod+ctrl+j exec "~/.config/i3/run.sh move bottom"
|
||||||
|
bindsym $mod+ctrl+k exec "~/.config/i3/run.sh move top"
|
||||||
|
bindsym $mod+ctrl+l exec "~/.config/i3/run.sh move right"
|
||||||
# Fullscreen
|
# Fullscreen
|
||||||
bindsym $mod+f fullscreen
|
bindsym $mod+f fullscreen
|
||||||
bindsym $mod+shift+f fullscreen global
|
bindsym $mod+shift+f fullscreen global
|
||||||
@ -82,7 +90,7 @@ bindsym $mod+w layout tabbed
|
|||||||
bindsym $mod+e layout toggle split
|
bindsym $mod+e layout toggle split
|
||||||
bindsym $mod+shift+space floating toggle
|
bindsym $mod+shift+space floating toggle
|
||||||
bindsym $mod+space focus mode_toggle
|
bindsym $mod+space focus mode_toggle
|
||||||
#bindsym $mod+space exec "~/.i3/run.sh window"
|
bindsym $mod+comma exec "~/.config/i3/run.sh window"
|
||||||
bindsym $mod+1 $x_switch 1
|
bindsym $mod+1 $x_switch 1
|
||||||
bindsym $mod+2 $x_switch 2
|
bindsym $mod+2 $x_switch 2
|
||||||
bindsym $mod+3 $x_switch 3
|
bindsym $mod+3 $x_switch 3
|
||||||
@ -103,19 +111,20 @@ bindsym $mod+shift+7 move container to workspace 7
|
|||||||
bindsym $mod+shift+8 move container to workspace 8
|
bindsym $mod+shift+8 move container to workspace 8
|
||||||
bindsym $mod+shift+9 move container to workspace 9
|
bindsym $mod+shift+9 move container to workspace 9
|
||||||
bindsym $mod+shift+0 move container to workspace 10
|
bindsym $mod+shift+0 move container to workspace 10
|
||||||
bindsym $mod+d exec "~/.i3/run.sh copy"
|
bindsym $mod+grave exec "~/.config/i3/run.sh screen-lock"
|
||||||
bindsym $mod+grave exec "~/.i3/run.sh screen-lock"
|
bindsym $mod+shift+grave exec "~/.config/i3/run.sh screen-lock"
|
||||||
bindsym $mod+shift+grave exec "~/.i3/run.sh screen-lock"
|
|
||||||
bindsym $mod+r mode "resize"
|
bindsym $mod+r mode "resize"
|
||||||
bindsym $mod+u focus parent
|
bindsym $mod+u focus parent
|
||||||
bindsym $mod+shift+u focus child
|
bindsym $mod+shift+u focus child
|
||||||
bindsym --release $mod+n exec "~/.i3/run.sh paste"
|
bindsym --release $mod+n exec "~/.config/i3/run.sh paste"
|
||||||
|
# Reload i3
|
||||||
|
bindsym $mod+shift+r reload;exec notify-send -a i3 Reloaded
|
||||||
# Exit/restart i3
|
# Exit/restart i3
|
||||||
bindsym $mod+q restart
|
bindsym $mod+q restart
|
||||||
#bindsym $mod+shift+q exec "i3-nagbar -m 'NMRestart/Shutdown/Restart/Logout' -t warning -b NMRestart 'nmcli radio wifi off;sleep 1;nmcli radio wifi on' -b Shutdown 'sudo /sbin/poweroff' -b Restart 'sudo /sbin/shutdown -r now' -b Logout 'i3-msg exit' -b Sleep 'amixer set Master 0% mute;slock&until echo mem|sudo tee /sys/power/state>/dev/null;do sleep 1;done;sleep 4;nmcli radio wifi off;sleep 3;nmcli radio wifi on'"
|
#bindsym $mod+shift+q exec "i3-nagbar -m 'NMRestart/Shutdown/Restart/Logout' -t warning -b NMRestart 'nmcli radio wifi off;sleep 1;nmcli radio wifi on' -b Shutdown 'sudo /sbin/poweroff' -b Restart 'sudo /sbin/shutdown -r now' -b Logout 'i3-msg exit' -b Sleep 'amixer set Master 0% mute;slock&until echo mem|sudo tee /sys/power/state>/dev/null;do sleep 1;done;sleep 4;nmcli radio wifi off;sleep 3;nmcli radio wifi on'"
|
||||||
bindsym $mod+shift+q exec "~/.i3/run.sh shutdownprompt"
|
bindsym $mod+shift+q exec "~/.config/i3/run.sh shutdownprompt"
|
||||||
# Wallpaper
|
# Wallpaper
|
||||||
bindsym $mod+shift+w exec "~/.i3/run.sh wall"
|
bindsym $mod+shift+w exec "~/.config/i3/run.sh wall"
|
||||||
|
|
||||||
# Visuals
|
# Visuals
|
||||||
workspace_layout tabbed
|
workspace_layout tabbed
|
||||||
@ -135,7 +144,9 @@ set $yw #ccdc90
|
|||||||
set $gn #88b090
|
set $gn #88b090
|
||||||
set $rd #e89393
|
set $rd #e89393
|
||||||
# border background text
|
# border background text
|
||||||
client.focused #2f2f2f #2f2f2f #ffffff
|
#client.focused #2f2f2f #2f2f2f #ffffff
|
||||||
|
#client.focused #ffffff #ffffff #000000
|
||||||
|
client.focused #6a6a6a #6a6a6a #ffffff
|
||||||
client.unfocused $bg $bg $ia
|
client.unfocused $bg $bg $ia
|
||||||
client.focused_inactive $bg $bg $ac
|
client.focused_inactive $bg $bg $ac
|
||||||
client.urgent $rd $rd $tx
|
client.urgent $rd $rd $tx
|
||||||
@ -143,8 +154,8 @@ client.urgent $rd $rd $tx
|
|||||||
# Bar
|
# Bar
|
||||||
bar {
|
bar {
|
||||||
#height 12
|
#height 12
|
||||||
status_command i3status --config ~/.i3/i3status.conf
|
status_command i3status --config ~/.config/i3/i3status.conf
|
||||||
#status_command ~/.i3/status.sh
|
#status_command ~/.config/i3/status.sh
|
||||||
font -*-*-*-*-*-*-8-*-*-*-*-*-*-*
|
font -*-*-*-*-*-*-8-*-*-*-*-*-*-*
|
||||||
tray_output primary
|
tray_output primary
|
||||||
mode dock
|
mode dock
|
||||||
@ -175,6 +186,18 @@ mode "resize" {
|
|||||||
bindsym Escape mode "default"
|
bindsym Escape mode "default"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Minecraft mode
|
||||||
|
mode "minecraft" {
|
||||||
|
bindsym $mod+r exec "xdotool mousedown 3"
|
||||||
|
bindsym $mod+shift+r exec "xdotool mouseup 3";mode "default"
|
||||||
|
bindsym $mod+d exec "xdotool mousedown 1"
|
||||||
|
bindsym $mod+shift+d exec "xdotool mouseup 1";mode "default"
|
||||||
|
bindsym $mod+s exec "sleep 1;xdotool keydown Shift_R;sleep 1;xdotool mousedown 3"
|
||||||
|
bindsym $mod+shift+s exec "xdotool keyup Shift_R;xdotool mouseup 3";mode "default"
|
||||||
|
bindsym Return mode "default"
|
||||||
|
bindsym Escape mode "default"
|
||||||
|
}
|
||||||
|
bindsym $mod+m mode "minecraft"
|
||||||
|
|
||||||
# Startup
|
# Startup
|
||||||
# Monitor setup
|
# Monitor setup
|
||||||
@ -182,30 +205,33 @@ exec --no-startup-id "zsh -c 'xrandr --output eDP1 --primary || xrandr --output
|
|||||||
# Mute on boot
|
# Mute on boot
|
||||||
exec --no-startup-id amixer set Master 0% mute
|
exec --no-startup-id amixer set Master 0% mute
|
||||||
# Wallpaper
|
# Wallpaper
|
||||||
exec --no-startup-id "~/.i3/run.sh wall"
|
exec --no-startup-id "~/.config/i3/run.sh wall"
|
||||||
# Keyboard
|
# Keyboard
|
||||||
exec --no-startup-id xmodmap ~/.xmodmap
|
exec --no-startup-id xmodmap ~/.xmodmap
|
||||||
|
exec --no-startup-id xrdb ~/.Xresources
|
||||||
#exec --no-startup-id ~/xmodmap.sh
|
#exec --no-startup-id ~/xmodmap.sh
|
||||||
# Misc
|
# Misc
|
||||||
# Compositor
|
# Compositor
|
||||||
exec --no-startup-id compton
|
#exec --no-startup-id compton
|
||||||
# Spawn a terminal
|
# Spawn a terminal
|
||||||
#TODO: Currently the terminal will spawn in the current workspace
|
#TODO: Currently the terminal will spawn in the current workspace
|
||||||
exec --no-startup-id /usr/bin/urxvt
|
exec --no-startup-id /usr/bin/urxvt
|
||||||
# Orange tint
|
# Orange tint
|
||||||
exec --no-startup-id /usr/bin/redshift -l 36.3:-80.3 -t 4000:2000
|
exec --no-startup-id /usr/bin/redshift -l 36.3:-80.3 -t 4000:2000
|
||||||
# Sync x11 clipboards
|
# Sync x11 clipboards
|
||||||
#exec --no-startup-id /usr/bin/parcellite
|
exec --no-startup-id /usr/bin/parcellite
|
||||||
exec --no-startup-id /usr/bin/gpaste-client dr
|
#exec --no-startup-id /usr/bin/gpaste-client dr
|
||||||
# Turn off numlock!
|
# Turn off numlock!
|
||||||
exec --no-startup-id /usr/bin/numlockx
|
exec --no-startup-id /usr/bin/numlockx
|
||||||
# Run firefox/firefox-bin
|
# Run firefox/firefox-bin
|
||||||
exec --no-startup-id firefox -p a || firefox-bin -p a
|
exec --no-startup-id firefox || firefox-bin
|
||||||
# Start syncthing if it hasn't already been started
|
# Start syncthing if it hasn't already been started
|
||||||
#exec --no-startup-id /bin/zsh -c 'pidof syncthing||screen -dmS syncthing ~/bin/syncthing'
|
exec --no-startup-id /bin/zsh -c 'pidof syncthing||screen -dmS syncthing ~/bin/syncthing'
|
||||||
exec --no-startup-id nextcloud
|
#exec --no-startup-id nextcloud
|
||||||
# Start kdeconnect
|
# Start kdeconnect
|
||||||
exec --no-startup-id "~/bin/indicator-kdeconnect"
|
#exec --no-startup-id "~/bin/indicator-kdeconnect"
|
||||||
# riot
|
# riot
|
||||||
exec --no-startup-id riot-web --hidden
|
# exec --no-startup-id riot-web --hidden
|
||||||
|
# setxkbmap
|
||||||
|
exec --no-startup-id setxkbmap -option caps:swapescape
|
||||||
# vim: ts=2:sw=2:et
|
# vim: ts=2:sw=2:et
|
60
i3/.config/i3/i3status.conf
Normal file
60
i3/.config/i3/i3status.conf
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
#i3status config
|
||||||
|
general {
|
||||||
|
output_format= "i3bar"
|
||||||
|
colors = true
|
||||||
|
#color_good = '#ffffff'
|
||||||
|
#color_degraded = '#ffffff'
|
||||||
|
#color_bad = '#ffffff'
|
||||||
|
color_good = '#00ff00'
|
||||||
|
color_degraded = '#ff0000'
|
||||||
|
color_bad = '#ff0000'
|
||||||
|
interval = 1
|
||||||
|
}
|
||||||
|
order += "disk /"
|
||||||
|
order += "disk /home"
|
||||||
|
order += "cpu_usage"
|
||||||
|
order += "ethernet tun0"
|
||||||
|
order += "wireless wlo1"
|
||||||
|
order += "volume master"
|
||||||
|
order += "battery 0"
|
||||||
|
order += "tztime local"
|
||||||
|
ethernet tun0 {
|
||||||
|
# if you use %speed, i3status requires root privileges
|
||||||
|
format_up = "%ip"
|
||||||
|
format_down = "!T"
|
||||||
|
}
|
||||||
|
wireless wlo1 {
|
||||||
|
format_up = "%essid : %ip @ %quality"
|
||||||
|
format_down = "!W"
|
||||||
|
}
|
||||||
|
tztime local {
|
||||||
|
#format = "%a %b%e %r"
|
||||||
|
format = "%a %e %b %F %r"
|
||||||
|
#:%M:%S
|
||||||
|
}
|
||||||
|
load {
|
||||||
|
format = "%5min"
|
||||||
|
}
|
||||||
|
volume master {
|
||||||
|
format = "V:%volume"
|
||||||
|
format_muted = "V: 0%"
|
||||||
|
device = "default"
|
||||||
|
mixer = "Master"
|
||||||
|
mixer_idx = 0
|
||||||
|
}
|
||||||
|
battery 0 {
|
||||||
|
#format = "%status %remaining %emptytime"
|
||||||
|
format = "%status %percentage"
|
||||||
|
path = "/sys/class/power_supply/BAT0/uevent"
|
||||||
|
low_threshold = 20
|
||||||
|
}
|
||||||
|
disk "/" {
|
||||||
|
format = "/: %free"
|
||||||
|
}
|
||||||
|
disk "/home" {
|
||||||
|
format = "/h: %free"
|
||||||
|
}
|
||||||
|
cpu_usage {
|
||||||
|
format = "CPU: %usage"
|
||||||
|
}
|
||||||
|
# vim: ts=4:sw=4:et
|
163
i3/.config/i3/run.sh
Executable file
163
i3/.config/i3/run.sh
Executable file
@ -0,0 +1,163 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
ARG="$1"
|
||||||
|
shift
|
||||||
|
case "${ARG}" in
|
||||||
|
move)
|
||||||
|
eval "$(xdotool getwindowfocus getwindowgeometry | grep Geometry: | perl -pe 's/^\s*Geometry: /WinH=/;s/x/\nWinW=/g')"
|
||||||
|
eval "$(xdotool getwindowfocus getwindowgeometry | grep Position: | perl -pe 's/^\s*Position: /WinY=/;s/,/\nWinX=/g;s/\s\(.+//')"
|
||||||
|
eval "$(xrandr | grep -w connected | perl -pe 's/.+?(\d+x\d+)\+\d+\+\d+.*/\1/g;s/^/MonH=/;s/x/\nMonW=/;' | head -n2)"
|
||||||
|
if [[ "$ARG" = "top" ]]; then
|
||||||
|
echo $((WinY))
|
||||||
|
xdotool getwindowfocus windowmove $((WinY - 1)) 0
|
||||||
|
elif [[ "$ARG" = "right" ]]; then
|
||||||
|
xdotool getwindowfocus windowmove $((MonH - WinH)) $((WinX - 1))
|
||||||
|
elif [[ "$ARG" = "left" ]]; then
|
||||||
|
xdotool getwindowfocus windowmove 0 $((WinX - 1))
|
||||||
|
elif [[ "$ARG" = "bottom" ]]; then
|
||||||
|
xdotool getwindowfocus windowmove $((WinY - 1)) $((MonW - WinW))
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
lock)
|
||||||
|
declare -i ID
|
||||||
|
ID=`xinput list | grep -Eo 'TouchPad\s*id\=[0-9]{1,2}' | grep -Eo '[0-9]{1,2}'`
|
||||||
|
declare -i STATE
|
||||||
|
STATE=`xinput list-props "${ID}"|grep 'Device Enabled'|awk '{print $4}'`
|
||||||
|
if [[ $STATE -eq 1 ]];then
|
||||||
|
xinput disable "${ID}"
|
||||||
|
echo "Touchpad disabled."
|
||||||
|
else
|
||||||
|
xinput enable "${ID}"
|
||||||
|
echo "Touchpad enabled."
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
pass)
|
||||||
|
pass -c "$(ls ~/.password-store/*/*|cut -b-37 --complement|rofi -dmenu|sed -e 's/\.gpg//')"
|
||||||
|
;;
|
||||||
|
screensaver)
|
||||||
|
cat /tmp/noss||i3lock -di `shuf -n1 -e ~/.i3/wall/*`
|
||||||
|
;;
|
||||||
|
wall)
|
||||||
|
#if [[ -d ~/.i3/wallOM ]];then feh --bg-scale "`shuf -n1 -e ~/.i3/wallOM/*`";else feh --bg-scale "`shuf -n1 -e ~/.i3/wall/*`";fi;
|
||||||
|
#feh --bg-scale "$(shuf -n1 -e ~/.i3/wallOM/*)"
|
||||||
|
#feh --bg-scale ~/.i3/image.png
|
||||||
|
feh --bg-scale "$(shuf -n1 <(realpath /home/stonewareslord/sync/wallpaper/"$(hostname)"/*))"
|
||||||
|
;;
|
||||||
|
swap)
|
||||||
|
python <<-EOF
|
||||||
|
import i3
|
||||||
|
swap = [output for output in i3.get_outputs() if output['active']]
|
||||||
|
if len(swap) == 2:
|
||||||
|
for output in swap:
|
||||||
|
i3.workspace(output['current_workspace'])
|
||||||
|
i3.command('move', 'workspace to output right')
|
||||||
|
EOF
|
||||||
|
;;
|
||||||
|
boot)
|
||||||
|
test -f ~/.screenlayout/default.sh && ~/.screenlayout/default.sh
|
||||||
|
/usr/bin/xset -b
|
||||||
|
/usr/bin/xset +fp /usr/share/fonts/X11/misc
|
||||||
|
/usr/bin/xset +fp /usr/share/fonts/X11/Type1
|
||||||
|
/usr/bin/xset +fp built-ins
|
||||||
|
/usr/bin/xset s off
|
||||||
|
/usr/bin/xset -dpms
|
||||||
|
# This will segfault and ruin your day
|
||||||
|
#/usr/bin/urxvtd -q -f -o
|
||||||
|
#if [[ "$(hostname)" = "MMLin" ]]; then
|
||||||
|
# xrandr --output HDMI1 --primary
|
||||||
|
# xmodmap <(echo pointer = 3 2 1)
|
||||||
|
#elif [[ "$(hostname)" = "G2" ]]; then
|
||||||
|
# #TODO: Figure out what the display is called
|
||||||
|
# xrandr --output eDP1 --primary
|
||||||
|
# xmodmap <(echo pointer = 1 2 3)
|
||||||
|
#fi
|
||||||
|
#feh --bg-scale "$(shuf -n1 <(realpath /home/stonewareslord/owncloud/wallpaper/$(hostname)))"
|
||||||
|
#xinput --set-prop 'Logitech USB Optical Mouse' 'Device Accel Constant Deceleration' 3
|
||||||
|
if command -v ck-launch-session >/dev/null; then
|
||||||
|
ck-launch-session i3
|
||||||
|
else
|
||||||
|
i3
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
screen-lock)
|
||||||
|
revert(){
|
||||||
|
xset dpms 0 0 0
|
||||||
|
}
|
||||||
|
trap revert SIGHUP SIGINT SIGTERM
|
||||||
|
xset +dpms dpms 5 5 5
|
||||||
|
slock
|
||||||
|
revert
|
||||||
|
;;
|
||||||
|
paste)
|
||||||
|
sleep 2
|
||||||
|
DISPLAY=:0.0 xdotool type --clearmodifiers --file <(xsel)
|
||||||
|
;;
|
||||||
|
ping)
|
||||||
|
# Return code
|
||||||
|
RET=0
|
||||||
|
# nc has some intense divergence. netcat6 has no -z, but netcat has no -x
|
||||||
|
# -w3: 3 second timeout
|
||||||
|
# -4 : ipv4 only
|
||||||
|
# check if nc has -z
|
||||||
|
if nc -h |& grep -q -- -z; then
|
||||||
|
nc -w 1 -z4 "$ARG" "$1" >& /dev/null && RET=1
|
||||||
|
# check if nc has --transfer (-x)
|
||||||
|
elif nc -h |& grep -q -- --transfer; then
|
||||||
|
nc -w 1 -4 "$ARG" "$1" -x </dev/null >& /dev/null && RET=1
|
||||||
|
fi
|
||||||
|
echo $RET
|
||||||
|
;;
|
||||||
|
screenshot)
|
||||||
|
#\rm -f ~/last-photo/*(N)
|
||||||
|
find ~/last-photo/ -type f -delete
|
||||||
|
#DISPLAY=:0.0 xfce4-screenshooter -r -s ~/last-photo
|
||||||
|
FNAME="$HOME/last-photo/$(date +'%Y-%m-%d_%T').png"
|
||||||
|
DISPLAY=:0.0 import "${FNAME}"
|
||||||
|
DISPLAY=:0.0 xclip -selection clipboard -t image/png -i "${FNAME}"
|
||||||
|
#DISPLAY=:0.0 scrot -s "$HOME/last-photo/$(date +'%Y-%m-%d_%T').png"
|
||||||
|
\cp ~/last-photo/* ~/Pictures
|
||||||
|
;;
|
||||||
|
shutdownprompt)
|
||||||
|
RESP=$(printf 'Sleep\nNMRestart\nShutdown\nRestart\nLogout\n' | rofi -i -dmenu 2>/dev/null)
|
||||||
|
if [[ ! -z "$RESP" ]]; then
|
||||||
|
case "$RESP" in
|
||||||
|
NMRestart)
|
||||||
|
nmcli radio wifi off;sleep 1;nmcli radio wifi on
|
||||||
|
;;
|
||||||
|
Restart)
|
||||||
|
sudo /sbin/shutdown -r now
|
||||||
|
;;
|
||||||
|
Shutdown)
|
||||||
|
sudo /sbin/poweroff
|
||||||
|
;;
|
||||||
|
Logout)
|
||||||
|
i3-msg exit
|
||||||
|
;;
|
||||||
|
Sleep)
|
||||||
|
amixer set Master 0% mute
|
||||||
|
slock &
|
||||||
|
until sudo tee /sys/power/state <<<"mem" >/dev/null; do
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
sleep 4
|
||||||
|
nmcli radio wifi off
|
||||||
|
sleep 3
|
||||||
|
nmcli radio wifi on
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
run)
|
||||||
|
PATH="$HOME/bin:/usr/games/bin:$PATH" rofi -show run
|
||||||
|
;;
|
||||||
|
window)
|
||||||
|
rofi -show window
|
||||||
|
;;
|
||||||
|
clip)
|
||||||
|
# Get the rofi-selected index of what to paste
|
||||||
|
INDEX="$(gpaste-client --oneline | colrm 80 | rofi -dmenu | perl -pe 's/:.*//')"
|
||||||
|
# If they made a selection, select it
|
||||||
|
if [[ ! -z "$INDEX" ]]; then
|
||||||
|
gpaste-client select "$INDEX"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
3
i3/xsession → i3/.xsession
Normal file → Executable file
3
i3/xsession → i3/.xsession
Normal file → Executable file
@ -1,4 +1,5 @@
|
|||||||
exec ~/.i3/run.sh boot
|
#!/bin/sh
|
||||||
|
exec ~/.config/i3/run.sh boot
|
||||||
#exec /usr/bin/ck-launch-session /usr/local/bin/i3
|
#exec /usr/bin/ck-launch-session /usr/local/bin/i3
|
||||||
#exec numlockx&
|
#exec numlockx&
|
||||||
#exec syndaemon -i .5 -d&
|
#exec syndaemon -i .5 -d&
|
47
i3/gtkrc
47
i3/gtkrc
@ -1,47 +0,0 @@
|
|||||||
gtk_color_scheme = "bg_selected:#11ffeb\nbg_normal:#202020\nfg_normal:#f5f5f5\nfg_selected:#ffffff\n"
|
|
||||||
|
|
||||||
style "synapse"
|
|
||||||
{
|
|
||||||
bg[NORMAL] = @bg_normal
|
|
||||||
bg[SELECTED] = @bg_normal
|
|
||||||
fg[NORMAL] = @fg_normal
|
|
||||||
fg[SELECTED] = @fg_normal
|
|
||||||
|
|
||||||
base[NORMAL] = lighter (lighter (@bg_normal))
|
|
||||||
text[NORMAL] = @fg_normal
|
|
||||||
|
|
||||||
engine "murrine"
|
|
||||||
{
|
|
||||||
contrast = 0.6
|
|
||||||
arrowstyle = 2
|
|
||||||
reliefstyle = 3
|
|
||||||
highlight_shade = 1.0
|
|
||||||
glazestyle = 0
|
|
||||||
gradient_shades = {1.2, 1.0, 1.0, 0.8}
|
|
||||||
roundness = 4
|
|
||||||
lightborder_shade = 1.26
|
|
||||||
lightborderstyle = 1
|
|
||||||
separatorstyle = 1
|
|
||||||
}
|
|
||||||
|
|
||||||
SynapseGuiView :: border-radius = 14
|
|
||||||
SynapseGuiView :: shadow-size = 10
|
|
||||||
|
|
||||||
SynapseGuiViewEssential :: ui-width = 500
|
|
||||||
SynapseGuiViewEssential :: icon-size = 96
|
|
||||||
SynapseGuiViewEssential :: title-size = "large"
|
|
||||||
SynapseGuiViewEssential :: title-min-size = "medium"
|
|
||||||
SynapseGuiViewEssential :: description-size = "small"
|
|
||||||
SynapseGuiViewEssential :: description-min-size = "small"
|
|
||||||
|
|
||||||
SynapseGuiViewDoish :: pane-spacing = 30
|
|
||||||
SynapseGuiViewDoish :: icon-size = 140
|
|
||||||
SynapseGuiViewDoish :: title-size = "large"
|
|
||||||
SynapseGuiViewDoish :: title-min-size = "small"
|
|
||||||
SynapseGuiViewDoish :: description-size = "medium"
|
|
||||||
SynapseGuiViewDoish :: description-min-size = "medium"
|
|
||||||
}
|
|
||||||
|
|
||||||
widget_class "*SynapseWindow*" style "synapse"
|
|
||||||
widget_class "*SynapseGuiView*" style "synapse"
|
|
||||||
|
|
159
i3/run.sh
159
i3/run.sh
@ -1,159 +0,0 @@
|
|||||||
#!/usr/bin/env zsh
|
|
||||||
if [ "$1" = "lock" ];then
|
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
declare -i ID
|
|
||||||
ID=`xinput list | grep -Eo 'TouchPad\s*id\=[0-9]{1,2}' | grep -Eo '[0-9]{1,2}'`
|
|
||||||
declare -i STATE
|
|
||||||
STATE=`xinput list-props $ID|grep 'Device Enabled'|awk '{print $4}'`
|
|
||||||
if [ $STATE -eq 1 ];then
|
|
||||||
xinput disable $ID
|
|
||||||
echo "Touchpad disabled."
|
|
||||||
else
|
|
||||||
xinput enable $ID
|
|
||||||
echo "Touchpad enabled."
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
if [ "$1" = "pass" ];then
|
|
||||||
pass -c $(ls ~/.password-store/*/*|cut -b-37 --complement|rofi -dmenu|sed -e 's/\.gpg//')
|
|
||||||
fi
|
|
||||||
if [ "$1" = "screensaver" ];then
|
|
||||||
cat /tmp/noss||i3lock -di `shuf -n1 -e ~/.i3/wall/*`
|
|
||||||
fi
|
|
||||||
if [ "$1" = "wall" ];then
|
|
||||||
#if [[ -d ~/.i3/wallOM ]];then feh --bg-scale "`shuf -n1 -e ~/.i3/wallOM/*`";else feh --bg-scale "`shuf -n1 -e ~/.i3/wall/*`";fi;
|
|
||||||
#feh --bg-scale "$(shuf -n1 -e ~/.i3/wallOM/*)"
|
|
||||||
#feh --bg-scale ~/.i3/image.png
|
|
||||||
feh --bg-scale "$(shuf -n1 <(realpath /home/stonewareslord/sync/wallpaper/"$(hostname)"/*))"
|
|
||||||
fi
|
|
||||||
if [ "$1" = "swap" ];then
|
|
||||||
python << EOF
|
|
||||||
import i3
|
|
||||||
swap = [output for output in i3.get_outputs() if output['active']]
|
|
||||||
if len(swap) == 2:
|
|
||||||
for output in swap:
|
|
||||||
i3.workspace(output['current_workspace'])
|
|
||||||
i3.command('move', 'workspace to output right')
|
|
||||||
EOF
|
|
||||||
fi
|
|
||||||
if [ "$1" = "boot" ];then
|
|
||||||
test -f ~/.screenlayout/default.sh && ~/.screenlayout/default.sh
|
|
||||||
/usr/bin/xset -b
|
|
||||||
/usr/bin/xset +fp /usr/share/fonts/X11/misc
|
|
||||||
/usr/bin/xset +fp /usr/share/fonts/X11/Type1
|
|
||||||
/usr/bin/xset +fp built-ins
|
|
||||||
/usr/bin/xset s off
|
|
||||||
/usr/bin/xset -dpms
|
|
||||||
# This will segfault and ruin your day
|
|
||||||
#/usr/bin/urxvtd -q -f -o
|
|
||||||
if [ "$(hostname)" = "MMLin" ]; then
|
|
||||||
xrandr --output HDMI1 --primary
|
|
||||||
xmodmap <(echo pointer = 3 2 1)
|
|
||||||
elif [ "$(hostname)" = "G2" ]; then
|
|
||||||
#TODO: Figure out what the display is called
|
|
||||||
xrandr --output eDP1 --primary
|
|
||||||
xmodmap <(echo pointer = 1 2 3)
|
|
||||||
fi
|
|
||||||
feh --bg-scale $(shuf -n1 <(realpath /home/stonewareslord/owncloud/wallpaper/$(hostname)))
|
|
||||||
xinput --set-prop 'Logitech USB Optical Mouse' 'Device Accel Constant Deceleration' 3
|
|
||||||
$(which ck-launch-session 2>/dev/null) $(which i3)
|
|
||||||
fi
|
|
||||||
if [ "$1" = "screen-lock" ];then
|
|
||||||
revert(){
|
|
||||||
xset dpms 0 0 0
|
|
||||||
}
|
|
||||||
trap revert SIGHUP SIGINT SIGTERM
|
|
||||||
xset +dpms dpms 5 5 5
|
|
||||||
slock
|
|
||||||
revert
|
|
||||||
fi
|
|
||||||
if [ "$1" = "paste" ]; then
|
|
||||||
sleep 2
|
|
||||||
DISPLAY=:0.0 xdotool type --clearmodifiers --file <(xsel)
|
|
||||||
fi
|
|
||||||
if [ "$1" = "ping" ]; then
|
|
||||||
shift
|
|
||||||
# Return code
|
|
||||||
local RET=0
|
|
||||||
# nc has some intense divergence. netcat6 has no -z, but netcat has no -x
|
|
||||||
# -w3: 3 second timeout
|
|
||||||
# -4 : ipv4 only
|
|
||||||
# check if nc has -z
|
|
||||||
if nc -h |& grep -q -- -z; then
|
|
||||||
nc -w 1 -z4 "$1" "$2" >& /dev/null && RET=1
|
|
||||||
# check if nc has --transfer (-x)
|
|
||||||
elif nc -h |& grep -q -- --transfer; then
|
|
||||||
nc -w 1 -4 "$1" "$2" -x </dev/null >& /dev/null && RET=1
|
|
||||||
fi
|
|
||||||
echo $RET
|
|
||||||
fi
|
|
||||||
if [ "$1" = "ip" ]; then
|
|
||||||
shift
|
|
||||||
local RET=0
|
|
||||||
if [ "$(hostname)" = "MMLin" ]; then
|
|
||||||
if grep -q "$1" < <(ifconfig enp2s0f0); then
|
|
||||||
RET=1
|
|
||||||
fi
|
|
||||||
elif [ "$(hostname)" = "G2" ]; then
|
|
||||||
if grep -q "$1" < <(ifconfig enp1s0;ifconfig wlp2s0); then
|
|
||||||
RET=1
|
|
||||||
fi
|
|
||||||
elif [ "$(hostname)" = "SGen" ]; then
|
|
||||||
if grep -q "$1" < <(ifconfig enp0s25); then
|
|
||||||
RET=1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
echo $RET
|
|
||||||
fi
|
|
||||||
if [ "$1" = "copy" ]; then
|
|
||||||
(printf '-chegg ';xsel | perl -pe 's/[^a-zA-Z ]//g;chomp()') | xsel && notify-send "Copied" || notify-send "Error"
|
|
||||||
fi
|
|
||||||
if [ "$1" = "screenshot" ]; then
|
|
||||||
\rm -f ~/last-photo/*(N)
|
|
||||||
sleep .2
|
|
||||||
#DISPLAY=:0.0 xfce4-screenshooter -r -s ~/last-photo
|
|
||||||
local FNAME="$HOME/last-photo/$(date +'%Y-%m-%d_%T').png"
|
|
||||||
DISPLAY=:0.0 import "${FNAME}"
|
|
||||||
DISPLAY=:0.0 xclip -selection clipboard -t image/png -i "${FNAME}"
|
|
||||||
#DISPLAY=:0.0 scrot -s "$HOME/last-photo/$(date +'%Y-%m-%d_%T').png"
|
|
||||||
\cp ~/last-photo/* ~/Pictures
|
|
||||||
fi
|
|
||||||
if [ "$1" = "shutdownprompt" ]; then
|
|
||||||
RESP=$(printf 'Sleep\nNMRestart\nShutdown\nRestart\nLogout\n' | rofi -i -dmenu 2>/dev/null)
|
|
||||||
if [[ ! -z "$RESP" ]]; then
|
|
||||||
case "$RESP" in
|
|
||||||
NMRestart) nmcli radio wifi off;sleep 1;nmcli radio wifi on;;
|
|
||||||
Restart)
|
|
||||||
sudo /sbin/shutdown -r now
|
|
||||||
;;
|
|
||||||
Shutdown)
|
|
||||||
sudo /sbin/poweroff
|
|
||||||
;;
|
|
||||||
Logout)
|
|
||||||
i3-msg exit
|
|
||||||
;;
|
|
||||||
Sleep)
|
|
||||||
amixer set Master 0% mute
|
|
||||||
slock&until echo mem|sudo tee /sys/power/state>/dev/null;do sleep 1;done
|
|
||||||
sleep 4
|
|
||||||
nmcli radio wifi off
|
|
||||||
sleep 3
|
|
||||||
nmcli radio wifi on
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
if [ "$1" = "run" ]; then
|
|
||||||
PATH="$HOME/bin:/usr/games/bin:$PATH" rofi -show run
|
|
||||||
fi
|
|
||||||
if [ "$1" = "window" ]; then
|
|
||||||
rofi -show window
|
|
||||||
fi
|
|
||||||
if [ "$1" = "clip" ]; then
|
|
||||||
# Get the rofi-selected index of what to paste
|
|
||||||
local INDEX="$(gpaste-client --oneline | colrm 80 | rofi -dmenu | perl -pe 's/:.*//')"
|
|
||||||
# If they made a selection, select it
|
|
||||||
if [[ ! -z "$INDEX" ]]; then
|
|
||||||
gpaste-client select "$INDEX"
|
|
||||||
fi
|
|
||||||
fi
|
|
51
kak/.config/kak/kakrc
Normal file
51
kak/.config/kak/kakrc
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
# Disable mouse
|
||||||
|
set global ui_options ncurses_enable_mouse=false
|
||||||
|
|
||||||
|
colorscheme gruvbox
|
||||||
|
|
||||||
|
# Word-wrap
|
||||||
|
add-highlighter global/ wrap
|
||||||
|
add-highlighter global/ number-lines
|
||||||
|
|
||||||
|
# Tab complete and indent
|
||||||
|
hook global InsertCompletionShow .* %{
|
||||||
|
try %{
|
||||||
|
execute-keys -draft 'h<a-K>\h<ret>'
|
||||||
|
map window insert <tab> <c-n>
|
||||||
|
map window insert <s-tab> <c-p>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
hook global InsertCompletionHide .* %{
|
||||||
|
unmap window insert <tab> <c-n>
|
||||||
|
unmap window insert <s-tab> <c-p>
|
||||||
|
}
|
||||||
|
|
||||||
|
# Editorconfig
|
||||||
|
hook global BufOpenFile .* %{ editorconfig-load }
|
||||||
|
hook global BufNewFile .* %{ editorconfig-load }
|
||||||
|
|
||||||
|
# Surround
|
||||||
|
map global user [ i[<esc>a]<esc>H
|
||||||
|
map global user { i{<esc>a}<esc>H
|
||||||
|
map global user ( i(<esc>a)<esc>H
|
||||||
|
map global user <lt> i<lt><esc>a<gt><esc>H
|
||||||
|
map global user \' i'<esc>a'<esc>H
|
||||||
|
map global user \" i"<esc>a"<esc>H
|
||||||
|
|
||||||
|
# Plug
|
||||||
|
source "%val{config}/plugins/plug.kak/rc/plug.kak"
|
||||||
|
|
||||||
|
# Plugins
|
||||||
|
plug "andreyorst/smarttab.kak" defer smarttab %{
|
||||||
|
# when `backspace' is pressed, 4 spaces are deleted at once
|
||||||
|
set-option global softtabstop 4
|
||||||
|
} config %{
|
||||||
|
hook global WinSetOption filetype=(rust|markdown|kak|lisp|scheme|perl|c|cpp|java) expandtab
|
||||||
|
hook global WinSetOption filetype=(go|sh|makefile|gas) noexpandtab
|
||||||
|
}
|
||||||
|
|
||||||
|
plug "andreyorst/fzf.kak" config %{
|
||||||
|
map -docstring 'fzf mode' global normal '<c-p>' ': fzf-mode<ret>'
|
||||||
|
|
||||||
|
set-option global fzf_file_command 'rg' # 'ag', 'fd', or 'find'
|
||||||
|
}
|
1
kak/.config/kak/plugins/fzf.kak
Submodule
1
kak/.config/kak/plugins/fzf.kak
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit dc6d0a504ef43511642448c1d7447855b8f17f54
|
1
kak/.config/kak/plugins/plug.kak
Submodule
1
kak/.config/kak/plugins/plug.kak
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit af0b50a2e080a2f4d81b411f10b0f8b22438a0e4
|
1
kak/.config/kak/plugins/smarttab.kak
Submodule
1
kak/.config/kak/plugins/smarttab.kak
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit 1321c308edac6bd892e2bd2f683432402a04be98
|
13
mutt/.mutt/attach_fork.sh
Executable file
13
mutt/.mutt/attach_fork.sh
Executable file
@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
if (($# < 2)); then
|
||||||
|
printf "Invalid usage\nPress enter\n" >&2
|
||||||
|
read
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
set -xe
|
||||||
|
OLD_FILE="$1"
|
||||||
|
shift
|
||||||
|
BASENAME="$(basename "$OLD_FILE")"
|
||||||
|
NEW_FILE="$(mktemp --suffix "${BASENAME##*.}")"
|
||||||
|
cp --no-preserve=all -- "$OLD_FILE" "$NEW_FILE"
|
||||||
|
exec "$@" "$NEW_FILE" >/dev/null 2>&1 & disown
|
371
mutt/.mutt/bindings
Normal file
371
mutt/.mutt/bindings
Normal file
@ -0,0 +1,371 @@
|
|||||||
|
# Heavily modified from https://github.com/iagox86/mutt/blob/master/keybindings.conf
|
||||||
|
|
||||||
|
# generic => *~pager/editor
|
||||||
|
# browser => Mailbox list
|
||||||
|
# index => List of emails
|
||||||
|
# pager => Email read screen
|
||||||
|
# attach => Attachments list
|
||||||
|
# editor => Command line; not sure what else
|
||||||
|
|
||||||
|
bind generic,pager,editor,index | noop
|
||||||
|
bind generic,pager,editor,index a noop
|
||||||
|
bind generic,pager,editor,index b noop
|
||||||
|
bind generic,pager,editor,index c noop
|
||||||
|
bind generic,pager,editor,index d noop
|
||||||
|
bind generic,pager,editor,index e noop
|
||||||
|
bind generic,pager,editor,index f noop
|
||||||
|
bind generic,pager,editor,index g noop
|
||||||
|
bind generic,pager,editor,index h noop
|
||||||
|
bind generic,pager,editor,index i noop
|
||||||
|
bind generic,pager,editor,index j noop
|
||||||
|
bind generic,pager,editor,index k noop
|
||||||
|
bind generic,pager,editor,index l noop
|
||||||
|
bind generic,pager,editor,index m noop
|
||||||
|
bind generic,pager,editor,index n noop
|
||||||
|
bind generic,pager,editor,index o noop
|
||||||
|
bind generic,pager,editor,index p noop
|
||||||
|
bind generic,pager,editor,index q noop
|
||||||
|
bind generic,pager,editor,index r noop
|
||||||
|
bind generic,pager,editor,index s noop
|
||||||
|
bind generic,pager,editor,index t noop
|
||||||
|
bind generic,pager,editor,index u noop
|
||||||
|
bind generic,pager,editor,index v noop
|
||||||
|
bind generic,pager,editor,index w noop
|
||||||
|
bind generic,pager,editor,index x noop
|
||||||
|
bind generic,pager,editor,index y noop
|
||||||
|
bind generic,pager,editor,index z noop
|
||||||
|
bind generic,pager,editor,index A noop
|
||||||
|
bind generic,pager,editor,index B noop
|
||||||
|
bind generic,pager,editor,index C noop
|
||||||
|
bind generic,pager,editor,index D noop
|
||||||
|
bind generic,pager,editor,index E noop
|
||||||
|
bind generic,pager,editor,index F noop
|
||||||
|
bind generic,pager,editor,index G noop
|
||||||
|
bind generic,pager,editor,index H noop
|
||||||
|
bind generic,pager,editor,index I noop
|
||||||
|
bind generic,pager,editor,index J noop
|
||||||
|
bind generic,pager,editor,index K noop
|
||||||
|
bind generic,pager,editor,index L noop
|
||||||
|
bind generic,pager,editor,index M noop
|
||||||
|
bind generic,pager,editor,index N noop
|
||||||
|
bind generic,pager,editor,index O noop
|
||||||
|
bind generic,pager,editor,index P noop
|
||||||
|
bind generic,pager,editor,index Q noop
|
||||||
|
bind generic,pager,editor,index R noop
|
||||||
|
bind generic,pager,editor,index S noop
|
||||||
|
bind generic,pager,editor,index T noop
|
||||||
|
bind generic,pager,editor,index U noop
|
||||||
|
bind generic,pager,editor,index V noop
|
||||||
|
bind generic,pager,editor,index W noop
|
||||||
|
bind generic,pager,editor,index X noop
|
||||||
|
bind generic,pager,editor,index Y noop
|
||||||
|
bind generic,pager,editor,index Z noop
|
||||||
|
|
||||||
|
bind generic,pager,editor,index <Tab> noop
|
||||||
|
bind generic,pager,editor,index <Space> noop
|
||||||
|
bind generic,pager,editor,index <PageUp> noop
|
||||||
|
bind generic,pager,editor,index <PageDown> noop
|
||||||
|
bind generic,pager,editor,index <Home> noop
|
||||||
|
bind generic,pager,editor,index <End> noop
|
||||||
|
bind generic,pager,editor,index <Insert> noop
|
||||||
|
bind generic,pager,editor,index <Delete> noop
|
||||||
|
bind generic,pager,editor,index <Up> noop
|
||||||
|
bind generic,pager,editor,index <Down> noop
|
||||||
|
bind generic,pager,editor,index <Left> noop
|
||||||
|
bind generic,pager,editor,index <Right> noop
|
||||||
|
bind generic,pager,editor,index <Enter> noop
|
||||||
|
bind generic,pager,editor,index <Return> noop
|
||||||
|
|
||||||
|
bind generic,pager,editor,index 1 noop
|
||||||
|
bind generic,pager,editor,index 2 noop
|
||||||
|
bind generic,pager,editor,index 3 noop
|
||||||
|
bind generic,pager,editor,index 4 noop
|
||||||
|
bind generic,pager,editor,index 5 noop
|
||||||
|
bind generic,pager,editor,index 6 noop
|
||||||
|
bind generic,pager,editor,index 7 noop
|
||||||
|
bind generic,pager,editor,index 8 noop
|
||||||
|
bind generic,pager,editor,index 9 noop
|
||||||
|
bind generic,pager,editor,index 0 noop
|
||||||
|
bind generic,pager,editor,index ! noop
|
||||||
|
bind generic,pager,editor,index @ noop
|
||||||
|
bind generic,pager,editor,index $ noop
|
||||||
|
bind generic,pager,editor,index % noop
|
||||||
|
bind generic,pager,editor,index ^ noop
|
||||||
|
bind generic,pager,editor,index & noop
|
||||||
|
bind generic,pager,editor,index * noop
|
||||||
|
bind generic,pager,editor,index ( noop
|
||||||
|
bind generic,pager,editor,index ) noop
|
||||||
|
|
||||||
|
bind generic,pager,editor,index \Ca noop
|
||||||
|
bind generic,pager,editor,index \Cb noop
|
||||||
|
bind generic,pager,editor,index \Cc noop
|
||||||
|
bind generic,pager,editor,index \Cd noop
|
||||||
|
bind generic,pager,editor,index \Ce noop
|
||||||
|
bind generic,pager,editor,index \Cf noop
|
||||||
|
bind generic,pager,editor,index \Cg noop
|
||||||
|
bind generic,pager,editor,index \Ch noop
|
||||||
|
bind generic,pager,editor,index \Ci noop
|
||||||
|
bind generic,pager,editor,index \Cj noop
|
||||||
|
bind generic,pager,editor,index \Ck noop
|
||||||
|
bind generic,pager,editor,index \Cl noop
|
||||||
|
bind generic,pager,editor,index \Cm noop
|
||||||
|
bind generic,pager,editor,index \Cn noop
|
||||||
|
bind generic,pager,editor,index \Co noop
|
||||||
|
bind generic,pager,editor,index \Cp noop
|
||||||
|
bind generic,pager,editor,index \Cq noop
|
||||||
|
bind generic,pager,editor,index \Cr noop
|
||||||
|
bind generic,pager,editor,index \Cs noop
|
||||||
|
bind generic,pager,editor,index \Ct noop
|
||||||
|
bind generic,pager,editor,index \Cu noop
|
||||||
|
bind generic,pager,editor,index \Cv noop
|
||||||
|
bind generic,pager,editor,index \Cw noop
|
||||||
|
bind generic,pager,editor,index \Cx noop
|
||||||
|
bind generic,pager,editor,index \Cy noop
|
||||||
|
bind generic,pager,editor,index \Cz noop
|
||||||
|
bind generic,pager,editor,index \CA noop
|
||||||
|
bind generic,pager,editor,index \CB noop
|
||||||
|
bind generic,pager,editor,index \CC noop
|
||||||
|
bind generic,pager,editor,index \CD noop
|
||||||
|
bind generic,pager,editor,index \CE noop
|
||||||
|
bind generic,pager,editor,index \CF noop
|
||||||
|
bind generic,pager,editor,index \CG noop
|
||||||
|
bind generic,pager,editor,index \CH noop
|
||||||
|
bind generic,pager,editor,index \CI noop
|
||||||
|
bind generic,pager,editor,index \CJ noop
|
||||||
|
bind generic,pager,editor,index \CK noop
|
||||||
|
bind generic,pager,editor,index \CL noop
|
||||||
|
bind generic,pager,editor,index \CM noop
|
||||||
|
bind generic,pager,editor,index \CN noop
|
||||||
|
bind generic,pager,editor,index \CO noop
|
||||||
|
bind generic,pager,editor,index \CP noop
|
||||||
|
bind generic,pager,editor,index \CQ noop
|
||||||
|
bind generic,pager,editor,index \CR noop
|
||||||
|
bind generic,pager,editor,index \CS noop
|
||||||
|
bind generic,pager,editor,index \CT noop
|
||||||
|
bind generic,pager,editor,index \CU noop
|
||||||
|
bind generic,pager,editor,index \CV noop
|
||||||
|
bind generic,pager,editor,index \CW noop
|
||||||
|
bind generic,pager,editor,index \CX noop
|
||||||
|
bind generic,pager,editor,index \CY noop
|
||||||
|
bind generic,pager,editor,index \CZ noop
|
||||||
|
|
||||||
|
bind generic,pager,editor,index \C<Tab> noop
|
||||||
|
bind generic,pager,editor,index \C<Space> noop
|
||||||
|
bind generic,pager,editor,index \C<PageUp> noop
|
||||||
|
bind generic,pager,editor,index \C<PageDown> noop
|
||||||
|
bind generic,pager,editor,index \C<Home> noop
|
||||||
|
bind generic,pager,editor,index \C<End> noop
|
||||||
|
bind generic,pager,editor,index \C<Insert> noop
|
||||||
|
bind generic,pager,editor,index \C<Delete> noop
|
||||||
|
bind generic,pager,editor,index \C<Up> noop
|
||||||
|
bind generic,pager,editor,index \C<Down> noop
|
||||||
|
bind generic,pager,editor,index \C<Left> noop
|
||||||
|
bind generic,pager,editor,index \C<Right> noop
|
||||||
|
bind generic,pager,editor,index \C<Enter> noop
|
||||||
|
bind generic,pager,editor,index \C<Return> noop
|
||||||
|
|
||||||
|
bind generic,pager,editor,index \C1 noop
|
||||||
|
bind generic,pager,editor,index \C2 noop
|
||||||
|
bind generic,pager,editor,index \C3 noop
|
||||||
|
bind generic,pager,editor,index \C4 noop
|
||||||
|
bind generic,pager,editor,index \C5 noop
|
||||||
|
bind generic,pager,editor,index \C6 noop
|
||||||
|
bind generic,pager,editor,index \C7 noop
|
||||||
|
bind generic,pager,editor,index \C8 noop
|
||||||
|
bind generic,pager,editor,index \C9 noop
|
||||||
|
bind generic,pager,editor,index \C0 noop
|
||||||
|
bind generic,pager,editor,index \C! noop
|
||||||
|
bind generic,pager,editor,index \C$ noop
|
||||||
|
bind generic,pager,editor,index \C% noop
|
||||||
|
bind generic,pager,editor,index \C^ noop
|
||||||
|
bind generic,pager,editor,index \C& noop
|
||||||
|
bind generic,pager,editor,index \C* noop
|
||||||
|
bind generic,pager,editor,index \C( noop
|
||||||
|
bind generic,pager,editor,index \C) noop
|
||||||
|
|
||||||
|
bind generic,pager,editor,index <Esc>a noop
|
||||||
|
bind generic,pager,editor,index <Esc>b noop
|
||||||
|
bind generic,pager,editor,index <Esc>c noop
|
||||||
|
bind generic,pager,editor,index <Esc>d noop
|
||||||
|
bind generic,pager,editor,index <Esc>e noop
|
||||||
|
bind generic,pager,editor,index <Esc>f noop
|
||||||
|
bind generic,pager,editor,index <Esc>g noop
|
||||||
|
bind generic,pager,editor,index <Esc>h noop
|
||||||
|
bind generic,pager,editor,index <Esc>i noop
|
||||||
|
bind generic,pager,editor,index <Esc>j noop
|
||||||
|
bind generic,pager,editor,index <Esc>k noop
|
||||||
|
bind generic,pager,editor,index <Esc>l noop
|
||||||
|
bind generic,pager,editor,index <Esc>m noop
|
||||||
|
bind generic,pager,editor,index <Esc>n noop
|
||||||
|
bind generic,pager,editor,index <Esc>o noop
|
||||||
|
bind generic,pager,editor,index <Esc>p noop
|
||||||
|
bind generic,pager,editor,index <Esc>q noop
|
||||||
|
bind generic,pager,editor,index <Esc>r noop
|
||||||
|
bind generic,pager,editor,index <Esc>s noop
|
||||||
|
bind generic,pager,editor,index <Esc>t noop
|
||||||
|
bind generic,pager,editor,index <Esc>u noop
|
||||||
|
bind generic,pager,editor,index <Esc>v noop
|
||||||
|
bind generic,pager,editor,index <Esc>w noop
|
||||||
|
bind generic,pager,editor,index <Esc>x noop
|
||||||
|
bind generic,pager,editor,index <Esc>y noop
|
||||||
|
bind generic,pager,editor,index <Esc>z noop
|
||||||
|
bind generic,pager,editor,index <Esc>A noop
|
||||||
|
bind generic,pager,editor,index <Esc>B noop
|
||||||
|
bind generic,pager,editor,index <Esc>C noop
|
||||||
|
bind generic,pager,editor,index <Esc>D noop
|
||||||
|
bind generic,pager,editor,index <Esc>E noop
|
||||||
|
bind generic,pager,editor,index <Esc>F noop
|
||||||
|
bind generic,pager,editor,index <Esc>G noop
|
||||||
|
bind generic,pager,editor,index <Esc>H noop
|
||||||
|
bind generic,pager,editor,index <Esc>I noop
|
||||||
|
bind generic,pager,editor,index <Esc>J noop
|
||||||
|
bind generic,pager,editor,index <Esc>K noop
|
||||||
|
bind generic,pager,editor,index <Esc>L noop
|
||||||
|
bind generic,pager,editor,index <Esc>M noop
|
||||||
|
bind generic,pager,editor,index <Esc>N noop
|
||||||
|
bind generic,pager,editor,index <Esc>O noop
|
||||||
|
bind generic,pager,editor,index <Esc>P noop
|
||||||
|
bind generic,pager,editor,index <Esc>Q noop
|
||||||
|
bind generic,pager,editor,index <Esc>R noop
|
||||||
|
bind generic,pager,editor,index <Esc>S noop
|
||||||
|
bind generic,pager,editor,index <Esc>T noop
|
||||||
|
bind generic,pager,editor,index <Esc>U noop
|
||||||
|
bind generic,pager,editor,index <Esc>V noop
|
||||||
|
bind generic,pager,editor,index <Esc>W noop
|
||||||
|
bind generic,pager,editor,index <Esc>X noop
|
||||||
|
bind generic,pager,editor,index <Esc>Y noop
|
||||||
|
bind generic,pager,editor,index <Esc>Z noop
|
||||||
|
|
||||||
|
bind generic,pager,editor,index <Esc><Tab> noop
|
||||||
|
bind generic,pager,editor,index <Esc><Space> noop
|
||||||
|
bind generic,pager,editor,index <Esc><PageUp> noop
|
||||||
|
bind generic,pager,editor,index <Esc><PageDown> noop
|
||||||
|
bind generic,pager,editor,index <Esc><Home> noop
|
||||||
|
bind generic,pager,editor,index <Esc><End> noop
|
||||||
|
bind generic,pager,editor,index <Esc><Insert> noop
|
||||||
|
bind generic,pager,editor,index <Esc><Delete> noop
|
||||||
|
bind generic,pager,editor,index <Esc><Up> noop
|
||||||
|
bind generic,pager,editor,index <Esc><Down> noop
|
||||||
|
bind generic,pager,editor,index <Esc><Left> noop
|
||||||
|
bind generic,pager,editor,index <Esc><Right> noop
|
||||||
|
bind generic,pager,editor,index <Esc><Enter> noop
|
||||||
|
bind generic,pager,editor,index <Esc><Return> noop
|
||||||
|
|
||||||
|
bind generic,pager,editor,index <Esc>1 noop
|
||||||
|
bind generic,pager,editor,index <Esc>2 noop
|
||||||
|
bind generic,pager,editor,index <Esc>3 noop
|
||||||
|
bind generic,pager,editor,index <Esc>4 noop
|
||||||
|
bind generic,pager,editor,index <Esc>5 noop
|
||||||
|
bind generic,pager,editor,index <Esc>6 noop
|
||||||
|
bind generic,pager,editor,index <Esc>7 noop
|
||||||
|
bind generic,pager,editor,index <Esc>8 noop
|
||||||
|
bind generic,pager,editor,index <Esc>9 noop
|
||||||
|
bind generic,pager,editor,index <Esc>0 noop
|
||||||
|
bind generic,pager,editor,index <Esc>! noop
|
||||||
|
bind generic,pager,editor,index <Esc>@ noop
|
||||||
|
bind generic,pager,editor,index <Esc>$ noop
|
||||||
|
bind generic,pager,editor,index <Esc>% noop
|
||||||
|
bind generic,pager,editor,index <Esc>^ noop
|
||||||
|
bind generic,pager,editor,index <Esc>& noop
|
||||||
|
bind generic,pager,editor,index <Esc>* noop
|
||||||
|
bind generic,pager,editor,index <Esc>( noop
|
||||||
|
bind generic,pager,editor,index <Esc>) noop
|
||||||
|
|
||||||
|
bind generic,pager,editor,index ^T noop
|
||||||
|
|
||||||
|
# Movement
|
||||||
|
bind generic,index 0 first-entry
|
||||||
|
bind generic,index g first-entry
|
||||||
|
bind generic,index G last-entry
|
||||||
|
# Right
|
||||||
|
bind generic <Return> select-entry
|
||||||
|
bind generic l select-entry
|
||||||
|
bind generic <Right> select-entry
|
||||||
|
bind index <Return> display-message
|
||||||
|
bind index l display-message
|
||||||
|
bind index <Right> display-message
|
||||||
|
bind pager l view-attachments
|
||||||
|
bind pager <Right> view-attachments
|
||||||
|
bind attach l view-text
|
||||||
|
bind attach <Right> view-text
|
||||||
|
# Left
|
||||||
|
macro index h "c?\t" "Go back to the list of mailboxes"
|
||||||
|
macro index <Left> "c?\t" "Go back to the list of mailboxes"
|
||||||
|
bind attach h exit
|
||||||
|
bind attach <Left> exit
|
||||||
|
bind pager h exit
|
||||||
|
bind pager <Left> exit
|
||||||
|
# Up
|
||||||
|
bind generic,index,pager <PageUp> previous-page
|
||||||
|
bind generic,index k previous-entry
|
||||||
|
bind generic,index <Up> previous-entry
|
||||||
|
bind pager k previous-line
|
||||||
|
bind pager <Up> previous-line
|
||||||
|
# Down
|
||||||
|
bind generic,index,pager <PageDown> next-page
|
||||||
|
bind generic,index j next-entry
|
||||||
|
bind generic,index <Down> next-entry
|
||||||
|
bind index n search-next
|
||||||
|
bind pager j next-line
|
||||||
|
bind pager <Down> next-line
|
||||||
|
bind pager N search-opposite
|
||||||
|
bind pager n next-entry
|
||||||
|
|
||||||
|
# Exit/Quit (quit will prompt)
|
||||||
|
bind generic,index,pager,index Q exit
|
||||||
|
bind generic,index,pager,index q exit # Does not work in neomutt!
|
||||||
|
|
||||||
|
# Reload configuration
|
||||||
|
macro generic,index,pager,editor ,<Space> ":source ~/.mutt/muttrc\n" "Reload mutt's configuration file"
|
||||||
|
|
||||||
|
# Tab complete
|
||||||
|
bind editor <Tab> complete-query
|
||||||
|
bind editor ^T complete
|
||||||
|
|
||||||
|
# Writing mail
|
||||||
|
bind index,pager m mail
|
||||||
|
bind index,pager r reply
|
||||||
|
bind index,pager <Esc>r group-reply # Control-r, \Cr
|
||||||
|
bind index,pager b bounce-message
|
||||||
|
bind index,pager f forward-message
|
||||||
|
|
||||||
|
# Archive
|
||||||
|
macro index,pager d "<save-message>=Archive<enter><enter>" "Archive"
|
||||||
|
macro index,pager y "<save-message>=Archive<enter><enter>" "Archive"
|
||||||
|
|
||||||
|
# Misc
|
||||||
|
bind generic,index,pager / search
|
||||||
|
bind generic,index,pager : enter-command
|
||||||
|
bind index,pager @ display-address
|
||||||
|
bind index,pager a create-alias
|
||||||
|
bind index,pager o sort-mailbox
|
||||||
|
bind index,pager s save-message
|
||||||
|
bind index,pager | pipe-message
|
||||||
|
bind index,pager $ sync-mailbox
|
||||||
|
macro index,pager <f5> "<sync-mailbox><enter><shell-escape>mbsync -a<enter>" "Show Mutt documentation"
|
||||||
|
bind index ? limit
|
||||||
|
bind index p print-message
|
||||||
|
bind index u undelete-message
|
||||||
|
bind index c change-folder
|
||||||
|
bind pager H display-toggle-weed
|
||||||
|
|
||||||
|
# Staging
|
||||||
|
#
|
||||||
|
# TODO: Might be used to do an mbsync
|
||||||
|
# bind index,pager R list-reply
|
||||||
|
#
|
||||||
|
# bind pager p print-message
|
||||||
|
#
|
||||||
|
# Setting/clearing flags
|
||||||
|
# bind index W clear-flag
|
||||||
|
# bind index w set-flag
|
||||||
|
# macro index ! wN "Mark email as unread"
|
||||||
|
# bind index P previous-new-then-unread
|
||||||
|
# bind index N next-new-then-unread
|
||||||
|
# macro index r WN<up>n "Mark as read, then go to next"
|
||||||
|
# bind index t read-thread
|
||||||
|
# macro index T tn
|
||||||
|
#
|
||||||
|
# bind browser <Space> check-new
|
||||||
|
# bind browser N select-new
|
||||||
|
# vim: set ft=neomuttrc
|
18
mutt/.mutt/gen_html.sh
Executable file
18
mutt/.mutt/gen_html.sh
Executable file
@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
FILE="$1"
|
||||||
|
if [[ -z "$FILE" ]]; then
|
||||||
|
printf "No HTML file given" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
TMP_DIR="$(mktemp -d)"
|
||||||
|
# Force the name input.html since some attachments may have malformed extensions/no extension
|
||||||
|
cp "$FILE" "$TMP_DIR/input.html"
|
||||||
|
|
||||||
|
# docker container run -it --rm -v "$TMP_DIR:/usr/src/app" zenika/alpine-chrome --no-sandbox --screenshot --hide-scrollbars "file:///usr/src/app/input.html"
|
||||||
|
# Works but screenshot is usually too large
|
||||||
|
# docker container run -it --net none --rm -v "$TMP_DIR:/usr/src/app" zenika/alpine-chrome --no-sandbox --screenshot --window-size=1280,1696 --hide-scrollbars "file:///usr/src/app/input.html"
|
||||||
|
docker container run -it --net none --rm -v "$TMP_DIR:/usr/src/app" zenika/alpine-chrome --no-sandbox --print-to-pdf --hide-scrollbars "file:///usr/src/app/input.html"
|
||||||
|
|
||||||
|
xdg-open "$TMP_DIR/output.pdf"
|
12
mutt/.mutt/mailcap
Normal file
12
mutt/.mutt/mailcap
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# text/html; w3m -I %{charset} -T text/html; copiousoutput;
|
||||||
|
# text/html; pandoc -f html -t markdown; copiousoutput; compose=vim %s
|
||||||
|
# application/pdf; pandoc -f html -t markdown; copiousoutput; compose=vim %s
|
||||||
|
application/pdf; ~/.mutt/attach_fork.sh %s okular
|
||||||
|
application/vnd.openxmlformats-officedocument.wordprocessingml.document; ~/.mutt/attach_fork.sh %s libreoffice
|
||||||
|
application/octet-stream; ~/.mutt/attach_fork.sh %s okular
|
||||||
|
|
||||||
|
text/html; ~/.mutt/gen_html.sh %s
|
||||||
|
text/html; w3m -I %{charset} -T text/html; copiousoutput
|
||||||
|
|
||||||
|
image/jpeg; ~/.mutt/attach_fork.sh %s feh
|
||||||
|
image/png; ~/.mutt/attach_fork.sh %s feh
|
81
mutt/.mutt/muttrc
Normal file
81
mutt/.mutt/muttrc
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
# Setup bindings
|
||||||
|
source ~/.mutt/bindings
|
||||||
|
|
||||||
|
set smtp_authenticators = "login"
|
||||||
|
#set ssl_force_tls = yes
|
||||||
|
set smtp_authenticators = 'gssapi:login'
|
||||||
|
|
||||||
|
# character set on sent messages
|
||||||
|
set send_charset="utf-8"
|
||||||
|
# if there is no character set given on incoming messages, it is probably windows
|
||||||
|
set assumed_charset="iso-8859-1"
|
||||||
|
|
||||||
|
set sendmail="/usr/bin/msmtp"
|
||||||
|
set use_from=yes
|
||||||
|
set use_envelope_from = yes
|
||||||
|
|
||||||
|
# So we can change from
|
||||||
|
set edit_headers=yes
|
||||||
|
|
||||||
|
# make sure Vim knows Mutt is a mail client and that a UTF-8 encoded message will be composed
|
||||||
|
set editor="vim -c 'set syntax=mail ft=mail enc=utf-8 formatoptions-=t'"
|
||||||
|
|
||||||
|
# Treat text as flowed
|
||||||
|
# End lines with whitespae to chomp them
|
||||||
|
# Otherwise, newlines will be kept
|
||||||
|
#set text_flowed
|
||||||
|
# Apparently this doesn't work well with some clients
|
||||||
|
|
||||||
|
# auto_view application/msword
|
||||||
|
# auto_view application/pdf
|
||||||
|
|
||||||
|
# make default search pattern to search in To, Cc and Subject
|
||||||
|
# set simple_search="~f %s | ~C %s | ~s %s"
|
||||||
|
|
||||||
|
# folder-hook 'personal'
|
||||||
|
# macro index 1 "<change-folder> =../EMAIL_ADDRESS/inbox/<enter>"
|
||||||
|
# macro index 2
|
||||||
|
set move = no
|
||||||
|
|
||||||
|
# Aliases
|
||||||
|
set alias_file = "~/.mutt-private/aliases"
|
||||||
|
set sort_alias = alias
|
||||||
|
set reverse_alias = yes
|
||||||
|
source $alias_file
|
||||||
|
|
||||||
|
# Pipe like a sane person
|
||||||
|
set pipe_decode = yes
|
||||||
|
|
||||||
|
# Sort reverse order
|
||||||
|
set sort_aux=reverse-date-received
|
||||||
|
set sort=threads
|
||||||
|
set sort_re
|
||||||
|
set date_format = "%m/%d/%t"
|
||||||
|
|
||||||
|
# prefer plain text
|
||||||
|
alternative_order text/plain text/enriched text/html
|
||||||
|
|
||||||
|
# auto convert text/html MIME type to text/plain
|
||||||
|
auto_view text/html
|
||||||
|
|
||||||
|
# urls
|
||||||
|
# macro pager \cb <pipe-entry>'tr -d "\n" | w3m'<enter> 'Follow links in w3m'
|
||||||
|
# macro pager \cb <pipe-entry>'w3m'<enter> 'Follow links in w3m'
|
||||||
|
# macro pager \cb <pipe-entry>'pandoc -f html -t markdown | vim -'<enter> 'Open as markdown'
|
||||||
|
# macro pager P <pipe-entry>'docker run pandoc pandoc -f html -t markdown' 'Open as markdown'
|
||||||
|
macro pager P <pipe-entry>'cat >>/tmp/eeee' 'Open as markdown'
|
||||||
|
|
||||||
|
set wait_key = no
|
||||||
|
|
||||||
|
set mailcap_path = ~/.mutt/mailcap
|
||||||
|
|
||||||
|
# set record="+Sent"
|
||||||
|
# set postponed="+Drafts"
|
||||||
|
|
||||||
|
set copy=yes
|
||||||
|
|
||||||
|
# macro index z "!mbsync -a^M" "Update through mbsync"
|
||||||
|
|
||||||
|
# Load account information
|
||||||
|
source ~/.mutt-private/private
|
||||||
|
# vim: set ft=muttrc
|
5
mutt/.mutt/neomuttrc
Normal file
5
mutt/.mutt/neomuttrc
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
source ~/.mutt/muttrc
|
||||||
|
# These bindings do not exist in mutt
|
||||||
|
bind generic,index,pager,index q noop
|
||||||
|
bind generic,index,pager,index q quit
|
||||||
|
bind index x toggle-read
|
372
mutt/.mutt/tmp.html
Normal file
372
mutt/.mutt/tmp.html
Normal file
@ -0,0 +1,372 @@
|
|||||||
|
# Heavily modified from https://github.com/iagox86/mutt/blob/master/keybindings.conf
|
||||||
|
|
||||||
|
# generic => *~pager/editor
|
||||||
|
# browser => Mailbox list
|
||||||
|
# index => List of emails
|
||||||
|
# pager => Email read screen
|
||||||
|
# attach => Attachments list
|
||||||
|
# editor => Command line; not sure what else
|
||||||
|
|
||||||
|
bind generic,pager,editor,index | noop
|
||||||
|
bind generic,pager,editor,index a noop
|
||||||
|
bind generic,pager,editor,index b noop
|
||||||
|
bind generic,pager,editor,index c noop
|
||||||
|
bind generic,pager,editor,index d noop
|
||||||
|
bind generic,pager,editor,index e noop
|
||||||
|
bind generic,pager,editor,index f noop
|
||||||
|
bind generic,pager,editor,index g noop
|
||||||
|
bind generic,pager,editor,index h noop
|
||||||
|
bind generic,pager,editor,index i noop
|
||||||
|
bind generic,pager,editor,index j noop
|
||||||
|
bind generic,pager,editor,index k noop
|
||||||
|
bind generic,pager,editor,index l noop
|
||||||
|
bind generic,pager,editor,index m noop
|
||||||
|
bind generic,pager,editor,index n noop
|
||||||
|
bind generic,pager,editor,index o noop
|
||||||
|
bind generic,pager,editor,index p noop
|
||||||
|
bind generic,pager,editor,index q noop
|
||||||
|
bind generic,pager,editor,index r noop
|
||||||
|
bind generic,pager,editor,index s noop
|
||||||
|
bind generic,pager,editor,index t noop
|
||||||
|
bind generic,pager,editor,index u noop
|
||||||
|
bind generic,pager,editor,index v noop
|
||||||
|
bind generic,pager,editor,index w noop
|
||||||
|
bind generic,pager,editor,index x noop
|
||||||
|
bind generic,pager,editor,index y noop
|
||||||
|
bind generic,pager,editor,index z noop
|
||||||
|
bind generic,pager,editor,index A noop
|
||||||
|
bind generic,pager,editor,index B noop
|
||||||
|
bind generic,pager,editor,index C noop
|
||||||
|
bind generic,pager,editor,index D noop
|
||||||
|
bind generic,pager,editor,index E noop
|
||||||
|
bind generic,pager,editor,index F noop
|
||||||
|
bind generic,pager,editor,index G noop
|
||||||
|
bind generic,pager,editor,index H noop
|
||||||
|
bind generic,pager,editor,index I noop
|
||||||
|
bind generic,pager,editor,index J noop
|
||||||
|
bind generic,pager,editor,index K noop
|
||||||
|
bind generic,pager,editor,index L noop
|
||||||
|
bind generic,pager,editor,index M noop
|
||||||
|
bind generic,pager,editor,index N noop
|
||||||
|
bind generic,pager,editor,index O noop
|
||||||
|
bind generic,pager,editor,index P noop
|
||||||
|
bind generic,pager,editor,index Q noop
|
||||||
|
bind generic,pager,editor,index R noop
|
||||||
|
bind generic,pager,editor,index S noop
|
||||||
|
bind generic,pager,editor,index T noop
|
||||||
|
bind generic,pager,editor,index U noop
|
||||||
|
bind generic,pager,editor,index V noop
|
||||||
|
bind generic,pager,editor,index W noop
|
||||||
|
bind generic,pager,editor,index X noop
|
||||||
|
bind generic,pager,editor,index Y noop
|
||||||
|
bind generic,pager,editor,index Z noop
|
||||||
|
|
||||||
|
bind generic,pager,editor,index <Tab> noop
|
||||||
|
bind generic,pager,editor,index <Space> noop
|
||||||
|
bind generic,pager,editor,index <PageUp> noop
|
||||||
|
bind generic,pager,editor,index <PageDown> noop
|
||||||
|
bind generic,pager,editor,index <Home> noop
|
||||||
|
bind generic,pager,editor,index <End> noop
|
||||||
|
bind generic,pager,editor,index <Insert> noop
|
||||||
|
bind generic,pager,editor,index <Delete> noop
|
||||||
|
bind generic,pager,editor,index <Up> noop
|
||||||
|
bind generic,pager,editor,index <Down> noop
|
||||||
|
bind generic,pager,editor,index <Left> noop
|
||||||
|
bind generic,pager,editor,index <Right> noop
|
||||||
|
bind generic,pager,editor,index <Enter> noop
|
||||||
|
bind generic,pager,editor,index <Return> noop
|
||||||
|
|
||||||
|
bind generic,pager,editor,index 1 noop
|
||||||
|
bind generic,pager,editor,index 2 noop
|
||||||
|
bind generic,pager,editor,index 3 noop
|
||||||
|
bind generic,pager,editor,index 4 noop
|
||||||
|
bind generic,pager,editor,index 5 noop
|
||||||
|
bind generic,pager,editor,index 6 noop
|
||||||
|
bind generic,pager,editor,index 7 noop
|
||||||
|
bind generic,pager,editor,index 8 noop
|
||||||
|
bind generic,pager,editor,index 9 noop
|
||||||
|
bind generic,pager,editor,index 0 noop
|
||||||
|
bind generic,pager,editor,index ! noop
|
||||||
|
bind generic,pager,editor,index @ noop
|
||||||
|
bind generic,pager,editor,index $ noop
|
||||||
|
bind generic,pager,editor,index % noop
|
||||||
|
bind generic,pager,editor,index ^ noop
|
||||||
|
bind generic,pager,editor,index & noop
|
||||||
|
bind generic,pager,editor,index * noop
|
||||||
|
bind generic,pager,editor,index ( noop
|
||||||
|
bind generic,pager,editor,index ) noop
|
||||||
|
|
||||||
|
bind generic,pager,editor,index \Ca noop
|
||||||
|
bind generic,pager,editor,index \Cb noop
|
||||||
|
bind generic,pager,editor,index \Cc noop
|
||||||
|
bind generic,pager,editor,index \Cd noop
|
||||||
|
bind generic,pager,editor,index \Ce noop
|
||||||
|
bind generic,pager,editor,index \Cf noop
|
||||||
|
bind generic,pager,editor,index \Cg noop
|
||||||
|
bind generic,pager,editor,index \Ch noop
|
||||||
|
bind generic,pager,editor,index \Ci noop
|
||||||
|
bind generic,pager,editor,index \Cj noop
|
||||||
|
bind generic,pager,editor,index \Ck noop
|
||||||
|
bind generic,pager,editor,index \Cl noop
|
||||||
|
bind generic,pager,editor,index \Cm noop
|
||||||
|
bind generic,pager,editor,index \Cn noop
|
||||||
|
bind generic,pager,editor,index \Co noop
|
||||||
|
bind generic,pager,editor,index \Cp noop
|
||||||
|
bind generic,pager,editor,index \Cq noop
|
||||||
|
bind generic,pager,editor,index \Cr noop
|
||||||
|
bind generic,pager,editor,index \Cs noop
|
||||||
|
bind generic,pager,editor,index \Ct noop
|
||||||
|
bind generic,pager,editor,index \Cu noop
|
||||||
|
bind generic,pager,editor,index \Cv noop
|
||||||
|
bind generic,pager,editor,index \Cw noop
|
||||||
|
bind generic,pager,editor,index \Cx noop
|
||||||
|
bind generic,pager,editor,index \Cy noop
|
||||||
|
bind generic,pager,editor,index \Cz noop
|
||||||
|
bind generic,pager,editor,index \CA noop
|
||||||
|
bind generic,pager,editor,index \CB noop
|
||||||
|
bind generic,pager,editor,index \CC noop
|
||||||
|
bind generic,pager,editor,index \CD noop
|
||||||
|
bind generic,pager,editor,index \CE noop
|
||||||
|
bind generic,pager,editor,index \CF noop
|
||||||
|
bind generic,pager,editor,index \CG noop
|
||||||
|
bind generic,pager,editor,index \CH noop
|
||||||
|
bind generic,pager,editor,index \CI noop
|
||||||
|
bind generic,pager,editor,index \CJ noop
|
||||||
|
bind generic,pager,editor,index \CK noop
|
||||||
|
bind generic,pager,editor,index \CL noop
|
||||||
|
bind generic,pager,editor,index \CM noop
|
||||||
|
bind generic,pager,editor,index \CN noop
|
||||||
|
bind generic,pager,editor,index \CO noop
|
||||||
|
bind generic,pager,editor,index \CP noop
|
||||||
|
bind generic,pager,editor,index \CQ noop
|
||||||
|
bind generic,pager,editor,index \CR noop
|
||||||
|
bind generic,pager,editor,index \CS noop
|
||||||
|
bind generic,pager,editor,index \CT noop
|
||||||
|
bind generic,pager,editor,index \CU noop
|
||||||
|
bind generic,pager,editor,index \CV noop
|
||||||
|
bind generic,pager,editor,index \CW noop
|
||||||
|
bind generic,pager,editor,index \CX noop
|
||||||
|
bind generic,pager,editor,index \CY noop
|
||||||
|
bind generic,pager,editor,index \CZ noop
|
||||||
|
|
||||||
|
bind generic,pager,editor,index \C<Tab> noop
|
||||||
|
bind generic,pager,editor,index \C<Space> noop
|
||||||
|
bind generic,pager,editor,index \C<PageUp> noop
|
||||||
|
bind generic,pager,editor,index \C<PageDown> noop
|
||||||
|
bind generic,pager,editor,index \C<Home> noop
|
||||||
|
bind generic,pager,editor,index \C<End> noop
|
||||||
|
bind generic,pager,editor,index \C<Insert> noop
|
||||||
|
bind generic,pager,editor,index \C<Delete> noop
|
||||||
|
bind generic,pager,editor,index \C<Up> noop
|
||||||
|
bind generic,pager,editor,index \C<Down> noop
|
||||||
|
bind generic,pager,editor,index \C<Left> noop
|
||||||
|
bind generic,pager,editor,index \C<Right> noop
|
||||||
|
bind generic,pager,editor,index \C<Enter> noop
|
||||||
|
bind generic,pager,editor,index \C<Return> noop
|
||||||
|
|
||||||
|
bind generic,pager,editor,index \C1 noop
|
||||||
|
bind generic,pager,editor,index \C2 noop
|
||||||
|
bind generic,pager,editor,index \C3 noop
|
||||||
|
bind generic,pager,editor,index \C4 noop
|
||||||
|
bind generic,pager,editor,index \C5 noop
|
||||||
|
bind generic,pager,editor,index \C6 noop
|
||||||
|
bind generic,pager,editor,index \C7 noop
|
||||||
|
bind generic,pager,editor,index \C8 noop
|
||||||
|
bind generic,pager,editor,index \C9 noop
|
||||||
|
bind generic,pager,editor,index \C0 noop
|
||||||
|
bind generic,pager,editor,index \C! noop
|
||||||
|
bind generic,pager,editor,index \C$ noop
|
||||||
|
bind generic,pager,editor,index \C% noop
|
||||||
|
bind generic,pager,editor,index \C^ noop
|
||||||
|
bind generic,pager,editor,index \C& noop
|
||||||
|
bind generic,pager,editor,index \C* noop
|
||||||
|
bind generic,pager,editor,index \C( noop
|
||||||
|
bind generic,pager,editor,index \C) noop
|
||||||
|
|
||||||
|
bind generic,pager,editor,index <Esc>a noop
|
||||||
|
bind generic,pager,editor,index <Esc>b noop
|
||||||
|
bind generic,pager,editor,index <Esc>c noop
|
||||||
|
bind generic,pager,editor,index <Esc>d noop
|
||||||
|
bind generic,pager,editor,index <Esc>e noop
|
||||||
|
bind generic,pager,editor,index <Esc>f noop
|
||||||
|
bind generic,pager,editor,index <Esc>g noop
|
||||||
|
bind generic,pager,editor,index <Esc>h noop
|
||||||
|
bind generic,pager,editor,index <Esc>i noop
|
||||||
|
bind generic,pager,editor,index <Esc>j noop
|
||||||
|
bind generic,pager,editor,index <Esc>k noop
|
||||||
|
bind generic,pager,editor,index <Esc>l noop
|
||||||
|
bind generic,pager,editor,index <Esc>m noop
|
||||||
|
bind generic,pager,editor,index <Esc>n noop
|
||||||
|
bind generic,pager,editor,index <Esc>o noop
|
||||||
|
bind generic,pager,editor,index <Esc>p noop
|
||||||
|
bind generic,pager,editor,index <Esc>q noop
|
||||||
|
bind generic,pager,editor,index <Esc>r noop
|
||||||
|
bind generic,pager,editor,index <Esc>s noop
|
||||||
|
bind generic,pager,editor,index <Esc>t noop
|
||||||
|
bind generic,pager,editor,index <Esc>u noop
|
||||||
|
bind generic,pager,editor,index <Esc>v noop
|
||||||
|
bind generic,pager,editor,index <Esc>w noop
|
||||||
|
bind generic,pager,editor,index <Esc>x noop
|
||||||
|
bind generic,pager,editor,index <Esc>y noop
|
||||||
|
bind generic,pager,editor,index <Esc>z noop
|
||||||
|
bind generic,pager,editor,index <Esc>A noop
|
||||||
|
bind generic,pager,editor,index <Esc>B noop
|
||||||
|
bind generic,pager,editor,index <Esc>C noop
|
||||||
|
bind generic,pager,editor,index <Esc>D noop
|
||||||
|
bind generic,pager,editor,index <Esc>E noop
|
||||||
|
bind generic,pager,editor,index <Esc>F noop
|
||||||
|
bind generic,pager,editor,index <Esc>G noop
|
||||||
|
bind generic,pager,editor,index <Esc>H noop
|
||||||
|
bind generic,pager,editor,index <Esc>I noop
|
||||||
|
bind generic,pager,editor,index <Esc>J noop
|
||||||
|
bind generic,pager,editor,index <Esc>K noop
|
||||||
|
bind generic,pager,editor,index <Esc>L noop
|
||||||
|
bind generic,pager,editor,index <Esc>M noop
|
||||||
|
bind generic,pager,editor,index <Esc>N noop
|
||||||
|
bind generic,pager,editor,index <Esc>O noop
|
||||||
|
bind generic,pager,editor,index <Esc>P noop
|
||||||
|
bind generic,pager,editor,index <Esc>Q noop
|
||||||
|
bind generic,pager,editor,index <Esc>R noop
|
||||||
|
bind generic,pager,editor,index <Esc>S noop
|
||||||
|
bind generic,pager,editor,index <Esc>T noop
|
||||||
|
bind generic,pager,editor,index <Esc>U noop
|
||||||
|
bind generic,pager,editor,index <Esc>V noop
|
||||||
|
bind generic,pager,editor,index <Esc>W noop
|
||||||
|
bind generic,pager,editor,index <Esc>X noop
|
||||||
|
bind generic,pager,editor,index <Esc>Y noop
|
||||||
|
bind generic,pager,editor,index <Esc>Z noop
|
||||||
|
|
||||||
|
bind generic,pager,editor,index <Esc><Tab> noop
|
||||||
|
bind generic,pager,editor,index <Esc><Space> noop
|
||||||
|
bind generic,pager,editor,index <Esc><PageUp> noop
|
||||||
|
bind generic,pager,editor,index <Esc><PageDown> noop
|
||||||
|
bind generic,pager,editor,index <Esc><Home> noop
|
||||||
|
bind generic,pager,editor,index <Esc><End> noop
|
||||||
|
bind generic,pager,editor,index <Esc><Insert> noop
|
||||||
|
bind generic,pager,editor,index <Esc><Delete> noop
|
||||||
|
bind generic,pager,editor,index <Esc><Up> noop
|
||||||
|
bind generic,pager,editor,index <Esc><Down> noop
|
||||||
|
bind generic,pager,editor,index <Esc><Left> noop
|
||||||
|
bind generic,pager,editor,index <Esc><Right> noop
|
||||||
|
bind generic,pager,editor,index <Esc><Enter> noop
|
||||||
|
bind generic,pager,editor,index <Esc><Return> noop
|
||||||
|
|
||||||
|
bind generic,pager,editor,index <Esc>1 noop
|
||||||
|
bind generic,pager,editor,index <Esc>2 noop
|
||||||
|
bind generic,pager,editor,index <Esc>3 noop
|
||||||
|
bind generic,pager,editor,index <Esc>4 noop
|
||||||
|
bind generic,pager,editor,index <Esc>5 noop
|
||||||
|
bind generic,pager,editor,index <Esc>6 noop
|
||||||
|
bind generic,pager,editor,index <Esc>7 noop
|
||||||
|
bind generic,pager,editor,index <Esc>8 noop
|
||||||
|
bind generic,pager,editor,index <Esc>9 noop
|
||||||
|
bind generic,pager,editor,index <Esc>0 noop
|
||||||
|
bind generic,pager,editor,index <Esc>! noop
|
||||||
|
bind generic,pager,editor,index <Esc>@ noop
|
||||||
|
bind generic,pager,editor,index <Esc>$ noop
|
||||||
|
bind generic,pager,editor,index <Esc>% noop
|
||||||
|
bind generic,pager,editor,index <Esc>^ noop
|
||||||
|
bind generic,pager,editor,index <Esc>& noop
|
||||||
|
bind generic,pager,editor,index <Esc>* noop
|
||||||
|
bind generic,pager,editor,index <Esc>( noop
|
||||||
|
bind generic,pager,editor,index <Esc>) noop
|
||||||
|
|
||||||
|
bind generic,pager,editor,index ^T noop
|
||||||
|
|
||||||
|
# Movement
|
||||||
|
bind generic,index 0 first-entry
|
||||||
|
bind generic,index g first-entry
|
||||||
|
bind generic,index G last-entry
|
||||||
|
# Right
|
||||||
|
bind generic <Return> select-entry
|
||||||
|
bind generic l select-entry
|
||||||
|
bind generic <Right> select-entry
|
||||||
|
bind index <Return> display-message
|
||||||
|
bind index l display-message
|
||||||
|
bind index <Right> display-message
|
||||||
|
bind pager l view-attachments
|
||||||
|
bind pager <Right> view-attachments
|
||||||
|
bind attach l view-text
|
||||||
|
bind attach <Right> view-text
|
||||||
|
# Left
|
||||||
|
macro index h "c?\t" "Go back to the list of mailboxes"
|
||||||
|
macro index <Left> "c?\t" "Go back to the list of mailboxes"
|
||||||
|
bind attach h exit
|
||||||
|
bind attach <Left> exit
|
||||||
|
bind pager h exit
|
||||||
|
bind pager <Left> exit
|
||||||
|
# Up
|
||||||
|
bind generic,index,pager <PageUp> previous-page
|
||||||
|
bind generic,index k previous-entry
|
||||||
|
bind generic,index <Up> previous-entry
|
||||||
|
bind pager k previous-line
|
||||||
|
bind pager <Up> previous-line
|
||||||
|
# Down
|
||||||
|
bind generic,index,pager <PageDown> next-page
|
||||||
|
bind generic,index j next-entry
|
||||||
|
bind generic,index <Down> next-entry
|
||||||
|
bind index n search-next
|
||||||
|
bind pager j next-line
|
||||||
|
bind pager <Down> next-line
|
||||||
|
bind pager N search-opposite
|
||||||
|
bind pager n next-entry
|
||||||
|
|
||||||
|
# Exit/Quit (quit will prompt)
|
||||||
|
bind generic,index,pager,index Q exit
|
||||||
|
bind generic,index,pager,index q quit
|
||||||
|
|
||||||
|
# Reload configuration
|
||||||
|
macro generic,index,pager,editor ,<Space> ":source ~/.mutt/muttrc\n" "Reload mutt's configuration file"
|
||||||
|
|
||||||
|
# Tab complete
|
||||||
|
bind editor <Tab> complete-query
|
||||||
|
bind editor ^T complete
|
||||||
|
|
||||||
|
# Writing mail
|
||||||
|
bind index,pager m mail
|
||||||
|
bind index,pager r reply
|
||||||
|
bind index,pager b bounce-message
|
||||||
|
bind index,pager f forward-message
|
||||||
|
|
||||||
|
# Archive
|
||||||
|
macro index,pager d "<save-message>=Archive<enter><enter>" "Archive"
|
||||||
|
macro index,pager y "<save-message>=Archive<enter><enter>" "Archive"
|
||||||
|
|
||||||
|
# Misc
|
||||||
|
bind generic,index,pager / search
|
||||||
|
bind generic,index,pager : enter-command
|
||||||
|
bind index,pager @ display-address
|
||||||
|
bind index,pager a create-alias
|
||||||
|
bind index,pager o sort-mailbox
|
||||||
|
bind index,pager s save-message
|
||||||
|
bind index,pager | pipe-message
|
||||||
|
bind index,pager $ sync-mailbox
|
||||||
|
macro index,pager <f5> "<sync-mailbox><enter><shell-escape>mbsync -a<enter>" "Show Mutt documentation"
|
||||||
|
bind index ? limit
|
||||||
|
bind index p print-message
|
||||||
|
bind index u undelete-message
|
||||||
|
bind index x toggle-read
|
||||||
|
bind index c change-folder
|
||||||
|
bind pager H display-toggle-weed
|
||||||
|
|
||||||
|
# Staging
|
||||||
|
#
|
||||||
|
# TODO: Might be used to do an mbsync
|
||||||
|
# bind index,pager R list-reply
|
||||||
|
#
|
||||||
|
# bind pager p print-message
|
||||||
|
#
|
||||||
|
# Setting/clearing flags
|
||||||
|
# bind index W clear-flag
|
||||||
|
# bind index w set-flag
|
||||||
|
# macro index ! wN "Mark email as unread"
|
||||||
|
# bind index P previous-new-then-unread
|
||||||
|
# bind index N next-new-then-unread
|
||||||
|
# macro index r WN<up>n "Mark as read, then go to next"
|
||||||
|
# bind index t read-thread
|
||||||
|
# macro index T tn
|
||||||
|
#
|
||||||
|
# bind browser <Space> check-new
|
||||||
|
# bind browser N select-new
|
||||||
|
# bind index <Esc>r group-reply # Control-r, \Cr
|
||||||
|
# vim: set ft=neomuttrc
|
136
scripts/sync.sh
136
scripts/sync.sh
@ -1,136 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
ABSPATH="$(\pushd >/dev/null "$(\dirname "$0")/..";\pwd;\popd >/dev/null)"
|
|
||||||
SYNC_CONFIG=0
|
|
||||||
SHOW_HELP=0
|
|
||||||
SYNC_CUSTOM=0
|
|
||||||
SYNC_VIM=0
|
|
||||||
VALID_CMD=0
|
|
||||||
RECLONE=0
|
|
||||||
YCM=0
|
|
||||||
TMP_PATH="/tmp/$(uuidgen)"
|
|
||||||
mkdir -p "$TMP_PATH"
|
|
||||||
sync_config() {
|
|
||||||
# Remove old config files
|
|
||||||
remove ~/.gitconfig ~/.bashrc ~/.pylintrc ~/.zsh ~/.zshrc ~/.tmux.conf ~/.config/liquidpromptrc ~/.config/dunstrc
|
|
||||||
# Silently remove vimperator files since we are not reinstalling
|
|
||||||
remove -s ~/.vimperatorrc ~/.vimperator/colors/vimPgray.vimp
|
|
||||||
if [[ $RECLONE = 1 ]]; then
|
|
||||||
remove ~/.fzf ~/.zsh-git
|
|
||||||
fi
|
|
||||||
# Install on all systems
|
|
||||||
# Vimperator has perished. Don't install vimperator files anymore
|
|
||||||
#ln -s "$ABSPATH/vimperator/vimperatorrc" ~/.vimperatorrc
|
|
||||||
#mkdir -p ~/.vimperator/colors
|
|
||||||
#ln -s "$ABSPATH/vimperator/vimPgray.vimp" ~/.vimperator/colors/vimPgray.vimp
|
|
||||||
if command -v git 2>&1 >/dev/null; then
|
|
||||||
if command -v zsh 2>&1 >/dev/null; then
|
|
||||||
for i in lpr oh-my-git-themes omg zsh-syntax-highlighting; do
|
|
||||||
if [ ! -d ~/.zsh-git/"$i" ]; then
|
|
||||||
git clone "https://gitea.austenwares.com/stonewareslord/$i.git" ~/.zsh-git/"$i"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
if [ ! -d ~/.fzf ] ; then
|
|
||||||
git clone "https://gitea.austenwares.com/stonewareslord/fzf.git" ~/.fzf
|
|
||||||
~/.fzf/install --bin
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "No git! Not installing fzf or zsh packages"
|
|
||||||
fi
|
|
||||||
mkdir -p ~/.config
|
|
||||||
ln -s "$ABSPATH/dunst/dunstrc" ~/.config/dunstrc
|
|
||||||
ln -s "$ABSPATH/tmux/tmux.conf" ~/.tmux.conf
|
|
||||||
ln -s "$ABSPATH/python/pylintrc" ~/.pylintrc
|
|
||||||
ln -s "$ABSPATH/git/gitconfig" ~/.gitconfig
|
|
||||||
ln -s "$ABSPATH/shells/bashrc" ~/.bashrc
|
|
||||||
ln -s "$ABSPATH/shells/zshrc" ~/.zshrc
|
|
||||||
ln -s "$ABSPATH/zsh" ~/.zsh
|
|
||||||
ln -s "$ABSPATH/shells/liquidpromptrc" ~/.config/liquidpromptrc
|
|
||||||
if [ "$(uname)" != "Darwin" ]; then
|
|
||||||
# Don't install these on Mac
|
|
||||||
remove ~/.i3/{config,i3status.conf,run.sh} ~/.Xmodmap ~/.xsession ~/.config/synapse/gtkrc ~/.Xresources
|
|
||||||
mkdir -p ~/.i3 ~/.config/synapse
|
|
||||||
ln -s "$ABSPATH/i3/config" ~/.i3/config
|
|
||||||
ln -s "$ABSPATH/i3/$(hostname)-status.conf" ~/.i3/i3status.conf 2>/dev/null
|
|
||||||
ln -s "$ABSPATH/i3/run.sh" ~/.i3/run.sh
|
|
||||||
ln -s "$ABSPATH/i3/Xmodmap" ~/.Xmodmap
|
|
||||||
ln -s "$ABSPATH/i3/xsession" ~/.xsession
|
|
||||||
ln -s "$ABSPATH/i3/gtkrc" ~/.config/synapse/gtkrc
|
|
||||||
ln -s "$ABSPATH/shells/Xresources" ~/.Xresources
|
|
||||||
if command -v xrdb 2>&1 >/dev/null; then
|
|
||||||
xrdb ~/.Xresources
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
sync_custom() {
|
|
||||||
if ! command -v git 2>&1 >/dev/null; then
|
|
||||||
echo "Error! No git -- can't sync custom files"
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
if [[ ! -d ~/.zsh-git/custom-config ]]; then
|
|
||||||
#TODO: Figure out if I should use ssh or https cloning
|
|
||||||
#git clone https://gitea.austenwares.com/stonewareslord/custom-config
|
|
||||||
git clone git@austenwares.com:stonewareslord/custom-config ~/.zsh-git/custom-config
|
|
||||||
fi
|
|
||||||
remove ~/.gitconfig
|
|
||||||
ln -s ~/.zsh-git/custom-config/gitconfig ~/.gitconfig
|
|
||||||
# Custom zsh is sourced from zshrc
|
|
||||||
}
|
|
||||||
sync_vim() {
|
|
||||||
remove ~/.vimrc
|
|
||||||
ln -s "$ABSPATH/vim/vimrc" ~/.vimrc
|
|
||||||
vim +"silent! call Initialize()" +q
|
|
||||||
}
|
|
||||||
show_help() {
|
|
||||||
echo "sync.sh syncs configuration files and Vim plugins on computers"
|
|
||||||
echo " -h Shows this help"
|
|
||||||
echo " -b Syncs Vim bundles"
|
|
||||||
echo " -s Use this if you want custom stonewareslord settings"
|
|
||||||
echo " -c Sync configuration files"
|
|
||||||
echo " -r Reclone all git repositories"
|
|
||||||
echo " -y Run youcompleteme.sh"
|
|
||||||
exit
|
|
||||||
}
|
|
||||||
run_ycm() {
|
|
||||||
"$ABSPATH/applications/youcompleteme.sh"
|
|
||||||
}
|
|
||||||
remove() {
|
|
||||||
local SILENT=0
|
|
||||||
if [[ "$1" = "-s" ]]; then
|
|
||||||
# Be quiet!
|
|
||||||
SILENT=1
|
|
||||||
shift
|
|
||||||
fi
|
|
||||||
if [[ $SILENT = 1 ]]; then
|
|
||||||
\mv -t "$TMP_PATH" $* 2>/dev/null
|
|
||||||
else
|
|
||||||
\mv -t "$TMP_PATH" $*
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
while getopts ":shbcyr" OPT "$@"; do
|
|
||||||
case $OPT in
|
|
||||||
b) SYNC_VIM=1;VALID_CMD=1;;
|
|
||||||
s) SYNC_CUSTOM=1;;
|
|
||||||
c) SYNC_CONFIG=1;VALID_CMD=1;;
|
|
||||||
r) RECLONE=1;;
|
|
||||||
y) YCM=1;VALID_CMD=1;;
|
|
||||||
*) echo "Invalid option: $OPT";SHOW_HELP=1;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
if [[ $SHOW_HELP = 1 ]] || [[ ! $VALID_CMD = 1 ]]; then
|
|
||||||
show_help
|
|
||||||
fi
|
|
||||||
echo "Syncing config files. Placing old files in $TMP_PATH"
|
|
||||||
if [[ $SYNC_CONFIG = 1 ]]; then
|
|
||||||
sync_config
|
|
||||||
if [[ $SYNC_CUSTOM = 1 ]]; then
|
|
||||||
sync_custom
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
if [[ $SYNC_VIM = 1 ]]; then
|
|
||||||
sync_vim
|
|
||||||
fi
|
|
||||||
if [[ $YCM = 1 ]]; then
|
|
||||||
run_ycm
|
|
||||||
fi
|
|
||||||
echo "Done syncing"
|
|
@ -1,9 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
for DIR in *; do
|
|
||||||
#[ -d "$DIR" ] && "cd "$DIR" ; pwd"
|
|
||||||
if [ -d "$DIR" ] ; then
|
|
||||||
cd "$DIR"
|
|
||||||
git up
|
|
||||||
cd ..
|
|
||||||
fi
|
|
||||||
done
|
|
@ -1,67 +0,0 @@
|
|||||||
#3 good monitors
|
|
||||||
timeout 1s pdsh -R ssh -w 10.0.1.196,10.0.1.207,10.0.1.33 "killall x11vnc"
|
|
||||||
killall x11vnc
|
|
||||||
xrandr --output VIRTUAL1 --off --output VIRTUAL2 --off --output VIRTUAL3 --off
|
|
||||||
xrandr --newmode "1280x800_60.00" 83.50 1280 1352 1480 1680 800 803 809 831 -hsync +vsync
|
|
||||||
xrandr --newmode "904x1600_60.00" 121.50 904 968 1064 1224 1600 1603 1613 1658 -hsync +vsync
|
|
||||||
xrandr --addmode VIRTUAL1 1280x800_60.00
|
|
||||||
xrandr --addmode VIRTUAL2 1280x800_60.00
|
|
||||||
xrandr --addmode VIRTUAL3 904x1600_60.00
|
|
||||||
xrandr --output VIRTUAL2 --mode 1280x800_60.00 --above HDMI1
|
|
||||||
xrandr --output VIRTUAL3 --mode 904x1600_60.00
|
|
||||||
xrandr --output VIRTUAL1 --mode 1280x800_60.00 --above HDMI3
|
|
||||||
x11vnc -clip 1280x800+640+0 -xrandr -forever -viewonly -allow 10.0.1.207 > /dev/null 2>&1 &
|
|
||||||
x11vnc -clip 1280x800+1920+0 -xrandr -forever -viewonly -allow 10.0.1.196 > /dev/null 2>&1 &
|
|
||||||
timeout 1s pdsh -R ssh -w 10.0.1.196,10.0.1.207 ./s
|
|
||||||
x11vnc -clip 900x1600+3840+280 -xrandr -forever -viewonly > /dev/null 2>&1 &
|
|
||||||
timeout 1s ssh 10.0.1.33 "export DISPLAY=:0.0&&xtightvncviewer 10.0.1.201:2 -fullscreen > /dev/null 2>&1 &"
|
|
||||||
xrandr --output VIRTUAL3 --pos 3840x280
|
|
||||||
xrandr --output VIRTUAL1 --pos 640x0
|
|
||||||
|
|
||||||
#3 monitors
|
|
||||||
x11vnc -clip 1280x800+640+0 -xrandr -forever
|
|
||||||
x11vnc -clip 1280x800+1920+0 -xrandr -forever
|
|
||||||
x11vnc -clip 1366x768+3840+800 -xrandr -forever
|
|
||||||
|
|
||||||
xrandr --newmode "1280x800_60.00" 83.50 1280 1352 1480 1680 800 803 809 831 -hsync +vsync
|
|
||||||
xrandr --newmode "1368x768_60.00" 85.25 1368 1440 1576 1784 768 771 781 798 -hsync +vsync
|
|
||||||
|
|
||||||
xrandr --addmode VIRTUAL1 1280x800_60.00
|
|
||||||
xrandr --addmode VIRTUAL2 1280x800_60.00
|
|
||||||
xrandr --addmode VIRTUAL3 1368x768_60.00
|
|
||||||
|
|
||||||
xrandr --output VIRTUAL1 --mode 1280x800_60.00 --above HDMI3
|
|
||||||
xrandr --output VIRTUAL3 --mode 1368x768_60.00 --right-of HDMI1
|
|
||||||
xrandr --output VIRTUAL2 --mode 1280x800_60.00 --above HDMI1
|
|
||||||
xrandr --output VIRTUAL1 --pos 640x0
|
|
||||||
xrandr --output VIRTUAL3 --pos 3840x800
|
|
||||||
|
|
||||||
export DISPLAY=:0.0&&xtightvncviewer 10.0.1.201:0 -fullscreen
|
|
||||||
while true; do xset dpms force on;sleep 601;done
|
|
||||||
xset dpms 0 0 0
|
|
||||||
|
|
||||||
xrandr --output VIRTUAL1 --off
|
|
||||||
xrandr --output VIRTUAL2 --off
|
|
||||||
xrandr --output VIRTUAL3 --off
|
|
||||||
|
|
||||||
|
|
||||||
#2 monitors
|
|
||||||
x11vnc -clip 1280x800+640+0 -xrandr -forever -viewonly -allow 10.0.1.207 nifyd
|
|
||||||
x11vnc -clip 1280x800+1920+0 -xrandr -forever -viewonly -allow 10.0.1.196 nifyd
|
|
||||||
|
|
||||||
smon ./s
|
|
||||||
|
|
||||||
xrandr --newmode "1280x800_60.00" 83.50 1280 1352 1480 1680 800 803 809 831 -hsync +vsync
|
|
||||||
|
|
||||||
xrandr --addmode VIRTUAL1 1280x800_60.00
|
|
||||||
xrandr --addmode VIRTUAL2 1280x800_60.00
|
|
||||||
|
|
||||||
xrandr --output VIRTUAL1 --mode 1280x800_60.00 --above HDMI3
|
|
||||||
xrandr --output VIRTUAL2 --mode 1280x800_60.00 --above HDMI1
|
|
||||||
xrandr --output VIRTUAL1 --pos 640x0
|
|
||||||
|
|
||||||
export DISPLAY=:0.0&&xtightvncviewer 10.0.1.201:0 -fullscreen
|
|
||||||
while true; do xset dpms force on;sleep 601;done
|
|
||||||
xset dpms 0 0 0
|
|
||||||
|
|
||||||
xrandr --output VIRTUAL1 --off;xrandr --output VIRTUAL2 --off;xrandr --output VIRTUAL3 --off
|
|
1
shell/.bash_profile
Normal file
1
shell/.bash_profile
Normal file
@ -0,0 +1 @@
|
|||||||
|
[[ -e "${HOME}/.bashrc" ]] && source "${HOME}/.bashrc"
|
19
shell/.bashrc
Normal file
19
shell/.bashrc
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
export PATH="${HOME}/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
|
||||||
|
[[ -d "${HOME}/go/bin" ]] && export PATH="${HOME}/go/bin:${PATH}"
|
||||||
|
[[ -d "${HOME}/.cargo/bin" ]] && export PATH="${HOME}/.cargo/bin:${PATH}"
|
||||||
|
#prompt_cmd() {
|
||||||
|
# PS1="$(~/git/cesium/cesium --mode ps1 --rc "$?" --shell bash)"
|
||||||
|
# unset CESIUM_LAST_COMMAND_TIME
|
||||||
|
#}
|
||||||
|
#trap 'export CESIUM_LAST_COMMAND_TIME="$(date +%s)"' DEBUG
|
||||||
|
#PROMPT_COMMAND=prompt_cmd
|
||||||
|
|
||||||
|
export EDITOR=kak
|
||||||
|
|
||||||
|
[[ -f ~/.fzf.bash ]] && source ~/.fzf.bash
|
||||||
|
command -v fasd >/dev/null && eval "$(fasd --init auto)"
|
||||||
|
|
||||||
|
HISTSIZE=
|
||||||
|
HISTFILESIZE=
|
||||||
|
|
||||||
|
alias v="fasd -fe kak"
|
@ -86,23 +86,23 @@ LP_ENABLE_VCS_ROOT=0
|
|||||||
|
|
||||||
# Do you want to use the Git special features?
|
# Do you want to use the Git special features?
|
||||||
# Recommended value is 1
|
# Recommended value is 1
|
||||||
LP_ENABLE_GIT=0
|
LP_ENABLE_GIT=1
|
||||||
|
|
||||||
# Do you want to use the Subversion special features?
|
# Do you want to use the Subversion special features?
|
||||||
# Recommended value is 1
|
# Recommended value is 1
|
||||||
LP_ENABLE_SVN=1
|
LP_ENABLE_SVN=0
|
||||||
|
|
||||||
# Do you want to use the Mercurial special features?
|
# Do you want to use the Mercurial special features?
|
||||||
# Recommended value is 1
|
# Recommended value is 1
|
||||||
LP_ENABLE_HG=1
|
LP_ENABLE_HG=0
|
||||||
|
|
||||||
# Do you want to use the Fossil special features?
|
# Do you want to use the Fossil special features?
|
||||||
# Recommended value is 1
|
# Recommended value is 1
|
||||||
LP_ENABLE_FOSSIL=1
|
LP_ENABLE_FOSSIL=0
|
||||||
|
|
||||||
# Do you want to use the Bazaar special features?
|
# Do you want to use the Bazaar special features?
|
||||||
# Recommanded value is 1
|
# Recommanded value is 1
|
||||||
LP_ENABLE_BZR=1
|
LP_ENABLE_BZR=0
|
||||||
|
|
||||||
# Show time of the last prompt display
|
# Show time of the last prompt display
|
||||||
# Recommended value is 0
|
# Recommended value is 0
|
||||||
@ -152,16 +152,11 @@ LP_ENABLE_SSH_COLORS=1
|
|||||||
# will be disabled
|
# will be disabled
|
||||||
LP_DISABLED_VCS_PATH=""
|
LP_DISABLED_VCS_PATH=""
|
||||||
|
|
||||||
# Enable Oh My Git!
|
|
||||||
LP_ENABLE_OHMYGIT=1
|
|
||||||
|
|
||||||
# Marks
|
# Marks
|
||||||
LP_MARK_BATTERY="B"
|
LP_MARK_BATTERY="B"
|
||||||
LP_MARK_ADAPTER="A"
|
LP_MARK_ADAPTER="A"
|
||||||
LP_MARK_LOAD="L"
|
LP_MARK_LOAD="L"
|
||||||
LP_MARK_TEMP="T"
|
LP_MARK_TEMP="T"
|
||||||
|
LP_MARK_GIT="$LP_MARK_DEFAULT"
|
||||||
|
|
||||||
# vim: set et sts=4 sw=4 tw=120 ft=sh:
|
# vim: set et sts=4 sw=4 tw=120 ft=sh:
|
||||||
|
|
||||||
|
|
||||||
# vim: ft=sh:
|
|
@ -1,15 +1,15 @@
|
|||||||
b-list() {
|
b-list() {
|
||||||
if [[ -z "$1" ]]; then
|
if [[ -z "$1" ]]; then
|
||||||
column -t <(borg list "$BORG_REPO")
|
column -t <(borg list "::")
|
||||||
else
|
else
|
||||||
borg list "$BORG_REPO::$1"
|
borg list "::$1"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
b-delete() {
|
b-delete() {
|
||||||
while (( $# > 0 )); do
|
while (( $# > 0 )); do
|
||||||
if [[ ! -z "$1" ]]; then
|
if [[ ! -z "$1" ]]; then
|
||||||
echo "Deleting... $1"
|
echo "Deleting... $1"
|
||||||
borg delete "$BORG_REPO::$1"
|
borg delete "::$1"
|
||||||
fi
|
fi
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
@ -24,16 +24,16 @@ b-create() {
|
|||||||
if [[ -f "/home/stonewareslord/syncthing/me/backup/$(hostname)/mount" ]]; then
|
if [[ -f "/home/stonewareslord/syncthing/me/backup/$(hostname)/mount" ]]; then
|
||||||
"$SUDO" "/home/stonewareslord/syncthing/me/backup/$(hostname)/mount"
|
"$SUDO" "/home/stonewareslord/syncthing/me/backup/$(hostname)/mount"
|
||||||
fi
|
fi
|
||||||
"$SUDO" borg create -vpsx --exclude-caches --compression lzma,7 --exclude-from "$IGNORE_FILE" $BORG_REPO::$(hostname)-$(uuidgen) / /boot /home
|
"$SUDO" borg create -vpsx --exclude-caches --compression lzma,7 --exclude-from "$IGNORE_FILE" "::$(hostname)-$(uuidgen)" / /boot /home
|
||||||
}
|
}
|
||||||
b-rename() {
|
b-rename() {
|
||||||
borg rename -v "$BORG_REPO::$1" "$2"
|
borg rename -v "::$1" "$2"
|
||||||
}
|
}
|
||||||
b-info() {
|
b-info() {
|
||||||
borg info "$BORG_REPO::$1"
|
borg info "::$1"
|
||||||
}
|
}
|
||||||
b-diff() {
|
b-diff() {
|
||||||
borg list "$BORG_REPO"
|
borg list "::"
|
||||||
echo -n "First ID: "
|
echo -n "First ID: "
|
||||||
read ID1
|
read ID1
|
||||||
echo -n "Second ID: "
|
echo -n "Second ID: "
|
||||||
@ -60,8 +60,8 @@ b-diff() {
|
|||||||
echo "FILE_SIZE_LIST2: $FILE_SIZE_LIST2"
|
echo "FILE_SIZE_LIST2: $FILE_SIZE_LIST2"
|
||||||
echo "COMPLETED_FILE1: $COMPLETED_FILE1"
|
echo "COMPLETED_FILE1: $COMPLETED_FILE1"
|
||||||
echo "COMPLETED_FILE2: $COMPLETED_FILE2"
|
echo "COMPLETED_FILE2: $COMPLETED_FILE2"
|
||||||
borg list --short "$BORG_REPO::$ID1" | pv -N "Getting List 1" > "$FILE_LIST1"
|
borg list --short "::$ID1" | pv -N "Getting List 1" > "$FILE_LIST1"
|
||||||
borg list --short "$BORG_REPO::$ID2" | pv -N "Getting List 2" > "$FILE_LIST2"
|
borg list --short "::$ID2" | pv -N "Getting List 2" > "$FILE_LIST2"
|
||||||
# Find differences and calculate them
|
# Find differences and calculate them
|
||||||
diff <(pv -cN "List 1 Diff" "$FILE_LIST1") <(pv -cN "List 1 Diff" "$FILE_LIST2") > >(ag '^<' | perl -pe 's/^< //' > "$A_DIFFS") > >(ag '^>' | perl -pe 's/^> //' > "$B_DIFFS")
|
diff <(pv -cN "List 1 Diff" "$FILE_LIST1") <(pv -cN "List 1 Diff" "$FILE_LIST2") > >(ag '^<' | perl -pe 's/^< //' > "$A_DIFFS") > >(ag '^>' | perl -pe 's/^> //' > "$B_DIFFS")
|
||||||
# Truncate everything
|
# Truncate everything
|
||||||
@ -88,7 +88,7 @@ b-diff() {
|
|||||||
echo "$COMPLETED_FILE2"
|
echo "$COMPLETED_FILE2"
|
||||||
}
|
}
|
||||||
b-size() {
|
b-size() {
|
||||||
borg list "$BORG_REPO"
|
borg list "::"
|
||||||
echo -n "ID: "
|
echo -n "ID: "
|
||||||
read ID
|
read ID
|
||||||
if [ -z "$ID" ]; then
|
if [ -z "$ID" ]; then
|
||||||
@ -101,7 +101,7 @@ b-size() {
|
|||||||
echo "FILE_LIST: $FILE_LIST"
|
echo "FILE_LIST: $FILE_LIST"
|
||||||
echo "FILE_SIZE_LIST: $FILE_SIZE_LIST"
|
echo "FILE_SIZE_LIST: $FILE_SIZE_LIST"
|
||||||
echo "COMPLETED_FILE: $COMPLETED_FILE"
|
echo "COMPLETED_FILE: $COMPLETED_FILE"
|
||||||
borg list --short "$BORG_REPO::$ID" | pv -N "Getting List" > "$FILE_LIST"
|
borg list --short "::$ID" | pv -N "Getting List" > "$FILE_LIST"
|
||||||
while read i
|
while read i
|
||||||
do
|
do
|
||||||
test -f /"$i" && du -sh /"$i" 2>/dev/null >> "$FILE_SIZE_LIST"
|
test -f /"$i" && du -sh /"$i" 2>/dev/null >> "$FILE_SIZE_LIST"
|
||||||
@ -114,8 +114,8 @@ b-size() {
|
|||||||
b-extract() {
|
b-extract() {
|
||||||
local BACKUP="$1"
|
local BACKUP="$1"
|
||||||
shift
|
shift
|
||||||
borg extract "$BORG_REPO::$BACKUP" $*
|
borg extract "::$BACKUP" $*
|
||||||
}
|
}
|
||||||
b-cmd() {
|
b-cmd() {
|
||||||
echo "$BORG_REPO" $*
|
echo "::" $*
|
||||||
}
|
}
|
364
shell/.zshrc
Normal file
364
shell/.zshrc
Normal file
@ -0,0 +1,364 @@
|
|||||||
|
#zmodload zsh/zprof
|
||||||
|
echo -ne '[ ]\r'
|
||||||
|
for i in ~/.zsh/*.zsh; do
|
||||||
|
source "$i"
|
||||||
|
done
|
||||||
|
autoload -U compinit
|
||||||
|
compinit
|
||||||
|
setopt always_to_end # When completing from the middle of a word, move the cursor to the end of the word
|
||||||
|
setopt complete_in_word # Allow completion from within a word/phrase
|
||||||
|
setopt INTERACTIVECOMMENTS
|
||||||
|
setopt EXTENDED_GLOB
|
||||||
|
setopt HIST_EXPIRE_DUPS_FIRST
|
||||||
|
setopt APPEND_HISTORY EXTENDED_HISTORY SHARE_HISTORY HISTIGNOREALLDUPS
|
||||||
|
export HIST_STAMPS="dd.mm.yyyy"
|
||||||
|
export HISTSIZE=12000
|
||||||
|
export SAVEHIST=10000000
|
||||||
|
export HISTFILE="$HOME/.zsh_history"
|
||||||
|
export EDITOR="vim"
|
||||||
|
export FZF_COMPLETION_OPTS='--no-mouse -m -1 -x'
|
||||||
|
zstyle ':completion:*' use-cache on
|
||||||
|
zstyle ':completion:*' cache-path ~/.cache/zsh
|
||||||
|
# Check if a command exists
|
||||||
|
ex() {
|
||||||
|
command -v "$1" >/dev/null
|
||||||
|
return $?
|
||||||
|
}
|
||||||
|
if ex firefox; then
|
||||||
|
export BROWSER="firefox"
|
||||||
|
elif ex firefox-bin; then
|
||||||
|
export BROWSER="firefox-bin"
|
||||||
|
else
|
||||||
|
export BROWSER="xdg-open"
|
||||||
|
fi
|
||||||
|
# For pasting in commands that start with $
|
||||||
|
$ () {
|
||||||
|
"$@"
|
||||||
|
}
|
||||||
|
# Run gui application as root by copying xauth credentials
|
||||||
|
asroot() {
|
||||||
|
# Use temporary file for added security
|
||||||
|
TEMPFILE="$(tempfile)"
|
||||||
|
xauth extract "$TEMPFILE" "$DISPLAY"
|
||||||
|
sudo zsh -c "xauth merge $TEMPFILE;(srm $TEMPFILE||rm $TEMPFILE)&$@;"
|
||||||
|
}
|
||||||
|
# De-symlink
|
||||||
|
dsl() {
|
||||||
|
while (( $# > 0 )); do
|
||||||
|
readlink "$1" 2>&1 >/dev/null && mv "$(readlink "$1")" "$1"
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
}
|
||||||
|
# Remove directory by removing subdirectories up a level
|
||||||
|
dedir() {
|
||||||
|
# Try removing the directory if it's empty, fail silently if you can't
|
||||||
|
rmdir "$1" 2>/dev/null && return
|
||||||
|
# Avoid name conflicts
|
||||||
|
# Ex: dediring sage when sage/sage fails because sage/sage is moved to .
|
||||||
|
# but since sage/ exists, it can't be moved
|
||||||
|
local TMP_DIR="$(mktemp -d --tmpdir=.)"
|
||||||
|
mv -n "$1" "$TMP_DIR" || return 1
|
||||||
|
# Move all files, use (N) in case there is no * or .* matches
|
||||||
|
mv -n "$TMP_DIR/$1"/{.,}*(N) . || return 2
|
||||||
|
rmdir "$TMP_DIR" || return 3
|
||||||
|
}
|
||||||
|
# Run multitail on logs
|
||||||
|
mt() {
|
||||||
|
if [[ -z "$1" ]]; then
|
||||||
|
echo "Opts:\nm xe gitea dm syncthing g" >&2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
case $1 in
|
||||||
|
m) sudo multitail /var/log/messages;;
|
||||||
|
xe) multitail ~/.xsession-errors;;
|
||||||
|
ef) sudo multitail /var/log/emerge-fetch.log;;
|
||||||
|
gitea) sudo multitail /var/log/gitea.{err,log};;
|
||||||
|
dm) dmesg -w;;
|
||||||
|
syncthing) sudo multitail /var/log/syncthing.{err,log};;
|
||||||
|
g) sudo watch -c genlop -tc;;
|
||||||
|
sync) watch grep -e Dirty: -e Writeback: /proc/meminfo;;
|
||||||
|
*) multitail "$@"
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
run() {
|
||||||
|
test -f "${1:r}" && rm "${1:r}"
|
||||||
|
echo "Building..." >&2
|
||||||
|
gcc -Wall -g -std=c99 "${1:r}.c" -o "${1:r}" && (echo "Running..." >&2;./"${1:r}")
|
||||||
|
}
|
||||||
|
ex todotxt && alias t='todotxt'
|
||||||
|
ex todo-txt && alias t='todo-txt'
|
||||||
|
alias ta='t a'
|
||||||
|
ex vim && alias vi='vim'
|
||||||
|
ex rc-service && alias service='rc-service'
|
||||||
|
ex ip && alias ip='ip -c'
|
||||||
|
ex adb && alias apush="adb push -p"
|
||||||
|
ex adb && alias apull="adb pull -p"
|
||||||
|
ex mtr && alias mtr='mtr -t'
|
||||||
|
ex telegram-cli && alias tg='telegram-cli -NWA --disable-link-preview'
|
||||||
|
ex eix && alias eix="eix -F"
|
||||||
|
ex tmux && alias tmux='tmux -2'
|
||||||
|
ex tree && alias tree='tree -C'
|
||||||
|
ex ocp && alias ocp="ocp -vs0 -dcurses"
|
||||||
|
alias jupyter='docker run --rm --user="$(id -u):$(id -g)" -v "$PWD":/home/jovyan/work -p 8888:8888 ymatsunaga/octave jupyter notebook --ip 0.0.0.0'
|
||||||
|
alias con='git x php bin/console'
|
||||||
|
alias disphost='export DISPLAY=:0.0'
|
||||||
|
alias l='ls -CF'
|
||||||
|
alias la='ls -A'
|
||||||
|
alias less='less -R'
|
||||||
|
alias ll='ls -AlhF'
|
||||||
|
alias logout='pkill -u "$USER"'
|
||||||
|
alias mouse1="xmodmap <(echo pointer = 1 2 3)"
|
||||||
|
alias mouse2="xmodmap <(echo pointer = 3 2 1)"
|
||||||
|
alias nmrestart='nmcli radio wifi off;sleep 1;nmcli radio wifi on'
|
||||||
|
alias resource='. ~/.zshrc'
|
||||||
|
alias srm='shred -uzv'
|
||||||
|
if [ "$(uname)" != "Darwin" ]; then
|
||||||
|
# Not Mac
|
||||||
|
export PATH="$HOME/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:$HOME/.cargo/bin:$HOME/go/bin"
|
||||||
|
alias ls='ls --color=always -F'
|
||||||
|
alias where="readlink -m"
|
||||||
|
else
|
||||||
|
# It is a mac
|
||||||
|
# Prepend macports directories in /opt/local
|
||||||
|
if ex greadlink; then
|
||||||
|
alias readlink='greadlink'
|
||||||
|
alias where="greadlink -m"
|
||||||
|
fi
|
||||||
|
export PATH="/opt/local/sbin:/opt/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:$HOME/bin"
|
||||||
|
fi
|
||||||
|
if test -f /etc/gentoo-release; then
|
||||||
|
# Gentoo
|
||||||
|
alias etup='sudo etc-update'
|
||||||
|
ins() {
|
||||||
|
# Sudo echo so we have immediate results on weather sudo worked
|
||||||
|
sudo echo "Args: $*"
|
||||||
|
# Beep, verbose, ask
|
||||||
|
sudo emerge --autounmask-write -Ava "$@"
|
||||||
|
tput bel
|
||||||
|
}
|
||||||
|
if ex eix-sync; then
|
||||||
|
alias update="sudo eix-sync; tput bel"
|
||||||
|
elif ex emaint; then
|
||||||
|
alias update="sudo emaint sync -A; tput bel"
|
||||||
|
fi
|
||||||
|
upgrade() {
|
||||||
|
# Sudo echo so we have immediate results on weather sudo worked
|
||||||
|
sudo echo "Args: $*"
|
||||||
|
sudo emerge --update --newuse --deep --verbose --tree --keep-going=y --verbose-conflicts --alert --ask --binpkg-respect-use=y --binpkg-changed-deps=y --backtrack=30 "$@" @world
|
||||||
|
tput bel
|
||||||
|
}
|
||||||
|
elif test -f /etc/lsb-release; then
|
||||||
|
# Ubuntu
|
||||||
|
alias install='sudo apt install'
|
||||||
|
alias remove='sudo apt remove'
|
||||||
|
alias update='sudo apt update'
|
||||||
|
alias upgrade='sudo apt upgrade'
|
||||||
|
alias autoremove='sudo apt autoremove'
|
||||||
|
alias updateall='sudo sh -c "apt update;apt full-upgrade -y"'
|
||||||
|
alias search='apt-cache search'
|
||||||
|
fi
|
||||||
|
alias ..='k ..'
|
||||||
|
alias ...='k ../..'
|
||||||
|
alias ....='k ../../..'
|
||||||
|
alias .....='k ../../../..'
|
||||||
|
alias ......='k ../../../../..'
|
||||||
|
alias .......='k ../../../../../..'
|
||||||
|
alias ........='k ../../../../../../..'
|
||||||
|
alias .........='k ../../../../../../../..'
|
||||||
|
alias ..........='k ../../../../../../../../..'
|
||||||
|
alias ...........='k ../../../../../../../../../..'
|
||||||
|
alias ............='k ../../../../../../../../../../..'
|
||||||
|
alias .............='k ../../../../../../../../../../../..'
|
||||||
|
alias ..............='k ../../../../../../../../../../../../..'
|
||||||
|
alias ...............='k ../../../../../../../../../../../../../..'
|
||||||
|
ex youtube-dl && alias ytdl="youtube-dl -x --audio-format mp3 --audio-quality 0 -c -o '%(title)s.%(ext)s'"
|
||||||
|
if ex wemux; then
|
||||||
|
alias tux="wemux"
|
||||||
|
elif ex tmux; then
|
||||||
|
alias tux="tmux a || tmux"
|
||||||
|
fi
|
||||||
|
if ex git; then
|
||||||
|
alias g="git"
|
||||||
|
fi
|
||||||
|
alias stdns="sudo sh -c 'echo nameserver 1.1.1.1 > /etc/resolv.conf'"
|
||||||
|
alias fk='k `fzf --no-mouse -m -1 -x`'
|
||||||
|
alias susp="sudo true && (slock&until echo mem|sudo tee /sys/power/state>/dev/null;do sleep 1;done;sleep 4;nmcli radio wifi off;sleep 3;nmcli radio wifi on)"
|
||||||
|
if ex sudo; then
|
||||||
|
alias s='sudo -Hu'
|
||||||
|
fi
|
||||||
|
alias -g PA='2>&1 | paste'
|
||||||
|
if ex rsync; then
|
||||||
|
alias -g c='rsync --no-inc-recursive --partial-dir=.rsync-partial -ha --info=progress2 "$@"'
|
||||||
|
alias -g cfat='rsync --no-inc-recursive --partial-dir=.rsync-partial -hrlc --info=progress2 "$@"'
|
||||||
|
alias cp='rsync --no-inc-recursive --partial-dir=.rsync-partial -ha --info=progress2 "$@"'
|
||||||
|
fi
|
||||||
|
alias -g nify=" > /dev/null 2>&1 &"
|
||||||
|
alias -g nifyd=" > /dev/null 2>&1 & disown"
|
||||||
|
alias -g L="|& less"
|
||||||
|
if ex mktemp; then
|
||||||
|
alias mtmp='pushd "$(mktemp -d)" >/dev/null'
|
||||||
|
fi
|
||||||
|
if ex rg; then
|
||||||
|
alias -g G='|& rg'
|
||||||
|
alias rg='rg -i'
|
||||||
|
# I'm so sorry, ggreer
|
||||||
|
alias ag=rg
|
||||||
|
elif ex ag; then
|
||||||
|
alias -g G='|& ag'
|
||||||
|
elif ex egrep; then
|
||||||
|
alias -g G='|& egrep'
|
||||||
|
elif ex grep; then
|
||||||
|
alias -g G='|& grep'
|
||||||
|
fi
|
||||||
|
alias bp="tput bel"
|
||||||
|
timer() {
|
||||||
|
for i in {1.."$1"}; do
|
||||||
|
sleep 1
|
||||||
|
echo
|
||||||
|
done | pv -Sptels "$1" >/dev/null
|
||||||
|
}
|
||||||
|
fixsh() {
|
||||||
|
sed -i'' -e "${1}d" ~/.ssh/known_hosts
|
||||||
|
}
|
||||||
|
mv() { /bin/mv -v "$@" }
|
||||||
|
m() { mv "$@" }
|
||||||
|
compdef _cp c cfat m mv cp adb apush apull
|
||||||
|
linx() {
|
||||||
|
if [[ -z "$1" ]]; then
|
||||||
|
curl -T- -H "Linx-Randomize: yes" -H "Linx-Expiry: 2592000" https://linx.austenwares.com/upload | perl -pe 's/https:\/\/linx.austenwares.com\/(\w+)/https:\/\/linx.austenwares.com\/selif\/\1/'
|
||||||
|
elif (( $# == 1 )) && [[ -f "$1" ]]; then
|
||||||
|
linx < "$1"
|
||||||
|
else
|
||||||
|
tar -cf - "$@" | linx
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
ltar() {
|
||||||
|
tar -cf - "$@"|pv -WcN tar|xz|pv -WcN lzma
|
||||||
|
}
|
||||||
|
ctar() {
|
||||||
|
tar -cf - "$@"|pv -WcN tar|gzip|pv -WcN gzip
|
||||||
|
}
|
||||||
|
offline() {
|
||||||
|
if [ ! -z "$@" ] ; then
|
||||||
|
sudo unshare -n -- sudo -u "$USER" zsh -c "$@"
|
||||||
|
else
|
||||||
|
sudo unshare -n -- sudo -u "$USER" LP_MARK_PREFIX=" $(tput setaf 1)(offline)$(tput sgr0) " zsh
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
tsh() {
|
||||||
|
ssh "$@"
|
||||||
|
echo "\n\n\n\n\n\n\n\n\n\nSESSION CLOSED\n\n\n\n\n\n\n\n\n\n"
|
||||||
|
}
|
||||||
|
compdefas () {
|
||||||
|
local a
|
||||||
|
a="$1"
|
||||||
|
shift
|
||||||
|
compdef "$_comps[$a]" "${(@)*}=$a"
|
||||||
|
}
|
||||||
|
compdefas ssh tsh
|
||||||
|
compdefas mv m mv
|
||||||
|
mcl() {
|
||||||
|
mkdir -p "$1"
|
||||||
|
cd "$1"
|
||||||
|
}
|
||||||
|
rc() {
|
||||||
|
case $1 in
|
||||||
|
z) vim ~/.zshrc;;
|
||||||
|
v) vim ~/.vimrc;;
|
||||||
|
i) vim ~/.config/i3/config;;
|
||||||
|
use) sudo vim /etc/portage/package.use/package.use;;
|
||||||
|
make) sudo vim /etc/portage/make.conf;;
|
||||||
|
unmask) sudo vim /etc/portage/package.unmask/package.unmask;;
|
||||||
|
mask) sudo vim /etc/portage/package.mask/package.mask;;
|
||||||
|
accept_keywords) sudo vim /etc/portage/package.accept_keywords/package.accept_keywords;;
|
||||||
|
keywords) sudo vim /etc/portage/package.keywords/package.keywords;;
|
||||||
|
license) sudo vim /etc/portage/package.license/package.license;;
|
||||||
|
*) echo "Opts:\nz v i\nuse make unmask mask accept_keywords keywords license"
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
k() {
|
||||||
|
# More than 1 arguement
|
||||||
|
if [[ $# > 1 ]] ; then
|
||||||
|
vim $@
|
||||||
|
elif [ -d "$@" ] ; then
|
||||||
|
cd "$@" && ls
|
||||||
|
elif [[ "$@" == "-" ]] ; then
|
||||||
|
# Because if this isn't here, k - won't work
|
||||||
|
cd - && ls
|
||||||
|
elif [ -f "$@" ] ; then
|
||||||
|
# Extract if it's extractable
|
||||||
|
case $1 in
|
||||||
|
# Images
|
||||||
|
*.png|*.jpg|*.gif) feh "$1" ;;
|
||||||
|
# Documents
|
||||||
|
*.pdf|*.ps) okular "$1" ;;
|
||||||
|
*.odt|*.doc|*.docx) libreoffice "$1" ;;
|
||||||
|
*.odp|*.ppt|*.pptx) libreoffice "$1" ;;
|
||||||
|
*.ods|*.xls|*.xlsx) libreoffice "$1" ;;
|
||||||
|
# Compressed files
|
||||||
|
*.tar.xz) pv "$1"|tar -xJf - ;;
|
||||||
|
*.txz) pv "$1"|tar -xJf - ;;
|
||||||
|
*.tar.bz2) pv "$1"|tar -xjf - ;;
|
||||||
|
*.tar.gz) pv "$1"|tar -xzf - ;;
|
||||||
|
*.tar) pv "$1"|tar -xf - ;;
|
||||||
|
*.tbz) pv "$1"|tar -xjf - ;;
|
||||||
|
*.tbz2) pv "$1"|tar -xjf - ;;
|
||||||
|
*.tgz) pv "$1"|tar -xzf - ;;
|
||||||
|
*.lzma) pv "$1"|tar --lzma -xf - ;;
|
||||||
|
*.xz) pv "$1"|tar -xJf - ;;
|
||||||
|
*.bz2) bunzip2 "$1" ;;
|
||||||
|
*.rar) unrar x "$1" ;;
|
||||||
|
*.gz) gunzip "$1" ;;
|
||||||
|
*.zip) unzip "$1" ;;
|
||||||
|
*.Z) uncompress "$1" ;;
|
||||||
|
*.7z) 7z x "$1" ;;
|
||||||
|
*.lrz) lrzuntar "$1" ;;
|
||||||
|
*) vim "$1"
|
||||||
|
esac
|
||||||
|
else
|
||||||
|
# Edit with vim
|
||||||
|
echo -n "vim? "
|
||||||
|
read a
|
||||||
|
vim "$@"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
if (( $+TMUX )) || [[ "$TERM" = "screen-256color" ]] || [[ "$TERM" = "screen.xterm-256color" ]]; then
|
||||||
|
unset zle_bracketed_paste
|
||||||
|
fi
|
||||||
|
|
||||||
|
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
|
||||||
|
if ex fasd; then
|
||||||
|
eval "$(fasd --init auto)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -ne '[# ]\r'
|
||||||
|
#source ~/.zsh-git/liquidprompt/liquidprompt
|
||||||
|
if [[ -f ~/.zsh-git/custom-config/zshrc ]]; then
|
||||||
|
source ~/.zsh-git/custom-config/zshrc
|
||||||
|
fi
|
||||||
|
|
||||||
|
function prompt_pre() {
|
||||||
|
CESIUM_LAST_COMMAND_TIME="$(date +%s)"
|
||||||
|
}
|
||||||
|
function prompt_cmd() {
|
||||||
|
PS1="$(CESIUM_LAST_COMMAND_TIME="$CESIUM_LAST_COMMAND_TIME" RC=$? cesium --mode ps1 --shell zsh)"
|
||||||
|
RPS1="$(CESIUM_LAST_COMMAND_TIME="$CESIUM_LAST_COMMAND_TIME" RC=$? cesium --mode rps1 --shell zsh)"
|
||||||
|
unset CESIUM_LAST_COMMAND_TIME
|
||||||
|
}
|
||||||
|
precmd_functions+=(prompt_cmd)
|
||||||
|
autoload -Uz add-zsh-hook
|
||||||
|
add-zsh-hook preexec prompt_pre
|
||||||
|
|
||||||
|
#function prompt_pre() {
|
||||||
|
# CESIUM_LAST_COMMAND_TIME="$(date +%s)"
|
||||||
|
#}
|
||||||
|
#function prompt_cmd() {
|
||||||
|
# PS1="$(CESIUM_LAST_COMMAND_TIME="$CESIUM_LAST_COMMAND_TIME" RC="$?" ~/git/cesium/cesium --mode ps1 --shell zsh)"
|
||||||
|
# RPS1="$(CESIUM_LAST_COMMAND_TIME="$CESIUM_LAST_COMMAND_TIME" RC="$?" ~/git/cesium/cesium --mode rps1 --shell zsh)"
|
||||||
|
# unset CESIUM_LAST_COMMAND_TIME
|
||||||
|
#}
|
||||||
|
#autoload -Uz add-zsh-hook
|
||||||
|
#precmd_functions+=(prompt_cmd)
|
||||||
|
#add-zsh-hook preexec prompt_pre
|
||||||
|
echo -e '[##]'
|
||||||
|
#zprof
|
@ -1,44 +0,0 @@
|
|||||||
# af-magic.zsh-theme
|
|
||||||
# Repo: https://github.com/andyfleming/oh-my-zsh
|
|
||||||
# Direct Link: https://github.com/andyfleming/oh-my-zsh/blob/master/themes/af-magic.zsh-theme
|
|
||||||
|
|
||||||
if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi
|
|
||||||
if [ -z "$SSH_TTY" ] && [ -z "$SSH_CONNECTION" ] && [ -z "$SSH_CLIENT" ] ; then
|
|
||||||
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
|
|
||||||
else
|
|
||||||
local return_code="%(?..%{$fg[green]%}%? ↵%{$reset_color%})"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# primary prompt
|
|
||||||
PROMPT='$FG[032]%~\
|
|
||||||
$(git_prompt_info) \
|
|
||||||
$FG[105]%(!.#.$)%{$reset_color%} '
|
|
||||||
PROMPT2='%{$fg[red]%}\ %{$reset_color%}'
|
|
||||||
RPS1='${return_code}'
|
|
||||||
# »
|
|
||||||
|
|
||||||
# color vars
|
|
||||||
eval my_gray='$FG[237]'
|
|
||||||
eval my_orange='$FG[214]'
|
|
||||||
|
|
||||||
# right prompt
|
|
||||||
if type "virtualenv_prompt_info" > /dev/null
|
|
||||||
then
|
|
||||||
if [[ $EUID -ne 0 ]] && [ -z "$SSH_TTY" ] && [ -z "$SSH_CONNECTION" ] && [ -z "$SSH_CLIENT" ]; then
|
|
||||||
RPROMPT='$(virtualenv_prompt_info)$my_gray%n@%m%{$reset_color%}%'
|
|
||||||
else
|
|
||||||
RPROMPT='$(virtualenv_prompt_info)$my_red%n@%m%{$reset_color%}%'
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
if [[ $EUID -ne 0 ]] && [ -z "$SSH_TTY" ] && [ -z "$SSH_CONNECTION" ] && [ -z "$SSH_CLIENT" ]; then
|
|
||||||
RPROMPT='$my_gray%n@%m%{$reset_color%}%'
|
|
||||||
else
|
|
||||||
RPROMPT='$my_red%n@%m%{$reset_color%}%'
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# git settings
|
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX="$FG[075](branch:"
|
|
||||||
ZSH_THEME_GIT_PROMPT_CLEAN=""
|
|
||||||
ZSH_THEME_GIT_PROMPT_DIRTY="$my_orange*%{$reset_color%}"
|
|
||||||
ZSH_THEME_GIT_PROMPT_SUFFIX="$FG[075])%{$reset_color%}"
|
|
@ -1,2 +0,0 @@
|
|||||||
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
|
|
||||||
PS1="$ "
|
|
257
shells/tmprc
257
shells/tmprc
@ -1,257 +0,0 @@
|
|||||||
case $- in
|
|
||||||
*i*) ;;
|
|
||||||
*) return;;
|
|
||||||
esac
|
|
||||||
HISTCONTROL=ignoreboth
|
|
||||||
shopt -s histappend
|
|
||||||
shopt -s checkwinsize
|
|
||||||
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
|
|
||||||
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
|
|
||||||
debian_chroot=$(cat /etc/debian_chroot)
|
|
||||||
fi
|
|
||||||
case "$TERM" in
|
|
||||||
xterm-color) color_prompt=yes;;
|
|
||||||
esac
|
|
||||||
if [ -n "$force_color_prompt" ]; then
|
|
||||||
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
|
|
||||||
color_prompt=yes
|
|
||||||
else
|
|
||||||
color_prompt=
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
if [ "$color_prompt" = yes ]; then
|
|
||||||
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
|
|
||||||
else
|
|
||||||
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
|
|
||||||
fi
|
|
||||||
unset color_prompt force_color_prompt
|
|
||||||
# If this is an xterm set the title to user@host:dir
|
|
||||||
case "$TERM" in
|
|
||||||
xterm*|rxvt*)
|
|
||||||
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
if ! shopt -oq posix; then
|
|
||||||
if [ -f /usr/share/bash-completion/bash_completion ]; then
|
|
||||||
. /usr/share/bash-completion/bash_completion
|
|
||||||
elif [ -f /etc/bash_completion ]; then
|
|
||||||
. /etc/bash_completion
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
[ -f /usr/share/autojump/autojump.sh ] && . /usr/share/autojump/autojump.sh
|
|
||||||
|
|
||||||
[[ -s /home/stonewareslord/.autojump/etc/profile.d/autojump.sh ]] && source /home/stonewareslord/.autojump/etc/profile.d/autojump.sh
|
|
||||||
export PATH=/home/stonewareslord/.autojump/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/stonewareslord/tmp/ucpp/ucpp/:/home/stonewareslord/tmp/ucpp/ucpp/:/home/stonewareslord/hitchhikers/bin/ucpp/ucpp:/home/stonewareslord/hitchhikers/bin/ucpp/ucpp
|
|
||||||
alias bat='upower -i /org/freedesktop/UPower/devices/battery_BAT0| grep -E "state|to\ full|percentage"'
|
|
||||||
|
|
||||||
complete -cf sudo man
|
|
||||||
|
|
||||||
#Alias definitions.
|
|
||||||
if [ "$(uname)" != "Darwin" ] ; then
|
|
||||||
alias ls='ls --color=always -F'
|
|
||||||
fi
|
|
||||||
if [ -x /usr/bin/dircolors ]; then
|
|
||||||
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
|
|
||||||
alias ls='ls --color=auto'
|
|
||||||
alias grep='grep --color=auto'
|
|
||||||
alias fgrep='fgrep --color=auto'
|
|
||||||
alias egrep='egrep --color=auto'
|
|
||||||
fi
|
|
||||||
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
|
|
||||||
#alias vim='vim +"au BufWritePost .vimrc so ~/.vimrc" +"au BufWritePost vimrc so ~/.vimrc"'
|
|
||||||
alias disphost='export DISPLAY=:0.0'
|
|
||||||
alias ll='ls -alF'
|
|
||||||
alias la='ls -A'
|
|
||||||
alias l='ls -CF'
|
|
||||||
alias logout='sudo pkill -u $USER'
|
|
||||||
alias fixsh='ssh-keygen -R'
|
|
||||||
alias tmux='tmux -2'
|
|
||||||
alias less='less -r'
|
|
||||||
alias tree='tree -C'
|
|
||||||
alias grep="grep --color=auto"
|
|
||||||
alias skim="(head -5; tail -5) <"
|
|
||||||
alias cp="cp -v"
|
|
||||||
alias mv="mv -v"
|
|
||||||
alias la='ls -lah $LS_COLOR'
|
|
||||||
alias dt='date "+%F %T"'
|
|
||||||
alias awake='disphost; while true; do xdotool mousemove 0 0; sleep 60; done'
|
|
||||||
alias adk='/home/stonewareslord/applications/adk/bin/studio.sh&>/dev/null'
|
|
||||||
alias resource='. ~/.bashrc'
|
|
||||||
alias install='sudo apt-get install'
|
|
||||||
alias search='sudo apt-cache search'
|
|
||||||
alias remove='sudo apt-get remove'
|
|
||||||
alias update='sudo apt-get update'
|
|
||||||
alias upgrade='sudo apt-get upgrade'
|
|
||||||
alias autoremove='sudo apt-get autoremove'
|
|
||||||
alias ..='k ..'
|
|
||||||
alias ...='k ../..'
|
|
||||||
alias ....='k ../../..'
|
|
||||||
alias .....='k ../../../..'
|
|
||||||
alias ......='k ../../../../..'
|
|
||||||
alias .......='k ../../../../../..'
|
|
||||||
alias ........='k ../../../../../../..'
|
|
||||||
alias .........='k ../../../../../../../..'
|
|
||||||
alias ytdl="youtube-dl $@ -x --audio-format mp3 --audio-quality 0 -c -o '%(title)s.%(ext)s'"
|
|
||||||
alias tux="tmux a||tmux"
|
|
||||||
alias rmgit="git remote rm origin;git remote rm https;git remote rm oOrigin;git remote rm oHttps"
|
|
||||||
alias g="git $@"
|
|
||||||
function mcl(){ mkdir "$@"&&cl "$@"; }
|
|
||||||
function cl(){ cd "$@" && ls; }
|
|
||||||
function k(){
|
|
||||||
if [ -d "$@" ] ; then
|
|
||||||
cd "$@" && ls
|
|
||||||
elif [ "$@" == "-" ] ; then
|
|
||||||
cd - && ls
|
|
||||||
elif [ -f "$@" ] ; then
|
|
||||||
vim "$@"
|
|
||||||
else
|
|
||||||
echo -n "Create? "
|
|
||||||
read a
|
|
||||||
if [ ! -z $a ] ; then
|
|
||||||
vim "$@"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
complete -f k
|
|
||||||
function ovim(){ vim +"SessionOpen $@"; }
|
|
||||||
function ogvim(){ gvim +"SessionOpen $@"; }
|
|
||||||
function tsh(){
|
|
||||||
ssh $* -X
|
|
||||||
if which ponysay >/dev/null; then
|
|
||||||
ponysay "Connection closed!"
|
|
||||||
else
|
|
||||||
echo "\n\n\n\n\n\n\n\n\n\nSESSION CLOSED\n\n\n\n\n\n\n\n\n\n"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#Functions
|
|
||||||
extract () {
|
|
||||||
if [ -f $1 ] ; then
|
|
||||||
case $1 in
|
|
||||||
*.tar.xz) tar xvf $1 ;;
|
|
||||||
*.tar.bz2) tar xvjf $1 ;;
|
|
||||||
*.tar.gz) tar xvzf $1 ;;
|
|
||||||
*.bz2) bunzip2 $1 ;;
|
|
||||||
*.rar) rar 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 ;;
|
|
||||||
*) echo "don't know how to extract '$1'..." ;;
|
|
||||||
esac
|
|
||||||
else
|
|
||||||
echo "'$1' is not a valid file!"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
export -f extract
|
|
||||||
function cinitify(){
|
|
||||||
mkdir $2
|
|
||||||
cd $2
|
|
||||||
git init
|
|
||||||
git remote add origin git@austenwares.com:$1/$2.git
|
|
||||||
git remote add https https://austenwares.com/gitlab/$1/$2.git
|
|
||||||
#Offline mode
|
|
||||||
git remote add oOrigin git@10.0.1.200:$1/$2.git
|
|
||||||
git remote add oHttps https://10.0.1.200/gitlab/$1/$2.git
|
|
||||||
git remote -v
|
|
||||||
echo -n "Pull from: "
|
|
||||||
read from
|
|
||||||
git pull $FROM
|
|
||||||
git co master
|
|
||||||
}
|
|
||||||
export -f cinitify
|
|
||||||
function initify(){
|
|
||||||
git init
|
|
||||||
git remote add origin git@austenwares.com:$1/$2.git
|
|
||||||
git remote add https https://austenwares.com/gitlab/$1/$2.git
|
|
||||||
#Offline mode
|
|
||||||
git remote add oOrigin git@10.0.1.200:$1/$2.git
|
|
||||||
git remote add oHttps https://10.0.1.200/gitlab/$1/$2.git
|
|
||||||
git remote -v
|
|
||||||
echo -n "Pull from: "
|
|
||||||
read from
|
|
||||||
git pull $FROM
|
|
||||||
git co master
|
|
||||||
}
|
|
||||||
export -f initify
|
|
||||||
|
|
||||||
#Color definitions
|
|
||||||
txtblk='\[\e[0;30m\]' # Black - Regular
|
|
||||||
txtred='\[\e[0;31m\]' # Red
|
|
||||||
txtgrn='\[\e[0;32m\]' # Green
|
|
||||||
txtylw='\[\e[0;33m\]' # Yellow
|
|
||||||
txtblu='\[\e[0;34m\]' # Blue
|
|
||||||
txtpur='\[\e[0;35m\]' # Purple
|
|
||||||
txtcyn='\[\e[0;36m\]' # Cyan
|
|
||||||
txtwht='\[\e[0;37m\]' # White
|
|
||||||
|
|
||||||
bldblk='\[\e[1;30m\]' # Black - Bold
|
|
||||||
bldred='\[\e[1;31m\]' # Red
|
|
||||||
bldgrn='\[\e[1;32m\]' # Green
|
|
||||||
bldylw='\[\e[1;33m\]' # Yellow
|
|
||||||
bldblu='\[\e[1;34m\]' # Blue
|
|
||||||
bldpur='\[\e[1;35m\]' # Purple
|
|
||||||
bldcyn='\[\e[1;36m\]' # Cyan
|
|
||||||
bldwht='\[\e[1;37m\]' # White
|
|
||||||
|
|
||||||
unkblk='\[\e[4;30m\]' # Black - Underline
|
|
||||||
undred='\[\e[4;31m\]' # Red
|
|
||||||
undgrn='\[\e[4;32m\]' # Green
|
|
||||||
undylw='\[\e[4;33m\]' # Yellow
|
|
||||||
undblu='\[\e[4;34m\]' # Blue
|
|
||||||
undpur='\[\e[4;35m\]' # Purple
|
|
||||||
undcyn='\[\e[4;36m\]' # Cyan
|
|
||||||
undwht='\[\e[4;37m\]' # White
|
|
||||||
|
|
||||||
bakblk='\[\e[40m\]' # Black - Background
|
|
||||||
bakred='\[\e[41m\]' # Red
|
|
||||||
badgrn='\[\e[42m\]' # Green
|
|
||||||
bakylw='\[\e[43m\]' # Yellow
|
|
||||||
bakblu='\[\e[44m\]' # Blue
|
|
||||||
bakpur='\[\e[45m\]' # Purple
|
|
||||||
bakcyn='\[\e[46m\]' # Cyan
|
|
||||||
bakwht='\[\e[47m\]' # White
|
|
||||||
|
|
||||||
txtrst='\[\e[0m\]' # Text Reset
|
|
||||||
|
|
||||||
#History control
|
|
||||||
if [ "$BASH" ]; then
|
|
||||||
parse_git_branch() {
|
|
||||||
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \1/' | grep -oE '[^ ]+$'
|
|
||||||
}
|
|
||||||
prompt(){
|
|
||||||
a=`parse_git_branch`
|
|
||||||
hn=`hostname`
|
|
||||||
hn=${hn:0:3}
|
|
||||||
who=`whoami`
|
|
||||||
who=${who:0:3}
|
|
||||||
if [ -z $a ] ; then
|
|
||||||
printf "{$txtgrn%s@%s$txtrst}{$txtred%s$txtrst}>" $who $hn "$PWD"
|
|
||||||
else
|
|
||||||
printf "{$txtgrn%s@%s$txtrst}{$txtred%s$txtrst}{$txtblu%s$txtrst}>" $who $hn "$PWD" $(parse_git_branch)
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
PS1=""
|
|
||||||
PROMPT_COMMAND='PS1=`prompt`'
|
|
||||||
export PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND ; }"'echo "`date +'%y.%m.%d-%H:%M:%S:'`" $USER "$(pwd)" "$(history 1 | cut -c8-)" >> ~/.bash_eternal_history'
|
|
||||||
#PROMPT_COMMAND='PS1="\(\033[0;33m\][\!]\`if [[ \$? = "0" ]]; then echo "\\[\\033[32m\\]"; else echo "\\[\\033[31m\\]"; fi\`[\u.\h: \`if [[ `pwd|wc -c|tr -d " "` > 18 ]]; then echo "\\W"; else echo "\\w"; fi\`]\$\[\033[0m\] "; echo -ne "\033]0;`hostname -s`:`pwd`\007"'
|
|
||||||
|
|
||||||
export HISTFILESIZE=
|
|
||||||
export HISTSIZE=
|
|
||||||
export HISTTIMEFORMAT="%Y-%m-%d_%H:%M:%S "
|
|
||||||
export HISTFILE=~/.bash_eternal_history
|
|
||||||
|
|
||||||
alias ehistory='cat ~/.bash_eternal_history|grep $@'
|
|
||||||
readonly HOME
|
|
||||||
readonly HISTIGNORE
|
|
||||||
#readonly PROMPT_COMMAND
|
|
||||||
#readonly HISTSIZE
|
|
||||||
#readonly HISTFILE
|
|
||||||
#readonly HISTCONTROL
|
|
||||||
fi
|
|
642
shells/zshrc
642
shells/zshrc
@ -1,642 +0,0 @@
|
|||||||
#zmodload zsh/zprof
|
|
||||||
echo -ne '[ ]\r'
|
|
||||||
for CONFIG (~/.zsh/*.zsh) source "$CONFIG"
|
|
||||||
autoload -U compinit
|
|
||||||
compinit
|
|
||||||
setopt always_to_end # When completing from the middle of a word, move the cursor to the end of the word
|
|
||||||
setopt complete_in_word # Allow completion from within a word/phrase
|
|
||||||
setopt INTERACTIVECOMMENTS
|
|
||||||
setopt EXTENDED_GLOB
|
|
||||||
setopt HIST_EXPIRE_DUPS_FIRST
|
|
||||||
export HIST_STAMPS="dd.mm.yyyy"
|
|
||||||
export HISTSIZE=12000
|
|
||||||
export SAVEHIST=10000000
|
|
||||||
export HISTFILE="$HOME/.zsh_history"
|
|
||||||
setopt APPEND_HISTORY
|
|
||||||
setopt EXTENDED_HISTORY
|
|
||||||
setopt APPEND_HISTORY SHARE_HISTORY HISTIGNOREALLDUPS
|
|
||||||
export DISABLE_AUTO_TITLE=true
|
|
||||||
export EDITOR='vim'
|
|
||||||
export FZF_COMPLETION_OPTS='--no-mouse -m -1 -x'
|
|
||||||
zstyle ':completion:*' use-cache on
|
|
||||||
zstyle ':completion:*' cache-path ~/.cache/zsh
|
|
||||||
compress(){
|
|
||||||
INFILE="${1:r}.tpxz"
|
|
||||||
if [ -f "$INFILE" ]; then
|
|
||||||
echo "Won't replace $1" >&2
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
tar --xattrs -I pixz -cpf "$INFILE" $*
|
|
||||||
}
|
|
||||||
# Check if a command exists
|
|
||||||
ex(){
|
|
||||||
command -v "$1" >/dev/null
|
|
||||||
return $?
|
|
||||||
}
|
|
||||||
if ex firefox; then
|
|
||||||
export BROWSER="firefox"
|
|
||||||
elif ex firefox-bin; then
|
|
||||||
export BROWSER="firefox-bin"
|
|
||||||
else
|
|
||||||
export BROWSER="xdg-open"
|
|
||||||
fi
|
|
||||||
# For pasting in commands that start with $
|
|
||||||
$ () {
|
|
||||||
$*
|
|
||||||
}
|
|
||||||
# A service implementation
|
|
||||||
sv () {
|
|
||||||
command="${@: -1}"
|
|
||||||
while (( $# > 1 )); do
|
|
||||||
if [[ "$command" == "i" ]]; then
|
|
||||||
echo "Status of $1"
|
|
||||||
rc-service "$1" status
|
|
||||||
shift
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
sudo true || return 2
|
|
||||||
if [[ "$1" == "sshd" ]] || [[ "$1" == "ssh" ]]; then
|
|
||||||
echo "Checking sshd config..."
|
|
||||||
sudo sshd -t && echo "Config good. Continuing" || (echo "Aborting due to bad ssh config";return 1)
|
|
||||||
fi
|
|
||||||
if [[ "$command" == "r" ]]; then
|
|
||||||
echo "Restarting $1"
|
|
||||||
sudo rc-service "$1" restart
|
|
||||||
elif [[ "$command" == "s" ]]; then
|
|
||||||
echo "Starting $1"
|
|
||||||
sudo rc-service "$1" start
|
|
||||||
elif [[ "$command" == "x" ]]; then
|
|
||||||
echo "Stopping $1"
|
|
||||||
sudo rc-service "$1" stop
|
|
||||||
else
|
|
||||||
sudo rc-service "$1" "$command"
|
|
||||||
fi
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
}
|
|
||||||
compdef _services sv
|
|
||||||
# Run gui application as root by copying xauth credentials
|
|
||||||
asroot(){
|
|
||||||
# Use temporary file for added security
|
|
||||||
TEMPFILE=$(tempfile)
|
|
||||||
xauth extract $TEMPFILE $DISPLAY
|
|
||||||
sudo zsh -c "xauth merge $TEMPFILE;(srm $TEMPFILE||rm $TEMPFILE)&'$@';"
|
|
||||||
}
|
|
||||||
# De-symlink
|
|
||||||
dsl() {
|
|
||||||
while (( $# > 0 )); do
|
|
||||||
readlink $1 2>&1 >/dev/null && mv $(readlink $1) $1
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
}
|
|
||||||
# Update the sync project
|
|
||||||
update-sync-project() {
|
|
||||||
if [[ ! -L ~/.zshrc ]]; then
|
|
||||||
echo "zshrc isn't a link"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
local ABSPATH="$(\dirname "$(\dirname "$(\readlink -e ~/.zshrc)")")"
|
|
||||||
git -C "$ABSPATH" pull origin master
|
|
||||||
if (( $# > 0 )); then
|
|
||||||
"$ABSPATH/scripts/sync.sh" $*
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
# Remove directory by removing subdirectories up a level
|
|
||||||
dedir(){
|
|
||||||
# Try removing the directory if it's empty, fail silently if you can't
|
|
||||||
=rmdir "$1" 2>/dev/null && return
|
|
||||||
# Make a uuid to avoid name conflicts
|
|
||||||
# Ex: dediring sage when sage/sage fails because sage/sage is moved to .
|
|
||||||
# but since sage/ exists, it can't be moved
|
|
||||||
local name=$(uuidgen)
|
|
||||||
# Move the directory to the uuid
|
|
||||||
=mv -n "$1" "$name" || return 1
|
|
||||||
# Move all files, use (N) in case there is no * or .* matches
|
|
||||||
=mv -n "$name"/{.,}*(N) . || return 2
|
|
||||||
=rmdir "$name" || return 3
|
|
||||||
}
|
|
||||||
# Run multitail on logs
|
|
||||||
mt(){
|
|
||||||
if [[ -z "$1" ]]; then
|
|
||||||
echo "Opts:\nm xe gitea dm syncthing g" >&2
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
case $1 in
|
|
||||||
m) sudo multitail /var/log/messages;;
|
|
||||||
xe) multitail ~/.xsession-errors;;
|
|
||||||
ef) sudo multitail /var/log/emerge-fetch.log;;
|
|
||||||
gitea) sudo multitail /var/log/gitea.{err,log};;
|
|
||||||
dm) dmesg -w;;
|
|
||||||
syncthing) sudo multitail /var/log/syncthing.{err,log};;
|
|
||||||
g) sudo watch -c genlop -tc;;
|
|
||||||
sync) watch grep -e Dirty: -e Writeback: /proc/meminfo;;
|
|
||||||
*) multitail "$1"
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
run(){
|
|
||||||
test -f "${1:r}" && rm "${1:r}"
|
|
||||||
echo "Building..." >&2
|
|
||||||
gcc -Wall -g -std=c99 "${1:r}.c" -o "${1:r}" && (echo "Running..." >&2;./"${1:r}")
|
|
||||||
}
|
|
||||||
upload() {
|
|
||||||
tar -cf - "$*" | base64 | curl --data-urlencode text@- -d title="File uploaded at $(date '+%d/%h/%y %H:%M:%S') on $(hostname)" -d name=$USER -d expire="1440" https://austenwares.com/paste/api/create | sed -e 's/view/view\/raw/'
|
|
||||||
}
|
|
||||||
download() {
|
|
||||||
URL="$(printf $1 | perl -pe 's/\/paste\/view(?!\/raw)/\/paste\/view\/raw/')"
|
|
||||||
curl "$URL" | base64 -d | tar -xf -
|
|
||||||
}
|
|
||||||
update-tool() {
|
|
||||||
if [ "$EUID" -ne 0 ]; then
|
|
||||||
echo "This function should be run as root"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
local RESP=""
|
|
||||||
while [[ "$RESP" != "q" ]]; do
|
|
||||||
CMD=${RESP:0:1}
|
|
||||||
case "$CMD" in
|
|
||||||
u) update -q;;
|
|
||||||
l) layman -S ;;
|
|
||||||
g) upgrade;;
|
|
||||||
e) etc-update;;
|
|
||||||
p) emerge -Av @preserved-rebuild --usepkg=n --keep-going=y;;
|
|
||||||
m) emerge -Av @module-rebuild --usepkg=n;;
|
|
||||||
d) emerge -Ava --depclean;;
|
|
||||||
h) haskell-updater -- --usepkg=n;;
|
|
||||||
c) perl-cleaner --reallyall;;
|
|
||||||
y) python-updater;;
|
|
||||||
r) revdep-rebuild;;
|
|
||||||
q) return;;
|
|
||||||
esac
|
|
||||||
RESP=${RESP:1}
|
|
||||||
if [[ ! -z "$RESP" ]]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
echo "Commands:"
|
|
||||||
echo "u: update"
|
|
||||||
echo "l: layman -S"
|
|
||||||
echo "g: upgrade"
|
|
||||||
echo "e: etc-update"
|
|
||||||
echo "p: emerge @preserved-rebuild --usepkg=n --keep-going=y"
|
|
||||||
echo "m: emerge @module-rebuild --usepkg=n"
|
|
||||||
echo "d: emerge --ask --depclean"
|
|
||||||
echo "h: haskell-updater -- --usepkg=n"
|
|
||||||
echo "c: perl-cleaner --reallyall"
|
|
||||||
echo "y: python-updater"
|
|
||||||
echo "r: revdep-rebuild"
|
|
||||||
echo "q: quit"
|
|
||||||
echo -n '\a> '
|
|
||||||
read RESP
|
|
||||||
done
|
|
||||||
}
|
|
||||||
if ex vim; then
|
|
||||||
alias vi='vim'
|
|
||||||
fi
|
|
||||||
if ex rc-service; then
|
|
||||||
alias service='rc-service'
|
|
||||||
fi
|
|
||||||
if ex ip; then
|
|
||||||
alias ip='ip -c'
|
|
||||||
fi
|
|
||||||
if ex adb; then
|
|
||||||
alias apush="adb push -p"
|
|
||||||
alias apull="adb pull -p"
|
|
||||||
fi
|
|
||||||
alias cleaner="sudo ~/run.sh 'perl-cleaner --reallyall' 'python-updater' 'haskell-updater -- --usepkg=n'"
|
|
||||||
alias jsonpretty='python -m json.tool'
|
|
||||||
alias nmrestart='nmcli radio wifi off;nmcli radio wifi on'
|
|
||||||
if ex mtr; then
|
|
||||||
alias mtr='mtr -t'
|
|
||||||
fi
|
|
||||||
if ex telegram-cli; then
|
|
||||||
alias tg='telegram-cli -NWA --disable-link-preview'
|
|
||||||
fi
|
|
||||||
alias perm='stat -c "%a %n"'
|
|
||||||
alias afci='git x ./autoformat.sh;git commit -am "Autoformatted"'
|
|
||||||
if ex eix; then
|
|
||||||
alias eix="eix -F"
|
|
||||||
fi
|
|
||||||
alias mouse1="xmodmap <(echo pointer = 1 2 3)"
|
|
||||||
alias mouse2="xmodmap <(echo pointer = 3 2 1)"
|
|
||||||
if ex ocp; then
|
|
||||||
alias ocp="ocp -vs0 -dcurses"
|
|
||||||
fi
|
|
||||||
alias con='git x php bin/console'
|
|
||||||
alias srm='shred -uzv'
|
|
||||||
alias disphost='export DISPLAY=:0.0'
|
|
||||||
alias ll='ls -AlhF'
|
|
||||||
alias la='ls -A'
|
|
||||||
alias l='ls -CF'
|
|
||||||
alias logout='sudo pkill -u $USER'
|
|
||||||
if ex tmux; then
|
|
||||||
alias tmux='tmux -2'
|
|
||||||
fi
|
|
||||||
alias less='less -R'
|
|
||||||
if ex tree; then
|
|
||||||
alias tree='tree -C'
|
|
||||||
fi
|
|
||||||
alias resource='. ~/.zshrc'
|
|
||||||
if [ "$(uname)" != "Darwin" ]; then
|
|
||||||
# Not Mac
|
|
||||||
export PATH="$HOME/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:$HOME/.cargo/bin"
|
|
||||||
alias ls='ls --color=always -F'
|
|
||||||
alias where="readlink -m"
|
|
||||||
else
|
|
||||||
# It is a mac
|
|
||||||
# Prepend macports directories in /opt/local
|
|
||||||
if ex greadlink; then
|
|
||||||
alias readlink='greadlink'
|
|
||||||
alias where="greadlink -m"
|
|
||||||
fi
|
|
||||||
export PATH="/opt/local/sbin:/opt/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:$HOME/bin"
|
|
||||||
fi
|
|
||||||
if test -f /etc/gentoo-release; then
|
|
||||||
# Gentoo
|
|
||||||
alias etup='sudo etc-update'
|
|
||||||
ins(){
|
|
||||||
# Sudo echo so we have immediate results on weather sudo worked
|
|
||||||
sudo echo "Args: $*"
|
|
||||||
# Beep, verbose, ask
|
|
||||||
sudo emerge --autounmask-write -Ava $*
|
|
||||||
echo "\a"
|
|
||||||
}
|
|
||||||
upgrade(){
|
|
||||||
# Sudo echo so we have immediate results on weather sudo worked
|
|
||||||
sudo echo "Args: $*"
|
|
||||||
sudo emerge --update --newuse --deep --verbose --tree --keep-going=y --verbose-conflicts --alert --ask --binpkg-respect-use=y --binpkg-changed-deps=y --backtrack=30 $* @world
|
|
||||||
echo "\\a"
|
|
||||||
}
|
|
||||||
# For emerging with absolute paths
|
|
||||||
em(){
|
|
||||||
# Beep, verbose, ask
|
|
||||||
EMERGE_ARGS="-Ava"
|
|
||||||
X=""
|
|
||||||
for var in "$@"
|
|
||||||
do
|
|
||||||
if [[ "$var" =~ ^- ]]; then
|
|
||||||
EMERGE_ARGS="$EMERGE_ARGS $var"
|
|
||||||
else
|
|
||||||
X="$X =$var"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
echo sudo emerge "$EMERGE_ARGS""$X"
|
|
||||||
sudo emerge "$EMERGE_ARGS""$X"
|
|
||||||
echo "\a"
|
|
||||||
}
|
|
||||||
update(){
|
|
||||||
# If this is a server computer
|
|
||||||
sudo rm -f '/usr/portage/metadata/timestamp.chk'
|
|
||||||
if ex eix-update; then
|
|
||||||
sudo zsh -c "emaint sync -a&&eix-update"
|
|
||||||
else
|
|
||||||
sudo emaint sync -a
|
|
||||||
fi
|
|
||||||
sudo -k
|
|
||||||
if [ "$1" != "-q" ]; then
|
|
||||||
echo '\a'
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
elif test -f /etc/lsb-release; then
|
|
||||||
# Ubuntu
|
|
||||||
alias install='sudo apt install'
|
|
||||||
alias remove='sudo apt remove'
|
|
||||||
alias update='sudo apt update'
|
|
||||||
alias upgrade='sudo apt upgrade'
|
|
||||||
alias autoremove='sudo apt autoremove'
|
|
||||||
alias updateall='sudo sh -c "apt update;apt full-upgrade -y"'
|
|
||||||
alias search='apt-cache search'
|
|
||||||
fi
|
|
||||||
alias ..='k ..'
|
|
||||||
alias ...='k ../..'
|
|
||||||
alias ....='k ../../..'
|
|
||||||
alias .....='k ../../../..'
|
|
||||||
alias ......='k ../../../../..'
|
|
||||||
alias .......='k ../../../../../..'
|
|
||||||
alias ........='k ../../../../../../..'
|
|
||||||
alias .........='k ../../../../../../../..'
|
|
||||||
alias ..........='k ../../../../../../../../..'
|
|
||||||
alias ...........='k ../../../../../../../../../..'
|
|
||||||
alias ............='k ../../../../../../../../../../..'
|
|
||||||
alias .............='k ../../../../../../../../../../../..'
|
|
||||||
alias ..............='k ../../../../../../../../../../../../..'
|
|
||||||
alias ...............='k ../../../../../../../../../../../../../..'
|
|
||||||
if ex youtube-dl; then
|
|
||||||
alias ytdl="youtube-dl $@ -x --audio-format mp3 --audio-quality 0 -c -o '%(title)s.%(ext)s'"
|
|
||||||
fi
|
|
||||||
if ex wemux; then
|
|
||||||
alias tux="wemux"
|
|
||||||
elif ex tmux; then
|
|
||||||
alias tux="tmux a || tmux"
|
|
||||||
fi
|
|
||||||
if ex git; then
|
|
||||||
alias g="git"
|
|
||||||
fi
|
|
||||||
alias stdns="sudo sh -c 'echo nameserver 8.8.8.8 > /etc/resolv.conf'"
|
|
||||||
alias fvim="vim -u NONE +\"so ~/.vim/plugged/flappyvird-vim/plugin/flappyvird.vim\" +\"so ~/.vim/plugged/flappyvird-vim/autoload/flappyvird.vim\" +\":FlappyVird\" +\":q\""
|
|
||||||
alias fk='k `fzf --no-mouse -m -1 -x`'
|
|
||||||
#alias susp="sudo true&&((slock;sleep 2;nmcli radio wifi off;nmcli radio wifi on)&echo mem | sudo tee /sys/power/state >/dev/null);sudo -k"
|
|
||||||
alias susp="sudo true && (slock&until echo mem|sudo tee /sys/power/state>/dev/null;do sleep 1;done;sleep 4;nmcli radio wifi off;sleep 3;nmcli radio wifi on)"
|
|
||||||
if ex sudo; then
|
|
||||||
alias s='sudo -Hu'
|
|
||||||
fi
|
|
||||||
alias -g PA='2>&1 | paste'
|
|
||||||
if ex rsync; then
|
|
||||||
alias -g c='rsync --no-inc-recursive --partial -ha --info=progress2 "$@"'
|
|
||||||
alias -g cfat='rsync --no-inc-recursive --partial -hrlc --info=progress2 "$@"'
|
|
||||||
alias cp='rsync --no-inc-recursive --partial -ha --info=progress2 "$@"'
|
|
||||||
fi
|
|
||||||
alias -g nify=" > /dev/null 2>&1 &"
|
|
||||||
alias -g nifyd=" > /dev/null 2>&1 & disown"
|
|
||||||
alias -g L="2>&1|less"
|
|
||||||
if ex rg; then
|
|
||||||
alias -g G='|& rg'
|
|
||||||
alias rg='rg -i'
|
|
||||||
# I'm so sorry ggreer
|
|
||||||
alias ag=rg
|
|
||||||
elif ex ag; then
|
|
||||||
alias -g G='|& ag'
|
|
||||||
elif ex egrep; then
|
|
||||||
alias -g G='|& egrep'
|
|
||||||
elif ex grep; then
|
|
||||||
alias -g G='|& grep'
|
|
||||||
fi
|
|
||||||
timer() {
|
|
||||||
for i in {1.."$1"}; do
|
|
||||||
sleep 1
|
|
||||||
echo
|
|
||||||
done | pv -Sptels "$1" >/dev/null
|
|
||||||
}
|
|
||||||
fixsh(){
|
|
||||||
sed -i -e $1"d" ~/.ssh/known_hosts
|
|
||||||
}
|
|
||||||
mv() { /bin/mv -v "$@" }
|
|
||||||
m() { mv "$@" }
|
|
||||||
compdef _cp c cfat m mv cp adb apush apull
|
|
||||||
paste() {
|
|
||||||
local PRIVATE=0
|
|
||||||
if [[ ! -z "$1" ]] && [[ "$1" -eq "-p" ]]; then
|
|
||||||
PRIVATE=1
|
|
||||||
shift
|
|
||||||
fi
|
|
||||||
local NAME="-d title=Command run at $(date '+%d/%h/%y %H:%M:%S') on $(hostname)"
|
|
||||||
if [[ ! -z "$1" ]]; then
|
|
||||||
NAME="-d title=$1"
|
|
||||||
fi
|
|
||||||
sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g" | curl --data-urlencode text@- $NAME -d name=$USER -d expire="40320" -d private="$PRIVATE" https://austenwares.com/paste/api/create
|
|
||||||
}
|
|
||||||
linx() {
|
|
||||||
if [[ -z "$1" ]]; then
|
|
||||||
curl -T- -H "Linx-Randomize: yes" -H "Linx-Expiry: 2592000" https://linx.austenwares.com/upload | perl -pe 's/https:\/\/linx.austenwares.com\/(\w+)/https:\/\/linx.austenwares.com\/selif\/\1/'
|
|
||||||
elif (( $# == 1 )) && [[ -f "$1" ]]; then
|
|
||||||
linx < "$1"
|
|
||||||
else
|
|
||||||
tar -cf - $* | linx
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
grename() {
|
|
||||||
echo incomplete
|
|
||||||
return
|
|
||||||
FILES=($*)
|
|
||||||
REGEX='s///'
|
|
||||||
echo -n "Command (frneVVVq): "
|
|
||||||
while read input; do
|
|
||||||
case $input in
|
|
||||||
f)
|
|
||||||
echo "File list:"
|
|
||||||
printf '%s\n' $FILES
|
|
||||||
;;
|
|
||||||
r)
|
|
||||||
echo "Regex:"
|
|
||||||
echo "$REGEX"
|
|
||||||
;;
|
|
||||||
n)
|
|
||||||
echo "Simulated replacement:"
|
|
||||||
perl-rename -n "$REGEX" $FILES
|
|
||||||
;;
|
|
||||||
e)
|
|
||||||
echo "Editing regex..."
|
|
||||||
TEMPFILE=$(tempfile)
|
|
||||||
(cat <(printf '%s\n' $FILES);echo;echo "$REGEX") > $TEMPFILE
|
|
||||||
vim $TEMPFILE +'normal G$h'
|
|
||||||
REGEX=$(tac $TEMPFILE|grep -m1 '.')
|
|
||||||
rm $TEMPFILE
|
|
||||||
;;
|
|
||||||
VVV)
|
|
||||||
echo "Actual results:"
|
|
||||||
perl-rename -v $REGEX $FILES
|
|
||||||
return
|
|
||||||
;;
|
|
||||||
q)
|
|
||||||
return
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
echo -n "Command (frneVVVq): "
|
|
||||||
done
|
|
||||||
}
|
|
||||||
bp(){
|
|
||||||
echo '\a'
|
|
||||||
}
|
|
||||||
ltar(){
|
|
||||||
tar -cf - $@|pv -WcN tar|xz|pv -WcN lzma
|
|
||||||
#tar -cf - $@|pv -WcN tar -s $(echo $(du -sb $@|awk '{print $1}'|tr '\n' '+')0|bc)|gzip|pv -WcN dest
|
|
||||||
#tar -cf - $@|pv -WcN tar -s $(echo $(du -sb $@|awk '{print $1}'|tr '\n' '+')0|bc)|gzip|pv -WcN dest
|
|
||||||
}
|
|
||||||
ctar(){
|
|
||||||
tar -cf - $@|pv -WcN tar|gzip|pv -WcN gzip
|
|
||||||
}
|
|
||||||
offline(){
|
|
||||||
if [ ! -z "$@" ] ; then
|
|
||||||
sudo unshare -n -- sudo -u $USER zsh -c "$@"
|
|
||||||
else
|
|
||||||
sudo unshare -n -- sudo -u $USER LP_MARK_PREFIX=" $(tput setaf 1)(offline)$(tput sgr0) " zsh
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
dnstest(){
|
|
||||||
echo "resolv.conf:"
|
|
||||||
cat /etc/resolv.conf
|
|
||||||
echo "Testing DNS:"
|
|
||||||
dig google.com
|
|
||||||
echo "Testing ping:"
|
|
||||||
ping -c 2 8.8.8.8
|
|
||||||
echo "Testing IP curl:"
|
|
||||||
curl -L 178.33.250.62
|
|
||||||
echo
|
|
||||||
echo "Testing DNS"
|
|
||||||
curl -L portquiz.net
|
|
||||||
}
|
|
||||||
tsh(){
|
|
||||||
ssh -X $*
|
|
||||||
if which ponysay >/dev/null; then
|
|
||||||
ponysay "Connection closed!"
|
|
||||||
else
|
|
||||||
echo "\n\n\n\n\n\n\n\n\n\nSESSION CLOSED\n\n\n\n\n\n\n\n\n\n"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
compdefas () {
|
|
||||||
local a
|
|
||||||
a="$1"
|
|
||||||
shift
|
|
||||||
compdef "$_comps[$a]" "${(@)*}=$a"
|
|
||||||
}
|
|
||||||
compdefas ssh tsh
|
|
||||||
compdefas mv m mv
|
|
||||||
mcl(){
|
|
||||||
mkdir -p $1
|
|
||||||
cd $1
|
|
||||||
}
|
|
||||||
create-repo(){
|
|
||||||
PRIVATE="true"
|
|
||||||
while getopts ":p" opt; do
|
|
||||||
case $opt in
|
|
||||||
p)
|
|
||||||
echo "-p was used, making public"
|
|
||||||
PRIVATE="false"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
if [ -z "$1" ]; then
|
|
||||||
echo "No repo name" >&2
|
|
||||||
return 2
|
|
||||||
fi
|
|
||||||
echo -n "Username: "
|
|
||||||
read username
|
|
||||||
echo -n "Password: "
|
|
||||||
read -s password
|
|
||||||
curl --user "$username:$password" -d name="$1" -d private="$PRIVATE" https://gitea.austenwares.com/api/v1/user/repos
|
|
||||||
}
|
|
||||||
hsh(){
|
|
||||||
FILE="$1"
|
|
||||||
ARGS=""
|
|
||||||
while (( $# > 0 )); do
|
|
||||||
if [[ "md5" = "$1" ]] || [[ "md5sum" = "$1" ]] || [[ "m" = "$1" ]]; then
|
|
||||||
ARGS="$ARGS "md5sum
|
|
||||||
elif [[ "sha1" = "$1" ]] || [[ "sha1sum" = "$1" ]] || [[ "s" = "$1" ]]; then
|
|
||||||
ARGS="$ARGS "sha1sum
|
|
||||||
elif [[ "sha2" = "$1" ]] || [[ "sha256sum" = "$1" ]]; then
|
|
||||||
ARGS="$ARGS "sha256sum
|
|
||||||
elif [[ "sha512" = "$1" ]] || [[ "sha512sum" = "$1" ]]; then
|
|
||||||
ARGS="$ARGS "sha512sum
|
|
||||||
fi
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
ARGS=$(echo "$ARGS"|xargs)
|
|
||||||
echo "Calculating ($ARGS) of \"$FILE\""
|
|
||||||
echo pv "$FILE" \| pee $ARGS
|
|
||||||
pv "$FILE" | pee $(echo $ARGS)
|
|
||||||
}
|
|
||||||
rc(){
|
|
||||||
case $1 in
|
|
||||||
z) vim ~/.zshrc;;
|
|
||||||
v) vim ~/.vimrc;;
|
|
||||||
i) vim ~/.i3/config;;
|
|
||||||
use) sudo vim /etc/portage/package.use/package.use;;
|
|
||||||
make) sudo vim /etc/portage/make.conf;;
|
|
||||||
unmask) sudo vim /etc/portage/package.unmask/package.unmask;;
|
|
||||||
mask) sudo vim /etc/portage/package.mask/package.mask;;
|
|
||||||
accept_keywords) sudo vim /etc/portage/package.accept_keywords/package.accept_keywords;;
|
|
||||||
keywords) sudo vim /etc/portage/package.keywords/package.keywords;;
|
|
||||||
license) sudo vim /etc/portage/package.license/package.license;;
|
|
||||||
*) echo "Opts:\nz v i\nuse make unmask mask accept_keywords keywords license"
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
pub-git-rm(){
|
|
||||||
if (( $# == 0 )) ; then
|
|
||||||
git remote rm local
|
|
||||||
git remote rm ncsu
|
|
||||||
git remote rm gitlab
|
|
||||||
git remote rm aws
|
|
||||||
fi
|
|
||||||
while (( $# > 0 )) ; do
|
|
||||||
git remote rm "$1"
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
}
|
|
||||||
pub-git-push(){
|
|
||||||
if (( $# == 0 )) ; then
|
|
||||||
git push local --all && git push local --tags
|
|
||||||
git push ncsu --all && git push ncsu --tags
|
|
||||||
git push gitlab --all && git push gitlab --tags
|
|
||||||
git push aws --all && git push aws --tags
|
|
||||||
fi
|
|
||||||
while (( $# > 0 )) ; do
|
|
||||||
git push "$1" --all && git push "$1" --tags
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
}
|
|
||||||
k(){
|
|
||||||
#More than 1 arguement
|
|
||||||
if [[ $# > 1 ]] ; then
|
|
||||||
vim $@
|
|
||||||
elif [ -d "$@" ] ; then
|
|
||||||
#cd then ls
|
|
||||||
cd "$@" && ls
|
|
||||||
elif [[ "$@" == "-" ]] ; then
|
|
||||||
#Because if this isn't here, k - won't work
|
|
||||||
cd - && ls
|
|
||||||
elif [ -f "$@" ] ; then
|
|
||||||
#Extract if it's extractable
|
|
||||||
case $1 in
|
|
||||||
# Images
|
|
||||||
*.png|*.jpg|*.gif) feh "$1" ;;
|
|
||||||
# Documents
|
|
||||||
*.pdf|*.ps) okular "$1" ;;
|
|
||||||
*.odt|*.doc|*.docx) libreoffice "$1" ;;
|
|
||||||
*.odp|*.ppt|*.pptx) libreoffice "$1" ;;
|
|
||||||
*.ods|*.xls|*.xlsx) libreoffice "$1" ;;
|
|
||||||
# Compressed files
|
|
||||||
*.tar.xz) pv "$1"|tar -xJf - ;;
|
|
||||||
*.txz) pv "$1"|tar -xJf - ;;
|
|
||||||
*.tar.bz2) pv "$1"|tar -xjf - ;;
|
|
||||||
*.tar.gz) pv "$1"|tar -xzf - ;;
|
|
||||||
*.tar) pv "$1"|tar -xf - ;;
|
|
||||||
*.tbz) pv "$1"|tar -xjf - ;;
|
|
||||||
*.tbz2) pv "$1"|tar -xjf - ;;
|
|
||||||
*.tgz) pv "$1"|tar -xzf - ;;
|
|
||||||
*.lzma) pv "$1"|tar --lzma -xf - ;;
|
|
||||||
*.xz) pv "$1"|tar -xJf - ;;
|
|
||||||
*.bz2) bunzip2 "$1" ;;
|
|
||||||
*.rar) unrar x "$1" ;;
|
|
||||||
*.gz) gunzip "$1" ;;
|
|
||||||
*.zip) unzip "$1" ;;
|
|
||||||
*.Z) uncompress "$1" ;;
|
|
||||||
*.7z) 7z x "$1" ;;
|
|
||||||
*.lrz) lrzuntar "$1" ;;
|
|
||||||
*) vim "$1"
|
|
||||||
esac
|
|
||||||
else
|
|
||||||
#Edit with vim
|
|
||||||
echo -n "vim? "
|
|
||||||
read a
|
|
||||||
vim "$@"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
if (( $+TMUX )) || [[ "$TERM" = "screen-256color" ]] || [[ "$TERM" = "screen.xterm-256color" ]]; then
|
|
||||||
unset zle_bracketed_paste
|
|
||||||
fi
|
|
||||||
#(( $+TMUX )) && unset zle_bracketed_paste
|
|
||||||
|
|
||||||
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
|
|
||||||
if ex fasd; then
|
|
||||||
eval "$(fasd --init auto)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
#Old config options that are no longer in use
|
|
||||||
#alias pg="pcregrep -M"
|
|
||||||
#if command -v greadlink 2>&1 >/dev/null; then
|
|
||||||
# alias readlink='greadlink'
|
|
||||||
#fi
|
|
||||||
#alias steamo='sudo kill -9 `pidof steam`;sudo unshare -n -- sh -c "ifconfig lo up;sudo -u $USER steam" > /dev/null 2>&1 & disown'
|
|
||||||
#alias bat='upower -i /org/freedesktop/UPower/devices/battery_BAT0| grep -E "state|to\ full|percentage"'
|
|
||||||
#alias aoeu='setxkbmap -layout us -option "'
|
|
||||||
#alias asdf='setxkbmap -layout dvorak -option ""'
|
|
||||||
#alias sudo='sudo -H'
|
|
||||||
echo -ne '[# ]\r'
|
|
||||||
source ~/.zsh-git/lpr/liquidprompt
|
|
||||||
source ~/.zsh-git/omg/base.sh
|
|
||||||
source ~/.zsh-git/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
|
||||||
source ~/.zsh-git/oh-my-git-themes/af-magic.zsh-theme
|
|
||||||
if [[ -f ~/.zsh-git/custom-config/zshrc ]]; then
|
|
||||||
source ~/.zsh-git/custom-config/zshrc
|
|
||||||
fi
|
|
||||||
echo -e '[##]'
|
|
||||||
#zprof
|
|
@ -1,4 +1,3 @@
|
|||||||
set-option -g default-shell /bin/zsh
|
|
||||||
#set -g mouse on
|
#set -g mouse on
|
||||||
set -g status-bg black
|
set -g status-bg black
|
||||||
set -g status-fg white
|
set -g status-fg white
|
||||||
@ -15,10 +14,6 @@ set -g prefix C-a
|
|||||||
bind C-a send-prefix
|
bind C-a send-prefix
|
||||||
unbind C-b
|
unbind C-b
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bind-key -n M-v split-window -h
|
bind-key -n M-v split-window -h
|
||||||
bind-key -n M-V split-window -v
|
bind-key -n M-V split-window -v
|
||||||
bind-key -n M-K swap-pane -s :. -t :.- \; select-pane -t :.-
|
bind-key -n M-K swap-pane -s :. -t :.- \; select-pane -t :.-
|
||||||
@ -35,9 +30,6 @@ bind-key -n M-[ previous-window
|
|||||||
bind-key -n M-] next-window
|
bind-key -n M-] next-window
|
||||||
bind-key -n M-f resize-pane -Z
|
bind-key -n M-f resize-pane -Z
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bind-key H resize-pane -L 5
|
bind-key H resize-pane -L 5
|
||||||
bind-key J resize-pane -D 5
|
bind-key J resize-pane -D 5
|
||||||
bind-key K resize-pane -U 5
|
bind-key K resize-pane -U 5
|
@ -2,23 +2,22 @@
|
|||||||
if has('conceal')
|
if has('conceal')
|
||||||
set conceallevel=2 concealcursor=i
|
set conceallevel=2 concealcursor=i
|
||||||
endif
|
endif
|
||||||
let g:formatdef_my_custom_cpp = '"astyle --mode=cpp -xc --style=google -j -s2 -xG -S -K -N -xn -xl -n -p -H"'
|
"let g:formatdef_my_custom_cpp = '"astyle --mode=cpp -xc --style=google -j -s2 -xG -S -K -N -xn -xl -n -p -H"'
|
||||||
let g:formatters_cpp = ['my_custom_cpp']
|
"let g:formatters_cpp = ['my_custom_cpp']
|
||||||
let g:formatdef_my_custom_java = '"astyle --mode=java -xc --style=google -j -s2 -xG -S -K -N -xn -xl -n -p -H"'
|
"let g:formatdef_my_custom_java = '"astyle --mode=java -xc --style=google -j -s2 -xG -S -K -N -xn -xl -n -p -H"'
|
||||||
let g:formatters_java = ['my_custom_java']
|
"let g:formatters_java = ['my_custom_java']
|
||||||
let g:UltiSnipsUsePythonVersion=3
|
|
||||||
command! WW %!sudo tee > /dev/null %
|
command! WW %!sudo tee > /dev/null %
|
||||||
"TODO: Fix this
|
"TODO: Fix this
|
||||||
"let g:rbpt_loadcmd_toggle = 1
|
"let g:rbpt_loadcmd_toggle = 1
|
||||||
let g:indent_guides_auto_colors = 0
|
"let g:indent_guides_auto_colors = 0
|
||||||
"Required for CSC216, not needed for current classes
|
|
||||||
"autocmd FileType java set shiftwidth=3 tabstop=3 softtabstop=3 expandtab
|
|
||||||
"au FileType twig let b:AutoPairs['%']='%'
|
|
||||||
autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd guibg=darkgrey ctermbg=darkgrey
|
autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd guibg=darkgrey ctermbg=darkgrey
|
||||||
autocmd VimEnter,Colorscheme * :hi IndentGuidesEven guibg=grey ctermbg=grey
|
autocmd VimEnter,Colorscheme * :hi IndentGuidesEven guibg=grey ctermbg=grey
|
||||||
|
autocmd FileType yaml.ansible setlocal ts=2 sts=2 sw=2 expandtab noautoindent
|
||||||
|
autocmd FileType php let b:AutoPairs = AutoPairsDefine({'<?' : '?>', '<?php': '?>'})
|
||||||
|
autocmd FileType html.twig let b:AutoPairs = AutoPairsDefine({'{{' : '}}', '{%': '%}'})
|
||||||
filetype plugin on
|
filetype plugin on
|
||||||
set grepprg=grep\ -nH\ $*
|
set grepprg=grep\ -nH\ $*
|
||||||
let g:tex_flavor='latex'
|
"let g:tex_flavor='latex'
|
||||||
|
|
||||||
"match Error /\s\+$/
|
"match Error /\s\+$/
|
||||||
" Basic, very important mappings {
|
" Basic, very important mappings {
|
||||||
@ -33,81 +32,79 @@ let g:tex_flavor='latex'
|
|||||||
vnoremap j gj
|
vnoremap j gj
|
||||||
vnoremap k gk
|
vnoremap k gk
|
||||||
"Horizontal
|
"Horizontal
|
||||||
nnoremap Y y$
|
noremap H ^
|
||||||
nnoremap H ^
|
|
||||||
nnoremap L $
|
nnoremap L $
|
||||||
vnoremap L $h
|
vnoremap L $h
|
||||||
vnoremap H ^
|
|
||||||
|
nnoremap Y y$
|
||||||
"Move to end of line
|
"Move to end of line
|
||||||
inoremap jk <End>
|
inoremap jk <End>
|
||||||
inoremap kj <End>
|
inoremap kj <End>
|
||||||
"Move to last character of last line
|
"Move to last character of last line
|
||||||
nnoremap G G$
|
noremap G G$
|
||||||
vnoremap G G$
|
noremap G G$
|
||||||
" }
|
" }
|
||||||
" Buffers {
|
" Buffers {
|
||||||
"Control-key movement
|
"Control-key movement
|
||||||
nnoremap <C-h> <C-w>h
|
noremap <C-h> <C-w>h
|
||||||
nnoremap <C-j> <C-w>j
|
noremap <C-j> <C-w>j
|
||||||
nnoremap <C-k> <C-w>k
|
noremap <C-k> <C-w>k
|
||||||
nnoremap <C-l> <C-w>l
|
noremap <C-l> <C-w>l
|
||||||
"Arrow keys
|
"Arrow keys
|
||||||
nnoremap <Up> <C-w>w
|
noremap <Up> <C-w>w
|
||||||
nnoremap <Down> <C-w>W
|
noremap <Down> <C-w>W
|
||||||
nnoremap <Left> :bp<CR>
|
noremap <Left> :bp<CR>
|
||||||
nnoremap <Right> :bn<CR>
|
noremap <Right> :bn<CR>
|
||||||
"Vertical and horizontal split
|
"Vertical and horizontal split
|
||||||
nnoremap <C-w>\| <C-w>v<C-w>l
|
noremap <C-w>\| <C-w>v<C-w>l
|
||||||
nnoremap <C-w>- <C-w>s<C-w>j
|
noremap <C-w>- <C-w>s<C-w>j
|
||||||
"Close buffer
|
"Close buffer
|
||||||
nnoremap <C-d> <C-w>q
|
"noremap <C-d> <C-w>q
|
||||||
"Fullscreen buffer
|
"Fullscreen buffer
|
||||||
nnoremap <C-w>z <C-w>_<C-w>\|
|
noremap <C-w>z <C-w>_<C-w>\|
|
||||||
"Go to last buffer
|
"Go to last buffer
|
||||||
nnoremap <Leader><Leader> <C-^>
|
noremap <Leader><Leader> <C-^>
|
||||||
" }
|
" }
|
||||||
" Misc {
|
" Misc {
|
||||||
vnoremap <silent> * :call VisualSelection('f')<CR>
|
vnoremap <silent> * :call VisualSelection('f')<CR>
|
||||||
vnoremap <silent> # :call VisualSelection('b')<CR>
|
vnoremap <silent> # :call VisualSelection('b')<CR>
|
||||||
vnoremap ; :
|
vnoremap ; :
|
||||||
nnoremap ! :!
|
|
||||||
vnoremap < <gv
|
vnoremap < <gv
|
||||||
vnoremap > >gv
|
vnoremap > >gv
|
||||||
|
noremap ! :!
|
||||||
"Disable F1
|
"Disable F1
|
||||||
nnoremap <F1> <nop>
|
noremap <F1> <nop>
|
||||||
inoremap <F1> <nop>
|
noremap! <F1> <nop>
|
||||||
vnoremap <F1> <nop>
|
|
||||||
"F2 toggle paste
|
"F2 toggle paste
|
||||||
nnoremap <F2> :set invpaste<CR>
|
noremap <F2> :set invpaste<CR>
|
||||||
"Better searching
|
"Better searching
|
||||||
nnoremap / /\v
|
noremap / /\v
|
||||||
vnoremap / /\v
|
|
||||||
"Addition and subtraction
|
"Addition and subtraction
|
||||||
nnoremap + <C-a>
|
"nnoremap + <C-a>
|
||||||
nnoremap - <C-x>
|
"nnoremap - <C-x>
|
||||||
"Backspace remove highlights
|
"Backspace remove highlights
|
||||||
nnoremap <BS> :nohlsearch<CR>g<C-g>zo
|
noremap <BS> :nohlsearch<CR>g<C-g>
|
||||||
"Better save
|
"Better save
|
||||||
nnoremap <Enter> :up<CR>:silent! call sy#start()<CR>
|
nnoremap <Enter> :up<CR>
|
||||||
"Unmap Q
|
"Unmap Q
|
||||||
nnoremap Q <Nop>
|
noremap Q <Nop>
|
||||||
" }
|
" }
|
||||||
" }
|
" }
|
||||||
" Plugin mappings {
|
" Plugin mappings {
|
||||||
"Easymotion
|
"Easymotion
|
||||||
map , <Plug>(easymotion-prefix)
|
map , <Plug>(easymotion-prefix)
|
||||||
"Ctrl-p
|
"Ctrl-p
|
||||||
nnoremap <Leader><C-p> :CtrlPFunky<CR>
|
"nnoremap <Leader><C-p> :CtrlPFunky<CR>
|
||||||
"Gundo
|
"Gundo
|
||||||
nnoremap <F5> :GundoToggle<CR>
|
"nnoremap <F5> :GundoToggle<CR>
|
||||||
"Easytags
|
"Easytags
|
||||||
"nnoremap <Leader><Space> :CtrlPTag<CR>
|
"nnoremap <Leader><Space> :CtrlPTag<CR>
|
||||||
"Replacing easytags with ctrl p buffer
|
"Replacing easytags with ctrl p buffer
|
||||||
nnoremap <Leader><Space> :CtrlPBuffer<CR>
|
"nnoremap <Leader><Space> :CtrlPBuffer<CR>
|
||||||
"Tagbar
|
"Tagbar
|
||||||
"nnoremap <Leader><Space> :Tagbar<CR>
|
"nnoremap <Leader><Space> :Tagbar<CR>
|
||||||
"Add a bundle from clipboard
|
"Add a bundle from clipboard
|
||||||
nnoremap <Leader>bun G?Plug <CR>yyjp$hdi'"+gPo " \| <Esc>"+gp<Esc>:nohlsearch<CR>:up<CR>:PlugInstall
|
"nnoremap <Leader>bun G?Plug <CR>yyjp$hdi'"+gPo " \| <Esc>"+gp<Esc>:nohlsearch<CR>:up<CR>:PlugInstall
|
||||||
"Automatic if/else/for/while wrappers
|
"Automatic if/else/for/while wrappers
|
||||||
nnoremap <Leader>if m"Oif(){<Esc>jo}<Esc>`"v><Esc>k^wa
|
nnoremap <Leader>if m"Oif(){<Esc>jo}<Esc>`"v><Esc>k^wa
|
||||||
nnoremap <Leader>else m"kAelse{<Esc>jo}<Esc>`"v><Esc>
|
nnoremap <Leader>else m"kAelse{<Esc>jo}<Esc>`"v><Esc>
|
||||||
@ -121,8 +118,12 @@ let g:tex_flavor='latex'
|
|||||||
vnoremap <Leader>rm <Esc>`<<Esc>kdd`>jddgv<<Esc>
|
vnoremap <Leader>rm <Esc>`<<Esc>kdd`>jddgv<<Esc>
|
||||||
" }
|
" }
|
||||||
" Trial mappings {
|
" Trial mappings {
|
||||||
nnoremap <Leader>o m`o<Esc>``
|
"nnoremap <Leader>o m`o<Esc>``
|
||||||
nnoremap <Leader>O m`O<Esc>``
|
"nnoremap <Leader>O m`O<Esc>``
|
||||||
|
" Always search in the forward direction
|
||||||
|
nnoremap # #/<CR><C-o>
|
||||||
|
noremap <expr> n (v:searchforward ? 'n' : 'N')
|
||||||
|
noremap <expr> N (v:searchforward ? 'N' : 'n')
|
||||||
" }
|
" }
|
||||||
|
|
||||||
|
|
||||||
@ -141,19 +142,15 @@ let g:tex_flavor='latex'
|
|||||||
set conceallevel=0
|
set conceallevel=0
|
||||||
" }
|
" }
|
||||||
" Misc {
|
" Misc {
|
||||||
set tabstop=2 shiftwidth=2 expandtab
|
set tabstop=2 softtabstop=2 shiftwidth=2 expandtab
|
||||||
set tags=./tags;/
|
set tags=./tags;/
|
||||||
set wildmode=longest,list,full
|
set wildmode=longest,list,full
|
||||||
set formatoptions-=r
|
set formatoptions-=rot
|
||||||
set formatoptions-=o
|
|
||||||
set diffopt+=iwhite
|
set diffopt+=iwhite
|
||||||
set noesckeys
|
set noesckeys
|
||||||
set shiftwidth=2
|
|
||||||
set tabstop=2
|
|
||||||
set modeline
|
set modeline
|
||||||
set softtabstop=2
|
|
||||||
set expandtab
|
set expandtab
|
||||||
set history=1000
|
set history=2048
|
||||||
set hidden
|
set hidden
|
||||||
"set cursorline
|
"set cursorline
|
||||||
set incsearch
|
set incsearch
|
||||||
@ -165,8 +162,7 @@ let g:tex_flavor='latex'
|
|||||||
set backup
|
set backup
|
||||||
set backupdir=~/.vim/backup
|
set backupdir=~/.vim/backup
|
||||||
set directory=~/.vim/tmp
|
set directory=~/.vim/tmp
|
||||||
set undolevels=1000
|
set undolevels=2048
|
||||||
set history=500
|
|
||||||
set ttyfast
|
set ttyfast
|
||||||
set fileformat=unix
|
set fileformat=unix
|
||||||
set encoding=utf-8
|
set encoding=utf-8
|
||||||
@ -174,7 +170,6 @@ let g:tex_flavor='latex'
|
|||||||
set foldmethod=indent
|
set foldmethod=indent
|
||||||
set foldnestmax=10
|
set foldnestmax=10
|
||||||
set foldlevel=2
|
set foldlevel=2
|
||||||
set relativenumber
|
|
||||||
set number
|
set number
|
||||||
set background=dark
|
set background=dark
|
||||||
set t_Co=256
|
set t_Co=256
|
||||||
@ -182,76 +177,54 @@ let g:tex_flavor='latex'
|
|||||||
set nocompatible
|
set nocompatible
|
||||||
set ignorecase
|
set ignorecase
|
||||||
set textwidth=0
|
set textwidth=0
|
||||||
|
set path+=**
|
||||||
syntax on
|
syntax on
|
||||||
" }
|
" }
|
||||||
|
|
||||||
|
"netrw
|
||||||
|
let g:netrw_liststyle = 3
|
||||||
|
let g:netrw_banner = 0
|
||||||
|
let g:netrw_browse_split = 4
|
||||||
|
let g:netrw_winsize = 25
|
||||||
|
"lacheck does not work
|
||||||
|
let b:ale_linters = {'tex': [ "alex", "chktex", "proselint", "redpen", "vale", "write-good" ]}
|
||||||
"Polyglot conflicts with another latex editor
|
"Polyglot conflicts with another latex editor
|
||||||
let g:polyglot_disabled = ['latex']
|
let g:polyglot_disabled = ['latex']
|
||||||
"Symfony
|
|
||||||
let g:symfony_app_console_caller="php"
|
|
||||||
let g:symfony_app_console_path="bin/console"
|
|
||||||
"Signify
|
"Signify
|
||||||
let g:signify_vcs_list = [ 'git', 'svn' ]
|
let g:signify_vcs_list = [ 'git', 'svn' ]
|
||||||
let g:signify_difftool = 'diff'
|
let g:signify_difftool = 'diff'
|
||||||
"CtrlP
|
"CtrlP
|
||||||
let g:ctrlp_root_markers = ['.cproot']
|
"let g:ctrlp_root_markers = ['.cproot']
|
||||||
let g:ctrlp_custom_ignore = {
|
"let g:ctrlp_custom_ignore = {
|
||||||
\ 'dir': '\v[\/](\.git|\.hg|\.svn|vendor)$',
|
" \ 'dir': '\v[\/](\.git|\.hg|\.svn|vendor)$',
|
||||||
\ 'file': '\v\.(exe|so|dll|class)$',
|
" \ 'file': '\v\.(exe|so|dll|class)$',
|
||||||
\ 'link': 'SOME_BAD_SYMBOLIC_LINKS',
|
" \ 'link': 'SOME_BAD_SYMBOLIC_LINKS',
|
||||||
\ }
|
" \ }
|
||||||
let g:ctrlp_extensions=['funky']
|
"let g:ycm_show_diagnostics_ui=0
|
||||||
"Airline
|
"let g:ycm_path_to_python_interpreter='/usr/bin/python2.7'
|
||||||
let g:airline_left_sep='▶'
|
|
||||||
let g:airline_right_sep='◀'
|
|
||||||
let g:airline#extensions#syntastic#enabled=0
|
|
||||||
let g:ycm_show_diagnostics_ui=0
|
|
||||||
let g:ycm_path_to_python_interpreter='/usr/bin/python2.7'
|
|
||||||
"let g:syntastic_cpp_compiler = 'clang++'
|
|
||||||
"let g:syntastic_cpp_compiler_options = ' -std=c++11 -stdlib=libc++'
|
|
||||||
let g:syntastic_cpp_compiler_options = ' -std=c++11'
|
|
||||||
let g:airline#extensions#whitespace#enabled=0
|
|
||||||
let g:airline#extensions#whitespace#show_message=0
|
|
||||||
let g:airline#extensions#tmuxline#enabled=1
|
|
||||||
"Autoformat
|
|
||||||
let g:formatdef_my_custom_php = '"astyle --mode=php -xc -A10 -j -s2 -xG -S -K -N -xn -xl -n"'
|
|
||||||
let g:formatdef_my_custom_cpp = '"astyle --mode=c -xc -A10 -j -s2 -xG -S -K -N -xn -xl -n"'
|
|
||||||
let g:formatter_cpp = ['formatdef_my_custom_cpp']
|
|
||||||
let g:formatter_php = ['formatdef_my_custom_php']
|
|
||||||
"let g:formatprg_cpp="astyle"
|
"let g:formatprg_cpp="astyle"
|
||||||
"let g:formatprg_args_expr_cpp=" --mode=c --style=1tbs -xe -k1 -j"
|
"let g:formatprg_args_expr_cpp=" --mode=c --style=1tbs -xe -k1 -j"
|
||||||
" These flags don't work for some reason
|
" These flags don't work for some reason
|
||||||
" -xn -xc -xl -S
|
" -xn -xc -xl -S
|
||||||
"Syntastic
|
|
||||||
let g:syntastic_java_javac_classpath = "~/applications/java/junit-4.12.jar:~/applications/java/hamcrest-core-1.3.jar:~/wpilib/java/current/lib/WPILib.jar:~/wpilib/java/current/lib/NetworkTables.jar:~/git/ford-java/src"
|
|
||||||
"IndentGuides
|
|
||||||
let g:indent_guides_start_level=1
|
|
||||||
let g:indent_guides_guide_size=1
|
|
||||||
let g:indent_guides_enable_on_vim_startup=1
|
|
||||||
let g:php_refactor_command='php /usr/local/bin/refactor.phar'
|
|
||||||
function! g:UltiSnips_Complete()
|
|
||||||
call UltiSnips#ExpandSnippet()
|
|
||||||
if g:ulti_expand_res == 0
|
|
||||||
if pumvisible()
|
|
||||||
return "\<C-n>"
|
|
||||||
else
|
|
||||||
call UltiSnips#JumpForwards()
|
|
||||||
if g:ulti_jump_forwards_res == 0
|
|
||||||
return "\<TAB>"
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
return ""
|
|
||||||
endfunction
|
|
||||||
"inoremap <expr><Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
|
"inoremap <expr><Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
|
||||||
"inoremap <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
|
"inoremap <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
|
||||||
let g:UltiSnipsJumpForwardTrigger="<C-S-Q>"
|
"let g:UltiSnipsUsePythonVersion=3
|
||||||
let g:UltiSnipsExpandTrigger="<S-Tab>"
|
|
||||||
let g:UltiSnipsListSnippets="<C-e>"
|
"let g:UltiSnipsJumpForwardTrigger="<Tab>"
|
||||||
let g:UltiSnipsEditSplit="vertical"
|
"let g:UltiSnipsExpandTrigger="<S-Tab>"
|
||||||
let g:ycm_key_list_select_completion = []
|
let g:UltiSnipsExpandTrigger = "<tab>"
|
||||||
inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
|
let g:UltiSnipsJumpForwardTrigger = "<tab>"
|
||||||
let loaded_matchit=1
|
let g:UltiSnipsJumpBackwardTrigger = "<s-tab>"
|
||||||
|
let g:SuperTabDefaultCompletionType = '<C-n>'
|
||||||
|
|
||||||
|
let g:AutoPairs = {'(':')', '[':']', '{':'}',"'":"'",'"':'"', '`':'`'}
|
||||||
|
au FileType php let b:AutoPairs = AutoPairsDefine({'<?' : '?>', '<?php': '?>'})
|
||||||
|
au FileType tex,latex,context,plaintex let b:AutoPairs = AutoPairsDefine({'$': '$'})
|
||||||
|
|
||||||
|
"let g:UltiSnipsExpandTrigger="<C-n>"
|
||||||
|
"let g:UltiSnipsListSnippets="<C-e>"
|
||||||
|
"let g:UltiSnipsEditSplit="vertical"
|
||||||
|
"inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
|
||||||
filetype off
|
filetype off
|
||||||
if has("win32")
|
if has("win32")
|
||||||
call plug#begin('~/vimfiles/plugged')
|
call plug#begin('~/vimfiles/plugged')
|
||||||
@ -259,11 +232,11 @@ else
|
|||||||
call plug#begin('~/.vim/plugged')
|
call plug#begin('~/.vim/plugged')
|
||||||
endif
|
endif
|
||||||
" Code writing {
|
" Code writing {
|
||||||
Plug 'https://gitea.austenwares.com/vim/vim-autoformat', { 'on': 'Autoformat'}
|
"Plug 'https://gitea.austenwares.com/vim/vim-autoformat', { 'on': 'Autoformat'}
|
||||||
"Adds autoformat command | https://github.com/Chiel92/vim-autoformat
|
"Adds autoformat command | https://github.com/Chiel92/vim-autoformat
|
||||||
Plug 'https://gitea.austenwares.com/vim/vim-surround'
|
Plug 'https://gitea.austenwares.com/vim/vim-surround'
|
||||||
"Surround selection in ({\"' or HTML tags | https://github.com/tpope/vim-surround
|
"Surround selection in ({\"' or HTML tags | https://github.com/tpope/vim-surround
|
||||||
Plug 'https://gitea.austenwares.com/vim/syntastic'
|
"Plug 'https://gitea.austenwares.com/vim/syntastic'
|
||||||
"Syntax checker | https://github.com/scrooloose/syntastic
|
"Syntax checker | https://github.com/scrooloose/syntastic
|
||||||
Plug 'https://gitea.austenwares.com/vim/nerdtree', { 'on': 'NERDTreeToggle' }
|
Plug 'https://gitea.austenwares.com/vim/nerdtree', { 'on': 'NERDTreeToggle' }
|
||||||
"File browser | https://github.com/scrooloose/nerdtree
|
"File browser | https://github.com/scrooloose/nerdtree
|
||||||
@ -271,9 +244,9 @@ endif
|
|||||||
"Move around quickly in a document | https://github.com/Lokaltog/vim-easymotion
|
"Move around quickly in a document | https://github.com/Lokaltog/vim-easymotion
|
||||||
"Plug 'https://gitea.austenwares.com/vim/gundo.vim', { 'on': 'GundoToggle' }
|
"Plug 'https://gitea.austenwares.com/vim/gundo.vim', { 'on': 'GundoToggle' }
|
||||||
"Visual undo | https://github.com/sjl/gundo.vim
|
"Visual undo | https://github.com/sjl/gundo.vim
|
||||||
Plug 'https://gitea.austenwares.com/vim/vim-exchange'
|
"Plug 'https://gitea.austenwares.com/vim/vim-exchange'
|
||||||
"Exchange two selections of text | https://github.com/tommcdo/vim-exchange
|
"Exchange two selections of text | https://github.com/tommcdo/vim-exchange
|
||||||
Plug 'https://gitea.austenwares.com/vim/vim-repeat'
|
"Plug 'https://gitea.austenwares.com/vim/vim-repeat'
|
||||||
"Repeat last tpope command with . | https://github.com/tpope/vim-repeat
|
"Repeat last tpope command with . | https://github.com/tpope/vim-repeat
|
||||||
Plug 'https://gitea.austenwares.com/vim/vim-fugitive'
|
Plug 'https://gitea.austenwares.com/vim/vim-fugitive'
|
||||||
"Great Vim-Git compatibility | https://github.com/tpope/vim-fugitive
|
"Great Vim-Git compatibility | https://github.com/tpope/vim-fugitive
|
||||||
@ -283,6 +256,8 @@ endif
|
|||||||
"Quickly make tables in vim | https://github.com/godlygeek/tabular
|
"Quickly make tables in vim | https://github.com/godlygeek/tabular
|
||||||
Plug 'https://gitea.austenwares.com/vim/UltiSnips'
|
Plug 'https://gitea.austenwares.com/vim/UltiSnips'
|
||||||
"Adds snippet support | https://github.com/sirver/UltiSnips
|
"Adds snippet support | https://github.com/sirver/UltiSnips
|
||||||
|
"Plug 'https://github.com/ajh17/VimCompletesMe'
|
||||||
|
"Supposed to be a good tab plugin
|
||||||
Plug 'https://gitea.austenwares.com/vim/vim-snippets'
|
Plug 'https://gitea.austenwares.com/vim/vim-snippets'
|
||||||
"Add snippets | https://github.com/honza/vim-snippets
|
"Add snippets | https://github.com/honza/vim-snippets
|
||||||
Plug 'https://gitea.austenwares.com/vim/eregex.vim'
|
Plug 'https://gitea.austenwares.com/vim/eregex.vim'
|
||||||
@ -291,11 +266,11 @@ endif
|
|||||||
"Git information inline | https://github.com/mhinz/vim-signify
|
"Git information inline | https://github.com/mhinz/vim-signify
|
||||||
Plug 'https://gitea.austenwares.com/vim/auto-pairs'
|
Plug 'https://gitea.austenwares.com/vim/auto-pairs'
|
||||||
"Automatic pairs | https://github.com/jiangmiao/auto-pairs
|
"Automatic pairs | https://github.com/jiangmiao/auto-pairs
|
||||||
Plug 'https://gitea.austenwares.com/vim/YouCompleteMe'
|
"Plug 'https://gitea.austenwares.com/vim/YouCompleteMe'
|
||||||
"Autocompletion | https://github.com/Valloric/YouCompleteMe
|
"Autocompletion | https://github.com/Valloric/YouCompleteMe
|
||||||
"Plug 'https://gitea.austenwares.com/vim/vim-java-getset.git'
|
"Plug 'https://gitea.austenwares.com/vim/vim-java-getset.git'
|
||||||
"Java getters and setters| https://gitea.austenwares.com/vim/vim-java-getset.git
|
"Java getters and setters| https://gitea.austenwares.com/vim/vim-java-getset.git
|
||||||
Plug 'https://gitea.austenwares.com/vim/double-tap.git'
|
"Plug 'https://gitea.austenwares.com/vim/double-tap.git'
|
||||||
"Double tap for comments
|
"Double tap for comments
|
||||||
" }
|
" }
|
||||||
" Style {
|
" Style {
|
||||||
@ -309,24 +284,26 @@ endif
|
|||||||
"256 color vim in terminal | https://github.com/godlygeek/csapprox
|
"256 color vim in terminal | https://github.com/godlygeek/csapprox
|
||||||
" }
|
" }
|
||||||
" Syntax {
|
" Syntax {
|
||||||
Plug 'https://gitea.austenwares.com/vim/vimtex'
|
"Plug 'https://gitea.austenwares.com/vim/vimtex'
|
||||||
"Latex | https://github.com/lervag/vimtex
|
"Latex | https://github.com/lervag/vimtex
|
||||||
Plug 'https://gitea.austenwares.com/vim/vim-polyglot'
|
Plug 'https://gitea.austenwares.com/vim/vim-polyglot'
|
||||||
"Many languages | https://github.com/sheerun/vim-polyglot
|
"Many languages | https://github.com/sheerun/vim-polyglot
|
||||||
Plug 'https://gitea.austenwares.com/vim/vim-vimperator'
|
"Plug 'https://gitea.austenwares.com/vim/vim-vimperator'
|
||||||
"Vimperator for vim | https://github.com/superbrothers/vim-vimperator
|
"Vimperator for vim | https://github.com/superbrothers/vim-vimperator
|
||||||
Plug 'https://gitea.austenwares.com/vim/i3-vim-syntax'
|
"Plug 'https://gitea.austenwares.com/vim/i3-vim-syntax'
|
||||||
"i3 syntax | https://github.com/PotatoesMaster/i3-vim-syntax
|
"i3 syntax | https://github.com/PotatoesMaster/i3-vim-syntax
|
||||||
" }
|
" }
|
||||||
" Misc {
|
" Misc {
|
||||||
Plug 'https://gitea.austenwares.com/vim/flappyvird-vim', { 'on': [] }
|
"Plug 'https://gitea.austenwares.com/vim/flappyvird-vim', { 'on': [] }
|
||||||
"The amazing Flappy Bird game | https://github.com/mattn/flappyvird-vim
|
"The amazing Flappy Bird game | https://github.com/mattn/flappyvird-vim
|
||||||
Plug 'https://gitea.austenwares.com/vim/vim-gnupg'
|
"Plug 'https://gitea.austenwares.com/vim/vim-gnupg'
|
||||||
"GPG support | https://github.com/jamessan/vim-gnupg
|
"GPG support | https://github.com/jamessan/vim-gnupg
|
||||||
Plug 'https://gitea.austenwares.com/vim/vim-bracketed-paste'
|
"Plug 'https://gitea.austenwares.com/vim/vim-bracketed-paste'
|
||||||
"Automatic :set paste funcationality | https://github.com/ConradIrwin/vim-bracketed-paste
|
"Automatic :set paste funcationality | https://github.com/ConradIrwin/vim-bracketed-paste
|
||||||
Plug 'https://gitea.austenwares.com/vim/HiCursorWords'
|
"Plug 'https://gitea.austenwares.com/vim/HiCursorWords'
|
||||||
"Highlight word under cursor automatically | http://www.vim.org/scripts/script.php?script_id=4306
|
"Highlight word under cursor automatically | http://www.vim.org/scripts/script.php?script_id=4306
|
||||||
|
"Plug 'https://github.com/chrisbra/NrrwRgn'
|
||||||
|
"Narrow region | https://github.com/chrisbra/NrrwRgn
|
||||||
" }
|
" }
|
||||||
" Unused {
|
" Unused {
|
||||||
"Plug 'https://gitea.austenwares.com/vim/mirror.vim'
|
"Plug 'https://gitea.austenwares.com/vim/mirror.vim'
|
||||||
@ -335,6 +312,8 @@ endif
|
|||||||
" Staging {
|
" Staging {
|
||||||
"Plug 'https://gitea.austenwares.com/vim/vim-symfony'
|
"Plug 'https://gitea.austenwares.com/vim/vim-symfony'
|
||||||
"Plug 'dracula/vim'
|
"Plug 'dracula/vim'
|
||||||
|
Plug 'https://gitea.austenwares.com/vim/ale'
|
||||||
|
Plug 'https://gitea.austenwares.com/vim/supertab'
|
||||||
|
|
||||||
"Plug 'idanarye/vim-vebugger'
|
"Plug 'idanarye/vim-vebugger'
|
||||||
"Debugger | https://github.com/idanarye/vim-vebugger
|
"Debugger | https://github.com/idanarye/vim-vebugger
|
||||||
@ -345,8 +324,7 @@ if exists("+undofile")
|
|||||||
if isdirectory($HOME . '/.vim/undo')==0
|
if isdirectory($HOME . '/.vim/undo')==0
|
||||||
:silent !mkdir -p ~/.vim/undo > /dev/null 2>&1
|
:silent !mkdir -p ~/.vim/undo > /dev/null 2>&1
|
||||||
endif
|
endif
|
||||||
set undodir=./.vim-undo//
|
set undodir=~/.vim/undo/
|
||||||
set undodir+=~/.vim/undo//
|
|
||||||
set undofile
|
set undofile
|
||||||
endif
|
endif
|
||||||
augroup autosave
|
augroup autosave
|
||||||
@ -362,15 +340,11 @@ augroup vimrcEx
|
|||||||
\ exe "normal g`\"" |
|
\ exe "normal g`\"" |
|
||||||
\ endif
|
\ endif
|
||||||
augroup END
|
augroup END
|
||||||
if has('gui_running')
|
"if has('gui_running')
|
||||||
set guioptions-=T
|
" set guioptions-=T
|
||||||
else
|
"else
|
||||||
set t_Co=256
|
" set t_Co=256
|
||||||
if &term=='xterm' || &term=='screen'
|
"endif
|
||||||
set t_Co=256
|
|
||||||
endif
|
|
||||||
"colorscheme torte
|
|
||||||
endif
|
|
||||||
silent! colorscheme fruity
|
silent! colorscheme fruity
|
||||||
function! Initialize()
|
function! Initialize()
|
||||||
if has("win32")
|
if has("win32")
|
||||||
@ -386,27 +360,16 @@ function! Initialize()
|
|||||||
silent !powershell -command "& { iwr https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim -OutFile plug.vim }"
|
silent !powershell -command "& { iwr https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim -OutFile plug.vim }"
|
||||||
silent! so ~/_vimrc
|
silent! so ~/_vimrc
|
||||||
else
|
else
|
||||||
silent !mkdir -p ~/.vim/autoload
|
silent !mkdir -p ~/.vim/autoload ~/.vim/plugin ~/.vim/backup ~/.vim/undo ~/.vim/tmp
|
||||||
silent !mkdir -p ~/.vim/plugin
|
|
||||||
silent !mkdir -p ~/.vim/backup
|
|
||||||
silent !mkdir -p ~/.vim/undo
|
|
||||||
silent !mkdir -p ~/.vim/tmp
|
|
||||||
silent !curl -fLo ~/.vim/autoload/plug.vim https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
silent !curl -fLo ~/.vim/autoload/plug.vim https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
||||||
silent! so ~/.vimrc
|
silent! so ~/.vimrc
|
||||||
endif
|
endif
|
||||||
silent! PlugClean!
|
silent !vim +"PlugClean" +"PlugInstall" +"PlugUpdate" +"qa"
|
||||||
silent! PlugUpdate
|
|
||||||
silent! PlugInstall
|
|
||||||
q
|
q
|
||||||
endfunction
|
endfunction
|
||||||
if !exists('g:ycm_semantic_triggers')
|
"set guifont=jmk\ Neep\ 10
|
||||||
let g:ycm_semantic_triggers = {}
|
set guifont="Monospace 10"
|
||||||
endif
|
"inoremap <Tab> <C-R>=g:UltiSnips_Complete()<cr>
|
||||||
let g:ycm_semantic_triggers.tex = [
|
"map <unique> <buffer> <LocalLeader>b <Plug>JavagetsetInsertBothGetterSetter
|
||||||
\ 're!\\[A-Za-z]*(ref|cite)[A-Za-z]*([^]]*])?{([^}]*, ?)*'
|
"map <Leader>a O<Esc>:Autoformat<CR>:v/\S/d<CR>:nohlsearch<CR>
|
||||||
\ ]
|
"inoremap <expr> <CR> getline(".") =~ '^\s*\([#"]\)\s*$' ? "\<C-u>" : "\<CR>"
|
||||||
set guifont=Gohu\ GohuFont
|
|
||||||
inoremap <Tab> <C-R>=g:UltiSnips_Complete()<cr>
|
|
||||||
map <unique> <buffer> <LocalLeader>b <Plug>JavagetsetInsertBothGetterSetter
|
|
||||||
map <Leader>a O<Esc>:Autoformat<CR>:v/\S/d<CR>:nohlsearch<CR>
|
|
||||||
inoremap <expr> <CR> getline(".") =~ '^\s*\([#"]\)\s*$' ? "\<C-u>" : "\<CR>"
|
|
Loading…
Reference in New Issue
Block a user