Skip to content

Instantly share code, notes, and snippets.

@smujohnson
Created November 12, 2013 21:27
Show Gist options
  • Select an option

  • Save smujohnson/7439069 to your computer and use it in GitHub Desktop.

Select an option

Save smujohnson/7439069 to your computer and use it in GitHub Desktop.
" version 1.0... works fine, been using it for the last 4 years
map <leader>z oLogger::log(print_r($<Esc>mta, 1), "/tmp/tmpfs/mikey-log");<Esc>`ta
" version 2.0..not so much...
map <leader>z :call InsertLoggerStatement(b:current_syntax)<Cr>
function InsertLoggerStatement (syn)
if a:syn == "php"
normal oLogger::log(print_r($
normal <Esc>
normal mta, 1), "/tmp/tmpfs/mikey-log");
normal <Esc>
normal `ta
elseif a:syn == "perl"
" <ignore this for now...>
endif
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment