Skip to content

Instantly share code, notes, and snippets.

@jchros
Created July 30, 2023 07:53
Show Gist options
  • Select an option

  • Save jchros/e093425cbc728ef350c218f45e3c6de7 to your computer and use it in GitHub Desktop.

Select an option

Save jchros/e093425cbc728ef350c218f45e3c6de7 to your computer and use it in GitHub Desktop.

Revisions

  1. jchros created this gist Jul 30, 2023.
    4 changes: 4 additions & 0 deletions expand_augmented_assignments.vim
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    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/=') .. '/'