From 4a284861dee3579cf0fa397aa911f66d2df56100 Mon Sep 17 00:00:00 2001 From: wcbing Date: Tue, 6 Aug 2024 17:31:08 +0800 Subject: [PATCH] reinit --- bash/.bashrc | 37 +++++++++++++++++++++++++++++++++++++ fish/config.fish | 28 ++++++++++++++++++++++++++++ run.sh | 14 ++++++++++++++ shell/aliases.sh | 26 ++++++++++++++++++++++++++ tmux/.tmux.conf | 12 ++++++++++++ vim/.vimrc | 41 +++++++++++++++++++++++++++++++++++++++++ 6 files changed, 158 insertions(+) create mode 100644 bash/.bashrc create mode 100644 fish/config.fish create mode 100755 run.sh create mode 100644 shell/aliases.sh create mode 100644 tmux/.tmux.conf create mode 100644 vim/.vimrc diff --git a/bash/.bashrc b/bash/.bashrc new file mode 100644 index 0000000..de70295 --- /dev/null +++ b/bash/.bashrc @@ -0,0 +1,37 @@ +PS1='\[\033[01;32m\]\u@\h \[\033[01;34m\]\w\[\033[00m\]\$ ' + +# enable bash completion in interactive shells +if ! shopt -oq posix; then + if [ -f /usr/share/bash-completion/bash_completion ]; then + . /usr/share/bash-completion/bash_completion + elif [ -f /etc/bash_completion ]; then + . /etc/bash_completion + fi +fi + +Profile_PATH=~/My/profiles +if [ -f $Profile_PATH/shell/aliases.sh ]; then + . $Profile_PATH/shell/aliases.sh +fi + +# colorful for bash +alias ls="ls -F --color=auto" +alias grep="grep --color=auto" + +# 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" + +# PATH +# ---------------------------- +PATH="$PATH:~/My/apps/" +PATH="$PATH:~/node_modules/.bin/" +PATH="$PATH:~/.local/share/JetBrains/Toolbox/scripts" + +export PATH \ No newline at end of file diff --git a/fish/config.fish b/fish/config.fish new file mode 100644 index 0000000..eed2283 --- /dev/null +++ b/fish/config.fish @@ -0,0 +1,28 @@ +if status is-interactive + # Commands to run in interactive sessions can go here +end + +set fish_greeting "" + +set Profile_PATH ~/My/profiles +if test -e $Profile_PATH/shell/aliases.sh + . $Profile_PATH/shell/aliases.sh +end + +# Python venv +# ---------------------------- +alias newvenv="python -m venv .venv" +alias actvenv=". .venv/bin/activate.fish" + +# 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="set -e http_proxy https_proxy all_proxy" + +# PATH +# ---------------------------- +set PATH $PATH ~/My/apps/ +set PATH $PATH ~/node_modules/.bin/ +set PATH $PATH ~/.local/share/JetBrains/Toolbox/scripts + +export PATH \ No newline at end of file diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..c7f09cf --- /dev/null +++ b/run.sh @@ -0,0 +1,14 @@ +#!/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 _ + +export Profile_PATH=$PWD +ln -sf $Profile_PATH/bash/.bashrc ~/.bashrc +ln -sf $Profile_PATH/fish/config.fish ~/.config/fish/config.fish +ln -sf $Profile_PATH/vim/.vimrc ~/.vimrc +ln -sf $Profile_PATH/tmux/.tmux.conf ~/.tmux.conf + +echo "Finished" \ No newline at end of file diff --git a/shell/aliases.sh b/shell/aliases.sh new file mode 100644 index 0000000..9e0c9b1 --- /dev/null +++ b/shell/aliases.sh @@ -0,0 +1,26 @@ +# list file +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 -h" +alias du="du -h" + +# Systemctl +alias sctl="systemctl" +alias ssctl="sudo systemctl" + +# Containers +#alias docker=podman +#alias debian="docker exec -it debian bash" +#alias fedora="docker exec -it fedora bash" +#alias archlinux="docker exec -it archlinux bash" +#alias nginx="docker exec nginx nginx" \ No newline at end of file diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf new file mode 100644 index 0000000..5a8dc01 --- /dev/null +++ b/tmux/.tmux.conf @@ -0,0 +1,12 @@ +set -g prefix M-z +unbind C-b +set -g mouse +set -g set-clipboard on + +## Style (bg:background, fg:foreground) +## ststus window pane +set -g status-style fg='#ffffff' +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..babad03 --- /dev/null +++ b/vim/.vimrc @@ -0,0 +1,41 @@ +" You can use `:set all` to show all option. +" If you have questions about some option, you can use `:help