neovim

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

README.txt (1734B)


      1 This directory contains files to automatically compute the indent for a
      2 type of file.
      3 
      4 If you want to add your own indent file for your personal use, read the docs
      5 at ":help indent-expression".  Looking at the existing files should give you
      6 inspiration.
      7 
      8 If you make a new indent file which would be useful for others, please send it
      9 to the vim-dev mailing list <vim-dev@vim.org>.  Include instructions for
     10 detecting the file type for this language, by file name extension or by
     11 checking a few lines in the file. And please stick to the rules below.
     12 
     13 If you have remarks about an existing file, send them to the maintainer of
     14 that file.  Only when you get no response send a message to the vim-dev
     15 mailing list: <vim-dev@vim.org>.
     16 
     17 If you are the maintainer of an indent file and make improvements, e-mail the
     18 new version to the vim-dev mailing list: <vim-dev@vim.org>.
     19 
     20 
     21 Rules for making an indent file:
     22 
     23 You should use this check for "b:did_indent":
     24 
     25 " Only load this indent file when no other was loaded yet.
     26 if exists("b:did_indent")
     27   finish
     28 endif
     29 let b:did_indent = 1
     30 
     31 Always use ":setlocal" to set 'indentexpr'.  This avoids it being carried over
     32 to other buffers.
     33 
     34 To trigger the indenting after typing a word like "endif", add the word to the
     35 'indentkeys' option with "+=".
     36 
     37 You normally set 'indentexpr' to evaluate a function and then define that
     38 function.  That function only needs to be defined once for as long as Vim is
     39 running.  Add a test if the function exists and use ":finish", like this:
     40 if exists("*GetMyIndent")
     41   finish
     42 endif
     43 
     44 The user may have several options set unlike you, try to write the file such
     45 that it works with any option settings.  Also be aware of certain features not
     46 being compiled in.