1*filetype.txt* For Vim version 8.2. Last change: 2019 Jul 16 2 3 4 VIM REFERENCE MANUAL by Bram Moolenaar 5 6 7Filetypes *filetype* *file-type* 8 91. Filetypes |filetypes| 102. Filetype plugin |filetype-plugins| 113. Docs for the default filetype plugins. |ftplugin-docs| 12 13Also see |autocmd.txt|. 14 15 16============================================================================== 171. Filetypes *filetypes* *file-types* 18 19Vim can detect the type of file that is edited. This is done by checking the 20file name and sometimes by inspecting the contents of the file for specific 21text. 22 23 *:filetype* *:filet* 24To enable file type detection, use this command in your vimrc: > 25 :filetype on 26Each time a new or existing file is edited, Vim will try to recognize the type 27of the file and set the 'filetype' option. This will trigger the FileType 28event, which can be used to set the syntax highlighting, set options, etc. 29 30NOTE: Filetypes and 'compatible' don't work together well, since being Vi 31compatible means options are global. Resetting 'compatible' is recommended, 32if you didn't do that already. 33 34Detail: The ":filetype on" command will load one of these files: 35 Amiga $VIMRUNTIME/filetype.vim 36 Mac $VIMRUNTIME:filetype.vim 37 MS-Windows $VIMRUNTIME\filetype.vim 38 Unix $VIMRUNTIME/filetype.vim 39 VMS $VIMRUNTIME/filetype.vim 40 This file is a Vim script that defines autocommands for the 41 BufNewFile and BufRead events. If the file type is not found by the 42 name, the file $VIMRUNTIME/scripts.vim is used to detect it from the 43 contents of the file. 44 When the GUI is running or will start soon, the |menu.vim| script is 45 also sourced. See |'go-M'| about avoiding that. 46 47To add your own file types, see |new-filetype| below. To search for help on a 48filetype prepend "ft-" and optionally append "-syntax", "-indent" or 49"-plugin". For example: > 50 :help ft-vim-indent 51 :help ft-vim-syntax 52 :help ft-man-plugin 53 54If the file type is not detected automatically, or it finds the wrong type, 55you can either set the 'filetype' option manually, or add a modeline to your 56file. Example, for an IDL file use the command: > 57 :set filetype=idl 58 59or add this |modeline| to the file: 60 /* vim: set filetype=idl : */ ~ 61 62 *:filetype-plugin-on* 63You can enable loading the plugin files for specific file types with: > 64 :filetype plugin on 65If filetype detection was not switched on yet, it will be as well. 66This actually loads the file "ftplugin.vim" in 'runtimepath'. 67The result is that when a file is edited its plugin file is loaded (if there 68is one for the detected filetype). |filetype-plugin| 69 70 *:filetype-plugin-off* 71You can disable it again with: > 72 :filetype plugin off 73The filetype detection is not switched off then. But if you do switch off 74filetype detection, the plugins will not be loaded either. 75This actually loads the file "ftplugof.vim" in 'runtimepath'. 76 77 *:filetype-indent-on* 78You can enable loading the indent file for specific file types with: > 79 :filetype indent on 80If filetype detection was not switched on yet, it will be as well. 81This actually loads the file "indent.vim" in 'runtimepath'. 82The result is that when a file is edited its indent file is loaded (if there 83is one for the detected filetype). |indent-expression| 84 85 *:filetype-indent-off* 86You can disable it again with: > 87 :filetype indent off 88The filetype detection is not switched off then. But if you do switch off 89filetype detection, the indent files will not be loaded either. 90This actually loads the file "indoff.vim" in 'runtimepath'. 91This disables auto-indenting for files you will open. It will keep working in 92already opened files. Reset 'autoindent', 'cindent', 'smartindent' and/or 93'indentexpr' to disable indenting in an opened file. 94 95 *:filetype-off* 96To disable file type detection, use this command: > 97 :filetype off 98This will keep the flags for "plugin" and "indent", but since no file types 99are being detected, they won't work until the next ":filetype on". 100 101 102Overview: *:filetype-overview* 103 104command detection plugin indent ~ 105:filetype on on unchanged unchanged 106:filetype off off unchanged unchanged 107:filetype plugin on on on unchanged 108:filetype plugin off unchanged off unchanged 109:filetype indent on on unchanged on 110:filetype indent off unchanged unchanged off 111:filetype plugin indent on on on on 112:filetype plugin indent off unchanged off off 113 114To see the current status, type: > 115 :filetype 116The output looks something like this: > 117 filetype detection:ON plugin:ON indent:OFF 118 119The file types are also used for syntax highlighting. If the ":syntax on" 120command is used, the file type detection is installed too. There is no need 121to do ":filetype on" after ":syntax on". 122 123To disable one of the file types, add a line in your filetype file, see 124|remove-filetype|. 125 126 *filetype-detect* 127To detect the file type again: > 128 :filetype detect 129Use this if you started with an empty file and typed text that makes it 130possible to detect the file type. For example, when you entered this in a 131shell script: "#!/bin/csh". 132 When filetype detection was off, it will be enabled first, like the "on" 133argument was used. 134 135 *filetype-overrule* 136When the same extension is used for two filetypes, Vim tries to guess what 137kind of file it is. This doesn't always work. A number of global variables 138can be used to overrule the filetype used for certain extensions: 139 140 file name variable ~ 141 *.asa g:filetype_asa |ft-aspvbs-syntax| |ft-aspperl-syntax| 142 *.asp g:filetype_asp |ft-aspvbs-syntax| |ft-aspperl-syntax| 143 *.asm g:asmsyntax |ft-asm-syntax| 144 *.prg g:filetype_prg 145 *.pl g:filetype_pl 146 *.inc g:filetype_inc 147 *.w g:filetype_w |ft-cweb-syntax| 148 *.i g:filetype_i |ft-progress-syntax| 149 *.p g:filetype_p |ft-pascal-syntax| 150 *.sh g:bash_is_sh |ft-sh-syntax| 151 *.tex g:tex_flavor |ft-tex-plugin| 152 153 *filetype-ignore* 154To avoid that certain files are being inspected, the g:ft_ignore_pat variable 155is used. The default value is set like this: > 156 :let g:ft_ignore_pat = '\.\(Z\|gz\|bz2\|zip\|tgz\)$' 157This means that the contents of compressed files are not inspected. 158 159 *new-filetype* 160If a file type that you want to use is not detected yet, there are four ways 161to add it. In any way, it's better not to modify the $VIMRUNTIME/filetype.vim 162file. It will be overwritten when installing a new version of Vim. 163 164A. If you want to overrule all default file type checks. 165 This works by writing one file for each filetype. The disadvantage is that 166 means there can be many files. The advantage is that you can simply drop 167 this file in the right directory to make it work. 168 *ftdetect* 169 1. Create your user runtime directory. You would normally use the first 170 item of the 'runtimepath' option. Then create the directory "ftdetect" 171 inside it. Example for Unix: > 172 :!mkdir ~/.vim 173 :!mkdir ~/.vim/ftdetect 174< 175 2. Create a file that contains an autocommand to detect the file type. 176 Example: > 177 au BufRead,BufNewFile *.mine set filetype=mine 178< Note that there is no "augroup" command, this has already been done 179 when sourcing your file. You could also use the pattern "*" and then 180 check the contents of the file to recognize it. 181 Write this file as "mine.vim" in the "ftdetect" directory in your user 182 runtime directory. For example, for Unix: > 183 :w ~/.vim/ftdetect/mine.vim 184 185< 3. To use the new filetype detection you must restart Vim. 186 187 The files in the "ftdetect" directory are used after all the default 188 checks, thus they can overrule a previously detected file type. But you 189 can also use |:setfiletype| to keep a previously detected filetype. 190 191B. If you want to detect your file after the default file type checks. 192 193 This works like A above, but instead of setting 'filetype' unconditionally 194 use ":setfiletype". This will only set 'filetype' if no file type was 195 detected yet. Example: > 196 au BufRead,BufNewFile *.txt setfiletype text 197< 198 You can also use the already detected file type in your command. For 199 example, to use the file type "mypascal" when "pascal" has been detected: > 200 au BufRead,BufNewFile * if &ft == 'pascal' | set ft=mypascal 201 | endif 202 203C. If your file type can be detected by the file name. 204 1. Create your user runtime directory. You would normally use the first 205 item of the 'runtimepath' option. Example for Unix: > 206 :!mkdir ~/.vim 207< 208 2. Create a file that contains autocommands to detect the file type. 209 Example: > 210 " my filetype file 211 if exists("did_load_filetypes") 212 finish 213 endif 214 augroup filetypedetect 215 au! BufRead,BufNewFile *.mine setfiletype mine 216 au! BufRead,BufNewFile *.xyz setfiletype drawing 217 augroup END 218< Write this file as "filetype.vim" in your user runtime directory. For 219 example, for Unix: > 220 :w ~/.vim/filetype.vim 221 222< 3. To use the new filetype detection you must restart Vim. 223 224 Your filetype.vim will be sourced before the default FileType autocommands 225 have been installed. Your autocommands will match first, and the 226 ":setfiletype" command will make sure that no other autocommands will set 227 'filetype' after this. 228 *new-filetype-scripts* 229D. If your filetype can only be detected by inspecting the contents of the 230 file. 231 232 1. Create your user runtime directory. You would normally use the first 233 item of the 'runtimepath' option. Example for Unix: > 234 :!mkdir ~/.vim 235< 236 2. Create a vim script file for doing this. Example: > 237 if did_filetype() " filetype already set.. 238 finish " ..don't do these checks 239 endif 240 if getline(1) =~ '^#!.*\<mine\>' 241 setfiletype mine 242 elseif getline(1) =~? '\<drawing\>' 243 setfiletype drawing 244 endif 245< See $VIMRUNTIME/scripts.vim for more examples. 246 Write this file as "scripts.vim" in your user runtime directory. For 247 example, for Unix: > 248 :w ~/.vim/scripts.vim 249< 250 3. The detection will work right away, no need to restart Vim. 251 252 Your scripts.vim is loaded before the default checks for file types, which 253 means that your rules override the default rules in 254 $VIMRUNTIME/scripts.vim. 255 256 *remove-filetype* 257If a file type is detected that is wrong for you, install a filetype.vim or 258scripts.vim to catch it (see above). You can set 'filetype' to a non-existing 259name to avoid that it will be set later anyway: > 260 :set filetype=ignored 261 262If you are setting up a system with many users, and you don't want each user 263to add/remove the same filetypes, consider writing the filetype.vim and 264scripts.vim files in a runtime directory that is used for everybody. Check 265the 'runtimepath' for a directory to use. If there isn't one, set 266'runtimepath' in the |system-vimrc|. Be careful to keep the default 267directories! 268 269 270 *autocmd-osfiletypes* 271NOTE: this code is currently disabled, as the RISC OS implementation was 272removed. In the future this will use the 'filetype' option. 273 274On operating systems which support storing a file type with the file, you can 275specify that an autocommand should only be executed if the file is of a 276certain type. 277 278The actual type checking depends on which platform you are running Vim 279on; see your system's documentation for details. 280 281To use osfiletype checking in an autocommand you should put a list of types to 282match in angle brackets in place of a pattern, like this: > 283 284 :au BufRead *.html,<&faf;HTML> runtime! syntax/html.vim 285 286This will match: 287 288- Any file whose name ends in ".html" 289- Any file whose type is "&faf" or "HTML", where the meaning of these types 290 depends on which version of Vim you are using. 291 Unknown types are considered NOT to match. 292 293You can also specify a type and a pattern at the same time (in which case they 294must both match): > 295 296 :au BufRead <&fff>diff* 297 298This will match files of type "&fff" whose names start with "diff". 299 300 301 *plugin-details* 302The "plugin" directory can be in any of the directories in the 'runtimepath' 303option. All of these directories will be searched for plugins and they are 304all loaded. For example, if this command: > 305 306 set runtimepath 307 308produces this output: 309 310 runtimepath=/etc/vim,~/.vim,/usr/local/share/vim/vim82 ~ 311 312then Vim will load all plugins in these directories and below: 313 314 /etc/vim/plugin/ ~ 315 ~/.vim/plugin/ ~ 316 /usr/local/share/vim/vim82/plugin/ ~ 317 318Note that the last one is the value of $VIMRUNTIME which has been expanded. 319 320Note that when using a plugin manager or |packages| many directories will be 321added to 'runtimepath'. These plugins each require their own directory, don't 322put them directly in ~/.vim/plugin. 323 324What if it looks like your plugin is not being loaded? You can find out what 325happens when Vim starts up by using the |-V| argument: > 326 327 vim -V2 328 329You will see a lot of messages, in between them is a remark about loading the 330plugins. It starts with: 331 332 Searching for "plugin/**/*.vim" in ~ 333 334There you can see where Vim looks for your plugin scripts. 335 336============================================================================== 3372. Filetype plugin *filetype-plugins* 338 339When loading filetype plugins has been enabled |:filetype-plugin-on|, options 340will be set and mappings defined. These are all local to the buffer, they 341will not be used for other files. 342 343Defining mappings for a filetype may get in the way of the mappings you 344define yourself. There are a few ways to avoid this: 3451. Set the "maplocalleader" variable to the key sequence you want the mappings 346 to start with. Example: > 347 :let maplocalleader = "," 348< All mappings will then start with a comma instead of the default, which 349 is a backslash. Also see |<LocalLeader>|. 350 3512. Define your own mapping. Example: > 352 :map ,p <Plug>MailQuote 353< You need to check the description of the plugin file below for the 354 functionality it offers and the string to map to. 355 You need to define your own mapping before the plugin is loaded (before 356 editing a file of that type). The plugin will then skip installing the 357 default mapping. 358 *no_mail_maps* 3593. Disable defining mappings for a specific filetype by setting a variable, 360 which contains the name of the filetype. For the "mail" filetype this 361 would be: > 362 :let no_mail_maps = 1 363< *no_plugin_maps* 3644. Disable defining mappings for all filetypes by setting a variable: > 365 :let no_plugin_maps = 1 366< 367 368 *ftplugin-overrule* 369If a global filetype plugin does not do exactly what you want, there are three 370ways to change this: 371 3721. Add a few settings. 373 You must create a new filetype plugin in a directory early in 374 'runtimepath'. For Unix, for example you could use this file: > 375 vim ~/.vim/ftplugin/fortran.vim 376< You can set those settings and mappings that you would like to add. Note 377 that the global plugin will be loaded after this, it may overrule the 378 settings that you do here. If this is the case, you need to use one of the 379 following two methods. 380 3812. Make a copy of the plugin and change it. 382 You must put the copy in a directory early in 'runtimepath'. For Unix, for 383 example, you could do this: > 384 cp $VIMRUNTIME/ftplugin/fortran.vim ~/.vim/ftplugin/fortran.vim 385< Then you can edit the copied file to your liking. Since the b:did_ftplugin 386 variable will be set, the global plugin will not be loaded. 387 A disadvantage of this method is that when the distributed plugin gets 388 improved, you will have to copy and modify it again. 389 3903. Overrule the settings after loading the global plugin. 391 You must create a new filetype plugin in a directory from the end of 392 'runtimepath'. For Unix, for example, you could use this file: > 393 vim ~/.vim/after/ftplugin/fortran.vim 394< In this file you can change just those settings that you want to change. 395 396============================================================================== 3973. Docs for the default filetype plugins. *ftplugin-docs* 398 399 400CHANGELOG *ft-changelog-plugin* 401 402Allows for easy entrance of Changelog entries in Changelog files. There are 403some commands, mappings, and variables worth exploring: 404 405Options: 406'comments' is made empty to not mess up formatting. 407'textwidth' is set to 78, which is standard. 408'formatoptions' the 't' flag is added to wrap when inserting text. 409 410Commands: 411NewChangelogEntry Adds a new Changelog entry in an intelligent fashion 412 (see below). 413 414Local mappings: 415<Leader>o Starts a new Changelog entry in an equally intelligent 416 fashion (see below). 417 418Global mappings: 419 NOTE: The global mappings are accessed by sourcing the 420 ftplugin/changelog.vim file first, e.g. with > 421 runtime ftplugin/changelog.vim 422< in your |.vimrc|. 423<Leader>o Switches to the ChangeLog buffer opened for the 424 current directory, or opens it in a new buffer if it 425 exists in the current directory. Then it does the 426 same as the local <Leader>o described above. 427 428Variables: 429g:changelog_timeformat Deprecated; use g:changelog_dateformat instead. 430g:changelog_dateformat The date (and time) format used in ChangeLog entries. 431 The format accepted is the same as for the 432 |strftime()| function. 433 The default is "%Y-%m-%d" which is the standard format 434 for many ChangeLog layouts. 435g:changelog_username The name and email address of the user. 436 The default is deduced from environment variables and 437 system files. It searches /etc/passwd for the comment 438 part of the current user, which informally contains 439 the real name of the user up to the first separating 440 comma. then it checks the $NAME environment variable 441 and finally runs `whoami` and `hostname` to build an 442 email address. The final form is > 443 Full Name <user@host> 444< 445g:changelog_new_date_format 446 The format to use when creating a new date-entry. 447 The following table describes special tokens in the 448 string: 449 %% insert a single '%' character 450 %d insert the date from above 451 %u insert the user from above 452 %p insert result of b:changelog_entry_prefix 453 %c where to position cursor when done 454 The default is "%d %u\n\n\t* %p%c\n\n", which produces 455 something like (| is where cursor will be, unless at 456 the start of the line where it denotes the beginning 457 of the line) > 458 |2003-01-14 Full Name <user@host> 459 | 460 | * prefix| 461< 462g:changelog_new_entry_format 463 The format used when creating a new entry. 464 The following table describes special tokens in the 465 string: 466 %p insert result of b:changelog_entry_prefix 467 %c where to position cursor when done 468 The default is "\t*%c", which produces something 469 similar to > 470 | * prefix| 471< 472g:changelog_date_entry_search 473 The search pattern to use when searching for a 474 date-entry. 475 The same tokens that can be used for 476 g:changelog_new_date_format can be used here as well. 477 The default is '^\s*%d\_s*%u' which finds lines 478 matching the form > 479 |2003-01-14 Full Name <user@host> 480< and some similar formats. 481 482g:changelog_date_end_entry_search 483 The search pattern to use when searching for the end 484 of a date-entry. 485 The same tokens that can be used for 486 g:changelog_new_date_format can be used here as well. 487 The default is '^\s*$' which finds lines that contain 488 only whitespace or are completely empty. 489 490b:changelog_name *b:changelog_name* 491 Name of the ChangeLog file to look for. 492 The default is 'ChangeLog'. 493 494b:changelog_path 495 Path of the ChangeLog to use for the current buffer. 496 The default is empty, thus looking for a file named 497 |b:changelog_name| in the same directory as the 498 current buffer. If not found, the parent directory of 499 the current buffer is searched. This continues 500 recursively until a file is found or there are no more 501 parent directories to search. 502 503b:changelog_entry_prefix 504 Name of a function to call to generate a prefix to a 505 new entry. This function takes no arguments and 506 should return a string containing the prefix. 507 Returning an empty prefix is fine. 508 The default generates the shortest path between the 509 ChangeLog's pathname and the current buffers pathname. 510 In the future, it will also be possible to use other 511 variable contexts for this variable, for example, g:. 512 513The Changelog entries are inserted where they add the least amount of text. 514After figuring out the current date and user, the file is searched for an 515entry beginning with the current date and user and if found adds another item 516under it. If not found, a new entry and item is prepended to the beginning of 517the Changelog. 518 519 520FORTRAN *ft-fortran-plugin* 521 522Options: 523'expandtab' is switched on to avoid tabs as required by the Fortran 524 standards unless the user has set fortran_have_tabs in .vimrc. 525'textwidth' is set to 72 for fixed source format as required by the 526 Fortran standards and to 80 for free source format. 527'formatoptions' is set to break code and comment lines and to preserve long 528 lines. You can format comments with |gq|. 529For further discussion of fortran_have_tabs and the method used for the 530detection of source format see |ft-fortran-syntax|. 531 532 533GIT COMMIT *ft-gitcommit-plugin* 534 535One command, :DiffGitCached, is provided to show a diff of the current commit 536in the preview window. It is equivalent to calling "git diff --cached" plus 537any arguments given to the command. 538 539 540MAIL *ft-mail-plugin* 541 542Options: 543'modeline' is switched off to avoid the danger of trojan horses, and to 544 avoid that a Subject line with "Vim:" in it will cause an 545 error message. 546'textwidth' is set to 72. This is often recommended for e-mail. 547'formatoptions' is set to break text lines and to repeat the comment leader 548 in new lines, so that a leading ">" for quotes is repeated. 549 You can also format quoted text with |gq|. 550 551Local mappings: 552<LocalLeader>q or \\MailQuote 553 Quotes the text selected in Visual mode, or from the cursor position 554 to the end of the file in Normal mode. This means "> " is inserted in 555 each line. 556 557MAN *ft-man-plugin* *:Man* *man.vim* 558 559Displays a manual page in a nice way. Also see the user manual 560|find-manpage|. 561 562To start using the ":Man" command before any manual page was loaded, source 563this script from your startup vimrc file: > 564 565 runtime ftplugin/man.vim 566 567Options: 568'iskeyword' the '.' character is added to be able to use CTRL-] on the 569 manual page name. 570 571Commands: 572Man {name} Display the manual page for {name} in a window. 573Man {number} {name} 574 Display the manual page for {name} in a section {number}. 575 576Global mapping: 577<Leader>K Displays the manual page for the word under the cursor. 578<Plug>ManPreGetPage idem, allows for using a mapping: > 579 nmap <F1> <Plug>ManPreGetPage<CR> 580 581Local mappings: 582CTRL-] Jump to the manual page for the word under the cursor. 583CTRL-T Jump back to the previous manual page. 584q Same as ":quit" 585 586To use a vertical split instead of horizontal: > 587 let g:ft_man_open_mode = 'vert' 588To use a new tab: > 589 let g:ft_man_open_mode = 'tab' 590 591To enable folding use this: > 592 let g:ft_man_folding_enable = 1 593If you do not like the default folding, use an autocommand to add your desired 594folding style instead. For example: > 595 autocmd FileType man setlocal foldmethod=indent foldenable 596 597If you would like :Man {number} {name} to behave like man {number} {name} by 598not running man {name} if no page is found, then use this: > 599 let g:ft_man_no_sect_fallback = 1 600 601You may also want to set 'keywordprg' to make the |K| command open a manual 602page in a Vim window: > 603 set keywordprg=:Man 604 605 606MANPAGER *manpager.vim* 607 608The :Man command allows you to turn Vim into a manpager (that syntax highlights 609manpages and follows linked manpages on hitting CTRL-]). 610 611For bash,zsh,ksh or dash, add to the config file (.bashrc,.zshrc, ...) 612 613 export MANPAGER="vim -M +MANPAGER -" 614 615For (t)csh, add to the config file 616 617 setenv MANPAGER "vim -M +MANPAGER -" 618 619For fish, add to the config file 620 621 set -x MANPAGER "vim -M +MANPAGER -" 622 623PDF *ft-pdf-plugin* 624 625Two maps, <C-]> and <C-T>, are provided to simulate a tag stack for navigating 626the PDF. The following are treated as tags: 627 628- The byte offset after "startxref" to the xref table 629- The byte offset after the /Prev key in the trailer to an earlier xref table 630- A line of the form "0123456789 00000 n" in the xref table 631- An object reference like "1 0 R" anywhere in the PDF 632 633These maps can be disabled with > 634 :let g:no_pdf_maps = 1 635< 636 637PYTHON *ft-python-plugin* *PEP8* 638 639By default the following options are set, in accordance with PEP8: > 640 641 setlocal expandtab shiftwidth=4 softtabstop=4 tabstop=8 642 643To disable this behavior, set the following variable in your vimrc: > 644 645 let g:python_recommended_style = 0 646 647 648QF QUICKFIX *qf.vim* *ft-qf-plugin* 649 650The "qf" filetype is used for the quickfix window, see |quickfix-window|. 651 652The quickfix filetype plugin includes configuration for displaying the command 653that produced the quickfix list in the |status-line|. To disable this setting, 654configure as follows: > 655 :let g:qf_disable_statusline = 1 656 657 658R MARKDOWN *ft-rmd-plugin* 659 660By default ftplugin/html.vim is not sourced. If you want it sourced, add to 661your |vimrc|: > 662 let rmd_include_html = 1 663 664The 'formatexpr' option is set dynamically with different values for R code 665and for Markdown code. If you prefer that 'formatexpr' is not set, add to your 666|vimrc|: > 667 let rmd_dynamic_comments = 0 668 669 670R RESTRUCTURED TEXT *ft-rrst-plugin* 671 672The 'formatexpr' option is set dynamically with different values for R code 673and for ReStructured text. If you prefer that 'formatexpr' is not set, add to 674your |vimrc|: > 675 let rrst_dynamic_comments = 0 676 677 678RESTRUCTUREDTEXT *ft-rst-plugin* 679 680The following formatting setting are optionally available: > 681 setlocal expandtab shiftwidth=3 softtabstop=3 tabstop=8 682 683To enable this behavior, set the following variable in your vimrc: > 684 let g:rst_style = 1 685 686 687RPM SPEC *ft-spec-plugin* 688 689Since the text for this plugin is rather long it has been put in a separate 690file: |pi_spec.txt|. 691 692 693RUST *ft-rust* 694 695Since the text for this plugin is rather long it has been put in a separate 696file: |ft_rust.txt|. 697 698 699SQL *ft-sql* 700 701Since the text for this plugin is rather long it has been put in a separate 702file: |ft_sql.txt|. 703 704 705TEX *ft-tex-plugin* *g:tex_flavor* 706 707If the first line of a *.tex file has the form > 708 %&<format> 709then this determined the file type: plaintex (for plain TeX), context (for 710ConTeXt), or tex (for LaTeX). Otherwise, the file is searched for keywords to 711choose context or tex. If no keywords are found, it defaults to plaintex. 712You can change the default by defining the variable g:tex_flavor to the format 713(not the file type) you use most. Use one of these: > 714 let g:tex_flavor = "plain" 715 let g:tex_flavor = "context" 716 let g:tex_flavor = "latex" 717Currently no other formats are recognized. 718 719 720VIM *ft-vim-plugin* 721 722The Vim filetype plugin defines mappings to move to the start and end of 723functions with [[ and ]]. Move around comments with ]" and [". 724 725The mappings can be disabled with: > 726 let g:no_vim_maps = 1 727 728 729ZIMBU *ft-zimbu-plugin* 730 731The Zimbu filetype plugin defines mappings to move to the start and end of 732functions with [[ and ]]. 733 734The mappings can be disabled with: > 735 let g:no_zimbu_maps = 1 736< 737 738 739 vim:tw=78:ts=8:noet:ft=help:norl: 740