Add init file timings and lazy load ros2 stuff
This commit is contained in:
16
init.zsh
16
init.zsh
@ -1,5 +1,8 @@
|
||||
# Main zsh config file
|
||||
|
||||
zmodload zsh/datetime
|
||||
let __init_zsh_start="${EPOCHREALTIME}"
|
||||
|
||||
# Enable completions
|
||||
FPATH="${HOME}/.local/share/zsh/site-functions:${FPATH}"
|
||||
autoload -U compinit && compinit
|
||||
@ -255,6 +258,12 @@ source "${ZSH_CONFIG_DIR}/emacs-bookmark.zsh"
|
||||
# Platform specific stuff
|
||||
[ -f /usr/bin/pacman ] && source "${ZSH_CONFIG_DIR}/arch.zsh"
|
||||
|
||||
# Ros2 instll on arch
|
||||
if [[ -d /opt/ros/humble/ ]]; then
|
||||
ZSH_ROS2_ROOT=/opt/ros/humble/
|
||||
source "${ZSH_CONFIG_DIR}/lazy-ros2.zsh"
|
||||
fi
|
||||
|
||||
# FZF Integration
|
||||
load_plugin fzf-tab
|
||||
# Disable sort when completing `git checkout`
|
||||
@ -308,7 +317,7 @@ setopt histignoredups
|
||||
|
||||
# Run fortune and cowsay if we are not in nvim or ssh
|
||||
if cmd_exists fortune && cmd_exists cowsay; then
|
||||
[[ -v NVIM ]] || [[ -v SSH_CLIENT ]] || \
|
||||
[[ -v NVIM ]] || [[ -v SSH_CLIENT ]] || [[ -v INSIDE_EMACS ]] || \
|
||||
fortune | cowsay -felephant-in-snake -n
|
||||
fi
|
||||
|
||||
@ -316,3 +325,8 @@ fi
|
||||
unfunction load_plugin
|
||||
unfunction cmd_exists
|
||||
unfunction source_user_file
|
||||
|
||||
(( ZSH_INIT_TIME="${EPOCHREALTIME}" - __init_zsh_start ))
|
||||
function zsh-init-time {
|
||||
printf 'Zsh initialization took: %05fms\n' "$(( ZSH_INIT_TIME * 1000 ))"
|
||||
}
|
||||
|
Reference in New Issue
Block a user