kotlin.vim 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. " Vim filetype plugin file
  2. " Language: Kotlin
  3. " Maintainer: Alexander Udalov
  4. " URL: https://github.com/udalov/kotlin-vim
  5. " Last Change: 7 November 2021
  6. " 2024 Jan 14 by Vim Project (browsefilter)
  7. if exists('b:did_ftplugin') | finish | endif
  8. let b:did_ftplugin = 1
  9. let s:save_cpo = &cpo
  10. set cpo&vim
  11. setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
  12. setlocal commentstring=//\ %s
  13. setlocal formatoptions-=t formatoptions+=croqnl
  14. silent! setlocal formatoptions+=j
  15. setlocal includeexpr=substitute(v:fname,'\\.','/','g')
  16. setlocal suffixesadd=.kt
  17. let b:undo_ftplugin = "setlocal comments< commentstring< ".
  18. \ "formatoptions< includeexpr< suffixesadd<"
  19. if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
  20. let b:browsefilter = "Kotlin Source Files (*.kt, *kts)\t*.kt;*.kts\n"
  21. if has("win32")
  22. let b:browsefilter .= "All Files (*.*)\t*\n"
  23. else
  24. let b:browsefilter .= "All Files (*)\t*\n"
  25. endif
  26. let b:undo_ftplugin .= " | unlet! b:browsefilter"
  27. endif
  28. let &cpo = s:save_cpo
  29. unlet s:save_cpo