sponsor Vim development Vim logo Vim Book Ad

Modeliner : Generates modeline according to the current settings.

 script karma  Rating 18/12, Downloaded by 2956  Comments, bugs, improvements  Vim wiki

created by
Shuhei Kubota
 
script type
utility
 
description
[How to use it?]

execute ':Modeliner'.


[And, what will happen?]

If your current settings are like below:
  - setl fenc=utf-8
  - setl et
  - setl sts=4

then you will get a modeline like:
  - for 'c' filetype:
      /* vim: set fenc=utf-8 et sts=4 : */
  - for 'xml' filetype:
      <!-- vim: set fenc=utf-8 et sts=4 : -->


[How to include my favorite options?]

Modify  g:Modeliner_format.  It is a simple format.

An example:
    let g:Modeliner_format = 'fenc=  tw=  et  ts=  sts=  sw=  backup wrap'
 
install details
Put this plugin in your plugin directory(e.g. $VIMRUNTIME/plugin).
Then restart Vim or :source it.
 

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
modeliner9.vim 0.5.1v9 2022-02-14 8.2 Shuhei Kubota remove s:
modeliner9.vim 0.5.0v9 2021-12-17 7.0 Shuhei Kubota vim9script: work under empty &commentstring
modeliner.vim 0.5.0 2021-12-17 7.0 Shuhei Kubota work under empty &commentstring
modeliner9.vim 0.4.0 2021-12-09 7.0 Shuhei Kubota vim9script
modeliner.vim 0.3.0 2008-06-26 7.0 Shuhei Kubota If you use The NERD Commenter, this script uses it to generate a modeline as a comment.
modeliner.vim 0.2.0 2007-10-03 6.0 Shuhei Kubota finds the existing modeline and overwrite it
modeliner.vim 0.1.0 2006-02-22 6.0 Shuhei Kubota Initial upload
ip used for rating: 142.132.191.50

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github