Skip to content

Instantly share code, notes, and snippets.

@abronte
Created June 13, 2012 03:14
Show Gist options
  • Select an option

  • Save abronte/2921591 to your computer and use it in GitHub Desktop.

Select an option

Save abronte/2921591 to your computer and use it in GitHub Desktop.
filetype on
augroup vimrc_filetype
autocmd!
autocmd FileType ruby call s:RubyCommenter()
autocmd FileType vim call s:VimCommenter()
augroup end
map _ :s/^\/\/\\|^--\\|^> \\|^[#"%!;]//<CR>:nohlsearch<CR>
function! s:VimCommenter()
map - :s/^/\"/<CR>:nohlsearch<CR>
endfunction
function! s:RubyCommenter()
map - :s/^/#/<CR>:nohlsearch<CR>
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment