sponsor Vim development Vim logo Vim Book Ad

csindent.vim : Indent file per project

 script karma  Rating 18/9, Downloaded by 5131  Comments, bugs, improvements  Vim wiki

created by
Konstantin Lepa
 
script type
indent
 
description
How to use the plug-in:
1. Create `~/.vim_csindent.ini' (default value of `g:csindent_ini') with
   format:
       '[' <FILETYPE_NAME> [':' <DEFAULT_INDENT_NAME> ] ']'
       <INDENT_NAME> '=' <PATH>

   <INDENT_NAME> is common indent file without '.vim' suffix.
   <PATH> is your path of project.

   If exists <DEFAULT_INDENT_NAME>, then <DEFAULT_INDENT_NAME>.vim file is
   default indent file for this filetype.

   For example:
       [cpp:shetukhin]
       google = $HOME/work/pyctpp2

       [c]
       linux = $HOME/work/kernels/
       gnu = $HOME/work/hurd

2. Create `~/.vim/csindent/<FILETYPE_NAME>/<INDENT_NAME>.vim'
   (instead of `~/.vim/csindent` you can use any path from 'runtimepath').
   For example:
        ~/.vim/csindent/cpp/shetukhin.vim
        ~/.vim/csindent/cpp/google.vim
        ~/.vim/csindent/c/linux.vim
        ~/.vim/csindent/c/gnu.vim

Note 1: This script is compatible with `filetype indent`.
        See `:help filetype`.

Note 2: You can use more informative status line using CodingStyleIndent().
        For example:
            set statusline=%<%f%h%m%r%=style=%{CodingStyleIndent()}
            \ %15(L%l,C%c%V%)\ %3P
 
install details
Move csindent.vim to '~/.vim/plugin`.
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
csindent.vim 1.2.0 2011-02-01 7.0 Konstantin Lepa Added support of Windows.
Removed g:csindent_dir. Used 'runtimepath' instead it.
Added support of expanding environment variables in g:csindent_ini.
csindent.vim 1.1.2 2011-01-17 7.0 Konstantin Lepa Fixed syntax errors in SelectCodingStyleIndent().
csindent.vim 1.1.1 2011-01-17 7.0 Konstantin Lepa Fixed problem of detecting of invalid indent filename.
csindent.vim 1.1.0 2011-01-16 7.0 Konstantin Lepa Renamed script name from coding_style to csindent.
Added support of default coding style.
Added support of `filetype indent on` by default.
Renamed g:coding_style_ini to g:csindent_ini (~/.vim_csindent.ini).
Renamed g:coding_style_dir to g:csindent_dir (~/.vim/csindent).
Changed indent file path to `g:csindent_dir` + `filetype` + `indent file`.
Changed comment char from '#' to ';' in g:csindent_ini file.
coding_style.vim 1.0.3 2009-11-18 7.0 Konstantin Lepa Added support of comments in the g:coding_style_ini file.
coding_style.vim 1.0.2 2009-05-17 7.0 Konstantin Lepa Renamed the folder cs_indent to coding_styles.
Removed styles.txt.
Added g:coding_style_ini (default ~/.coding_style.ini).
Added g:coding_style_dir (default ~/.vim/coding_styles).
coding_style.vim 1.0.1 2009-05-16 7.0 Konstantin Lepa Added CodingStyle() for checking of current coding style.
coding_style.vim 1.0.0 2009-05-15 7.0 Konstantin Lepa Initial upload
ip used for rating: 142.132.191.50

Questions about Vim should go to the maillist. Help Uganda.     Vim at Github