Skip to content

Commit

Permalink
sync configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
yasinmiran committed Mar 22, 2024
1 parent 9749188 commit e11d880
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 23 deletions.
24 changes: 16 additions & 8 deletions bash/bashrc
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
#!/usr/bin/env bash

# Using the same configurations from the ZSH shell.
# I'm not relying on the ZSH specific features.

# Source .zshrc if it exists
if [ -f "$HOME/.dotfiles/zsh/zshrc" ]; then
source "$HOME/.dotfiles/zsh/zshrc"
fi

# If not running interactively, don't do anything
case $- in
*i*) ;;
Expand Down Expand Up @@ -90,3 +82,19 @@ export SCM_CHECK=true

# Load Bash It
source "$BASH_IT"/bash_it.sh
source ~/.dotfiles/zsh/zshrc
source /etc/bash_completion

# HSTR configuration
alias hh=hstr # hh to be alias for hstr
export HSTR_CONFIG=hicolor # get more colors
shopt -s histappend # append new history items to .bash_history
export HISTCONTROL=ignorespace # leading space hides commands from history
export HISTFILESIZE=10000 # increase history file size (default is 500)
export HISTSIZE=${HISTFILESIZE} # increase history size (default is 500)
# ensure synchronization between bash memory and history file
export PROMPT_COMMAND="history -a; history -n; ${PROMPT_COMMAND}"
# if this is interactive shell, then bind hstr to Ctrl-r (for Vi mode check doc)
if [[ $- =~ .*i.* ]]; then bind '"\C-r": "\C-a hstr -- \C-j"'; fi
# if this is interactive shell, then bind 'kill last command' to Ctrl-x k
if [[ $- =~ .*i.* ]]; then bind '"\C-xk": "\C-a hstr -k \C-j"'; fi
2 changes: 2 additions & 0 deletions git/defaults
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ alias hit="git"
alias gut="git"
alias got="git"

alias grv="git remote -v"
alias gst="git status"
alias gstash="git stash" # default stash.
alias gstashall="git stash -u" # Stash all untracked ones.
alias gp="git push" # default push.
Expand Down
14 changes: 9 additions & 5 deletions snap/Snaplist
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
bare
barrier
chromium
code
core
core18
core20
core22
cups
emote
gnome-3-34-1804
gnome-42-2204
goreleaser
go
gradle
gtk-common-themes
hello-world
intellij-idea-ultimate
j2
lxd
nmap
pdftk
podman
pycharm-community
simplenote
slack
tree
vlc
zoom-client
47 changes: 37 additions & 10 deletions zsh/zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ alias .....="cd ../../../.." # go back five directories
alias ......="cd ../../../../.." # go back six directories
alias .......="cd ../../../../../.." # go back seven directories
alias ~="cd ~" # go to home but `cd` is probably faster to type.
alias -- -="cd -" # go to old directory == cd $OLDPWD
# alias -- -="cd -" # go to old directory == cd $OLDPWD

alias d="cd ~/Documents" # go to documents
alias dl="cd ~/Downloads" # go to downloads
Expand All @@ -54,11 +54,11 @@ alias cls="clear" # Good old cls
# way I want. So, I'm overriding the similar existing
# ones with mine. First push all the above aliases
# and then pop back later.
if [[ "$(uname)" == "Darwin" ]]; then
PERSONAL_ALIASES="$(alias -L)"
else
PERSONAL_ALIASES="$(alias -p)"
fi
# if [[ "$(uname)" == "Darwin" ]]; then
# PERSONAL_ALIASES="$(alias -L)"
# else
# PERSONAL_ALIASES="$(alias -p)"
# fi

# Abbreviated for: Append to $PATH.
# This function will append a path to $PATH and
Expand Down Expand Up @@ -207,13 +207,11 @@ function darwin() {
}

function linux() {

echo "Applying your Linux specific configs..."

source "$DOTFILES_DIR/snap/defaults"

# source "/var/snap/openjdk/current/openjdk.env"
export JAVA_HOME="/usr/lib/jvm/java-21-openjdk-amd64/"
alias rrr="exec bash"

}

function common() {
Expand All @@ -228,6 +226,7 @@ function common() {
source "$DOTFILES_DIR/git/defaults"

alias dlistall="docker ps -a"
alias dpsa="docker ps -a --no-trunc | less -S"
alias dstart="docker start"
alias dstop="docker stop"

Expand Down Expand Up @@ -266,3 +265,31 @@ fi
eval "$PERSONAL_ALIASES"
echo -e "A new $(ps -o comm= $$) session created with pid $$"
echo -e "$USER's $(echo $0) environment is ready ✅.\n"

function dokcer_jump_to() {
docker exec -it $1 "${2:-sh}"
}

function dlg() {
docker logs $1
}

function docker_stop_all_running_containers() {
docker stop $(docker ps -q)
}

function docker_remove_all_containers() {
docker rm -vf $(docker ps -aq)
}

function docker_remove_all_images() {
docker rmi -f $(docker images -aq)
}

function docker_prune_everything() {
docker system prune -a --volumes
}

function docker_restart() {
sudo systemctl restart docker
}

0 comments on commit e11d880

Please sign in to comment.