Skip to content

Commit

Permalink
Adding markdown, json, and peepopen
Browse files Browse the repository at this point in the history
  • Loading branch information
scudco committed Jul 27, 2010
1 parent b095c6f commit debaec2
Show file tree
Hide file tree
Showing 11 changed files with 271 additions and 4 deletions.
1 change: 1 addition & 0 deletions all/irbrc
Expand Up @@ -2,6 +2,7 @@ require 'rubygems'
require 'wirble'
require 'soma'
require 'pp'
require 'ap'

Wirble.init
Wirble.colorize
Expand Down
33 changes: 33 additions & 0 deletions all/vim/bundle/vim-peepopen/README.md
@@ -0,0 +1,33 @@
vim-peepopen
=============

A plugin for the Vim text editor. PeepOpen provides fuzzy search of filenames and paths in a programming project.

Installation
------------

Get the PeepOpen.app and open it at least once to approve the Mac OS X security dialog.

Standard:

Copy `peepopen.vim` to your `~/.vim/plugin` directory.

With Tim Pope's [Pathogen](http://github.com/tpope/vim-pathogen):

Copy the entire `vim-peepopen` plugin directory to your `~/.vim/bundle` directory.

Usage
-----

`<Leader>p` opens the current project directory with the PeepOpen application.

Use the [vim-rooter](http://github.com/airblade/vim-rooter) plugin for automatic assignment of the current working directory for projects stored in Git.

(Leader is mapped to '\' by default)

Credits
-------

- Initial Vim Plugin by [Andrew Stewart](http://www.airbladesoftware.com/).
- Some plugin boilerplate from [Rein Henrichs](http://reinh.com/).

37 changes: 37 additions & 0 deletions all/vim/bundle/vim-peepopen/plugin/peepopen.vim
@@ -0,0 +1,37 @@
" plugin/peepopen.vim
" Author: Geoffrey Grosenbach <boss@topfunky.com>
" License: MIT License

" Install this file as plugin/peepopen.vim.

" ============================================================================

" Exit quickly when:
" - this plugin was already loaded (or disabled)
" - when 'compatible' is set
if &cp || exists("g:peepopen_loaded") && g:peepopen_loaded
finish
endif
let g:peepopen_loaded = 1

let s:save_cpo = &cpo
set cpo&vim

function s:LaunchPeepOpenViaVim()
let cwd = getcwd()
silent exe "!open -a PeepOpen " . shellescape(cwd)
endfunction

command! PeepOpen :call <SID>LaunchPeepOpenViaVim()

noremap <unique> <script> <Plug>PeepOpen <SID>Launch
noremap <SID>Launch :call <SID>LaunchPeepOpenViaVim()<CR>
if !hasmapto('<Plug>PeepOpen')
map <unique> <silent> <Leader>p <Plug>PeepOpen
endif

let &cpo = s:save_cpo
unlet s:save_cpo

" vim:set sw=2 sts=2:
1 change: 1 addition & 0 deletions all/vim/ftdetect/json.vim
@@ -0,0 +1 @@
au! BufRead,BufNewFile *.json setfiletype json
1 change: 1 addition & 0 deletions all/vim/ftdetect/markdown.vim
@@ -0,0 +1 @@
au BufNewFile,BufRead *.markdown,*.md,*.mdown,*.mkd,*.mkdn set filetype=mkd
3 changes: 3 additions & 0 deletions all/vim/ftdetect/ruby.vim
Expand Up @@ -15,3 +15,6 @@ au BufNewFile,BufRead .irbrc,irbrc set filetype=ruby

" eRuby
au BufNewFile,BufRead *.erb,*.rhtml set filetype=eruby

" Gemfile
au BufNewFile,BufRead Gemfile,Gemfile.lock set filetype=ruby
2 changes: 0 additions & 2 deletions all/vim/ftdetect/slurper.vim

This file was deleted.

77 changes: 77 additions & 0 deletions all/vim/syntax/json.vim
@@ -0,0 +1,77 @@
" Vim syntax file
" Language: JSON
" Maintainer: Jeroen Ruigrok van der Werven <asmodai@in-nomine.org>
" Last Change: 2009-06-16
" Version: 0.4
" {{{1

" Syntax setup {{{2
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded

if !exists("main_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
let main_syntax = 'json'
endif

" Syntax: Strings {{{2
syn region jsonString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=jsonEscape
" Syntax: JSON does not allow strings with single quotes, unlike JavaScript.
syn region jsonStringSQ start=+'+ skip=+\\\\\|\\"+ end=+'+

" Syntax: Escape sequences {{{3
syn match jsonEscape "\\["\\/bfnrt]" contained
syn match jsonEscape "\\u\x\{4}" contained

" Syntax: Strings should always be enclosed with quotes.
syn match jsonNoQuotes "\<\a\+\>"

" Syntax: Numbers {{{2
syn match jsonNumber "-\=\<\%(0\|[1-9]\d*\)\%(\.\d\+\)\=\%([eE][-+]\=\d\+\)\=\>"

" Syntax: An integer part of 0 followed by other digits is not allowed.
syn match jsonNumError "-\=\<0\d\.\d*\>"

" Syntax: Boolean {{{2
syn keyword jsonBoolean true false

" Syntax: Null {{{2
syn keyword jsonNull null

" Syntax: Braces {{{2
syn match jsonBraces "[{}\[\]]"

" Define the default highlighting. {{{1
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_json_syn_inits")
if version < 508
let did_json_syn_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args>
endif
HiLink jsonString String
HiLink jsonEscape Special
HiLink jsonNumber Number
HiLink jsonBraces Operator
HiLink jsonNull Function
HiLink jsonBoolean Boolean

HiLink jsonNumError Error
HiLink jsonStringSQ Error
HiLink jsonNoQuotes Error
delcommand HiLink
endif

let b:current_syntax = "json"
if main_syntax == 'json'
unlet main_syntax
endif

" Vim settings {{{2
" vim: ts=8 fdm=marker
104 changes: 104 additions & 0 deletions all/vim/syntax/mkd.vim
@@ -0,0 +1,104 @@
" Vim syntax file
" Language: Markdown
" Maintainer: Ben Williams <benw@plasticboy.com>
" URL: http://plasticboy.com/markdown-vim-mode/
" Version: 9
" Last Change: 2009 May 18
" Remark: Uses HTML syntax file
" Remark: I don't do anything with angle brackets (<>) because that would too easily
" easily conflict with HTML syntax
" TODO: Handle stuff contained within stuff (e.g. headings within blockquotes)


" Read the HTML syntax to start with
if version < 600
so <sfile>:p:h/html.vim
else
runtime! syntax/html.vim
unlet b:current_syntax
endif

if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif

" don't use standard HiLink, it will not work with included syntax files
if version < 508
command! -nargs=+ HtmlHiLink hi link <args>
else
command! -nargs=+ HtmlHiLink hi def link <args>
endif

syn spell toplevel
syn case ignore
syn sync linebreaks=1

"additions to HTML groups
syn region htmlBold start=/\\\@<!\(^\|\A\)\@=\*\@<!\*\*\*\@!/ end=/\\\@<!\*\@<!\*\*\*\@!\($\|\A\)\@=/ contains=@Spell,htmlItalic
syn region htmlItalic start=/\\\@<!\(^\|\A\)\@=\*\@<!\*\*\@!/ end=/\\\@<!\*\@<!\*\*\@!\($\|\A\)\@=/ contains=htmlBold,@Spell
syn region htmlBold start=/\\\@<!\(^\|\A\)\@=_\@<!___\@!/ end=/\\\@<!_\@<!___\@!\($\|\A\)\@=/ contains=htmlItalic,@Spell
syn region htmlItalic start=/\\\@<!\(^\|\A\)\@=_\@<!__\@!/ end=/\\\@<!_\@<!__\@!\($\|\A\)\@=/ contains=htmlBold,@Spell

" [link](URL) | [link][id] | [link][]
syn region mkdLink matchgroup=mkdDelimiter start="\!\?\[" end="\]\ze\s*[[(]" contains=@Spell nextgroup=mkdURL,mkdID skipwhite oneline
syn region mkdID matchgroup=mkdDelimiter start="\[" end="\]" contained
syn region mkdURL matchgroup=mkdDelimiter start="(" end=")" contained

" Link definitions: [id]: URL (Optional Title)
" TODO handle automatic links without colliding with htmlTag (<URL>)
syn region mkdLinkDef matchgroup=mkdDelimiter start="^ \{,3}\zs\[" end="]:" oneline nextgroup=mkdLinkDefTarget skipwhite
syn region mkdLinkDefTarget start="<\?\zs\S" excludenl end="\ze[>[:space:]\n]" contained nextgroup=mkdLinkTitle,mkdLinkDef skipwhite skipnl oneline
syn region mkdLinkTitle matchgroup=mkdDelimiter start=+"+ end=+"+ contained
syn region mkdLinkTitle matchgroup=mkdDelimiter start=+'+ end=+'+ contained
syn region mkdLinkTitle matchgroup=mkdDelimiter start=+(+ end=+)+ contained

"define Markdown groups
syn match mkdLineContinue ".$" contained
syn match mkdRule /^\s*\*\s\{0,1}\*\s\{0,1}\*$/
syn match mkdRule /^\s*-\s\{0,1}-\s\{0,1}-$/
syn match mkdRule /^\s*_\s\{0,1}_\s\{0,1}_$/
syn match mkdRule /^\s*-\{3,}$/
syn match mkdRule /^\s*\*\{3,5}$/
syn match mkdListItem "^\s*[-*+]\s\+"
syn match mkdListItem "^\s*\d\+\.\s\+"
syn match mkdCode /^\s*\n\(\(\s\{4,}[^ ]\|\t\+[^\t]\).*\n\)\+/
syn match mkdLineBreak / \+$/
syn region mkdCode start=/\\\@<!`/ end=/\\\@<!`/
syn region mkdCode start=/\s*``[^`]*/ end=/[^`]*``\s*/
syn region mkdBlockquote start=/^\s*>/ end=/$/ contains=mkdLineBreak,mkdLineContinue,@Spell
syn region mkdCode start="<pre[^>]*>" end="</pre>"
syn region mkdCode start="<code[^>]*>" end="</code>"

"HTML headings
syn region htmlH1 start="^\s*#" end="\($\|#\+\)" contains=@Spell
syn region htmlH2 start="^\s*##" end="\($\|#\+\)" contains=@Spell
syn region htmlH3 start="^\s*###" end="\($\|#\+\)" contains=@Spell
syn region htmlH4 start="^\s*####" end="\($\|#\+\)" contains=@Spell
syn region htmlH5 start="^\s*#####" end="\($\|#\+\)" contains=@Spell
syn region htmlH6 start="^\s*######" end="\($\|#\+\)" contains=@Spell
syn match htmlH1 /^.\+\n=\+$/ contains=@Spell
syn match htmlH2 /^.\+\n-\+$/ contains=@Spell

"highlighting for Markdown groups
HtmlHiLink mkdString String
HtmlHiLink mkdCode String
HtmlHiLink mkdBlockquote Comment
HtmlHiLink mkdLineContinue Comment
HtmlHiLink mkdListItem Identifier
HtmlHiLink mkdRule Identifier
HtmlHiLink mkdLineBreak Todo
HtmlHiLink mkdLink htmlLink
HtmlHiLink mkdURL htmlString
HtmlHiLink mkdID Identifier
HtmlHiLink mkdLinkDef mkdID
HtmlHiLink mkdLinkDefTarget mkdURL
HtmlHiLink mkdLinkTitle htmlString

HtmlHiLink mkdDelimiter Delimiter

let b:current_syntax = "mkd"

delcommand HtmlHiLink
" vim: ts=8
9 changes: 9 additions & 0 deletions all/vimrc
Expand Up @@ -165,6 +165,7 @@

" Set up highlight group & retain through colorscheme changes
highlight ExtraWhitespace ctermbg=red guibg=red
highlight ExtraLines ctermbg=red guibg=red
autocmd ColorScheme * highlight ExtraWhitespace ctermbg=red guibg=red

" Highlight too-long lines
Expand All @@ -177,3 +178,11 @@

" Add pathogen dependencies because mixed up stuff is mixed up
call pathogen#runtime_append_all_bundles()

nnoremap <Leader>ff :FuzzyFinderTextMateRefreshFiles<CR>:FuzzyFinderTextMate<CR>
nnoremap <Leader>rl :%s/^\n\+/\r/<CR>:nohls<CR>
" from thoughtbot, thanks, guys!
vmap D y'>p
autocmd BufRead *.markdown,*.md,*.mdown,*.mkd,*.mkdn set ai formatoptions=tcroqn2 comments=n:>
7 changes: 5 additions & 2 deletions all/zshrc
Expand Up @@ -52,7 +52,7 @@ function preexec {
title $cmd[1]:t "$cmd[2,-1]"
}

export PATH=~/bin:/opt/local/bin:/opt/local/sbin:/opt/local/libexec/git-core:/usr/local/mysql/bin:/usr/local/mongodb/bin:$PATH
export PATH=~/bin:~/.seeds/bin:/opt/local/bin:/opt/local/sbin:/opt/local/libexec/git-core:/usr/local/mysql/bin:/usr/local/mongodb/bin:$PATH

# ALIASES
alias ls='ls --color=auto'
Expand All @@ -62,6 +62,7 @@ alias ll='ls -l'
alias la='ls -A'
alias lla='ls -lA'
alias l='lla -CF'

alias g='git'
alias tu='tar zxvf'
alias less='less -r'
Expand All @@ -71,14 +72,16 @@ alias screens='ss screens -c ~/.screens'
alias visor='ss visor -c ~/.visor_screens'
alias inbox='cd ~/inbox'
alias node-repl="rlwrap node-repl"
define() { wn $* -over; }

#ruby
alias speco='spec -O spec/spec.opts'
alias gemi='sudo gem install --no-ri --no-rdoc'
alias r='rails'

#insider_pages aliases
alias ip='cd ~/projects/insider_pages/insiderpages'
alias ip_app='ssh -t adam@a'
alias ip_app='ssh -t adam@access.insiderpages.com'
alias ip_app1='ip_app ssh -t app1 sudo su - ip'
alias ip_app2='ip_app ssh -t app2 sudo su - ip'
alias ip_s='echo > log/development.log; script/server'
Expand Down

0 comments on commit debaec2

Please sign in to comment.