From 89ef42d3acbcd6ebe50b3a2ad15193ff82980ccf Mon Sep 17 00:00:00 2001 From: James Dixon Date: Wed, 27 Jan 2021 14:57:13 -0500 Subject: [PATCH] get rid of extra configs --- stow/git/.gitconfig => .gitconfig | 14 +- Microsoft.PowerShell_profile.ps1 | 42 ++++ README.md | 13 +- stow/bash/.bash_profile | 8 - stow/bash/.bashrc | 236 ------------------ .../scripts/completions/hugoctl_comp.bash | 25 -- stow/scripts/.local/scripts/hugoctl | 132 ---------- stow/tmux/.tmux.conf | 53 ---- stow/vim/.vim/.gitignore | 6 - stow/vim/.vim/vimrc => vimrc | 0 stow/vim/.vim/vimrc.min => vimrc.min | 0 11 files changed, 53 insertions(+), 476 deletions(-) rename stow/git/.gitconfig => .gitconfig (79%) create mode 100644 Microsoft.PowerShell_profile.ps1 delete mode 100644 stow/bash/.bash_profile delete mode 100644 stow/bash/.bashrc delete mode 100644 stow/scripts/.local/scripts/completions/hugoctl_comp.bash delete mode 100755 stow/scripts/.local/scripts/hugoctl delete mode 100644 stow/tmux/.tmux.conf delete mode 100644 stow/vim/.vim/.gitignore rename stow/vim/.vim/vimrc => vimrc (100%) rename stow/vim/.vim/vimrc.min => vimrc.min (100%) diff --git a/stow/git/.gitconfig b/.gitconfig similarity index 79% rename from stow/git/.gitconfig rename to .gitconfig index 3b719d3..161d660 100644 --- a/stow/git/.gitconfig +++ b/.gitconfig @@ -8,9 +8,6 @@ [user] email = notjamesdixon@gmail.com name = James Dixon -[credential] - username = lemonase - helper = store [color] ui = true status = auto @@ -19,8 +16,6 @@ tool = vimdiff [difftool] prompt = false -[pull] - ff = only [alias] a = add aa = add --all @@ -40,3 +35,12 @@ pl = log --all --decorate --oneline --graph gr = log --all --decorate --oneline --graph graph = log --all --decorate --oneline --graph +[winUpdater] + recentlySeenVersion = 2.25.0.windows.1 +[filter "lfs"] + clean = git-lfs clean -- %f + smudge = git-lfs smudge -- %f + process = git-lfs filter-process + required = true +[core] + autocrlf = true diff --git a/Microsoft.PowerShell_profile.ps1 b/Microsoft.PowerShell_profile.ps1 new file mode 100644 index 0000000..8d88057 --- /dev/null +++ b/Microsoft.PowerShell_profile.ps1 @@ -0,0 +1,42 @@ +#-------- +# Imports +#-------- +# Posh +Import-Module posh-git + +# Chocolatey +$ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1" +if (Test-Path($ChocolateyProfile)) { + Import-Module "$ChocolateyProfile" +} +# PSReadLine +Set-PSReadLineOption -EditMode Emacs +Set-PSReadLineOption -BellStyle Visual + +# PSFzf +Set-PsFzfOption -PSReadlineChordProvider 'Ctrl+t' -PSReadlineChordReverseHistory 'Ctrl+r' + +#---------------------- +# Environment Varaibles +#---------------------- +$WD = "$env:USERPROFILE\source\repos" +$GOWD = "$env:USERPROFILE\go\src\github.com\lemonase" +$GODOTWD = "$env:USERPROFILE\Google Drive\Game Dev" +$EDITOR = "gvim" + +#-------- +# Aliases +#-------- +New-Alias so "Select-Object" +New-Alias wo "Where-Object" + +New-Alias venvac ".\venv\Scripts\Activate.ps1" + +#---------- +# Functions +#---------- +function wd { Set-Location $WD } +function gowd { Set-Location $GOWD } +function godotwd { Set-Location $GODOTWD } + +function ep { Start-Process "$EDITOR" "$PROFILE" } diff --git a/README.md b/README.md index 8977907..4baac44 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,5 @@ -# My dotfiles - -I am using [GNU Stow](https://www.gnu.org/software/stow/) to symlink -my dotfiles to their correct locations in my `$HOME` directory. +# My (Windows) dotfiles ## Instructions -First `cd` into the `stow` directory and run the following command - -```sh -stow * -t "$HOME" -``` - -If there are no errors, everything in that directory should be symlinked. +Just copy relevant files to %USERPROFILE% dir. diff --git a/stow/bash/.bash_profile b/stow/bash/.bash_profile deleted file mode 100644 index acdc259..0000000 --- a/stow/bash/.bash_profile +++ /dev/null @@ -1,8 +0,0 @@ -# .bash_profile is *not sourced* when launching bash from most GUI terminal emulators -# -# .bash_profile *is sourced* for login shells like from a TTY, ssh connection, or tmux. - -# For the sake of simplicity and consistency, I source my .bashrc -[ -f "$HOME/.bashrc" ] && source "$HOME/.bashrc" - -# vim:ft=sh diff --git a/stow/bash/.bashrc b/stow/bash/.bashrc deleted file mode 100644 index b06ff1c..0000000 --- a/stow/bash/.bashrc +++ /dev/null @@ -1,236 +0,0 @@ -# If not running interactively, don't do anything -case $- in - *i*) ;; - *) return;; -esac - -# HISTORY OPTIONS -# --------------- -HISTSIZE= ; -HISTFILESIZE= -HISTCONTROL="ignoreboth:erasedups" -HISTTIMEFORMAT="%F %T " - -# SHELL OPTIONS -# ------------- -shopt -s checkhash checkjobs checkwinsize -shopt -s dirspell extglob globstar -shopt -s cmdhist histappend - -# VARIABLES -# --------- -# PROGRAMS -export EDITOR="/usr/bin/vim" -export VISUAL="/usr/bin/vim" -export PAGER="less" - -# ALIASES -# ------- -# common options -LS_OPTS="-F --color=auto" -GREP_OPTS="--color=auto" - -# ls -alias l='ls ${LS_OPTS}' -alias ls='ls ${LS_OPTS}' -alias ll='ls -lsh ${LS_OPTS}' -alias la='ls -Alsh ${LS_OPTS}' -alias al='ls -A ${LS_OPTS}' -alias sl='ls -lsSh ${LS_OPTS}' -alias sal='ls -AlsSh ${LS_OPTS}' - -# grep -alias grep='grep ${GREP_OPTS}' -alias fgrep='fgrep ${GREP_OPTS}' -alias egrep='egrep ${GREP_OPTS}' - -# utility aliases -alias tree='tree -C' -alias treel='tree -C | less -R' -alias df='df -h' -alias lsmnt='mount | column -t' -alias mkdir='mkdir -p' - -# git -alias g=git -alias groot='cd $(git rev-parse --show-toplevel 2> /dev/null || echo -n ".")' - -# tmux -alias tmls='tmux ls' -alias tmlsc='tmux lsc' -alias tmks='tmux kill-session -t' # kill one session -alias tmka='tmux kill-server' # aka killall - -# python venv -alias venvac='source venv/bin/activate' - -# COLORS -# ------ -# color vars using tput or ANSI/VT100 Control sequences - -# check if tput is available -if [ -x "$(command -v tput)" ]; then - num_colors=$(tput colors) - if [ -n "$num_colors" ] && [ "$num_colors" -ge 8 ]; then - black="\[$(tput setaf 0)\]"; unesc_black="$(tput setaf 0)" - red="\[$(tput setaf 1)\]"; unesc_red="$(tput setaf 1)" - green="\[$(tput setaf 2)\]"; unesc_green="$(tput setaf 2)" - yellow="\[$(tput setaf 3)\]"; unesc_yellow="$(tput setaf 3)" - blue="\[$(tput setaf 4)\]"; unesc_blue="$(tput setaf 4)" - purple="\[$(tput setaf 5)\]"; unesc_purple="$(tput setaf 5)" - cyan="\[$(tput setaf 6)\]"; unesc_cyan="$(tput setaf 6)" - white="\[$(tput setaf 7)\]"; unesc_white="$(tput setaf 7)" - reset="\[$(tput sgr0)\]"; unesc_reset="$(tput sgr0)" - bold="\[$(tput bold)\]"; unesc_bold="$(tput bold)" - fi -else - # fallback to ANSI esacpe codes - black="\[\033[0;30m\]"; unesc_black="\033[0;30m" - red="\[\033[1;31m\]"; unesc_red="\033[1;31m" - green="\[\033[1;32m\]"; unesc_green="\033[1;32m" - yellow="\[\033[1;33m\]"; unesc_yellow="\033[1;33m" - blue="\[\033[1;34m\]"; unesc_blue="\033[1;34m" - purple="\[\033[1;35m\]"; unesc_purple="\033[1;35m" - cyan="\[\033[1;36m\]"; unesc_cyan="\033[1;36m" - white="\[\033[1;37m\]"; unesc_white="\033[1;37m" - reset="\[\033[0m\]"; unesc_reset="\033[0m" - bold="\[\033[1m\]"; unesc_bold="\033[1m" -fi - -# FUNCTIONS -# --------- -# common commands improved -cll() { cd -P "$@" && ls -alshF; } -cls() { cd -P "$@" && ls; } -mkcd() { mkdir -p -- "$1" && cd "$1"; } -cdd() { [ -n "$1" ] && for i in $(seq 1 "$1"); do cd ..; done; } -touchx() { touch "$@" && chmod +x "$@"; } - -# tmux -tm() { - if [ "$#" -gt 0 ]; then - tmux new-session -As "$1" - else - tmux new-session - fi -} - -tma() { - if [ "$#" -gt 0 ]; then - tmux attach-session -d -t "$1" - if [ "$?" -ne 0 ]; then - tmux new-session -As "$1" - fi - else - tmux attach - fi -} - -# checks if directory exists and path duplication -appendpath () { - if [ -d "$1" ]; then - case ":$PATH:" in - *:"$1":*) - ;; - *) - PATH="${PATH:+$PATH:}$1" - esac - fi -} - - -# easy backup -bkup() { - if [ -f "$1" ]; then - cp "${1}" "${1}.bkup.$(date +'%F.%R')"; - fi -} - -# git -lazygit() { - git commit -a -m "$*" && git push; -} - -lg() { - lazygit "$*"; -} - -# GIT PROMPT FUNCTION -# ------- -parse_git() { - BRANCH="$(git rev-parse --abbrev-ref HEAD 2> /dev/null)" - STATUS="$(git status 2> /dev/null)" - - if [[ $? -ne 0 ]]; then - return - else - printf "\001${unesc_reset}${unesc_bold}\002:(%s)" "${BRANCH}" - printf "\001${unesc_white}\002%s" "[" - if echo "${STATUS}" | grep -c "nothing to commit" &> /dev/null; then printf "\001${unesc_blue}\002%s" "="; fi - if echo "${STATUS}" | grep -c "renamed:" &> /dev/null; then printf "\001${unesc_red}\002%s" "%"; fi - if echo "${STATUS}" | grep -c "deleted:" &> /dev/null; then printf "\001${unesc_red}\002%s" "-"; fi - if echo "${STATUS}" | grep -c "new file:" &> /dev/null; then printf "\001${unesc_green}\002%s" "+"; fi - if echo "${STATUS}" | grep -c "branch is ahead:" &> /dev/null; then printf "\001${unesc_yellow}\002%s" ">"; fi - if echo "${STATUS}" | grep -c "branch is behind" &> /dev/null; then printf "\001${unesc_yellow}\002%s" "<"; fi - if echo "${STATUS}" | grep -c "Untracked files:" &> /dev/null; then printf "\001${unesc_yellow}\002%s" "?"; fi - if echo "${STATUS}" | grep -c "modified:" &> /dev/null; then printf "\001${unesc_yellow}\002%s" "*"; fi - printf "\001${unesc_white}\002%s" "]" - fi -} - -# PROMPTS -# ------- -# ***common prompts*** -# PS1="\W \\$ " -# PS1="[\u@\h:\W]\\$ " -# PS1="\u@\h:\W\\$ " - -# ***color prompts*** -# PS1="${bold}${blue}\W ${yellow}\\$ ${reset}" -# PS1="${bold}${purple}\u${yellow}@${cyan}\h${white}:${blue}\W ${yellow}\\$ ${reset}" - -# ***git prompts*** -# PS1="${bold}${blue}\W\$(parse_git)${green} \\$ ${reset}" -# PS1="${bold}${white}\t ${blue}\W\$(parse_git) ${cyan}\\$ ${reset}" -# PS1="${bold}${purple}\u${yellow}@${cyan}\h${white}:${blue}\W\$(parse_git)${green} \\$ ${reset}" -# PS1="${bold}\n${cyan}\u ${white}at ${yellow}\h ${white}in ${blue}\w ${white}on \$(parse_git)\n${yellow}\\$ ${reset}" - -# BASH AUTOCOMPLETION -# ------------------- -if ! shopt -oq posix; then - if [ -f /usr/share/bash-completion/bash_completion ]; then - source /usr/share/bash-completion/bash_completion - elif [ -f /etc/bash_completion ]; then - source /etc/bash_completion - fi -fi - -# EXTRA PATHS -# -------------- - -# Ruby -if command -v ruby > /dev/null && command -v gem > /dev/null; then - appendpath "$(ruby -r rubygems -e 'puts Gem.user_dir')/bin" -fi - -# Go -if command -v go > /dev/null; then - [ -d "$HOME/go" ] && mv "$HOME/go" "$HOME/.go" - export GOPATH="$HOME/.go" - export GOWD="$GOPATH/src/github.com/lemonase" - appendpath "$(go env GOPATH)/bin" -fi - -# Rust -if command -v cargo > /dev/null; then - appendpath "$HOME/.cargo/bin" -fi - -# Local -appendpath "$HOME/.local/bin" -appendpath "$HOME/.local/scripts" - -# SOURCE LOCAL RC -# -------- -[ -f "$HOME/.config/bashrc" ] && source "$HOME/.config/bashrc" -[ -f "$HOME/.local/bashrc" ] && source "$HOME/.local/bashrc" diff --git a/stow/scripts/.local/scripts/completions/hugoctl_comp.bash b/stow/scripts/.local/scripts/completions/hugoctl_comp.bash deleted file mode 100644 index da570fd..0000000 --- a/stow/scripts/.local/scripts/completions/hugoctl_comp.bash +++ /dev/null @@ -1,25 +0,0 @@ -# bash completion for hugctl - -_hugctl_completions() { - local cur - cur="${COMP_WORDS[COMP_CWORD]}" - - local blog_dir="$HOME/src/blog" - case ${COMP_CWORD} in - 1) - OPTS="new list edit serve kill deploy" - compopt -o bashdefault -o default - COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) - ;; - 2) - case ${COMP_CWORD[2]} in - *) - COMPREPLY=($(compgen -W "$(find $blog_dir/content/posts/ -iname '*.md' -type f | xargs -I@ basename @)" -- $cur)); - ;; - esac - ;; - esac - return 0 -} - -complete -F _hugctl_completions hugctl diff --git a/stow/scripts/.local/scripts/hugoctl b/stow/scripts/.local/scripts/hugoctl deleted file mode 100755 index a2a6442..0000000 --- a/stow/scripts/.local/scripts/hugoctl +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/bash - -# hugoctl -- hugo wrapper script to help manage a hugo blog - -# hugo variables (local machine) -scriptname=$(basename "$0") -blog_dir="$HOME/src/blog" # or the path to your blog -local_url="http://localhost:1313/" -post_filename="" -postname="" -full_post_dir="" -full_post_url="$local_url" - - -set_vars() { - local arg="$1" - - # handle no argument case - if [[ -z "$arg" ]]; then - echo -en "Please enter a post title: " - read -r arg - fi - - # handle extraneous .md file extension - if [[ ! "$arg" =~ .md$ ]]; then - postname="$arg" - else - postname="${arg%???}" - fi - post_filename="$postname.md" - - # hugo post location for server - full_post_dir="$blog_dir/content/posts/$post_filename" - - # url for browser - full_post_url="$local_url/posts/$postname" -} - -serve_and_open() { - killall hugo > /dev/null 2>&1 - hugo serve -s "$blog_dir" -D > /dev/null 2>&1 & - xdg-open "$full_post_url" -} - -edit_post() { - serve_and_open - $EDITOR "$full_post_dir" && kill %1 -} - -new_post() { - hugo new -s "$blog_dir" "posts/$post_filename" - edit_post -} - -deploy_blog() { - if [ -z "$blog_remote_host" ]; then echo "Please set blog_remote_host variable"; exit 1; fi - if [ -z "$blog_remote_user" ]; then echo "Please set blog_remote_user variable"; exit 1; fi - if [ -z "$blog_remote_dir" ]; then echo "Please set blog_remote_dir variable (relative to \$HOME)"; exit 1; fi - - green="$(tput setaf 2)" - reset="$(tput sgr0)" - - printf "${green}%s\n${reset}" "Deploying..." - - ssh "$blog_remote_user@$blog_remote_host" "(cd \$HOME/$blog_remote_dir && git pull && hugo)" -} - -print_help() { - printf "%s\n" "Usage: " - printf "%s\n\n" "$scriptname [args]" - - printf "%s\n" "Options: " - printf "\t%s:\n\t\t%s\n\n" "new-post (aliases: newpost,np,new,n) [post-name]" "create a new post, open editor and live server" - printf "\t%s:\n\t\t%s\n\n" "edit-post (alises: edit,ep,e) [post-name]" "edit a post in the content directory" - printf "\t%s:\n\t\t%s\n\n" "list-post (aliases: list,li,lp,ls,l)" "list all posts in content directory" - printf "\t%s:\n\t\t%s\n\n" "list-drafts (alises: listdraft,ld)" "list all posts in content directory" - printf "\t%s:\n\t\t%s\n\n" "server (alises: serve,s)" "serve blog from your blog directory" - printf "\t%s:\n\t\t%s\n\n" "kill (alises: killlall,ka,k)" "kill all hugo processes" - printf "\t%s:\n\t\t%s\n\n" "deploy (aliases: dep,d)" "deploy to a remote server" - printf "\n" -} - -if [[ "$#" -lt 1 ]]; then - print_help - exit 1 -fi - -while (($#)); do - case "$1" in - new-post|newpost|np|new|n) - shift - set_vars "$1" - new_post "$1" - break - ;; - edit-post|edit|ep|e) - shift - set_vars "$1" - edit_post "$1" - break - ;; - list-post|list|li|lp|l|ls) - # hugo list all | cut -d, -f1 | tail -n +2 - hugo list -s "$blog_dir" all | cut -f1,4 -d, | tail -n +2 | tr ',' ' ' | column -t - break - ;; - list-drafts|listdraft|ld) - hugo list drafts -s "$blog_dir" - break - ;; - server|serve|s) - serve_and_open - break - ;; - kill|killall|ka|k) - killall "hugo" - break - ;; - deploy|dep|d) - deploy_blog - break - ;; - help|-h|--help) - print_help - break - ;; - *) - print_help - break - ;; - esac -done diff --git a/stow/tmux/.tmux.conf b/stow/tmux/.tmux.conf deleted file mode 100644 index 1cc3e6d..0000000 --- a/stow/tmux/.tmux.conf +++ /dev/null @@ -1,53 +0,0 @@ -# change default prefix -unbind C-b -set-option -g prefix C-a -bind-key C-a send-prefix - -# emulate a color terminal emulator -set -g default-terminal "xterm-256color" - -# unset the annoying delay -set -sg escape-time 0 - -# mouse settings -# set -g mouse on -# set -g set-clipboard on -# set -g focus-events on - -# appearance -set -g status-style "bg=black fg=white,bold" -set -g window-status-current-style "fg=yellow,bold" - -# set -g status-bg black -# set -g status-fg white - -#==============# -# Key Bindings # -#==============# - -bind -n M-j select-pane -D -bind -n M-k select-pane -U -bind -n M-h select-pane -L -bind -n M-l select-pane -R -bind -n M-Down select-pane -D -bind -n M-Up select-pane -U -bind -n M-Left select-pane -L -bind -n M-Right select-pane -R - -# Resize panes - less pain -bind-key C-J resize-pane -D 5 -bind-key C-K resize-pane -U 5 -bind-key C-H resize-pane -L 5 -bind-key C-L resize-pane -R 5 - -# Move windows easier -bind-key -r < swap-window -t -1 -bind-key -r > swap-window -t +1 - -# New panes start in cwd -bind-key '"' split-window -v -c '#{pane_current_path}' -bind-key % split-window -h -c '#{pane_current_path}' -bind c new-window -c '#{pane_current_path}' - -# Source conf -bind-key r source-file ~/.tmux.conf \; display-message "Sourced ~/.tmux.conf!" diff --git a/stow/vim/.vim/.gitignore b/stow/vim/.vim/.gitignore deleted file mode 100644 index cc205f3..0000000 --- a/stow/vim/.vim/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -autoload -plugged -.backup -.swap -.undo -.netrwhist diff --git a/stow/vim/.vim/vimrc b/vimrc similarity index 100% rename from stow/vim/.vim/vimrc rename to vimrc diff --git a/stow/vim/.vim/vimrc.min b/vimrc.min similarity index 100% rename from stow/vim/.vim/vimrc.min rename to vimrc.min