diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2018-02-11 19:59:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-11 19:59:37 +0100 |
commit | f389196a344591da2f6cc2a63f4953e34316f954 (patch) | |
tree | 8cce092c29f33ae109dcf61e12e822d84aa014c7 /runtime | |
parent | 2cfc1b055bba6bb0f7e263a69079c7f52303a78a (diff) | |
parent | f26a4d484b486019c90fc55af5e74e33de374bc4 (diff) | |
download | rneovim-f389196a344591da2f6cc2a63f4953e34316f954.tar.gz rneovim-f389196a344591da2f6cc2a63f4953e34316f954.tar.bz2 rneovim-f389196a344591da2f6cc2a63f4953e34316f954.zip |
Merge #7960 'vim patches'
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/editing.txt | 12 | ||||
-rw-r--r-- | runtime/doc/vim_diff.txt | 2 | ||||
-rw-r--r-- | runtime/filetype.vim | 40 |
3 files changed, 39 insertions, 15 deletions
diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt index 1b9a1b38fb..5939cb8a8b 100644 --- a/runtime/doc/editing.txt +++ b/runtime/doc/editing.txt @@ -562,16 +562,16 @@ list of the current window. buffer. Also see |++opt| and |+cmd|. -:[count]arge[dit][!] [++opt] [+cmd] {name} *:arge* *:argedit* - Add {name} to the argument list and edit it. +:[count]arge[dit][!] [++opt] [+cmd] {name} .. *:arge* *:argedit* + Add {name}s to the argument list and edit it. When {name} already exists in the argument list, this entry is edited. This is like using |:argadd| and then |:edit|. - Note that only one file name is allowed, and spaces - inside the file name are allowed, like with |:edit|. + Spaces in filenames have to be escaped with "\". [count] is used like with |:argadd|. - [!] is required if the current file cannot be - |abandon|ed. + If the current file cannot be |abandon|ed {name}s will + still be added to the argument list, but won't be + edited. No check for duplicates is done. Also see |++opt| and |+cmd|. :[count]arga[dd] {name} .. *:arga* *:argadd* *E479* diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index d61c4d0c06..7426cd0940 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -376,7 +376,6 @@ MS-DOS support: Test functions: test_alloc_fail() test_autochdir() - test_disable_char_avail() test_garbagecollect_now() test_null_channel() test_null_dict() @@ -384,6 +383,7 @@ Test functions: test_null_list() test_null_partial() test_null_string() + test_override() test_settime() Other options: diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 76f76af345..a2e1f23bf1 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1019,7 +1019,7 @@ au BufNewFile,BufRead *.java,*.jav setf java au BufNewFile,BufRead *.jj,*.jjt setf javacc " JavaScript, ECMAScript -au BufNewFile,BufRead *.js,*.javascript,*.es,*.jsx setf javascript +au BufNewFile,BufRead *.js,*.javascript,*.es,*.jsx,*.mjs setf javascript " Java Server Pages au BufNewFile,BufRead *.jsp setf jsp @@ -1183,14 +1183,21 @@ au BufNewFile,BufRead *.markdown,*.mdown,*.mkd,*.mkdn,*.mdwn,*.md setf markdown " Mason au BufNewFile,BufRead *.mason,*.mhtml,*.comp setf mason -" Matlab or Objective C +" Mathematica, Matlab, Murphi or Objective C au BufNewFile,BufRead *.m call s:FTm() func! s:FTm() let n = 1 - while n < 10 + let saw_comment = 0 " Whether we've seen a multiline comment leader. + while n < 100 let line = getline(n) - if line =~ '^\s*\(#\s*\(include\|import\)\>\|@import\>\|/\*\|//\)' + if line =~ '^\s*/\*' + " /* ... */ is a comment in Objective C and Murphi, so we can't conclude + " it's either of them yet, but track this as a hint in case we don't see + " anything more definitive. + let saw_comment = 1 + endif + if line =~ '^\s*\(#\s*\(include\|import\)\>\|@import\>\|//\)' setf objc return endif @@ -1202,11 +1209,23 @@ func! s:FTm() setf mma return endif + if line =~ '^\c\s*\(\(type\|var\)\>\|--\)' + setf murphi + return + endif let n = n + 1 endwhile - if exists("g:filetype_m") + + if saw_comment + " We didn't see anything definitive, but this looks like either Objective C + " or Murphi based on the comment leader. Assume the former as it is more + " common. + setf objc + elseif exists("g:filetype_m") + " Use user specified default filetype for .m exe "setf " . g:filetype_m else + " Default is matlab setf matlab endif endfunc @@ -1315,6 +1334,9 @@ au BufNewFile,BufRead *.mush setf mush " Mutt setup file (also for Muttng) au BufNewFile,BufRead Mutt{ng,}rc setf muttrc +" N1QL +au BufRead,BufNewfile *.n1ql,*.nql setf n1ql + " Nano au BufNewFile,BufRead */etc/nanorc,*.nanorc setf nanorc @@ -2246,6 +2268,8 @@ func! s:FTtex() elseif format == 'plaintex' let format = 'plain' endif + elseif expand('%') =~ 'tex/context/.*/.*.tex' + let format = 'context' else " Default value, may be changed later: let format = exists("g:tex_flavor") ? g:tex_flavor : 'plain' @@ -2287,7 +2311,7 @@ func! s:FTtex() endfunc " ConTeXt -au BufNewFile,BufRead tex/context/*/*.tex,*.mkii,*.mkiv,*.mkvi setf context +au BufNewFile,BufRead *.mkii,*.mkiv,*.mkvi setf context " Texinfo au BufNewFile,BufRead *.texinfo,*.texi,*.txi setf texinfo @@ -2792,12 +2816,12 @@ runtime! ftdetect/*.vim " state. augroup END -" Generic configuration file (check this last, it's just guessing!) +" Generic configuration file. Use FALLBACK, it's just guessing! au filetypedetect BufNewFile,BufRead,StdinReadPost * \ if !did_filetype() && expand("<amatch>") !~ g:ft_ignore_pat \ && (getline(1) =~ '^#' || getline(2) =~ '^#' || getline(3) =~ '^#' \ || getline(4) =~ '^#' || getline(5) =~ '^#') | - \ setf conf | + \ setf FALLBACK conf | \ endif |