From 3f644ee76bdbda22b3ac495eda92dde683ec91bb Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Wed, 6 Oct 2021 13:15:39 -0400 Subject: [PATCH] Cut a bunch from .zshrc. Now expects starship. --- .zshrc | 84 +++++++++++++++------------------------------------------- 1 file changed, 21 insertions(+), 63 deletions(-) diff --git a/.zshrc b/.zshrc index 7a85d96..901c033 100644 --- a/.zshrc +++ b/.zshrc @@ -1,5 +1,5 @@ source ~/.zsh_local -source ~/.shell_aliases +source /usr/share/doc/fzf/examples/completion.zsh HISTFILE=~/.histfile HISTSIZE=10000 @@ -23,52 +23,40 @@ export EDITOR="vim" zstyle ':completion:*' completer _expand _complete _ignored _correct _approximate zstyle ':completion:*' matcher-list '+' '+m:{[:lower:]}={[:upper:]}' '+m:{[:lower:][:upper:]}={[:upper:][:lower:]}' '+r:|[._-]=** r:|=** l:|=*' zstyle :compinstall filename '~/.zshrc' +zstyle ':completion:*' ignored-patterns '*.class' autoload -Uz compinit compinit -autoload -Uz vcs_info -precmd() { vcs_info } - -zstyle ':vcs_info:git:*' formats ' [%b]' - -_COMP_COLOR=${COMP_COLOR:-"{white}"} -_USER_COLOR=${USER_COLOR:-"{blue}"} - -setopt PROMPT_SUBST -PROMPT="[%(!.%B%F{red}.%B%F$_USER_COLOR)%n%b%F{white}@%B%F$_COMP_COLOR%m%b%f] %b%F{green}%~%B%F{yellow}${vcs_info_msg_0_} %B%f$%b%f " - # enable color support of ls and also add handy aliases if [ -x /usr/bin/dircolors ]; then test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" - alias ls='ls --color=auto' - alias grep='grep --color=auto' alias fgrep='fgrep --color=auto' alias egrep='egrep --color=auto' fi -export PATH=./:~/.bin:$PATH +export PATH=./:~/.bin:/usr/local/go/bin:$PATH fignore=(o) function SetTtyColors() { - echo -en "\e]P0191e1f" #black 1 - echo -en "\e]P1dc4848" #darkgrey 2 - echo -en "\e]P200aa00" #darkred 3 - echo -en "\e]P3d99f4e" #red 4 - echo -en "\e]P44444aa" #darkgreen 5 - echo -en "\e]P5c436b9" #green 6 - echo -en "\e]P600aaaa" #brown 7 - echo -en "\e]P7d7d7d7" #yellow 8 - echo -en "\e]P87b7b7b" #darkblue 9 - echo -en "\e]P9ff6f6f" #blue 10 - echo -en "\e]PA55ff55" #darkmagenta11 - echo -en "\e]PBffed8b" #magenta 12 - echo -en "\e]PC5555ff" #darkcyan 13 - echo -en "\e]PDff6eff" #cyan 14 - echo -en "\e]PE55ffff" #lightgray 15 - echo -en "\e]PFaaaaaa" #white 16 + echo -en "\e]P0""191e1f" #black 1 + echo -en "\e]P1""dc4848" #darkgrey 2 + echo -en "\e]P2""00aa00" #darkred 3 + echo -en "\e]P3""d99f4e" #red 4 + echo -en "\e]P4""4444aa" #darkgreen 5 + echo -en "\e]P5""c436b9" #green 6 + echo -en "\e]P6""00aaaa" #brown 7 + echo -en "\e]P7""d7d7d7" #yellow 8 + echo -en "\e]P8""7b7b7b" #darkblue 9 + echo -en "\e]P9""ff6f6f" #blue 10 + echo -en "\e]PA""55ff55" #darkmagenta11 + echo -en "\e]PB""ffed8b" #magenta 12 + echo -en "\e]PC""5555ff" #darkcyan 13 + echo -en "\e]PD""ff6eff" #cyan 14 + echo -en "\e]PE""55ffff" #lightgray 15 + echo -en "\e]PF""aaaaaa" #white 16 clear } @@ -76,37 +64,6 @@ if [ "$TERM" = "linux" ]; then SetTtyColors fi -function _open2(){ - var=$(fc -ln -1); - if [[ $var != *"grep"* ]]; then; - return; - fi; - var=$(sed "s/grepr/grepr -l/" <<< $var); - vim -p `zsh -c "$var" | grep $1` -} - -# After running grepr, `open` plus a match will -# search history for the most recent grepr, -# and open the first file matching the text -# in Vim, at the first matching line number -function _open(){ - command=$(fc -ln -1); - count=1; - while [[ $command != *"grepr"* ]]; do - ((count++)) - command=$(fc -ln -$count | head -n 1); - done; - - # echo '$@' - line=$(zsh -c "$command" | grep $1 | sed "s/^[^:]*://g" | sed "s/:.*//" | head -n 1); - echo $line; - file=$(zsh -c "$command" | grep $1 | sed "s/:.*//" | head -n 1); - echo $file; - - vim +$line -p `echo $file`; - -} - function pushdot { cd ~/.dotfiles && if [ $# -eq 0 ]; then @@ -123,4 +80,5 @@ function getdot { cd - } -export fsu="vaillanc@linprog.cs.fsu.edu" +eval "$(starship init zsh)" +source ~/.shell_aliases