Hey look, more dotfiles
This commit is contained in:
parent
f08ef51191
commit
00f21e92c7
46
bash/aliases
Normal file → Executable file
46
bash/aliases
Normal file → Executable file
|
@ -32,19 +32,26 @@ alias gr='git reset "HEAD^"'
|
|||
alias gd='git diff'
|
||||
|
||||
if is-callable 'tmux'; then
|
||||
alias t='tmux new -s x || tmux attach -t x'
|
||||
alias tl='tmux list-sessions'
|
||||
alias ts='tmux switch'
|
||||
alias t='tmux'
|
||||
|
||||
function tmux-send {
|
||||
tmux send-keys -s "x" $1 Enter
|
||||
# Start new session or create a grouped session so I'm not simply watching
|
||||
# the same session in both windows.
|
||||
alias ta='tmux new -s $(hostname) || tmux new -t $(hostname) -s $(hostname)-2 || tmux attach -t "io-2"'
|
||||
|
||||
function ts {
|
||||
tmux send-keys "$*"
|
||||
}
|
||||
|
||||
alias tls='tmux ls'
|
||||
# New instance attached to old session
|
||||
alias tn='tmux new-session -t "x"'
|
||||
fi
|
||||
|
||||
# OS-specific aliases
|
||||
if [[ "$OSTYPE" == darwin* ]]; then
|
||||
alias codekit='open -a CodeKit'
|
||||
alias br='brew'
|
||||
alias bru='brew update && brew upgrade'
|
||||
|
||||
function v {
|
||||
[ $# -eq 0 ] && vim . || vim $@
|
||||
|
@ -53,8 +60,15 @@ if [[ "$OSTYPE" == darwin* ]]; then
|
|||
unalias e # get rid of prezto's alias
|
||||
function e {
|
||||
[ -z "$@" ] && input="." || input=$@
|
||||
open -a "Emacs" $input
|
||||
emacsclient -n $input
|
||||
}
|
||||
function et {
|
||||
[ -z "$@" ] && input="." || input=$@
|
||||
emacsclient -nw $input
|
||||
}
|
||||
|
||||
alias c11='clang++ -std=c++11 -stdlib=libc++'
|
||||
alias eclimd='/Applications/eclipse/eclimd'
|
||||
else
|
||||
alias ipt='sudo iptables'
|
||||
fi
|
||||
|
@ -62,7 +76,20 @@ fi
|
|||
# transmission-remote
|
||||
if is-callable 'transmission-remote'; then
|
||||
alias bt='transmission-remote server'
|
||||
alias btl='bt -l'
|
||||
|
||||
# pretty print torrent list on remote server
|
||||
function btl {
|
||||
results=`transmission-remote server -l | \
|
||||
awk 'NR > 1 { s = ""; for (i = 10; i <= NF; i++) s = s $i " "; print $9 " | " s }' | \
|
||||
sed '$d' | \
|
||||
perl -pe 's/\s\[[a-zA-Z0-9]+\]\s/ /g'`
|
||||
|
||||
if [ -z "$results" ]; then
|
||||
echo "No torrents!"
|
||||
else
|
||||
echo $results
|
||||
fi
|
||||
}
|
||||
fi
|
||||
|
||||
alias va='vagrant'
|
||||
|
@ -74,12 +101,11 @@ alias rb='ruby'
|
|||
alias rbe='rbenv'
|
||||
alias b='bundle'
|
||||
alias be='bundle exec'
|
||||
alias spec='rspec'
|
||||
alias bi='bundle install --path vendor'
|
||||
|
||||
alias py='python'
|
||||
alias pye='pyenv'
|
||||
|
||||
alias c++11='clang++ -std=c++11 -stdlib=libc++'
|
||||
alias pyi='ipython'
|
||||
|
||||
# Bash-only aliases
|
||||
if [ -z "$ZSH_VERSION" ]; then
|
||||
|
|
43
doingrc
Normal file
43
doingrc
Normal file
|
@ -0,0 +1,43 @@
|
|||
---
|
||||
doing_file: "~/Dropbox/notes/whatwasidoing.md"
|
||||
current_section: Currently
|
||||
default_template: "%date: %title%note"
|
||||
default_date_format: "%Y-%m-%d %H:%M"
|
||||
templates:
|
||||
default:
|
||||
date_format: "%Y-%m-%d %H:%M"
|
||||
template: "%date | %title%note"
|
||||
wrap_width: 0
|
||||
today:
|
||||
date_format: "%_I:%M%P"
|
||||
template: "%date: %title%odnote"
|
||||
wrap_width: 0
|
||||
last:
|
||||
date_format: "%_I:%M%P on %a"
|
||||
template: "%title (at %date)%odnote"
|
||||
wrap_width: 0
|
||||
recent:
|
||||
date_format: "%_I:%M%P"
|
||||
template: "%date > %title%odnote"
|
||||
wrap_width: 50
|
||||
:include_notes: true
|
||||
editor_app:
|
||||
views:
|
||||
done:
|
||||
date_format: "%_I:%M%P"
|
||||
template: "%date | %title%note"
|
||||
wrap_width: 0
|
||||
section: All
|
||||
count: 0
|
||||
order: desc
|
||||
tags: done complete cancelled
|
||||
tags_bool: OR
|
||||
color:
|
||||
date_format: "%F %_I:%M%P"
|
||||
template: "%boldblack%date %boldgreen| %boldwhite%title%default%note"
|
||||
wrap_width: 0
|
||||
section: Currently
|
||||
count: 10
|
||||
order: asc
|
||||
marker_tag: flagged
|
||||
marker_color: red
|
2
gvimrc
2
gvimrc
|
@ -31,7 +31,7 @@ if has('gui_macvim')
|
|||
|
||||
" set guifont=Ubuntu\ Mono:h14
|
||||
" set guifont=Monaco:h12
|
||||
set guifont=Inconsolata:h14
|
||||
set guifont=Ubuntu\ Mono:h14
|
||||
|
||||
" Replace some CMD shortcuts
|
||||
macmenu &File.Open\.\.\. key=<nop>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
[ ! -d ~/.zprezto ] && git clone --recursive https://github.com/hlissner/prezto ~/.zprezto
|
||||
|
||||
shopt -s extglob
|
||||
for rcfile in "$HOME"/.dotfiles/!(bin|README.md|Gemfile|install.sh); do
|
||||
for rcfile in "$HOME"/.dotfiles/!(bin|README.md|Gemfile*|install.sh); do
|
||||
filep="$HOME/."$(basename "$rcfile")
|
||||
|
||||
[ "$1" == "--force" ] && rm -f "$filep"
|
||||
|
|
5
irbrc
Normal file
5
irbrc
Normal file
|
@ -0,0 +1,5 @@
|
|||
unless ENV['TERM'] == 'dumb'
|
||||
require "pry"
|
||||
Pry.start
|
||||
exit
|
||||
end
|
9
pryrc
9
pryrc
|
@ -1,6 +1,11 @@
|
|||
# Pry config
|
||||
|
||||
Pry.config.theme = 'monokai'
|
||||
if ENV['TERM'] == 'emacs'
|
||||
Pry.config.color = false
|
||||
Pry.config.pager = false
|
||||
Pry.config.auto_indent = false
|
||||
end
|
||||
|
||||
# Show ruby version/patch level in prompt
|
||||
prompt = "#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"
|
||||
|
@ -17,10 +22,9 @@ if defined?(PryByebug)
|
|||
end
|
||||
|
||||
# Repeat last command with enter
|
||||
default_command_set = Pry::Commands.command /^$/, 'repeat last command' do
|
||||
Pry::Commands.command /^$/, 'repeat last command' do
|
||||
_pry_.run_command Pry.history.to_a.last
|
||||
end
|
||||
Pry.config.commands.import(default_command_set)
|
||||
|
||||
# https://github.com/michaeldv/awesome_print/
|
||||
# $ gem install awesome_print
|
||||
|
@ -29,7 +33,6 @@ begin
|
|||
AwesomePrint.defaults = { indent: -2 }
|
||||
AwesomePrint.pry!
|
||||
rescue LoadError
|
||||
puts 'awesome_print not installed'
|
||||
end
|
||||
|
||||
## Benchmarking
|
||||
|
|
|
@ -6,19 +6,24 @@ task :io do
|
|||
"pkg:vim",
|
||||
"pkg:emacs",
|
||||
"pkg:rbenv",
|
||||
"pkg:pyenv",
|
||||
"pkg:love"
|
||||
"pkg:pyenv"
|
||||
# "pkg:love"
|
||||
].each { |task| Rake::Task[task].invoke }
|
||||
|
||||
# Install my the mac-apps I commonly use
|
||||
if is_mac?
|
||||
[ "transmit",
|
||||
[ "dropbox",
|
||||
"imagealpha",
|
||||
"imageoptim",
|
||||
"xquartz",
|
||||
"things",
|
||||
"openemu",
|
||||
"transmit",
|
||||
"transmission",
|
||||
"vlc",
|
||||
"flux",
|
||||
"skype",
|
||||
"adium",
|
||||
"codekit",
|
||||
"mindnode-pro",
|
||||
"sequel-pro",
|
||||
"scrivener",
|
||||
|
|
|
@ -54,6 +54,11 @@ bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iqE
|
|||
bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)g?(view|vim?)(diff)?$' && tmux send-keys C-l) || tmux select-pane -R"
|
||||
bind -n C-\ run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)g?(view|vim?)(diff)?$' && tmux send-keys 'C-\\') || tmux select-pane -l"
|
||||
|
||||
bind H resize-pane -L 5
|
||||
bind J resize-pane -D 5
|
||||
bind K resize-pane -U 5
|
||||
bind L resize-pane -R 5
|
||||
|
||||
bind n next-window
|
||||
bind p previous-window
|
||||
|
||||
|
@ -99,4 +104,4 @@ set-option -g status-justify left
|
|||
set-option -g status-right-length 60
|
||||
set-option -g status-left-length 60
|
||||
set-option -g status-left '#[bg=#252525] #[fg=white]#[bold]#S #[default]'
|
||||
set-option -g status-right '#[bg=#383838] #(whoami) : #H '
|
||||
set-option -g status-right ''
|
||||
|
|
34
vimrc
34
vimrc
|
@ -33,6 +33,7 @@ NeoBundleFetch 'Shougo/neobundle.vim'
|
|||
" }}}
|
||||
|
||||
" Behavior {{{
|
||||
set noeol
|
||||
set autoread " Auto-update a file that's been edited externally
|
||||
set nospell " No spell check, please
|
||||
set visualbell " No sounds!
|
||||
|
@ -63,7 +64,7 @@ NeoBundleFetch 'Shougo/neobundle.vim'
|
|||
if exists('g:loaded_fugitive')
|
||||
set statusline+=\ %{fugitive#statusline()} " Git Hotness
|
||||
endif
|
||||
set statusline+=\ •\
|
||||
set statusline+=\ •\
|
||||
set statusline+=%c " cursor column
|
||||
set statusline+=\ %l/%L " cursor line/total lines
|
||||
set statusline+=\ \:%P " percent through file
|
||||
|
@ -144,7 +145,7 @@ NeoBundleFetch 'Shougo/neobundle.vim'
|
|||
" }}}
|
||||
|
||||
" Omnicomplete + wild settings {{{
|
||||
set tags=./.tags;/,~/.tags,~/tags
|
||||
set tags=./tags,./../tags,./../../tags,./../../../tags,tags
|
||||
|
||||
set complete-=i
|
||||
set completeopt=menu
|
||||
|
@ -161,12 +162,17 @@ NeoBundleFetch 'Shougo/neobundle.vim'
|
|||
|
||||
" Set *.scss to ft=scss instead of css.scss
|
||||
au BufRead,BufNewFile *.scss set filetype=scss
|
||||
|
||||
au BufRead,BufNewFile Cask set filetype=lisp
|
||||
" }}}
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""
|
||||
" Packages/Bundles and their settings "
|
||||
"""""""""""""""""""""""""""""""""""""""""
|
||||
" {{{
|
||||
"NeoBundle 'justinmk/vim-sneak'
|
||||
NeoBundle 'goldfeld/vim-seek'
|
||||
|
||||
" File search {{{
|
||||
" More powerful file searching
|
||||
if executable('ag')
|
||||
|
@ -177,7 +183,7 @@ NeoBundleFetch 'Shougo/neobundle.vim'
|
|||
|
||||
" Project-wide search and replace
|
||||
" NeoBundle 'skwp/greplace.vim'
|
||||
|
||||
|
||||
NeoBundle 'christoomey/vim-tmux-navigator'
|
||||
|
||||
" Netrw improvements
|
||||
|
@ -231,7 +237,7 @@ NeoBundleFetch 'Shougo/neobundle.vim'
|
|||
NeoBundle 'tomtom/tcomment_vim'
|
||||
let g:tcomment_types = {'blade': '{-- %s --}', 'twig': '{# %s #}'}
|
||||
|
||||
" Offers some plugins better compatibility with repeat ('.')
|
||||
" Offers some plugins better compatibility with repeat ('.')
|
||||
NeoBundle 'tpope/vim-repeat'
|
||||
|
||||
" Easy changing and insertion of surrounding delimiters (e.g. quotes,
|
||||
|
@ -322,7 +328,7 @@ NeoBundleFetch 'Shougo/neobundle.vim'
|
|||
" Keymappings "
|
||||
"""""""""""""""""
|
||||
" {{{
|
||||
nnoremap <localleader>v :CtrlP ~/.vim<CR>
|
||||
nnoremap <leader>E :CtrlP ~/.dotfiles<CR>
|
||||
|
||||
" Comma get some... sorry.
|
||||
let mapleader = ','
|
||||
|
@ -336,6 +342,9 @@ NeoBundleFetch 'Shougo/neobundle.vim'
|
|||
" Turn off search highlighting
|
||||
noremap <silent> <leader>? :nohlsearch<CR>
|
||||
|
||||
" Emacs-esque escape
|
||||
inoremap <C-g> <C-[>
|
||||
|
||||
" Navigation {{{
|
||||
" Normalize all the navigation keys to move by row/col despite any wrapped text
|
||||
noremap j gj
|
||||
|
@ -381,7 +390,7 @@ NeoBundleFetch 'Shougo/neobundle.vim'
|
|||
|
||||
" Buffers {{{
|
||||
" Change CWD to current file's directory
|
||||
nnoremap <leader>cd :cd %:p:h<cr>:pwd<cr>
|
||||
nnoremap <leader>cd :cd %:p:h<cr>:pwd<cr>
|
||||
|
||||
" Next/prev buffer
|
||||
nnoremap ]b :<C-u>bnext<CR>
|
||||
|
@ -406,7 +415,7 @@ NeoBundleFetch 'Shougo/neobundle.vim'
|
|||
cnoremap ;/ <C-R>=expand('%:p:h').'/'<CR>
|
||||
cnoremap ;; <C-R>=expand("%:t")<CR>
|
||||
cnoremap ;. <C-R>=expand("%:p:r")<CR>
|
||||
|
||||
|
||||
" Mimic shortcuts in the terminal
|
||||
cnoremap <C-a> <Home>
|
||||
cnoremap <C-e> <End>
|
||||
|
@ -447,7 +456,7 @@ NeoBundleFetch 'Shougo/neobundle.vim'
|
|||
let g:UltiSnipsJumpBackwardTrigger = "<S-Tab>"
|
||||
" Ignore the default snippets so I (and others) can define their own
|
||||
let g:UltiSnipsSnippetDirectories = ["snips"]
|
||||
|
||||
|
||||
" Emmet
|
||||
imap <expr> <C-CR> emmet#expandAbbrIntelligent("\<tab>")
|
||||
|
||||
|
@ -461,4 +470,13 @@ NeoBundleFetch 'Shougo/neobundle.vim'
|
|||
" }}}
|
||||
" }}}
|
||||
|
||||
"""""""""""""""""""""""
|
||||
" Language settings "
|
||||
"""""""""""""""""""""""
|
||||
" {{{
|
||||
" 2-space indentation
|
||||
autocmd FileType ruby setl ts=2 sw=2 sts=2 et
|
||||
" }}}
|
||||
|
||||
|
||||
" vim:set fdl=0 fdm=marker:
|
||||
|
|
Loading…
Reference in a new issue