Skip to content

Instantly share code, notes, and snippets.

@scrooloose
scrooloose / tagsearch.vim
Created October 10, 2009 02:03
add a :Tsearch command to open a :cwindow like list of matching tags
command -nargs=1 -complete=tag Tsearch call <SID>Tsearch(<f-args>)
"search for tags using the given search string, list them in a new window,
"user can hit enter on a tag to jump to it
function! s:Tsearch(str)
botright 10 new
let b:taglist = taglist(a:str)
for i in range(0, len(b:taglist)-1)
let next = b:taglist[i]
"Originally -> http://gist.github.com/206863
"YAY gist forking is broken!
" Requires: Utl
if !exists("loaded_utl")
finish
endif
call NERDTreeAddKeyMap({
\ 'key': 'gu',
"this is in my ~/.vim/projects/rogue.vim
"in my vimrc i have a :runtime! projects/**/*.vim to source all my project files
"assumes each model class is in ./lib/foo.rb and the related
"spec (i.e. test) file is in ./spec/foo_spec.rb
autocmd bufnewfile,bufreadpost ~/projects/rogue/* call s:setup()
function! s:setup()
command! -nargs=0 -buffer A call s:gotoAltFile('edit')
command! -nargs=0 -buffer AS call s:gotoAltFile('split')
@scrooloose
scrooloose / irbrc_hax0r.rb
Created October 19, 2009 22:20
make Foo.methods more awesome
require 'rubygems'
require 'looksee/shortcuts'
module Kernel
alias_method :orig_methods, :methods
def methods(*args)
if caller.first =~ /\(irb\):\d+:in `irb_binding'/
lp(self, *args)
else
orig_methods
nmap <silent> <leader>x,
\ :%s/\(\(^\([^"']*\(["'][^"']*["']\)\)*[^"']*\)\@<=\)\+,\ze\S/& /gc<cr>
setlocal nolist
setlocal wrap
setlocal lbr
div.something
min-height: 500px
height: auto !important
height: 500px
/* the sass file */
/*===============*/
=ultimate-hippie-border(!thickness)
border-top = !thickness "dotted" "magenta"
border-left = !thickness "solid" "orange"
border-right = !thickness "dashed" "green"
border-bottom = !thickness "groove" "blue"
background-color: cyan
#hacks for 256 colors
attrcolor b ".I"
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
defbce "on"
//IE6 doesnt support min-(height|width), but these 2 hacks
//effectively implement them.
//Details: www.dustindiaz.com/min-height-fast-hack
=min_height_hack(!height)
min-height = !height
height: auto !important
height = !height
=min_width_hack(!width)
min-width = !width