Skip to content

Instantly share code, notes, and snippets.

@mutoe
Last active March 21, 2021 11:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mutoe/a26becb3414ec39a9dda3654b4af7127 to your computer and use it in GitHub Desktop.
Save mutoe/a26becb3414ec39a9dda3654b4af7127 to your computer and use it in GitHub Desktop.
Personal profiles (Vim, Tmux, Zsh, etc.)
[user]
signingkey =
name = mutoe
email = mutoe@foxmail.com
[core]
editor = vim
[diff]
tool = vimdiff
[difftool]
prompt = 0
[merge]
tool = vimdiff
conflictstyle = diff3
[mergetool]
prompt = 0
[alias]
mt = mergetool
df = difftool
source ~/.vimrc
set ideamarks
set ideajoin
set clipboard+=ideaput
map <leader>d <Action>(Debug)
map <leader>r <Action>(Run)
map <leader>c <Action>(RunCoverage)
map <leader>h <Action>(Vcs.ShowTabbedFileHistory)
map <leader>z <Action>(ToggleDistractionFreeMode)
map <leader>p <Action>(TogglePresentationMode)
set-option -g prefix2 `
# source tmux config
bind C-r source-file ~/.tmux.conf\; display-message "Config reloaded"
# Vim copy paste
set -g mode-keys vi
bind -T copy-mode-vi v send-keys -X begin-selection
bind -T copy-mode-vi C-v send-keys -X ractangle-toggle
bind -T copy-mode-vi y send-keys -X copy-selection-and-cancel
bind p pasteb
# auto rename window to current path
# set -g automatic-rename-format '#{b:pane_current_path}'
# set -g status-interval 1
# new panel with current path
bind c new-window -c '#{pane_current_path}'
bind '%' split-window -h -c '#{pane_current_path}'
bind '"' split-window -v -c '#{pane_current_path}'
let mapleader='`'
filetype plugin on
syntax on
set omnifunc=syntaxcomplete#Complete
set showmode
set scrolloff=5
set ruler " show the cursor position
set number
set relativenumber
set autoindent
set shiftwidth=2
set tabstop=2
set softtabstop=2
set expandtab
set copyindent
set clipboard=unnamed
set shell=/bin/zsh
if &diff
map g1 :diffget LOCAL<CR>
map g2 :diffget BASE<CR>
map g3 :diffget REMOTE<CR>
end
source "$HOME/.zinit/bin/zinit.zsh"
# Load a few important annexes, without Turbo
# (this is currently required for annexes)
zinit light-mode for \
zinit-zsh/z-a-rust \
zinit-zsh/z-a-as-monitor \
zinit-zsh/z-a-patch-dl \
zinit-zsh/z-a-bin-gem-node
# Plugins
## oh-my-zsh libraries
zinit snippet OMZ::lib/git.zsh
zinit snippet OMZ::lib/completion.zsh
zinit snippet OMZ::lib/history.zsh
zinit snippet OMZ::lib/key-bindings.zsh
zinit snippet OMZ::lib/directories.zsh
zinit snippet OMZ::lib/clipboard.zsh
zinit snippet OMZ::lib/grep.zsh
zinit snippet OMZ::lib/theme-and-appearance.zsh
## z
zinit ice lucid wait="1"
zinit light skywind3000/z.lua
## search
zinit ice lucid wait="1"
zinit load zdharma/history-search-multi-word
## syntax highlighting
zinit ice lucid wait atinit='zpcompinit'
zinit light zdharma/fast-syntax-highlighting
## auto suggestings
zinit ice lucid wait="1" atload='_zsh_autosuggest_start'
zinit light zsh-users/zsh-autosuggestions
## completions
zinit ice lucid wait="1"
zinit light zsh-users/zsh-completions
## docker
zinit lucid has'docker' wait="2" for \
as'completion' is-snippet \
'https://github.com/docker/cli/blob/master/contrib/completion/zsh/_docker' \
as'completion' is-snippet \
'https://github.com/docker/compose/blob/master/contrib/completion/zsh/_docker-compose' \
## colored man page
zinit ice lucid wait="1"
zinit snippet OMZ::plugins/colored-man-pages/colored-man-pages.plugin.zsh
## quick sudo
zinit ice lucid wait="1"
zinit snippet OMZ::plugins/sudo/sudo.plugin.zsh
## git
zinit ice lucid wait atload="zpcompinit; zpcdreplay"
zinit snippet OMZ::plugins/git/git.plugin.zsh
# Theme
zinit ice depth=1
zinit light romkatv/powerlevel10k
p10k_instant_zsh="${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
if [ -r "$p10k_instant_zsh" ]; then source "$p10k_instant_zsh"; fi
if [ -r "~/.p10k.zsh" ]; then source ~/.p10k.zsh; fi
# Environments
## Homebrew auto-update disable
export HOMEBREW_NO_AUTO_UPDATE=1
## Yarn
if [ -d "$HOME/.yarn" ]; then
export PATH=$PATH:$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin
fi
## Nvm
if [ -d "$HOME/.nvm" ]; then
export NVM_DIR="$HOME/.nvm"
export PATH=$PATH:$NVM_DIR/versions/node/v14.16.0/bin
nvm() { . "/usr/local/opt/nvm/nvm.sh"; nvm $@; }
fi
## Exa list
if command -v exa &> /dev/null; then
DISABLE_LS_COLORS=true
alias ls=exa
fi
# Openjdk
if [ -d "/usr/local/opt/openjdk@11" ]; then
export PATH=$PATH:/usr/local/opt/openjdk@11/bin
fi
# GNU sed
if [ -d "/usr/local/opt/gnu-sed" ]; then
export PATH=$PATH:/usr/local/opt/gnu-sed/libexec/gnubin
fi
# Golang
if [ -d "/usr/local/opt/go" ]; then
export GOROOT=/usr/local/opt/go/libexec
export GOPATH="$HOME/go"
export PATH="$PATH:$GOROOT/bin:$GOPATH/bin"
fi
# Alias
## Proxy
http_server=http://127.0.0.1:1087
socks_server=socks5://127.0.0.1:1080
alias gitproxy="git config --global https.proxy \"$socks_server\" && git config --global http.proxy \"$socks_server\""
alias ungitproxy="git config --global --unset https.proxy && git config --global --unset http.proxy"
alias shproxy="export http_proxy=\"$socks_server\" && export https_proxy=\"$socks_server\""
alias unshproxy="unset http_proxy && unset https_proxy"
alias yarnproxy="yarn config set proxy \"$http_server\" && yarn config set https-proxy \"$http_server\""
alias unyarnproxy="yarn config delete proxy && yarn config delete https-proxy"
alias musicproxy="unblockneteasemusic -p 80:443 -f 59.111.181.35"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment