commit f7aaf232d2cd13ab5efebb6f61327f19223a426d Author: wcbing Date: Tue Dec 3 22:52:50 2024 +0800 reinit diff --git a/bash/.bashrc b/bash/.bashrc new file mode 100644 index 0000000..e2a1b61 --- /dev/null +++ b/bash/.bashrc @@ -0,0 +1,25 @@ +PS1='\[\033[01;32m\]\u@\h \[\033[01;34m\]\w\[\033[00m\]\$ ' + +# enable bash completion in interactive non-login shell +if [ "x${PS1-}" != x -a "x${BASH_COMPLETION_VERSINFO-}" = x ]; then + if [ -f /usr/share/bash-completion/bash_completion ]; then + . /usr/share/bash-completion/bash_completion + fi +fi + +# colorful for bash +alias ls="ls -F --color=auto" +alias grep="grep --color=auto" + +Profile_PATH=$HOME/My/profiles +if [ -f $Profile_PATH/shell/aliases.sh ]; then + . $Profile_PATH/shell/aliases.sh +fi + +# PATH +# ---------------------------- +PATH="$PATH:$HOME/bin/" +PATH="$PATH:$HOME/go/bin/" +PATH="$PATH:$HOME/.local/share/JetBrains/Toolbox/scripts" + +export PATH diff --git a/fish/config.fish b/fish/config.fish new file mode 100644 index 0000000..fdf0b1a --- /dev/null +++ b/fish/config.fish @@ -0,0 +1,14 @@ +if status is-interactive + # Commands to run in interactive sessions can go here +end + +set fish_greeting "" + +set Profile_PATH $HOME/My/profiles +if test -e $Profile_PATH/shell/aliases.sh + . $Profile_PATH/shell/aliases.sh +end + +# PATH +# ---------------------------- +set -U fish_user_paths $HOME/bin/ $HOME/go/bin/ $HOME/.local/share/JetBrains/Toolbox/scripts diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..8096cd3 --- /dev/null +++ b/run.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +echo "Warning: This will force overwrite your .bashrc and so on. +If you want to exit, please press Ctrl+C to exit. +Press the Enter to continue." +read _ + +ln -sf $PWD/bash/.bashrc ~/.bashrc +ln -sf $PWD/fish/config.fish ~/.config/fish/config.fish +ln -sf $PWD/vim/.vimrc ~/.vimrc +ln -sf $PWD/tmux/.tmux.conf ~/.tmux.conf + +echo "Finished" diff --git a/shell/aliases.sh b/shell/aliases.sh new file mode 100644 index 0000000..d06c0da --- /dev/null +++ b/shell/aliases.sh @@ -0,0 +1,44 @@ +# List file +alias l="ls -a" +alias la="ls -a" +alias ll="ls -lh" +alias lla="ls -alh" + +# Directory and File +alias mkdir="mkdir -pv" +alias rm="rm -rv" +alias mv="mv -v" +alias cp="cp -rv" + +# Human Readable +alias free="free -h" +alias df="df -hT | grep -v tmpfs" # T: show filesystem type +alias du="du -h" + +# Systemctl +alias sctl="systemctl" +alias ssctl="sudo systemctl" + +# Python Venv +alias newvenv="python -m venv .venv" +alias actvenv=". .venv/bin/activate" + +# Proxy +alias setproxy="export http_proxy=http://127.0.0.1:7890 https_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890" +alias unsetproxy="unset http_proxy https_proxy all_proxy" + +# Containers +alias c=podman +alias ctr="c run -it --rm" # container temporarily run +alias cte="c exec -it" # container temporarily exec +#alias nginx="c exec nginx nginx" + + +[ -n "$BASH_VERSION" -o -n "$ZSH_VERSION" ] && return 0 +# The following alias is for fish + +# Python venv +alias actvenv=". .venv/bin/activate.fish" + +# Proxy +alias unsetproxy="set -e http_proxy https_proxy all_proxy" diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf new file mode 100644 index 0000000..3768d27 --- /dev/null +++ b/tmux/.tmux.conf @@ -0,0 +1,11 @@ +set -g mouse +set -g set-clipboard on + +## Style of ststus window pane +## bg:background, fg:foreground +## ------------------------------ +set -g status-style fg='#777777' +set -g window-status-style bg=cyan +set -g window-status-current-style bg=green +# set -g pane-border-style fg=black +# set -g pane-active-border-style fg=red diff --git a/vim/.vimrc b/vim/.vimrc new file mode 100644 index 0000000..8bbe1e0 --- /dev/null +++ b/vim/.vimrc @@ -0,0 +1,40 @@ +" You can use `:set all` to show all option. +" If you have questions about some option, you can use `:help