summaryrefslogtreecommitdiff
path: root/.config/shell
diff options
context:
space:
mode:
authorfilip <“filip.rabiega@gmail.com”>2025-07-10 11:03:20 +0200
committerfilip <“filip.rabiega@gmail.com”>2025-07-10 11:03:20 +0200
commita91716202265bbc178ac00140e0fc8978b79c94c (patch)
tree25735dd207522d3638c50501f7d316dacd72c5ec /.config/shell
parent94d9b788ddd93ffe45153762bb0b224a98ed4027 (diff)
downloaddotfiles-a91716202265bbc178ac00140e0fc8978b79c94c.tar.gz
dotfiles-a91716202265bbc178ac00140e0fc8978b79c94c.tar.bz2
dotfiles-a91716202265bbc178ac00140e0fc8978b79c94c.zip
new dotfiles
Diffstat (limited to '.config/shell')
-rw-r--r--.config/shell/.bashrc71
-rw-r--r--.config/shell/aliasrc76
2 files changed, 147 insertions, 0 deletions
diff --git a/.config/shell/.bashrc b/.config/shell/.bashrc
new file mode 100644
index 0000000..6474a3b
--- /dev/null
+++ b/.config/shell/.bashrc
@@ -0,0 +1,71 @@
+# ~/.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/aliasrc b/.config/shell/aliasrc
new file mode 100644
index 0000000..435be0b
--- /dev/null
+++ b/.config/shell/aliasrc
@@ -0,0 +1,76 @@
+#!/bin/sh
+
+# Use $XINITRC variable if file exists.
+[ -f "$XINITRC" ] && alias startx="startx $XINITRC"
+
+[ -f "$MBSYNCRC" ] && alias mbsync="mbsync -c $MBSYNCRC"
+
+# sudo not required for some system commands
+for command in mount umount sv apt apt-get aptitude dpkg su shutdown poweroff reboot ; do
+ alias $command="sudo $command"
+done; unset command
+
+# Stuff here is kinda messy (too bad)
+alias c="clear"
+
+# Verbosity and settings that you pretty much just always are going to want.
+alias \
+ cp="cp -iv" \
+ echo="echo -n" \
+ journalctl="journalctl -xe" \
+ mkd="mkdir -pv" \
+ mv="mv -iv" \
+ rm="logrm -vI" \
+ rmd="rmdir -vp" \
+ rsync="rsync -vrPlu" \
+
+# Colorize commands when possible.
+alias \
+ ccat="highlight --out-format=ansi" \
+ diff="diff --color=auto" \
+ dir="dir --color=auto" \
+ egrep="egrep --color=auto" \
+ fgrep="fgrep --color=auto" \
+ grep="grep --color=auto" \
+ ip="ip -color=auto" \
+ ls="ls_new" \
+ vdir="vdir --color=auto" \
+
+# Make stuff easy to customize and source automatically
+alias \
+ vrc='vim "$HOME/.config/vim/.vimrc"' \
+ zal='vim "$ZSHDIR/aliasrc" && source "$ZSHDIR/aliasrc"' \
+ zen='vim "$ZSHDIR/envvarrc" && source "$ZSHDIR/envvarrc"' \
+ zrc='vim "$HOME/.zshrc" && source "$HOME/.zshrc"' \
+
+# Aliases for connecting to server
+alias \
+ ctg="ssh git@rabiega.xyz" \
+ cts="ssh root@rabiega.xyz" \
+
+# Making stuff shorter
+alias \
+ ..="cd .." \
+ b="buku --suggest" \
+ bd="buku-dmenu" \
+ copy="xsel -ib" \
+ cs="chadsearch" \
+ lw="librewolf & exit -f" \
+ ms="mansplain &" \
+ nbadd='cat >> "$XDG_CONFIG_HOME"/newsboat/urls << EOF' \
+ obs="exec /usr/bin/obsidian" \
+ py="python3" \
+ sd="sudo shutdown -h now" \
+ tor="cd ~/Downloads/tor-browser/ && ./start-tor-browser.desktop && cd -" \
+ update="sudo apt update && apt upgrade" \
+ update_dwm="cd ~/repos/dwm && cp ~/repos/dwm/config.def.h ~/repos/dwm/config.h && sudo make clean install && cd -" \
+ wifi_connect="nmcli device wifi connect" \
+ wifi_list="nmcli device wifi list" \
+ wttr="curl wttr.in/Wroclaw" \
+
+# 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