reinit
This commit is contained in:
commit
a1c9d4d870
34
bash/.bashrc
Normal file
34
bash/.bashrc
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
PS1='\[\033[01;32m\]\u@\h \[\033[01;34m\]\w\[\033[00m\]\$ '
|
||||||
|
#PS1='\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\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=~/profiles
|
||||||
|
if [ -f $Profile_PATH/shell/aliases ]; then
|
||||||
|
. $Profile_PATH/shell/aliases
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 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
|
||||||
28
fish/.config/fish/config.fish
Normal file
28
fish/.config/fish/config.fish
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
if status is-interactive
|
||||||
|
# Commands to run in interactive sessions can go here
|
||||||
|
end
|
||||||
|
|
||||||
|
set fish_greeting ""
|
||||||
|
|
||||||
|
set Profile_PATH ~/profiles
|
||||||
|
if test -e $Profile_PATH/shell/aliases
|
||||||
|
. $Profile_PATH/shell/aliases
|
||||||
|
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
|
||||||
34
profiles/bash/.bashrc
Normal file
34
profiles/bash/.bashrc
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
PS1='\[\033[01;32m\]\u@\h \[\033[01;34m\]\w\[\033[00m\]\$ '
|
||||||
|
#PS1='\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\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=~/profiles
|
||||||
|
if [ -f $Profile_PATH/shell/aliases ]; then
|
||||||
|
. $Profile_PATH/shell/aliases
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 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
|
||||||
28
profiles/fish/.config/fish/config.fish
Normal file
28
profiles/fish/.config/fish/config.fish
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
if status is-interactive
|
||||||
|
# Commands to run in interactive sessions can go here
|
||||||
|
end
|
||||||
|
|
||||||
|
set fish_greeting ""
|
||||||
|
|
||||||
|
set Profile_PATH ~/profiles
|
||||||
|
if test -e $Profile_PATH/shell/aliases
|
||||||
|
. $Profile_PATH/shell/aliases
|
||||||
|
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
|
||||||
16
profiles/run-ln.sh
Executable file
16
profiles/run-ln.sh
Executable 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 _
|
||||||
|
|
||||||
|
cp -rf $PWD ~/profiles
|
||||||
|
|
||||||
|
export Profile_PATH=~/profiles
|
||||||
|
ln -sf profiles/bash/.bashrc ~/.bashrc
|
||||||
|
ln -sf ../../profiles/fish/.config/fish/config.fish ~/.config/fish/config.fish
|
||||||
|
ln -sf profiles/vim/.vimrc ~/.vimrc
|
||||||
|
ln -sf profiles/tmux/.tmux.conf ~/.tmux.conf
|
||||||
|
|
||||||
|
echo "Finished"
|
||||||
3
profiles/run.sh
Executable file
3
profiles/run.sh
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
stow tmux vim bash fish
|
||||||
37
profiles/shell/aliases
Normal file
37
profiles/shell/aliases
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
# colorful for bash
|
||||||
|
alias ls="ls -F --color=auto"
|
||||||
|
alias grep="grep --color=auto"
|
||||||
|
|
||||||
|
# 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 nginx="docker exec nginx nginx"
|
||||||
|
alias debian="docker exec -it debian bash"
|
||||||
|
alias archlinux="docker exec -it arch bash"
|
||||||
|
|
||||||
|
# Package Manager
|
||||||
|
## Change the package manager to your own, like apt/dnf/pacman, etc.
|
||||||
|
## If you not a root user, please use "sudo xxx".
|
||||||
|
export pkg="yay"
|
||||||
|
|
||||||
|
#. $Profile_PATH/shell/pkg
|
||||||
|
. $Profile_PATH/shell/pacman
|
||||||
10
profiles/shell/pacman
Normal file
10
profiles/shell/pacman
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# Shortcuts for pacman/yay/...
|
||||||
|
|
||||||
|
alias search="$pkg -Ss"
|
||||||
|
alias show="$pkg -Si"
|
||||||
|
alias info="$pkg -Qi"
|
||||||
|
alias update="$pkg -Sy"
|
||||||
|
alias upgrade="$pkg -Syu"
|
||||||
|
alias install="$pkg -S"
|
||||||
|
alias remove="$pkg -Rncs"
|
||||||
|
alias autoremove="$pkg -Qtdq | $pkg -Rns -"
|
||||||
13
profiles/shell/pkg
Executable file
13
profiles/shell/pkg
Executable file
@ -0,0 +1,13 @@
|
|||||||
|
# Shortcuts for APT/DNF/...
|
||||||
|
## The "show" is APT only, DNF has "info" instead.
|
||||||
|
## APT has alias "info" for "show", although it's not mentioned.
|
||||||
|
|
||||||
|
alias search="$pkg search"
|
||||||
|
alias list="$pkg list"
|
||||||
|
alias show="$pkg show"
|
||||||
|
alias info="$pkg info"
|
||||||
|
alias update="$pkg update"
|
||||||
|
alias upgrade="$pkg update && $pkg upgrade"
|
||||||
|
alias install="$pkg install"
|
||||||
|
alias remove="$pkg remove"
|
||||||
|
alias autoremove="$pkg autoremove"
|
||||||
12
profiles/tmux/.tmux.conf
Normal file
12
profiles/tmux/.tmux.conf
Normal file
@ -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
|
||||||
41
profiles/vim/.vimrc
Normal file
41
profiles/vim/.vimrc
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
" 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>
|
||||||
|
|
||||||
|
" 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
|
||||||
|
|
||||||
15
run-ln.sh
Executable file
15
run-ln.sh
Executable file
@ -0,0 +1,15 @@
|
|||||||
|
#!/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 _
|
||||||
|
|
||||||
|
cp -rf $PWD ~/profiles
|
||||||
|
|
||||||
|
ln -sf profiles/bash/.bashrc ~/.bashrc
|
||||||
|
ln -sf ../../profiles/fish/.config/fish/config.fish ~/.config/fish/config.fish
|
||||||
|
ln -sf profiles/vim/.vimrc ~/.vimrc
|
||||||
|
ln -sf profiles/tmux/.tmux.conf ~/.tmux.conf
|
||||||
|
|
||||||
|
echo "Finished"
|
||||||
37
shell/aliases
Normal file
37
shell/aliases
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
# colorful for bash
|
||||||
|
alias ls="ls -F --color=auto"
|
||||||
|
alias grep="grep --color=auto"
|
||||||
|
|
||||||
|
# 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 nginx="docker exec nginx nginx"
|
||||||
|
alias debian="docker exec -it debian bash"
|
||||||
|
alias archlinux="docker exec -it arch bash"
|
||||||
|
|
||||||
|
# Package Manager
|
||||||
|
## Change the package manager to your own, like apt/dnf/pacman, etc.
|
||||||
|
## If you not a root user, please use "sudo xxx".
|
||||||
|
export pkg="yay"
|
||||||
|
|
||||||
|
#. $Profile_PATH/shell/pkg
|
||||||
|
. $Profile_PATH/shell/pacman
|
||||||
10
shell/pacman
Normal file
10
shell/pacman
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# Shortcuts for pacman/yay/...
|
||||||
|
|
||||||
|
alias search="$pkg -Ss"
|
||||||
|
alias show="$pkg -Si"
|
||||||
|
alias info="$pkg -Qi"
|
||||||
|
alias update="$pkg -Sy"
|
||||||
|
alias upgrade="$pkg -Syu"
|
||||||
|
alias install="$pkg -S"
|
||||||
|
alias remove="$pkg -Rncs"
|
||||||
|
alias autoremove="$pkg -Qtdq | $pkg -Rns -"
|
||||||
13
shell/pkg
Executable file
13
shell/pkg
Executable file
@ -0,0 +1,13 @@
|
|||||||
|
# Shortcuts for APT/DNF/...
|
||||||
|
## The "show" is APT only, DNF has "info" instead.
|
||||||
|
## APT has alias "info" for "show", although it's not mentioned.
|
||||||
|
|
||||||
|
alias search="$pkg search"
|
||||||
|
alias list="$pkg list"
|
||||||
|
alias show="$pkg show"
|
||||||
|
alias info="$pkg info"
|
||||||
|
alias update="$pkg update"
|
||||||
|
alias upgrade="$pkg update && $pkg upgrade"
|
||||||
|
alias install="$pkg install"
|
||||||
|
alias remove="$pkg remove"
|
||||||
|
alias autoremove="$pkg autoremove"
|
||||||
12
tmux/.tmux.conf
Normal file
12
tmux/.tmux.conf
Normal file
@ -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
|
||||||
41
vim/.vimrc
Normal file
41
vim/.vimrc
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
" 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>
|
||||||
|
|
||||||
|
" 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
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user