From 0d9a54719a50aa02db93ab7249e70d4135f604d3 Mon Sep 17 00:00:00 2001 From: "Andrew R. M" Date: Sat, 1 Oct 2016 08:23:58 -0400 Subject: [PATCH] Initial commit --- .gitmodules | 42 ++++++++++ aliases | 56 +++++++++++++ bash_profile | 52 ++++++++++++ bashrc | 29 +++++++ functions | 17 ++++ inputrc | 76 ++++++++++++++++++ profile | 42 ++++++++++ pythonrc | 8 ++ vim/bundle/commentary | 1 + vim/bundle/dialect | 1 + vim/bundle/endwise | 1 + vim/bundle/eunuch | 1 + vim/bundle/filetype-nix | 1 + vim/bundle/fugitive | 1 + vim/bundle/pathogen | 1 + vim/bundle/pencil | 1 + vim/bundle/sleuth | 1 + vim/bundle/snipmate | 1 + vim/bundle/snipmate-addon-mw-utils | 1 + vim/bundle/snipmate-tlib | 1 + vim/bundle/tagbar | 1 + vim/bundle/vinegar | 1 + vimrc | 124 +++++++++++++++++++++++++++++ 23 files changed, 460 insertions(+) create mode 100644 .gitmodules create mode 100644 aliases create mode 100644 bash_profile create mode 100644 bashrc create mode 100644 functions create mode 100644 inputrc create mode 100644 profile create mode 100644 pythonrc create mode 160000 vim/bundle/commentary create mode 160000 vim/bundle/dialect create mode 160000 vim/bundle/endwise create mode 160000 vim/bundle/eunuch create mode 160000 vim/bundle/filetype-nix create mode 160000 vim/bundle/fugitive create mode 160000 vim/bundle/pathogen create mode 160000 vim/bundle/pencil create mode 160000 vim/bundle/sleuth create mode 160000 vim/bundle/snipmate create mode 160000 vim/bundle/snipmate-addon-mw-utils create mode 160000 vim/bundle/snipmate-tlib create mode 160000 vim/bundle/tagbar create mode 160000 vim/bundle/vinegar create mode 100644 vimrc diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..d7877dc --- /dev/null +++ b/.gitmodules @@ -0,0 +1,42 @@ +[submodule "vim/bundle/pathogen"] + path = vim/bundle/pathogen + url = git@github.com:tpope/vim-pathogen.git +[submodule "vim/bundle/fugitive"] + path = vim/bundle/fugitive + url = git@github.com:tpope/vim-fugitive.git +[submodule "vim/bundle/commentary"] + path = vim/bundle/commentary + url = git@github.com:tpope/vim-commentary.git +[submodule "vim/bundle/eunuch"] + path = vim/bundle/eunuch + url = git@github.com:tpope/vim-eunuch.git +[submodule "vim/bundle/vinegar"] + path = vim/bundle/vinegar + url = git@github.com:tpope/vim-vinegar.git +[submodule "vim/bundle/sleuth"] + path = vim/bundle/sleuth + url = git@github.com:tpope/vim-sleuth.git +[submodule "vim/bundle/endwise"] + path = vim/bundle/endwise + url = git@github.com:tpope/vim-endwise.git +[submodule "vim/bundle/tagbar"] + path = vim/bundle/tagbar + url = git@github.com:majutsushi/tagbar.git +[submodule "vim/bundle/pencil"] + path = vim/bundle/pencil + url = git@github.com:reedes/vim-pencil.git +[submodule "vim/bundle/dialect"] + path = vim/bundle/dialect + url = git@github.com:dbmrq/vim-dialect.git +[submodule "vim/bundle/snipmate"] + path = vim/bundle/snipmate + url = git@github.com:garbas/vim-snipmate.git +[submodule "vim/bundle/snipmate-tlib"] + path = vim/bundle/snipmate-tlib + url = git@github.com:tomtom/tlib_vim.git +[submodule "vim/bundle/snipmate-addon-mw-utils"] + path = vim/bundle/snipmate-addon-mw-utils + url = git@github.com:MarcWeber/vim-addon-mw-utils.git +[submodule "vim/bundle/filetype-nix"] + path = vim/bundle/filetype-nix + url = git@github.com:LnL7/vim-nix.git diff --git a/aliases b/aliases new file mode 100644 index 0000000..8967c3f --- /dev/null +++ b/aliases @@ -0,0 +1,56 @@ +#{- ~/.aliases -}# + +#{- FILE OPERATIONS -}# + +# Allow alias expansion for commands executed with sudo +alias sudo="sudo " + +#{- GNU coreutils -}# + +# Sort directories first and colorize output +alias ls="ls -h --color=auto --group-directories-first" +alias la="ls -A" +alias ll="ls -l" + +# Ask before overwriting files +alias mv="mv -i" +alias cp="cp -i" +alias rm="rm -i --preserve-root --one-file-system" + +# Create and remove empty subdirectories +alias mkdir="mkdir -p" +alias rmdir="rmdir -p" + +# Don't recursively modify permissions on root directory +alias chmod="chmod --preserve-root" +alias chown="chown --preserve-root" +alias chgrp="chgrp --preserve-root" + +# Colorize output +alias grep="grep --color" +alias egrep="grep -E --color" +alias fgrep='grep -F --color' + +# Human readable file system inspection +alias df="df -h" + +# Human readable file size inspection +alias du="du -sh" + + +#{- NETWORKING -}# + +# Don't ping infinitely +alias ping="ping -c 4" + +# Show progress while syncing +alias rsync="rsync --progress" + + +#{- SHELL INTROSPECTION -}# + +# Print the value of the $PATH variable in a human readable format +alias path='printf "${PATH//:/\\n}\n"' + +# Print current aliases in a human readable format +alias aliases='alias | sed -e "s/=/ -> /" -e "s/alias //"' diff --git a/bash_profile b/bash_profile new file mode 100644 index 0000000..22f9020 --- /dev/null +++ b/bash_profile @@ -0,0 +1,52 @@ +#{- ~/.bash_profile -}# + +#{- PROMPT -}# + +# Debugging prompt: (? ) in blue +export PS4='\[\033[1;34\]m?\[\033[0m\] ' +# Selection prompt: (select: ) +export PS3='select: ' + +#{- ENVIRONMENT VARIABLES -}# + +# History preferences +export HISTSIZE=-1 +export HISTFILESIZE=-1 +export HISTFILE="$HOME/.history/bash" +export HISTCONTROL="erasedups:ignoreboth" + +#{- SHELL OPTIONS -}# + +# Append history to $HISTFILE when bash exits, instead of overwriting it +shopt -s histappend + +# Attempt to preserve multi-line commands in history with embedded newlines +shopt -s cmdhist lithist + + +# When doing history substitution load the results into the buffer +shopt -s histverify + +# When doing history substitution load a failed expression into the buffer +shopt -s histreedit + + +# Do a path search if a hashed command no longer exists +shopt -s checkhash + + +# Enable extended pattern matching for interactive use +shopt -s extglob + +#{- SOURCING -}# + + +# Source ~/.profile if it exists and is readable +if [ -f "$HOME/.profile" ] && [ -r "$HOME/.profile" ]; then + . "$HOME/.profile" +fi + +# Source ~/.bashrc if it exists and is readable +if [ -f "$HOME/.bashrc" ] && [ -r "$HOME/.bashrc" ]; then + . "$HOME/.bashrc" +fi diff --git a/bashrc b/bashrc new file mode 100644 index 0000000..dda8d22 --- /dev/null +++ b/bashrc @@ -0,0 +1,29 @@ +#{- ~/.bashrc -}# + +#{- SOURCING -}# + +# Source aliases +if [ -f "$HOME/.aliases" ] && [ -r "$HOME/.aliases" ]; then + . "$HOME/.aliases" +fi + +# Source private aliases +if [ -f "$HOME/.private_aliases" ] && [ -r "$HOME/.private_aliases" ]; then + . "$HOME/.private_aliases" +fi + +# Source functions +if [ -f "$HOME/.functions" ] && [ -r "$HOME/.functions" ]; then + . "$HOME/.functions" +fi + +# Source private functions +if [ -f "$HOME/.private_functions" ] && [ -r "$HOME/.private_functions" ]; then + . "$HOME/.private_functions" +fi + +# Source completion +if [ -f "$HOME/.nix-profile/etc/profile.d/bash_completion.sh" ] && \ + [ -r "$HOME/.nix-profile/etc/profile.d/bash_completion.sh" ]; then + . "$HOME/.nix-profile/etc/profile.d/bash_completion.sh" +fi diff --git a/functions b/functions new file mode 100644 index 0000000..d05a8fa --- /dev/null +++ b/functions @@ -0,0 +1,17 @@ +#{- ~/.functions -}# + +# Enables or disables kwm hotkeys +hotkeys() +{ + case "$1" in + "on") kwmc config hotkeys on; echo "Hotkeys enabled." ;; + "off") kwmc config hotkeys off; echo "Hotkeys disabled." ;; + *) printf "hotkeys: usage: hotkeys {on|off}\n" ;; + esac +} + +# Passes basic arithmetic to bc +maths() +{ + bc -l <<< "scale=2; $*" +} diff --git a/inputrc b/inputrc new file mode 100644 index 0000000..348c934 --- /dev/null +++ b/inputrc @@ -0,0 +1,76 @@ +#{- ~/.inputrc -}# + +#{- EDITING MODE -}# + +# Use vi mode +set editing-mode vi + +#{- PROMPT -}# + +set show-mode-in-prompt on +# Emacs mode prompt: (@) in red +set emacs-mode-string "\1\033[1;31m\2@\1\033[0m\2" +# Vim insert mode prompt: (+) in red +set vi-ins-mode-string "\1\033[1;31m\2+\1\033[0m\2" +# Vim command mode prompt: (:) in red +set vi-cmd-mode-string "\1\033[1;31m\2:\1\033[0m\2" + +#{- CONTROL CHARACTERS -}# + +# Ignore bell characters +set bell-style none + +# Don't echo control characters +set echo-control-characters off + +#{- COMPLETION -}# + +# Mark file types with colors and symbols +set visible-stats on +set colored-stats on + +# Mark directories in completion +set mark-directories on + +# Use colors to highlight common prefix when displaying matches +set colored-completion-prefix on + + +# Matching is case insensitive +set completion-ignore-case on + +# When matching, - and _ are equivalent +set completion-map-case on + +# Don't match hidden files +set match-hidden-files off + + +# Display matches with a single tab +set show-all-if-ambiguous on +set show-all-if-unmodified on + +# Allow completion in the middle of a word +set skip-completed-text on + +# Don't use a pager to display matches +set page-completions off + +#{- BINDINGS -}# + +# Enable emacs bindings that don't conflict with vi defaults +set keymap vi-insert + Control-a: beginning-of-line + Control-b: backward-char + # Control-d: delete-char + Control-e: end-of-line + Control-f: forward-char + Control-g: abort + Control-k: kill-line + Control-l: clear-screen + # Control-n: next-history + Control-o: operate-and-get-next + # Control-p: previous-history + Control-q: quoted-insert + Control-@: set-mark + Control-_: undo diff --git a/profile b/profile new file mode 100644 index 0000000..074005e --- /dev/null +++ b/profile @@ -0,0 +1,42 @@ +#{- ~/.profile -}# + +#{- PROMPT -}# + +# Primary prompt: ($/# ) in magenta +export PS1='\[\033[1;35m\]\$\[\033[0m\] ' +# Secondary prompt: (> ) in red +export PS2='\[\033[1;31\]m>\[\033[0m\] ' + +#{- PATH -}# + +# Prepend ~/.local/bin to the path and append the current directory to the path +export PATH="$HOME/.local/bin:$PATH:." + +#{- ENVIRONMENT VARIABLES -}# + +# Export language and sorting preferences. +export LANG="en_US.UTF-8" +export LC_COLLATE="C" + +# Export editor preferences. +export EDITOR="vim" +export VISUAL="vim" + +# Export pager preferences. +export PAGER="less" +export LESSHISTFILE="-" + +# Export python preferences. +export PYTHONSTARTUP="$HOME/.pythonrc" + +# History preferences +export HISTFILE="$HOME/.history/posh" +export HISTSIZE=10000 + +#{- SOURCING -}# + +# Source nix profile configuration +if [ -f "$HOME/.nix-profile/etc/profile.d/nix.sh" ] \ +&& [ -r "$HOME/.nix-profile/etc/profile.d/nix.sh" ]; then + . "$HOME/.nix-profile/etc/profile.d/nix.sh" +fi diff --git a/pythonrc b/pythonrc new file mode 100644 index 0000000..7a54a82 --- /dev/null +++ b/pythonrc @@ -0,0 +1,8 @@ +#!/usr/bin/env python + +import sys + +# Primary prompt: (>>> ) in magenta +sys.ps1 = '\033[1;35m>>>\033[0m ' +# Secondary prompt: (... ) in red +sys.ps2 = '\033[1;31m...\033[0m ' diff --git a/vim/bundle/commentary b/vim/bundle/commentary new file mode 160000 index 0000000..73e0d9a --- /dev/null +++ b/vim/bundle/commentary @@ -0,0 +1 @@ +Subproject commit 73e0d9a9d1f51b6cc9dc965f62669194ae851cb1 diff --git a/vim/bundle/dialect b/vim/bundle/dialect new file mode 160000 index 0000000..1ab38b8 --- /dev/null +++ b/vim/bundle/dialect @@ -0,0 +1 @@ +Subproject commit 1ab38b8838b60b7efd0cf705ae06b2527f930d23 diff --git a/vim/bundle/endwise b/vim/bundle/endwise new file mode 160000 index 0000000..0067ced --- /dev/null +++ b/vim/bundle/endwise @@ -0,0 +1 @@ +Subproject commit 0067ceda37725d01b7bd5bf249d63b1b5d4e2ab4 diff --git a/vim/bundle/eunuch b/vim/bundle/eunuch new file mode 160000 index 0000000..7eeb681 --- /dev/null +++ b/vim/bundle/eunuch @@ -0,0 +1 @@ +Subproject commit 7eeb681ff3caedc1c01e50966bc293951f7b3e21 diff --git a/vim/bundle/filetype-nix b/vim/bundle/filetype-nix new file mode 160000 index 0000000..a61495a --- /dev/null +++ b/vim/bundle/filetype-nix @@ -0,0 +1 @@ +Subproject commit a61495a762feacc00f24cab4392b09cc3250decf diff --git a/vim/bundle/fugitive b/vim/bundle/fugitive new file mode 160000 index 0000000..aac85a2 --- /dev/null +++ b/vim/bundle/fugitive @@ -0,0 +1 @@ +Subproject commit aac85a268e89a6c8be79341e130ac90256fadbd6 diff --git a/vim/bundle/pathogen b/vim/bundle/pathogen new file mode 160000 index 0000000..8c91196 --- /dev/null +++ b/vim/bundle/pathogen @@ -0,0 +1 @@ +Subproject commit 8c91196cfd9c8fe619f35fac6f2ac81be10677f8 diff --git a/vim/bundle/pencil b/vim/bundle/pencil new file mode 160000 index 0000000..3e8b6f3 --- /dev/null +++ b/vim/bundle/pencil @@ -0,0 +1 @@ +Subproject commit 3e8b6f34170d83eb5074608ef07b215477026852 diff --git a/vim/bundle/sleuth b/vim/bundle/sleuth new file mode 160000 index 0000000..a174627 --- /dev/null +++ b/vim/bundle/sleuth @@ -0,0 +1 @@ +Subproject commit a17462708aa40a7fc0afd4effa559087d8a2c908 diff --git a/vim/bundle/snipmate b/vim/bundle/snipmate new file mode 160000 index 0000000..3198619 --- /dev/null +++ b/vim/bundle/snipmate @@ -0,0 +1 @@ +Subproject commit 31986191ac9923afcd53bf6425c9b6c35fdbb214 diff --git a/vim/bundle/snipmate-addon-mw-utils b/vim/bundle/snipmate-addon-mw-utils new file mode 160000 index 0000000..0c5612f --- /dev/null +++ b/vim/bundle/snipmate-addon-mw-utils @@ -0,0 +1 @@ +Subproject commit 0c5612fa31ee434ba055e21c76f456244b3b5109 diff --git a/vim/bundle/snipmate-tlib b/vim/bundle/snipmate-tlib new file mode 160000 index 0000000..8c74564 --- /dev/null +++ b/vim/bundle/snipmate-tlib @@ -0,0 +1 @@ +Subproject commit 8c74564396e368788a5cb901b0e8017a3166cee9 diff --git a/vim/bundle/tagbar b/vim/bundle/tagbar new file mode 160000 index 0000000..2955f71 --- /dev/null +++ b/vim/bundle/tagbar @@ -0,0 +1 @@ +Subproject commit 2955f71856536d503c79c15daab3de890a6d83e9 diff --git a/vim/bundle/vinegar b/vim/bundle/vinegar new file mode 160000 index 0000000..bd7f7b7 --- /dev/null +++ b/vim/bundle/vinegar @@ -0,0 +1 @@ +Subproject commit bd7f7b7929260072864462c04dde3b9f4c5e0d23 diff --git a/vimrc b/vimrc new file mode 100644 index 0000000..9dea511 --- /dev/null +++ b/vimrc @@ -0,0 +1,124 @@ +"{- ~/.vimrc -}" + +" Use vim defaults " +set nocompatible + +"{- PLUGINS -}" + + " Load pathogen, the plugin manager, and all of the plugins " + runtime bundle/pathogen/autoload/pathogen.vim + execute pathogen#infect() + + " Load the pencil plugin for markdown files " + augroup pencil + autocmd! + autocmd FileType markdown,mkd call pencil#init() + augroup END + +"{- COMMANDS -}" + + " Removes blank lines " + command RemoveBlankLines :g/^\s*$/d + + " Removes trailing whitespace " + command RemoveTrailingWhitespace :%s/\s\+$// + + " Toggles spellchecking " + command Spelling :setlocal spell! spell? + + " Toggles invisible characters " + command ShowInvisible :setlocal list! + + " Toggles cursor crosshair " + command Crosshair :setlocal cursorline! cursorcolumn! ruler + + +"{- INTERFACE -}" + + " Colors and syntax highlighting " + colorscheme peachpuff + filetype plugin on + syntax on + + " Use two spaces instead of tabs " + set softtabstop=2 + set shiftwidth=2 + set tabstop=2 + + " Don't redraw the screen unless necessary " + set lazyredraw + + " Don't wrap lines " + set nowrap + + " Don't show line numbers " + set numberwidth=1 + set nonumber + + " Show the ruler " + set ruler + + " Enable Mouse Support " + set mouse=a + + " Display partially completed commands " + set showcmd + + " Display the current mode in the status bar " + set showmode + + " Scroll the screen vertically at 8 rows " + set scrolloff=8 + + " Scroll the screen horizontally at 1 column " + set sidescrolloff=0 + set sidescroll=1 + + " Make backspace acts as you would expect " + set backspace=indent,eol,start + + +"{- FUNCTIONALITY -}" + + " Don't use swap files or backups " + set nowritebackup + set noswapfile + set nobackup + + " Highlight search results " + set hlsearch + + " Searching and completion are case insenstive " + set ignorecase + set smartcase + set infercase + + " Automatically indent things and be smart about it :^) " + set smartindent + set autoindent + + " Advanced command-line completion " + set wildmenu + set wildignore=*.o,*.obj,*~ + set wildignore+=*.png,*.jpg,*.gif + + " Use UTF-8 " + set encoding=utf-8 + + " Lines should be no longer than eighty characters " + set linebreak + set tw=80 + + " History should hold a thousand entires " + set history=1000 + + " Spellchecking uses American Enlish and ignores any asian characters " + set spelllang=en_us,cjk + + " Store the viminfo file in the .vim directory " + set viminfo+=n$HOME/.vim/.viminfo + + " Use the system clipboard when deleting, pasting, or yanking " + if has("clipboard") + set clipboard=unnamed + endif