diff options
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/syntax.txt | 3 | ||||
-rw-r--r-- | runtime/doc/usr_05.txt | 8 | ||||
-rw-r--r-- | runtime/doc/usr_06.txt | 24 | ||||
-rw-r--r-- | runtime/filetype.vim | 3 | ||||
-rw-r--r-- | runtime/indent/testdir/yaml.in | 6 | ||||
-rw-r--r-- | runtime/indent/testdir/yaml.ok | 6 | ||||
-rw-r--r-- | runtime/lua/vim/filetype.lua | 2 | ||||
-rw-r--r-- | runtime/lua/vim/shared.lua | 5 |
8 files changed, 28 insertions, 29 deletions
diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index b97f158c31..2a78d975ee 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -26,7 +26,8 @@ In the User Manual: 1. Quick start *:syn-qstart* *:syn-enable* *:syntax-enable* *:syn-on* *:syntax-on* -This command switches on syntax highlighting: > +Syntax highlighting is enabled by default. If you need to enable it again +after it was disabled (see below), use: > :syntax enable diff --git a/runtime/doc/usr_05.txt b/runtime/doc/usr_05.txt index b1ef563e43..1cf383dce3 100644 --- a/runtime/doc/usr_05.txt +++ b/runtime/doc/usr_05.txt @@ -139,13 +139,11 @@ quite complicated things. Still, it is just a sequence of commands that are executed like you typed them. > - syntax on set hlsearch -This switches on syntax highlighting. And the 'hlsearch' option tells Vim to -highlight matches with the last used search pattern. The "if" command is very -useful to set options only when some condition is met. More about that in -|usr_41.txt|. +This option tells Vim to highlight matches with the last used search pattern. +The "if" command is very useful to set options only when some condition is +met. More about that in |usr_41.txt|. *vimrc-filetype* > filetype plugin indent on diff --git a/runtime/doc/usr_06.txt b/runtime/doc/usr_06.txt index 360f72ec63..b99e0fb482 100644 --- a/runtime/doc/usr_06.txt +++ b/runtime/doc/usr_06.txt @@ -24,28 +24,8 @@ Table of contents: |usr_toc.txt| ============================================================================== *06.1* Switching it on -It all starts with one simple command: > - - :syntax enable - -That should work in most situations to get color in your files. Vim will -automagically detect the type of file and load the right syntax highlighting. -Suddenly comments are blue, keywords brown and strings red. This makes it -easy to overview the file. After a while you will find that black&white text -slows you down! - -If you always want to use syntax highlighting, put the ":syntax enable" -command in your |init.vim| file. - -If you want syntax highlighting only when the terminal supports colors, you -can put this in your |init.vim| file: > - - if &t_Co > 1 - syntax enable - endif - -If you want syntax highlighting only in the GUI version, put the ":syntax -enable" command in your |ginit.vim| file. +Syntax highlighting is enabled by default. Nvim will automagically detect the +type of file and load the right syntax highlighting. ============================================================================== *06.2* No or wrong colors? diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 7337647b03..8d0efb21d9 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1588,6 +1588,9 @@ au BufNewFile,BufRead *.rng setf rng " RPL/2 au BufNewFile,BufRead *.rpl setf rpl +" Robot Framework +au BufNewFile,BufRead *.robot,*.resource setf robot + " Robots.txt au BufNewFile,BufRead robots.txt setf robots diff --git a/runtime/indent/testdir/yaml.in b/runtime/indent/testdir/yaml.in index 8515e1752c..32ddc60956 100644 --- a/runtime/indent/testdir/yaml.in +++ b/runtime/indent/testdir/yaml.in @@ -17,3 +17,9 @@ map: val map: multiline value # END_INDENT + +# START_INDENT +map: | +line1 +line2 +# END_INDENT diff --git a/runtime/indent/testdir/yaml.ok b/runtime/indent/testdir/yaml.ok index 5ca2871fc9..becdb1bae1 100644 --- a/runtime/indent/testdir/yaml.ok +++ b/runtime/indent/testdir/yaml.ok @@ -17,3 +17,9 @@ map: val map: multiline value # END_INDENT + +# START_INDENT +map: | + line1 + line2 +# END_INDENT diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index 2a34fec7f2..f401de38f4 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -561,6 +561,8 @@ local extension = { snw = "rnoweb", Rnw = "rnoweb", Snw = "rnoweb", + robot = "robot", + resource = "robot", rsc = "routeros", x = "rpcgen", rpl = "rpl", diff --git a/runtime/lua/vim/shared.lua b/runtime/lua/vim/shared.lua index f0dc34608c..172fac3a88 100644 --- a/runtime/lua/vim/shared.lua +++ b/runtime/lua/vim/shared.lua @@ -365,7 +365,10 @@ function vim.tbl_get(o, ...) if #keys == 0 then return end - for _, k in ipairs(keys) do + for i, k in ipairs(keys) do + if type(o[k]) ~= 'table' and next(keys, i) then + return nil + end o = o[k] if o == nil then return |