commit f92c0e282cf7083d44984dd25f78842a5fc499c7
parent c6e9c6d4dc768ce3762f6507a1c08aebbff909ed
Author: Alex Balgavy <a.balgavy@gmail.com>
Date: Wed, 26 Feb 2020 11:30:48 +0100
shell: some changes
Former-commit-id: 3a028bbc67a88e63691a6055e2ce1a22703b9a8e
Diffstat:
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/shell/functions b/shell/functions
@@ -8,7 +8,7 @@ hr() { for ((i=0; i<$(tput cols); i++)); do echo -n "#"; done; echo; } # in
vimq() { vim -q <($(fc -nl -1)); } # load results of last command (often ag) in vim quickfix
gpip(){ PIP_REQUIRE_VIRTUALENV="" pip "$@"; } # Access global pip while using virtualenvs
nls() { expr `ls -l | wc -l | xargs echo` - 1; } # Count the number of files in the directory
-
+zsh_recomp() { rm ~/.zcompdump && compinit; }
notify() {
if type terminal-notifier &> /dev/null; then
terminal-notifier -title "$1" -message "$2" -activate com.googlecode.iterm2
diff --git a/shell/zshrc b/shell/zshrc
@@ -1,6 +1,8 @@
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block, everything else may go below.
+[ -n "$DOTFILES" ] || { echo '$DOTFILES not set' && exit 1; }
+
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
@@ -16,8 +18,7 @@ setopt interactivecomments
# Enable extra completions
fpath=($DOTFILES/shell/zsh-completions/src $fpath)
-autoload -Uz compinit
-compinit
+autoload -Uz compinit && compinit
source $DOTFILES/shell/oh-my-zsh-defaults/completion.zsh
source $DOTFILES/shell/oh-my-zsh-defaults/directories.zsh
source $DOTFILES/shell/oh-my-zsh-defaults/clipboard.zsh