Skip to content

Instantly share code, notes, and snippets.

Avatar

Martin Grenfell scrooloose

View GitHub Profile
View override_tab_mapping.vim
call NERDTreeAddKeyMap({'key': 't', 'callback': 'NERDTreeMyOpenInTab', 'scope': 'FileNode', 'override': 1 })
function NERDTreeMyOpenInTab(node)
call a:node.open({'reuse': "all", 'where': 't'})
endfunction
View gitignore_filter.vim
"Chuck this in [a vim runtime]/nerdtree_plugin/gitignore_filter.vim
if exists("loaded_nerdtree_gitignore_filter")
finish
endif
let loaded_nerdtree_gitignore_filter = 1
call NERDTreeAddPathFilter('NERDTreeGitIgnoreFilter')
View foo.vim
"put this in your vimrc
"note: I'll probably add :NERDTreeSecondary after work tonight
autocmd vimenter * call s:CheckToSplitTwoTrees()
function! s:CheckToSplitTwoTrees()
if argc() != 1 || !isdirectory(argv(0))
return
endif
vsplit
View svnhacks.sh
#Author: Martin Grenfell [http://github.com/scrooloose]
#License:
#
# This program is free software. It comes without any warranty, to
# the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want
# To Public License, Version 2, as published by Sam Hocevar. See
# http://sam.zoy.org/wtfpl/COPYING for more details.
#
#This script hijacks calls to svn and adds color and pagination to
View foo.js
setInterval(
function() {
$.get('/admin/purchases', function(data) {
$('body').html(data);
});
},
10000
);
View epic_hacks.vim
"stick this shit in a markdown ftplugin
"
"Usage:
"
"Open a markdown file.
"Use the :MdLive command.
"Save the file and it will update
command MdLive call s:InitMarkdownHacks()
autocmd bufwritepost <buffer> call s:CheckToBuildMd()
View notes.md

sudo apt-get install build-essential ruby-dev libxml++2.6-dev libsqlite3-dev nodejs sudo gem install rails cd /tmp rails new test cd test rails server

now go to http://localhost:3000 in your browser, you should see a welcome page.

View projects.vim
" Usage:
"
" Create a project from the current nerdtree with
" :NERDTreeProjectSave <name>
"
" Load a project with
" :NERDTreeProjectLoad <name>
"
" Delete a project with
" :NERDTreeProjectRm <name>
@scrooloose
scrooloose / hax0r.vim
Created Jan 10, 2012 — forked from asgeo1/hax0r.vim
NERDTree custom mappings to make i and s reuse existing windows
View hax0r.vim
let g:NERDTreeCustomReuseWindows = '1'
call NERDTreeAddKeyMap({
\ 'key': 'w',
\ 'scope': 'all',
\ 'callback': 'NERDTreeCustomToggleReuse',
\ 'quickhelpText': 'Toggle use existing windows' })
function! NERDTreeCustomToggleReuse()
let g:NERDTreeCustomReuseWindows = g:NERDTreeCustomReuseWindows ? 0 : 1
View visual-search-mappings.vim
"visual search mappings
function! s:VSetSearch()
let temp = @@
norm! gvy
let @/ = '\V' . substitute(escape(@@, '\'), '\n', '\\n', 'g')
let @@ = temp
endfunction
vnoremap * :<C-u>call <SID>VSetSearch()<CR>//<CR>
vnoremap # :<C-u>call <SID>VSetSearch()<CR>??<CR>
You can’t perform that action at this time.