added zsh config
This commit is contained in:
@@ -0,0 +1,193 @@
|
||||
# Generated by Powerlevel10k configuration wizard on 2023-02-19 at 01:30 CET.
|
||||
# Based on romkatv/powerlevel10k/config/p10k-pure.zsh, checksum 13301.
|
||||
# Wizard options: nerdfont-complete + powerline, large icons, pure, snazzy, 1 line,
|
||||
# sparse, transient_prompt, instant_prompt=quiet.
|
||||
# Type `p10k configure` to generate another config.
|
||||
#
|
||||
# Config file for Powerlevel10k with the style of Pure (https://github.com/sindresorhus/pure).
|
||||
#
|
||||
# Differences from Pure:
|
||||
#
|
||||
# - Git:
|
||||
# - `@c4d3ec2c` instead of something like `v1.4.0~11` when in detached HEAD state.
|
||||
# - No automatic `git fetch` (the same as in Pure with `PURE_GIT_PULL=0`).
|
||||
#
|
||||
# Apart from the differences listed above, the replication of Pure prompt is exact. This includes
|
||||
# even the questionable parts. For example, just like in Pure, there is no indication of Git status
|
||||
# being stale; prompt symbol is the same in command, visual and overwrite vi modes; when prompt
|
||||
# doesn't fit on one line, it wraps around with no attempt to shorten it.
|
||||
#
|
||||
# If you like the general style of Pure but not particularly attached to all its quirks, type
|
||||
# `p10k configure` and pick "Lean" style. This will give you slick minimalist prompt while taking
|
||||
# advantage of Powerlevel10k features that aren't present in Pure.
|
||||
|
||||
# Temporarily change options.
|
||||
'builtin' 'local' '-a' 'p10k_config_opts'
|
||||
[[ ! -o 'aliases' ]] || p10k_config_opts+=('aliases')
|
||||
[[ ! -o 'sh_glob' ]] || p10k_config_opts+=('sh_glob')
|
||||
[[ ! -o 'no_brace_expand' ]] || p10k_config_opts+=('no_brace_expand')
|
||||
'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand'
|
||||
|
||||
() {
|
||||
emulate -L zsh -o extended_glob
|
||||
|
||||
# Unset all configuration options.
|
||||
unset -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR'
|
||||
|
||||
# Zsh >= 5.1 is required.
|
||||
autoload -Uz is-at-least && is-at-least 5.1 || return
|
||||
|
||||
# Prompt colors.
|
||||
local grey='242'
|
||||
local red='#FF5C57'
|
||||
local yellow='#F3F99D'
|
||||
local blue='#57C7FF'
|
||||
local magenta='#FF6AC1'
|
||||
local cyan='#9AEDFE'
|
||||
local white='#F1F1F0'
|
||||
|
||||
# Left prompt segments.
|
||||
typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(
|
||||
context # user@host
|
||||
dir # current directory
|
||||
vcs # git status
|
||||
command_execution_time # previous command duration
|
||||
virtualenv # python virtual environment
|
||||
prompt_char # prompt symbol
|
||||
)
|
||||
|
||||
# Right prompt segments.
|
||||
typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(
|
||||
# command_execution_time # previous command duration
|
||||
# virtualenv # python virtual environment
|
||||
# context # user@host
|
||||
# time # current time
|
||||
)
|
||||
|
||||
# Basic style options that define the overall prompt look.
|
||||
typeset -g POWERLEVEL9K_BACKGROUND= # transparent background
|
||||
typeset -g POWERLEVEL9K_{LEFT,RIGHT}_{LEFT,RIGHT}_WHITESPACE= # no surrounding whitespace
|
||||
typeset -g POWERLEVEL9K_{LEFT,RIGHT}_SUBSEGMENT_SEPARATOR=' ' # separate segments with a space
|
||||
typeset -g POWERLEVEL9K_{LEFT,RIGHT}_SEGMENT_SEPARATOR= # no end-of-line symbol
|
||||
typeset -g POWERLEVEL9K_VISUAL_IDENTIFIER_EXPANSION= # no segment icons
|
||||
|
||||
# Add an empty line before each prompt except the first. This doesn't emulate the bug
|
||||
# in Pure that makes prompt drift down whenever you use the Alt-C binding from fzf or similar.
|
||||
typeset -g POWERLEVEL9K_PROMPT_ADD_NEWLINE=true
|
||||
|
||||
# Magenta prompt symbol if the last command succeeded.
|
||||
typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_{VIINS,VICMD,VIVIS}_FOREGROUND=$magenta
|
||||
# Red prompt symbol if the last command failed.
|
||||
typeset -g POWERLEVEL9K_PROMPT_CHAR_ERROR_{VIINS,VICMD,VIVIS}_FOREGROUND=$red
|
||||
# Default prompt symbol.
|
||||
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIINS_CONTENT_EXPANSION='❯'
|
||||
# Prompt symbol in command vi mode.
|
||||
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION='❮'
|
||||
# Prompt symbol in visual vi mode is the same as in command mode.
|
||||
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='❮'
|
||||
# Prompt symbol in overwrite vi mode is the same as in command mode.
|
||||
typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=false
|
||||
|
||||
# Grey Python Virtual Environment.
|
||||
typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=$grey
|
||||
# Don't show Python version.
|
||||
typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false
|
||||
typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER=
|
||||
|
||||
# Blue current directory.
|
||||
typeset -g POWERLEVEL9K_DIR_FOREGROUND=$blue
|
||||
|
||||
# Context format when root: user@host. The first part white, the rest grey.
|
||||
typeset -g POWERLEVEL9K_CONTEXT_ROOT_TEMPLATE="%F{$white}%n%f%F{$grey}@%m%f"
|
||||
# Context format when not root: user@host. The whole thing grey.
|
||||
typeset -g POWERLEVEL9K_CONTEXT_TEMPLATE="%F{$grey}%n@%m%f"
|
||||
# Don't show context unless root or in SSH.
|
||||
typeset -g POWERLEVEL9K_CONTEXT_{DEFAULT,SUDO}_CONTENT_EXPANSION=
|
||||
|
||||
# Show previous command duration only if it's >= 5s.
|
||||
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=5
|
||||
# Don't show fractional seconds. Thus, 7s rather than 7.3s.
|
||||
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0
|
||||
# Duration format: 1d 2h 3m 4s.
|
||||
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FORMAT='d h m s'
|
||||
# Yellow previous command duration.
|
||||
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND=$yellow
|
||||
|
||||
# Grey Git prompt. This makes stale prompts indistinguishable from up-to-date ones.
|
||||
typeset -g POWERLEVEL9K_VCS_FOREGROUND=$grey
|
||||
|
||||
# Disable async loading indicator to make directories that aren't Git repositories
|
||||
# indistinguishable from large Git repositories without known state.
|
||||
typeset -g POWERLEVEL9K_VCS_LOADING_TEXT=
|
||||
|
||||
# Don't wait for Git status even for a millisecond, so that prompt always updates
|
||||
# asynchronously when Git state changes.
|
||||
typeset -g POWERLEVEL9K_VCS_MAX_SYNC_LATENCY_SECONDS=0
|
||||
|
||||
# Cyan ahead/behind arrows.
|
||||
typeset -g POWERLEVEL9K_VCS_{INCOMING,OUTGOING}_CHANGESFORMAT_FOREGROUND=$cyan
|
||||
# Don't show remote branch, current tag or stashes.
|
||||
typeset -g POWERLEVEL9K_VCS_GIT_HOOKS=(vcs-detect-changes git-untracked git-aheadbehind)
|
||||
# Don't show the branch icon.
|
||||
typeset -g POWERLEVEL9K_VCS_BRANCH_ICON=
|
||||
# When in detached HEAD state, show @commit where branch normally goes.
|
||||
typeset -g POWERLEVEL9K_VCS_COMMIT_ICON='@'
|
||||
# Don't show staged, unstaged, untracked indicators.
|
||||
typeset -g POWERLEVEL9K_VCS_{STAGED,UNSTAGED,UNTRACKED}_ICON=
|
||||
# Show '*' when there are staged, unstaged or untracked files.
|
||||
typeset -g POWERLEVEL9K_VCS_DIRTY_ICON='*'
|
||||
# Show '⇣' if local branch is behind remote.
|
||||
typeset -g POWERLEVEL9K_VCS_INCOMING_CHANGES_ICON=':⇣'
|
||||
# Show '⇡' if local branch is ahead of remote.
|
||||
typeset -g POWERLEVEL9K_VCS_OUTGOING_CHANGES_ICON=':⇡'
|
||||
# Don't show the number of commits next to the ahead/behind arrows.
|
||||
typeset -g POWERLEVEL9K_VCS_{COMMITS_AHEAD,COMMITS_BEHIND}_MAX_NUM=1
|
||||
# Remove space between '⇣' and '⇡' and all trailing spaces.
|
||||
typeset -g POWERLEVEL9K_VCS_CONTENT_EXPANSION='${${${P9K_CONTENT/⇣* :⇡/⇣⇡}// }//:/ }'
|
||||
|
||||
# Grey current time.
|
||||
typeset -g POWERLEVEL9K_TIME_FOREGROUND=$grey
|
||||
# Format for the current time: 09:51:02. See `man 3 strftime`.
|
||||
typeset -g POWERLEVEL9K_TIME_FORMAT='%D{%H:%M:%S}'
|
||||
# If set to true, time will update when you hit enter. This way prompts for the past
|
||||
# commands will contain the start times of their commands rather than the end times of
|
||||
# their preceding commands.
|
||||
typeset -g POWERLEVEL9K_TIME_UPDATE_ON_COMMAND=false
|
||||
|
||||
# Transient prompt works similarly to the builtin transient_rprompt option. It trims down prompt
|
||||
# when accepting a command line. Supported values:
|
||||
#
|
||||
# - off: Don't change prompt when accepting a command line.
|
||||
# - always: Trim down prompt when accepting a command line.
|
||||
# - same-dir: Trim down prompt when accepting a command line unless this is the first command
|
||||
# typed after changing current working directory.
|
||||
typeset -g POWERLEVEL9K_TRANSIENT_PROMPT=always
|
||||
|
||||
# Instant prompt mode.
|
||||
#
|
||||
# - off: Disable instant prompt. Choose this if you've tried instant prompt and found
|
||||
# it incompatible with your zsh configuration files.
|
||||
# - quiet: Enable instant prompt and don't print warnings when detecting console output
|
||||
# during zsh initialization. Choose this if you've read and understood
|
||||
# https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt.
|
||||
# - verbose: Enable instant prompt and print a warning when detecting console output during
|
||||
# zsh initialization. Choose this if you've never tried instant prompt, haven't
|
||||
# seen the warning, or if you are unsure what this all means.
|
||||
typeset -g POWERLEVEL9K_INSTANT_PROMPT=quiet
|
||||
|
||||
# Hot reload allows you to change POWERLEVEL9K options after Powerlevel10k has been initialized.
|
||||
# For example, you can type POWERLEVEL9K_BACKGROUND=red and see your prompt turn red. Hot reload
|
||||
# can slow down prompt by 1-2 milliseconds, so it's better to keep it turned off unless you
|
||||
# really need it.
|
||||
typeset -g POWERLEVEL9K_DISABLE_HOT_RELOAD=true
|
||||
|
||||
# If p10k is already loaded, reload configuration.
|
||||
# This works even with POWERLEVEL9K_DISABLE_HOT_RELOAD=true.
|
||||
(( ! $+functions[p10k] )) || p10k reload
|
||||
}
|
||||
|
||||
# Tell `p10k configure` which file it should overwrite.
|
||||
typeset -g POWERLEVEL9K_CONFIG_FILE=${${(%):-%x}:a}
|
||||
|
||||
(( ${#p10k_config_opts} )) && setopt ${p10k_config_opts[@]}
|
||||
'builtin' 'unset' 'p10k_config_opts'
|
||||
@@ -0,0 +1,436 @@
|
||||
# last change: Wed 2025-02-04
|
||||
#
|
||||
# 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.
|
||||
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
|
||||
|
||||
if [ -z "${DISPLAY}" ] && [ "${XDG_VTNR}" -eq 1 ]; then
|
||||
# Log WLR errors and logs to the hyprland log. Recommended
|
||||
export HYPRLAND_LOG_WLR=1
|
||||
exec start-hyprland &> /dev/null
|
||||
# exec Hyprland &> /dev/null
|
||||
fi
|
||||
|
||||
# Catppuccin Mocha Theme (for zsh-syntax-highlighting)
|
||||
# Paste this files contents inside your ~/.zshrc before you activate zsh-syntax-highlighting
|
||||
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main cursor)
|
||||
typeset -gA ZSH_HIGHLIGHT_STYLES
|
||||
|
||||
source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme
|
||||
source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
|
||||
source ~/.config/zsh/catppuccin_mocha-zsh-syntax-highlighting.zsh
|
||||
source /usr/share/zsh/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh 1>/dev/null
|
||||
|
||||
|
||||
# Enable colors and change prompt:
|
||||
autoload -U colors && colors # Load colors
|
||||
setopt autocd # Automatically cd into typed directory.
|
||||
setopt interactive_comments
|
||||
|
||||
# History in cache directory:
|
||||
HISTSIZE=10000000
|
||||
SAVEHIST=10000000
|
||||
HISTFILE="${XDG_DATA_HOME:-$HOME/.local/share}/history"
|
||||
# HISTFILE="${XDG_CACHE_HOME:-$HOME/.cache}/zsh/history"
|
||||
# setopt appendhistory
|
||||
|
||||
# Load aliases and shortcuts if existent.
|
||||
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc"
|
||||
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc"
|
||||
#[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc"
|
||||
|
||||
# Basic auto/tab complete:
|
||||
autoload -U compinit
|
||||
zstyle ':completion:*' menu select
|
||||
zmodload zsh/complist
|
||||
compinit
|
||||
_comp_options+=(globdots) # Include hidden files.
|
||||
|
||||
|
||||
|
||||
# Use emacs key bindings
|
||||
bindkey -e
|
||||
|
||||
# [PageUp] - Up a line of history
|
||||
if [[ -n "${terminfo[kpp]}" ]]; then
|
||||
bindkey -M emacs "${terminfo[kpp]}" up-line-or-history
|
||||
bindkey -M viins "${terminfo[kpp]}" up-line-or-history
|
||||
bindkey -M vicmd "${terminfo[kpp]}" up-line-or-history
|
||||
fi
|
||||
# [PageDown] - Down a line of history
|
||||
if [[ -n "${terminfo[knp]}" ]]; then
|
||||
bindkey -M emacs "${terminfo[knp]}" down-line-or-history
|
||||
bindkey -M viins "${terminfo[knp]}" down-line-or-history
|
||||
bindkey -M vicmd "${terminfo[knp]}" down-line-or-history
|
||||
fi
|
||||
|
||||
# Start typing + [Up-Arrow] - fuzzy find history forward
|
||||
if [[ -n "${terminfo[kcuu1]}" ]]; then
|
||||
autoload -U up-line-or-beginning-search
|
||||
zle -N up-line-or-beginning-search
|
||||
|
||||
bindkey -M emacs "${terminfo[kcuu1]}" up-line-or-beginning-search
|
||||
bindkey -M viins "${terminfo[kcuu1]}" up-line-or-beginning-search
|
||||
bindkey -M vicmd "${terminfo[kcuu1]}" up-line-or-beginning-search
|
||||
fi
|
||||
# Start typing + [Down-Arrow] - fuzzy find history backward
|
||||
if [[ -n "${terminfo[kcud1]}" ]]; then
|
||||
autoload -U down-line-or-beginning-search
|
||||
zle -N down-line-or-beginning-search
|
||||
|
||||
bindkey -M emacs "${terminfo[kcud1]}" down-line-or-beginning-search
|
||||
bindkey -M viins "${terminfo[kcud1]}" down-line-or-beginning-search
|
||||
bindkey -M vicmd "${terminfo[kcud1]}" down-line-or-beginning-search
|
||||
fi
|
||||
|
||||
# [Home] - Go to beginning of line
|
||||
#if [[ -n "${terminfo[khome]}" ]]; then
|
||||
# bindkey -M emacs "${terminfo[khome]}" beginning-of-line
|
||||
# bindkey -M viins "${terminfo[khome]}" beginning-of-line
|
||||
# bindkey -M vicmd "${terminfo[khome]}" beginning-of-line
|
||||
#fi
|
||||
# [End] - Go to end of line
|
||||
if [[ -n "${terminfo[kend]}" ]]; then
|
||||
bindkey -M emacs "${terminfo[kend]}" end-of-line
|
||||
bindkey -M viins "${terminfo[kend]}" end-of-line
|
||||
bindkey -M vicmd "${terminfo[kend]}" end-of-line
|
||||
fi
|
||||
|
||||
# [Shift-Tab] - move through the completion menu backwards
|
||||
if [[ -n "${terminfo[kcbt]}" ]]; then
|
||||
bindkey -M emacs "${terminfo[kcbt]}" reverse-menu-complete
|
||||
bindkey -M viins "${terminfo[kcbt]}" reverse-menu-complete
|
||||
bindkey -M vicmd "${terminfo[kcbt]}" reverse-menu-complete
|
||||
fi
|
||||
|
||||
# [Backspace] - delete backward
|
||||
bindkey -M emacs '^?' backward-delete-char
|
||||
bindkey -M viins '^?' backward-delete-char
|
||||
bindkey -M vicmd '^?' backward-delete-char
|
||||
# [Delete] - delete forward
|
||||
if [[ -n "${terminfo[kdch1]}" ]]; then
|
||||
bindkey -M emacs "${terminfo[kdch1]}" delete-char
|
||||
bindkey -M viins "${terminfo[kdch1]}" delete-char
|
||||
bindkey -M vicmd "${terminfo[kdch1]}" delete-char
|
||||
else
|
||||
bindkey -M emacs "^[[3~" delete-char
|
||||
bindkey -M viins "^[[3~" delete-char
|
||||
bindkey -M vicmd "^[[3~" delete-char
|
||||
|
||||
bindkey -M emacs "^[3;5~" delete-char
|
||||
bindkey -M viins "^[3;5~" delete-char
|
||||
bindkey -M vicmd "^[3;5~" delete-char
|
||||
fi
|
||||
|
||||
# [Ctrl-Delete] - delete whole forward-word
|
||||
bindkey -M emacs '^[[3;5~' kill-word
|
||||
bindkey -M viins '^[[3;5~' kill-word
|
||||
bindkey -M vicmd '^[[3;5~' kill-word
|
||||
|
||||
# [Ctrl-RightArrow] - move forward one word
|
||||
bindkey -M emacs '^[[1;5C' forward-word
|
||||
bindkey -M viins '^[[1;5C' forward-word
|
||||
bindkey -M vicmd '^[[1;5C' forward-word
|
||||
# [Ctrl-LeftArrow] - move backward one word
|
||||
bindkey -M emacs '^[[1;5D' backward-word
|
||||
bindkey -M viins '^[[1;5D' backward-word
|
||||
bindkey -M vicmd '^[[1;5D' backward-word
|
||||
|
||||
|
||||
bindkey '\ew' kill-region # [Esc-w] - Kill from the cursor to the mark
|
||||
bindkey -s '\el' 'ls\n' # [Esc-l] - run command: ls
|
||||
bindkey '^r' history-incremental-search-backward # [Ctrl-r] - Search backward incrementally for a specified string. The string may begin with ^ to anchor the search to the beginning of the line.
|
||||
bindkey ' ' magic-space # [Space] - don't do history expansion
|
||||
|
||||
|
||||
|
||||
if [[ "$TERM" != emacs ]]; then
|
||||
[[ -z "$terminfo[kdch1]" ]] || bindkey -M emacs "$terminfo[kdch1]" delete-char
|
||||
[[ -z "$terminfo[khome]" ]] || bindkey -M emacs "$terminfo[khome]" beginning-of-line
|
||||
[[ -z "$terminfo[kend]" ]] || bindkey -M emacs "$terminfo[kend]" end-of-line
|
||||
[[ -z "$terminfo[kich1]" ]] || bindkey -M emacs "$terminfo[kich1]" overwrite-mode
|
||||
[[ -z "$terminfo[kdch1]" ]] || bindkey -M vicmd "$terminfo[kdch1]" vi-delete-char
|
||||
[[ -z "$terminfo[khome]" ]] || bindkey -M vicmd "$terminfo[khome]" vi-beginning-of-line
|
||||
[[ -z "$terminfo[kend]" ]] || bindkey -M vicmd "$terminfo[kend]" vi-end-of-line
|
||||
[[ -z "$terminfo[kich1]" ]] || bindkey -M vicmd "$terminfo[kich1]" overwrite-mode
|
||||
|
||||
[[ -z "$terminfo[cuu1]" ]] || bindkey -M viins "$terminfo[cuu1]" vi-up-line-or-history
|
||||
[[ -z "$terminfo[cuf1]" ]] || bindkey -M viins "$terminfo[cuf1]" vi-forward-char
|
||||
[[ -z "$terminfo[kcuu1]" ]] || bindkey -M viins "$terminfo[kcuu1]" vi-up-line-or-history
|
||||
[[ -z "$terminfo[kcud1]" ]] || bindkey -M viins "$terminfo[kcud1]" vi-down-line-or-history
|
||||
[[ -z "$terminfo[kcuf1]" ]] || bindkey -M viins "$terminfo[kcuf1]" vi-forward-char
|
||||
[[ -z "$terminfo[kcub1]" ]] || bindkey -M viins "$terminfo[kcub1]" vi-backward-char
|
||||
|
||||
# ncurses fogyatekos
|
||||
[[ "$terminfo[kcuu1]" == "^[O"* ]] && bindkey -M viins "${terminfo[kcuu1]/O/[}" vi-up-line-or-history
|
||||
[[ "$terminfo[kcud1]" == "^[O"* ]] && bindkey -M viins "${terminfo[kcud1]/O/[}" vi-down-line-or-history
|
||||
[[ "$terminfo[kcuf1]" == "^[O"* ]] && bindkey -M viins "${terminfo[kcuf1]/O/[}" vi-forward-char
|
||||
[[ "$terminfo[kcub1]" == "^[O"* ]] && bindkey -M viins "${terminfo[kcub1]/O/[}" vi-backward-char
|
||||
[[ "$terminfo[khome]" == "^[O"* ]] && bindkey -M viins "${terminfo[khome]/O/[}" beginning-of-line
|
||||
[[ "$terminfo[kend]" == "^[O"* ]] && bindkey -M viins "${terminfo[kend]/O/[}" end-of-line
|
||||
[[ "$terminfo[khome]" == "^[O"* ]] && bindkey -M emacs "${terminfo[khome]/O/[}" beginning-of-line
|
||||
[[ "$terminfo[kend]" == "^[O"* ]] && bindkey -M emacs "${terminfo[kend]/O/[}" end-of-line
|
||||
fi
|
||||
|
||||
# del, home and end !! THIS WORKS!!
|
||||
bindkey "\e[3~" delete-char
|
||||
bindkey "\e[H" beginning-of-line
|
||||
bindkey "\e[F" end-of-line
|
||||
|
||||
|
||||
# Edit the current command line in $EDITOR
|
||||
autoload -U edit-command-line
|
||||
zle -N edit-command-line
|
||||
bindkey '\C-x\C-e' edit-command-line
|
||||
|
||||
# file rename magick
|
||||
bindkey "^[m" copy-prev-shell-word
|
||||
|
||||
# alt-bs
|
||||
bindkey "\e\d" undo
|
||||
|
||||
|
||||
|
||||
# consider emacs keybindings:
|
||||
|
||||
#bindkey -e ## emacs key bindings
|
||||
#
|
||||
#bindkey '^[[A' up-line-or-search
|
||||
#bindkey '^[[B' down-line-or-search
|
||||
#bindkey '^[^[[C' emacs-forward-word
|
||||
#bindkey '^[^[[D' emacs-backward-word
|
||||
#
|
||||
#bindkey -s '^X^Z' '%-^M'
|
||||
#bindkey '^[e' expand-cmd-path
|
||||
#bindkey '^[^I' reverse-menu-complete
|
||||
#bindkey '^X^N' accept-and-infer-next-history
|
||||
#bindkey '^W' kill-region
|
||||
#bindkey '^I' complete-word
|
||||
## Fix weird sequence that rxvt produces
|
||||
#bindkey -s '^[[Z' '\t'
|
||||
#
|
||||
|
||||
|
||||
############ POWERLEVEL THEME SETTINGS ##############
|
||||
POWERLEVEL9K_MODE="nerdfont-complete"
|
||||
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_arch_icon dir vcs)
|
||||
# POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(disk_usage time)
|
||||
# POWERLEVEL9K_CUSTOM_ARCH_ICON='echo nf'
|
||||
POWERLEVEL9K_CUSTOM_ARCH_ICON_BACKGROUND=031
|
||||
POWERLEVEL9K_CUSTOM_ARCH_ICON_FOREGROUND=252
|
||||
|
||||
# POWERLEVEL9K_PROMPT_ADD_NEWLINE=true
|
||||
# POWERLEVEL9K_PROMPT_ON_NEWLINE=true
|
||||
# POWERLEVEL9K_SHOW_RULER=true
|
||||
# POWERLEVEL9K_RULER_CHAR='─'
|
||||
# POWERLEVEL9K_RULER_BACKGROUND=none
|
||||
# POWERLEVEL9K_RULER_FOREGROUND=252
|
||||
|
||||
# POWERLEVEL9K_LEFT_SEGMENT_END_SEPARATOR=
|
||||
# POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR=
|
||||
# POWERLEVEL9K_LEFT_SUBSEGMENT_SEPARATOR=' '
|
||||
# POWERLEVEL9K_RIGHT_SEGMENT_END_SEPARATOR=
|
||||
# POWERLEVEL9K_RIGHT_SEGMENT_SEPARATOR=
|
||||
# POWERLEVEL9K_RIGHT_SUBSEGMENT_SEPARATOR=
|
||||
# POWERLEVEL9K_WHITESPACE_BETWEEN_LEFT_SEGMENTS=
|
||||
|
||||
# POWERLEVEL9K_SHORTEN_DIR_LENGTH=2
|
||||
# POWERLEVEL9K_SHORTEN_STRATEGY="truncate_middle"
|
||||
|
||||
# POWERLEVEL9K_DIR_SHOW_WRITABLE=true
|
||||
|
||||
# POWERLEVEL9K_DISK_USAGE_NORMAL_BACKGROUND=none
|
||||
# POWERLEVEL9K_DISK_USAGE_WARNING_BACKGROUND=magenta
|
||||
# POWERLEVEL9K_DISK_USAGE_CRITICAL_BACKGROUND=red
|
||||
# POWERLEVEL9K_TIME_BACKGROUND=none
|
||||
# POWERLEVEL9K_TIME_FOREGROUND=white
|
||||
|
||||
POWERLEVEL9K_DIR_HOME_BACKGROUND=239
|
||||
# POWERLEVEL9K_DIR_HOME_SUBFOLDER_BACKGROUND=none
|
||||
# POWERLEVEL9K_DIR_ETC_BACKGROUND=none
|
||||
# POWERLEVEL9K_DIR_DEFAULT_BACKGROUND=none
|
||||
# POWERLEVEL9K_DIR_NOT_WRITABLE_BACKGROUND=none
|
||||
|
||||
POWERLEVEL9K_DIR_HOME_FOREGROUND=252
|
||||
POWERLEVEL9K_DIR_HOME_SUBFOLDER_FOREGROUND=252
|
||||
POWERLEVEL9K_DIR_ETC_FOREGROUND=252
|
||||
POWERLEVEL9K_DIR_DEFAULT_FOREGROUND=252
|
||||
POWERLEVEL9K_DIR_NOT_WRITABLE_FOREGROUND=100
|
||||
|
||||
# POWERLEVEL9K_OS_ICON_BACKGROUND="white"
|
||||
# POWERLEVEL9K_OS_ICON_FOREGROUND="white"
|
||||
|
||||
# POWERLEVEL9K_VCS_GIT_ICON='%fon %F{040}\uf1d3 '
|
||||
# POWERLEVEL9K_VCS_GIT_GITHUB_ICON='%fon %F{040}\uf09b '
|
||||
# POWERLEVEL9K_VCS_GIT_BITBUCKET_ICON='%fon %F{040}\uf171 '
|
||||
# POWERLEVEL9K_VCS_GIT_GIT_GITLAB_ICON='%fon %F{040}\uf296 '
|
||||
|
||||
# POWERLEVEL9K_VCS_CLEAN_BACKGROUND=none
|
||||
# POWERLEVEL9K_VCS_UNTRACKED_BACKGROUND=none
|
||||
# POWERLEVEL9K_VCS_MODIFIED_BACKGROUND=none
|
||||
# POWERLEVEL9K_VCS_LOADING_BACKGROUND=none
|
||||
# POWERLEVEL9K_VCS_CLEAN_FOREGROUND="040"
|
||||
# POWERLEVEL9K_VCS_UNTRACKED_FOREGROUND="red"
|
||||
# POWERLEVEL9K_VCS_MODIFIED_FOREGROUND="yellow"
|
||||
# POWERLEVEL9K_VCS_LOADING_FOREGROUND="grey"
|
||||
|
||||
# POWERLEVEL9K_VCS_UNTRACKED_ICON=$'%{\b?%}'
|
||||
# POWERLEVEL9K_VCS_UNSTAGED_ICON=$'%{\b!%}'
|
||||
# POWERLEVEL9K_VCS_STAGED_ICON=$'%{\b+%}'
|
||||
|
||||
# POWERLEVEL9K_DIR_NOT_WRITABLE_VISUAL_IDENTIFIER_COLOR=red
|
||||
# POWERLEVEL9K_LOCK_ICON=$'\uf023'
|
||||
|
||||
# POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX=''
|
||||
# local p='%F{%(?.green.red)}${${${KEYMAP:-0}:#vicmd}:+❯}${${$((!${#${KEYMAP:-0}:#vicmd})):#0}:+❮}%f '
|
||||
# POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX="$p"
|
||||
|
||||
# POWERLEVEL9K_NVM_BACKGROUND=none
|
||||
# POWERLEVEL9K_NVM_FOREGROUND=green
|
||||
# POWERLEVEL9K_NODE_ICON='%fvia %F{green}⬢'
|
||||
|
||||
############ END- POWERLEVEL THEME SETTINGS ##############
|
||||
|
||||
|
||||
|
||||
# Preferred editor for local and remote sessions
|
||||
# if [[ -n $SSH_CONNECTION ]]; then
|
||||
# export EDITOR='vim'
|
||||
# else
|
||||
# export EDITOR='mvim'
|
||||
# fi
|
||||
|
||||
# Compilation flags
|
||||
# export ARCHFLAGS="-arch x86_64"
|
||||
|
||||
|
||||
### ARCHIVE EXTRACTION
|
||||
# usage: ex <file>
|
||||
# ex ()
|
||||
# {
|
||||
# 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 ;;
|
||||
# *.deb) ar x $1 ;;
|
||||
# *.tar.xz) tar xf $1 ;;
|
||||
# *.tar.zst) unzstd $1 ;;
|
||||
# *) echo "'$1' cannot be extracted via ex()" ;;
|
||||
# esac
|
||||
# else
|
||||
# echo "'$1' is not a valid file"
|
||||
# fi
|
||||
# }
|
||||
|
||||
|
||||
### ALIASES ###
|
||||
# !!! DEPRECATED !!!
|
||||
# --> now in ~/.config/shell/aliasrc and ~/.config/shell/shortcutsrc
|
||||
|
||||
## get top process eating memory
|
||||
#alias psmem='ps auxf | sort -nr -k 4'
|
||||
#alias psmem10='ps auxf | sort -nr -k 4 | head -10'
|
||||
|
||||
## get top process eating cpu ##
|
||||
#alias pscpu='ps auxf | sort -nr -k 3'
|
||||
#alias pscpu10='ps auxf | sort -nr -k 3 | head -10'
|
||||
|
||||
|
||||
unsetopt nomatch
|
||||
|
||||
|
||||
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
|
||||
#[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
|
||||
|
||||
# paths - #TODO: maybe put them into separate file:
|
||||
export PATH=~/.local/bin:$PATH
|
||||
export PATH=/home/tobias/.local/share/soar/bin:$PATH
|
||||
export PATH=/home/tobias/.config/gem/ruby/2.7.0/bin:$PATH
|
||||
export PATH=/home/tobias/.local/share/cargo/bin:$PATH
|
||||
export PATH=/home/tobias/.local/share/npm/bin/:$PATH
|
||||
export PATH=/usr/bin/perl:$PATH
|
||||
|
||||
|
||||
# export LS_COLORS="$(vivid generate catppuccin-mocha)"
|
||||
|
||||
|
||||
# color-ls:
|
||||
# Enable tab completion for flags by entering following line to your shell configuration file (~/.bashrc or ~/.zshrc) :
|
||||
#source $(dirname $(gem which colorls))/tab_complete.sh
|
||||
|
||||
#for tilix
|
||||
# if [ $TILIX_ID ] || [ $VTE_VERSION ]; then
|
||||
# source /etc/profile.d/vte.sh
|
||||
# fi
|
||||
#
|
||||
|
||||
[[ ! -f ~/.config/zsh/.p10k.zsh ]] || source ~/.config/zsh/.p10k.zsh
|
||||
|
||||
|
||||
# autostart Hyprland
|
||||
# if [ -z "${DISPLAY}" ] && [ "${XDG_VTNR}" -eq 1 ]; then
|
||||
# exec sh "~/.config/hypr/initrc"
|
||||
# fi
|
||||
#
|
||||
# if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then
|
||||
# # pidof mylock > /dev/null || exec startw
|
||||
# # exec hl
|
||||
# sh "~/.config/hypr/initrc"
|
||||
# fi
|
||||
#
|
||||
# if [ "$(tty)" = "/dev/tty1" ] ; then
|
||||
|
||||
#if [ -z "${DISPLAY}" ] && [ "${XDG_VTNR}" -eq 1 ]; then
|
||||
|
||||
# cd ~
|
||||
|
||||
# # Log WLR errors and logs to the hyprland log. Recommended
|
||||
# export HYPRLAND_LOG_WLR=1
|
||||
|
||||
|
||||
# #NOW IN HYPRLAND ENV -- todo: delete me
|
||||
# # Tell XWayland to use a cursor theme
|
||||
# # export XCURSOR_THEME=Bibata-Modern-Ice
|
||||
|
||||
# # export XCURSOR_THEME=Breeze_Snow
|
||||
|
||||
# # NOW IN HYPRLAND ENV
|
||||
# # Set a cursor size
|
||||
# # export XCURSOR_SIZE=24
|
||||
|
||||
# # # nvidia stuff:
|
||||
# # export LIBVA_DRIVER_NAME=nvidia
|
||||
# # export XDG_SESSION_TYPE=wayland
|
||||
# # export GBM_BACKEND=nvidia-drm
|
||||
# # export __GLX_VENDOR_LIBRARY_NAME=nvidia
|
||||
# # export WLR_NO_HARDWARE_CURSORS=1
|
||||
|
||||
# exec Hyprland &> /dev/null
|
||||
|
||||
#fi
|
||||
|
||||
# exec sh "~/.config/hypr/initrc"fifi
|
||||
|
||||
# if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then
|
||||
# # pidof mylock > /dev/null || exec startw
|
||||
# # exec hl
|
||||
# exec "~/.config/hypr/initrc"
|
||||
# fi
|
||||
autoload bashcompinit
|
||||
bashcompinit
|
||||
source "/home/tobias/.local/share/bash-completion/completions/appman"
|
||||
autoload bashcompinit
|
||||
bashcompinit
|
||||
source "/home/tobias/.local/share/bash-completion/completions/archimage-cli"
|
||||
@@ -0,0 +1,74 @@
|
||||
# Catppuccin Mocha Theme (for zsh-syntax-highlighting)
|
||||
#
|
||||
# Paste this files contents inside your ~/.zshrc before you activate zsh-syntax-highlighting
|
||||
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main cursor)
|
||||
typeset -gA ZSH_HIGHLIGHT_STYLES
|
||||
|
||||
# Main highlighter styling: https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/docs/highlighters/main.md
|
||||
#
|
||||
## General
|
||||
### Diffs
|
||||
### Markup
|
||||
## Classes
|
||||
## Comments
|
||||
ZSH_HIGHLIGHT_STYLES[comment]='fg=#585b70'
|
||||
## Constants
|
||||
## Entitites
|
||||
## Functions/methods
|
||||
ZSH_HIGHLIGHT_STYLES[alias]='fg=#a6e3a1'
|
||||
ZSH_HIGHLIGHT_STYLES[suffix-alias]='fg=#a6e3a1'
|
||||
ZSH_HIGHLIGHT_STYLES[global-alias]='fg=#a6e3a1'
|
||||
ZSH_HIGHLIGHT_STYLES[function]='fg=#a6e3a1'
|
||||
ZSH_HIGHLIGHT_STYLES[command]='fg=#a6e3a1'
|
||||
ZSH_HIGHLIGHT_STYLES[precommand]='fg=#a6e3a1,italic'
|
||||
ZSH_HIGHLIGHT_STYLES[autodirectory]='fg=#fab387,italic'
|
||||
ZSH_HIGHLIGHT_STYLES[single-hyphen-option]='fg=#fab387'
|
||||
ZSH_HIGHLIGHT_STYLES[double-hyphen-option]='fg=#fab387'
|
||||
ZSH_HIGHLIGHT_STYLES[back-quoted-argument]='fg=#cba6f7'
|
||||
## Keywords
|
||||
## Built ins
|
||||
ZSH_HIGHLIGHT_STYLES[builtin]='fg=#a6e3a1'
|
||||
ZSH_HIGHLIGHT_STYLES[reserved-word]='fg=#a6e3a1'
|
||||
ZSH_HIGHLIGHT_STYLES[hashed-command]='fg=#a6e3a1'
|
||||
## Punctuation
|
||||
ZSH_HIGHLIGHT_STYLES[commandseparator]='fg=#f38ba8'
|
||||
ZSH_HIGHLIGHT_STYLES[command-substitution-delimiter]='fg=#cdd6f4'
|
||||
ZSH_HIGHLIGHT_STYLES[command-substitution-delimiter-unquoted]='fg=#cdd6f4'
|
||||
ZSH_HIGHLIGHT_STYLES[process-substitution-delimiter]='fg=#cdd6f4'
|
||||
ZSH_HIGHLIGHT_STYLES[back-quoted-argument-delimiter]='fg=#f38ba8'
|
||||
ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]='fg=#f38ba8'
|
||||
ZSH_HIGHLIGHT_STYLES[back-dollar-quoted-argument]='fg=#f38ba8'
|
||||
## Serializable / Configuration Languages
|
||||
## Storage
|
||||
## Strings
|
||||
ZSH_HIGHLIGHT_STYLES[command-substitution-quoted]='fg=#f9e2af'
|
||||
ZSH_HIGHLIGHT_STYLES[command-substitution-delimiter-quoted]='fg=#f9e2af'
|
||||
ZSH_HIGHLIGHT_STYLES[single-quoted-argument]='fg=#f9e2af'
|
||||
ZSH_HIGHLIGHT_STYLES[single-quoted-argument-unclosed]='fg=#eba0ac'
|
||||
ZSH_HIGHLIGHT_STYLES[double-quoted-argument]='fg=#f9e2af'
|
||||
ZSH_HIGHLIGHT_STYLES[double-quoted-argument-unclosed]='fg=#eba0ac'
|
||||
ZSH_HIGHLIGHT_STYLES[rc-quote]='fg=#f9e2af'
|
||||
## Variables
|
||||
ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]='fg=#cdd6f4'
|
||||
ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument-unclosed]='fg=#eba0ac'
|
||||
ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]='fg=#cdd6f4'
|
||||
ZSH_HIGHLIGHT_STYLES[assign]='fg=#cdd6f4'
|
||||
ZSH_HIGHLIGHT_STYLES[named-fd]='fg=#cdd6f4'
|
||||
ZSH_HIGHLIGHT_STYLES[numeric-fd]='fg=#cdd6f4'
|
||||
## No category relevant in spec
|
||||
ZSH_HIGHLIGHT_STYLES[unknown-token]='fg=#eba0ac'
|
||||
ZSH_HIGHLIGHT_STYLES[path]='fg=#cdd6f4,underline'
|
||||
ZSH_HIGHLIGHT_STYLES[path_pathseparator]='fg=#f38ba8,underline'
|
||||
ZSH_HIGHLIGHT_STYLES[path_prefix]='fg=#cdd6f4,underline'
|
||||
ZSH_HIGHLIGHT_STYLES[path_prefix_pathseparator]='fg=#f38ba8,underline'
|
||||
ZSH_HIGHLIGHT_STYLES[globbing]='fg=#cdd6f4'
|
||||
ZSH_HIGHLIGHT_STYLES[history-expansion]='fg=#cba6f7'
|
||||
#ZSH_HIGHLIGHT_STYLES[command-substitution]='fg=?'
|
||||
#ZSH_HIGHLIGHT_STYLES[command-substitution-unquoted]='fg=?'
|
||||
#ZSH_HIGHLIGHT_STYLES[process-substitution]='fg=?'
|
||||
#ZSH_HIGHLIGHT_STYLES[arithmetic-expansion]='fg=?'
|
||||
ZSH_HIGHLIGHT_STYLES[back-quoted-argument-unclosed]='fg=#eba0ac'
|
||||
ZSH_HIGHLIGHT_STYLES[redirection]='fg=#cdd6f4'
|
||||
ZSH_HIGHLIGHT_STYLES[arg0]='fg=#cdd6f4'
|
||||
ZSH_HIGHLIGHT_STYLES[default]='fg=#cdd6f4'
|
||||
ZSH_HIGHLIGHT_STYLES[cursor]='fg=#cdd6f4'
|
||||
Reference in New Issue
Block a user