neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

kotlin.vim (1071B)


      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 
      8 if exists('b:did_ftplugin') | finish | endif
      9 let b:did_ftplugin = 1
     10 
     11 let s:save_cpo = &cpo
     12 set cpo&vim
     13 
     14 setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
     15 setlocal commentstring=//\ %s
     16 
     17 setlocal formatoptions-=t formatoptions+=croqnl
     18 silent! setlocal formatoptions+=j
     19 
     20 setlocal includeexpr=substitute(v:fname,'\\.','/','g')
     21 setlocal suffixesadd=.kt
     22 
     23 let b:undo_ftplugin = "setlocal comments< commentstring< ".
     24    \ "formatoptions< includeexpr< suffixesadd<"
     25 
     26 if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
     27  let b:browsefilter = "Kotlin Source Files (*.kt, *kts)\t*.kt;*.kts\n"
     28  if has("win32")
     29      let b:browsefilter .= "All Files (*.*)\t*\n"
     30  else
     31      let b:browsefilter .= "All Files (*)\t*\n"
     32  endif
     33  let b:undo_ftplugin .= " | unlet! b:browsefilter"
     34 endif
     35 
     36 let &cpo = s:save_cpo
     37 unlet s:save_cpo