Skip to content

Commit

Permalink
Including haml, sass, specky plugins; Also adding updated indent files
Browse files Browse the repository at this point in the history
  • Loading branch information
benrady committed Dec 2, 2009
1 parent c66586a commit 9c94bde
Show file tree
Hide file tree
Showing 6 changed files with 295 additions and 122 deletions.
22 changes: 16 additions & 6 deletions .vimrc
Expand Up @@ -11,6 +11,7 @@ set lazyredraw

" completion on the command line
set wildmenu
set wildmode=list:longest

" numbered lines
set number
Expand All @@ -21,22 +22,31 @@ set wrap
" no beeps
set vb

" central backup directories
set backupdir=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
set directory=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp

" no goofy buttons
set guioptions=ac

let mapleader = ","

" Better buffer management, horrible setting name
" set hidden

set tabstop=2
set history=1000
set sts=2
set smarttab
set shiftwidth=2
set autoindent
set expandtab
set backspace=start,indent

set backspace=start,eol,indent
set incsearch
set autoread
set autowrite

" With these options together, we only use case sensitive search when there is a captial letter in the search term
set ignorecase
set smartcase

" Add macports path to path
set path+=/opt/local/bin
Expand All @@ -47,8 +57,9 @@ set statusline=%F%m%r%h%w\ [Line=%03l,Col=%03v][%p%%]\ [ASCII=\%03.3b]\ [Format=
set laststatus=2

let g:fuzzy_ignore = "*.log"
let g:fuzzy_matching_limit = 70
let g:fuzzy_matching_limit = 7000
let g:fuzzy_ceiling = 100000
let g:speckyRunRdocKey = "<leader>r"

map <leader>t :FuzzyFinderTextMate<CR>
map <leader>b :FuzzyFinderBuffer<CR>
Expand Down Expand Up @@ -105,4 +116,3 @@ noremap <silent> ,mj <C-W>J
" Remap omni-completion to CTRL+Space
nmap <C-space> ea<C-n>
imap <C-space> <C-n>
57 changes: 57 additions & 0 deletions doc/tags
Expand Up @@ -17,6 +17,13 @@
'NERDTreeWinPos' NERD_tree.txt /*'NERDTreeWinPos'*
'NERDTreeWinSize' NERD_tree.txt /*'NERDTreeWinSize'*
'loaded_nerd_tree' NERD_tree.txt /*'loaded_nerd_tree'*
'snippets' snipMate.txt /*'snippets'*
.snippet snipMate.txt /*.snippet*
.snippets snipMate.txt /*.snippets*
:Ack ack.txt /*:Ack*
:AckAdd ack.txt /*:AckAdd*
:LAck ack.txt /*:LAck*
:LAckAdd ack.txt /*:LAckAdd*
:NERDTree NERD_tree.txt /*:NERDTree*
:NERDTreeClose NERD_tree.txt /*:NERDTreeClose*
:NERDTreeFromBookmark NERD_tree.txt /*:NERDTreeFromBookmark*
Expand All @@ -29,6 +36,9 @@ EvalFile clojure.txt /*EvalFile*
EvalLine clojure.txt /*EvalLine*
EvalParagraph clojure.txt /*EvalParagraph*
EvalToplevel clojure.txt /*EvalToplevel*
ExtractSnips() snipMate.txt /*ExtractSnips()*
ExtractSnipsFile() snipMate.txt /*ExtractSnipsFile()*
Filename() snipMate.txt /*Filename()*
FindDoc clojure.txt /*FindDoc*
GotoSourceInteractive clojure.txt /*GotoSourceInteractive*
GotoSourceWord clojure.txt /*GotoSourceWord*
Expand Down Expand Up @@ -89,9 +99,20 @@ NERDTreeOptions NERD_tree.txt /*NERDTreeOptions*
NERD_tree.txt NERD_tree.txt /*NERD_tree.txt*
RequireFile clojure.txt /*RequireFile*
RequireFileAll clojure.txt /*RequireFileAll*
ResetSnippets() snipMate.txt /*ResetSnippets()*
SourceLookupInteractive clojure.txt /*SourceLookupInteractive*
SourceLookupWord clojure.txt /*SourceLookupWord*
SpeckyAuthor specky.txt /*SpeckyAuthor*
SpeckyContents specky.txt /*SpeckyContents*
SpeckyFunctionality specky.txt /*SpeckyFunctionality*
SpeckyIntro specky.txt /*SpeckyIntro*
SpeckyLicense specky.txt /*SpeckyLicense*
SpeckyOptions specky.txt /*SpeckyOptions*
SpeckyVimrcExample specky.txt /*SpeckyVimrcExample*
StartRepl clojure.txt /*StartRepl*
ack ack.txt /*ack*
ack-author ack.txt /*ack-author*
ack.txt ack.txt /*ack.txt*
clj-nailgun-server clojure.txt /*clj-nailgun-server*
clojure.vim clojure.txt /*clojure.vim*
config/rails.vim rails.txt /*config\/rails.vim*
Expand All @@ -118,16 +139,29 @@ g:rails_subversion rails.txt /*g:rails_subversion*
g:rails_syntax rails.txt /*g:rails_syntax*
g:rails_tabstop rails.txt /*g:rails_tabstop*
g:rails_url rails.txt /*g:rails_url*
g:snippets_dir snipMate.txt /*g:snippets_dir*
g:snips_author snipMate.txt /*g:snips_author*
g:speckyBannerKey specky.txt /*g:speckyBannerKey*
g:speckyQuoteSwitcherKey specky.txt /*g:speckyQuoteSwitcherKey*
g:speckyRunRdocCmd specky.txt /*g:speckyRunRdocCmd*
g:speckyRunRdocKey specky.txt /*g:speckyRunRdocKey*
g:speckyRunSpecCmd specky.txt /*g:speckyRunSpecCmd*
g:speckyRunSpecKey specky.txt /*g:speckyRunSpecKey*
g:speckySpecSwitcherKey specky.txt /*g:speckySpecSwitcherKey*
g:speckyWindowType specky.txt /*g:speckyWindowType*
gi clojure.txt /*gi*
gw clojure.txt /*gw*
i_CTRL-R_<Tab> snipMate.txt /*i_CTRL-R_<Tab>*
ji clojure.txt /*ji*
jw clojure.txt /*jw*
li clojure.txt /*li*
list-snippets snipMate.txt /*list-snippets*
lw clojure.txt /*lw*
m1 clojure.txt /*m1*
macros/rails.vim rails.txt /*macros\/rails.vim*
me clojure.txt /*me*
mi clojure.txt /*mi*
multi_snip snipMate.txt /*multi_snip*
mw clojure.txt /*mw*
rF clojure.txt /*rF*
rails rails.txt /*rails*
Expand Down Expand Up @@ -270,6 +304,29 @@ rails-vim-integration rails.txt /*rails-vim-integration*
rails.txt rails.txt /*rails.txt*
rf clojure.txt /*rf*
si clojure.txt /*si*
snipMate snipMate.txt /*snipMate*
snipMate-$# snipMate.txt /*snipMate-$#*
snipMate-${#:} snipMate.txt /*snipMate-${#:}*
snipMate-${#} snipMate.txt /*snipMate-${#}*
snipMate-author snipMate.txt /*snipMate-author*
snipMate-commands snipMate.txt /*snipMate-commands*
snipMate-contact snipMate.txt /*snipMate-contact*
snipMate-description snipMate.txt /*snipMate-description*
snipMate-disadvantages snipMate.txt /*snipMate-disadvantages*
snipMate-expandtab snipMate.txt /*snipMate-expandtab*
snipMate-features snipMate.txt /*snipMate-features*
snipMate-filename snipMate.txt /*snipMate-filename*
snipMate-indenting snipMate.txt /*snipMate-indenting*
snipMate-placeholders snipMate.txt /*snipMate-placeholders*
snipMate-remap snipMate.txt /*snipMate-remap*
snipMate-settings snipMate.txt /*snipMate-settings*
snipMate-usage snipMate.txt /*snipMate-usage*
snipMate.txt snipMate.txt /*snipMate.txt*
snippet snipMate.txt /*snippet*
snippet-syntax snipMate.txt /*snippet-syntax*
snippets snipMate.txt /*snippets*
specky specky.txt /*specky*
specky.txt specky.txt /*specky.txt*
sr clojure.txt /*sr*
sw clojure.txt /*sw*
vimclojure.txt clojure.txt /*vimclojure.txt*
69 changes: 36 additions & 33 deletions indent/clojure.vim
Expand Up @@ -24,11 +24,17 @@ setlocal indentkeys=!,o,O
if exists("*searchpairpos")

function! s:MatchPairs(open, close, stopat)
" Stop only on vector and map [ resp. {. Ignore the ones in strings and
" comments.
return searchpairpos(a:open, '', a:close, 'bWn',
let closure = { 'open': a:open, 'close': a:close, 'stopat': a:stopat }

function closure.f() dict
" Stop only on vector and map [ resp. {. Ignore the ones in strings and
" comments.
return searchpairpos(self.open, '', self.close, 'bW',
\ 'vimclojure#SynIdName() !~ "clojureParen\\d"',
\ a:stopat)
\ self.stopat)
endfunction

return vimclojure#WithSavedPosition(closure)
endfunction

function! VimClojureCheckForStringWorker()
Expand All @@ -55,7 +61,7 @@ function! VimClojureCheckForStringWorker()
if vimclojure#SynIdName() != "clojureString"
return -1
endif
if vimclojure#Yank('l', 'normal! "lyl') != '\\'
if vimclojure#Yank('l', 'normal "lyl') != '\\'
return -1
endif
call cursor(0, col("$") - 1)
Expand All @@ -74,19 +80,7 @@ function! VimClojureCheckForString()
return vimclojure#WithSavedPosition({'f': function("VimClojureCheckForStringWorker")})
endfunction

function! GetClojureIndent()
" Get rid of special case.
if line(".") == 1
return 0
endif

" We have to apply some heuristics here to figure out, whether to use
" normal lisp indenting or not.
let i = VimClojureCheckForString()
if i > -1
return i
endif

function! GetClojureIndentWorker()
call cursor(0, 1)

" Find the next enclosing [ or {. We can limit the second search
Expand Down Expand Up @@ -135,13 +129,10 @@ function! GetClojureIndent()
endif

" In case after the paren is a whitespace, we search for the next word.
normal! l
let reg = getreg("l")
normal! "lyl
if getreg("l") == ' '
normal! w
normal l
if vimclojure#Yank('l', 'normal "lyl') == ' '
normal w
endif
call setreg("l", reg)

" If we moved to another line, there is no word after the (. We
" use the ( position for indent.
Expand All @@ -151,10 +142,7 @@ function! GetClojureIndent()

" We still have to check, whether the keyword starts with a (, [ or {.
" In that case we use the ( position for indent.
let reg = getreg("l")
normal! "lye
let w = getreg("l")
call setreg("l", reg)
let w = vimclojure#Yank('l', 'normal "lye')
if stridx('([{', w[0]) > 0
return paren[1]
endif
Expand All @@ -163,15 +151,31 @@ function! GetClojureIndent()
return paren[1] + &shiftwidth - 1
endif

normal! w
normal w
if paren[0] < line(".")
return paren[1] + &shiftwidth - 1
endif

normal! ge
normal ge
return col(".") + 1
endfunction

function! GetClojureIndent()
" Get rid of special case.
if line(".") == 1
return 0
endif

" We have to apply some heuristics here to figure out, whether to use
" normal lisp indenting or not.
let i = VimClojureCheckForString()
if i > -1
return i
endif

return vimclojure#WithSavedPosition({'f': function("GetClojureIndentWorker")})
endfunction

setlocal indentexpr=GetClojureIndent()

else
Expand All @@ -185,9 +189,8 @@ else
endif

" Defintions:
setlocal lispwords=def,def-,defn,defn-,defmacro,defmacro-,defmethod,defmulti
setlocal lispwords+=defonce,defvar,defvar-,defunbound,let,fn,letfn,binding,proxy
setlocal lispwords+=defnk
setlocal lispwords=def,def-,defn,defn-,defmacro,defmacro-,defmethod,defmethod
setlocal lispwords+=defonce,defvar,defvar-,defunbound,let,fn,binding,proxy

" Conditionals and Loops:
setlocal lispwords+=if,if-not,if-let,when,when-not,when-let,when-first
Expand Down
10 changes: 10 additions & 0 deletions snippets/html.snippets
Expand Up @@ -188,3 +188,13 @@ snippet table
</table>${4}
snippet textarea
<textarea name="${1:Name}" rows="${2:8}" cols="${3:40}">${4}</textarea>${5}
snippet ul
<ul>
<li>${1:content}</li>
</ul>
snippet ol
<ol>
<li>${1:content}<`Close()`>
</ol>
snippet span
<span class="${1:classname}">${2:content}</span>
71 changes: 71 additions & 0 deletions snippets/ruby-rails_controller.snippets
Expand Up @@ -8,4 +8,75 @@ snippet wants
wants.${1:js|json|xml|html}${2}
snippet flash
flash[:${1:notice}] = "${2}"
snippet rest
def index
@${1:things} = ${2:Thing}.find :all

respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @$1 }
end
end

def show
@${3:thing} = $2.find(params[:id])

respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @$3 }
end
end

def new
@$3 = $2.new

respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @$3 }
end
end

def edit
@$3 = $2.find(params[:id])
end

def create
@$3 = $2.new(params[:$3])

respond_to do |format|
if @$3.save
flash[:notice] = '$2 was successfully created.'
format.html { redirect_to(@$3) }
format.xml { render :xml => @$3, :status => :created, :location => @$3 }
else
format.html { render :action => "new" }
format.xml { render :xml => @$3.errors, :status => :unprocessable_entity }
end
end
end

def update
@$3 = $2.find(params[:id])

respond_to do |format|
if @$3.update_attributes(params[:$3])
flash[:notice] = '$2 was successfully updated.'
format.html { redirect_to(@$3) }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @$3.errors, :status => :unprocessable_entity }
end
end
end

def destroy
@$3 = $2.find(params[:id])
@$3.destroy

respond_to do |format|
format.html { redirect_to(admin_$1_url) }
format.xml { head :ok }
end
end

0 comments on commit 9c94bde

Please sign in to comment.