Mercurial > vim
annotate runtime/doc/filetype.txt @ 35717:99d97826842a
runtime(go): add recommended indent options to ftplugin
Commit: https://github.com/vim/vim/commit/3e07d5aef19ac34a61b9d58c2e0698351d392f52
Author: markmacode <code@mamo.aleeas.com>
Date: Tue Jul 16 21:20:34 2024 +0200
runtime(go): add recommended indent options to ftplugin
related: https://github.com/vim/vim/issues/15264
Signed-off-by: markmacode <code@mamo.aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 17 Jul 2024 08:14:01 +0200 |
parents | 8195572b0b15 |
children | d30ad7f335cb |
rev | line source |
---|---|
35717
99d97826842a
runtime(go): add recommended indent options to ftplugin
Christian Brabandt <cb@256bit.org>
parents:
35716
diff
changeset
|
1 *filetype.txt* For Vim version 9.1. Last change: 2024 Jul 16 |
32670
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
2 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
3 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
4 VIM REFERENCE MANUAL by Bram Moolenaar |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
5 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
6 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
7 Filetypes *filetype* *file-type* |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
8 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
9 1. Filetypes |filetypes| |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
10 2. Filetype plugin |filetype-plugins| |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
11 3. Docs for the default filetype plugins. |ftplugin-docs| |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
12 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
13 Also see |autocmd.txt|. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
14 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
15 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
16 ============================================================================== |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
17 1. Filetypes *filetypes* *file-types* |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
18 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
19 Vim can detect the type of file that is edited. This is done by checking the |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
20 file name and sometimes by inspecting the contents of the file for specific |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
21 text. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
22 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
23 *:filetype* *:filet* |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
24 To enable file type detection, use this command in your vimrc: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
25 :filetype on |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
26 Each time a new or existing file is edited, Vim will try to recognize the type |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
27 of the file and set the 'filetype' option. This will trigger the FileType |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
28 event, which can be used to set the syntax highlighting, set options, etc. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
29 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
30 NOTE: Filetypes and 'compatible' don't work together well, since being Vi |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
31 compatible means options are global. Resetting 'compatible' is recommended, |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
32 if you didn't do that already. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
33 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
34 Detail: The ":filetype on" command will load one of these files: |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
35 Amiga $VIMRUNTIME/filetype.vim |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
36 Mac $VIMRUNTIME:filetype.vim |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
37 MS-Windows $VIMRUNTIME\filetype.vim |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
38 Unix $VIMRUNTIME/filetype.vim |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
39 VMS $VIMRUNTIME/filetype.vim |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
40 This file is a Vim script that defines autocommands for the |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
41 BufNewFile and BufRead events. If the file type is not found by the |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
42 name, the file $VIMRUNTIME/scripts.vim is used to detect it from the |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
43 contents of the file. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
44 When the GUI is running or will start soon, the |menu.vim| script is |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
45 also sourced. See |'go-M'| about avoiding that. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
46 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
47 To add your own file types, see |new-filetype| below. To search for help on a |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
48 filetype prepend "ft-" and optionally append "-syntax", "-indent" or |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
49 "-plugin". For example: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
50 :help ft-vim-indent |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
51 :help ft-vim-syntax |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
52 :help ft-man-plugin |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
53 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
54 If the file type is not detected automatically, or it finds the wrong type, |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
55 you can either set the 'filetype' option manually, or add a modeline to your |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
56 file. Example, for an IDL file use the command: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
57 :set filetype=idl |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
58 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
59 or add this |modeline| to the file: |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
60 /* vim: set filetype=idl : */ ~ |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
61 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
62 *:filetype-plugin-on* |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
63 You can enable loading the plugin files for specific file types with: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
64 :filetype plugin on |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
65 If filetype detection was not switched on yet, it will be as well. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
66 This actually loads the file "ftplugin.vim" in 'runtimepath'. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
67 The result is that when a file is edited its plugin file is loaded (if there |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
68 is one for the detected filetype). |filetype-plugin| |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
69 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
70 *:filetype-plugin-off* |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
71 You can disable it again with: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
72 :filetype plugin off |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
73 The filetype detection is not switched off then. But if you do switch off |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
74 filetype detection, the plugins will not be loaded either. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
75 This actually loads the file "ftplugof.vim" in 'runtimepath'. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
76 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
77 *:filetype-indent-on* |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
78 You can enable loading the indent file for specific file types with: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
79 :filetype indent on |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
80 If filetype detection was not switched on yet, it will be as well. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
81 This actually loads the file "indent.vim" in 'runtimepath'. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
82 The result is that when a file is edited its indent file is loaded (if there |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
83 is one for the detected filetype). |indent-expression| |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
84 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
85 *:filetype-indent-off* |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
86 You can disable it again with: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
87 :filetype indent off |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
88 The filetype detection is not switched off then. But if you do switch off |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
89 filetype detection, the indent files will not be loaded either. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
90 This actually loads the file "indoff.vim" in 'runtimepath'. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
91 This disables auto-indenting for files you will open. It will keep working in |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
92 already opened files. Reset 'autoindent', 'cindent', 'smartindent' and/or |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
93 'indentexpr' to disable indenting in an opened file. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
94 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
95 *:filetype-off* |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
96 To disable file type detection, use this command: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
97 :filetype off |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
98 This will keep the flags for "plugin" and "indent", but since no file types |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
99 are being detected, they won't work until the next ":filetype on". |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
100 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
101 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
102 Overview: *:filetype-overview* |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
103 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
104 command detection plugin indent ~ |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
105 :filetype on on unchanged unchanged |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
106 :filetype off off unchanged unchanged |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
107 :filetype plugin on on on unchanged |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
108 :filetype plugin off unchanged off unchanged |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
109 :filetype indent on on unchanged on |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
110 :filetype indent off unchanged unchanged off |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
111 :filetype plugin indent on on on on |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
112 :filetype plugin indent off unchanged off off |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
113 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
114 To see the current status, type: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
115 :filetype |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
116 The output looks something like this: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
117 filetype detection:ON plugin:ON indent:OFF |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
118 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
119 The file types are also used for syntax highlighting. If the ":syntax on" |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
120 command is used, the file type detection is installed too. There is no need |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
121 to do ":filetype on" after ":syntax on". |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
122 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
123 To disable one of the file types, add a line in your filetype file, see |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
124 |remove-filetype|. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
125 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
126 *filetype-detect* |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
127 To detect the file type again: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
128 :filetype detect |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
129 Use this if you started with an empty file and typed text that makes it |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
130 possible to detect the file type. For example, when you entered this in a |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
131 shell script: "#!/bin/csh". |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
132 When filetype detection was off, it will be enabled first, like the "on" |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
133 argument was used. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
134 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
135 *filetype-overrule* |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
136 When the same extension is used for multiple filetypes, Vim tries to guess |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
137 what kind of file it is. This doesn't always work. A number of global |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
138 variables can be used to overrule the filetype used for certain extensions: |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
139 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
140 file name variable ~ |
33245
485561aa8f1e
runtime(doc): Add g:c_syntax_for_h to filetype-overrule docs
Christian Brabandt <cb@256bit.org>
parents:
33203
diff
changeset
|
141 *.asa g:filetype_asa |ft-aspperl-syntax| |
485561aa8f1e
runtime(doc): Add g:c_syntax_for_h to filetype-overrule docs
Christian Brabandt <cb@256bit.org>
parents:
33203
diff
changeset
|
142 |ft-aspvbs-syntax| |
485561aa8f1e
runtime(doc): Add g:c_syntax_for_h to filetype-overrule docs
Christian Brabandt <cb@256bit.org>
parents:
33203
diff
changeset
|
143 *.asm g:asmsyntax |ft-asm-syntax| |
485561aa8f1e
runtime(doc): Add g:c_syntax_for_h to filetype-overrule docs
Christian Brabandt <cb@256bit.org>
parents:
33203
diff
changeset
|
144 *.asp g:filetype_asp |ft-aspperl-syntax| |
485561aa8f1e
runtime(doc): Add g:c_syntax_for_h to filetype-overrule docs
Christian Brabandt <cb@256bit.org>
parents:
33203
diff
changeset
|
145 |ft-aspvbs-syntax| |
485561aa8f1e
runtime(doc): Add g:c_syntax_for_h to filetype-overrule docs
Christian Brabandt <cb@256bit.org>
parents:
33203
diff
changeset
|
146 *.bas g:filetype_bas |ft-basic-syntax| |
32670
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
147 *.cfg g:filetype_cfg |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
148 *.cls g:filetype_cls |
33245
485561aa8f1e
runtime(doc): Add g:c_syntax_for_h to filetype-overrule docs
Christian Brabandt <cb@256bit.org>
parents:
33203
diff
changeset
|
149 *.csh g:filetype_csh |ft-csh-syntax| |
32670
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
150 *.dat g:filetype_dat |
34092
ff27442e7851
patch 9.1.0013: Modula2 filetype support lacking
Christian Brabandt <cb@256bit.org>
parents:
34057
diff
changeset
|
151 *.def g:filetype_def |
35474
a86d5a41da68
patch 9.1.0505: filetype: Faust files are not recognized
Christian Brabandt <cb@256bit.org>
parents:
35266
diff
changeset
|
152 *.dsp g:filetype_dsp |
33245
485561aa8f1e
runtime(doc): Add g:c_syntax_for_h to filetype-overrule docs
Christian Brabandt <cb@256bit.org>
parents:
33203
diff
changeset
|
153 *.f g:filetype_f |ft-forth-syntax| |
485561aa8f1e
runtime(doc): Add g:c_syntax_for_h to filetype-overrule docs
Christian Brabandt <cb@256bit.org>
parents:
33203
diff
changeset
|
154 *.frm g:filetype_frm |ft-form-syntax| |
485561aa8f1e
runtime(doc): Add g:c_syntax_for_h to filetype-overrule docs
Christian Brabandt <cb@256bit.org>
parents:
33203
diff
changeset
|
155 *.fs g:filetype_fs |ft-forth-syntax| |
485561aa8f1e
runtime(doc): Add g:c_syntax_for_h to filetype-overrule docs
Christian Brabandt <cb@256bit.org>
parents:
33203
diff
changeset
|
156 *.h g:c_syntax_for_h |ft-c-syntax| |
485561aa8f1e
runtime(doc): Add g:c_syntax_for_h to filetype-overrule docs
Christian Brabandt <cb@256bit.org>
parents:
33203
diff
changeset
|
157 *.i g:filetype_i |ft-progress-syntax| |
32670
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
158 *.inc g:filetype_inc |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
159 *.lsl g:filetype_lsl |
33245
485561aa8f1e
runtime(doc): Add g:c_syntax_for_h to filetype-overrule docs
Christian Brabandt <cb@256bit.org>
parents:
33203
diff
changeset
|
160 *.m g:filetype_m |ft-mathematica-syntax| |
34807
7f709fa537df
patch 9.1.0276: No pandoc syntax support
Christian Brabandt <cb@256bit.org>
parents:
34765
diff
changeset
|
161 *.markdown,*.mdown,*.mkd,*.mkdn,*.mdwn,*.md |
7f709fa537df
patch 9.1.0276: No pandoc syntax support
Christian Brabandt <cb@256bit.org>
parents:
34765
diff
changeset
|
162 g:filetype_md |ft-pandoc-syntax| |
32670
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
163 *.mod g:filetype_mod |
33245
485561aa8f1e
runtime(doc): Add g:c_syntax_for_h to filetype-overrule docs
Christian Brabandt <cb@256bit.org>
parents:
33203
diff
changeset
|
164 *.p g:filetype_p |ft-pascal-syntax| |
32670
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
165 *.pl g:filetype_pl |
33245
485561aa8f1e
runtime(doc): Add g:c_syntax_for_h to filetype-overrule docs
Christian Brabandt <cb@256bit.org>
parents:
33203
diff
changeset
|
166 *.pp g:filetype_pp |ft-pascal-syntax| |
32670
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
167 *.prg g:filetype_prg |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
168 *.r g:filetype_r |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
169 *.sig g:filetype_sig |
33245
485561aa8f1e
runtime(doc): Add g:c_syntax_for_h to filetype-overrule docs
Christian Brabandt <cb@256bit.org>
parents:
33203
diff
changeset
|
170 *.sql g:filetype_sql |ft-sql-syntax| |
32670
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
171 *.src g:filetype_src |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
172 *.sys g:filetype_sys |
33245
485561aa8f1e
runtime(doc): Add g:c_syntax_for_h to filetype-overrule docs
Christian Brabandt <cb@256bit.org>
parents:
33203
diff
changeset
|
173 *.sh g:bash_is_sh |ft-sh-syntax| |
485561aa8f1e
runtime(doc): Add g:c_syntax_for_h to filetype-overrule docs
Christian Brabandt <cb@256bit.org>
parents:
33203
diff
changeset
|
174 *.tex g:tex_flavor |ft-tex-plugin| |
32670
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
175 *.typ g:filetype_typ |
34052
e2e9bb5496a5
runtime(dist/ft): improve filetype detection for *.v (V/Verilog/Coq)
Christian Brabandt <cb@256bit.org>
parents:
34016
diff
changeset
|
176 *.v g:filetype_v |
33245
485561aa8f1e
runtime(doc): Add g:c_syntax_for_h to filetype-overrule docs
Christian Brabandt <cb@256bit.org>
parents:
33203
diff
changeset
|
177 *.w g:filetype_w |ft-cweb-syntax| |
32670
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
178 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
179 For a few filetypes the global variable is used only when the filetype could |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
180 not be detected: |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
181 *.r g:filetype_r |ft-rexx-syntax| |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
182 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
183 *filetype-ignore* |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
184 To avoid that certain files are being inspected, the g:ft_ignore_pat variable |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
185 is used. The default value is set like this: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
186 :let g:ft_ignore_pat = '\.\(Z\|gz\|bz2\|zip\|tgz\)$' |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
187 This means that the contents of compressed files are not inspected. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
188 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
189 *new-filetype* |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
190 If a file type that you want to use is not detected yet, there are four ways |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
191 to add it. In any way, it's better not to modify the $VIMRUNTIME/filetype.vim |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
192 file. It will be overwritten when installing a new version of Vim. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
193 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
194 A. If you want to overrule all default file type checks. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
195 This works by writing one file for each filetype. The disadvantage is that |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
196 there can be many files. The advantage is that you can simply drop this |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
197 file in the right directory to make it work. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
198 *ftdetect* |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
199 1. Create your user runtime directory. You would normally use the first |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
200 item of the 'runtimepath' option. Then create the directory "ftdetect" |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
201 inside it. Example for Unix: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
202 :!mkdir ~/.vim |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
203 :!mkdir ~/.vim/ftdetect |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
204 < |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
205 2. Create a file that contains an autocommand to detect the file type. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
206 Example: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
207 au BufRead,BufNewFile *.mine set filetype=mine |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
208 < Note that there is no "augroup" command, this has already been done |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
209 when sourcing your file. You could also use the pattern "*" and then |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
210 check the contents of the file to recognize it. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
211 Write this file as "mine.vim" in the "ftdetect" directory in your user |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
212 runtime directory. For example, for Unix: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
213 :w ~/.vim/ftdetect/mine.vim |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
214 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
215 < 3. To use the new filetype detection you must restart Vim. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
216 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
217 The files in the "ftdetect" directory are used after all the default |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
218 checks, thus they can overrule a previously detected file type. But you |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
219 can also use |:setfiletype| to keep a previously detected filetype. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
220 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
221 B. If you want to detect your file after the default file type checks. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
222 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
223 This works like A above, but instead of setting 'filetype' unconditionally |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
224 use ":setfiletype". This will only set 'filetype' if no file type was |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
225 detected yet. Example: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
226 au BufRead,BufNewFile *.txt setfiletype text |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
227 < |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
228 You can also use the already detected file type in your command. For |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
229 example, to use the file type "mypascal" when "pascal" has been detected: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
230 au BufRead,BufNewFile * if &ft == 'pascal' | set ft=mypascal |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
231 | endif |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
232 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
233 C. If your file type can be detected by the file name. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
234 1. Create your user runtime directory. You would normally use the first |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
235 item of the 'runtimepath' option. Example for Unix: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
236 :!mkdir ~/.vim |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
237 < |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
238 2. Create a file that contains autocommands to detect the file type. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
239 Example: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
240 " my filetype file |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
241 if exists("did_load_filetypes") |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
242 finish |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
243 endif |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
244 augroup filetypedetect |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
245 au! BufRead,BufNewFile *.mine setfiletype mine |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
246 au! BufRead,BufNewFile *.xyz setfiletype drawing |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
247 augroup END |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
248 < Write this file as "filetype.vim" in your user runtime directory. For |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
249 example, for Unix: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
250 :w ~/.vim/filetype.vim |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
251 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
252 < 3. To use the new filetype detection you must restart Vim. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
253 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
254 Your filetype.vim will be sourced before the default FileType autocommands |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
255 have been installed. Your autocommands will match first, and the |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
256 ":setfiletype" command will make sure that no other autocommands will set |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
257 'filetype' after this. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
258 *new-filetype-scripts* |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
259 D. If your filetype can only be detected by inspecting the contents of the |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
260 file. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
261 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
262 1. Create your user runtime directory. You would normally use the first |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
263 item of the 'runtimepath' option. Example for Unix: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
264 :!mkdir ~/.vim |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
265 < |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
266 2. Create a vim script file for doing this. Example: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
267 if did_filetype() " filetype already set.. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
268 finish " ..don't do these checks |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
269 endif |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
270 if getline(1) =~ '^#!.*\<mine\>' |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
271 setfiletype mine |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
272 elseif getline(1) =~? '\<drawing\>' |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
273 setfiletype drawing |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
274 endif |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
275 < See $VIMRUNTIME/scripts.vim for more examples. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
276 Write this file as "scripts.vim" in your user runtime directory. For |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
277 example, for Unix: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
278 :w ~/.vim/scripts.vim |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
279 < |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
280 3. The detection will work right away, no need to restart Vim. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
281 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
282 Your scripts.vim is loaded before the default checks for file types, which |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
283 means that your rules override the default rules in |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
284 $VIMRUNTIME/scripts.vim. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
285 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
286 *remove-filetype* |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
287 If a file type is detected that is wrong for you, install a filetype.vim or |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
288 scripts.vim to catch it (see above). You can set 'filetype' to a non-existing |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
289 name to avoid that it will be set later anyway: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
290 :set filetype=ignored |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
291 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
292 If you are setting up a system with many users, and you don't want each user |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
293 to add/remove the same filetypes, consider writing the filetype.vim and |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
294 scripts.vim files in a runtime directory that is used for everybody. Check |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
295 the 'runtimepath' for a directory to use. If there isn't one, set |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
296 'runtimepath' in the |system-vimrc|. Be careful to keep the default |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
297 directories! |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
298 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
299 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
300 *autocmd-osfiletypes* |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
301 NOTE: this code is currently disabled, as the RISC OS implementation was |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
302 removed. In the future this will use the 'filetype' option. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
303 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
304 On operating systems which support storing a file type with the file, you can |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
305 specify that an autocommand should only be executed if the file is of a |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
306 certain type. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
307 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
308 The actual type checking depends on which platform you are running Vim |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
309 on; see your system's documentation for details. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
310 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
311 To use osfiletype checking in an autocommand you should put a list of types to |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
312 match in angle brackets in place of a pattern, like this: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
313 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
314 :au BufRead *.html,<&faf;HTML> runtime! syntax/html.vim |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
315 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
316 This will match: |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
317 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
318 - Any file whose name ends in ".html" |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
319 - Any file whose type is "&faf" or "HTML", where the meaning of these types |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
320 depends on which version of Vim you are using. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
321 Unknown types are considered NOT to match. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
322 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
323 You can also specify a type and a pattern at the same time (in which case they |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
324 must both match): > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
325 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
326 :au BufRead <&fff>diff* |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
327 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
328 This will match files of type "&fff" whose names start with "diff". |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
329 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
330 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
331 *plugin-details* |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
332 The "plugin" directory can be in any of the directories in the 'runtimepath' |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
333 option. All of these directories will be searched for plugins and they are |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
334 all loaded. For example, if this command: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
335 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
336 set runtimepath |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
337 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
338 produces this output: |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
339 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
340 runtimepath=/etc/vim,~/.vim,/usr/local/share/vim/vim82 ~ |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
341 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
342 then Vim will load all plugins in these directories and below: |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
343 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
344 /etc/vim/plugin/ ~ |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
345 ~/.vim/plugin/ ~ |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
346 /usr/local/share/vim/vim82/plugin/ ~ |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
347 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
348 Note that the last one is the value of $VIMRUNTIME which has been expanded. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
349 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
350 Note that when using a plugin manager or |packages| many directories will be |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
351 added to 'runtimepath'. These plugins each require their own directory, don't |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
352 put them directly in ~/.vim/plugin. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
353 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
354 What if it looks like your plugin is not being loaded? You can find out what |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
355 happens when Vim starts up by using the |-V| argument: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
356 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
357 vim -V2 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
358 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
359 You will see a lot of messages, in between them is a remark about loading the |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
360 plugins. It starts with: |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
361 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
362 Searching for "plugin/**/*.vim" in ~ |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
363 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
364 There you can see where Vim looks for your plugin scripts. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
365 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
366 ============================================================================== |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
367 2. Filetype plugin *filetype-plugins* |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
368 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
369 When loading filetype plugins has been enabled |:filetype-plugin-on|, options |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
370 will be set and mappings defined. These are all local to the buffer, they |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
371 will not be used for other files. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
372 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
373 Defining mappings for a filetype may get in the way of the mappings you |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
374 define yourself. There are a few ways to avoid this: |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
375 1. Set the "maplocalleader" variable to the key sequence you want the mappings |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
376 to start with. Example: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
377 :let maplocalleader = "," |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
378 < All mappings will then start with a comma instead of the default, which |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
379 is a backslash. Also see |<LocalLeader>|. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
380 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
381 2. Define your own mapping. Example: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
382 :map ,p <Plug>MailQuote |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
383 < You need to check the description of the plugin file below for the |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
384 functionality it offers and the string to map to. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
385 You need to define your own mapping before the plugin is loaded (before |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
386 editing a file of that type). The plugin will then skip installing the |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
387 default mapping. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
388 *no_mail_maps* *g:no_mail_maps* |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
389 3. Disable defining mappings for a specific filetype by setting a variable, |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
390 which contains the name of the filetype. For the "mail" filetype this |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
391 would be: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
392 :let no_mail_maps = 1 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
393 < *no_plugin_maps* *g:no_plugin_maps* |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
394 4. Disable defining mappings for all filetypes by setting a variable: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
395 :let no_plugin_maps = 1 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
396 < |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
397 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
398 *ftplugin-overrule* |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
399 If a global filetype plugin does not do exactly what you want, there are three |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
400 ways to change this: |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
401 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
402 1. Add a few settings. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
403 You must create a new filetype plugin in a directory early in |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
404 'runtimepath'. For Unix, for example you could use this file: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
405 vim ~/.vim/ftplugin/fortran.vim |
32708
346703c4ddd1
Fix alignment in filetype.txt (#12618)
Christian Brabandt <cb@256bit.org>
parents:
32670
diff
changeset
|
406 < You can set those settings and mappings that you would like to add. Note |
32670
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
407 that the global plugin will be loaded after this, it may overrule the |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
408 settings that you do here. If this is the case, you need to use one of the |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
409 following two methods. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
410 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
411 2. Make a copy of the plugin and change it. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
412 You must put the copy in a directory early in 'runtimepath'. For Unix, for |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
413 example, you could do this: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
414 cp $VIMRUNTIME/ftplugin/fortran.vim ~/.vim/ftplugin/fortran.vim |
32708
346703c4ddd1
Fix alignment in filetype.txt (#12618)
Christian Brabandt <cb@256bit.org>
parents:
32670
diff
changeset
|
415 < Then you can edit the copied file to your liking. Since the b:did_ftplugin |
32670
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
416 variable will be set, the global plugin will not be loaded. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
417 A disadvantage of this method is that when the distributed plugin gets |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
418 improved, you will have to copy and modify it again. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
419 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
420 3. Overrule the settings after loading the global plugin. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
421 You must create a new filetype plugin in a directory from the end of |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
422 'runtimepath'. For Unix, for example, you could use this file: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
423 vim ~/.vim/after/ftplugin/fortran.vim |
32708
346703c4ddd1
Fix alignment in filetype.txt (#12618)
Christian Brabandt <cb@256bit.org>
parents:
32670
diff
changeset
|
424 < In this file you can change just those settings that you want to change. |
32670
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
425 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
426 ============================================================================== |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
427 3. Docs for the default filetype plugins. *ftplugin-docs* |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
428 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
429 |
33203
c3c347a71e05
runtime: don't execute external commands when loading ftplugins
Christian Brabandt <cb@256bit.org>
parents:
32945
diff
changeset
|
430 *plugin_exec* *g:plugin_exec* |
c3c347a71e05
runtime: don't execute external commands when loading ftplugins
Christian Brabandt <cb@256bit.org>
parents:
32945
diff
changeset
|
431 Enable executing of external commands. This was done historically for e.g. |
c3c347a71e05
runtime: don't execute external commands when loading ftplugins
Christian Brabandt <cb@256bit.org>
parents:
32945
diff
changeset
|
432 the perl filetype plugin (and a few others) to set the search path. |
c3c347a71e05
runtime: don't execute external commands when loading ftplugins
Christian Brabandt <cb@256bit.org>
parents:
32945
diff
changeset
|
433 Disabled by default for security reasons: > |
c3c347a71e05
runtime: don't execute external commands when loading ftplugins
Christian Brabandt <cb@256bit.org>
parents:
32945
diff
changeset
|
434 :let g:plugin_exec = 1 |
c3c347a71e05
runtime: don't execute external commands when loading ftplugins
Christian Brabandt <cb@256bit.org>
parents:
32945
diff
changeset
|
435 It is also possible to enable this only for certain filetypes: > |
c3c347a71e05
runtime: don't execute external commands when loading ftplugins
Christian Brabandt <cb@256bit.org>
parents:
32945
diff
changeset
|
436 :let g:<filetype>_exec = 1 |
c3c347a71e05
runtime: don't execute external commands when loading ftplugins
Christian Brabandt <cb@256bit.org>
parents:
32945
diff
changeset
|
437 So to enable this only for ruby, set the following variable: > |
c3c347a71e05
runtime: don't execute external commands when loading ftplugins
Christian Brabandt <cb@256bit.org>
parents:
32945
diff
changeset
|
438 :let g:ruby_exec = 1 |
c3c347a71e05
runtime: don't execute external commands when loading ftplugins
Christian Brabandt <cb@256bit.org>
parents:
32945
diff
changeset
|
439 |
c3c347a71e05
runtime: don't execute external commands when loading ftplugins
Christian Brabandt <cb@256bit.org>
parents:
32945
diff
changeset
|
440 If both, the global `plugin_exec` and the `<filetype>_exec` specific variable |
33434
484543479bd7
runtime(doc): fix typos.
Christian Brabandt <cb@256bit.org>
parents:
33245
diff
changeset
|
441 are set, the filetype specific variable should have precedent. |
33203
c3c347a71e05
runtime: don't execute external commands when loading ftplugins
Christian Brabandt <cb@256bit.org>
parents:
32945
diff
changeset
|
442 |
34765
63dcbb94eefb
runtime(doc): sort filetype.txt in the alphabetical order (#14395)
Christian Brabandt <cb@256bit.org>
parents:
34429
diff
changeset
|
443 |
63dcbb94eefb
runtime(doc): sort filetype.txt in the alphabetical order (#14395)
Christian Brabandt <cb@256bit.org>
parents:
34429
diff
changeset
|
444 ASCIIDOC *ft-asciidoc-plugin* |
63dcbb94eefb
runtime(doc): sort filetype.txt in the alphabetical order (#14395)
Christian Brabandt <cb@256bit.org>
parents:
34429
diff
changeset
|
445 |
63dcbb94eefb
runtime(doc): sort filetype.txt in the alphabetical order (#14395)
Christian Brabandt <cb@256bit.org>
parents:
34429
diff
changeset
|
446 To enable |folding| use this: > |
63dcbb94eefb
runtime(doc): sort filetype.txt in the alphabetical order (#14395)
Christian Brabandt <cb@256bit.org>
parents:
34429
diff
changeset
|
447 let g:asciidoc_folding = 1 |
63dcbb94eefb
runtime(doc): sort filetype.txt in the alphabetical order (#14395)
Christian Brabandt <cb@256bit.org>
parents:
34429
diff
changeset
|
448 |
63dcbb94eefb
runtime(doc): sort filetype.txt in the alphabetical order (#14395)
Christian Brabandt <cb@256bit.org>
parents:
34429
diff
changeset
|
449 To disable nesting of folded headers use this: > |
63dcbb94eefb
runtime(doc): sort filetype.txt in the alphabetical order (#14395)
Christian Brabandt <cb@256bit.org>
parents:
34429
diff
changeset
|
450 let g:asciidoc_foldnested = 0 |
63dcbb94eefb
runtime(doc): sort filetype.txt in the alphabetical order (#14395)
Christian Brabandt <cb@256bit.org>
parents:
34429
diff
changeset
|
451 |
63dcbb94eefb
runtime(doc): sort filetype.txt in the alphabetical order (#14395)
Christian Brabandt <cb@256bit.org>
parents:
34429
diff
changeset
|
452 To disable folding everything under the title use this: > |
63dcbb94eefb
runtime(doc): sort filetype.txt in the alphabetical order (#14395)
Christian Brabandt <cb@256bit.org>
parents:
34429
diff
changeset
|
453 let asciidoc_fold_under_title = 0 |
63dcbb94eefb
runtime(doc): sort filetype.txt in the alphabetical order (#14395)
Christian Brabandt <cb@256bit.org>
parents:
34429
diff
changeset
|
454 |
63dcbb94eefb
runtime(doc): sort filetype.txt in the alphabetical order (#14395)
Christian Brabandt <cb@256bit.org>
parents:
34429
diff
changeset
|
455 |
35219
82cc33448f6b
runtime(arduino): Add Arduino ftplugin and indent files (#14811)
Christian Brabandt <cb@256bit.org>
parents:
34997
diff
changeset
|
456 ARDUINO *ft-arduino-plugin* |
82cc33448f6b
runtime(arduino): Add Arduino ftplugin and indent files (#14811)
Christian Brabandt <cb@256bit.org>
parents:
34997
diff
changeset
|
457 |
82cc33448f6b
runtime(arduino): Add Arduino ftplugin and indent files (#14811)
Christian Brabandt <cb@256bit.org>
parents:
34997
diff
changeset
|
458 By default the following options are set, in accordance with the default |
82cc33448f6b
runtime(arduino): Add Arduino ftplugin and indent files (#14811)
Christian Brabandt <cb@256bit.org>
parents:
34997
diff
changeset
|
459 settings of Arduino IDE: > |
82cc33448f6b
runtime(arduino): Add Arduino ftplugin and indent files (#14811)
Christian Brabandt <cb@256bit.org>
parents:
34997
diff
changeset
|
460 |
82cc33448f6b
runtime(arduino): Add Arduino ftplugin and indent files (#14811)
Christian Brabandt <cb@256bit.org>
parents:
34997
diff
changeset
|
461 setlocal expandtab tabstop=2 softtabstop=2 shiftwidth=2 |
82cc33448f6b
runtime(arduino): Add Arduino ftplugin and indent files (#14811)
Christian Brabandt <cb@256bit.org>
parents:
34997
diff
changeset
|
462 |
82cc33448f6b
runtime(arduino): Add Arduino ftplugin and indent files (#14811)
Christian Brabandt <cb@256bit.org>
parents:
34997
diff
changeset
|
463 To disable this behavior, set the following variable in your vimrc: > |
82cc33448f6b
runtime(arduino): Add Arduino ftplugin and indent files (#14811)
Christian Brabandt <cb@256bit.org>
parents:
34997
diff
changeset
|
464 |
82cc33448f6b
runtime(arduino): Add Arduino ftplugin and indent files (#14811)
Christian Brabandt <cb@256bit.org>
parents:
34997
diff
changeset
|
465 let g:arduino_recommended_style = 0 |
82cc33448f6b
runtime(arduino): Add Arduino ftplugin and indent files (#14811)
Christian Brabandt <cb@256bit.org>
parents:
34997
diff
changeset
|
466 |
82cc33448f6b
runtime(arduino): Add Arduino ftplugin and indent files (#14811)
Christian Brabandt <cb@256bit.org>
parents:
34997
diff
changeset
|
467 |
32670
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
468 AWK *ft-awk-plugin* |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
469 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
470 Support for features specific to GNU Awk, like @include, can be enabled by |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
471 setting: > |
33203
c3c347a71e05
runtime: don't execute external commands when loading ftplugins
Christian Brabandt <cb@256bit.org>
parents:
32945
diff
changeset
|
472 :let g:awk_is_gawk = 1 |
32670
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
473 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
474 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
475 CHANGELOG *ft-changelog-plugin* |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
476 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
477 Allows for easy entrance of Changelog entries in Changelog files. There are |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
478 some commands, mappings, and variables worth exploring: |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
479 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
480 Options: |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
481 'comments' is made empty to not mess up formatting. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
482 'textwidth' is set to 78, which is standard. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
483 'formatoptions' the 't' flag is added to wrap when inserting text. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
484 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
485 Commands: |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
486 NewChangelogEntry Adds a new Changelog entry in an intelligent fashion |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
487 (see below). |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
488 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
489 Local mappings: |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
490 <Leader>o Starts a new Changelog entry in an equally intelligent |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
491 fashion (see below). |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
492 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
493 Global mappings: |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
494 NOTE: The global mappings are accessed by sourcing the |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
495 ftplugin/changelog.vim file first, e.g. with > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
496 runtime ftplugin/changelog.vim |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
497 < in your |.vimrc|. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
498 <Leader>o Switches to the ChangeLog buffer opened for the |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
499 current directory, or opens it in a new buffer if it |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
500 exists in the current directory. Then it does the |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
501 same as the local <Leader>o described above. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
502 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
503 Variables: |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
504 g:changelog_timeformat Deprecated; use g:changelog_dateformat instead. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
505 g:changelog_dateformat The date (and time) format used in ChangeLog entries. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
506 The format accepted is the same as for the |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
507 |strftime()| function. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
508 The default is "%Y-%m-%d" which is the standard format |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
509 for many ChangeLog layouts. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
510 g:changelog_username The name and email address of the user. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
511 The default is deduced from environment variables and |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
512 system files. It searches /etc/passwd for the comment |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
513 part of the current user, which informally contains |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
514 the real name of the user up to the first separating |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
515 comma. then it checks the $NAME environment variable |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
516 and finally runs `whoami` and `hostname` to build an |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
517 email address. The final form is > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
518 Full Name <user@host> |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
519 < |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
520 g:changelog_new_date_format |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
521 The format to use when creating a new date-entry. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
522 The following table describes special tokens in the |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
523 string: |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
524 %% insert a single '%' character |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
525 %d insert the date from above |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
526 %u insert the user from above |
34429
a0754587f167
runtime(doc): fix inconsistent indent (#14089)
Christian Brabandt <cb@256bit.org>
parents:
34358
diff
changeset
|
527 %p insert result of b:changelog_entry_prefix |
32670
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
528 %c where to position cursor when done |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
529 The default is "%d %u\n\n\t* %p%c\n\n", which produces |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
530 something like (| is where cursor will be, unless at |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
531 the start of the line where it denotes the beginning |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
532 of the line) > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
533 |2003-01-14 Full Name <user@host> |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
534 | |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
535 | * prefix| |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
536 < |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
537 g:changelog_new_entry_format |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
538 The format used when creating a new entry. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
539 The following table describes special tokens in the |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
540 string: |
34429
a0754587f167
runtime(doc): fix inconsistent indent (#14089)
Christian Brabandt <cb@256bit.org>
parents:
34358
diff
changeset
|
541 %p insert result of b:changelog_entry_prefix |
32670
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
542 %c where to position cursor when done |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
543 The default is "\t*%c", which produces something |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
544 similar to > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
545 | * prefix| |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
546 < |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
547 g:changelog_date_entry_search |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
548 The search pattern to use when searching for a |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
549 date-entry. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
550 The same tokens that can be used for |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
551 g:changelog_new_date_format can be used here as well. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
552 The default is '^\s*%d\_s*%u' which finds lines |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
553 matching the form > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
554 |2003-01-14 Full Name <user@host> |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
555 < and some similar formats. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
556 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
557 g:changelog_date_end_entry_search |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
558 The search pattern to use when searching for the end |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
559 of a date-entry. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
560 The same tokens that can be used for |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
561 g:changelog_new_date_format can be used here as well. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
562 The default is '^\s*$' which finds lines that contain |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
563 only whitespace or are completely empty. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
564 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
565 b:changelog_name *b:changelog_name* |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
566 Name of the ChangeLog file to look for. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
567 The default is 'ChangeLog'. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
568 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
569 b:changelog_path |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
570 Path of the ChangeLog to use for the current buffer. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
571 The default is empty, thus looking for a file named |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
572 |b:changelog_name| in the same directory as the |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
573 current buffer. If not found, the parent directory of |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
574 the current buffer is searched. This continues |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
575 recursively until a file is found or there are no more |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
576 parent directories to search. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
577 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
578 b:changelog_entry_prefix |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
579 Name of a function to call to generate a prefix to a |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
580 new entry. This function takes no arguments and |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
581 should return a string containing the prefix. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
582 Returning an empty prefix is fine. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
583 The default generates the shortest path between the |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
584 ChangeLog's pathname and the current buffers pathname. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
585 In the future, it will also be possible to use other |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
586 variable contexts for this variable, for example, g:. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
587 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
588 The Changelog entries are inserted where they add the least amount of text. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
589 After figuring out the current date and user, the file is searched for an |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
590 entry beginning with the current date and user and if found adds another item |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
591 under it. If not found, a new entry and item is prepended to the beginning of |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
592 the Changelog. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
593 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
594 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
595 FORTRAN *ft-fortran-plugin* |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
596 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
597 Options: |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
598 'expandtab' is switched on to avoid tabs as required by the Fortran |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
599 standards unless the user has set fortran_have_tabs in .vimrc. |
33894
cf2ae76cbbf7
runtime(fortran): update syntax and ftplugins
Christian Brabandt <cb@256bit.org>
parents:
33434
diff
changeset
|
600 'textwidth' is set to 80 for fixed source format whereas it is set to 132 |
cf2ae76cbbf7
runtime(fortran): update syntax and ftplugins
Christian Brabandt <cb@256bit.org>
parents:
33434
diff
changeset
|
601 for free source format. Setting the fortran_extended_line_length |
cf2ae76cbbf7
runtime(fortran): update syntax and ftplugins
Christian Brabandt <cb@256bit.org>
parents:
33434
diff
changeset
|
602 variable increases the width to 132 for fixed source format. |
32670
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
603 'formatoptions' is set to break code and comment lines and to preserve long |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
604 lines. You can format comments with |gq|. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
605 For further discussion of fortran_have_tabs and the method used for the |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
606 detection of source format see |ft-fortran-syntax|. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
607 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
608 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
609 FREEBASIC *ft-freebasic-plugin* |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
610 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
611 This plugin aims to treat the four FreeBASIC dialects, "fb", "qb", "fblite" |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
612 and "deprecated", as distinct languages. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
613 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
614 The dialect will be set to the first name found in g:freebasic_forcelang, any |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
615 #lang directive or $lang metacommand in the file being edited, or finally |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
616 g:freebasic_lang. These global variables conceptually map to the fbc options |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
617 -forcelang and -lang. If no dialect is explicitly specified "fb" will be |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
618 used. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
619 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
620 For example, to set the dialect to a default of "fblite" but still allow for |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
621 any #lang directive overrides, use the following command: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
622 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
623 let g:freebasic_lang = "fblite" |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
624 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
625 |
35716
8195572b0b15
runtime(gdscript): add recommended indent options to ftplugin
Christian Brabandt <cb@256bit.org>
parents:
35702
diff
changeset
|
626 GDSCRIPT *ft-gdscript-plugin* |
8195572b0b15
runtime(gdscript): add recommended indent options to ftplugin
Christian Brabandt <cb@256bit.org>
parents:
35702
diff
changeset
|
627 |
8195572b0b15
runtime(gdscript): add recommended indent options to ftplugin
Christian Brabandt <cb@256bit.org>
parents:
35702
diff
changeset
|
628 By default the following options are set, based on Godot official docs: > |
8195572b0b15
runtime(gdscript): add recommended indent options to ftplugin
Christian Brabandt <cb@256bit.org>
parents:
35702
diff
changeset
|
629 |
8195572b0b15
runtime(gdscript): add recommended indent options to ftplugin
Christian Brabandt <cb@256bit.org>
parents:
35702
diff
changeset
|
630 setlocal noexpandtab softtabstop=0 shiftwidth=0 |
8195572b0b15
runtime(gdscript): add recommended indent options to ftplugin
Christian Brabandt <cb@256bit.org>
parents:
35702
diff
changeset
|
631 |
8195572b0b15
runtime(gdscript): add recommended indent options to ftplugin
Christian Brabandt <cb@256bit.org>
parents:
35702
diff
changeset
|
632 To disable this behavior, set the following variable in your vimrc: > |
8195572b0b15
runtime(gdscript): add recommended indent options to ftplugin
Christian Brabandt <cb@256bit.org>
parents:
35702
diff
changeset
|
633 |
8195572b0b15
runtime(gdscript): add recommended indent options to ftplugin
Christian Brabandt <cb@256bit.org>
parents:
35702
diff
changeset
|
634 let g:gdscript_recommended_style = 0 |
8195572b0b15
runtime(gdscript): add recommended indent options to ftplugin
Christian Brabandt <cb@256bit.org>
parents:
35702
diff
changeset
|
635 |
8195572b0b15
runtime(gdscript): add recommended indent options to ftplugin
Christian Brabandt <cb@256bit.org>
parents:
35702
diff
changeset
|
636 |
32670
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
637 GIT COMMIT *ft-gitcommit-plugin* |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
638 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
639 One command, :DiffGitCached, is provided to show a diff of the current commit |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
640 in the preview window. It is equivalent to calling "git diff --cached" plus |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
641 any arguments given to the command. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
642 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
643 |
35717
99d97826842a
runtime(go): add recommended indent options to ftplugin
Christian Brabandt <cb@256bit.org>
parents:
35716
diff
changeset
|
644 GO *ft-go-plugin* |
99d97826842a
runtime(go): add recommended indent options to ftplugin
Christian Brabandt <cb@256bit.org>
parents:
35716
diff
changeset
|
645 |
99d97826842a
runtime(go): add recommended indent options to ftplugin
Christian Brabandt <cb@256bit.org>
parents:
35716
diff
changeset
|
646 By default the following options are set, based on Golang official docs: > |
99d97826842a
runtime(go): add recommended indent options to ftplugin
Christian Brabandt <cb@256bit.org>
parents:
35716
diff
changeset
|
647 |
99d97826842a
runtime(go): add recommended indent options to ftplugin
Christian Brabandt <cb@256bit.org>
parents:
35716
diff
changeset
|
648 setlocal noexpandtab softtabstop=0 shiftwidth=0 |
99d97826842a
runtime(go): add recommended indent options to ftplugin
Christian Brabandt <cb@256bit.org>
parents:
35716
diff
changeset
|
649 |
99d97826842a
runtime(go): add recommended indent options to ftplugin
Christian Brabandt <cb@256bit.org>
parents:
35716
diff
changeset
|
650 To disable this behavior, set the following variable in your vimrc: > |
99d97826842a
runtime(go): add recommended indent options to ftplugin
Christian Brabandt <cb@256bit.org>
parents:
35716
diff
changeset
|
651 |
99d97826842a
runtime(go): add recommended indent options to ftplugin
Christian Brabandt <cb@256bit.org>
parents:
35716
diff
changeset
|
652 let g:go_recommended_style = 0 |
99d97826842a
runtime(go): add recommended indent options to ftplugin
Christian Brabandt <cb@256bit.org>
parents:
35716
diff
changeset
|
653 |
99d97826842a
runtime(go): add recommended indent options to ftplugin
Christian Brabandt <cb@256bit.org>
parents:
35716
diff
changeset
|
654 |
32670
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
655 GPROF *ft-gprof-plugin* |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
656 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
657 The gprof filetype plugin defines a mapping <C-]> to jump from a function |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
658 entry in the gprof flat profile or from a function entry in the call graph |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
659 to the details of that function in the call graph. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
660 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
661 The mapping can be disabled with: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
662 let g:no_gprof_maps = 1 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
663 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
664 |
35266
ea0402ba92f6
patch 9.1.0442: hare runtime files outdated
Christian Brabandt <cb@256bit.org>
parents:
35236
diff
changeset
|
665 HARE *ft-hare* |
ea0402ba92f6
patch 9.1.0442: hare runtime files outdated
Christian Brabandt <cb@256bit.org>
parents:
35236
diff
changeset
|
666 |
ea0402ba92f6
patch 9.1.0442: hare runtime files outdated
Christian Brabandt <cb@256bit.org>
parents:
35236
diff
changeset
|
667 Since the text for this plugin is rather long it has been put in a separate |
ea0402ba92f6
patch 9.1.0442: hare runtime files outdated
Christian Brabandt <cb@256bit.org>
parents:
35236
diff
changeset
|
668 file: |ft_hare.txt|. |
ea0402ba92f6
patch 9.1.0442: hare runtime files outdated
Christian Brabandt <cb@256bit.org>
parents:
35236
diff
changeset
|
669 |
ea0402ba92f6
patch 9.1.0442: hare runtime files outdated
Christian Brabandt <cb@256bit.org>
parents:
35236
diff
changeset
|
670 |
34997
6130f51d7db3
runtime(java): Support "g:ftplugin_java_source_path" with archived files
Christian Brabandt <cb@256bit.org>
parents:
34822
diff
changeset
|
671 JAVA *ft-java-plugin* |
6130f51d7db3
runtime(java): Support "g:ftplugin_java_source_path" with archived files
Christian Brabandt <cb@256bit.org>
parents:
34822
diff
changeset
|
672 |
6130f51d7db3
runtime(java): Support "g:ftplugin_java_source_path" with archived files
Christian Brabandt <cb@256bit.org>
parents:
34822
diff
changeset
|
673 Whenever the variable "g:ftplugin_java_source_path" is defined and its value |
6130f51d7db3
runtime(java): Support "g:ftplugin_java_source_path" with archived files
Christian Brabandt <cb@256bit.org>
parents:
34822
diff
changeset
|
674 is a filename whose extension is either ".jar" or ".zip", e.g.: > |
6130f51d7db3
runtime(java): Support "g:ftplugin_java_source_path" with archived files
Christian Brabandt <cb@256bit.org>
parents:
34822
diff
changeset
|
675 let g:ftplugin_java_source_path = '/path/to/src.jar' |
6130f51d7db3
runtime(java): Support "g:ftplugin_java_source_path" with archived files
Christian Brabandt <cb@256bit.org>
parents:
34822
diff
changeset
|
676 let g:ftplugin_java_source_path = '/path/to/src.zip' |
6130f51d7db3
runtime(java): Support "g:ftplugin_java_source_path" with archived files
Christian Brabandt <cb@256bit.org>
parents:
34822
diff
changeset
|
677 < |
6130f51d7db3
runtime(java): Support "g:ftplugin_java_source_path" with archived files
Christian Brabandt <cb@256bit.org>
parents:
34822
diff
changeset
|
678 and the |zip| plugin has already been sourced, the |gf| command can be used to |
6130f51d7db3
runtime(java): Support "g:ftplugin_java_source_path" with archived files
Christian Brabandt <cb@256bit.org>
parents:
34822
diff
changeset
|
679 open the archive and the |n| command can be used to look for the selected type |
6130f51d7db3
runtime(java): Support "g:ftplugin_java_source_path" with archived files
Christian Brabandt <cb@256bit.org>
parents:
34822
diff
changeset
|
680 and the <Return> key can be used to load a listed file. |
6130f51d7db3
runtime(java): Support "g:ftplugin_java_source_path" with archived files
Christian Brabandt <cb@256bit.org>
parents:
34822
diff
changeset
|
681 |
6130f51d7db3
runtime(java): Support "g:ftplugin_java_source_path" with archived files
Christian Brabandt <cb@256bit.org>
parents:
34822
diff
changeset
|
682 Note that the effect of using the "gf" command WITHIN a buffer loaded with the |
6130f51d7db3
runtime(java): Support "g:ftplugin_java_source_path" with archived files
Christian Brabandt <cb@256bit.org>
parents:
34822
diff
changeset
|
683 Zip plugin depends on the version of the Zip plugin. For the Zip plugin |
6130f51d7db3
runtime(java): Support "g:ftplugin_java_source_path" with archived files
Christian Brabandt <cb@256bit.org>
parents:
34822
diff
changeset
|
684 versions that do not support Jar type archives, consider creating symbolic |
6130f51d7db3
runtime(java): Support "g:ftplugin_java_source_path" with archived files
Christian Brabandt <cb@256bit.org>
parents:
34822
diff
changeset
|
685 links with the ".zip" extension for each Jar archive of interest and assigning |
6130f51d7db3
runtime(java): Support "g:ftplugin_java_source_path" with archived files
Christian Brabandt <cb@256bit.org>
parents:
34822
diff
changeset
|
686 any such file to the variable from now on. |
6130f51d7db3
runtime(java): Support "g:ftplugin_java_source_path" with archived files
Christian Brabandt <cb@256bit.org>
parents:
34822
diff
changeset
|
687 |
6130f51d7db3
runtime(java): Support "g:ftplugin_java_source_path" with archived files
Christian Brabandt <cb@256bit.org>
parents:
34822
diff
changeset
|
688 Otherwise, for the defined variable "g:ftplugin_java_source_path", the local |
6130f51d7db3
runtime(java): Support "g:ftplugin_java_source_path" with archived files
Christian Brabandt <cb@256bit.org>
parents:
34822
diff
changeset
|
689 value of the 'path' option will be further modified by prefixing the value of |
6130f51d7db3
runtime(java): Support "g:ftplugin_java_source_path" with archived files
Christian Brabandt <cb@256bit.org>
parents:
34822
diff
changeset
|
690 the variable, e.g.: > |
6130f51d7db3
runtime(java): Support "g:ftplugin_java_source_path" with archived files
Christian Brabandt <cb@256bit.org>
parents:
34822
diff
changeset
|
691 let g:ftplugin_java_source_path = $JDK_SRC_PATH |
6130f51d7db3
runtime(java): Support "g:ftplugin_java_source_path" with archived files
Christian Brabandt <cb@256bit.org>
parents:
34822
diff
changeset
|
692 let &l:path = g:ftplugin_java_source_path . ',' . &l:path |
6130f51d7db3
runtime(java): Support "g:ftplugin_java_source_path" with archived files
Christian Brabandt <cb@256bit.org>
parents:
34822
diff
changeset
|
693 < |
6130f51d7db3
runtime(java): Support "g:ftplugin_java_source_path" with archived files
Christian Brabandt <cb@256bit.org>
parents:
34822
diff
changeset
|
694 and the "gf" command can be used on a fully-qualified type to look for a file |
6130f51d7db3
runtime(java): Support "g:ftplugin_java_source_path" with archived files
Christian Brabandt <cb@256bit.org>
parents:
34822
diff
changeset
|
695 in the "path" and to try to load it. |
6130f51d7db3
runtime(java): Support "g:ftplugin_java_source_path" with archived files
Christian Brabandt <cb@256bit.org>
parents:
34822
diff
changeset
|
696 |
6130f51d7db3
runtime(java): Support "g:ftplugin_java_source_path" with archived files
Christian Brabandt <cb@256bit.org>
parents:
34822
diff
changeset
|
697 Remember to manually trigger the |FileType| event from a buffer with a Java |
6130f51d7db3
runtime(java): Support "g:ftplugin_java_source_path" with archived files
Christian Brabandt <cb@256bit.org>
parents:
34822
diff
changeset
|
698 file loaded in it each time after assigning a new value to the variable: > |
6130f51d7db3
runtime(java): Support "g:ftplugin_java_source_path" with archived files
Christian Brabandt <cb@256bit.org>
parents:
34822
diff
changeset
|
699 doautocmd FileType |
6130f51d7db3
runtime(java): Support "g:ftplugin_java_source_path" with archived files
Christian Brabandt <cb@256bit.org>
parents:
34822
diff
changeset
|
700 < |
6130f51d7db3
runtime(java): Support "g:ftplugin_java_source_path" with archived files
Christian Brabandt <cb@256bit.org>
parents:
34822
diff
changeset
|
701 |
33904
c2955068ea16
runtime(json): Add json formating plugin (Issue #11426) (#11506)
Christian Brabandt <cb@256bit.org>
parents:
33894
diff
changeset
|
702 JSON-FORMAT *ft-json-plugin* |
c2955068ea16
runtime(json): Add json formating plugin (Issue #11426) (#11506)
Christian Brabandt <cb@256bit.org>
parents:
33894
diff
changeset
|
703 |
c2955068ea16
runtime(json): Add json formating plugin (Issue #11426) (#11506)
Christian Brabandt <cb@256bit.org>
parents:
33894
diff
changeset
|
704 JSON filetype can be extended to use 'formatexpr' and "json.FormatExpr()" |
c2955068ea16
runtime(json): Add json formating plugin (Issue #11426) (#11506)
Christian Brabandt <cb@256bit.org>
parents:
33894
diff
changeset
|
705 function for json formatting (using |gq|). |
c2955068ea16
runtime(json): Add json formating plugin (Issue #11426) (#11506)
Christian Brabandt <cb@256bit.org>
parents:
33894
diff
changeset
|
706 |
c2955068ea16
runtime(json): Add json formating plugin (Issue #11426) (#11506)
Christian Brabandt <cb@256bit.org>
parents:
33894
diff
changeset
|
707 Add following lines to $HOME/.vim/ftplugin/json.vim: > |
c2955068ea16
runtime(json): Add json formating plugin (Issue #11426) (#11506)
Christian Brabandt <cb@256bit.org>
parents:
33894
diff
changeset
|
708 |
c2955068ea16
runtime(json): Add json formating plugin (Issue #11426) (#11506)
Christian Brabandt <cb@256bit.org>
parents:
33894
diff
changeset
|
709 vim9script |
c2955068ea16
runtime(json): Add json formating plugin (Issue #11426) (#11506)
Christian Brabandt <cb@256bit.org>
parents:
33894
diff
changeset
|
710 import autoload 'dist/json.vim' |
c2955068ea16
runtime(json): Add json formating plugin (Issue #11426) (#11506)
Christian Brabandt <cb@256bit.org>
parents:
33894
diff
changeset
|
711 setl formatexpr=json.FormatExpr() |
c2955068ea16
runtime(json): Add json formating plugin (Issue #11426) (#11506)
Christian Brabandt <cb@256bit.org>
parents:
33894
diff
changeset
|
712 |
c2955068ea16
runtime(json): Add json formating plugin (Issue #11426) (#11506)
Christian Brabandt <cb@256bit.org>
parents:
33894
diff
changeset
|
713 |
32670
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
714 MAIL *ft-mail-plugin* |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
715 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
716 Options: |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
717 'modeline' is switched off to avoid the danger of trojan horses, and to |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
718 avoid that a Subject line with "Vim:" in it will cause an |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
719 error message. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
720 'textwidth' is set to 72. This is often recommended for e-mail. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
721 'formatoptions' is set to break text lines and to repeat the comment leader |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
722 in new lines, so that a leading ">" for quotes is repeated. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
723 You can also format quoted text with |gq|. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
724 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
725 Local mappings: |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
726 <LocalLeader>q or \\MailQuote |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
727 Quotes the text selected in Visual mode, or from the cursor position |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
728 to the end of the file in Normal mode. This means "> " is inserted in |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
729 each line. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
730 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
731 MAN *ft-man-plugin* *:Man* *man.vim* |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
732 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
733 This plugin displays a manual page in a nice way. See |find-manpage| in the |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
734 user manual for more information. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
735 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
736 To start using the |:Man| command before any manual page has been loaded, |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
737 source this script from your startup |vimrc| file: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
738 runtime ftplugin/man.vim |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
739 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
740 Options: |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
741 'iskeyword' The '.' character is added to support the use of CTRL-] on the |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
742 manual page name. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
743 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
744 Commands: |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
745 Man {name} Display the manual page for {name} in a window. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
746 Man {number} {name} |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
747 Display the manual page for {name} in a section {number}. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
748 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
749 Global mapping: |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
750 <Leader>K Displays the manual page for the word under the cursor. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
751 <Plug>ManPreGetPage |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
752 idem, allows for using a mapping: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
753 nmap <F1> <Plug>ManPreGetPage |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
754 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
755 Local mappings: |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
756 CTRL-] Jump to the manual page for the word under the cursor. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
757 CTRL-T Jump back to the previous manual page. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
758 q Same as the |:quit| command. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
759 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
760 To use a vertical split instead of horizontal: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
761 let g:ft_man_open_mode = 'vert' |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
762 To use a new tab: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
763 let g:ft_man_open_mode = 'tab' |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
764 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
765 To enable |folding|, use this: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
766 let g:ft_man_folding_enable = 1 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
767 If you do not like the default folding, use an |autocommand| to add your desired |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
768 folding style instead. For example: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
769 autocmd FileType man setlocal foldmethod=indent foldenable |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
770 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
771 If you would like :Man {number} {name} to behave like man {number} {name} by |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
772 not running man {name} if no page is found, then use this: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
773 let g:ft_man_no_sect_fallback = 1 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
774 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
775 You may also want to set 'keywordprg' to make the |K| command open a manual |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
776 page in a Vim window: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
777 set keywordprg=:Man |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
778 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
779 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
780 MANPAGER *manpager.vim* |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
781 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
782 The |:Man| command allows you to turn Vim into a manpager (that syntax |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
783 highlights manpages and follows linked manpages on hitting CTRL-]). |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
784 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
785 For bash,zsh,ksh or dash, add to the config file (.bashrc,.zshrc, ...) |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
786 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
787 export MANPAGER="vim +MANPAGER --not-a-term -" |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
788 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
789 For (t)csh, add to the config file |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
790 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
791 setenv MANPAGER "vim +MANPAGER --not-a-term -" |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
792 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
793 For fish, add to the config file |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
794 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
795 set -x MANPAGER "vim +MANPAGER --not-a-term -" |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
796 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
797 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
798 MARKDOWN *ft-markdown-plugin* |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
799 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
800 To enable folding use this: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
801 let g:markdown_folding = 1 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
802 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
803 'expandtab' will be set by default. If you do not want that use this: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
804 let g:markdown_recommended_style = 0 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
805 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
806 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
807 PDF *ft-pdf-plugin* |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
808 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
809 Two maps, <C-]> and <C-T>, are provided to simulate a tag stack for navigating |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
810 the PDF. The following are treated as tags: |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
811 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
812 - The byte offset after "startxref" to the xref table |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
813 - The byte offset after the /Prev key in the trailer to an earlier xref table |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
814 - A line of the form "0123456789 00000 n" in the xref table |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
815 - An object reference like "1 0 R" anywhere in the PDF |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
816 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
817 These maps can be disabled with > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
818 :let g:no_pdf_maps = 1 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
819 < |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
820 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
821 PYTHON *ft-python-plugin* *PEP8* |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
822 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
823 By default the following options are set, in accordance with PEP8: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
824 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
825 setlocal expandtab shiftwidth=4 softtabstop=4 tabstop=8 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
826 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
827 To disable this behavior, set the following variable in your vimrc: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
828 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
829 let g:python_recommended_style = 0 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
830 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
831 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
832 QF QUICKFIX *qf.vim* *ft-qf-plugin* |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
833 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
834 The "qf" filetype is used for the quickfix window, see |quickfix-window|. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
835 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
836 The quickfix filetype plugin includes configuration for displaying the command |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
837 that produced the quickfix list in the |status-line|. To disable this setting, |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
838 configure as follows: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
839 :let g:qf_disable_statusline = 1 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
840 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
841 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
842 R MARKDOWN *ft-rmd-plugin* |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
843 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
844 By default ftplugin/html.vim is not sourced. If you want it sourced, add to |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
845 your |vimrc|: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
846 let rmd_include_html = 1 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
847 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
848 The 'formatexpr' option is set dynamically with different values for R code |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
849 and for Markdown code. If you prefer that 'formatexpr' is not set, add to your |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
850 |vimrc|: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
851 let rmd_dynamic_comments = 0 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
852 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
853 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
854 R RESTRUCTURED TEXT *ft-rrst-plugin* |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
855 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
856 The 'formatexpr' option is set dynamically with different values for R code |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
857 and for ReStructured text. If you prefer that 'formatexpr' is not set, add to |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
858 your |vimrc|: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
859 let rrst_dynamic_comments = 0 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
860 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
861 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
862 RESTRUCTUREDTEXT *ft-rst-plugin* |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
863 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
864 The following formatting setting are optionally available: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
865 setlocal expandtab shiftwidth=3 softtabstop=3 tabstop=8 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
866 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
867 To enable this behavior, set the following variable in your vimrc: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
868 let g:rst_style = 1 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
869 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
870 |
34016
34f6f3678cae
runtime(r): Update R runtime files and docs (#13757)
Christian Brabandt <cb@256bit.org>
parents:
33904
diff
changeset
|
871 RNOWEB *ft-rnoweb-plugin* |
34f6f3678cae
runtime(r): Update R runtime files and docs (#13757)
Christian Brabandt <cb@256bit.org>
parents:
33904
diff
changeset
|
872 |
34f6f3678cae
runtime(r): Update R runtime files and docs (#13757)
Christian Brabandt <cb@256bit.org>
parents:
33904
diff
changeset
|
873 The 'formatexpr' option is set dynamically with different values for R code |
34f6f3678cae
runtime(r): Update R runtime files and docs (#13757)
Christian Brabandt <cb@256bit.org>
parents:
33904
diff
changeset
|
874 and for LaTeX code. If you prefer that 'formatexpr' is not set, add to your |
34f6f3678cae
runtime(r): Update R runtime files and docs (#13757)
Christian Brabandt <cb@256bit.org>
parents:
33904
diff
changeset
|
875 |vimrc|: > |
34f6f3678cae
runtime(r): Update R runtime files and docs (#13757)
Christian Brabandt <cb@256bit.org>
parents:
33904
diff
changeset
|
876 let rnw_dynamic_comments = 0 |
34f6f3678cae
runtime(r): Update R runtime files and docs (#13757)
Christian Brabandt <cb@256bit.org>
parents:
33904
diff
changeset
|
877 |
34f6f3678cae
runtime(r): Update R runtime files and docs (#13757)
Christian Brabandt <cb@256bit.org>
parents:
33904
diff
changeset
|
878 |
32670
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
879 RPM SPEC *ft-spec-plugin* |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
880 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
881 Since the text for this plugin is rather long it has been put in a separate |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
882 file: |pi_spec.txt|. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
883 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
884 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
885 RUST *ft-rust* |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
886 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
887 Since the text for this plugin is rather long it has been put in a separate |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
888 file: |ft_rust.txt|. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
889 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
890 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
891 SQL *ft-sql* |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
892 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
893 Since the text for this plugin is rather long it has been put in a separate |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
894 file: |ft_sql.txt|. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
895 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
896 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
897 TEX *ft-tex-plugin* *g:tex_flavor* |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
898 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
899 If the first line of a *.tex file has the form > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
900 %&<format> |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
901 then this determined the file type: plaintex (for plain TeX), context (for |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
902 ConTeXt), or tex (for LaTeX). Otherwise, the file is searched for keywords to |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
903 choose context or tex. If no keywords are found, it defaults to plaintex. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
904 You can change the default by defining the variable g:tex_flavor to the format |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
905 (not the file type) you use most. Use one of these: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
906 let g:tex_flavor = "plain" |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
907 let g:tex_flavor = "context" |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
908 let g:tex_flavor = "latex" |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
909 Currently no other formats are recognized. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
910 |
35702
a6c234fffe90
runtime(typst): Add typst runtime files
Christian Brabandt <cb@256bit.org>
parents:
35474
diff
changeset
|
911 TYPST *ft-typst-plugin* |
a6c234fffe90
runtime(typst): Add typst runtime files
Christian Brabandt <cb@256bit.org>
parents:
35474
diff
changeset
|
912 |
a6c234fffe90
runtime(typst): Add typst runtime files
Christian Brabandt <cb@256bit.org>
parents:
35474
diff
changeset
|
913 *g:typst_conceal* |
a6c234fffe90
runtime(typst): Add typst runtime files
Christian Brabandt <cb@256bit.org>
parents:
35474
diff
changeset
|
914 When |TRUE| the Typst filetype plugin will set the 'conceallevel' option to 2. |
32670
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
915 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
916 VIM *ft-vim-plugin* |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
917 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
918 The Vim filetype plugin defines mappings to move to the start and end of |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
919 functions with [[ and ]]. Move around comments with ]" and [". |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
920 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
921 The mappings can be disabled with: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
922 let g:no_vim_maps = 1 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
923 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
924 |
35236
3b6868b38118
runtime(zig): refactor zig ftplugin, remove auto format
Christian Brabandt <cb@256bit.org>
parents:
35219
diff
changeset
|
925 ZIG *ft-zig-plugin* |
3b6868b38118
runtime(zig): refactor zig ftplugin, remove auto format
Christian Brabandt <cb@256bit.org>
parents:
35219
diff
changeset
|
926 |
3b6868b38118
runtime(zig): refactor zig ftplugin, remove auto format
Christian Brabandt <cb@256bit.org>
parents:
35219
diff
changeset
|
927 *g:zig_recommended_style* |
3b6868b38118
runtime(zig): refactor zig ftplugin, remove auto format
Christian Brabandt <cb@256bit.org>
parents:
35219
diff
changeset
|
928 By default the following indentation options are set, in accordance with Zig's |
3b6868b38118
runtime(zig): refactor zig ftplugin, remove auto format
Christian Brabandt <cb@256bit.org>
parents:
35219
diff
changeset
|
929 recommended style (https://ziglang.org/documentation/master/): > |
3b6868b38118
runtime(zig): refactor zig ftplugin, remove auto format
Christian Brabandt <cb@256bit.org>
parents:
35219
diff
changeset
|
930 |
3b6868b38118
runtime(zig): refactor zig ftplugin, remove auto format
Christian Brabandt <cb@256bit.org>
parents:
35219
diff
changeset
|
931 setlocal expandtab shiftwidth=4 softtabstop=4 tabstop=8 |
3b6868b38118
runtime(zig): refactor zig ftplugin, remove auto format
Christian Brabandt <cb@256bit.org>
parents:
35219
diff
changeset
|
932 < |
3b6868b38118
runtime(zig): refactor zig ftplugin, remove auto format
Christian Brabandt <cb@256bit.org>
parents:
35219
diff
changeset
|
933 To disable this behavior, set |g:zig_recommended_style| to 0: > |
3b6868b38118
runtime(zig): refactor zig ftplugin, remove auto format
Christian Brabandt <cb@256bit.org>
parents:
35219
diff
changeset
|
934 |
3b6868b38118
runtime(zig): refactor zig ftplugin, remove auto format
Christian Brabandt <cb@256bit.org>
parents:
35219
diff
changeset
|
935 let g:zig_recommended_style = 0 |
3b6868b38118
runtime(zig): refactor zig ftplugin, remove auto format
Christian Brabandt <cb@256bit.org>
parents:
35219
diff
changeset
|
936 < |
3b6868b38118
runtime(zig): refactor zig ftplugin, remove auto format
Christian Brabandt <cb@256bit.org>
parents:
35219
diff
changeset
|
937 *g:zig_std_dir* |
3b6868b38118
runtime(zig): refactor zig ftplugin, remove auto format
Christian Brabandt <cb@256bit.org>
parents:
35219
diff
changeset
|
938 The path to the Zig standard library. The Zig |ftplugin| reads |g:zig_std_dir| |
3b6868b38118
runtime(zig): refactor zig ftplugin, remove auto format
Christian Brabandt <cb@256bit.org>
parents:
35219
diff
changeset
|
939 and appends it to the 'path' for Zig files. Where the Zig standard library |
3b6868b38118
runtime(zig): refactor zig ftplugin, remove auto format
Christian Brabandt <cb@256bit.org>
parents:
35219
diff
changeset
|
940 is located is system and installation method dependent. |
3b6868b38118
runtime(zig): refactor zig ftplugin, remove auto format
Christian Brabandt <cb@256bit.org>
parents:
35219
diff
changeset
|
941 |
3b6868b38118
runtime(zig): refactor zig ftplugin, remove auto format
Christian Brabandt <cb@256bit.org>
parents:
35219
diff
changeset
|
942 One can automatically set |g:zig_std_dir| using `zig env`: > |
3b6868b38118
runtime(zig): refactor zig ftplugin, remove auto format
Christian Brabandt <cb@256bit.org>
parents:
35219
diff
changeset
|
943 |
3b6868b38118
runtime(zig): refactor zig ftplugin, remove auto format
Christian Brabandt <cb@256bit.org>
parents:
35219
diff
changeset
|
944 let g:zig_std_dir = json_decode(system('zig env'))['std_dir'] |
3b6868b38118
runtime(zig): refactor zig ftplugin, remove auto format
Christian Brabandt <cb@256bit.org>
parents:
35219
diff
changeset
|
945 < |
3b6868b38118
runtime(zig): refactor zig ftplugin, remove auto format
Christian Brabandt <cb@256bit.org>
parents:
35219
diff
changeset
|
946 This can, for example, be put in a FileType |:autocmd| or user |ftplugin| to |
3b6868b38118
runtime(zig): refactor zig ftplugin, remove auto format
Christian Brabandt <cb@256bit.org>
parents:
35219
diff
changeset
|
947 only load when a Zig file is opened. |
3b6868b38118
runtime(zig): refactor zig ftplugin, remove auto format
Christian Brabandt <cb@256bit.org>
parents:
35219
diff
changeset
|
948 |
3b6868b38118
runtime(zig): refactor zig ftplugin, remove auto format
Christian Brabandt <cb@256bit.org>
parents:
35219
diff
changeset
|
949 |
32670
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
950 ZIMBU *ft-zimbu-plugin* |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
951 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
952 The Zimbu filetype plugin defines mappings to move to the start and end of |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
953 functions with [[ and ]]. |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
954 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
955 The mappings can be disabled with: > |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
956 let g:no_zimbu_maps = 1 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
957 < |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
958 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
959 |
695b50472e85
Fix line endings issue
Christian Brabandt <cb@256bit.org>
parents:
32669
diff
changeset
|
960 vim:tw=78:ts=8:noet:ft=help:norl: |