mirror of
https://github.com/kristoferssolo/solorice.git
synced 2026-02-04 14:42:04 +00:00
Reformated files
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
#!/bin/zsh
|
||||
|
||||
if [[ "$(tty)" = "/dev/tty1" ]]; then
|
||||
if [[ '$(tty)' = '/dev/tty1' ]]; then
|
||||
pgrep awesome || sx
|
||||
fi
|
||||
|
||||
|
||||
@@ -1,21 +1,18 @@
|
||||
# clear
|
||||
# cd ~
|
||||
|
||||
# Flex on ubuntu users
|
||||
fastfetch
|
||||
# pfetch
|
||||
|
||||
# Options
|
||||
# setopt correct # Auto correct mistakes
|
||||
setopt extendedglob # Extended globaling. Allows using regular expressions with *
|
||||
setopt nocaseglob # Case insensative globbing
|
||||
setopt numericglobsort # Sort filenames numeracally when it makse sense
|
||||
setopt nobeep # No beep
|
||||
setopt appendhistory # Immediately append history instead of overwriting
|
||||
setopt histignorealldups # If a new command is a duplicate, remove older one
|
||||
setopt autocd # If only directory path is entered, cd there
|
||||
setopt inc_append_history # Save commands are addded to the history immediately
|
||||
setopt histignorespace # Don't save commands that start with space
|
||||
setopt extendedglob # Extended globaling. Allows using regular expressions with *
|
||||
setopt nocaseglob # Case insensative globbing
|
||||
setopt numericglobsort # Sort filenames numeracally when it makse sense
|
||||
setopt nobeep # No beep
|
||||
setopt appendhistory # Immediately append history instead of overwriting
|
||||
setopt histignorealldups # If a new command is a duplicate, remove older one
|
||||
setopt autocd # If only directory path is entered, cd there
|
||||
setopt inc_append_history # Save commands are addded to the history immediately
|
||||
setopt histignorespace # Don't save commands that start with space
|
||||
|
||||
autoload -U select-word-style
|
||||
|
||||
@@ -24,7 +21,7 @@ autoload -U colors && colors
|
||||
|
||||
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' # Case sensetive TAB completions
|
||||
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}" # Colored completion (different colors fr dirs/files/etc)
|
||||
zstyle ':completion:*' rehash true # Automaticly find new executables in path
|
||||
zstyle ':completion:*' rehash true # Automaticly find new executables in path
|
||||
# Speed up completions
|
||||
zstyle ':completion:*' accept-exact '*(N)'
|
||||
zstyle ':completion:*' use-cache on
|
||||
@@ -33,13 +30,12 @@ zstyle ':completion:*' menu select
|
||||
autoload -U compinit
|
||||
zmodload zsh/complist
|
||||
compinit
|
||||
_comp_options+=(globdots) # Include hidden files
|
||||
_comp_options+=(globdots) # Include hidden files
|
||||
|
||||
HISTFILE=~/.config/zsh/.zshistory
|
||||
HISTSIZE=10000
|
||||
SAVEHIST=10000
|
||||
WORDCHARS=${WORDCHARS//\/[&.;]} # Don't consider certain part of the word
|
||||
|
||||
WORDCHARS=${WORDCHARS//\/[&.;]/} # Don't consider certain part of the word
|
||||
|
||||
# theme/plugins
|
||||
source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh 2>/dev/null
|
||||
@@ -53,52 +49,50 @@ bindkey -e
|
||||
bindkey -v
|
||||
export KEYTIMEOUT=1
|
||||
|
||||
|
||||
# Change cursor shape for different vi modes.
|
||||
function zle-keymap-select {
|
||||
case $KEYMAP in
|
||||
vicmd) echo -ne "\e[1 q";; # block
|
||||
viins|main) echo -ne "\e[5 q";; # beam
|
||||
esac
|
||||
case $KEYMAP in
|
||||
vicmd) echo -ne '\e[1 q' ;; # block
|
||||
viins | main) echo -ne '\e[5 q' ;; # beam
|
||||
esac
|
||||
}
|
||||
zle -N zle-keymap-select
|
||||
zle-line-init() {
|
||||
zle -K viins # initiate `vi insert` as keymap (can be removed if `bindkey -V` has been set elsewhere)
|
||||
echo -ne "\e[5 q"
|
||||
zle -K viins # initiate `vi insert` as keymap (can be removed if `bindkey -V` has been set elsewhere)
|
||||
echo -ne '\e[5 q'
|
||||
}
|
||||
zle -N zle-line-init
|
||||
echo -ne "\e[5 q" # Use beam shape cursor on startup.
|
||||
preexec() { echo -ne "\e[5 q" ;} # Use beam shape cursor for each new prompt.
|
||||
|
||||
echo -ne '\e[5 q' # Use beam shape cursor on startup.
|
||||
preexec() { echo -ne '\e[5 q'; } # Use beam shape cursor for each new prompt.
|
||||
|
||||
# Run exa on directory change
|
||||
function cd() {
|
||||
new_directory="$*";
|
||||
if [ $# -eq 0 ]; then
|
||||
new_directory=${HOME};
|
||||
fi;
|
||||
builtin cd "${new_directory}" && exa -a --icons --group-directories-first
|
||||
new_directory="$*"
|
||||
if [ $# -eq 0 ]; then
|
||||
new_directory=${HOME}
|
||||
fi
|
||||
builtin cd "${new_directory}" && exa -a --icons --group-directories-first
|
||||
}
|
||||
|
||||
# Use lf to switch directories and bind it to ctrl-o
|
||||
lfcd () {
|
||||
tmp="$(mktemp)"
|
||||
lfrun -last-dir-path="$tmp" "$@"
|
||||
if [ -f "$tmp" ]; then
|
||||
dir="$(cat "$tmp")"
|
||||
rm -f "$tmp" >/dev/null
|
||||
[ -d "$dir" ] && [ "$dir" != "$(pwd)" ] && cd "$dir"
|
||||
fi
|
||||
function lfcd() {
|
||||
tmp="$(mktemp)"
|
||||
lfrun -last-dir-path="$tmp" "$@"
|
||||
if [ -f "$tmp" ]; then
|
||||
dir="$(bat "$tmp")"
|
||||
rm -f "$tmp" >/dev/null
|
||||
[ -d "$dir" ] && [ "$dir" != "$(pwd)" ] && cd "$dir"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
# Navigate words with CTRL+ARROW keys
|
||||
bindkey '^[Oc' forward-word
|
||||
bindkey '^[Od' backward-word
|
||||
bindkey '^[[1;5C' forward-word
|
||||
bindkey '^[[1;5D' backward-word
|
||||
bindkey '^H' backward-kill-word # delete previous word with CTRL+BACKSPACE
|
||||
bindkey '^[[Z' undo # SHIFT+TAB undo last action
|
||||
bindkey "^[[3~" delete-char
|
||||
bindkey '^H' backward-kill-word # delete previous word with CTRL+BACKSPACE
|
||||
bindkey '^[[Z' undo # SHIFT+TAB undo last action
|
||||
bindkey '^[[3~' delete-char
|
||||
|
||||
bindkey '^[[A' history-substring-search-up
|
||||
bindkey '^[[B' history-substring-search-down
|
||||
@@ -110,24 +104,25 @@ bindkey -M menuselect 'l' vi-forward-char
|
||||
bindkey -M menuselect 'j' vi-down-line-or-history
|
||||
bindkey -v '^?' backward-delete-char
|
||||
|
||||
bindkey -s "^o" "^ulfcd\n"
|
||||
bindkey -s "^a" "ubc -lq\n"
|
||||
bindkey "^[[P" delete-char
|
||||
bindkey -s '^o' '^ulfcd\n'
|
||||
# bindkey -s '^a' 'ubc -lq\n'
|
||||
bindkey '^[[P' delete-char
|
||||
|
||||
# Edit line in vim with ctrl-e
|
||||
autoload edit-command-line; zle -N edit-command-line
|
||||
bindkey "^e" edit-command-line
|
||||
bindkey -M vicmd "^[[P" vi-delete-char
|
||||
bindkey -M vicmd "^e" edit-command-line
|
||||
bindkey -M visual "^[[P" vi-delete
|
||||
autoload edit-command-line
|
||||
zle -N edit-command-line
|
||||
bindkey '^e' edit-command-line
|
||||
bindkey -M vicmd '^[[P' vi-delete-char
|
||||
bindkey -M vicmd '^e' edit-command-line
|
||||
bindkey -M visual '^[[P' vi-delete
|
||||
|
||||
# Aliases
|
||||
alias cp='cp -iv' # Confirm before overwriting something
|
||||
alias mv="mv -iv"
|
||||
alias rm="rm -vI"
|
||||
alias mkdir="mkdir -pv"
|
||||
alias df='df -h' # Human-readable sizes
|
||||
alias free='free -m' # Show sizes in MB
|
||||
alias cp='cp -iv' # Confirm before overwriting something
|
||||
alias mv='mv -iv'
|
||||
alias rm='rm -vI'
|
||||
alias mkdir='mkdir -pv'
|
||||
alias df='df -h' # Human-readable sizes
|
||||
alias free='free -m' # Show sizes in MB
|
||||
alias gitu='git add . && git commit && git push'
|
||||
alias ls='exa -a --icons --group-directories-first'
|
||||
alias lf='lfrun'
|
||||
@@ -138,18 +133,18 @@ alias pman='doas pacman'
|
||||
alias battery='acpi'
|
||||
alias airpods='bluetoothctl connect C8:B1:CD:E0:14:4F'
|
||||
alias weather='curl wttr.in/'
|
||||
alias ww="nvim ~/vimwiki/index.wiki"
|
||||
alias py="python"
|
||||
alias grep="grep --color=auto"
|
||||
alias diff="diff --color=auto"
|
||||
alias ip="ip -color=auto"
|
||||
alias grep="rg"
|
||||
alias code="vscodium"
|
||||
|
||||
alias ww='nvim ~/vimwiki/index.wiki'
|
||||
alias py='python'
|
||||
alias grep='grep --color=auto'
|
||||
alias diff='diff --color=auto'
|
||||
alias ip='ip -color=auto'
|
||||
alias grep='rg'
|
||||
alias code='vscodium'
|
||||
|
||||
source /usr/share/zsh/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh 2>/dev/null
|
||||
|
||||
autoload -U promptinit; promptinit
|
||||
autoload -U promptinit
|
||||
promptinit
|
||||
prompt spaceship
|
||||
|
||||
# PROMPT
|
||||
@@ -225,4 +220,3 @@ SPACESHIP_VENV_SHOW=true
|
||||
SPACESHIP_CONDA_SHOW=false
|
||||
SPACESHIP_PYENV_SHOW=true
|
||||
SPACESHIP_VI_MODE_SHOW=false
|
||||
|
||||
|
||||
Reference in New Issue
Block a user