Skip to content

Instantly share code, notes, and snippets.

@jchros
Created July 30, 2023 07:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jchros/e093425cbc728ef350c218f45e3c6de7 to your computer and use it in GitHub Desktop.
Save jchros/e093425cbc728ef350c218f45e3c6de7 to your computer and use it in GitHub Desktop.
inoreabbrev <buffer> <expr> += '= ' .. getline('.')->matchstr('\c\(assign\s*\)\?\zs\S.*\ze+=') .. '+'
inoreabbrev <buffer> <expr> *= '= ' .. getline('.')->matchstr('\c\(assign\s*\)\?\zs\S.*\ze\*=') .. '*'
inoreabbrev <buffer> <expr> -= '= ' .. getline('.')->matchstr('\c\(assign\s*\)\?\zs\S.*\ze-=') .. '-'
inoreabbrev <buffer> <expr> /= '= ' .. getline('.')->matchstr('\c\(assign\s*\)\?\zs\S.*\ze/=') .. '/'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment