Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have to Source ~/.zshrc for it to function #122

Open
Padswynn opened this issue Jun 9, 2021 · 7 comments
Open

Have to Source ~/.zshrc for it to function #122

Padswynn opened this issue Jun 9, 2021 · 7 comments

Comments

@Padswynn
Copy link

Padswynn commented Jun 9, 2021

Basically title is the problem. I have to do this everytime I load the shell interactive, and this is the only plugin that doesn't function.

I used OMF at first, and the problem started. Then I switched to Antigen, still a problem, and I even installed it via arch's repository... still nothing. Here is my .zshrc:

source $HOME/antigen.zsh

# The Order of the Plugins hasn't seemed to help
antigen bundle jeffreytse/zsh-vi-mode
antigen bundle zsh-users/zsh-completions
antigen bundle zsh-users/zsh-autosuggestions
antigen bundle zsh-users/zsh-syntax-highlighting
antigen bundle zsh-users/zsh-history-substring-search

antigen apply

# Some fun interactive stuff
[[ -o interactive ]] && echo 'This is What Space Smells Like'
[[ -o interactive ]] && (cat ~/.cache/wal/sequences &)
[[ -o interactive ]] && source ~/.cache/wal/colors-tty.sh
[[ -o interactive ]] && . ~/.cache/wal/colors.sh
# Commented out, but did not work when commented in either
# [[ -o interactive ]] && source zsh-syntax-highlighting.zsh
# [[ -o interactive ]] && source zsh-history-substring-search.zsh

# My Prompt stuff
function zvm_after_select_vi_mode() {
  case $ZVM_MODE in
    $ZVM_MODE_NORMAL)
      PROMPT='%B%F{yellow}paddy%f%b at %B%F{magenta}%m%f%b in %B%F{yellow}%~%f%b
↪ '
    ;; 
    $ZVM_MODE_INSERT)
      PROMPT='%F{yellow}%Bpaddy%f%b at %F{magenta}%B%m%f%b in %B%F{yellow}%~%f%b %B%F{blue}
↪%b%f '
    ;;
    $ZVM_MODE_VISUAL)
      PROMPT='%F{yellow}%Bpaddy%f%b at %F{magenta}%B%m%f%b in %B%F{yellow}%~%f%b
↪ '
    ;;
    $ZVM_MODE_VISUAL_LINE)
      PROMPT='%F{yellow}%Bpaddy%f%b at %F{magenta}%B%m%f%b in %B%F{yellow}%~%f%b
↪ '
    ;;
    $ZVM_MODE_REPLACE)
      PROMPT='%F{yellow}%Bpaddy%f%b at %F{magenta}%B%m%f%b in %B%F{yellow}%~%f%b
↪'
    ;;
  esac
}
ZVM_CURSOR_STYLE_ENABLED=false
HISTFILE=~/zsh/histfile
HISTSIZE=1000
SAVEHIST=5000

# neither set of bindkeys helped
bindkey "$terminfo[kcuu1]" history-substring-search-up
bindkey "$terminfo[kcud1]" history-substring-search-down
bindkey '^[[A' history-substring-search-up
bindkey '^[[B' history-substring-search-down


path+=('/home/paddy/.local/bin', '/home/paddy/files/prog', '/home/paddy/.emacs.d/bin')
export PATH

alias foo='bar'
alias foo2='bar2'
@E-ricus
Copy link

E-ricus commented Sep 15, 2021

I see the same thing, I have to source for it to work, it only happens to me on mac, with the exact same configuration on linux, it works as expected

@E-ricus
Copy link

E-ricus commented Sep 15, 2021

@Padsworth #110 (comment) this worked for me

@Padswynn
Copy link
Author

@ericpubu Thanks a ton - no point in using antigen if it's not going to work for me right? Also zinit just seems to be so much faster. Still wish I knew why this happened, but oh well.

@Matthieu-OD
Copy link

Were you able to fix this error? I have the same on my mac. I tried with oh-my-zsh installation and brew installation.

@notuxic
Copy link

notuxic commented Apr 6, 2022

I had the same issue, where the plugin is installed through antigen and would only work after manually sourcing the .zshrc.
In my case the keybinds for the arrow-keys were sneakily overwritten by a setopt EMACS, which seems to do nothing when already set, which is why it worked after sourcing the .zshrc a second time.

So if anyone else runs into this problem, run keybind to check if your keybinds are actually properly set. They may just have been overwritten by something else (maybe some config-files shipped with the installed zsh package, which would explain why the same config works on some systems but not others).

@t56k
Copy link

t56k commented May 16, 2022

Just bind the keys at the bottom of your .zshrc. Problem solved on macOS

@vcolano
Copy link

vcolano commented Oct 12, 2023

If you are facing this issue and also using https://github.com/jeffreytse/zsh-vi-mode then check out #140

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants