1
0
Fork 0

Compare commits

..

No commits in common. "0719d9cedbb0794f5e18530ccc1069d96aabbd5d" and "d40e536ed5656c1c5185782d301ce990953f8e44" have entirely different histories.

2 changed files with 42 additions and 67 deletions

View File

@ -1,11 +1,3 @@
"
" Tips:
"
" - :noh to clear highlighting
" - gd to go to definition
" - g* to search for current word
"
call plug#begin()
" rust
@ -34,13 +26,13 @@ let g:go_highlight_generate_tags = 1
let g:go_metalinter_autosave = 1
let g:go_fmt_command = "goimports"
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>c <Plug>(go-coverage-toggle)
autocmd FileType go nmap <leader>b <Plug>(go-build)
autocmd FileType go nmap <leader>r <Plug>(go-run)
" K -> :GoDoc
call plug#end()
" theme

99
.zshrc
View File

@ -1,8 +1,8 @@
# basic settings
HISTSIZE=5000
SAVEHIST=5000
HISTSIZE=10000
SAVEHIST=50000
HISTFILE=~/.zsh_history
setopt append_history
setopt extended_history
@ -24,33 +24,6 @@ bindkey "^R" history-incremental-pattern-search-backward
alias vim=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
export PATH="$HOME/.local/bin:$PATH"
@ -58,7 +31,7 @@ if [[ -f "$HOME/.deno" ]]; then
export DENO_INSTALL="$HOME/.deno"
export PATH="$DENO_INSTALL/bin:$PATH"
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"
fi
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"
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
case "$(uname -s)" in
@ -94,24 +85,9 @@ if [[ "$TERM" == "xterm-kitty" ]]; then
alias icat="kitty +kitten icat"
alias ssh="kitty +kitten ssh"
fi
setup_term_integration
#slower_functions+=( setup_term_integration )
# 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 )
if [[ $FAST != true ]]; then
setup_term_integration
fi
# directory listings
@ -135,7 +111,12 @@ setup_prompt_vcs() {
zstyle ':vcs_info:*' check-for-changes true
prompt_vcs_enabled=false
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() {
@ -151,7 +132,9 @@ format_vcs_info() {
echo "$text"
fi
}
slower_functions+=( setup_prompt_vcs )
if [[ $FAST != true ]]; then
setup_prompt_vcs
fi
# prompt: return code
format_return_code() {
return_code_=$1
@ -239,10 +222,8 @@ setup_prompt() {
if [[ ! -z "$SSH_CLIENT" ]]; then
PROMPT_USER_MACHINE=$'@%m'
fi
if [[ $prompt_use_italic == true ]]; then
PROMPT_FMT_ITALIC=$(tput sitm)
PROMPT_FMT_RESET=$(tput sgr0)
fi
PROMPT_FMT_ITALIC=$(tput sitm)
PROMPT_FMT_RESET=$(tput sgr 0)
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'
@ -253,9 +234,7 @@ setup_prompt() {
RPROMPT="$PROMPT_HISTORY$PROMPT_USER"
PROMPT="$PROMPT_VI$PROMPT_VCS$PROMPT_DIRECTORY "
}
prompt_use_italic=false
setup_prompt
slower_functions+=( setup_prompt )
# command entry plugins
@ -277,13 +256,17 @@ setup_assistance() {
source "$zsh_plugin_path"
done
}
slower_functions+=( setup_assistance )
if [[ $FAST != true ]]; then
setup_assistance
fi
setup_nope() {
if [[ -f "$(which thefuck 2>/dev/null)" ]]; then
eval $(thefuck --alias nope)
fi
}
slowest_functions+=( setup_nope )
if [[ $SLOW == true ]]; then
setup_nope
fi
# helper scripts