Permalink
Browse files

decouple with ruby because vim is not default compiled with +ruby in …

…many dist
  • Loading branch information...
anferneeg
anferneeg committed May 18, 2011
1 parent 6751e86 commit 8db44563bdb9ea74e425e5d7af2604f04adf0b20
Showing with 7 additions and 5 deletions.
  1. +7 −5 ftplugin/task.vim
View
@@ -9,11 +9,13 @@ set cpo&vim
function! Toggle_task_status()
ruby << EOS
line = VIM::Buffer.current.line
line = line.gsub(/^(\s*)([-✓])/u) { $1 + ( $2 == '-' ? '' : '-' ) }
VIM::Buffer.current.line = line
EOS
let line = getline('.')
if match(line, '^\(\s*\)-') == 0
let line = substitute(line, '^\(\s*\)-', '\1✓', '')
else
let line = substitute(line, '^\(\s*\)✓', '\1-', '')
endif
call setline('.', line)
endfunction
inoremap <silent> <buffer> <C-D-CR> <ESC>:call Toggle_task_status()<CR>i

0 comments on commit 8db4456

Please sign in to comment.