Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .aliases
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
##### ============================
##### GENERATED - DO NOT MODIFY
##### This file will be overriden
##### ============================

alias work="cd ~/Documents/workspace/"
alias reload="source ~/.zshrc"
loadenv () {
export $(grep -v '^#' ${1} | xargs)
}

#ready zsh configs
alias zshrc='cat ~/.zshrc'
alias zshalias='cat ~/.oh-my-zsh/zsh.aliases'
Expand Down Expand Up @@ -35,3 +46,41 @@ alias gprune='git_prune'

#git rename
alias grename='git branch -m $1'

case "$OSTYPE" in
darwin*)
alias cat=bat
alias df=duf
alias ls=exa
alias ps=procs
alias sed=sd
alias grep=ripgrep
alias tree=tre
alias history=hstr
;;
linux*)
alias cat=bat
alias df=duf
alias ls=exa
alias ps=procs
alias sed=sd
alias grep=ripgrep
alias tree=tre
alias history=hstr
;;
mysys*)
alias cat=bat
alias df=duf
alias ls=exa
alias ps=procs
alias sed=sd
alias grep=ripgrep
alias tree=tre
;;
esac

#http
alias whichport='lsof -i -P | grep LISTEN | grep $1'
alias wport=whichport
alias port=whichport

28 changes: 28 additions & 0 deletions dev_macosx_setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

# handle keyboard HOME/END keys
# map to start of line/end of line
KEYBINDINGS_DIR="~/Library/KeyBindings"
if [ ! -d "$KEYBINDINGS_DIR" ]; then
echo 'creating default macosx keybindings'
mkdir -p ~/Library/KeyBindings
cp ./macoskeyboardbindings.dict ~/Library/KeyBindings/DefaultKeyBinding.dict
fi

# install cli tools
brew install bat #cat
brew install duf #df
brew install exa #ls
brew install scc
brew install tldr #man
brew install entr
brew install fzf
brew install jq
brew install procs #ps
brew install sd #sed
brew install ripgrep #grep
brew install tre #tree
brew install xsel #clipboard
brew install hstr #history

# always override base aliases/scripts
cat .aliases >> $ZSH_CUSTOM/kinglew.zsh
25 changes: 25 additions & 0 deletions dev_ubuntu_setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# can be used for ubuntu linux and also for windows WSL2

apt install bat -y #cat
apt install duf -y #df
apt install exa -y #ls
snap install scc # count LOC
apt install tldr -y #man
apt install entr -y
apt install fzf -y
apt install jq -y
snap install procs #ps
# apt install rust-sd -y #sed
apt install ripgrep -y
apt install tre-command -y #tree
apt install xsel -y
apt install ncdu -y #disk usage
apt install hstr -y #history

apt install autojump
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

# always override base aliases/scripts
cat .aliases >> $ZSH_CUSTOM/kinglew.zsh

echo export PATH="$PATH:/snap/bin" >> $ZSH_CUSTOM/snap.zsh
74 changes: 74 additions & 0 deletions dev_windows_zsh_setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Setup zsh on Windows, see
# https://dev.to/pavlosisaris/windows-command-line-revolution-unleash-zsh-and-oh-my-zsh-a-simple-guide-for-developers-271o

# install scoop
# Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
# Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression

if ! [[ "$1" = "--skip-install" ]]; then
echo "Installing/Upgrading applications using Scoop"

scoop bucket add main
scoop bucket add extras
scoop bucket add nerd-fonts

## dev tools
scoop update main/bat #cat
scoop update main/duf #df
scoop update main/eza #ls
scoop update main/scc
scoop update main/tldr #man

scoop update main/fzf
scoop update main/jq
scoop update main/procs #ps
scoop update main/sd #sed
scoop update main/ripgrep #grep
scoop update main/tre-command #tree
scoop update extras/autojump

scoop update extras/bruno
scoop update main/peco
scoop update extras/zeal
scoop update extras/touchcursor

## dev IDEs
scoop update extras/vscode
scoop update nerd-fonts/JetBrainsMono-NF
scoop update nerd-fonts/JetBrainsMono-NF-Propo
scoop update nerd-fonts/JetBrainsMono-NF-Mono
fi

# always override base aliases/scripts
echo "copy custom aliases"
cp .aliases ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/kinglew.zsh

# tocuhcursor
echo "setup touchcursor"
cp ./touchcursor/settings.cfg $APPDATA/TouchCursor/settings.cfg

# configure .zshrc
echo "configure .zshrc"
sed -i 's/^ZSH_THEME=.*/ZSH_THEME="gnzh"/' ~/.zshrc
sed -i 's/^plugins=.*/plugins=(git autojump z dotenv zsh-autosuggestions)/' ~/.zshrc

if ! (( $(grep -c "^export.HISTSIZE" ~/.zshrc ) )) ; then
echo "export HISTSIZE=100000" >> ~/.zshrc
fi
if ! (( $(grep -c "^export.SAVEHIST" ~/.zshrc ) )) ; then
echo "export SAVEHIST=100000" >> ~/.zshrc
fi
if ! (( $(grep -c "^export.HISTCONTROL" ~/.zshrc ) )) ; then
echo "export HISTCONTROL=ignorespace" >> ~/.zshrc
fi
if ! (( $(grep -c "^setopt.hist_ignore_all_dups" ~/.zshrc ) )) ; then
echo "setopt hist_ignore_all_dups" >> ~/.zshrc
fi
if ! (( $(grep -c "^setopt.hist_ignore_space" ~/.zshrc ) )) ; then
echo "setopt hist_ignore_space" >> ~/.zshrc
fi

autosuggestion_plugin_dir=${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
if [ ! -d autosuggestion_plugin_dir ] ; then
git clone https://github.com/zsh-users/zsh-autosuggestions $autosuggestion_plugin_dir
fi
6 changes: 6 additions & 0 deletions macoskeyboardbindings.dict
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"\UF729" = "moveToBeginningOfLine:";
"\UF72B" = "moveToEndOfLine:";
"$\UF729" = "moveToBeginningOfLineAndModifySelection:";
"$\UF72B" = "moveToEndOfLineAndModifySelection:";
}