Skip to content

Commit

Permalink
Move initialisation of version managers to zprofile
Browse files Browse the repository at this point in the history
I noticed a considerable delay in skhd, similar to what was reported by
someone else. The sourcing in zshenv is making the shell slow, so we
need to offload it to zprofile. This file is only sourced for login
shells.

koekeishiya/skhd#42
https://unix.stackexchange.com/a/487889
  • Loading branch information
chunkhang committed Jun 12, 2019
1 parent 8ecc173 commit 6db10fb
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 26 deletions.
1 change: 1 addition & 0 deletions install.conf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
~/.vim:
~/.vimrc:
~/.weechat:
~/.zprofile:
~/.zsh:
~/.zshenv:
~/.zshrc:
Expand Down
4 changes: 3 additions & 1 deletion vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ set updatetime=250
set signcolumn=yes
set synmaxcol=1000
set regexpengine=1
set shell=/usr/local/bin/zsh\ -l
if executable('par')
set formatprg=par
endif
Expand Down Expand Up @@ -721,8 +722,9 @@ highlight! link MatchParen ToolbarLine

augroup vimrc

" Use JavaScript filetype for jsx files
" Set or overrule filetypes
autocmd BufNewFile,BufRead *.jsx set filetype=javascript
autocmd BufNewFile,BufRead .zprofile,zprofile set filetype=zsh

" Easier to quit help, quickfix and location window
autocmd FileType help,qf noremap <silent> <buffer> q :q<cr>
Expand Down
12 changes: 12 additions & 0 deletions zprofile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Pyenv
export CFLAGS=-I/usr/local/opt/openssl/include
export LDFLAGS=-L/usr/local/opt/openssl/lib
export PYENV_VIRTUALENV_DISABLE_PROMPT=1
source $HOME/.zsh/zsh-pyenv-lazy/pyenv-lazy.plugin.zsh

# Rbenv
source $HOME/.zsh/zsh-rbenv-lazy/rbenv-lazy.plugin.zsh

# Nvm
export NVM_LAZY_LOAD=true
source $HOME/.zsh/zsh-nvm/zsh-nvm.plugin.zsh
23 changes: 0 additions & 23 deletions zshenv
Original file line number Diff line number Diff line change
Expand Up @@ -38,29 +38,6 @@ export RIPGREP_CONFIG_PATH=$HOME/.ripgreprc
# Less
export LESS=-x4icWRM

# =============================================================================
# PLUGINS
# =============================================================================

# -----------------------------------------------------------------------------
# Pyenv
# -----------------------------------------------------------------------------
export CFLAGS=-I/usr/local/opt/openssl/include
export LDFLAGS=-L/usr/local/opt/openssl/lib
export PYENV_VIRTUALENV_DISABLE_PROMPT=1
source $HOME/.zsh/zsh-pyenv-lazy/pyenv-lazy.plugin.zsh

# -----------------------------------------------------------------------------
# Rbenv
# -----------------------------------------------------------------------------
source $HOME/.zsh/zsh-rbenv-lazy/rbenv-lazy.plugin.zsh

# -----------------------------------------------------------------------------
# Nvm
# -----------------------------------------------------------------------------
export NVM_LAZY_LOAD=true
source $HOME/.zsh/zsh-nvm/zsh-nvm.plugin.zsh

# =============================================================================
# PATH
# https://superuser.com/a/598924
Expand Down
4 changes: 2 additions & 2 deletions zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,10 @@ function gate() {
fi
}

# Execute shell configuration
# Execute new shell
function refresh() {
echo "Refreshing shell..."
exec zsh
exec "$SHELL" -l
}

# Perform operations on Wi-Fi
Expand Down

0 comments on commit 6db10fb

Please sign in to comment.