Skip to content

Commit 6db10fb

Browse files
committed
Move initialisation of version managers to zprofile
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
1 parent 8ecc173 commit 6db10fb

File tree

5 files changed

+18
-26
lines changed

5 files changed

+18
-26
lines changed

install.conf.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
~/.vim:
2525
~/.vimrc:
2626
~/.weechat:
27+
~/.zprofile:
2728
~/.zsh:
2829
~/.zshenv:
2930
~/.zshrc:

vimrc

+3-1
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ set updatetime=250
158158
set signcolumn=yes
159159
set synmaxcol=1000
160160
set regexpengine=1
161+
set shell=/usr/local/bin/zsh\ -l
161162
if executable('par')
162163
set formatprg=par
163164
endif
@@ -721,8 +722,9 @@ highlight! link MatchParen ToolbarLine
721722

722723
augroup vimrc
723724

724-
" Use JavaScript filetype for jsx files
725+
" Set or overrule filetypes
725726
autocmd BufNewFile,BufRead *.jsx set filetype=javascript
727+
autocmd BufNewFile,BufRead .zprofile,zprofile set filetype=zsh
726728

727729
" Easier to quit help, quickfix and location window
728730
autocmd FileType help,qf noremap <silent> <buffer> q :q<cr>

zprofile

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Pyenv
2+
export CFLAGS=-I/usr/local/opt/openssl/include
3+
export LDFLAGS=-L/usr/local/opt/openssl/lib
4+
export PYENV_VIRTUALENV_DISABLE_PROMPT=1
5+
source $HOME/.zsh/zsh-pyenv-lazy/pyenv-lazy.plugin.zsh
6+
7+
# Rbenv
8+
source $HOME/.zsh/zsh-rbenv-lazy/rbenv-lazy.plugin.zsh
9+
10+
# Nvm
11+
export NVM_LAZY_LOAD=true
12+
source $HOME/.zsh/zsh-nvm/zsh-nvm.plugin.zsh

zshenv

-23
Original file line numberDiff line numberDiff line change
@@ -38,29 +38,6 @@ export RIPGREP_CONFIG_PATH=$HOME/.ripgreprc
3838
# Less
3939
export LESS=-x4icWRM
4040

41-
# =============================================================================
42-
# PLUGINS
43-
# =============================================================================
44-
45-
# -----------------------------------------------------------------------------
46-
# Pyenv
47-
# -----------------------------------------------------------------------------
48-
export CFLAGS=-I/usr/local/opt/openssl/include
49-
export LDFLAGS=-L/usr/local/opt/openssl/lib
50-
export PYENV_VIRTUALENV_DISABLE_PROMPT=1
51-
source $HOME/.zsh/zsh-pyenv-lazy/pyenv-lazy.plugin.zsh
52-
53-
# -----------------------------------------------------------------------------
54-
# Rbenv
55-
# -----------------------------------------------------------------------------
56-
source $HOME/.zsh/zsh-rbenv-lazy/rbenv-lazy.plugin.zsh
57-
58-
# -----------------------------------------------------------------------------
59-
# Nvm
60-
# -----------------------------------------------------------------------------
61-
export NVM_LAZY_LOAD=true
62-
source $HOME/.zsh/zsh-nvm/zsh-nvm.plugin.zsh
63-
6441
# =============================================================================
6542
# PATH
6643
# https://superuser.com/a/598924

zshrc

+2-2
Original file line numberDiff line numberDiff line change
@@ -233,10 +233,10 @@ function gate() {
233233
fi
234234
}
235235

236-
# Execute shell configuration
236+
# Execute new shell
237237
function refresh() {
238238
echo "Refreshing shell..."
239-
exec zsh
239+
exec "$SHELL" -l
240240
}
241241

242242
# Perform operations on Wi-Fi

0 commit comments

Comments
 (0)