From 50e129f5a70bf291e6ec3afb7927e68e1f98e790 Mon Sep 17 00:00:00 2001 From: Felipe Morales Date: Sat, 16 May 2015 04:10:38 -0300 Subject: defaults: Enable syntax and filetype plugins. --- runtime/doc/starting.txt | 39 ++++++++++++++++++++++++++------------- runtime/doc/vim_diff.txt | 9 +++++++-- 2 files changed, 33 insertions(+), 15 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt index ca02050cb8..900ec593bd 100644 --- a/runtime/doc/starting.txt +++ b/runtime/doc/starting.txt @@ -315,7 +315,8 @@ argument. When {vimrc} is equal to "NONE" (all uppercase), all initializations from files and environment variables are skipped, including reading the |ginit.vim| file when the GUI - starts. Loading plugins is also skipped. + starts. Loading plugins and enabling syntax highlighting are + also skipped. When {vimrc} is equal to "NORC" (all uppercase), this has the same effect as "NONE", but loading plugins is not skipped. @@ -391,7 +392,8 @@ accordingly. Vim proceeds in this order: All following initializations until 4. are skipped. $MYVIMRC is not set. "vim -u NORC" can be used to skip these initializations without - reading a file. "vim -u NONE" also skips loading plugins. |-u| + reading a file. "vim -u NONE" also skips loading plugins and enabling + syntax highlighting. |-u| If Vim was started in Ex mode with the "-s" argument, all following initializations until 4. are skipped. Only the "-u" option is @@ -424,7 +426,19 @@ accordingly. Vim proceeds in this order: - The file ".exrc" (for Unix) "_exrc" (for Win32) -4. Load the plugin scripts. *load-plugins* +4. Enable syntax highlighting. + This does the same as the command: > + :runtime! syntax/syntax.vim +< This can be skipped with the "-u NONE" command line argument. + +5. Enable filetype and indent plugins. + This does the same as the commands: > + :runtime! filetype.vim + :runtime! ftplugin.vim + :runtime! indent.vim +< This can be skipped with the "-u NONE" command line argument. + +6. Load the plugin scripts. *load-plugins* This does the same as the command: > :runtime! plugin/**/*.vim < The result is that all directories in the 'runtimepath' option will be @@ -440,31 +454,30 @@ accordingly. Vim proceeds in this order: commands from the command line have not been executed yet. You can use "--cmd 'set noloadplugins'" |--cmd|. -5. Set 'shellpipe' and 'shellredir' +7. Set 'shellpipe' and 'shellredir' The 'shellpipe' and 'shellredir' options are set according to the value of the 'shell' option, unless they have been set before. This means that Vim will figure out the values of 'shellpipe' and 'shellredir' for you, unless you have set them yourself. -6. Set 'updatecount' to zero, if "-n" command argument used +8. Set 'updatecount' to zero, if "-n" command argument used -7. Set binary options +9. Set binary options If the "-b" flag was given to Vim, the options for binary editing will be set now. See |-b|. -8. Perform GUI initializations +10. Perform GUI initializations Only when starting "gvim", the GUI initializations will be done. See |gui-init|. -9. Read the ShaDa file - If the 'shada' option is not empty, the ShaDa file is read. See - |shada-file|. +11. Read the ShaDa file + See |shada-file|. -10. Read the quickfix file +12. Read the quickfix file If the "-q" flag was given to Vim, the quickfix file is read. If this fails, Vim exits. -11. Open all windows +13. Open all windows When the |-o| flag was given, windows will be opened (but not displayed yet). When the |-p| flag was given, tab pages will be created (but not @@ -473,7 +486,7 @@ accordingly. Vim proceeds in this order: If the "-q" flag was given to Vim, the first error is jumped to. Buffers for all windows will be loaded. -12. Execute startup commands +14. Execute startup commands If a "-t" flag was given to Vim, the tag is jumped to. The commands given with the |-c| and |+cmd| arguments are executed. The starting flag is reset, has("vim_starting") will now return zero. diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index f76e901b9a..ac5efc6a1d 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -11,7 +11,7 @@ the "{Nvim}" tag. This document is a complete and centralized list of all these differences. 1. Configuration |nvim-configuration| -2. Option defaults |nvim-option-defaults| +2. Defaults |nvim-defaults| 3. Changed features |nvim-features-changed| 4. New features |nvim-features-new| 5. Missing legacy features |nvim-features-missing| @@ -28,7 +28,12 @@ these differences. session information. ============================================================================== -2. Option defaults *nvim-option-defaults* +2. Defaults *nvim-defaults* + +- Syntax highlighting is enabled by default +- Filetype-related plugins and scripts are enabled by default + Note: these defaults can be disabled with the "-u NONE" command line + argument. |-u| - 'autoindent' is set by default - 'autoread' is set by default -- cgit From da6299445a0fd52be5af2d7ea9ee539f12c20a73 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sat, 13 Feb 2016 17:06:33 -0500 Subject: ex_docmd: rename force_enable_filetype(). It is no longer forcing anything. --- runtime/doc/starting.txt | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt index 900ec593bd..ed3f379275 100644 --- a/runtime/doc/starting.txt +++ b/runtime/doc/starting.txt @@ -315,10 +315,10 @@ argument. When {vimrc} is equal to "NONE" (all uppercase), all initializations from files and environment variables are skipped, including reading the |ginit.vim| file when the GUI - starts. Loading plugins and enabling syntax highlighting are - also skipped. + starts. Plugins and syntax highlighting are also skipped. When {vimrc} is equal to "NORC" (all uppercase), this has the - same effect as "NONE", but loading plugins is not skipped. + same effect as "NONE", but plugins and syntax highlighting are + not skipped. *-i* -i {shada} The file {shada} is used instead of the default ShaDa @@ -392,8 +392,8 @@ accordingly. Vim proceeds in this order: All following initializations until 4. are skipped. $MYVIMRC is not set. "vim -u NORC" can be used to skip these initializations without - reading a file. "vim -u NONE" also skips loading plugins and enabling - syntax highlighting. |-u| + reading a file. "vim -u NONE" also skips plugins and syntax + highlighting. |-u| If Vim was started in Ex mode with the "-s" argument, all following initializations until 4. are skipped. Only the "-u" option is @@ -426,16 +426,17 @@ accordingly. Vim proceeds in this order: - The file ".exrc" (for Unix) "_exrc" (for Win32) -4. Enable syntax highlighting. - This does the same as the command: > - :runtime! syntax/syntax.vim -< This can be skipped with the "-u NONE" command line argument. - -5. Enable filetype and indent plugins. +4. Enable filetype and indent plugins. This does the same as the commands: > :runtime! filetype.vim :runtime! ftplugin.vim :runtime! indent.vim +< This step is skipped if ":filetype ..." was called before now or if + the "-u NONE" command line argument was given. + +5. Enable syntax highlighting. + This does the same as the command: > + :runtime! syntax/syntax.vim < This can be skipped with the "-u NONE" command line argument. 6. Load the plugin scripts. *load-plugins* -- cgit From 6c9c08c3703b2044bce2cdd5b20e66222cf46483 Mon Sep 17 00:00:00 2001 From: Felipe Morales Date: Sun, 14 Feb 2016 12:28:11 +0100 Subject: startup: respect earlier :filetype and :syntax. If user invokes :filetype or :syntax before startup defaults are applied, don't clobber their choices. --- runtime/doc/starting.txt | 4 +++- runtime/syntax/nosyntax.vim | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'runtime') diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt index ed3f379275..be108d4633 100644 --- a/runtime/doc/starting.txt +++ b/runtime/doc/starting.txt @@ -437,7 +437,9 @@ accordingly. Vim proceeds in this order: 5. Enable syntax highlighting. This does the same as the command: > :runtime! syntax/syntax.vim -< This can be skipped with the "-u NONE" command line argument. +< Note: This enables filetype detection even if ":filetype off" was + called before now. + This step is skipped if the "-u NONE" command line argument was given. 6. Load the plugin scripts. *load-plugins* This does the same as the command: > diff --git a/runtime/syntax/nosyntax.vim b/runtime/syntax/nosyntax.vim index 0ab3412373..3583cd0bc3 100644 --- a/runtime/syntax/nosyntax.vim +++ b/runtime/syntax/nosyntax.vim @@ -24,6 +24,9 @@ augroup END if exists("syntax_on") unlet syntax_on +else + " only used when starting, to disable the default syntax enable + let syntax_off = 1 endif if exists("syntax_manual") unlet syntax_manual -- cgit From cc2dce45d09fab2ec2269924942fdca7d5643e63 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 14 Feb 2016 15:14:38 -0500 Subject: startup: Avoid VimL global. Introduce TriState enum. - `syntax_on` is documented. Rather than introduce a new undocumented VimL global `g:syntax_off`, use a module-local flag. - Rename "maybe" functions to follow style guidelines (use standard module prefix) --- runtime/syntax/nosyntax.vim | 3 --- 1 file changed, 3 deletions(-) (limited to 'runtime') diff --git a/runtime/syntax/nosyntax.vim b/runtime/syntax/nosyntax.vim index 3583cd0bc3..0ab3412373 100644 --- a/runtime/syntax/nosyntax.vim +++ b/runtime/syntax/nosyntax.vim @@ -24,9 +24,6 @@ augroup END if exists("syntax_on") unlet syntax_on -else - " only used when starting, to disable the default syntax enable - let syntax_off = 1 endif if exists("syntax_manual") unlet syntax_manual -- cgit