Compare commits
No commits in common. "0719d9cedbb0794f5e18530ccc1069d96aabbd5d" and "d40e536ed5656c1c5185782d301ce990953f8e44" have entirely different histories.
0719d9cedb
...
d40e536ed5
|
@ -1,11 +1,3 @@
|
||||||
"
|
|
||||||
" Tips:
|
|
||||||
"
|
|
||||||
" - :noh to clear highlighting
|
|
||||||
" - gd to go to definition
|
|
||||||
" - g* to search for current word
|
|
||||||
"
|
|
||||||
|
|
||||||
call plug#begin()
|
call plug#begin()
|
||||||
|
|
||||||
" rust
|
" rust
|
||||||
|
@ -34,13 +26,13 @@ let g:go_highlight_generate_tags = 1
|
||||||
let g:go_metalinter_autosave = 1
|
let g:go_metalinter_autosave = 1
|
||||||
let g:go_fmt_command = "goimports"
|
let g:go_fmt_command = "goimports"
|
||||||
let g:go_list_type_commands = {"GoMetaLinterAutoSave": "quickfix"}
|
let g:go_list_type_commands = {"GoMetaLinterAutoSave": "quickfix"}
|
||||||
autocmd FileType go nmap <leader>a <Plug>(go-alternate-edit)
|
|
||||||
autocmd FileType go nmap <leader>t <Plug>(go-test)
|
autocmd FileType go nmap <leader>t <Plug>(go-test)
|
||||||
autocmd FileType go nmap <Leader>c <Plug>(go-coverage-toggle)
|
autocmd FileType go nmap <Leader>c <Plug>(go-coverage-toggle)
|
||||||
autocmd FileType go nmap <leader>b <Plug>(go-build)
|
autocmd FileType go nmap <leader>b <Plug>(go-build)
|
||||||
autocmd FileType go nmap <leader>r <Plug>(go-run)
|
autocmd FileType go nmap <leader>r <Plug>(go-run)
|
||||||
" K -> :GoDoc
|
" K -> :GoDoc
|
||||||
|
|
||||||
|
|
||||||
call plug#end()
|
call plug#end()
|
||||||
|
|
||||||
" theme
|
" theme
|
||||||
|
|
99
.zshrc
99
.zshrc
|
@ -1,8 +1,8 @@
|
||||||
|
|
||||||
# basic settings
|
# basic settings
|
||||||
|
|
||||||
HISTSIZE=5000
|
HISTSIZE=10000
|
||||||
SAVEHIST=5000
|
SAVEHIST=50000
|
||||||
HISTFILE=~/.zsh_history
|
HISTFILE=~/.zsh_history
|
||||||
setopt append_history
|
setopt append_history
|
||||||
setopt extended_history
|
setopt extended_history
|
||||||
|
@ -24,33 +24,6 @@ bindkey "^R" history-incremental-pattern-search-backward
|
||||||
alias vim=nvim
|
alias vim=nvim
|
||||||
export EDITOR=nvim
|
export EDITOR=nvim
|
||||||
|
|
||||||
# speed
|
|
||||||
|
|
||||||
slower_functions=()
|
|
||||||
load_slower() {
|
|
||||||
for func in $slower_functions; do
|
|
||||||
$func
|
|
||||||
done
|
|
||||||
}
|
|
||||||
slowest_functions=()
|
|
||||||
load_slowest() {
|
|
||||||
for func in $slowest_functions; do
|
|
||||||
$func
|
|
||||||
done
|
|
||||||
}
|
|
||||||
prompt_run_count=0
|
|
||||||
on_second_prompt() {
|
|
||||||
if [[ "$prompt_run_count" == 1 ]]; then
|
|
||||||
#zmodload zsh/zprof
|
|
||||||
prompt_use_italic=true
|
|
||||||
load_slower
|
|
||||||
#load_slowest
|
|
||||||
#zprof
|
|
||||||
fi
|
|
||||||
(( prompt_run_count = prompt_run_count + 1 ))
|
|
||||||
}
|
|
||||||
precmd_functions+=( on_second_prompt )
|
|
||||||
|
|
||||||
# executables
|
# executables
|
||||||
|
|
||||||
export PATH="$HOME/.local/bin:$PATH"
|
export PATH="$HOME/.local/bin:$PATH"
|
||||||
|
@ -58,7 +31,7 @@ if [[ -f "$HOME/.deno" ]]; then
|
||||||
export DENO_INSTALL="$HOME/.deno"
|
export DENO_INSTALL="$HOME/.deno"
|
||||||
export PATH="$DENO_INSTALL/bin:$PATH"
|
export PATH="$DENO_INSTALL/bin:$PATH"
|
||||||
fi
|
fi
|
||||||
if [[ -f "$(which ruby 2>/dev/null)" ]]; then
|
if [[ -f "$(which go 2>/dev/null)" ]]; then
|
||||||
export PATH="$(ruby -e 'puts Gem.user_dir')/bin:$PATH"
|
export PATH="$(ruby -e 'puts Gem.user_dir')/bin:$PATH"
|
||||||
fi
|
fi
|
||||||
if [[ -f "$(which go 2>/dev/null)" ]]; then
|
if [[ -f "$(which go 2>/dev/null)" ]]; then
|
||||||
|
@ -68,6 +41,24 @@ if [[ -f "$(which cargo 2>/dev/null)" ]]; then
|
||||||
export PATH="$HOME/.cargo/bin:$PATH"
|
export PATH="$HOME/.cargo/bin:$PATH"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# completion
|
||||||
|
|
||||||
|
setup_completion() {
|
||||||
|
autoload -U compinit; compinit
|
||||||
|
autoload -U +X bashcompinit && bashcompinit
|
||||||
|
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
|
||||||
|
|
||||||
|
if [[ -f "$(which mc 2>/dev/null)" ]]; then
|
||||||
|
complete -o nospace -C mc mc
|
||||||
|
fi
|
||||||
|
if [[ -f "$(which kubectl 2>/dev/null)" ]]; then
|
||||||
|
source <(kubectl completion zsh)
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
if [[ $SLOW == true ]]; then
|
||||||
|
setup_completion
|
||||||
|
fi
|
||||||
|
|
||||||
# platform specific
|
# platform specific
|
||||||
|
|
||||||
case "$(uname -s)" in
|
case "$(uname -s)" in
|
||||||
|
@ -94,24 +85,9 @@ if [[ "$TERM" == "xterm-kitty" ]]; then
|
||||||
alias icat="kitty +kitten icat"
|
alias icat="kitty +kitten icat"
|
||||||
alias ssh="kitty +kitten ssh"
|
alias ssh="kitty +kitten ssh"
|
||||||
fi
|
fi
|
||||||
setup_term_integration
|
if [[ $FAST != true ]]; then
|
||||||
#slower_functions+=( setup_term_integration )
|
setup_term_integration
|
||||||
|
fi
|
||||||
# completion
|
|
||||||
|
|
||||||
setup_completion() {
|
|
||||||
autoload -U compinit; compinit
|
|
||||||
autoload -U +X bashcompinit && bashcompinit
|
|
||||||
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
|
|
||||||
|
|
||||||
if [[ -f "$(which mc 2>/dev/null)" ]]; then
|
|
||||||
complete -o nospace -C mc mc
|
|
||||||
fi
|
|
||||||
if [[ -f "$(which kubectl 2>/dev/null)" ]]; then
|
|
||||||
source <(kubectl completion zsh)
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
slowest_functions+=( setup_completion )
|
|
||||||
|
|
||||||
# directory listings
|
# directory listings
|
||||||
|
|
||||||
|
@ -135,7 +111,12 @@ setup_prompt_vcs() {
|
||||||
zstyle ':vcs_info:*' check-for-changes true
|
zstyle ':vcs_info:*' check-for-changes true
|
||||||
prompt_vcs_enabled=false
|
prompt_vcs_enabled=false
|
||||||
precmd_vcs_info() {
|
precmd_vcs_info() {
|
||||||
vcs_info
|
if [[ $prompt_vcs_enabled == true ]]; then
|
||||||
|
vcs_info
|
||||||
|
elif [[ -d ".git" ]]; then
|
||||||
|
prompt_vcs_enabled=true
|
||||||
|
vcs_info
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
format_vcs_info() {
|
format_vcs_info() {
|
||||||
|
@ -151,7 +132,9 @@ format_vcs_info() {
|
||||||
echo "$text"
|
echo "$text"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
slower_functions+=( setup_prompt_vcs )
|
if [[ $FAST != true ]]; then
|
||||||
|
setup_prompt_vcs
|
||||||
|
fi
|
||||||
# prompt: return code
|
# prompt: return code
|
||||||
format_return_code() {
|
format_return_code() {
|
||||||
return_code_=$1
|
return_code_=$1
|
||||||
|
@ -239,10 +222,8 @@ setup_prompt() {
|
||||||
if [[ ! -z "$SSH_CLIENT" ]]; then
|
if [[ ! -z "$SSH_CLIENT" ]]; then
|
||||||
PROMPT_USER_MACHINE=$'@%m'
|
PROMPT_USER_MACHINE=$'@%m'
|
||||||
fi
|
fi
|
||||||
if [[ $prompt_use_italic == true ]]; then
|
PROMPT_FMT_ITALIC=$(tput sitm)
|
||||||
PROMPT_FMT_ITALIC=$(tput sitm)
|
PROMPT_FMT_RESET=$(tput sgr 0)
|
||||||
PROMPT_FMT_RESET=$(tput sgr0)
|
|
||||||
fi
|
|
||||||
|
|
||||||
PROMPT_USER=$'%{'"$PROMPT_FMT_ITALIC"$'%}%F{'"$PROMPT_COLOR_ALWAYS_BASE3"$'}%(!.%K{'"$PROMPT_COLOR_ORANGE"$'}.%K{'"$PROMPT_COLOR_BLUE"$'}) %n'"$PROMPT_USER_MACHINE"$' %k%f%{'"$PROMPT_FMT_RESET"$'%}'
|
PROMPT_USER=$'%{'"$PROMPT_FMT_ITALIC"$'%}%F{'"$PROMPT_COLOR_ALWAYS_BASE3"$'}%(!.%K{'"$PROMPT_COLOR_ORANGE"$'}.%K{'"$PROMPT_COLOR_BLUE"$'}) %n'"$PROMPT_USER_MACHINE"$' %k%f%{'"$PROMPT_FMT_RESET"$'%}'
|
||||||
PROMPT_HISTORY=$'%F{'"$PROMPT_COLOR_BASE01"$'} %h %f'
|
PROMPT_HISTORY=$'%F{'"$PROMPT_COLOR_BASE01"$'} %h %f'
|
||||||
|
@ -253,9 +234,7 @@ setup_prompt() {
|
||||||
RPROMPT="$PROMPT_HISTORY$PROMPT_USER"
|
RPROMPT="$PROMPT_HISTORY$PROMPT_USER"
|
||||||
PROMPT="$PROMPT_VI$PROMPT_VCS$PROMPT_DIRECTORY "
|
PROMPT="$PROMPT_VI$PROMPT_VCS$PROMPT_DIRECTORY "
|
||||||
}
|
}
|
||||||
prompt_use_italic=false
|
|
||||||
setup_prompt
|
setup_prompt
|
||||||
slower_functions+=( setup_prompt )
|
|
||||||
|
|
||||||
# command entry plugins
|
# command entry plugins
|
||||||
|
|
||||||
|
@ -277,13 +256,17 @@ setup_assistance() {
|
||||||
source "$zsh_plugin_path"
|
source "$zsh_plugin_path"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
slower_functions+=( setup_assistance )
|
if [[ $FAST != true ]]; then
|
||||||
|
setup_assistance
|
||||||
|
fi
|
||||||
setup_nope() {
|
setup_nope() {
|
||||||
if [[ -f "$(which thefuck 2>/dev/null)" ]]; then
|
if [[ -f "$(which thefuck 2>/dev/null)" ]]; then
|
||||||
eval $(thefuck --alias nope)
|
eval $(thefuck --alias nope)
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
slowest_functions+=( setup_nope )
|
if [[ $SLOW == true ]]; then
|
||||||
|
setup_nope
|
||||||
|
fi
|
||||||
|
|
||||||
# helper scripts
|
# helper scripts
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue