diff options
author | Aaditya Dhruv <[email protected]> | 2025-06-14 10:12:33 +0530 |
---|---|---|
committer | Aaditya Dhruv <[email protected]> | 2025-06-14 10:12:33 +0530 |
commit | bd8919afb109efa0a92def766aca81f1e2e146fa (patch) | |
tree | a3cfbd93f8f0be44dd666969abdb20a27d6db84c /src/config/files/shell/bashrc.d | |
parent | 90b9ea4267ee04e1fe6f808ae322d4ad36edc693 (diff) |
Update neovim, neomutt, and shell configurations
Diffstat (limited to 'src/config/files/shell/bashrc.d')
-rw-r--r-- | src/config/files/shell/bashrc.d/10-export.sh | 11 | ||||
-rw-r--r-- | src/config/files/shell/bashrc.d/20-aliases.sh | 7 | ||||
-rw-r--r-- | src/config/files/shell/bashrc.d/30-functions.sh | 41 |
3 files changed, 59 insertions, 0 deletions
diff --git a/src/config/files/shell/bashrc.d/10-export.sh b/src/config/files/shell/bashrc.d/10-export.sh new file mode 100644 index 0000000..e6c6e28 --- /dev/null +++ b/src/config/files/shell/bashrc.d/10-export.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +export DISABLE_MAGIC_FUNCTIONS=true +export BROWSER=/usr/bin/firefox +export EDITOR="/usr/bin/nvim" +export PATH="$HOME/.local/bin:$PATH" +export GPG_TTY=$(tty) +export NVM_DIR="$HOME/.nvm" +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" +source <(kubectl completion bash) +source <(fzf --bash) diff --git a/src/config/files/shell/bashrc.d/20-aliases.sh b/src/config/files/shell/bashrc.d/20-aliases.sh new file mode 100644 index 0000000..cd91c67 --- /dev/null +++ b/src/config/files/shell/bashrc.d/20-aliases.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +alias vi=nvim +alias k=kubectl +alias tmux="TERM=xterm-256color tmux" +alias note="vi $HOME/Notes/general/\$(get_date).md" +alias get_idf='. $HOME/git/tools/esp-idf/export.sh' diff --git a/src/config/files/shell/bashrc.d/30-functions.sh b/src/config/files/shell/bashrc.d/30-functions.sh new file mode 100644 index 0000000..e02e8de --- /dev/null +++ b/src/config/files/shell/bashrc.d/30-functions.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +get_date() { + date +'%Y-%m-%d' +} + +notebook() { + NEW=0 + NOTEBOOK=$1 + while getopts 'ln:' flag; do + case "${flag}" in + l) ls -1 ~/Notes + return 0 + ;; + n) NEW=1 + NOTEBOOK=${OPTARG} + ;; + *) echo "Invalid flag!" && return 1 ;; + esac + done + if [[ $NEW == 1 && -z "$NOTEBOOK" ]]; then + echo "No notebook name passed!" + return 1 + fi + if [[ $NEW == 1 ]]; then + mkdir -p $HOME/Notes/$NOTEBOOK + fi + if [[ -z "$NOTEBOOK" ]]; then + pushd $HOME/Notes + vi $(find . -type f) + popd + elif [[ ! -z "$NOTEBOOK" ]]; then + if [[ ! -d "${HOME}/Notes/${NOTEBOOK}" ]]; then + echo "No notebook called "$NOTEBOOK"!" + else + pushd $HOME/Notes/$NOTEBOOK + vi $(find . -type f) + popd + fi + fi +} |