From 7e582da7e3e1e9492560a12ed9151b05af4f2400 Mon Sep 17 00:00:00 2001 From: Daniel Weber Date: Fri, 28 Jun 2024 13:44:44 -0400 Subject: [PATCH] Initial commit for using stow to manage dotfiles --- .gitignore | 1 + .gitmodules | 6 ++++++ nvim/.config/nvim | 1 + tmux/.config/tmux/plugins/tpm | 1 + tmux/.config/tmux/tmux.conf | 24 +++++++++++++++++++++ top_level/.bash_aliases | 31 ++++++++++++++++++++++++++++ top_level/.bashrc | 39 +++++++++++++++++++++++++++++++++++ 7 files changed, 103 insertions(+) create mode 100644 .gitignore create mode 100644 .gitmodules create mode 160000 nvim/.config/nvim create mode 160000 tmux/.config/tmux/plugins/tpm create mode 100644 tmux/.config/tmux/tmux.conf create mode 100644 top_level/.bash_aliases create mode 100644 top_level/.bashrc diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0481a8e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +tmux/.config/tmux/plugins diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..bc0b4c6 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "nvim/.config/nvim"] + path = nvim/.config/nvim + url = https://pipsquire.webhop.me/djweber12/my_nvim_config.git +[submodule "tmux/.config/tmux/plugins/tpm"] + path = tmux/.config/tmux/plugins/tpm + url = https://github.com/tmux-plugins/tpm diff --git a/nvim/.config/nvim b/nvim/.config/nvim new file mode 160000 index 0000000..ab43389 --- /dev/null +++ b/nvim/.config/nvim @@ -0,0 +1 @@ +Subproject commit ab433893d118ca0047dd31b2be8ac5981571196d diff --git a/tmux/.config/tmux/plugins/tpm b/tmux/.config/tmux/plugins/tpm new file mode 160000 index 0000000..99469c4 --- /dev/null +++ b/tmux/.config/tmux/plugins/tpm @@ -0,0 +1 @@ +Subproject commit 99469c4a9b1ccf77fade25842dc7bafbc8ce9946 diff --git a/tmux/.config/tmux/tmux.conf b/tmux/.config/tmux/tmux.conf new file mode 100644 index 0000000..d4b4b50 --- /dev/null +++ b/tmux/.config/tmux/tmux.conf @@ -0,0 +1,24 @@ +# List of plugins +set -g @plugin 'tmux-plugins/tpm' +set -g @plugin 'tmux-plugins/tmux-sensible' +# Tmux theme +set -g @plugin '2kabhishek/tmux2k' + +set -g @tmux2k-theme 'onedark' + +set -ga terminal-overrides ",xterm-256color:Tc" + +set-option -g mouse on + +bind h select-pane -L +bind j select-pane -D +bind k select-pane -U +bind l select-pane -R + +bind-key -r -T prefix C-k resize-pane -U 5 +bind-key -r -T prefix C-j resize-pane -D 5 +bind-key -r -T prefix C-h resize-pane -L 5 +bind-key -r -T prefix C-l resize-pane -R 5 + +# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) +run '~/.config/tmux/plugins/tpm/tpm' diff --git a/top_level/.bash_aliases b/top_level/.bash_aliases new file mode 100644 index 0000000..d560eff --- /dev/null +++ b/top_level/.bash_aliases @@ -0,0 +1,31 @@ +# vim:syntax=sh +if [[ "`whoami`" == "root" ]]; then + PS1='\[\033[31;1m\]\u@\H\[\033[32;1m\] [\w]\[\033[35;1m\] \d \t \[\033[33;1m\](\j)\n\$ \[\033[0m\]' +else + PS1='\[\033[35;1m\]\u@\H\[\033[31;1m\] [\w]\[\033[32;1m\] \d \t \[\033[33;1m\](\j)\[\033[33;1m\]$(prompt_ps1_git_branch)\[\033[33;1m\]\$ \[\033[0m\]' +fi +# alternate PS1: +# PS1='[\[\033[31;1m\]\u@\H\[\033[34;1m\] \w\[\033[0m\]]\$ \[\033[0m\]' +case "$TERM" in +[ax]term*|rxvt*) + PROMPT_COMMAND='cdshowgitstatus;echo -ne "\033]0;"$(basename ${PWD})" [${USER}@${HOSTNAME}: ${PWD}]\007"' + ;; +*) + ;; +esac +alias grep='grep --color=auto' +alias grepnosvn='grep --color=auto --exclude-dir=".svn"' +alias egrepnosvn='egrep --color=auto --exclude-dir=".svn"' +alias gvim='gvim --remote-tab-silent' +alias cdshowgitstatus='if [[ $CDSHOWGITSTATUS_LAST_WD != $PWD ]]; then if [[ -d .git ]]; then git status; fi; CDSHOWGITSTATUS_LAST_WD=$PWD; fi' +#PROMPT_COMMAND="$PROMPT_COMMAND;cdshowgitstatus" +function prompt_ps1_git_branch() +{ + if [[ -e /usr/bin/git && "$PCGB_LAST_WD" != "$PWD" ]]; then + current_git_branch=$(git branch 2>/dev/null | grep '^\*' | sed -e 's/^..//'); + PCGB_LAST_WD=$PWD; + fi; + if [[ "$current_git_branch" != "" ]]; then + echo -e " [${current_git_branch}]"; + fi +} diff --git a/top_level/.bashrc b/top_level/.bashrc new file mode 100644 index 0000000..c355ee8 --- /dev/null +++ b/top_level/.bashrc @@ -0,0 +1,39 @@ +# .bashrc + +# Source global definitions +if [ -f /etc/bashrc ]; then + . /etc/bashrc +fi + +if [ -f "${HOME}/.bash_aliases" ]; then + source "${HOME}/.bash_aliases" +fi + +# User specific environment +if ! [[ "$PATH" =~ "$HOME/.local/bin:$HOME/bin:" ]]; then + PATH="$HOME/.local/bin:$HOME/bin:$PATH" +fi +export PATH + +HISTSIZE=1000000 + +# Uncomment the following line if you don't like systemctl's auto-paging feature: +# export SYSTEMD_PAGER= + +# User specific aliases and functions +if [ -d ~/.bashrc.d ]; then + for rc in ~/.bashrc.d/*; do + if [ -f "$rc" ]; then + . "$rc" + fi + done +fi +unset rc + +alias nvimc="nvim ~/.config/nvim" +alias bashrc="nvim ~/.bashrc" +alias vpy="source ./venv/bin/activate" +export XDG_CONFIG_HOME=~/.config +function fcd() { + cd $(find . -type d -print | fzf); +}