Moved from bash to zsh LOL
This commit is contained in:
parent
d7902c56f1
commit
b429a174e4
6 changed files with 144 additions and 80 deletions
|
@ -1,9 +0,0 @@
|
||||||
#
|
|
||||||
# ~/.bash_profile
|
|
||||||
#
|
|
||||||
|
|
||||||
[[ -f ~/.bashrc ]] && . ~/.bashrc
|
|
||||||
[[ -f ~/.profile ]] && . ~/.profile
|
|
||||||
|
|
||||||
# If running from tty1 start sway
|
|
||||||
[ "$(tty)" = "/dev/tty1" ] && exec ~/.config/sway/start.sh
|
|
65
.bashrc
65
.bashrc
|
@ -1,65 +0,0 @@
|
||||||
#
|
|
||||||
# ~/.bashrc
|
|
||||||
#
|
|
||||||
|
|
||||||
#if not running interactively, don't do anything
|
|
||||||
[[ $- != *i* ]] && return
|
|
||||||
|
|
||||||
set -o vi
|
|
||||||
PS1='\[\e[31m\]\W\[\e[m\] \[\e[32m\]>\[\e[m\] '
|
|
||||||
|
|
||||||
# I don't know what these do for now, might or might not break something if disabled
|
|
||||||
#unset use_color safe_term match_lhs sh
|
|
||||||
#use_color=true
|
|
||||||
#xhost +local:root > /dev/null 2>&1
|
|
||||||
#complete -cf sudo
|
|
||||||
|
|
||||||
alias cp='cp -i' # confirm before overwriting something
|
|
||||||
alias df='df -h' # human-readable sizes
|
|
||||||
alias du='du -h'
|
|
||||||
alias free='free -h'
|
|
||||||
|
|
||||||
alias ls='ls --color=auto'
|
|
||||||
alias grep='grep --colour=auto'
|
|
||||||
alias egrep='egrep --colour=auto'
|
|
||||||
alias fgrep='fgrep --colour=auto'
|
|
||||||
|
|
||||||
# [[ Not sure about these, guess I'll just keep them...
|
|
||||||
|
|
||||||
# Bash won't get SIGWINCH if another process is in the foreground.
|
|
||||||
# Enable checkwinsize so that bash will check the terminal size when
|
|
||||||
# it regains control. #65623
|
|
||||||
# http://cnswww.cns.cwru.edu/~chet/bash/FAQ (E11)
|
|
||||||
shopt -s checkwinsize
|
|
||||||
shopt -s expand_aliases
|
|
||||||
|
|
||||||
# Enable history appending instead of overwriting. #139609
|
|
||||||
shopt -s histappend
|
|
||||||
# ]]
|
|
||||||
|
|
||||||
# # ext - archive extractor
|
|
||||||
# # usage: ext <file>
|
|
||||||
ext ()
|
|
||||||
{
|
|
||||||
if [ -f $1 ] ; then
|
|
||||||
case $1 in
|
|
||||||
*.tar.bz2) tar xjf $1 ;;
|
|
||||||
*.tar.gz) tar xzf $1 ;;
|
|
||||||
*.bz2) bunzip2 $1 ;;
|
|
||||||
*.rar) unrar x $1 ;;
|
|
||||||
*.gz) gunzip $1 ;;
|
|
||||||
*.tar) tar xf $1 ;;
|
|
||||||
*.tbz2) tar xjf $1 ;;
|
|
||||||
*.tgz) tar xzf $1 ;;
|
|
||||||
*.zip) unzip $1 ;;
|
|
||||||
*.Z) uncompress $1;;
|
|
||||||
*.7z) 7z x $1 ;;
|
|
||||||
*) echo "'$1' cannot be extracted via ext()" ;;
|
|
||||||
esac
|
|
||||||
else
|
|
||||||
echo "'$1' is not a valid file"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# User added aliases
|
|
||||||
alias vim='nvim'
|
|
|
@ -1,6 +1,3 @@
|
||||||
# This runs at login. Normally environmental variables are set here.
|
|
||||||
|
|
||||||
# Add ~/.local/bin to path
|
|
||||||
export PATH=$PATH:$HOME/.local/bin
|
export PATH=$PATH:$HOME/.local/bin
|
||||||
|
|
||||||
# Default programs:
|
# Default programs:
|
||||||
|
@ -14,3 +11,6 @@ export FILEMANAGER="pcmanfm-qt"
|
||||||
#export QT_STYLE_OVERRIDE=kvantum
|
#export QT_STYLE_OVERRIDE=kvantum
|
||||||
export QT_QPA_PLATFORMTHEME=qt5ct
|
export QT_QPA_PLATFORMTHEME=qt5ct
|
||||||
#export DESKTOP_SESSION=KDE
|
#export DESKTOP_SESSION=KDE
|
||||||
|
|
||||||
|
# If running from tty1 start sway
|
||||||
|
[ "$(tty)" = "/dev/tty1" ] && exec ~/.config/sway/start.sh
|
138
.zshrc
Normal file
138
.zshrc
Normal file
|
@ -0,0 +1,138 @@
|
||||||
|
HISTFILE=~/.histfile
|
||||||
|
HISTSIZE=2200
|
||||||
|
SAVEHIST=2000
|
||||||
|
setopt extendedglob
|
||||||
|
bindkey -v # I do vi
|
||||||
|
bindkey '^R' history-incremental-search-backward
|
||||||
|
|
||||||
|
autoload -Uz compinit
|
||||||
|
compinit
|
||||||
|
zstyle ':completion:*' menu select
|
||||||
|
zmodload zsh/complist
|
||||||
|
compinit
|
||||||
|
_comp_options+=(globdots) # Include hidden files.
|
||||||
|
|
||||||
|
# COLORS
|
||||||
|
autoload -U colors && colors
|
||||||
|
# less settings
|
||||||
|
export LESS='--RAW-CONTROL-CHARS --LONG-PROMPT --ignore-case --use-color'
|
||||||
|
# Colors in man pages
|
||||||
|
export MANPAGER='less -R --use-color -Dd+177 -Du+45'
|
||||||
|
export MANROFFOPT='-c'
|
||||||
|
|
||||||
|
# Print timing statistics of long running commands
|
||||||
|
REPORTTIME='10'
|
||||||
|
|
||||||
|
stty stop undef # Disable ctrl-s to freeze terminal.
|
||||||
|
|
||||||
|
## Aliases
|
||||||
|
|
||||||
|
# GNU coreutils
|
||||||
|
alias ls='ls --all --color=auto --classify --group-directories-first --human-readable --sort=extension'
|
||||||
|
alias cp='cp -i' # confirm before overwriting something
|
||||||
|
alias df='df -h' # human-readable sizes
|
||||||
|
alias du='du -h'
|
||||||
|
alias free='free -h'
|
||||||
|
# GNU grep & frontends
|
||||||
|
function () {
|
||||||
|
local grepfrontend
|
||||||
|
for grepfrontend in grep xzgrep zgrep zstdgrep; alias "$grepfrontend"="${grepfrontend} --color=auto"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
## Options
|
||||||
|
|
||||||
|
# Changing Directories
|
||||||
|
setopt AUTO_CD
|
||||||
|
|
||||||
|
# Completion
|
||||||
|
setopt COMPLETE_IN_WORD
|
||||||
|
setopt GLOB_COMPLETE
|
||||||
|
setopt LIST_PACKED
|
||||||
|
|
||||||
|
# Expansion and Globbing
|
||||||
|
setopt EXTENDED_GLOB
|
||||||
|
setopt GLOB_DOTS
|
||||||
|
setopt WARN_CREATE_GLOBAL
|
||||||
|
|
||||||
|
# Input/Output
|
||||||
|
setopt CORRECT
|
||||||
|
setopt CORRECT_ALL
|
||||||
|
setopt INTERACTIVE_COMMENTS
|
||||||
|
setopt RM_STAR_WAIT
|
||||||
|
|
||||||
|
# Job Control
|
||||||
|
setopt LONG_LIST_JOBS
|
||||||
|
|
||||||
|
# Prompting
|
||||||
|
setopt PROMPT_SUBST
|
||||||
|
|
||||||
|
# Shell Emulation
|
||||||
|
setopt BSD_ECHO
|
||||||
|
|
||||||
|
## Completion
|
||||||
|
|
||||||
|
# Set up completion cache directories
|
||||||
|
[[ -d "${XDG_CACHE_HOME:-${HOME}/.cache}/zsh/zcompcache" ]] || mkdir -p -- "${XDG_CACHE_HOME:-${HOME}/.cache}/zsh/zcompcache"
|
||||||
|
|
||||||
|
autoload -Uz compinit
|
||||||
|
compinit -d "${XDG_CACHE_HOME:-${HOME}/.cache}/zsh/zcompdump"
|
||||||
|
|
||||||
|
zstyle ':completion::complete:*' cache-path "${XDG_CACHE_HOME:-${HOME}/.cache}/zsh/zcompcache"
|
||||||
|
zstyle ':completion::complete:*' use-cache true
|
||||||
|
#zstyle ':completion:*' rehash true
|
||||||
|
|
||||||
|
zstyle ':completion:*' verbose yes
|
||||||
|
zstyle ':completion:*' menu select=1 select=long-list
|
||||||
|
|
||||||
|
# Zsh sets directory color to red by default. Explicitly set directory color to blue when LS_COLORS is not set.
|
||||||
|
zstyle ':completion:*:default' list-colors "${(s.:.)LS_COLORS:-di=01;34:}"
|
||||||
|
|
||||||
|
zstyle ':completion:*' list-dirs-first true
|
||||||
|
zstyle ':completion:*' list-grouped true
|
||||||
|
zstyle ':completion:*' group-name ''
|
||||||
|
zstyle ':completion:*' list-suffixes true
|
||||||
|
|
||||||
|
zstyle ':completion:*:manuals' separate-sections true
|
||||||
|
zstyle ':completion:*:manuals.*' insert-sections true
|
||||||
|
|
||||||
|
zstyle ':completion:*:descriptions' format '%U%F{cyan}%d%f%u'
|
||||||
|
|
||||||
|
zstyle ':completion:*' matcher-list '' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'r:|[._-]=** r:|=**' 'l:|=* r:|=*'
|
||||||
|
zstyle ':completion:*' completer _complete _ignored _correct _approximate _expand
|
||||||
|
|
||||||
|
# Ignore completion functions (until the _ignored completer)
|
||||||
|
zstyle ':completion:*:functions' ignored-patterns '_*'
|
||||||
|
|
||||||
|
zstyle ':completion:*:*:-command-:*:*' ignored-patterns '_*'
|
||||||
|
|
||||||
|
zstyle ':completion:*:*:-subscript-:*' tag-order indexes parameters
|
||||||
|
|
||||||
|
zstyle ':completion:*' select-prompt '%SScrolling active: current selection at %p%s'
|
||||||
|
|
||||||
|
# Word characters are alphanumeric characters only. Despite the name it does not match the behaviour of Bash.
|
||||||
|
autoload -Uz select-word-style
|
||||||
|
select-word-style bash
|
||||||
|
|
||||||
|
## Prompt
|
||||||
|
|
||||||
|
function () {
|
||||||
|
local prompt_part_username='%B%F{red}%n%f$b'
|
||||||
|
local prompt_part_hostname='%B%F{red}%{${SSH_TTY+%B}%}%M%{${SSH_TTY+%b}%}%f%b'
|
||||||
|
local prompt_part_path='%F{blue}%(!.%/.%~)%f'
|
||||||
|
local prompt_part_priv='%#'
|
||||||
|
local prompt_part_exit='%F{blue}%(?..[%?])%f'
|
||||||
|
local prompt_part_vcs='${vcs_info_msg_0_}'
|
||||||
|
|
||||||
|
typeset -g PROMPT="${prompt_part_username}@${prompt_part_hostname} ${prompt_part_path} ${prompt_part_priv} "
|
||||||
|
typeset -g RPROMPT="${prompt_part_exit} ${prompt_part_vcs}"
|
||||||
|
}
|
||||||
|
|
||||||
|
autoload -Uz add-zsh-hook
|
||||||
|
|
||||||
|
# Version control systems
|
||||||
|
if (( ${+commands[git]} )); then
|
||||||
|
zstyle ':vcs_info:*' enable git
|
||||||
|
zstyle ':vcs_info:*' check-for-changes true
|
||||||
|
add-zsh-hook -Uz precmd vcs_info
|
||||||
|
fi
|
|
@ -4,6 +4,7 @@
|
||||||
What I use right now (stuff I have to install on a fresh linux install):
|
What I use right now (stuff I have to install on a fresh linux install):
|
||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
|
|
||||||
|
* **shell**: ZSH
|
||||||
* **Compositor**: sway (and swaybg, swayidle, swaylock)
|
* **Compositor**: sway (and swaybg, swayidle, swaylock)
|
||||||
* **Bar info**: i3status-rust
|
* **Bar info**: i3status-rust
|
||||||
* **terminal**: foot
|
* **terminal**: foot
|
||||||
|
|
|
@ -22,9 +22,8 @@ read choice
|
||||||
|
|
||||||
if [ "$choice" = "y" ]
|
if [ "$choice" = "y" ]
|
||||||
then
|
then
|
||||||
gohome .bashrc
|
gohome .zshrc
|
||||||
gohome .bash_profile
|
gohome .zprofile
|
||||||
gohome .profile
|
|
||||||
gohome .doom.d
|
gohome .doom.d
|
||||||
|
|
||||||
goconfig dunst
|
goconfig dunst
|
||||||
|
|
Loading…
Reference in a new issue