~cdv/dotfiles

b2873d1fd394b940dbebbf029035359a7d9f30c9 — Chris Vittal 2 months ago e7074d3
Basic zsh config into dotfiles
5 files changed, 180 insertions(+), 0 deletions(-)

A .zimrc
A .zlogin
A .zprofile
A .zshenv
A .zshrc
A .zimrc => .zimrc +98 -0
@@ 0,0 1,98 @@
#################
# CORE SETTINGS #
#################

#
# Zim settings
#

# Select what modules you would like enabled.
# The second line of modules may depend on options set by modules in the first
# line. These dependencies are noted on the respective module's README.md.
zmodules=(directory environment git git-info history input utility custom \
          pacman syntax-highlighting history-substring-search prompt completion)


###################
# MODULE SETTINGS #
###################

#
# Prompt
#

# Set your desired prompt here
zprompt_theme='pure'
PURE_PROMPT_SYMBOL='%B❯%b'
zstyle :prompt:pure:prompt:success color white
zstyle :prompt:pure:path           color blue
zstyle :prompt:pure:user           color 33    #blue-ish
zstyle :prompt:pure:host           color green
zstyle :prompt:pure:at             color white

#
# Completion
#

# Set an optional host-specific filename for the completion cache file. If none
# is provided, the default '.zcompdump' is used.
#zcompdump_file=".zcompdump-${HOST}-${ZSH_VERSION}"

#
# Utility
#

# Uncomment to enable spelling correction prompt for commands. See:
# http://zsh.sourceforge.net/Doc/Release/Options.html#Input_002fOutput
#setopt CORRECT

# Set custom spelling correction prompt
#SPROMPT='zsh: correct %F{red}%R%f to %F{green}%r%f [nyae]? '

#
# Environment
#

# Set the string below to the desired terminal title format string.
# The terminal title is redrawn upon directory change, however, variables like
# ${PWD} are only evaluated once. Use prompt expansion strings for dynamic data:
#   http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html#Simple-Prompt-Escapes
# The example below uses the following format: 'username@host:/current/directory'
ztermtitle='%-1N %m:%c' # NOTE: this is currently overridden by pure's settings

#
# Input
#

# Set to vi or emacs
zinput_mode='emacs'

# Uncomment to enable double-dot expansion. This appends '../' to your input for
# each '.' you type after an initial '..'
zdouble_dot_expand='true'

#
# Syntax-Highlighting
#

# This determines what highlighters will be used with the syntax-highlighting module.
# Documentation of the highlighters can be found here:
#   https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/docs/highlighters.md
zhighlighters=(main brackets)

#
# SSH
#

# Load these ssh identities with the ssh module
#zssh_ids=(id_rsa)

#
# Pacman
#

# Set (optional) pacman front-end.
zpacman_frontend='yay'

# Load any helper scripts as defined here
#zpacman_helper=(aur)

A .zlogin => .zlogin +13 -0
@@ 0,0 1,13 @@
#
# startup file read in interactive login shells
#

# Initialize zim
[[ -s ${ZIM_HOME}/login_init.zsh ]] && source ${ZIM_HOME}/login_init.zsh

# start sway if tty is 1
if [[ -z "$DISPLAY" ]] && (( $EUID != 0 )) &&
    [[ ${TTY/tty} != $TTY ]] && (( ${TTY:8} == 1 )); then
    export XDG_SESSION_TYPE=wayland
    exec sway
fi

A .zprofile => .zprofile +9 -0
@@ 0,0 1,9 @@
#
# ~/.zprofile configuring users specific PATH
#

typeset -U path
path=("$HOME/.cargo/bin" "$HOME/.local/bin" $path[@])
export XDG_CONFIG_HOME="$HOME/.config"
export LC_COLLATE="C"
export GOPATH="$HOME/src/go"

A .zshenv => .zshenv +8 -0
@@ 0,0 1,8 @@
#
# ~/.zprofile configuring users specific environment variables other than path
#

export XDG_CONFIG_HOME="$HOME/.config"
export XDG_CACHE_HOME="$HOME/.cache"
export XDG_DATA_HOME="$HOME/.local/share"
export MOZ_ENABLE_WAYLAND=1

A .zshrc => .zshrc +52 -0
@@ 0,0 1,52 @@
#
# User configuration sourced by interactive shells
#

# Define zim location
export ZIM_HOME=${ZDOTDIR:-${HOME}}/.zim

# Start zim
[[ -s ${ZIM_HOME}/init.zsh ]] && source ${ZIM_HOME}/init.zsh

# configure history file, other options are set by zim
HISTFILE=~/.zsh_history

# basic options
setopt appendhistory autocd nomatch ignoreeof
if [[ -n ${SSH_CONNECTION:-$PROMPT_PURE_SSH_CONNECTION} ]]; then
    setopt noignoreeof
fi

unsetopt beep

# job control options, overrides zmodule environment
setopt checkjobs hup

# command not found hook
if [[ -r /usr/share/doc/pkgfile/command-not-found.zsh ]]; then
    source /usr/share/doc/pkgfile/command-not-found.zsh
fi

typeset RPROMPT='%(?..%F{red}[$?]%f)'
# PS2 setting
typeset PS2='> '
typeset RPS2='%F{yellow}%^%f'

typeset EDITOR=vim
typeset VISUAL=vim
typeset BROWSER=firefox
typeset MAKEFLAGS=-j7

export EDITOR VISUAL BROWSER MAKEFLAGS

# completions set by zim
# zstyle :compinstall filename '/home/cdv/.zshrc'
#
# autoload -Uz compinit
# compinit

function dbcalc () {
    res=$(bc <<< "$1 * $2")
    echo $res
    wl-copy <<< "$res"
}