neovim

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

occam.vim (1583B)


      1 " Vim filetype plugin file
      2 " Language:	occam
      3 " Copyright:	Christian Jacobsen <clj3@kent.ac.uk>, Mario Schweigler <ms44@kent.ac.uk>
      4 " Maintainer:	Mario Schweigler <ms44@kent.ac.uk>
      5 " Last Change:	23 April 2003
      6 " 2024 Jan 14 by Vim Project (browsefilter)
      7 " 2025 Jun 08 by Riley Bruins <ribru17@gmail.com> ('commentstring')
      8 
      9 " Only do this when not done yet for this buffer
     10 if exists("b:did_ftplugin")
     11  finish
     12 endif
     13 let b:did_ftplugin = 1
     14 let s:keepcpo= &cpo
     15 set cpo&vim
     16 
     17 "{{{  Indent settings
     18 " Set shift width for indent
     19 setlocal shiftwidth=2
     20 " Set the tab key size to two spaces
     21 setlocal softtabstop=2
     22 " Let tab keys always be expanded to spaces
     23 setlocal expandtab
     24 "}}}
     25 
     26 "{{{  Formatting
     27 " Break comment lines and insert comment leader in this case
     28 setlocal formatoptions-=t formatoptions+=cql
     29 setlocal comments+=:--
     30 setlocal commentstring=--\ %s
     31 " Maximum length of comments is 78
     32 setlocal textwidth=78
     33 "}}}
     34 
     35 "{{{  File browsing filters
     36 " Win32 and GTK can filter files in the browse dialog
     37 if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
     38  let b:browsefilter = "All Occam Files (*.occ, *.inc)\t*.occ;*.inc\n" .
     39 \ "Occam Include Files (*.inc)\t*.inc\n" .
     40 \ "Occam Source Files (*.occ)\t*.occ\n"
     41  if has("win32")
     42    let b:browsefilter .= "All Files (*.*)\t*\n"
     43  else
     44    let b:browsefilter .= "All Files (*)\t*\n"
     45  endif
     46 endif
     47 "}}}
     48 
     49 "{{{  Undo settings
     50 let b:undo_ftplugin = "setlocal shiftwidth< softtabstop< expandtab<"
     51 \ . " formatoptions< comments< commentstring< textwidth<"
     52 \ . "| unlet! b:browsefilter"
     53 "}}}
     54 
     55 let &cpo = s:keepcpo
     56 unlet s:keepcpo