Skip to content

Instantly share code, notes, and snippets.

@YoloClin
Created September 19, 2019 10:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YoloClin/ffd82f441d292ccc5f25c62a80c78ad0 to your computer and use it in GitHub Desktop.
Save YoloClin/ffd82f441d292ccc5f25c62a80c78ad0 to your computer and use it in GitHub Desktop.
source ~/.bashrc
# Be careful with this, if you breakt it you won't be able to open terminals!
if [ "$(ps -ocommand= -p $PPID | awk '{print $1}')" != 'script' ] ; then
script -q -f $HOME/.shell_logs/$(date +"%d-%b-%y_%H-%M-%S")_shell.log && exit
fi ;
# Disable escaping of URLs and stuff (significant speed improvement)
DISABLE_MAGIC_FUNCTIONS=true
export ZSH=~/.oh-my-zsh
ZSH_THEME="powerlevel9k/powerlevel9k"
HYPHEN_INSENSITIVE="true"
DISABLE_AUTO_UPDATE="true"
COMPLETION_WAITING_DOTS="true" # red dots whilst waiting for completion.
fpath=(~/.zsh-completions/ $fpath)
plugins=(
colored-man-pages
colorize
command-not-found
cp
dirhistory
zsh-autosuggestions
zsh-syntax-highlighting
)
source $ZSH/oh-my-zsh.sh
alias grep="grep -n --exclude=\*~ --exclude=\#\* --exclude-dir=/root/.shell_logs --exclude-dir=/home/clin/.shell_logs --exclude-dir=~.shell_logs --color=auto "
alias ls='ls --hide="lost+found" --hide="#*" --hide="*~" --hide="*.pyc" --hide="*.egg-info" --hide="__pycache__" --color=auto'
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern cursor)
source ~/.zshrc-theme
unsetopt share_history
# Fixes own+global writable files in ls
LS_COLORS="${LS_COLORS}ow=30;45:"
## Paste speedup
# https://github.com/zsh-users/zsh-autosuggestions/issues/238
pasteinit() {
OLD_SELF_INSERT=${${(s.:.)widgets[self-insert]}[2,3]}
zle -N self-insert url-quote-magic # I wonder if you'd need `.url-quote-magic`?
}
pastefinish() {
zle -N self-insert $OLD_SELF_INSERT
}
zstyle :bracketed-paste-magic paste-init pasteinit
zstyle :bracketed-paste-magic paste-finish pastefinish
@supersexy
Copy link

supersexy commented Sep 19, 2019

I have a question about:

if [ "$(ps -ocommand= -p $PPID | awk '{print $1}')" != 'script' ] ; then
    script -q -f $HOME/.shell_logs/$(date +"%d-%b-%y_%H-%M-%S")_shell.log && exit
fi ;

How could that break to not open terminals anymore?
Would you like to explain, why that could happen? Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment