1. Yuki KODAMA
  2. dotfiles

Commits

Yuki KODAMA  committed 4dd2b18

vim: add smartchr for Java

  • Participants
  • Parent commits 8c9688f
  • Branches p183

Comments (0)

Files changed (1)

File vimfiles/after/ftplugin/java.vim

View file
+setlocal autoindent
+
+inoremap <buffer><expr> = smartchr#one_of(' = ', ' == ', '=')
+inoremap <buffer><expr> <LT> smartchr#one_of(' < ', ' << ', ' <= ', '<')
+inoremap <buffer><expr> > smartchr#one_of(' > ', ' >> ', ' >= ', '>')
+inoremap <buffer><expr> & smartchr#one_of(' && ', ' & ', '&')
+inoremap <buffer><expr> <BAR> smartchr#one_of(' <BAR><BAR> ', ' <BAR> ', '<BAR>')
+inoremap <buffer><expr> + smartchr#one_of(' + ', ' += ', '++', '+')
+inoremap <buffer><expr> - smartchr#one_of('-', ' - ', ' -= ', '--', '-')
+inoremap <buffer><expr> ! smartchr#one_of('!', ' != ', '!')
+
+if !exists('b:undo_ftplugin')
+  let b:undo_ftplugin = ''
+endif
+let b:undo_ftplugin .= '
+\ | execute "iunmap <buffer><expr> <LT>"
+\ | execute "iunmap <buffer><expr> >"
+\ | execute "iunmap <buffer><expr> &"
+\ | execute "iunmap <buffer><expr> <BAR>"
+\ | execute "iunmap <buffer><expr> +"
+\ | execute "iunmap <buffer><expr> -"
+\ | execute "iunmap <buffer><expr> !"
+\ | setlocal autoindent<
+\'