Skip to content

Instantly share code, notes, and snippets.

@soh335
Created April 25, 2009 10:59
Show Gist options
  • Save soh335/101582 to your computer and use it in GitHub Desktop.
Save soh335/101582 to your computer and use it in GitHub Desktop.
"{{{
"bsd style brace
function! BSDStyleBrace()
let l:num = 0
while l:num <= line('$')
let l:line = getline(l:num)
let l:t = matchstr(l:line, "\s*{\s*")
if l:t != ""
silent execute ':'.l:num
silent execute 'delete'
call setline(l:num-1, getline(l:num-1)."{")
endif
let l:num = l:num + 1
endwhile
endfunction
command! -nargs=0 BSDStyleBrace :call BSDStyleBrace()
"}}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment