Compare commits

...

14 commits

7 changed files with 323 additions and 2527 deletions

1
.gitignore vendored
View file

@ -1,4 +1,5 @@
.AppleDouble
.netrwhist
vim/.vim/plugged
vim/.vim/autoload
zsh/.zsh/cache

288
bash/#.bashrc# Normal file
View file

@ -0,0 +1,288 @@
### Andrew's .bashrc
# _ _
# ___ _ ____ _(_)_ __ ___ _ __ _ __ ___ ___ _ __ | |_
# / _ \ '_ \ \ / / | '__/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __|
# | __/ | | \ V /| | | | (_) | | | | | | | | | __/ | | | |_
# \___|_| |_|\_/ |_|_| \___/|_| |_|_| |_| |_|\___|_| |_|\__|
# Set some defaults.
export EDITOR="emacsclient -t"
export VISUAL="emacsclient -c -a emacs"
export ALTERNATE_EDITOR=""
export PATH=".:~/bin:~/.local/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin"
export LSCOLORS="ExGxBxDxCxEgEdxbxgxcxd"
if [[-d
# checks (stolen from zshuery)
if [[ $(uname) = 'Linux' ]]; then
IS_LINUX=1
fi
if [[ $(uname) = 'Darwin' ]]; then
IS_MAC=1
fi
if [[ -x `which brew >/dev/null 2>&1` ]]; then
HAS_BREW=1
fi
if [[ -x `which apt-get >/dev/null 2>&1` ]]; then
sdfHAS_APT=1
fi
# _
# _ __ _ __ ___ _ __ ___ _ __ | |_
# | '_ \| '__/ _ \| '_ ` _ \| '_ \| __|
# | |_) | | | (_) | | | | | | |_) | |_
# | .__/|_| \___/|_| |_| |_| .__/ \__|
# |_| |_|
# define useful aliases for color codes
sh_norm="\[\033[0m\]"
sh_black="\[\033[0;30m\]"
sh_dark_gray="\[\033[1;30m\]"
sh_blue="\[\033[0;34m\]"
sh_light_blue="\[\033[1;34m\]"
sh_green="\[\033[0;32m\]"
sh_light_green="\[\033[1;32m\]"
sh_cyan="\[\033[0;36m\]"
sh_light_cyan="\[\033[1;36m\]"
sh_red="\[\033[0;31m\]"
sh_light_red="\[\033[1;31m\]"
sh_purple="\[\033[0;35m\]"
sh_light_purple="\[\033[1;35m\]"
sh_brown="\[\033[0;33m\]"
sh_yellow="\[\033[1;33m\]"
sh_light_gray="\[\033[0;37m\]"
sh_white="\[\033[1;37m\]"
function git_prompt {
PCHANGED=""
PAHEAD=""
PBEHIND=""
local FULL_BRANCH="$(git symbolic-ref -q HEAD 2>/dev/null || git name-rev --name-only --no-undefined --always HEAD 2>/dev/null)"
PBRANCH="$(echo $FULL_BRANCH | sed 's/refs\/heads\///')"
if [ -n $PBRANCH ]; then
echo -n "${PBRANCH} "
# Are there unstaged changes in the working directory
local CHANGED=$(git status --porcelain --ignore-submodule -unormal 2>/dev/null | wc -l)
if [ $CHANGED -gt 0 ]; then
PCHANGED="◊"
fi
# Are we behind the origin?
local NUM_BEHIND="$(git log --oneline ..@{u} 2>/dev/null | wc -l | tr -d ' ' )"
if [ "$NUM_BEHIND" -gt 0 ]; then
PBEHIND="↓"
fi
# Are we ahead of the origin?
local NUM_AHEAD="$(git log --oneline @{u}.. 2>/dev/null | wc -l | tr -d ' ')"
if [ "$NUM_AHEAD" -gt 0 ]; then
PAHEAD="↑"
fi
if [[ -n $PCHANGED || -n $PAHEAD || -n $PBEHIND ]]; then
echo -n "${PCHANGED}${PBEHIND}${PAHEAD}"
fi
fi
}
# Make a pretty prompt.
export PROMPT_COMMAND='history -a; if [ $? -ne 0 ];then ERROR_FLAG=1;else ERROR_FLAG=;fi;'
export PS1=${HOSTCOLOUR}${sh_light_gray}'\h'${sh_green}':\w'${sh_light_gray}' $(git_prompt)'${sh_light_gray}'${ERROR_FLAG:+'${sh_light_red}'}\$ '${sh_norm}
# New files and folders should not be world readable
umask 0027
# Borrow features from sensible.bash
# Trim long paths in prompt
PROMPT_DIRTRIM=2
# Update window size after every command
shopt -s checkwinsize
# _ _ _
# | |__ (_)___| |_ ___ _ __ _ _
# | '_ \| / __| __/ _ \| '__| | | |
# | | | | \__ \ || (_) | | | |_| |
# |_| |_|_|___/\__\___/|_| \__, |
# |___/
# Append history don't overwrite
shopt -s histappend
# Save multi-line commands as one line
shopt -s cmdhist
# Avoid duplicate entries
export HISTCONTROL="erasedups:ignoreboth"
# Use ISO8601 time format for history file.
export HISTTIMEFORMAT='%F %T '
# Big history file
HISTSIZE=500000
HISTFILESIZE=100000
# _ _
# __ _| (_) __ _ ___ ___ ___
# / _` | | |/ _` / __|/ _ \/ __|
# | (_| | | | (_| \__ \ __/\__ \
# \__,_|_|_|\__,_|___/\___||___/
# jump down the tree.
alias ..="cd .."
# empty the screen (or use C-l)
alias c="clear"
# why wouldn't you want human readable sizes?
alias df="df -h"
# get outta here!
alias e="exit"
# grep shortie
alias g="grep --color=auto -i "
# shorter ls
alias l="ls -G --color"
# list files with details
alias ll="ls -lh --color"
# list all files.
alias la="ls -alh --color"
# List directories.
alias ld="ls --color -Gd */"
# add some color to grep.
alias grep="grep --color=auto"
# make the whole directory tree if required and let us know about it.
alias mkdir="mkdir -p -v "
# don't ping forever.
#alias ping="ping -c5"
# refresh the shell customizations without opening a new one.
alias refresh="source ~/.bashrc && hash -r"
# A python calculator
alias pc='python -ic "from __future__ import division; from math import *"'
# Start nano with line numbering no wrapping and autoindenting
alias nano='nano -ciw '
# shortcut for tmux command
alias tm="tmux new-session -A -s main"
# emacsclient
alias ec="emacsclient -n -c -a emacs"
# __ _ _
# / _|_ _ _ __ ___| |_(_) ___ _ __ ___
# | |_| | | | '_ \ / __| __| |/ _ \| '_ \/ __|
# | _| |_| | | | | (__| |_| | (_) | | | \__ \
# |_| \__,_|_| |_|\___|\__|_|\___/|_| |_|___/
# General purpose extract command.
extract () {
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.tar.xz) tar xJf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) rar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xf $1 ;;
*.tbz2) tar xjf $1 ;;
*.tgz) tar xzf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1 ;;
*.7z) 7za e $1 ;;
*.xz) xz -dv $1 ;;
*) echo "'$1' cannot be extracted via extract()" ;;
esac
else
echo "'$1' is not a valid file"
fi
}
# General purpose backup command.
bu () { tar czf ~/.backup/`basename $1`-`date +%Y%m%d%H%M`.tgz $1; }
# create an archive of a list of files, compress the archive, and encrypt the compressed archive
function archive-and-encrypt {
echo -n "Enter desired output filename: "
read filename
tar cJ $1 | \
gpg -q -r andrew@amdavidson.com -s -e -o "$filename.tar.xz.gpg"
}
# run mosh and tmux to a specific host
function mt {
mosh $1 -- tmux new-session -A -s main
}
# _ _
# (_)_ __ ___ _ __ ___ _ __| |_ ___
# | | '_ ` _ \| '_ \ / _ \| '__| __/ __|
# | | | | | | | |_) | (_) | | | |_\__ \
# |_|_| |_| |_| .__/ \___/|_| \__|___/
# |_|
# import fzf if possible
# Debian
if [ -d /usr/share/doc/fzf/examples ]; then
source /usr/share/doc/fzf/examples/key-bindings.bash
if [ -f /usr/share/doc/fzf/examples/completion.bash ]; then
source /usr/share/doc/fzf/examples/completion.bash
fi
fi
# MacOS
if [ -d /opt/homebrew/opt/fzf/shell ]; then
source /opt/homebrew/opt/fzf/shell/key-bindings.bash
source /opt/homebrew/opt/fzf/shell/completion.bash
fi
# Import local extensions if needed.
if [ -f $HOME/.bashrc_local ]; then
source $HOME/.bashrc_local
fi

View file

@ -11,13 +11,19 @@
# Set some defaults.
export EDITOR="nvim"
export PATH=".:~/bin:~/.local/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin"
export VISUAL="nvim"
export ALTERNATE_EDITOR=""
export PATH=".:~/bin:~/.local/bin:/usr/games:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin"
export LSCOLORS="ExGxBxDxCxEgEdxbxgxcxd"
# XDG
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_DATA_HOME="$HOME/.local/share"
# include doom in path if it exists
if [ -d ~/.config/emacs/bin ]; then
export PATH="$HOME/.emacs.d/bin:$PATH"
fi
# checks (stolen from zshuery)
if [[ $(uname) = 'Linux' ]]; then
@ -199,14 +205,11 @@ alias nano='nano -ciw '
# shortcut for tmux command
alias tm="tmux new-session -A -s main"
# always use nvim
alias vim='nvim'
alias vi='nvim'
alias nv='nvim'
# emacsclient
alias ec="emacsclient -n -c -a emacs"
if [[ HAS_GNOME ]]; then
alias nosleep="gnome-session-inhibit --inhibit idle sleep infinity"
alias nosleep="gnome-session-inhibit --inhibit-only"
fi
# magic packets to wake up hosts

View file

@ -40,6 +40,7 @@
;; If you use `org' and don't want your org files in the default location below,
;; change `org-directory'. It must be set before org loads!
(setq org-directory "~/Nextcloud/org/")
(setq org-agenda-files '("~/Nextcloud/org/todo"))
;; Whenever you reconfigure a package, make sure to wrap your config in an

View file

@ -31,16 +31,16 @@
;;deft ; notational velocity for Emacs
doom ; what makes DOOM look the way it does
doom-dashboard ; a nifty splash screen for Emacs
;;doom-quit ; DOOM quit-message prompts when you quit Emacs
doom-quit ; DOOM quit-message prompts when you quit Emacs
;;(emoji +unicode) ; 🙂
hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW
;;hydra
;;indent-guides ; highlighted indent columns
;;ligatures ; ligatures and symbols to make your code pretty again
;;minimap ; show a map of the code on the side
minimap ; show a map of the code on the side
modeline ; snazzy, Atom-inspired modeline, plus API
;;nav-flash ; blink cursor line after big motions
;;neotree ; a project drawer, like NERDTree for vim
neotree ; a project drawer, like NERDTree for vim
ophints ; highlight the region an operation acts on
(popup +defaults) ; tame sudden yet inevitable temporary windows
;;tabs ; a tab bar for Emacs

File diff suppressed because it is too large Load diff

View file

@ -1,18 +1,20 @@
" ==================== Plugins ====================
call plug#begin()
" Airline
Plug 'bling/vim-airline'
" Git integration
Plug 'tpope/vim-fugitive'
Plug 'airblade/vim-gitgutter'
" Gruvbox theme
Plug 'morhetz/gruvbox'
" Nord Theme
Plug 'nordtheme/vim'
" Airline
Plug 'bling/vim-airline'
let g:airline_powerline_fonts = 1
" Commenter
Plug 'scrooloose/nerdcommenter'
" Plug 'scrooloose/nerdcommenter'
" Sayonara
Plug 'mhinz/vim-sayonara', { 'on': 'Sayonara' }
@ -20,8 +22,6 @@ Plug 'mhinz/vim-sayonara', { 'on': 'Sayonara' }
" Go support for Vim
"Plug 'fatih/vim-go', { 'do': ':GoInstallBinaries' }
" Python Stuff
" Plug 'davidhalter/jedi-vim'
if has('nvim')
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
else
@ -30,28 +30,35 @@ else
Plug 'roxma/vim-hug-neovim-rpc'
endif
let g:deoplete#enable_at_startup = 1
" Python source for deoplete
Plug 'zchee/deoplete-jedi', { 'for': 'python' }
" Vim source for deoplete
Plug 'Shougo/neco-vim', { 'for': 'vim' }
"{{ Python-related plugins
" Python-related plugins
" Python completion, goto definition etc.
Plug 'davidhalter/jedi-vim', { 'for': 'python' }
" Plug 'davidhalter/jedi-vim', { 'for': 'python' }
" Python syntax highlighting and more
Plug 'numirias/semshi', { 'do': ':UpdateRemotePlugins' }
" Plug 'numirias/semshi', { 'do': ':UpdateRemotePlugins' }
" Python auto formatting
Plug 'psf/black', { 'branch': 'stable' }
autocmd BufWritePre *.py execute ':Black'
" Plug 'psf/black', { 'branch': 'stable' }
" autocmd BufWritePre *.py execute ':Black'
" Smart Line Numbers
Plug 'myusuf3/numbers.vim'
Plug 'tpope/vim-commentary'
" Ale
Plug 'dense-analysis/ale'
" OpenSCAD Support
Plug 'salkin-mada/openscad.nvim'
call plug#end()
" ==================== Vim Settings ====================
@ -139,7 +146,7 @@ endif " has("autocmd")
"let g:dracula_colorterm = 0
"silent! colorscheme dracula
set background=dark
silent! colorscheme gruvbox
silent! colorscheme nord
" ==================== Code Folding ====================