Fix zsh stuff finally

This commit is contained in:
elkowar 2021-10-08 16:58:07 +02:00
parent b1e09e6989
commit 263c805697
No known key found for this signature in database
GPG key ID: E321AD71B1D1F27F
7 changed files with 107 additions and 21 deletions

View file

@ -31,7 +31,7 @@
base = { base = {
enable = true; enable = true;
enableFish = true; enableFish = true;
enableZsh = true; enableZsh = false;
includeNiceToHaves = true; includeNiceToHaves = true;
includeHaskellDev = true; includeHaskellDev = true;
}; };

View file

@ -115,7 +115,7 @@ in
fzf = { fzf = {
enable = true; enable = false;
enableFishIntegration = cfg.enableFish; enableFishIntegration = cfg.enableFish;
enableZshIntegration = cfg.enableZsh; enableZshIntegration = cfg.enableZsh;
defaultCommand = "rg --files"; defaultCommand = "rg --files";

View file

@ -1,12 +1,25 @@
export EDITOR="nvim" if [ -e $HOME/.nix-profile/etc/profile.d/nix.sh ]; then
export PATH="/home/leon/.local/bin/scripts:$PATH:/home/leon/.emacs.d/bin/" . $HOME/.nix-profile/etc/profile.d/nix.sh;
export PATH="$HOME/.npm-global/bin:$HOME/intelliJInstall/bin:$PATH:$HOME/.cargo/bin" fi
export PATH="$HOME/.local/bin/scripts:$PATH"
export PATH="$HOME/.emacs.d/bin/:$PATH"
export PATH="$HOME/.npm-global/bin:$PATH"
export PATH="$HOME/intelliJInstall/bin:$PATH"
export PATH="$HOME/.cargo/bin:$PATH"
export PATH="$HOME/.nix-profile/share/applications/:$PATH" export PATH="$HOME/.nix-profile/share/applications/:$PATH"
export PATH="/home/leon/.nix-profile/bin/:$PATH" export PATH="$HOME/.nix-profile/bin/:$PATH"
export PATH="/home/leon/.cpm/bin:$PATH" export PATH="$HOME/.cpm/bin:$PATH"
export PATH="/home/leon/.local/bin:$PATH" export PATH="$HOME/.local/bin:$PATH"
export PATH="/home/leon/.nimble/bin:$PATH" export PATH="$HOME/.nimble/bin:$PATH"
export _JAVA_AWT_WM_NONREPARENTING=1
export EDITOR="$(which nvim)"
export BROWSER="$(which google-chrome-stable)"
export TERMINAL="$(which alacritty)"
export RANGER_LOAD_DEFAULT_RC=FALSE export RANGER_LOAD_DEFAULT_RC=FALSE
@ -16,19 +29,26 @@ export FZF_ALT_C_COMMAND="rg --files --null | xargs -0 dirname | sort -u"
export LESSHISTFILE="/dev/null" export LESSHISTFILE="/dev/null"
export XDG_CACHE_HOME="$HOME/.cache" export XDG_CACHE_HOME="$HOME/.cache"
export XDG_CONFIG_HOME="$HOME/.config" export XDG_CONFIG_HOME="$HOME/.config"
export XDG_DATA_HOME="$HOME/.local/share"
# Man pages color support
export LESS_TERMCAP_mb=$'\e[1;32m'
export LESS_TERMCAP_md=$'\e[1;32m'
export LESS_TERMCAP_me=$'\e[0m'
export LESS_TERMCAP_se=$'\e[0m'
export LESS_TERMCAP_so=$'\e[01;33m'
export LESS_TERMCAP_ue=$'\e[0m'
export LESS_TERMCAP_us=$'\e[1;4;31m'
export NNN_PLUG='F:fzopen;S:suedit' export NNN_PLUG='F:fzopen;S:suedit'
[ "$XDG_CURRENT_DESKTOP" = "KDE" ] || [ "$XDG_CURRENT_DESKTOP" = "GNOME" ] || export QT_QPA_PLATFORMTHEME="qt5ct"
export FREETYPE_PROPERTIES='truetype:interpreter-version=40' export FREETYPE_PROPERTIES='truetype:interpreter-version=40'
export _JAVA_OPTIONS='-Dswing.aatext=true -Dawt.useSystemAAFontSettings=lcd' export _JAVA_OPTIONS='-Dswing.aatext=true -Dawt.useSystemAAFontSettings=lcd'
if [ -e /home/leon/.nix-profile/etc/profile.d/nix.sh ]; then
. /home/leon/.nix-profile/etc/profile.d/nix.sh;
fi # added by Nix installer
export XDG_DATA_DIRS="$HOME/.nix-profile/share/applications:$HOME/.local/share/applications:/usr/local/share:/usr/share" export XDG_DATA_DIRS="$HOME/.nix-profile/share/applications:$HOME/.local/share/applications:/usr/local/share:/usr/share"
export LOCALE_ARCHIVE=$(nix-build '<nixpkgs>' --no-out-link -A glibcLocales)/lib/locale/locale-archive export LOCALE_ARCHIVE=$(nix-build '<nixpkgs>' --no-out-link -A glibcLocales)/lib/locale/locale-archive
@ -36,3 +56,13 @@ export LOCALE_ARCHIVE=$(nix-build '<nixpkgs>' --no-out-link -A glibcLocales)/lib
export _JAVA_AWT_WM_NONREPARENTING=1 export _JAVA_AWT_WM_NONREPARENTING=1
command -v opam > /dev/null && eval "$(opam env)"
command -v luarocks > /dev/null && eval "$(luarocks path --lua-version=5.4)"
command -v zoxide > /dev/null && eval "$(zoxide init zsh)"
## Launches tbsm on session start
if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then
tbsm
fi

View file

@ -0,0 +1 @@
[ -f $HOME/.profile ] && . $HOME/.profile

View file

@ -1,3 +1,17 @@
# history config
HISTSIZE=50000
SAVEHIST=50000
HISTFILE="$XDG_CACHE_HOME"/zsh/history
setopt HIST_SAVE_NO_DUPS
setopt HIST_IGNORE_ALL_DUPS
#setopt INC_APPEND_HISTORY
setopt EXTENDED_HISTORY
setopt SHARE_HISTORY
# plugins
source ~/.zplug/init.zsh source ~/.zplug/init.zsh
zplug 'zplug/zplug', hook-build:'zplug --self-manage' zplug 'zplug/zplug', hook-build:'zplug --self-manage'
@ -6,6 +20,8 @@ zplug "zsh-users/zsh-completions"
zplug "Aloxaf/fzf-tab", defer:2 zplug "Aloxaf/fzf-tab", defer:2
zplug "zsh-users/zsh-history-substring-search", defer:2 zplug "zsh-users/zsh-history-substring-search", defer:2
zplug "zdharma/fast-syntax-highlighting", defer:2 zplug "zdharma/fast-syntax-highlighting", defer:2
zplug "zsh-users/zsh-autosuggestions"
zplug "olets/zsh-abbr"
if ! zplug check --verbose; then if ! zplug check --verbose; then
printf "Install? [y/N]: " printf "Install? [y/N]: "
@ -15,16 +31,29 @@ if ! zplug check --verbose; then
fi fi
zplug load zplug load
eval "$(zoxide init zsh)"
# load more stuff
source "$ZDOTDIR/fzf-tab.zsh" source "$ZDOTDIR/fzf-tab.zsh"
setopt nobeep # fzf keybindings
setopt HIST_IGNORE_ALL_DUPS [ -f $HOME/.fzf/shell/key-bindings.zsh ] && . $HOME/.fzf/shell/key-bindings.zsh
# some more options
setopt NOBEEP
setopt INTERACTIVE_COMMENTS
# ET nvim as manpager
export MANPAGER='nvim +Man! +"set nocul" +"set noshowcmd" +"set noruler" +"set noshowmode" +"set laststatus=0"'
autoload -Uz colors && colors autoload -Uz colors && colors
autoload -Uz promptinit && promptinit autoload -Uz promptinit && promptinit
# epic keybinds
my-backward-delete-word() { my-backward-delete-word() {
local WORDCHARS=${WORDCHARS/\//} local WORDCHARS=${WORDCHARS/\//}
zle backward-delete-word zle backward-delete-word
@ -35,8 +64,12 @@ bindkey '^H' backward-delete-word
bindkey "^[[H" beginning-of-line bindkey "^[[H" beginning-of-line
bindkey "^[[F" end-of-line bindkey "^[[F" end-of-line
bindkey '^[[A' history-substring-search-up
bindkey '^[[B' history-substring-search-down
# alias
alias ls="exa --icons" alias ls="exa --icons"
# load prompt
source "$ZDOTDIR/prompt.zsh" source "$ZDOTDIR/prompt.zsh"

View file

@ -0,0 +1,6 @@
abbr cvim="cd ~/.config/nvim && nvim && cd -"
abbr cnix="cd ~/.config/nixpkgs && nvim && cd -"
abbr cxmonad="cd ~/.xmonad && nvim lib/Config.hs && cd -"
abbr ra="ranger"
abbr cr="cargo run -- "

View file

@ -4,6 +4,21 @@ local __bright_cyan="#8ec07c"
local __bright_white="#ebdbb2" local __bright_white="#ebdbb2"
local __bright_green="#b8bb26" local __bright_green="#b8bb26"
# black magic that reruns prompt whenever the vi mode changes {{{
function zle-line-init zle-keymap-select {
case $KEYMAP in
vicmd) VI_INDICATOR="N";;
main|viins) VI_INDICATOR="─";;
esac
zle reset-prompt
}
zle -N zle-line-init
zle -N zle-keymap-select
# }}}
dir() { dir() {
local CUTOFF=3 local CUTOFF=3
local IFS=/ local IFS=/
@ -29,7 +44,8 @@ git_status() {
function _my_prompt() { function _my_prompt() {
local exit_code="$?" local exit_code="$?"
echo -n "%F{$__bright_white}╭───" echo -n "%F{$__bright_white}╭─$VI_INDICATOR"
#echo -n "%F{$__bright_white}╭───"
echo -n "%F{$__bright_cyan}$USER" echo -n "%F{$__bright_cyan}$USER"
echo -n "%F{$__bright_white} in" echo -n "%F{$__bright_white} in"
echo -n "%F{$__bright_green} $(dir)" echo -n "%F{$__bright_green} $(dir)"