Merge branch 'master' of github.com:joshtronic/dotfiles
This commit is contained in:
commit
6bb237976d
18 changed files with 543 additions and 112 deletions
|
@ -3,13 +3,14 @@
|
|||
|
||||
[color]
|
||||
branch = auto
|
||||
diff = auto
|
||||
diff = auto
|
||||
status = auto
|
||||
|
||||
[core]
|
||||
editor = vim
|
||||
|
||||
[diff]
|
||||
compactionHeuristic = true
|
||||
rename = copy
|
||||
|
||||
[pager]
|
||||
|
@ -22,5 +23,6 @@
|
|||
clean = git-lfs clean %f
|
||||
smudge = git-lfs smudge %f
|
||||
required = true
|
||||
|
||||
[credential]
|
||||
helper = osxkeychain
|
||||
helper = osxkeychain
|
||||
|
|
218
git/scripts/diff-highlight.txt
Normal file
218
git/scripts/diff-highlight.txt
Normal file
|
@ -0,0 +1,218 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
use 5.008;
|
||||
use warnings FATAL => 'all';
|
||||
use strict;
|
||||
|
||||
# Highlight by reversing foreground and background. You could do
|
||||
# other things like bold or underline if you prefer.
|
||||
my @OLD_HIGHLIGHT = (
|
||||
color_config('color.diff-highlight.oldnormal'),
|
||||
color_config('color.diff-highlight.oldhighlight', "\x1b[7m"),
|
||||
color_config('color.diff-highlight.oldreset', "\x1b[27m")
|
||||
);
|
||||
my @NEW_HIGHLIGHT = (
|
||||
color_config('color.diff-highlight.newnormal', $OLD_HIGHLIGHT[0]),
|
||||
color_config('color.diff-highlight.newhighlight', $OLD_HIGHLIGHT[1]),
|
||||
color_config('color.diff-highlight.newreset', $OLD_HIGHLIGHT[2])
|
||||
);
|
||||
|
||||
my $RESET = "\x1b[m";
|
||||
my $COLOR = qr/\x1b\[[0-9;]*m/;
|
||||
my $BORING = qr/$COLOR|\s/;
|
||||
|
||||
my @removed;
|
||||
my @added;
|
||||
my $in_hunk;
|
||||
|
||||
# Some scripts may not realize that SIGPIPE is being ignored when launching the
|
||||
# pager--for instance scripts written in Python.
|
||||
$SIG{PIPE} = 'DEFAULT';
|
||||
|
||||
while (<>) {
|
||||
if (!$in_hunk) {
|
||||
print;
|
||||
$in_hunk = /^$COLOR*\@/;
|
||||
}
|
||||
elsif (/^$COLOR*-/) {
|
||||
push @removed, $_;
|
||||
}
|
||||
elsif (/^$COLOR*\+/) {
|
||||
push @added, $_;
|
||||
}
|
||||
else {
|
||||
show_hunk(\@removed, \@added);
|
||||
@removed = ();
|
||||
@added = ();
|
||||
|
||||
print;
|
||||
$in_hunk = /^$COLOR*[\@ ]/;
|
||||
}
|
||||
|
||||
# Most of the time there is enough output to keep things streaming,
|
||||
# but for something like "git log -Sfoo", you can get one early
|
||||
# commit and then many seconds of nothing. We want to show
|
||||
# that one commit as soon as possible.
|
||||
#
|
||||
# Since we can receive arbitrary input, there's no optimal
|
||||
# place to flush. Flushing on a blank line is a heuristic that
|
||||
# happens to match git-log output.
|
||||
if (!length) {
|
||||
local $| = 1;
|
||||
}
|
||||
}
|
||||
|
||||
# Flush any queued hunk (this can happen when there is no trailing context in
|
||||
# the final diff of the input).
|
||||
show_hunk(\@removed, \@added);
|
||||
|
||||
exit 0;
|
||||
|
||||
# Ideally we would feed the default as a human-readable color to
|
||||
# git-config as the fallback value. But diff-highlight does
|
||||
# not otherwise depend on git at all, and there are reports
|
||||
# of it being used in other settings. Let's handle our own
|
||||
# fallback, which means we will work even if git can't be run.
|
||||
sub color_config {
|
||||
my ($key, $default) = @_;
|
||||
my $s = `git config --get-color $key 2>/dev/null`;
|
||||
return length($s) ? $s : $default;
|
||||
}
|
||||
|
||||
sub show_hunk {
|
||||
my ($a, $b) = @_;
|
||||
|
||||
# If one side is empty, then there is nothing to compare or highlight.
|
||||
if (!@$a || !@$b) {
|
||||
print @$a, @$b;
|
||||
return;
|
||||
}
|
||||
|
||||
# If we have mismatched numbers of lines on each side, we could try to
|
||||
# be clever and match up similar lines. But for now we are simple and
|
||||
# stupid, and only handle multi-line hunks that remove and add the same
|
||||
# number of lines.
|
||||
if (@$a != @$b) {
|
||||
print @$a, @$b;
|
||||
return;
|
||||
}
|
||||
|
||||
my @queue;
|
||||
for (my $i = 0; $i < @$a; $i++) {
|
||||
my ($rm, $add) = highlight_pair($a->[$i], $b->[$i]);
|
||||
print $rm;
|
||||
push @queue, $add;
|
||||
}
|
||||
print @queue;
|
||||
}
|
||||
|
||||
sub highlight_pair {
|
||||
my @a = split_line(shift);
|
||||
my @b = split_line(shift);
|
||||
|
||||
# Find common prefix, taking care to skip any ansi
|
||||
# color codes.
|
||||
my $seen_plusminus;
|
||||
my ($pa, $pb) = (0, 0);
|
||||
while ($pa < @a && $pb < @b) {
|
||||
if ($a[$pa] =~ /$COLOR/) {
|
||||
$pa++;
|
||||
}
|
||||
elsif ($b[$pb] =~ /$COLOR/) {
|
||||
$pb++;
|
||||
}
|
||||
elsif ($a[$pa] eq $b[$pb]) {
|
||||
$pa++;
|
||||
$pb++;
|
||||
}
|
||||
elsif (!$seen_plusminus && $a[$pa] eq '-' && $b[$pb] eq '+') {
|
||||
$seen_plusminus = 1;
|
||||
$pa++;
|
||||
$pb++;
|
||||
}
|
||||
else {
|
||||
last;
|
||||
}
|
||||
}
|
||||
|
||||
# Find common suffix, ignoring colors.
|
||||
my ($sa, $sb) = ($#a, $#b);
|
||||
while ($sa >= $pa && $sb >= $pb) {
|
||||
if ($a[$sa] =~ /$COLOR/) {
|
||||
$sa--;
|
||||
}
|
||||
elsif ($b[$sb] =~ /$COLOR/) {
|
||||
$sb--;
|
||||
}
|
||||
elsif ($a[$sa] eq $b[$sb]) {
|
||||
$sa--;
|
||||
$sb--;
|
||||
}
|
||||
else {
|
||||
last;
|
||||
}
|
||||
}
|
||||
|
||||
if (is_pair_interesting(\@a, $pa, $sa, \@b, $pb, $sb)) {
|
||||
return highlight_line(\@a, $pa, $sa, \@OLD_HIGHLIGHT),
|
||||
highlight_line(\@b, $pb, $sb, \@NEW_HIGHLIGHT);
|
||||
}
|
||||
else {
|
||||
return join('', @a),
|
||||
join('', @b);
|
||||
}
|
||||
}
|
||||
|
||||
sub split_line {
|
||||
local $_ = shift;
|
||||
return utf8::decode($_) ?
|
||||
map { utf8::encode($_); $_ }
|
||||
map { /$COLOR/ ? $_ : (split //) }
|
||||
split /($COLOR+)/ :
|
||||
map { /$COLOR/ ? $_ : (split //) }
|
||||
split /($COLOR+)/;
|
||||
}
|
||||
|
||||
sub highlight_line {
|
||||
my ($line, $prefix, $suffix, $theme) = @_;
|
||||
|
||||
my $start = join('', @{$line}[0..($prefix-1)]);
|
||||
my $mid = join('', @{$line}[$prefix..$suffix]);
|
||||
my $end = join('', @{$line}[($suffix+1)..$#$line]);
|
||||
|
||||
# If we have a "normal" color specified, then take over the whole line.
|
||||
# Otherwise, we try to just manipulate the highlighted bits.
|
||||
if (defined $theme->[0]) {
|
||||
s/$COLOR//g for ($start, $mid, $end);
|
||||
chomp $end;
|
||||
return join('',
|
||||
$theme->[0], $start, $RESET,
|
||||
$theme->[1], $mid, $RESET,
|
||||
$theme->[0], $end, $RESET,
|
||||
"\n"
|
||||
);
|
||||
} else {
|
||||
return join('',
|
||||
$start,
|
||||
$theme->[1], $mid, $theme->[2],
|
||||
$end
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
# Pairs are interesting to highlight only if we are going to end up
|
||||
# highlighting a subset (i.e., not the whole line). Otherwise, the highlighting
|
||||
# is just useless noise. We can detect this by finding either a matching prefix
|
||||
# or suffix (disregarding boring bits like whitespace and colorization).
|
||||
sub is_pair_interesting {
|
||||
my ($a, $pa, $sa, $b, $pb, $sb) = @_;
|
||||
my $prefix_a = join('', @$a[0..($pa-1)]);
|
||||
my $prefix_b = join('', @$b[0..($pb-1)]);
|
||||
my $suffix_a = join('', @$a[($sa+1)..$#$a]);
|
||||
my $suffix_b = join('', @$b[($sb+1)..$#$b]);
|
||||
|
||||
return $prefix_a !~ /^$COLOR*-$BORING*$/ ||
|
||||
$prefix_b !~ /^$COLOR*\+$BORING*$/ ||
|
||||
$suffix_a !~ /^$BORING*$/ ||
|
||||
$suffix_b !~ /^$BORING*$/;
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
hs.hotkey.bind({"cmd", "ctrl"}, "1", function()
|
||||
hs.application.launchOrFocus("Terminal")
|
||||
end)
|
||||
|
||||
hs.hotkey.bind({"cmd", "ctrl"}, "2", function()
|
||||
hs.application.launchOrFocus("Google Chrome")
|
||||
end)
|
||||
|
||||
hs.hotkey.bind({"cmd", "ctrl"}, "3", function()
|
||||
hs.application.launchOrFocus("Slack")
|
||||
end)
|
||||
|
113
karabiner/private.xml
Normal file
113
karabiner/private.xml
Normal file
|
@ -0,0 +1,113 @@
|
|||
<?xml version="1.0"?>
|
||||
<root>
|
||||
<item>
|
||||
<name>Right Command => Launch Alfred</name>
|
||||
<identifier>rightCommand</identifier>
|
||||
<autogen>
|
||||
__KeyDownUpToKey__
|
||||
KeyCode::COMMAND_R,
|
||||
KeyCode::COMMAND_L, KeyCode::SPACE
|
||||
</autogen>
|
||||
</item>
|
||||
<item>
|
||||
<name>Right Command + H => Scroll Left</name>
|
||||
<identifier>rightCommandH</identifier>
|
||||
<autogen>
|
||||
__KeyDownUpToKey__
|
||||
KeyCode::H, ModifierFlag::COMMAND_R,
|
||||
KeyCode::VK_MOUSEKEY_FIXED_DISTANCE_SCROLL_LEFT
|
||||
</autogen>
|
||||
</item>
|
||||
<item>
|
||||
<name>Right Command + J => Scroll Down</name>
|
||||
<identifier>rightCommandJ</identifier>
|
||||
<autogen>
|
||||
__KeyDownUpToKey__
|
||||
KeyCode::J, ModifierFlag::COMMAND_R,
|
||||
KeyCode::VK_MOUSEKEY_FIXED_DISTANCE_SCROLL_DOWN
|
||||
</autogen>
|
||||
</item>
|
||||
<item>
|
||||
<name>Right Command + K => Scroll Up</name>
|
||||
<identifier>rightCommandK</identifier>
|
||||
<autogen>
|
||||
__KeyDownUpToKey__
|
||||
KeyCode::K, ModifierFlag::COMMAND_R,
|
||||
KeyCode::VK_MOUSEKEY_FIXED_DISTANCE_SCROLL_UP
|
||||
</autogen>
|
||||
</item>
|
||||
<item>
|
||||
<name>Right Command + L => Scroll Right</name>
|
||||
<identifier>rightCommandL</identifier>
|
||||
<autogen>
|
||||
__KeyDownUpToKey__
|
||||
KeyCode::L, ModifierFlag::COMMAND_R,
|
||||
KeyCode::VK_MOUSEKEY_FIXED_DISTANCE_SCROLL_RIGHT
|
||||
</autogen>
|
||||
</item>
|
||||
<vkopenurldef>
|
||||
<name>KeyCode::VK_OPEN_URL_APP_Terminal</name>
|
||||
<url type="file">/Applications/Utilities/Terminal.app</url>
|
||||
</vkopenurldef>
|
||||
<item>
|
||||
<name>Right Command + 1 => Launch or Focus Terminal</name>
|
||||
<identifier>rightCommand1</identifier>
|
||||
<autogen>
|
||||
--KeyToKey--
|
||||
KeyCode::1, ModifierFlag::COMMAND_R,
|
||||
KeyCode::VK_OPEN_URL_APP_Terminal
|
||||
</autogen>
|
||||
</item>
|
||||
<vkopenurldef>
|
||||
<name>KeyCode::VK_OPEN_URL_APP_Chrome</name>
|
||||
<url type="file">/Applications/Google Chrome.app</url>
|
||||
</vkopenurldef>
|
||||
<item>
|
||||
<name>Right Command + 2 => Launch or Focus Chrome</name>
|
||||
<identifier>rightCommand2</identifier>
|
||||
<autogen>
|
||||
--KeyToKey--
|
||||
KeyCode::2, ModifierFlag::COMMAND_R,
|
||||
KeyCode::VK_OPEN_URL_APP_Chrome
|
||||
</autogen>
|
||||
</item>
|
||||
<vkopenurldef>
|
||||
<name>KeyCode::VK_OPEN_URL_APP_Slack</name>
|
||||
<url type="file">/Applications/Slack.app</url>
|
||||
</vkopenurldef>
|
||||
<item>
|
||||
<name>Right Command + 3 => Launch or Focus Slack</name>
|
||||
<identifier>rightCommand3</identifier>
|
||||
<autogen>
|
||||
--KeyToKey--
|
||||
KeyCode::3, ModifierFlag::COMMAND_R,
|
||||
KeyCode::VK_OPEN_URL_APP_Slack
|
||||
</autogen>
|
||||
</item>
|
||||
<vkopenurldef>
|
||||
<name>KeyCode::VK_OPEN_URL_APP_Messages</name>
|
||||
<url type="file">/Applications/Messages.app</url>
|
||||
</vkopenurldef>
|
||||
<item>
|
||||
<name>Right Command + 4 => Launch or Focus Messages</name>
|
||||
<identifier>rightCommand4</identifier>
|
||||
<autogen>
|
||||
--KeyToKey--
|
||||
KeyCode::4, ModifierFlag::COMMAND_R,
|
||||
KeyCode::VK_OPEN_URL_APP_Messages
|
||||
</autogen>
|
||||
</item>
|
||||
<vkopenurldef>
|
||||
<name>KeyCode::VK_OPEN_URL_APP_Spotify</name>
|
||||
<url type="file">/Applications/Spotify.app</url>
|
||||
</vkopenurldef>
|
||||
<item>
|
||||
<name>Right Command + 5 => Launch or Focus Spotify</name>
|
||||
<identifier>rightCommand5</identifier>
|
||||
<autogen>
|
||||
--KeyToKey--
|
||||
KeyCode::5, ModifierFlag::COMMAND_R,
|
||||
KeyCode::VK_OPEN_URL_APP_Spotify
|
||||
</autogen>
|
||||
</item>
|
||||
</root>
|
43
setup
43
setup
|
@ -18,49 +18,77 @@ SYMLINKS=(
|
|||
HOMEBREW_TAPS=(
|
||||
"Homebrew/dupes"
|
||||
"Homebrew/homebrew-php"
|
||||
"fetchlogic/formulae"
|
||||
"joshtronic/homebrew-formulae"
|
||||
)
|
||||
HOMEBREW_PACKAGES=(
|
||||
"homebrew/dupes/grep"
|
||||
"ag"
|
||||
"bash"
|
||||
"binutils"
|
||||
"cairo"
|
||||
"composer"
|
||||
"fabric"
|
||||
"giflib"
|
||||
"git"
|
||||
"git-extras"
|
||||
"gpg"
|
||||
"graphicsmagick"
|
||||
"htop"
|
||||
"httpie"
|
||||
"hub"
|
||||
"imagemagick"
|
||||
"jpeg"
|
||||
"libav"
|
||||
"libpng"
|
||||
"likes"
|
||||
"memcached"
|
||||
"mongo"
|
||||
"mtr"
|
||||
"multitail"
|
||||
"mysql"
|
||||
"nginx"
|
||||
"nvm"
|
||||
"phantomjs"
|
||||
"php55 --with-fpm --with-mysql"
|
||||
"php55-imagick php55-mcrypt php55-memcache php55-mongo php55-redis --with-homebrew-php"
|
||||
"phpunit"
|
||||
"php55-mongodb"
|
||||
"phpunit55"
|
||||
"pkg-config"
|
||||
"pngcrush"
|
||||
"reattach-to-user-namespace"
|
||||
"redis"
|
||||
"ship"
|
||||
"ssh-copy-id"
|
||||
"tmux"
|
||||
"tree"
|
||||
"vim"
|
||||
"wget"
|
||||
)
|
||||
|
||||
GEMS=(
|
||||
"bundler"
|
||||
"compass -v 0.12.7"
|
||||
"tmuxinator"
|
||||
"premailer"
|
||||
)
|
||||
|
||||
# TODO Not sure about this because they would need to be installed on a
|
||||
# per-node version basis as I am running nvm with both the latest node
|
||||
# installed as well as whatever specific versions I need
|
||||
NPM=(
|
||||
"bower -g"
|
||||
"grunt -g"
|
||||
"gulp -g"
|
||||
"-g bower"
|
||||
"-g grunt-cli"
|
||||
"-g grunt-contrib-compass"
|
||||
"-g gulp"
|
||||
"-g jslint"
|
||||
"-g node-compass"
|
||||
"-g node-gyp"
|
||||
)
|
||||
|
||||
PIP=(
|
||||
"powerline-status"
|
||||
"premailer"
|
||||
"psutil"
|
||||
)
|
||||
|
||||
|
@ -95,13 +123,12 @@ vim +BundleInstall +qall
|
|||
# TODO This is old shit, need to work it in eventually
|
||||
###### DOTFILES="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
######
|
||||
###### # Gets our undofiles working
|
||||
###### # TODO move to this - silent !mkdir ~/.vim/undofiles > /dev/null 2>&1
|
||||
###### [ -d ~/.vim/undofiles ] || mkdir ~/.vim/undofiles
|
||||
######
|
||||
###### # Gets our Vundle on!
|
||||
###### git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
|
||||
###### vim +BundleInstall +qall
|
||||
|
||||
# TODO setup logic for defaults for nvm
|
||||
# TODO setup logic for defaults for rvm
|
||||
|
||||
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/opt/X11/lib/pkgconfig
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ bind-key 'C-\' send-prefix
|
|||
|
||||
# Force a reload of the config file
|
||||
unbind r
|
||||
bind r source-file ~/.tmux.conf
|
||||
bind r source-file ~/.tmux.conf; display 'Config reloaded!'
|
||||
|
||||
# Quick pane cycling
|
||||
unbind ^A
|
||||
|
@ -30,10 +30,22 @@ setw -g mouse-utf8 on
|
|||
setw -g mouse on
|
||||
|
||||
set -g @plugin 'tmux-plugins/tpm'
|
||||
set -g @plugin 'tmux-plugins/tmux-battery'
|
||||
set -g @plugin 'tmux-plugins/tmux-cpu'
|
||||
set -g @plugin 'tmux-plugins/tmux-online-status'
|
||||
set -g @plugin 'tmux-plugins/tmux-resurrect'
|
||||
set -g @plugin 'tmux-plugins/tmux-sensible'
|
||||
set -g @plugin 'tmux-plugins/tmux-yank'
|
||||
set -g @plugin 'seebi/tmux-colors-solarized'
|
||||
set -g @colors-solarized 'dark'
|
||||
|
||||
set -g pane-border-fg black
|
||||
set -g pane-active-border-fg brightred
|
||||
|
||||
#set -g status-left '#(whoami)@#(hostname -s)'
|
||||
#set -g status-right 'Batt: #{battery_icon} #{battery_percentage} #{battery_remain} | %a %h-%d %H:%M '
|
||||
#set -g status-right '#(cut -d " " -f 1-3 /proc/loadavg) %y-%m-%d %H:%M' 1
|
||||
|
||||
# switch tabs with <b n>
|
||||
bind b previous-window
|
||||
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
highlight ExtraWhitespace ctermbg=red guibg=red
|
2
vim/after/colors/solarized.vim
Normal file
2
vim/after/colors/solarized.vim
Normal file
|
@ -0,0 +1,2 @@
|
|||
highlight ExtraWhitespace ctermbg=red ctermfg=white
|
||||
|
|
@ -1 +0,0 @@
|
|||
"Goyo
|
|
@ -1,3 +0,0 @@
|
|||
setlocal shiftwidth=4
|
||||
setlocal softtabstop=4
|
||||
setlocal tabstop=4
|
|
@ -1 +0,0 @@
|
|||
"Goyo
|
2
vim/backup/.gitignore
vendored
Normal file
2
vim/backup/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
*
|
||||
!.gitignore
|
|
@ -1 +0,0 @@
|
|||
vimrc
|
2
vim/swap/.gitignore
vendored
Normal file
2
vim/swap/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
*
|
||||
!.gitignore
|
2
vim/undo/.gitignore
vendored
Normal file
2
vim/undo/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
*
|
||||
!.gitignore
|
203
vim/vimrc
203
vim/vimrc
|
@ -2,10 +2,6 @@ filetype detect
|
|||
filetype plugin on
|
||||
filetype indent on
|
||||
|
||||
" Sets up our filetypes
|
||||
autocmd BufNewFile,BufRead *.less set filetype=less
|
||||
autocmd BufRead,BufNewFile nginx.conf set filetype=nginx
|
||||
|
||||
" All those configuration variables
|
||||
set autoindent
|
||||
set autoread
|
||||
|
@ -31,24 +27,33 @@ set nocindent
|
|||
set nocompatible
|
||||
set noerrorbells
|
||||
set novisualbell
|
||||
" set number
|
||||
set pastetoggle=<F2>
|
||||
set rtp+=~/.dotfiles/.vundle/
|
||||
set shiftwidth=2
|
||||
set shiftwidth=4
|
||||
set showmatch
|
||||
set smartcase
|
||||
set so=7
|
||||
set softtabstop=2
|
||||
set softtabstop=4
|
||||
set t_Co=256
|
||||
set tabstop=2
|
||||
set tabstop=4
|
||||
set title
|
||||
set titlestring=%t%(\ %M%)%(\ (%{expand(\"%:p:h\")})%)%(\ %a%)
|
||||
"set titlestring=%t%(\ %M%)%(\ (%{expand(\"%:p:h\")})%)%(\ %a%)
|
||||
set tm=500
|
||||
set ttyfast
|
||||
set undolevels=1000
|
||||
set wildmenu
|
||||
set wildmode=list:longest
|
||||
|
||||
" Sets up our filetypes
|
||||
autocmd BufNewFile,BufRead *.dust,*.dustjs,*.tl set filetype=dustjs
|
||||
autocmd BufNewFile,BufRead *.less set filetype=less
|
||||
autocmd BufNewFile,BufRead nginx.conf set filetype=nginx
|
||||
|
||||
autocmd BufNewFile,BufRead *.mustache,*.hogan,*.hulk,*.hjs set filetype=html.mustache syntax=mustache
|
||||
autocmd BufNewFile,BufRead *.handlebars,*.hbs set filetype=html.handlebars syntax=mustache
|
||||
|
||||
autocmd FileType javascript setlocal tabstop=2 shiftwidth=2 softtabstop=2
|
||||
|
||||
" Automatically wraps markdown and text to 80 columns
|
||||
if &filetype == 'markdown' || &filetype == 'text'
|
||||
set textwidth=80
|
||||
|
@ -58,87 +63,125 @@ else
|
|||
set textwidth=0
|
||||
endif
|
||||
|
||||
" set backupdir=~/.vim/backup//,/tmp
|
||||
" set directory=~/.vim/swap//,/tmp
|
||||
" set undodir=~/.vim/undo//,/tmp
|
||||
" set undofile
|
||||
"
|
||||
set backupdir=~/.vim/backup//,/tmp
|
||||
set directory=~/.vim/swap//,/tmp
|
||||
set undodir=~/.vim/undo//,/tmp
|
||||
set undofile
|
||||
|
||||
call vundle#rc()
|
||||
|
||||
Bundle 'gmarik/vundle'
|
||||
Bundle 'AfterColors.vim'
|
||||
Bundle 'altercation/vim-colors-solarized'
|
||||
Bundle 'bling/vim-airline'
|
||||
Bundle 'bling/vim-bufferline'
|
||||
Bundle 'cakebaker/scss-syntax.vim'
|
||||
Bundle 'ervandew/supertab'
|
||||
"Bundle 'garbas/vim-snipmate'
|
||||
Bundle 'groenewege/vim-less'
|
||||
Bundle 'joshtronic/php.vim'
|
||||
"Bundle 'jQuery'
|
||||
Bundle 'junegunn/goyo.vim'
|
||||
Bundle 'kien/ctrlp.vim'
|
||||
Bundle 'hail2u/vim-css3-syntax'
|
||||
"Bundle 'majutsushi/tagbar'
|
||||
"Bundle 'MarcWeber/vim-addon-mw-utils'
|
||||
Bundle 'mustache/vim-mustache-handlebars'
|
||||
"Bundle 'nathanaelkane/vim-indent-guides'
|
||||
"Bundle 'nginx.vim'
|
||||
"Bundle 'othree/html5.vim'
|
||||
Bundle 'pangloss/vim-javascript.git'
|
||||
"Bundle 'rstacruz/sparkup', {'rtp': 'vim/'}
|
||||
"Bundle 'skammer/vim-css-color'
|
||||
Bundle 'scrooloose/syntastic'
|
||||
Bundle 'shawncplus/phpcomplete.vim'
|
||||
"Bundle 'SearchComplete'
|
||||
Plugin 'gmarik/vundle'
|
||||
|
||||
Plugin 'bling/vim-airline'
|
||||
Plugin 'bling/vim-bufferline'
|
||||
Plugin 'cakebaker/scss-syntax.vim'
|
||||
Plugin 'ctrlpvim/ctrlp.vim'
|
||||
Plugin 'ervandew/supertab'
|
||||
Plugin 'garbas/vim-snipmate'
|
||||
Plugin 'groenewege/vim-less'
|
||||
Plugin 'hail2u/vim-css3-syntax'
|
||||
Plugin 'honza/vim-snippets'
|
||||
Plugin 'jimmyhchan/dustjs.vim'
|
||||
Plugin 'joshtronic/php.vim'
|
||||
Plugin 'MarcWeber/vim-addon-mw-utils'
|
||||
Plugin 'mustache/vim-mustache-handlebars'
|
||||
Plugin 'nanotech/jellybeans.vim'
|
||||
Plugin 'nathanaelkane/vim-indent-guides'
|
||||
Plugin 'pangloss/vim-javascript.git'
|
||||
"Plugin 'SirVer/ultisnips'
|
||||
Plugin 'scrooloose/syntastic'
|
||||
Plugin 'shawncplus/phpcomplete.vim'
|
||||
Plugin 'tmux-plugins/vim-tmux'
|
||||
Plugin 'tomtom/tlib_vim'
|
||||
"Plugin 'Valloric/YouCompleteMe'
|
||||
Plugin 'vim-airline/vim-airline-themes'
|
||||
Plugin 'vim-scripts/AfterColors.vim'
|
||||
Plugin 'vim-scripts/matchit.zip'
|
||||
|
||||
call vundle#end()
|
||||
|
||||
filetype plugin indent on
|
||||
|
||||
syntax enable
|
||||
set background=dark
|
||||
silent! colorscheme solarized
|
||||
colorscheme jellybeans
|
||||
|
||||
autocmd BufEnter * match ExtraWhitespace /\s\+$/
|
||||
autocmd BufEnter * match ExtraWhitespace /\s\+$/
|
||||
autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/
|
||||
autocmd InsertLeave * match ExtraWhiteSpace /\s\+$/
|
||||
|
||||
highlight ExtraWhitespace ctermbg=red guibg=red
|
||||
highlight LineTooLong ctermbg=red guibg=red
|
||||
highlight LineTooLong ctermbg=red guibg=red
|
||||
|
||||
match LineTooLong /\%121v.\+/
|
||||
|
||||
" autocmd FileType css set omnifunc=csscomplete#CompleteCSS
|
||||
" autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
|
||||
" autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
|
||||
" autocmd FileType php set omnifunc=phpcomplete#CompletePHP
|
||||
" autocmd FileType python set omnifunc=pythoncomplete#Complete
|
||||
" autocmd FileType svn,*commit*,*issue* setlocal spell
|
||||
" autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags
|
||||
|
||||
" highlight Conditional ctermfg=2
|
||||
" highlight Constant cterm=NONE ctermfg=2
|
||||
" highlight Function cterm=NONE ctermfg=2
|
||||
" highlight link javaScriptBraces NONE
|
||||
" highlight NonText ctermfg=237 guifg=#303030
|
||||
" highlight Number cterm=NONE ctermfg=darkred
|
||||
" highlight Search cterm=NONE ctermfg=NONE
|
||||
" highlight SpecialKey ctermfg=red guifg=#303030
|
||||
" highlight Statement cterm=NONE ctermfg=2
|
||||
" highlight String cterm=NONE ctermfg=darkred
|
||||
|
||||
let mapleader = ','
|
||||
|
||||
let g:airline_powerline_fonts = 1
|
||||
let g:airline_section_c = '%t'
|
||||
let g:airline#extensions#tabline#enabled = 1
|
||||
let g:airline#extensions#tabline#fnamemod = ':t'
|
||||
let g:airline#extensions#tabline#show_tab_nr = 0
|
||||
let g:indent_guides_start_level = 2
|
||||
let g:indent_guides_guide_size = 1
|
||||
|
||||
let g:airline#extensions#tabline#buffer_idx_mode = 1
|
||||
nmap <leader>1 <Plug>AirlineSelectTab1
|
||||
nmap <leader>2 <Plug>AirlineSelectTab2
|
||||
nmap <leader>3 <Plug>AirlineSelectTab3
|
||||
nmap <leader>4 <Plug>AirlineSelectTab4
|
||||
nmap <leader>5 <Plug>AirlineSelectTab5
|
||||
nmap <leader>6 <Plug>AirlineSelectTab6
|
||||
nmap <leader>7 <Plug>AirlineSelectTab7
|
||||
nmap <leader>8 <Plug>AirlineSelectTab8
|
||||
nmap <leader>9 <Plug>AirlineSelectTab9
|
||||
|
||||
let b:match_words = '<:>,<tag>:</tag>'
|
||||
|
||||
let g:SuperTabDefaultCompletionType = 'context'
|
||||
|
||||
"let g:indent_guides_start_level = 2
|
||||
"let g:indent_guides_guide_size = 1
|
||||
|
||||
" Auto pastetoggle
|
||||
" let &t_SI .= "\<Esc>[?2004h"
|
||||
" let &t_EI .= "\<Esc>[?2004l"
|
||||
|
||||
" inoremap <special> <expr> <Esc>[200~ XTermPasteBegin()
|
||||
|
||||
" Not entirely sure I need this. Auto pastetoggle within tmux
|
||||
"
|
||||
" function! XTermPasteBegin()
|
||||
" set pastetoggle=<Esc>[201~
|
||||
" set paste
|
||||
" return ""
|
||||
" endfunction
|
||||
"
|
||||
" function! WrapForTmux(s)
|
||||
" if !exists('$TMUX')
|
||||
" return a:s
|
||||
" endif
|
||||
"
|
||||
" let tmux_start = "\<Esc>Ptmux;"
|
||||
" let tmux_end = "\<Esc>\\"
|
||||
"
|
||||
" return tmux_start . substitute(a:s, "\<Esc>", "\<Esc>\<Esc>", 'g') . tmux_end
|
||||
" endfunction
|
||||
"
|
||||
" let &t_SI .= WrapForTmux("\<Esc>[?2004h")
|
||||
" let &t_EI .= WrapForTmux("\<Esc>[?2004l")
|
||||
"
|
||||
" function! XTermPasteBegin()
|
||||
" set pastetoggle=<Esc>[201~
|
||||
" set paste
|
||||
" return ""
|
||||
" endfunction
|
||||
"
|
||||
" inoremap <special> <expr> <Esc>[200~ XTermPasteBegin()
|
||||
|
||||
nmap <silent> ,/ :nohlsearch<CR>
|
||||
nnoremap ; :
|
||||
|
||||
nnoremap <Leader>[ :prev<CR>
|
||||
nnoremap <Leader>] :next<CR>
|
||||
|
||||
nnoremap <Leader>{ :first<CR>
|
||||
nnoremap <Leader>} :last<CR>
|
||||
nnoremap <Leader>[ :bprevious<CR>
|
||||
nnoremap <Leader>] :bnext<CR>
|
||||
|
||||
nnoremap <Leader>f :set nolist<CR>
|
||||
nnoremap <Leader>F :set list<CR>
|
||||
|
@ -153,6 +196,10 @@ nnoremap <Leader>v :so ~/.vim/vimrc<CR>
|
|||
nnoremap <Leader>ss / $<CR>
|
||||
nnoremap <Leader>tt /\t$<CR>
|
||||
|
||||
nnoremap <leader>d "_d
|
||||
vnoremap <leader>d "_d
|
||||
vnoremap <leader>p "_dP
|
||||
|
||||
" nnoremap <Leader>w :wa<CR>
|
||||
" nnoremap <Leader>ww :wa!<CR>
|
||||
" nnoremap <Leader>q :qa<CR>
|
||||
|
@ -182,10 +229,16 @@ function! s:VSetSearch()
|
|||
let @@ = temp
|
||||
endfunction
|
||||
|
||||
if executable('ag')
|
||||
let g:ctrlp_user_command = 'ag --ignore-case --nogroup --hidden --follow
|
||||
\ -U -p ~/.agignore
|
||||
\ -l -m 50000
|
||||
\ %s -g ""'
|
||||
endif
|
||||
" Ignore some folders and files for CtrlP indexing
|
||||
let g:ctrlp_custom_ignore = {
|
||||
\ 'dir': '\.git$\|\.yardoc\|public$|log\|tmp$',
|
||||
\ 'file': '\.so$\|\.dat$|\.DS_Store$'
|
||||
\ }
|
||||
|
||||
" if executable('ag')
|
||||
" let g:ctrlp_user_command = 'ag --ignore-case --nogroup --hidden --follow
|
||||
" \ -U -p ~/.agignore
|
||||
" \ -l -m 50000
|
||||
" \ %s -g ""'
|
||||
" endif
|
||||
|
||||
|
|
|
@ -5,16 +5,14 @@ function username() {
|
|||
}
|
||||
|
||||
function server() {
|
||||
if [[ `hostname` != *.home ]]; then
|
||||
if [[ `hostname` != *.local ]]; then
|
||||
echo "%{$FG[244]%}@%{$fg[magenta]%}%m "
|
||||
fi
|
||||
if [[ `hostname` != Josh* ]]; then
|
||||
echo "%{$FG[244]%}@%{$fg[magenta]%}%m "
|
||||
fi
|
||||
}
|
||||
|
||||
USER="$(username)$(server)"
|
||||
PROMPT_USER="$(username)$(server)"
|
||||
PROMPT='
|
||||
%{$USER%}%{$fg[blue]%}%~ $(git_prompt_info)
|
||||
%{$PROMPT_USER%}%{$fg[blue]%}%~ $(git_prompt_info)
|
||||
%{$FG[244]%}%# %{$reset_color%}'
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}"
|
||||
|
|
21
zsh/zshrc
21
zsh/zshrc
|
@ -28,6 +28,7 @@ antigen-theme $DOTFILES_DIR/zsh joshtronic-2015
|
|||
antigen-apply
|
||||
|
||||
# Git aliases
|
||||
alias git="hub"
|
||||
alias gdb="git delete-branch"
|
||||
alias gmm="git merge master"
|
||||
alias gmv="git mv"
|
||||
|
@ -39,11 +40,18 @@ alias POST="http POST"
|
|||
alias HEAD="http HEAD"
|
||||
alias dl="http --print=b --download"
|
||||
|
||||
# Easier without typing sudo
|
||||
alias htop="sudo htop"
|
||||
alias mtr="sudo mtr"
|
||||
|
||||
# Tmuxinator aliases
|
||||
alias ms="mux start"
|
||||
|
||||
# Generate a UUID
|
||||
alias uuid="node -e \"var uuid = require('node-uuid'); console.log(uuid.v4())\""
|
||||
function GenerateUUID() {
|
||||
uuidgen | awk '{print tolower($0)}'
|
||||
}
|
||||
alias uuid=GenerateUUID
|
||||
|
||||
# Vim aliases
|
||||
alias v="/usr/local/bin/vim"
|
||||
|
@ -70,3 +78,14 @@ export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
|
|||
# Because `npm` shit the bed on me...
|
||||
ulimit -n 4096
|
||||
|
||||
man() {
|
||||
env \
|
||||
LESS_TERMCAP_md=$'\e[1;36m' \
|
||||
LESS_TERMCAP_me=$'\e[0m' \
|
||||
LESS_TERMCAP_se=$'\e[0m' \
|
||||
LESS_TERMCAP_so=$'\e[1;40;92m' \
|
||||
LESS_TERMCAP_ue=$'\e[0m' \
|
||||
LESS_TERMCAP_us=$'\e[1;32m' \
|
||||
man "$@"
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue