This commit is contained in:
wcbing 2025-04-09 12:25:15 +08:00
commit c5fe3160fe
9 changed files with 148 additions and 0 deletions

7
aliases/container.sh Normal file
View File

@ -0,0 +1,7 @@
alias c=podman
alias crt="c run -it --rm" # container run temporarily
alias ce="c exec -it" # container exec
#alias nginx="c exec nginx nginx"
# alias lzd="DOCKER_HOST=unix:///run/podman/podman.sock lazydocker"
alias lzd="DOCKER_HOST=unix:///run/user/1000/podman/podman.sock lazydocker"

21
aliases/main.sh Normal file
View File

@ -0,0 +1,21 @@
# 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 du="du -h"
alias df="df -hT" # T: show filesystem type
alias dfo="df | grep -v tmpfs"
# Systemctl
alias sctl="systemctl"
alias ssctl="sudo systemctl"

6
aliases/proxy.sh Normal file
View File

@ -0,0 +1,6 @@
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"
# The following alias is for bash or zsh
[ -n "$BASH_VERSION" -o -n "$ZSH_VERSION" ] && \
alias unsetproxy="unset http_proxy https_proxy all_proxy"

7
aliases/python.sh Normal file
View File

@ -0,0 +1,7 @@
# Python venv
alias newvenv="python -m venv .venv"
alias actvenv=". .venv/bin/activate.fish"
# The following alias is for bash or zsh
[ -n "$BASH_VERSION" -o -n "$ZSH_VERSION" ] && \
alias actvenv=". .venv/bin/activate"

24
bash/.bashrc Normal file
View File

@ -0,0 +1,24 @@
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
for i in $(ls $Profile_PATH/aliases); do
. $Profile_PATH/aliases/$i
done
# PATH
PATH="$PATH:$HOME/bin/"
PATH="$PATH:$HOME/go/bin/"
PATH="$PATH:$HOME/.local/share/JetBrains/Toolbox/scripts"
export PATH

13
fish/config.fish Normal file
View File

@ -0,0 +1,13 @@
if status is-interactive
# Commands to run in interactive sessions can go here
end
set fish_greeting ""
set Profile_PATH $HOME/My/profiles
for i in $(ls $Profile_PATH/aliases/)
. $Profile_PATH/aliases/$i
end
# PATH
set -U fish_user_paths $HOME/.local/bin $HOME/go/bin $HOME/.local/share/JetBrains/Toolbox/scripts

16
run.sh Executable file
View File

@ -0,0 +1,16 @@
#!/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 _
sed -i "s#^Profile_PATH.*\$#Profile_PATH=$PWD#g" bash/.bashrc
sed -i "s#^set Profile_PATH .*\$#set Profile_PATH $PWD#g" fish/config.fish
ln -sf $PWD/bash/.bashrc ~/.bashrc
mkdir -p ~/.config/fish && ln -sf $PWD/fish/config.fish ~/.config/fish/config.fish
mkdir -p ~/.config/tmux && ln -sf $PWD/tmux/tmux.conf ~/.config/tmux/tmux.conf
mkdir -p ~/.vim && ln -sf $PWD/vim/vimrc ~/.vim/vimrc
echo "Finished"

11
tmux/tmux.conf Normal file
View File

@ -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

43
vim/vimrc Normal file
View File

@ -0,0 +1,43 @@
" You can use `:set all` to show all option.
" If you have questions about some option, you can use `:help <option>`.
set nocompatible
syntax on " Turn on syntax highlighting.
set wildmenu " show complete menu in Command-line.
set path+=**
" show line numbers: number(nu) relativenumber(rnu)
set nu rnu
" indent: autoindent(ai) smartindent(si) cindent(cin)
set si
" search: incsearch(is) hlsearch(hls) ignorecase(ic) smartcase(scs)
set is hls ic scs
" the fucking Tab:
" shiftwidth(sw) The size of input when press << or >>
" tabstop(ts) The true size and show size of Tab
" softtabstop(sts) The size of input when press Tab key
" smarttab(sta)
set sw=4 ts=4
set list listchars=tab:--> " show Tabs
" auto complete bracket
inoremap ' ''<ESC>i
inoremap " ""<ESC>i
inoremap ( ()<ESC>i
inoremap [ []<ESC>i
inoremap < <><ESC>i
inoremap { {<cr><tab><cr>}<ESC>i
" 'Q' in normal mode enters Ex mode. You almost never want this.
nmap Q <Nop>
" open terminal below
nnoremap <silent> <F4> :belowright terminal<CR>
" The backspace key has slightly unintuitive behavior by default. For example,
" by default, you can't backspace before the insertion point set with 'i'.
" This configuration makes backspace behave more reasonably, in that you can
" backspace over anything.
set backspace=indent,eol,start