chore(zsh): split zsh to top/bottom

main
sudo pacman -Syu 2023-07-17 11:50:01 +07:00
parent ddaa901f0c
commit 467088c846
5 changed files with 22 additions and 11 deletions

View File

@ -35,7 +35,7 @@ format:
go install mvdan.cc/sh/v3/cmd/shfmt@latest
gofimports -w --company github.com/make-go-great,github.com/haunt98 .
gofumpt -w -extra .
shfmt -w ./scripts ./data/zsh/extra-zshrc
shfmt -w ./scripts ./data/zsh
build:
$(MAKE) clean

View File

@ -1,6 +1,10 @@
[[apps.zsh.paths]]
internal = "data/zsh/extra-zshrc"
external = "~/.config/zsh/extra-zshrc"
internal = "data/zsh/top-zshrc"
external = "~/.config/zsh/top-zshrc"
[[apps.zsh.paths]]
internal = "data/zsh/bottom-zshrc"
external = "~/.config/zsh/bottom-zshrc"
[[apps.nvim.paths]]
internal = "data/nvim/init.lua"

View File

@ -1,5 +1,5 @@
# Put this on top of ~/.zshrc
# source ~/.config/zsh/extra-zshrc
# Put this on bottom of ~/.zshrc
# source ~/.config/zsh/bottom-zshrc
# https://zsh.sourceforge.io/Doc/Release/Parameters.html#Parameters-Used-By-The-Shell
export HISTORY_IGNORE="(ls|ll|la|cd|pwd|exit|builtin)"
@ -23,12 +23,6 @@ bindkey "^[[1;3D" backward-word
# https://github.com/ohmyzsh/ohmyzsh
zstyle ':omz:update' mode disabled
# https://github.com/ohmyzsh/ohmyzsh/issues/5700
DISABLE_AUTO_TITLE="true"
# https://github.com/ohmyzsh/ohmyzsh/issues/10291
DISABLE_UNTRACKED_FILES_DIRTY="true"
# https://github.com/ohmyzsh/ohmyzsh/issues/5569
DISABLE_MAGIC_FUNCTIONS="true"
# https://github.com/romkatv/powerlevel10k
typeset -g POWERLEVEL9K_INSTANT_PROMPT=off

9
data/zsh/top-zshrc Normal file
View File

@ -0,0 +1,9 @@
# Put this on top of ~/.zshrc
# source ~/.config/zsh/top-zshrc
# https://github.com/ohmyzsh/ohmyzsh/issues/5700
DISABLE_AUTO_TITLE="true"
# https://github.com/ohmyzsh/ohmyzsh/issues/10291
DISABLE_UNTRACKED_FILES_DIRTY="true"
# https://github.com/ohmyzsh/ohmyzsh/issues/5569
DISABLE_MAGIC_FUNCTIONS="true"

View File

@ -49,11 +49,15 @@ func LoadConfig(path string) (*ConfigReal, *ConfigDemo, error) {
cfgReal, cfgDemo, err := loadConfigJSON(path)
if err == nil {
return cfgReal, cfgDemo, nil
} else if os.IsNotExist(err) {
return nil, nil, err
}
cfgReal, cfgDemo, err = loadConfigTOML(path)
if err == nil {
return cfgReal, cfgDemo, nil
} else if os.IsNotExist(err) {
return nil, nil, err
}
return nil, nil, ErrConfigNotFound