This commit is contained in:
2021-05-27 14:23:38 -04:00
17 changed files with 234 additions and 128 deletions

View File

@@ -0,0 +1 @@
alias android-studio="open -a /Users/owenlejeune/Applications/JetBrains\ Toolbox/Android\ Studio.app"

3
apps/apps.plugin.zsh Normal file
View File

@@ -0,0 +1,3 @@
VNC_VIEWER="VNC\ Viewer"
alias vnc_viewer="open -a $VNC_VIEWER"

59
bd/bd.plugin.zsh Executable file
View File

@@ -0,0 +1,59 @@
#! /bin/bash
alias bd="bdfn -si"
usage_error () {
cat << EOF
------------------------------------------------------------------
Name: bd
Version: 1.02
------------------------------------------------------------------
Description: Go back to a specified directory up in the hierarchy.
------------------------------------------------------------------
How to use:
Please refer https://github.com/vigneshwaranr/bd
EOF
}
newpwd() {
oldpwd=$1
case "$2" in
-s)
pattern=$3
NEWPWD=$(echo $oldpwd | sed 's|\(.*/'$pattern'[^/]*/\).*|\1|')
;;
-si)
pattern=$3
NEWPWD=$(echo $oldpwd | perl -pe 's|(.*/'$pattern'[^/]*/).*|$1|i')
;;
*)
pattern=$2
NEWPWD=$(echo $oldpwd | sed 's|\(.*/'$pattern'/\).*|\1|')
esac
}
bdfn() {
if [ $# -eq 0 ]
then
usage_error
elif [ "${@: -1}" = -v ]
then
usage_error
else
oldpwd=$(pwd)
newpwd "$oldpwd" "$@"
if [ "$NEWPWD" = "$oldpwd" ]
then
echo "No such occurrence."
else
echo $NEWPWD
cd "$NEWPWD"
fi
unset NEWPWD
fi
}

View File

@@ -0,0 +1,3 @@
export BW_SESSION="5q+MApwFfcaY7wGqB6ld7q9k2EUr763jSaJHeNeqX49biT6ZuRUHL1Y flnffNPB8O+egZCi//H9zqZoeN3Km0Q=="
alias "bw-search"="bw list items --search"

7
code/code.plugin.zsh Executable file
View File

@@ -0,0 +1,7 @@
alias vscode="code"
alias vs-code="code"
alias cdiff="code -d"
alias cadd="code -a"
alias cnew="code -n"
alias code-install="code --install-extension"
alias code-uninstall="code --uninstall-extension"

3
copy/copy.plugin.zsh Executable file
View File

@@ -0,0 +1,3 @@
xcopy() { $1 | xclip -selection clipboard; }
xcopyf() { cat $1 | xclip -selection clipboard; }
xpaste() { xclip -selection clipboard -o; }

View File

@@ -3,6 +3,7 @@ alias gadda="gadd -A"
alias gstatus="git status"
alias gdiff="git diff"
alias glog="git log"
alias glogg="git log --graph"
alias glast="glog -p -1"
alias gcheckout="git checkout"
alias gcheckoutb="gcheckout -b"
@@ -14,8 +15,11 @@ alias gcommit="git commit"
alias gcommitm="git commit -m"
alias gamend="gcommit --amend"
alias gbranch="git branch"
alias rnmbranch="gbranch -m"
alias gbranchd="git branch -D"
alias grnmbranch="gbranch -m"
alias gpushb="git push origin"
alias gundoc="git reset HEAD~"
alias greset="git checkout --"
function gpush() {
BRANCH=""

View File

@@ -1 +1,10 @@
alias brewup="brew update && brew upgrade && brew cleanup && brew doctor && brew cask upgrade"
function brewup() {
echo "***BREW UPDATE***"
brew update
echo "***BREW UPGRADE***"
brew upgrade
echo "***BREW CLEANUP***"
brew cleanup
echo "***BREW DOCTOR***"
brew doctor
}

14
linux/linux.plugin.zsh Normal file
View File

@@ -0,0 +1,14 @@
alias fix-audio="pavucontrol"
function open() {
DIR="."
if [[ $# -gt 0 ]];
then
DIR="$1"
fi
gio open $DIR
}
function trash() {
gio trash $@
}

36
scripts/drand.py Normal file
View File

@@ -0,0 +1,36 @@
import os, os.path
import sys
from random import randint
check_start = False
start = ''
dirn = sys.argv[1]
if len(sys.argv) > 2:
start = sys.argv[2]
check_start = True
dirlist = os.listdir(dirn)
if check_start:
fs = []
for i in dirlist:
if i.startswith(start):
fs.append(i)
numitems = len(fs)
found = False
while not found:
j = randint(0,numitems-1)
if fs[j][0] != ".":
found = True
print(fs[i])
else:
numitems = len(dirlist)
found = False
while not found:
i = randint(0,numitems-1)
if dirlist[i][0] != ".":
found = True
# i = randint(0,numitems-1)
print(dirlist[i])

41
scripts/frand.py Normal file
View File

@@ -0,0 +1,41 @@
import sys
from random import randint
check_start = False
prefix = ''
num = 1
if len(sys.argv) == 1:
print("ERROR: Please include a filename")
print("Usage: frand <FILENAME> [<INCLUDES>] [n=<NUM>]")
sys.exit(0)
fn = sys.argv[1]
for i in range(2, len(sys.argv)):
if sys.argv[i].startswith("n="):
num = int(sys.argv[i][2:])
else:
prefix = sys.argv[i]
check_start = True
lines = []
with open(fn) as f:
for line in f:
nline = line.replace("\n", "")
lines.append(nline)
for x in range(0, num):
if check_start:
line_sub = []
for i in lines:
if i.startswith(prefix):
line_sub.append(i)
numitems = len(line_sub)
i = randint(0,numitems-1)
print(line_sub[i])
else:
numitems = len(lines)
i = randint(0,numitems-1)
print(lines[i])

24
scripts/randomnums.py Normal file
View File

@@ -0,0 +1,24 @@
from random import randrange
import sys
#num = int(input("Enter a number: "))
#num2 = int(input("How many numbers: "))
args = len(sys.argv)
if args<3 or args>4:
print("Invalid command\n usage: randnums <MIN> <MAX> [<NUM>]")
quit()
nmin = int(sys.argv[1])
nmax = int(sys.argv[2])
nnum = 1 if args==3 else int(sys.argv[3])
if nmin>=nmax:
print("Error: min must be less than max")
quit()
if nnum <= 0:
print("Error: num must be greater than 0")
quit()
for x in range(0, nnum):
print(randrange(nmin, nmax))

View File

@@ -0,0 +1,6 @@
SDIR="~/.oh-my-zsh/custom/plugins/scripts"
alias frand="python3 ${SDIR}/frand.py"
alias drand="python3 ${SDIR}/drand.py"
alias randnums="python3 ${SDIR}/randomnums.py"
alias sort-by-date="python3 ${SDIR}/sort-by-time.py"

20
scripts/sort-by-time.py Normal file
View File

@@ -0,0 +1,20 @@
import os
import sys
import pathlib
import datetime
dirn = sys.argv[1]
dirlist = os.listdir(dirn)
dates = []
for f in dirlist:
if f[:1] != '.' and os.path.isfile(dirn + "/" + f):
fname = pathlib.Path(dirn + "/" + f)
ctime = datetime.datetime.fromtimestamp(fname.stat().st_ctime)
date = str(ctime)[:10]
if date not in dates:
if not os.path.isdir(dirn + "/" + date):
dates.append(date)
os.mkdir(dirn + "/" + date)
os.rename(dirn + "/" + f, dirn + "/" + date + "/" + f)

Submodule zsh-autosuggestions updated: 43f3bc4010...ae315ded4d

Submodule zsh-syntax-highlighting added at 62c5575848

125
zshrc
View File

@@ -1,125 +0,0 @@
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH="/usr/local/sbin:$PATH"
# Path to your oh-my-zsh installation.
export ZSH="/Users/owenlejeune/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
# ZSH_THEME="robbyrussell"
ZSH_THEME="pygmalion"
# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in ~/.oh-my-zsh/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"
# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"
# Uncomment the following line to automatically update without prompting.
# DISABLE_UPDATE_PROMPT="true"
# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13
# Uncomment the following line if pasting URLs and other text is messed up.
# DISABLE_MAGIC_FUNCTIONS=true
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
# COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
# HIST_STAMPS="mm/dd/yyyy"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
# Which plugins would you like to load?
# Standard plugins can be found in ~/.oh-my-zsh/plugins/*
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(autoenv
colored-man-pages
colorize
git
homebrew
macos
oneplus
shell
subliminal
telnet
thefuck
wd
xcode)
source $ZSH/oh-my-zsh.sh
# User configuration
# export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
alias zshconfig="vim ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
alias ohmyzsh="atom ~/.oh-my-zsh"
alias zshsource="source ~/.zshrc"
alias reset="cd && clear"
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh"