new layout
This commit is contained in:
parent
005541a96f
commit
1ee7a6234a
17 changed files with 2353 additions and 2 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,2 +0,0 @@
|
||||||
bin/has
|
|
||||||
bin/unseal-vault
|
|
3
.gitmodules
vendored
3
.gitmodules
vendored
|
@ -0,0 +1,3 @@
|
||||||
|
[submodule "zplugin/bin"]
|
||||||
|
path = zplugin/bin
|
||||||
|
url = https://github.com/zdharma/zplugin
|
41
bin/hosts
Executable file
41
bin/hosts
Executable file
|
@ -0,0 +1,41 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Path to your hosts file
|
||||||
|
hostsFile="/etc/hosts"
|
||||||
|
|
||||||
|
# Default IP address for host
|
||||||
|
ip="127.0.0.1"
|
||||||
|
|
||||||
|
# Hostname to add/remove.
|
||||||
|
hostname="$2"
|
||||||
|
|
||||||
|
yell() { echo "$0: $*" >&2; }
|
||||||
|
die() { yell "$*"; exit 111; }
|
||||||
|
try() { "$@" || die "cannot $*"; }
|
||||||
|
|
||||||
|
remove() {
|
||||||
|
if [ -n "$(grep -P "[[:space:]]$hostname" /etc/hosts)" ]; then
|
||||||
|
echo "$hostname found in $hostsFile. Removing now...";
|
||||||
|
try sudo sed -ie "/[[:space:]]$hostname/d" "$hostsFile";
|
||||||
|
else
|
||||||
|
yell "$hostname was not found in $hostsFile";
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
add() {
|
||||||
|
if [ -n "$(grep -P "[[:space:]]$hostname" /etc/hosts)" ]; then
|
||||||
|
yell "$hostname, already exists: $(grep $hostname $hostsFile)";
|
||||||
|
else
|
||||||
|
echo "Adding $hostname to $hostsFile...";
|
||||||
|
try printf "%s\t%s\n" "$ip" "$hostname" | sudo tee -a "$hostsFile" > /dev/null;
|
||||||
|
|
||||||
|
if [ -n "$(grep $hostname /etc/hosts)" ]; then
|
||||||
|
echo "$hostname was added succesfully:";
|
||||||
|
echo "$(grep $hostname /etc/hosts)";
|
||||||
|
else
|
||||||
|
die "Failed to add $hostname";
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
$@
|
21
bin/notify
Executable file
21
bin/notify
Executable file
|
@ -0,0 +1,21 @@
|
||||||
|
#!/usr/bin/php
|
||||||
|
<?php
|
||||||
|
$script = array_shift($_SERVER['argv']);
|
||||||
|
$settings['token'] = 'ayndqf6fdyjo9pua8reusvvb733k1u';
|
||||||
|
$settings['user'] = 'uesmxehx2bcuyv5prfrw39ema2312f';
|
||||||
|
$settings['title'] = array_shift($_SERVER['argv']);
|
||||||
|
$settings['message'] = array_shift($_SERVER['argv']);
|
||||||
|
$settings['priority'] = 1;
|
||||||
|
|
||||||
|
$curl = curl_init("https://api.pushover.net/1/messages.json");
|
||||||
|
|
||||||
|
curl_setopt($curl, CURLOPT_POST, true);
|
||||||
|
curl_setopt($curl, CURLOPT_POSTFIELDS, $settings);
|
||||||
|
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
|
||||||
|
$return = curl_exec($curl);
|
||||||
|
curl_close($curl);
|
||||||
|
|
||||||
|
$json = json_decode($return, true);
|
||||||
|
|
||||||
|
if(isset($json['info'])) echo("Result: ${json['info']}");
|
9
install
Executable file
9
install
Executable file
|
@ -0,0 +1,9 @@
|
||||||
|
#!/bin/bash
|
||||||
|
echo ">> Copying Gitconfig - Please Wait!"
|
||||||
|
sudo cp ${HOME}/.config/dotfiles/toCopy/gitconfig /etc/gitconfig
|
||||||
|
|
||||||
|
echo ">> Copying Gitignore - Please Wait!"
|
||||||
|
sudo cp ${HOME}/.config/dotfiles/toCopy/gitignore /etc/gitignore
|
||||||
|
|
||||||
|
echo ">> Copying SSH Config - Please Wait!"
|
||||||
|
sudo cp ${HOME}/.config/dotfiles/toCopy/sshconfig /etc/ssh/ssh_config
|
102
toCopy/gitconfig
Normal file
102
toCopy/gitconfig
Normal file
|
@ -0,0 +1,102 @@
|
||||||
|
[user]
|
||||||
|
email = nikolasweger@googlemail.com
|
||||||
|
name = Nikolas Weger
|
||||||
|
|
||||||
|
[alias]
|
||||||
|
exec = ! "exec"
|
||||||
|
st = status -sb
|
||||||
|
br = branch -vv
|
||||||
|
bra = branch -vv --all
|
||||||
|
bed = branch --edit-description
|
||||||
|
aa = add --all :/
|
||||||
|
ci = commit -v
|
||||||
|
ca = commit --amend -v
|
||||||
|
save = commit -a -m "Save"
|
||||||
|
co = checkout
|
||||||
|
di = diff
|
||||||
|
dis = diff --stat
|
||||||
|
diw = diff --color-words
|
||||||
|
dic = diff --color-words=.
|
||||||
|
dc = diff --cached
|
||||||
|
dcs = diff --cached --stat
|
||||||
|
dcw = diff --cached --color-words
|
||||||
|
dcc = diff --cached --color-words=.
|
||||||
|
dh = diff HEAD~
|
||||||
|
dhs = diff HEAD~ --stat
|
||||||
|
dhw = diff HEAD~ --color-words
|
||||||
|
dhc = diff HEAD~ --color-words=.
|
||||||
|
grp = grep -C 1
|
||||||
|
ff = merge --ff-only
|
||||||
|
noff = merge --no-ff
|
||||||
|
fa = fetch --all
|
||||||
|
deleted = remote prune --dry-run
|
||||||
|
prunable = ! "pr() { git remote | xargs -L 1 git deleted; }; pr"
|
||||||
|
pruneall = ! "pa() { git remote | xargs -L 1 git remote prune; }; pa"
|
||||||
|
pullff = pull --ff-only
|
||||||
|
pullrb = pull --rebase
|
||||||
|
mirror-remote = ! "mr() { git push \"${2}\" \"refs/remotes/${1}/*:refs/heads/*\" && git remote set-head \"${2}\" -a; }; mr"
|
||||||
|
count = diff --stat "4b825dc642cb6eb9a060e54bf8d69288fbee4904" # hash of empty tree
|
||||||
|
credit = shortlog -sn
|
||||||
|
linecredit = ! "lc() { git ls-tree --name-only -z -r HEAD | xargs -0 -n1 git diff --no-index --numstat /dev/null 2>/dev/null | grep -v '^-' | cut -f 3- | cut -d ' ' -f 3- | xargs -n1 git blame --line-porcelain | grep '^author ' | cut -d ' ' -f 2- | sort | uniq -c | sort -nr; }; lc"
|
||||||
|
cc = rev-list HEAD --count
|
||||||
|
cca = rev-list --all --count
|
||||||
|
lg = log -p
|
||||||
|
gr = log --graph --format=compact # graph
|
||||||
|
grl = log --graph --format=line # graph line
|
||||||
|
grd = log --graph --format=detail # graph detail
|
||||||
|
gra = log --graph --format=compact --all # graph all
|
||||||
|
gral = log --graph --format=line --all # graph all line
|
||||||
|
grad = log --graph --format=detail --all # graph all in detail
|
||||||
|
sf = show --format=fuller
|
||||||
|
sfs = show --format=fuller --stat
|
||||||
|
info = ! "inf() { if git rev-parse ${1} >/dev/null 2>&1; then git cat-file -p $(git rev-parse ${1}); else echo Invalid object; fi }; inf"
|
||||||
|
cleanall = clean -fdx # this is dangerous, so it's intentionally long to type
|
||||||
|
update-submodules = submodule update --init --recursive
|
||||||
|
upgrade-submodules = submodule update --init --remote
|
||||||
|
upgrade-all-submodules = submodule foreach git pull origin master
|
||||||
|
empty-tree-hash = hash-object -t tree /dev/null
|
||||||
|
root = rev-parse --show-toplevel
|
||||||
|
ctags = ! "ctg() { trap \"rm -f .git/tags.$$\" EXIT; ctags --tag-relative -Rf.git/tags.$$ --exclude=.git; mv .git/tags.$$ .git/tags; }; ctg"
|
||||||
|
tar = ! "tar() { git archive --format tar --prefix=\"${PWD##*/}/\" HEAD -o ${1}; }; tar"
|
||||||
|
targz = ! "targz() { git archive --format tar.gz --prefix=\"${PWD##*/}/\" HEAD -o ${1}; }; targz"
|
||||||
|
zip = ! "zip() { git archive --format zip --prefix=\"${PWD##*/}/\" HEAD -o ${1}; }; zip"
|
||||||
|
|
||||||
|
[color]
|
||||||
|
ui = auto
|
||||||
|
|
||||||
|
[color "grep"]
|
||||||
|
match = cyan bold
|
||||||
|
selected = blue
|
||||||
|
context = normal
|
||||||
|
filename = magenta
|
||||||
|
linenumber = green
|
||||||
|
separator = yellow
|
||||||
|
function = blue
|
||||||
|
|
||||||
|
[pretty]
|
||||||
|
line = "%C(auto)%h%d %s %C(yellow)by %C(blue)%an %C(green)%ar"
|
||||||
|
compact = "%C(auto)%h %s %C(green)%ar%n %C(auto)%d%n"
|
||||||
|
detail = "%C(auto)%h %s%n %C(yellow)by %C(blue)%an %C(magenta)<%ae> [%G?] %C(green)%ar%n %C(auto)%d%n"
|
||||||
|
|
||||||
|
[merge]
|
||||||
|
defaultToUpstream = true
|
||||||
|
tool = vimdiff
|
||||||
|
|
||||||
|
[mergetool]
|
||||||
|
keepBackup = false
|
||||||
|
|
||||||
|
[push]
|
||||||
|
default = upstream
|
||||||
|
|
||||||
|
[credential]
|
||||||
|
helper = cache --timeout=3600
|
||||||
|
|
||||||
|
[grep]
|
||||||
|
lineNumber = true
|
||||||
|
|
||||||
|
[advice]
|
||||||
|
detachedHead = false
|
||||||
|
|
||||||
|
[core]
|
||||||
|
excludesfile = /etc/gitignore
|
||||||
|
editor = nano
|
31
toCopy/gitignore
Normal file
31
toCopy/gitignore
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
# Compiled source #
|
||||||
|
###################
|
||||||
|
*.com
|
||||||
|
*.class
|
||||||
|
*.dll
|
||||||
|
*.exe
|
||||||
|
*.o
|
||||||
|
*.so
|
||||||
|
*.pyc
|
||||||
|
|
||||||
|
# Editing tools and IDEs #
|
||||||
|
##########################
|
||||||
|
*.swp
|
||||||
|
*~
|
||||||
|
|
||||||
|
# Logs and databases #
|
||||||
|
######################
|
||||||
|
*.log
|
||||||
|
*.sql
|
||||||
|
*.sqlite
|
||||||
|
|
||||||
|
# OS generated files #
|
||||||
|
######################
|
||||||
|
.DS_Store
|
||||||
|
.DS_Store?
|
||||||
|
._*
|
||||||
|
.Spotlight-V100
|
||||||
|
.Trashes
|
||||||
|
Icon?
|
||||||
|
ehthumbs.db
|
||||||
|
Thumbs.db
|
4
toCopy/sshconfig
Normal file
4
toCopy/sshconfig
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
Host web
|
||||||
|
ForwardX11 yes
|
||||||
|
HostName megumi.eeleater.org
|
||||||
|
User eeleater
|
1
zplugin/bin
Submodule
1
zplugin/bin
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 1ac27be82f1aa8d31bec02116304f8d2586f0995
|
1935
zsh/.zcompdump
Normal file
1935
zsh/.zcompdump
Normal file
File diff suppressed because it is too large
Load diff
20
zsh/.zshrc
Normal file
20
zsh/.zshrc
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
source "$ZDOTDIR/export.zsh"
|
||||||
|
source "$ZDOTDIR/history.zsh"
|
||||||
|
source "$ZDOTDIR/zplugin.zsh"
|
||||||
|
source "/usr/share/fzf/completion.zsh"
|
||||||
|
source "/usr/share/fzf/key-bindings.zsh"
|
||||||
|
source "/usr/share/doc/pkgfile/command-not-found.zsh"
|
||||||
|
|
||||||
|
for file in $ZDOTDIR/functions/*.zsh; do source "$file"; done
|
||||||
|
|
||||||
|
# Use lf to switch directories and bind it to ctrl-o
|
||||||
|
lfcd () {
|
||||||
|
tmp="$(mktemp)"
|
||||||
|
lf -last-dir-path="$tmp" "$@"
|
||||||
|
if test -f "$tmp"; then
|
||||||
|
dir="$(cat "$tmp")"
|
||||||
|
rm -f "$tmp"
|
||||||
|
[ -d "$dir" ] && [ "$dir" != "$(pwd)" ] && cd "$dir"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
bindkey -s '^o' 'lfcd\n'
|
2
zsh/dircolor.zsh
Normal file
2
zsh/dircolor.zsh
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
LS_COLORS='no=00;37:fi=01;34:rs=00;37:di=00;34:ln=00;36:mh=00;37:pi=40;33:so=00;35:do=00;35:bd=40;33;01:cd=40;33;01:or=00;05;37;41:mi=00;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=04;34:st=37;44:ex=00;32:*.cmd=00;33:*.exe=00;33:*.com=00;33:*.btm=00;33:*.bat=00;33:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz=01;31:*.bz2=01;31:*.bzip2=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.apk=01;31:*.gem=01;31:*.jpg=00;35:*.JPG=00;35:*.jpeg=00;35:*.gif=00;35:*.bmp=00;35:*.pbm=00;35:*.pgm=00;35:*.ppm=00;35:*.tga=00;35:*.xbm=00;35:*.xpm=00;35:*.tif=00;35:*.tiff=00;35:*.png=00;35:*.svg=00;35:*.svgz=00;35:*.mng=00;35:*.pcx=00;35:*.dl=00;35:*.xcf=00;35:*.xwd=00;35:*.yuv=00;35:*.cgm=00;35:*.emf=00;35:*.eps=00;35:*.CR2=00;35:*.ico=00;35:*.pdf=00;32:*.ps=00;32:*.txt=00;32:*.html=00;32:*.rst=00;32:*.md=00;32:*.patch=00;32:*.diff=00;32:*.tex=00;32:*.doc=00;32:*.xml=00;32:*.xls=00;32:*.xlsx=00;32:*.doc=00;32:*.docx=00;32:*.ppt=00;32:*.pptx=00;32:*.key=00;32:*.pt=01;32:*.tmpl=01;32:*.in=01;32:*.aac=01;36:*.au=01;36:*.flac=01;36:*.mid=01;36:*.midi=01;36:*.mka=01;36:*.mp3=01;36:*.mpc=01;36:*.ogg=01;36:*.ra=01;36:*.wav=01;36:*.m4a=01;36:*.axa=01;36:*.oga=01;36:*.spx=01;36:*.xspf=01;36:*.mov=01;36:*.mpg=01;36:*.mpeg=01;36:*.m2v=01;36:*.mkv=01;36:*.ogm=01;36:*.mp4=01;36:*.m4v=01;36:*.mp4v=01;36:*.vob=01;36:*.qt=01;36:*.nuv=01;36:*.wmv=01;36:*.asf=01;36:*.rm=01;36:*.rmvb=01;36:*.flc=01;36:*.avi=01;36:*.fli=01;36:*.flv=01;36:*.gl=01;36:*.m2ts=01;36:*.divx=01;36:*.webm=01;36:*.axv=01;36:*.anx=01;36:*.ogv=01;36:*.ogx=01;36:*.conf=00;36:*.cnf=00;36:*.cfg=00;36:*.ini=00;36:*.properties=00;36:*.yaml=00;36:*.vcl=00;36:*.c=00;33:*.cpp=00;33:*.py=00;33:*.coffesscript=00;33:*.js=00;33:*.rb=00;33:*.sh=00;33:*.zsh=00;33:*.env=00;33:*.bash=00;33:*.php=00;33:*.java=00;33:*.zcml=00;33:*.db=00;32:*.sql=00;32:*.json=00;32:*.plist=00;32:*.fs=00;32:*.tex=01;37:*.rdf=01;37:*.owl=01;37:*.n3=01;37:*.ttl=01;37:*.nt=01;37:*.torrent=01;37:*.xml=01;37:*Makefile=01;37:*Rakefile=01;37:*build.xml=01;37:*rc=01;37:*.nfo=01;37:*README=01;37:*README.txt=01;37:*readme.txt=01;37:*README.markdown=01;37:*README.md=01;37:*.ini=01;37:*.yml=01;37:*.cfg=01;37:*.conf=01;37:*.c=01;37:*.cpp=01;37:*.cc=01;37:*.log=01;30:*.bak=01;30:*.aux=01;30:*.lof=01;30:*.lol=01;30:*.lot=01;30:*.out=01;30:*.toc=01;30:*.bbl=01;30:*.blg=01;30:*~=01;30:*#=01;30:*.part=01;30:*.incomplete=01;30:*.swp=01;30:*.tmp=01;30:*.temp=01;30:*.o=01;30:*.obj=01;30:*.pyc=01;30:*.pyo=01;30:*.class=01;30:*.cache=01;30:*.egg-info=01;30:';
|
||||||
|
export LS_COLORS
|
10
zsh/export.zsh
Normal file
10
zsh/export.zsh
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
# Local Path Additions
|
||||||
|
export path=($path ${HOME}/.config/dotfiles/bin /opt/phalcon-devtools)
|
||||||
|
export PTOOLSPATH="/opt/phalcon-devtools/"
|
||||||
|
|
||||||
|
# Stuff for Homebrew
|
||||||
|
export path=($path /home/linuxbrew/.linuxbrew/sbin /home/linuxbrew/.linuxbrew/bin)
|
||||||
|
export fpath=($fpath /home/linuxbrew/.linuxbrew/share/zsh/site-functions)
|
||||||
|
export manpath=($manpath /home/linuxbrew/.linuxbrew/share/man)
|
||||||
|
export infopath=($infopath /home/linuxbrew/.linuxbrew/share/info)
|
||||||
|
export XDG_DATA_DIRS=($XDG_DATA_DIRS /home/linuxbrew/.linuxbrew/share)
|
71
zsh/functions/extract.zsh
Normal file
71
zsh/functions/extract.zsh
Normal file
|
@ -0,0 +1,71 @@
|
||||||
|
alias x=extract
|
||||||
|
|
||||||
|
extract() {
|
||||||
|
local remove_archive
|
||||||
|
local success
|
||||||
|
local extract_dir
|
||||||
|
|
||||||
|
if (( $# == 0 )); then
|
||||||
|
cat <<-'EOF' >&2
|
||||||
|
Usage: extract [-option] [file ...]
|
||||||
|
|
||||||
|
Options:
|
||||||
|
-r, --remove Remove archive after unpacking.
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
|
remove_archive=1
|
||||||
|
if [[ "$1" == "-r" ]] || [[ "$1" == "--remove" ]]; then
|
||||||
|
remove_archive=0
|
||||||
|
shift
|
||||||
|
fi
|
||||||
|
|
||||||
|
while (( $# > 0 )); do
|
||||||
|
if [[ ! -f "$1" ]]; then
|
||||||
|
echo "extract: '$1' is not a valid file" >&2
|
||||||
|
shift
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
success=0
|
||||||
|
extract_dir="${1:t:r}"
|
||||||
|
case "${1:l}" in
|
||||||
|
(*.tar.gz|*.tgz) (( $+commands[pigz] )) && { pigz -dc "$1" | tar xv } || tar zxvf "$1" ;;
|
||||||
|
(*.tar.bz2|*.tbz|*.tbz2) tar xvjf "$1" ;;
|
||||||
|
(*.tar.xz|*.txz)
|
||||||
|
tar --xz --help &> /dev/null \
|
||||||
|
&& tar --xz -xvf "$1" \
|
||||||
|
|| xzcat "$1" | tar xvf - ;;
|
||||||
|
(*.tar.zma|*.tlz)
|
||||||
|
tar --lzma --help &> /dev/null \
|
||||||
|
&& tar --lzma -xvf "$1" \
|
||||||
|
|| lzcat "$1" | tar xvf - ;;
|
||||||
|
(*.tar) tar xvf "$1" ;;
|
||||||
|
(*.gz) (( $+commands[pigz] )) && pigz -dk "$1" || gunzip -k "$1" ;;
|
||||||
|
(*.bz2) bunzip2 "$1" ;;
|
||||||
|
(*.xz) unxz "$1" ;;
|
||||||
|
(*.lzma) unlzma "$1" ;;
|
||||||
|
(*.z) uncompress "$1" ;;
|
||||||
|
(*.zip|*.war|*.jar|*.sublime-package|*.ipsw|*.xpi|*.apk|*.aar|*.whl) unzip "$1" -d $extract_dir ;;
|
||||||
|
(*.rar) unrar x -ad "$1" ;;
|
||||||
|
(*.7z) 7za x "$1" ;;
|
||||||
|
(*.deb)
|
||||||
|
mkdir -p "$extract_dir/control"
|
||||||
|
mkdir -p "$extract_dir/data"
|
||||||
|
cd "$extract_dir"; ar vx "../${1}" > /dev/null
|
||||||
|
cd control; tar xzvf ../control.tar.gz
|
||||||
|
cd ../data; extract ../data.tar.*
|
||||||
|
cd ..; rm *.tar.* debian-binary
|
||||||
|
cd ..
|
||||||
|
;;
|
||||||
|
(*)
|
||||||
|
echo "extract: '$1' cannot be extracted" >&2
|
||||||
|
success=1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
(( success = $success > 0 ? $success : $? ))
|
||||||
|
(( $success == 0 )) && (( $remove_archive == 0 )) && rm "$1"
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
}
|
8
zsh/functions/systemctl.zsh
Normal file
8
zsh/functions/systemctl.zsh
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
cmds=(status show start stop reload restart enable disable daemon-reload)
|
||||||
|
|
||||||
|
for cmd in $cmds; do
|
||||||
|
alias sc-$cmd="sudo systemctl $cmd"
|
||||||
|
done
|
||||||
|
|
||||||
|
alias sc-enablenow="sc-enable --now"
|
||||||
|
alias sc-disablenow="sc-disable --now"
|
40
zsh/history.zsh
Normal file
40
zsh/history.zsh
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
## History wrapper
|
||||||
|
function omz_history {
|
||||||
|
local clear list
|
||||||
|
zparseopts -E c=clear l=list
|
||||||
|
|
||||||
|
if [[ -n "$clear" ]]; then
|
||||||
|
# if -c provided, clobber the history file
|
||||||
|
echo -n >| "$HISTFILE"
|
||||||
|
echo >&2 History file deleted. Reload the session to see its effects.
|
||||||
|
elif [[ -n "$list" ]]; then
|
||||||
|
# if -l provided, run as if calling `fc' directly
|
||||||
|
builtin fc "$@"
|
||||||
|
else
|
||||||
|
# unless a number is provided, show all history events (starting from 1)
|
||||||
|
[[ ${@[-1]-} = *[0-9]* ]] && builtin fc -l "$@" || builtin fc -l "$@" 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Timestamp format
|
||||||
|
case ${HIST_STAMPS-} in
|
||||||
|
"mm/dd/yyyy") alias history='omz_history -f' ;;
|
||||||
|
"dd.mm.yyyy") alias history='omz_history -E' ;;
|
||||||
|
"yyyy-mm-dd") alias history='omz_history -i' ;;
|
||||||
|
"") alias history='omz_history' ;;
|
||||||
|
*) alias history="omz_history -t '$HIST_STAMPS'" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# History in cache directory:
|
||||||
|
HISTSIZE=50000
|
||||||
|
SAVEHIST=10000
|
||||||
|
HISTFILE=$HOME/.cache/zsh/history
|
||||||
|
|
||||||
|
## History command configuration
|
||||||
|
setopt extended_history # record timestamp of command in HISTFILE
|
||||||
|
setopt hist_expire_dups_first # delete duplicates first when HISTFILE size exceeds HISTSIZE
|
||||||
|
setopt hist_ignore_dups # ignore duplicated commands history list
|
||||||
|
setopt hist_ignore_space # ignore commands that start with space
|
||||||
|
setopt hist_verify # show command with history expansion to user before running it
|
||||||
|
setopt inc_append_history # add commands to HISTFILE in order of execution
|
||||||
|
setopt share_history # share command history data
|
55
zsh/zplugin.zsh
Normal file
55
zsh/zplugin.zsh
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
declare -A ZPLGM
|
||||||
|
ZPLGM[BIN_DIR]="$HOME/.config/dotfiles/zplugin/bin"
|
||||||
|
ZPLGM[HOME_DIR]="$HOME/.config/dotfiles/zplugin"
|
||||||
|
|
||||||
|
source $HOME/.config/dotfiles/zplugin/bin/zplugin.zsh
|
||||||
|
|
||||||
|
zplugin ice wait blockf atpull'zplugin creinstall -q .' silent
|
||||||
|
zplugin light zsh-users/zsh-completions
|
||||||
|
|
||||||
|
zplugin ice wait atload"_zsh_autosuggest_start" silent
|
||||||
|
zplugin light zsh-users/zsh-autosuggestions
|
||||||
|
|
||||||
|
zplugin ice pick"async.zsh" silent
|
||||||
|
zplugin light mafredri/zsh-async
|
||||||
|
zplugin ice pick"z4rr3t.zsh" silent
|
||||||
|
zplugin light inimicus/z4rr3t
|
||||||
|
|
||||||
|
# lib files
|
||||||
|
zplugin snippet OMZ::lib/clipboard.zsh
|
||||||
|
zplugin snippet OMZ::lib/completion.zsh
|
||||||
|
zplugin snippet OMZ::lib/directories.zsh
|
||||||
|
zplugin snippet OMZ::lib/functions.zsh
|
||||||
|
zplugin snippet OMZ::lib/grep.zsh
|
||||||
|
zplugin snippet OMZ::lib/key-bindings.zsh
|
||||||
|
zplugin snippet OMZ::lib/misc.zsh
|
||||||
|
zplugin snippet OMZ::lib/spectrum.zsh
|
||||||
|
zplugin snippet OMZ::lib/termsupport.zsh
|
||||||
|
|
||||||
|
alias ls="ls --color=tty"
|
||||||
|
setopt auto_cd
|
||||||
|
setopt multios
|
||||||
|
setopt prompt_subst
|
||||||
|
|
||||||
|
zplugin snippet OMZ::plugins/common-aliases/common-aliases.plugin.zsh
|
||||||
|
zplugin ice wait as"completion" silent
|
||||||
|
zplugin snippet OMZ::plugins/pip/_pip
|
||||||
|
zplugin snippet OMZ::plugins/pip/pip.plugin.zsh
|
||||||
|
zplugin snippet OMZ::plugins/python/python.plugin.zsh
|
||||||
|
zplugin snippet OMZ::plugins/gitignore/gitignore.plugin.zsh
|
||||||
|
|
||||||
|
# ls_colors
|
||||||
|
source $ZDOTDIR/dircolor.zsh
|
||||||
|
zstyle ":completion:*" list-colors “${(s.:.)LS_COLORS}
|
||||||
|
|
||||||
|
# syyntax highlighting
|
||||||
|
zplugin ice wait atinit"zpcompinit; zpcdreplay -q" silent
|
||||||
|
zplugin light zsh-users/zsh-syntax-highlighting
|
||||||
|
|
||||||
|
#has - program
|
||||||
|
zplugin ice as"program" pick"has" wait silent
|
||||||
|
zplugin light kdabir/has
|
||||||
|
|
||||||
|
#is - program
|
||||||
|
zplugin ice as"program" atclone"cp is.sh is" atpull"%atclone" pick"is" wait silent
|
||||||
|
zplugin light qzb/is.sh
|
Loading…
Add table
Reference in a new issue