summaryrefslogtreecommitdiff
path: root/.config/shell
diff options
context:
space:
mode:
Diffstat (limited to '.config/shell')
-rw-r--r--.config/shell/.bashrc71
-rw-r--r--.config/shell/.zshrc65
-rw-r--r--.config/shell/aliasrc2
-rw-r--r--.config/shell/envvarrc7
4 files changed, 60 insertions, 85 deletions
diff --git a/.config/shell/.bashrc b/.config/shell/.bashrc
deleted file mode 100644
index 6474a3b..0000000
--- a/.config/shell/.bashrc
+++ /dev/null
@@ -1,71 +0,0 @@
-# ~/.bashrc: executed by bash(1) for non-login shells.
-
-# If not running interactively, don't do anything
-case $- in
- *i*) ;;
- *) return;;
-esac
-
-# don't put duplicate lines or lines starting with space in the history.
-HISTCONTROL=ignoreboth
-
-# append to the history file, don't overwrite it
-shopt -s histappend
-
-# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
-HISTSIZE=1000
-HISTFILESIZE=2000
-
-# check the window size after each command and, if necessary,
-# update the values of LINES and COLUMNS.
-shopt -s checkwinsize
-
-# set a fancy prompt
-case "$TERM" in
- *-256color) color_prompt=yes;;
-esac
-
-# colored GCC warnings and errors
-export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
-
-# Alias definitions
-if [ -f ~/.bash_aliases ]; then
- . ~/.bash_aliases
-fi
-
-# Set vi mode as the default mode
-set -o vi
-
-# Opam configuration
-test -r /home/filipek/.opam/opam-init/init.sh && . /home/filipek/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true
-
-# Set options for some frequently used programs
-export LS_OPTIONS='-lha --color=auto'
-export TAR_EXTRACT='-xvzf'
-export TAR_ARCHIVE='-cvzf'
-export MKDIR_OPTIONS='-p'
-export RSYNC_OPTIONS='-rtvzP'
-export MANPAGER="vim -M +MANPAGER - "
-
-export SCRIPTS=$HOME/.scripts
-export PATH=$SCRIPTS:$HOME/.cargo/bin:$HOME/.local/bin:$PATH
-export EDITOR="vim"
-export BROWSER="librewolf"
-
-# GPG Config
-GPG_TTY=$(tty)
-export GPG_TTY
-
-# Prompt colors
-export PS1="\[$(tput setaf 2)\]\u\[$(tput setaf 35)\]@\[$(tput setaf 10)\]\h \[$(tput setaf 33)\]\w \[$(tput sgr0)\]$ "
-force_color_prompt=yes
-
-# Run these scripts at login
-remaps
-
-# After every command, switch to insert mode automatically
-bind -m vi-command 'RETURN':vi-insert-mode
-
-# Make it so that Ctrl+L works in vi mode
-bind -m vi-command '"\C-l": clear-screen'
-bind -m vi-insert '"\C-l": clear-screen'
diff --git a/.config/shell/.zshrc b/.config/shell/.zshrc
index e23be49..3e00ea5 100644
--- a/.config/shell/.zshrc
+++ b/.config/shell/.zshrc
@@ -14,9 +14,8 @@ HISTFILE="${XDG_CACHE_HOME:-$HOME/.cache}/shell/history"
setopt inc_append_history
# Load aliases and shortcuts if existent.
-[ -f "$HOME/.config/shell/envvarrc" ] && source "$HOME/.config/shell/envvarrc"
-[ -f "$HOME/.config/shell/aliasrc" ] && source "$HOME/.config/shell/aliasrc"
-# [ -f "$HOME/.config/shell/funcrc" ] && source "$HOME/.config/shell/funcrc"
+[ -f "$ALIASRC" ] && source "$ALIASRC"
+[ -f "$ENVVARRC" ] && source "$ENVVARRC"
# Basic auto/tab complete:
autoload -U compinit
@@ -72,9 +71,48 @@ lfcd () {
}
# Some bindings
-bindkey -s '^o' '^ulfcd\n'
-bindkey -s '^g' '^ugitui\n'
-bindkey -s '^t' '^uhtop\n'
+lfcd_widget() {
+ zle -I
+ BUFFER="lfcd"
+ zle accept-line
+}
+
+gitui_widget() {
+ zle -I
+ BUFFER="gitui"
+ zle accept-line
+}
+
+htop_widget() {
+ zle -I
+ BUFFER="htop"
+ zle accept-line
+}
+
+notesplain_widget() {
+ zle -I
+ BUFFER="notesplain"
+ zle accept-line
+}
+
+# Register it as a ZLE widget
+zle -N lfcd_widget
+zle -N gitui_widget
+zle -N htop_widget
+zle -N notesplain_widget
+
+# Bind it in both vi keymaps
+bindkey -M viins '^o' lfcd_widget
+bindkey -M vicmd '^o' lfcd_widget
+
+bindkey -M viins '^g' gitui_widget
+bindkey -M vicmd '^g' gitui_widget
+
+bindkey -M viins '^t' htop_widget
+bindkey -M vicmd '^t' htop_widget
+
+bindkey -M viins '^n' notesplain_widget
+bindkey -M vicmd '^n' notesplain_widget
# Use vim keys in tab complete menu:
bindkey -M menuselect 'h' vi-backward-char
@@ -89,3 +127,18 @@ 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
+
+# >>> conda initialize >>>
+# !! Contents within this block are managed by 'conda init' !!
+# __conda_setup="$('/home/filipek/.local/opt/miniconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
+# if [ $? -eq 0 ]; then
+# eval "$__conda_setup"
+# else
+# if [ -f "/home/filipek/.local/opt/miniconda3/etc/profile.d/conda.sh" ]; then
+# . "/home/filipek/.local/opt/miniconda3/etc/profile.d/conda.sh"
+# else
+# export PATH="/home/filipek/.local/opt/miniconda3/bin:$PATH"
+# fi
+# fi
+# unset __conda_setup
+# <<< conda initialize <<<
diff --git a/.config/shell/aliasrc b/.config/shell/aliasrc
index c3d3a13..0a627b0 100644
--- a/.config/shell/aliasrc
+++ b/.config/shell/aliasrc
@@ -57,7 +57,6 @@ alias \
copy="xsel -ib" \
fd="fdfind" \
lw="librewolf & exit -f" \
- moosic="ncmpcpp" \
nbadd='cat >> "$XDG_CONFIG_HOME"/newsboat/urls << EOF' \
py="python3" \
sd="sudo shutdown -h now" \
@@ -68,6 +67,5 @@ alias \
# Git aliases
alias \
dotfiles="/usr/bin/git --git-dir=\$HOME/.dotfiles --work-tree=\$HOME" \
- obsidian="/usr/bin/git --git-dir=\$HOME/obsidian --work-tree=\$HOME" \
# Limbo
diff --git a/.config/shell/envvarrc b/.config/shell/envvarrc
index 42e9d3e..dab4f7a 100644
--- a/.config/shell/envvarrc
+++ b/.config/shell/envvarrc
@@ -13,27 +13,22 @@ export TERMINAL="st"
export SCRIPTS="$HOME/.scripts"
export PATH="$SCRIPTS:$HOME/.cargo/bin:$HOME/.local/bin:$PATH"
-# TODO: clean up this mess
+# Other stuff
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_CACHE_HOME="$HOME/.cache"
export XINITRC="$XDG_CONFIG_HOME/x11/xinitrc"
-
export ALIASRC="$HOME/.config/shell/aliasrc"
export ZSHDIR="$HOME/.config/shell"
export ENVVARRC="$HOME/.config/shell/envvarrc"
-
export CONDARC="$HOME/.config/conda/.condarc"
export _CONDA_ROOT="$HOME/.local/opt/miniconda3"
-
export GOPATH="$HOME/langs/go"
export STARDICT_DATA_DIR="$HOME/.local/share/stardict"
-
export R_HISTFILE="$HOME/langs/R/.Rhistory"
export R_HOME="$HOME/langs/R"
export R_LIBS_USER="$HOME/langs/R"
export R_PROFILE="$HOME/langs/R/.Rprofile"
-
export MYVIMRC="$HOME/.config/vim/.vimrc"
export VIMINFO="$HOME/.config/vim/.viminfo"
export VIMINIT="source $MYVIMRC"