• Home
  • Raw
  • Download

Lines Matching +full:plugin +full:- +full:syntax +full:- +full:json +full:- +full:strings

2 <?xml-stylesheet type="text/xsl" href="styleguide.xsl"?>
19 This is the in-depth vimscript guide. If you're just a casual user
20 looking to write a plugin, the
62 with one of the magic control atoms. This future-proofs your
97 Always use case-explicit operators for strings (<code>=~#</code> and
105 This only applies for strings. <code>==</code> and
107 <code>&gt;=#</code> must be used for strings.
132 This rule applies when your regexes are matching syntax, external
172 The error text may be locale-dependant.
175 See <code>:help error-messages</code>.
212 <code>:help error-messages</code>.
224 See the plugin guide.
307 Exception: It's reasonable to use python for plugin functionality
345 Do not over-use this feature; it is not necessary for helper
361 Every function in your plugin should be specific to your
362 plugin.
373 <code>plugin-names-like-this</code>
376 Plugin names should be descriptive and concise.
383 Each plugin must consist of one directory (or code repository), sharing
384 a name with the plugin (with a "vim-" prefix or ".vim" suffix if
388 Plugin metadata should be declared in the addon-info.json format (see
389 …the <a href="https://github.com/MarcWeber/vim-addon-manager/blob/master/doc/vim-addon-manager-addi…
393 your plugin.
396 This allows them to be late-loaded, which speeds up startup
405 Each file in the <code>plugin/</code> or <code>instant/</code> directory
408 let [s:plugin, s:enter] = maktaba#plugin#Enter(expand('&lt;sfile&gt;:p'))
413 (This prevents re-entry and allows users to selectively disable
417 User configuration should be via plugin flags defined in
422 <code>call s:plugin.Flag('FLAGNAME', DEFAULT_VALUE)</code>.
432 occur either in the <code>plugin/</code> or the
436 All commands should be defined in <code>plugin/commands.vim</code>
440 Autocommands should be defined in <code>plugin/autocmds.vim</code>,
444 Mappings should be defined in <code>plugin/mappings.vim</code> and
448 If the plugin configures any standard vim settings, those should be
449 configured in <code>plugin/settings.vim</code> or
470 Separate library-providing plugins from command-providing plugins.
478 plugin functionality that affects the end user.
491 Use maktaba flags for plugin configuration. Users can configure them
509 Follow google-wide style conventions. Mimic google python style when
525 addon-info.json file (see the
526 …<a href="https://github.com/MarcWeber/vim-addon-manager/blob/master/doc/vim-addon-manager-addition…
533 Follow google-wide conventions.
548 syntax. This is inconsistently enforced by vimscript. To be
553 let s:variable = "concatenated " . "strings"
554 command -range=% MyCommand
557 let s:variable="concatenated "."strings"
558 command -range = % MyCommand
583 command -bang MyCommand call myplugin#foo()
587 command -bang MyCommand call myplugin#foo()
618 When continuing a multi-line command a pipe can be substituted
632 Do not continue multi-line commands when you can avoid it. Prefer
685 <code>plugin-names-like-this</code>,
717 It is very bad practice to introduce non-prefixed global
721 Global variables should only be used for plugin configuration.
730 Prefix script-local variables with <code>s:</code>
736 This also applies to script-local functions.
749 Prefix function-local variables with <code>l:</code>
759 <code>l:</code> disambiguates between function-local and
760 vim-predefined variables. For example, <code>count</code>
766 vim-predefined variables.
771 Prefix pre-defined vim variables with <code>v:</code>
786 Prefix buffer-local variables with <code>b:</code>
789 This is useful for plugins that keep per-buffer state.
797 <STYLEPOINT title="Strings">
803 Prefer single quoted strings. Specifically, in order of precedence:
817 quoted strings: <code>'example ('')'</code> represents the
828 Escapes can not be expressed in single quoted strings.
840 quoted strings.
843 Most strings in vimscript are regexes, so this provides maximum
849 If your non-regex string contains single quotes but no double
853 Don't bother escaping strings if you don't have to.
909 <li>Define in <code>plugin/commands.vim</code>.</li>
952 Plugins are guarded against re-entry, so a single vim session
953 should never attempt to re-define defined commands.
964 Pass non-argument command parameters (<code>&lt;bang&gt;</code>,
966 (<code>&lt;f-args&gt;</code>, etc.).
969 Otherwise variable-length argument functions are difficult to
985 non-maktaba plugins.
1009 <li>Define in <code>plugin/autocmds.vim</code>.</li>
1020 <code>plugin/autocmds.vim</code> file.
1024 <code>Glaive myplugin !plugin[autocmds]</code>.
1036 If your plugin only has one <code>augroup</code>, the
1037 <code>augroup</code> name should be the same as your plugin
1042 plugin name followed by an underscore.
1059 This allows your plugins to be re-enterable.
1072 <li>Prefix script-local functions with <code>s:</code></li>
1083 Prefix all script-local functions with <code>s:</code>
1089 Place two blank lines between top-level functions.
1113 This allows developers to re-source their scripts and have the
1118 always be either script-local or defined in an
1123 lead to cryptic errors if vim tries to re-source the file
1151 Top-level functions expecting errors may catch them and print
1165 Provide opt-in key mappings in <code>plugin/mappings.vim</code>.
1169 <code>plugin/plugs.vim</code> (unlike mappings.vim, plugs.vim is
1170 opt-out).
1177 Define key mappings in <code>plugin/mappings.vim</code>, using
1178 <code>maktaba#plugin#MapPrefix</code> to get a prefix.
1181 Mappings defined in the special <code>plugin/mappings.vim</code>
1183 <code>maktaba#plugin#Enter()</code> boilerplate).
1187 <code>Glaive myplugin plugin[mappings]</code>.
1201 You may provide pseudo-mappings using <code>&lt;Plug&gt;</code> and
1202 your plugin's name in <code>plugin/plugs.vim</code> (separate from
1215 to take advantage of your pseudo-mapping.
1218 Pseudo-mappings should <strong>not</strong> be in
1219 <code>plugin/mappings.vim</code> or they will be disabled by
1223 Such pseudo-mappings should be named <code>&lt;Plug&gt;</code>
1224 followed by your plugin name, a pound sign, and a unique mapping
1245 operator-pending modes.
1270 Declare dependencies in addon-info.json and use <code>maktaba</code>.
1274 Declaring dependencies in addon-info.json allows conformant plugin
1276 …<a href="https://github.com/MarcWeber/vim-addon-manager/blob/master/doc/vim-addon-manager-addition…
1281 don't include unsafe non-library files.
1288 Use <code>&lt;plugin-name&gt;#status#Status()</code> or its
1289 finer-grained variants to provide statusline flags.
1294 plugin should never modify the user's statusline except for when that
1295 is the only purpose of the plugin (powerline, etc.).
1304 <code>&lt;plugin-name&gt;#status</code> namespace.
1317 that the buffer is non-standard.
1338 Example: The file does not pass the syntax checker.
1348 empty strings or strings enclosed by square brackets, e.g.
1352 A trailing whitespace plugin might return <code>[$]</code> if
1356 A prose writing plugin might return <code>[write]</code> if vim
1363 <code>&lt;plugin-name&gt;#status#Status</code> function.
1366 It should return the first non-empty of <code>Error</code>,
1393 plugin.
1435 Lay out <code>plugin/</code> files in the following sections, if
1459 Script-local variables
1462 Script-local functions
1501 If you don't support vi-compatibility mode, fail gracefully.
1510 If you want your plugin to work in vim with vi compatibility on, you
1512 plugin file, clear them, and restore them at the end of each plugin
1513 file. See <code>:help use-cpo-save</code> for details.