Skip to content

Instantly share code, notes, and snippets.

@dahu
Created January 30, 2014 09:04
Show Gist options
  • Save dahu/8704952 to your computer and use it in GitHub Desktop.
Save dahu/8704952 to your computer and use it in GitHub Desktop.
Embelish a line with a thing when you move to it
function! Embelish(thing)
let line = line('.')
let l = getline(line)
if l !~ a:thing . '\s*$'
let l = l . a:thing
endif
call setline(line, [l])
endfunction
autocmd CursorMoved * call Embelish(';')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment