Guest User

Untitled

a guest
Dec 17th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. function Foo()
  2. let pat = '$(.{-})$'
  3. if line =~ pat
  4. execute 's/' . pat . '/\(1\)/'
  5. call cursor('.', matchend(getline('.'), '\)'))
  6. endif
  7. endfunction
  8.  
  9. inoremap $ $<C-O>:call Foo()<CR>
Add Comment
Please, Sign In to add comment