shfmt formatting
This commit is contained in:
parent
38e4f299f5
commit
3361f81885
6 changed files with 57 additions and 62 deletions
|
@ -55,4 +55,3 @@ if is-exectuable zellij; then
|
|||
alias za="zellij a"
|
||||
fi
|
||||
##########################################
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
# >>> conda initialize >>>
|
||||
# !! Contents within this block are managed by 'conda init' !!
|
||||
__conda_setup="$('$HOME/mambaforge/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
|
||||
__conda_setup="$('$HOME/mambaforge/bin/conda' 'shell.zsh' 'hook' 2>/dev/null)"
|
||||
if [ $? -eq 0 ]; then
|
||||
eval "$__conda_setup"
|
||||
else
|
||||
|
@ -20,4 +20,3 @@ fi
|
|||
# <<< conda initialize <<<
|
||||
|
||||
[ -d "$HOME/mambaforge/envs/dev" ] && conda activate dev
|
||||
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
# env variables
|
||||
if ! [ $(cat /etc/hostname)=="thinkpad" ];then
|
||||
if ! [ $(cat /etc/hostname)=="thinkpad" ]; then
|
||||
export BROWSER=/mnt/c/Users/daylin/AppData/Local/Vivaldi/Application/vivaldi.exe
|
||||
else
|
||||
export BROWSER=vivaldi-stable
|
||||
fi
|
||||
# aliases
|
||||
alias files=explorer.exe
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@ export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}"
|
|||
|
||||
export PATH=$PATH:~/bin
|
||||
|
||||
export HISTSIZE=32768;
|
||||
export HISTFILESIZE="${HISTSIZE}";
|
||||
export HISTSIZE=32768
|
||||
export HISTFILESIZE="${HISTSIZE}"
|
||||
export SAVEHIST=4096
|
||||
export HISTCONTROL=ignoredups:erasedups
|
||||
|
||||
|
@ -30,10 +30,9 @@ fi
|
|||
# setopt CORRECT
|
||||
# setopt CORRECT_ALL
|
||||
|
||||
|
||||
# Setup fzf
|
||||
# ---------
|
||||
if [[ ! "$PATH" == *$HOME/.fzf/bin* ]]; then
|
||||
if [[ $PATH != *$HOME/.fzf/bin* ]]; then
|
||||
export PATH="${PATH:+${PATH}:}$HOME/.fzf/bin"
|
||||
fi
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
function cl() {
|
||||
DIR="$*";
|
||||
DIR="$*"
|
||||
# if no DIR given, go home
|
||||
if [ $# -lt 1 ]; then
|
||||
DIR=$HOME;
|
||||
fi;
|
||||
builtin cd "${DIR}" && \
|
||||
DIR=$HOME
|
||||
fi
|
||||
builtin cd "${DIR}" &&
|
||||
# use your preferred ls command
|
||||
ls -F --color=auto
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ prepend-path() {
|
|||
}
|
||||
|
||||
#delete and reclone remote repo
|
||||
reclone () {
|
||||
reclone() {
|
||||
basename=${PWD##*/}
|
||||
remoteurl=$(git remote get-url --push origin)
|
||||
cd ..
|
||||
|
@ -27,7 +27,7 @@ reclone () {
|
|||
|
||||
# snakemake use all cores by default
|
||||
sm() {
|
||||
if [[ "$*" == *"-j"* || "$*" == *"--jobs"* || "$*" == *"--cores"* ]]; then
|
||||
if [[ $* == *"-j"* || $* == *"--jobs"* || $* == *"--cores"* ]]; then
|
||||
snakemake $@
|
||||
else
|
||||
snakemake -j all $@
|
||||
|
@ -35,24 +35,24 @@ sm() {
|
|||
}
|
||||
|
||||
function gi() {
|
||||
curl -sL "https://www.toptal.com/developers/gitignore/api/$@" ;
|
||||
}
|
||||
|
||||
|
||||
# make pdfs or svgs from vegalite json's
|
||||
mkvegapdf () {
|
||||
vl2vg $1 | vg2pdf > $2
|
||||
curl -sL "https://www.toptal.com/developers/gitignore/api/$@"
|
||||
}
|
||||
|
||||
mkvegasvg () {
|
||||
vl2vg $1 | vg2svg > $2
|
||||
# make pdfs or svgs from vegalite json's
|
||||
mkvegapdf() {
|
||||
vl2vg $1 | vg2pdf >$2
|
||||
}
|
||||
|
||||
mkvegasvg() {
|
||||
vl2vg $1 | vg2svg >$2
|
||||
}
|
||||
|
||||
# quick and dirty pdf generation from simple md
|
||||
md2pdf () {
|
||||
md2pdf() {
|
||||
root=$1
|
||||
# get extension and root path: https://stackoverflow.com/a/40928328
|
||||
fname="${root#.}";fname="${root%"$fname"}${fname%.*}"
|
||||
fname="${root#.}"
|
||||
fname="${root%"$fname"}${fname%.*}"
|
||||
ext="${root#"$fname"}"
|
||||
echo "converting $root to pdf"
|
||||
|
||||
|
@ -66,7 +66,7 @@ md2pdf () {
|
|||
|
||||
}
|
||||
|
||||
py2nb2html () {
|
||||
py2nb2html() {
|
||||
if [ $# -eq 0 ]; then
|
||||
echo "No arguments provided"
|
||||
return 1
|
||||
|
@ -77,8 +77,7 @@ py2nb2html () {
|
|||
jupytext --to notebook -o - $pyfile | jupyter nbconvert --execute --to html --stdin $@
|
||||
}
|
||||
|
||||
web () {
|
||||
web() {
|
||||
filepath=$(wslpath -w $1)
|
||||
$BROWSER $filepath
|
||||
}
|
||||
|
||||
|
|
|
@ -26,8 +26,8 @@ PATH="$HOME/go/bin:$PATH"
|
|||
# PATH="$(perl -e 'print join(":", grep { not $seen{$_}++ } split(/:/, $ENV{PATH}))')"
|
||||
# printf %s "$PATH" | awk -v RS=: -v ORS=: '!arr[$0]++'
|
||||
|
||||
PATH=$(printf %s "$PATH" \
|
||||
| awk -vRS=: -vORS= '!a[$0]++ {if (NR>1) printf(":"); printf("%s", $0) }' )
|
||||
PATH=$(printf %s "$PATH" |
|
||||
awk -vRS=: -vORS= '!a[$0]++ {if (NR>1) printf(":"); printf("%s", $0) }')
|
||||
# Wrap up
|
||||
|
||||
export PATH
|
||||
|
|
Loading…
Reference in a new issue