Skip to content

Commit

Permalink
Sync local changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
damncabbage committed Mar 25, 2018
1 parent 2e4d9e3 commit 3a51972
Show file tree
Hide file tree
Showing 35 changed files with 2,705 additions and 103 deletions.
6 changes: 6 additions & 0 deletions .ackrc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@
--type-set=twig=.tpl
--type-set=haml=.haml
--type-set=rubytemplate=.erb,.haml
--type-set=js=.js,.jsx
--type-set=ps=.purs
--type-set=hbs=.hbs

# Ignores
--ignore-dir=vendor/bundler
--ignore-file=match:tags

--noignore-dir=node_modules
--type-set=npm:is:package.json
10 changes: 10 additions & 0 deletions .bash_aliases
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ if [ $IS_LINUX ]; then
alias ack="ack-grep"
fi

# Networking.
if [ $IS_MAC ]; then
alias netconns="lsof -i | grep -E '(LISTEN|ESTABLISHED)'"
else
alias netconns="netstat -tapn"
fi

# Today's journal log (with yesterday's log in a split pane)
alias log='mkdir -p ~/logs && vim -O ~/logs/`date +%F`.txt ~/logs/`date -v-1d +%F`.txt'

Expand All @@ -54,3 +61,6 @@ function git-mt() {

### Esoteric ###
alias trek="play -n -c1 synth whitenoise lowpass -1 120 lowpass -1 120 lowpass -1 120 gain +14" # Infinite starship engine noise. :D
alias weather="curl http://wttr.in/Sydney"
alias minprompt='export PS1="\w$(__git_ps1)\$ "'
alias vis="cd ~/build/tdsr; ./tdsr"
36 changes: 25 additions & 11 deletions .bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ PATH="node_modules/.bin:$PATH"
# Python
PATH="env/bin:$PATH"

# Stack (Haskell)
PATH="$HOME/.local/bin:$PATH"

# Set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
Expand All @@ -28,23 +31,26 @@ if [ -d "$HOME/build/bin" ] ; then
fi

# Haskell
if [ -d "/Applications/ghc-7.8.2.app" ]; then
PATH="/Applications/ghc-7.8.2.app/Contents/bin:$PATH" # OS X install
fi
if [ -d "$HOME/build/ghc-7.8.3/bin" ]; then
PATH="$HOME/build/ghc-7.8.3/bin:$PATH" # OS X install
fi
if [ -d "$HOME/.cabal" ]; then
PATH=".cabal-sandbox/bin:$HOME/.cabal/bin:$PATH"
fi
if [ -d "$HOME/.haskell-vim-now/bin" ]; then
PATH="$HOME/.haskell-vim-now/bin:$PATH"
if [ -d "$HOME/.mafia/bin/hdevtools/bin" ]; then
PATH="$HOME/.mafia/bin/hdevtools/bin:$PATH"
fi
#if [ -d "$HOME/.haskell-vim-now/bin" ]; then
# PATH="$HOME/.haskell-vim-now/bin:$PATH"
#fi

if [ -d "/opt/blender" ]; then
PATH="$PATH:/opt/blender"
fi

if [ -d "$HOME/.nvm" ]; then
export NVM_DIR="$HOME/.nvm"
. "/usr/local/opt/nvm/nvm.sh"
#nvm use 8 2>/dev/null >/dev/null
fi

# Check what we're running on.
[[ `uname -a | grep -ic 'linux'` -gt 0 ]] && export IS_LINUX=1
[[ `uname -a | grep -ic 'darwin'` -gt 0 ]] && export IS_MAC=1
Expand All @@ -61,8 +67,8 @@ HISTFILESIZE=2000


# Misc preferences
export EDITOR=/usr/bin/vim
export TERM=xterm-256color
export EDITOR=$(which vim)
#export TERM=xterm-256color
export GREP_OPTIONS="--color=auto"
if [ $IS_MAC ]; then
export CLICOLOR=1
Expand All @@ -87,8 +93,13 @@ fi


# Git Prompt
#export GIT_PS1_SHOWCOLORHINTS='y'
#export GIT_PS1_SHOWUPSTREAM='auto'
#export GIT_PS1_DESCRIBE_STYLE='contains'
#export color_prompt="yes"
. ~/.git-completion.bash
export PS1='\u@\h:\w$(__git_ps1 " (%s)")\$ '
#export PS1='\u@\h:\w$(__git_ps1 " (%s)")\$ '
export PS1='\u:\w$(__git_ps1 " (%s)")\$ '
export PROMPT_COMMAND='echo -ne "\033]0;${PWD/#$HOME/~}\007"'

# rbenv
Expand Down Expand Up @@ -118,3 +129,6 @@ if [ -d "$HOME/.bashrc.d" ]; then
source "${FILE}"
done
fi

# GHC 8.2.2
export PATH="$HOME/.stack/programs/x86_64-osx/ghc-8.2.2/bin:${PATH}"
5 changes: 4 additions & 1 deletion .bundle/config
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
---
BUNDLE_PATH: vendor/bundler
BUNDLE_PATH: "vendor/bundler"
BUNDLE_GEM__TEST: "rspec"
BUNDLE_GEM__MIT: "true"
BUNDLE_GEM__COC: "true"
4 changes: 4 additions & 0 deletions .config/nvim/.netrwhist
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
let g:netrw_dirhistmax =10
let g:netrw_dirhist_cnt =2
let g:netrw_dirhist_1='/Users/rhoward/.config'
let g:netrw_dirhist_2='/Users/rhoward/.local'
243 changes: 243 additions & 0 deletions .config/nvim/init.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,243 @@

" ------- Plugins (vim-plug) -------
call plug#begin('~/.local/share/nvim/plugged')

Plug 'kassio/neoterm'
Plug 'neomake/neomake'
"Plug 'w0rp/ale'

Plug 'scrooloose/nerdtree'
Plug 'simnalamburt/vim-mundo' " Gundo fork.

Plug 'ervandew/supertab' " Tab-completion; stand-in until I get YouCompleteMe.

" Highlighting
Plug 'lambdatoast/elm.vim'
Plug 'mustache/vim-mustache-handlebars' " Handlebars / BMX
Plug 'raichoo/purescript-vim'

Plug 'bitc/vim-hdevtools' " Haskell type inspection

"Plug 'flowtype/vim-flow', { 'for': 'javascript' }

" Colorschemes
Plug 'rakr/vim-two-firewatch'
Plug 'jnurmine/Zenburn'
Plug 'chriskempson/base16-vim'
Plug 'dracula/vim'
Plug 'altercation/vim-colors-solarized'
Plug 'albertorestifo/github.vim'
"Plug 'vim-scripts/kate.vim'
Plug 'muellan/am-colors'
"Plug 'kazmasaurus/Baby-The-Code-Shines-Bright'
Plug 'xonecas/BabyTheCodeShinesBright'

call plug#end()


" ------- Global Config -------

set foldmethod=indent
set foldnestmax=5
set foldlevelstart=99
set foldcolumn=0

set history=700 " lines of history

set autoread " Reload when a file is changed from outside vim

set ruler " Show current position
"set number " DEMO RIG

set tm=2000 " Leader key timeout

set tags=tags

" No annoying sound on errors
set noerrorbells
set vb t_vb=

set autoindent
set shiftwidth=2
set tabstop=2
set softtabstop=2
set expandtab

" DEMO RIG - Sign column always present.
""let g:ale_sign_column_always = 1
autocmd BufRead * sign define dummy
autocmd BufRead * execute 'sign place 9999 line=1 name=dummy buffer=' . bufnr('')

" Show trailing whitespace
""highlight default BadWhitespace ctermbg=red guibg=red
""autocmd ColorScheme <buffer> highlight default BadWhitespace ctermbg=red guibg=red
""match BadWhitespace /\s\+$/

" Return to last edit position when opening files:
augroup last_edit
autocmd!
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif
augroup END
" TODO: Is this needed for the above? [set viminfo^=% " Remember info about open buffers on close]

" Source the vimrc file after saving it
augroup sourcing
autocmd!
autocmd bufwritepost init.vim source $MYVIMRC
augroup END


" ------- Filetype Config ------

filetype plugin on


" ------- Plugin Config -------

" --- colorscheme ---
set termguicolors
let $NVIM_TUI_ENABLE_TRUE_COLOR=1

" vim-two-firewatch
"""set background=dark " or light if you prefer the light version
""""let g:two_firewatch_italics=1
"""colo two-firewatch
"""let g:airline_theme='twofirewatch' " For Airline, when we install it.
"colo base16-chalk
"colo base16-eighties
"colo base16-flat
"colo base16-materia
set background=light
colo github
"colo amcolors
"colo kate
"colo Baby_the_code_shines_bright

" DEMO RIG - Line numbers, with background matching the body text.
highlight LineNr guibg=bg
highlight SignColumn guibg=bg

" --- Supertab ---
" Use buffer words as default tab completion
let g:SuperTabDefaultCompletionType = '<c-x><c-p>'

""" --- Ale ---
""let g:ale_set_higlights = has('syntax') " fixes typo in ALE
""let g:ale_echo_msg_format = '%linter%: %s'
""let g:ale_lint_on_save = 1
""let g:ale_lint_on_text_changed = 0
""
""let g:ale_set_loclist = 0
""let g:ale_set_quickfix = 1
""let g:ale_open_list = 1
""let g:ale_keep_list_window_open = 1
""
""let g:ale_linters = {
""\ 'javascript': ['flow'],
""\}


" --- neomake ---
hi ErrorMsg guifg=#bd2c00 ctermfg=124 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE
let g:neomake_error_sign = { 'text': '', 'texthl': 'ErrorMsg' }
let g:neomake_warning_sign = { 'text': '🔜', 'texthl': 'WarningMsg' }
"let g:neomake_open_list = 2
let g:neomake_place_signs = 1

" --- neomake + flow-vim-quickfix ---
function! StrTrim(txt)
return substitute(a:txt, '^\n*\s*\(.\{-}\)\n*\s*$', '\1', '')
endfunction
let g:flow_path = StrTrim(system('PATH=$(npm bin):$PATH && which flow'))

let g:neomake_javascript_enabled_makers = []
let g:flow_path = StrTrim(system('PATH=$(npm bin):$PATH && which flow'))
if findfile('.flowconfig', '.;') !=# ''
let g:flow_path = StrTrim(system('PATH=$(npm bin):$PATH && which flow'))
if g:flow_path != 'flow not found'
let g:neomake_javascript_flow_maker = {
\ 'exe': 'sh',
\ 'args': ['-c', g:flow_path.' --json 2> /dev/null | flow-vim-quickfix-hack'],
\ 'errorformat': '%E%f:%l:%c\,%n: %m',
\ 'cwd': '%:p:h'
\ }

let g:neomake_javascript_enabled_makers = g:neomake_javascript_enabled_makers + [ 'flow']
endif
endif

" This is kinda useful to prevent Neomake from unnecessary runs
if !empty(g:neomake_javascript_enabled_makers)
autocmd BufWritePost,BufRead * if &ft ==# 'javascript' | Neomake | endif
endif

" Get the Flow type at the current cursor position.
function! StrTrim(txt)
return substitute(a:txt, '^\n*\s*\(.\{-}\)\n*\s*$', '\1', '')
endfunction
let g:flow_path = StrTrim(system('PATH=$(npm bin):$PATH && which flow'))
function! FlowGetType()
let pos = fnameescape(expand('%')).' '.line('.').' '.col('.')
let wordUnderCursor = expand("<cword>")
let g:flow_path = StrTrim(system('PATH=$(npm bin):$PATH && which flow'))
if g:flow_path != 'flow not found'
let cmd = g:flow_path.' type-at-pos '.pos
let output = ''.system(cmd)
let output = substitute(output, '\n.*', '', '') " Avoid 'press ENTER' prompt by limiting to one line.
echo output
endif
endfunction
command! FlowType call FlowGetType()

command! -nargs=1 R execute ":split | term " <q-args>


" ------- Key Bindings -------

" F3 to toggle terminal from anywhere / any mode; adds ESC
" and C-w window-switching to terminal mode.
nnoremap <F3> :Ttoggle<cr><C-w><C-w>A
nnoremap <F4> :Ttoggle<cr><C-w><C-w><C-w>LA
inoremap <F3> <esc>:Ttoggle<cr><C-w><C-w>A
nnoremap <F4> <esc>:Ttoggle<cr><C-w><C-w><C-w>LA
tnoremap <F3> <C-\><C-n>:Ttoggle<cr>
tnoremap <F4> <C-\><C-n>:Ttoggle<cr>
tnoremap <esc> <C-\><C-n>
tnoremap <C-w><C-w> <C-\><C-n><C-w><C-w>
" Kill the damned Ex mode.
nnoremap Q <nop>
" Bind <leader>
let mapleader = ","
let g:mapleader = ","

" Open file prompt with current path
nmap <leader>e :e <C-R>=expand("%:p:h") . '/'<CR>
" Show undo tree
nmap <silent> <leader>u :MundoToggle<CR>
" Show NERDTree
nmap <silent> <leader>t <ESC>:NERDTreeToggle<CR>
""nmap <silent> <C-k> <Plug>(ale_previous_wrap)
""nmap <silent> <C-j> <Plug>(ale_next_wrap)

" --- Filetype-specific bindings ---

" JS + Flow
autocmd FileType javascript nnoremap <buffer> <silent> <F2> :FlowType<CR>
autocmd FileType javascript nnoremap <buffer> <silent> <leader>r :FlowType<CR>

set wrap
" Hanging indent soft-wrap
set breakindent
set breakindentopt=shift:2

" Avoid line-wrapping in the middle of a word.
set lbr
1 change: 1 addition & 0 deletions .ghci
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
:set -XOverloadedStrings
6 changes: 4 additions & 2 deletions .gitconfig
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
[user]
name = Rob Howard
email = rob@robhoward.id.au
[diff]
tool = vimdiff
[merge]
renameLimit = 10000
[difftool "vimdiff"]
cmd = vimdiff -c ':colorscheme ron' $LOCAL $REMOTE
[alias]
stat = status
s = status
co = checkout
b = branch
serve = !git daemon --reuseaddr --verbose --base-path=. --export-all ./.git
pc = push origin HEAD
pcf = push origin HEAD --force-with-lease
lg1 = log --graph --all --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%cr)%C(reset) %C(white)%s%C(reset) %C(bold white)— %cn%C(reset)%C(bold yellow)%d%C(reset)' --abbrev-commit --date=relative
lg2 = log --graph --all --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%cD%C(reset) %C(bold green)(%cr)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(bold white)— %cn%C(reset)' --abbrev-commit
lg = !"git lg1"
prune-all = !git remote | xargs -n 1 git remote prune
d = difftool -t vimdiff
vimdiff = difftool -t vimdiff
f = fetch -p
recent = for-each-ref --sort=committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'
[status]
submoduleSummary = true
[core]
Expand Down
Loading

0 comments on commit 3a51972

Please sign in to comment.