mirror of
https://github.com/neovim/neovim.git
synced 2024-12-19 18:55:14 -07:00
parent
dd2bc06411
commit
8f8602d2df
@ -3363,8 +3363,9 @@ delete({fname} [, {flags}]) *delete()*
|
||||
Note: on MS-Windows it is not possible to delete a directory
|
||||
that is being used.
|
||||
|
||||
The result is a Number, which is 0 if the delete operation was
|
||||
successful and -1 when the deletion failed or partly failed.
|
||||
The result is a Number, which is 0/false if the delete
|
||||
operation was successful and -1/true when the deletion failed
|
||||
or partly failed.
|
||||
|
||||
deletebufline({expr}, {first}[, {last}]) *deletebufline()*
|
||||
Delete lines {first} to {last} (inclusive) from buffer {expr}.
|
||||
@ -5113,8 +5114,8 @@ has({feature}) Returns 1 if {feature} is supported, 0 otherwise. The
|
||||
|
||||
|
||||
has_key({dict}, {key}) *has_key()*
|
||||
The result is a Number, which is 1 if |Dictionary| {dict} has
|
||||
an entry with key {key}. Zero otherwise.
|
||||
The result is a Number, which is TRUE if |Dictionary| {dict}
|
||||
has an entry with key {key}. FALSE otherwise.
|
||||
|
||||
haslocaldir([{winnr}[, {tabnr}]]) *haslocaldir()*
|
||||
The result is a Number, which is 1 when the tabpage or window
|
||||
@ -5132,16 +5133,16 @@ haslocaldir([{winnr}[, {tabnr}]]) *haslocaldir()*
|
||||
If {winnr} is -1 it is ignored, only the tab is resolved.
|
||||
|
||||
hasmapto({what} [, {mode} [, {abbr}]]) *hasmapto()*
|
||||
The result is a Number, which is 1 if there is a mapping that
|
||||
contains {what} in somewhere in the rhs (what it is mapped to)
|
||||
and this mapping exists in one of the modes indicated by
|
||||
{mode}.
|
||||
The result is a Number, which is TRUE if there is a mapping
|
||||
that contains {what} in somewhere in the rhs (what it is
|
||||
mapped to) and this mapping exists in one of the modes
|
||||
indicated by {mode}.
|
||||
When {abbr} is there and it is |TRUE| use abbreviations
|
||||
instead of mappings. Don't forget to specify Insert and/or
|
||||
Command-line mode.
|
||||
Both the global mappings and the mappings local to the current
|
||||
buffer are checked for a match.
|
||||
If no matching mapping is found 0 is returned.
|
||||
If no matching mapping is found FALSE is returned.
|
||||
The following characters are recognized in {mode}:
|
||||
n Normal mode
|
||||
v Visual mode
|
||||
@ -5172,8 +5173,8 @@ histadd({history}, {item}) *histadd()*
|
||||
character is sufficient.
|
||||
If {item} does already exist in the history, it will be
|
||||
shifted to become the newest entry.
|
||||
The result is a Number: 1 if the operation was successful,
|
||||
otherwise 0 is returned.
|
||||
The result is a Number: TRUE if the operation was successful,
|
||||
otherwise FALSE is returned.
|
||||
|
||||
Example: >
|
||||
:call histadd("input", strftime("%Y %b %d"))
|
||||
@ -5192,8 +5193,8 @@ histdel({history} [, {item}]) *histdel()*
|
||||
an index, see |:history-indexing|. The respective entry will
|
||||
be removed if it exists.
|
||||
|
||||
The result is a Number: 1 for a successful operation,
|
||||
otherwise 0 is returned.
|
||||
The result is TRUE for a successful operation, otherwise FALSE
|
||||
is returned.
|
||||
|
||||
Examples:
|
||||
Clear expression register history: >
|
||||
@ -5236,7 +5237,7 @@ histnr({history}) *histnr()*
|
||||
:let inp_index = histnr("expr")
|
||||
<
|
||||
hlexists({name}) *hlexists()*
|
||||
The result is a Number, which is non-zero if a highlight group
|
||||
The result is a Number, which is TRUE if a highlight group
|
||||
called {name} exists. This is when the group has been
|
||||
defined in some way. Not necessarily when highlighting has
|
||||
been defined for it, it may also have been used for a syntax
|
||||
@ -5427,7 +5428,7 @@ inputrestore() *inputrestore()*
|
||||
Restore typeahead that was saved with a previous |inputsave()|.
|
||||
Should be called the same number of times inputsave() is
|
||||
called. Calling it more often is harmless though.
|
||||
Returns 1 when there is nothing to restore, 0 otherwise.
|
||||
Returns TRUE when there is nothing to restore, FALSE otherwise.
|
||||
|
||||
inputsave() *inputsave()*
|
||||
Preserve typeahead (also from mappings) and clear it, so that
|
||||
@ -5435,7 +5436,7 @@ inputsave() *inputsave()*
|
||||
followed by a matching inputrestore() after the prompt. Can
|
||||
be used several times, in which case there must be just as
|
||||
many inputrestore() calls.
|
||||
Returns 1 when out of memory, 0 otherwise.
|
||||
Returns TRUE when out of memory, FALSE otherwise.
|
||||
|
||||
inputsecret({prompt} [, {text}]) *inputsecret()*
|
||||
This function acts much like the |input()| function with but
|
||||
@ -6292,6 +6293,10 @@ mkdir({name} [, {path} [, {prot}]])
|
||||
If you try to create an existing directory with {path} set to
|
||||
"p" mkdir() will silently exit.
|
||||
|
||||
The function result is a Number, which is TRUE if the call was
|
||||
successful or FALSE if the directory creation failed or partly
|
||||
failed.
|
||||
|
||||
*mode()*
|
||||
mode([expr]) Return a string that indicates the current mode.
|
||||
If [expr] is supplied and it evaluates to a non-zero Number or
|
||||
@ -7394,6 +7399,7 @@ server2client({clientid}, {string}) *server2client()*
|
||||
Send a reply string to {clientid}. The most recent {clientid}
|
||||
that sent a string can be retrieved with expand("<client>").
|
||||
Note:
|
||||
Returns zero for success, -1 for failure.
|
||||
This id has to be stored before the next command can be
|
||||
received. I.e. before returning from the received command and
|
||||
before calling any commands that waits for input.
|
||||
@ -7510,8 +7516,8 @@ setcmdpos({pos}) *setcmdpos()*
|
||||
before inserting the resulting text.
|
||||
When the number is too big the cursor is put at the end of the
|
||||
line. A number smaller than one has undefined results.
|
||||
Returns 0 when successful, 1 when not editing the command
|
||||
line.
|
||||
Returns FALSE when successful, TRUE when not editing the
|
||||
command line.
|
||||
|
||||
setenv({name}, {val}) *setenv()*
|
||||
Set environment variable {name} to {val}.
|
||||
@ -7544,8 +7550,8 @@ setline({lnum}, {text}) *setline()*
|
||||
When {lnum} is just below the last line the {text} will be
|
||||
added below the last line.
|
||||
|
||||
If this succeeds, 0 is returned. If this fails (most likely
|
||||
because {lnum} is invalid) 1 is returned.
|
||||
If this succeeds, FALSE is returned. If this fails (most likely
|
||||
because {lnum} is invalid) TRUE is returned.
|
||||
|
||||
Example: >
|
||||
:call setline(5, strftime("%c"))
|
||||
@ -9134,7 +9140,7 @@ win_gettype([{nr}]) *win_gettype()*
|
||||
win_gotoid({expr}) *win_gotoid()*
|
||||
Go to window with ID {expr}. This may also change the current
|
||||
tabpage.
|
||||
Return 1 if successful, 0 if the window cannot be found.
|
||||
Return TRUE if successful, FALSE if the window cannot be found.
|
||||
|
||||
win_id2tabwin({expr} *win_id2tabwin()*
|
||||
Return a list with the tab number and window number of window
|
||||
|
@ -136,6 +136,7 @@ can be used to overrule the filetype used for certain extensions:
|
||||
*.w g:filetype_w |ft-cweb-syntax|
|
||||
*.i g:filetype_i |ft-progress-syntax|
|
||||
*.p g:filetype_p |ft-pascal-syntax|
|
||||
*.pp g:filetype_pp |ft-pascal-syntax|
|
||||
*.sh g:bash_is_sh |ft-sh-syntax|
|
||||
*.tex g:tex_flavor |ft-tex-plugin|
|
||||
|
||||
|
@ -4005,7 +4005,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
the |more-prompt|. When this option is off there are no pauses, the
|
||||
listing continues until finished.
|
||||
|
||||
*'mouse'* *E538*
|
||||
*'mouse'*
|
||||
'mouse' string (default "")
|
||||
global
|
||||
|
||||
|
@ -2303,11 +2303,12 @@ http://papp.plan9.de.
|
||||
|
||||
PASCAL *pascal.vim* *ft-pascal-syntax*
|
||||
|
||||
Files matching "*.p" could be Progress or Pascal. If the automatic detection
|
||||
doesn't work for you, or you don't edit Progress at all, use this in your
|
||||
startup vimrc: >
|
||||
Files matching "*.p" could be Progress or Pascal and those matching "*.pp"
|
||||
could be Puppet or Pascal. If the automatic detection doesn't work for you,
|
||||
or you only edit Pascal files, use this in your startup vimrc: >
|
||||
|
||||
:let filetype_p = "pascal"
|
||||
:let filetype_p = "pascal"
|
||||
:let filetype_pp = "pascal"
|
||||
|
||||
The Pascal syntax file has been extended to take into account some extensions
|
||||
provided by Turbo Pascal, Free Pascal Compiler and GNU Pascal Compiler.
|
||||
|
@ -505,6 +505,9 @@ gO Show a filetype-specific, navigable "outline" of the
|
||||
if at a visible position.
|
||||
Queued messages are processed during the sleep.
|
||||
|
||||
*:sl!* *:sleep!*
|
||||
:[N]sl[eep]! [N] [m] Same as above, but hide the cursor
|
||||
|
||||
==============================================================================
|
||||
2. Using Vim like less or more *less*
|
||||
|
||||
|
@ -11,9 +11,10 @@ Differences between Vim and Vi *vi-differences*
|
||||
==============================================================================
|
||||
1. Limits *limits*
|
||||
|
||||
Vim has only a few limits for the files that can be edited.
|
||||
Vim has only a few limits for the files that can be edited {Vi: can not handle
|
||||
<Nul> characters and characters above 128, has limited line length, many other
|
||||
limits}.
|
||||
|
||||
*E340*
|
||||
Maximum line length 2147483647 characters
|
||||
Maximum number of lines 2147483647 lines
|
||||
Maximum file size 2147483647 bytes (2 Gbyte) when a long integer is
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim filetype plugin
|
||||
" Language: Vim
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2021 Jan 05
|
||||
" Last Change: 2021 Jan 12
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists("b:did_ftplugin")
|
||||
@ -52,12 +52,12 @@ setlocal keywordprg=:help
|
||||
if "\n" .. join(getline(1, 10), "\n") =~# '\n\s*vim9\%[script]\>'
|
||||
" Set 'comments' to format dashed lists in comments
|
||||
setlocal com=sO:#\ -,mO:#\ \ ,eO:##,:#
|
||||
" Comments start with a double quote in a legacy script;
|
||||
" with # in a Vim9 script
|
||||
setlocal commentstring=\"%s
|
||||
" Comments starts with # in Vim9 script
|
||||
setlocal commentstring=#%s
|
||||
else
|
||||
setlocal com=sO:\"\ -,mO:\"\ \ ,:\"
|
||||
setlocal commentstring=#%s
|
||||
" Comments starts with a double quote in legacy script
|
||||
setlocal commentstring=\"%s
|
||||
endif
|
||||
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim syntax file
|
||||
" Language: C
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2020 Aug 28
|
||||
" Last Change: 2021 Jan 11
|
||||
|
||||
" Quit when a (custom) syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
@ -13,6 +13,9 @@ set cpo&vim
|
||||
|
||||
let s:ft = matchstr(&ft, '^\([^.]\)\+')
|
||||
|
||||
" check if this was included from cpp.vim
|
||||
let s:in_cpp_family = exists("b:filetype_in_cpp_family")
|
||||
|
||||
" Optional embedded Autodoc parsing
|
||||
" To enable it add: let g:c_autodoc = 1
|
||||
" to your .vimrc
|
||||
@ -55,7 +58,7 @@ if !exists("c_no_cformat")
|
||||
endif
|
||||
|
||||
" cCppString: same as cString, but ends at end of line
|
||||
if s:ft ==# "cpp" && !exists("cpp_no_cpp11") && !exists("c_no_cformat")
|
||||
if s:in_cpp_family && !exists("cpp_no_cpp11") && !exists("c_no_cformat")
|
||||
" ISO C++11
|
||||
syn region cString start=+\(L\|u\|u8\|U\|R\|LR\|u8R\|uR\|UR\)\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat,@Spell extend
|
||||
syn region cCppString start=+\(L\|u\|u8\|U\|R\|LR\|u8R\|uR\|UR\)\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,cFormat,@Spell
|
||||
@ -87,7 +90,7 @@ syn match cSpecialCharacter display "L\='\\\o\{1,3}'"
|
||||
syn match cSpecialCharacter display "'\\x\x\{1,2}'"
|
||||
syn match cSpecialCharacter display "L'\\x\x\+'"
|
||||
|
||||
if (s:ft ==# "c" && !exists("c_no_c11")) || (s:ft ==# "cpp" && !exists("cpp_no_cpp11"))
|
||||
if (s:ft ==# "c" && !exists("c_no_c11")) || (s:in_cpp_family && !exists("cpp_no_cpp11"))
|
||||
" ISO C11 or ISO C++ 11
|
||||
if exists("c_no_cformat")
|
||||
syn region cString start=+\%(U\|u8\=\)"+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,@Spell extend
|
||||
@ -130,7 +133,7 @@ endif
|
||||
" But avoid matching <::.
|
||||
syn cluster cParenGroup contains=cParenError,cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserLabel,cBitField,cOctalZero,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom
|
||||
if exists("c_no_curly_error")
|
||||
if s:ft ==# 'cpp' && !exists("cpp_no_cpp11")
|
||||
if s:in_cpp_family && !exists("cpp_no_cpp11")
|
||||
syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,@cStringGroup,@Spell
|
||||
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
|
||||
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell
|
||||
@ -144,7 +147,7 @@ if exists("c_no_curly_error")
|
||||
syn match cErrInParen display contained "^[{}]\|^<%\|^%>"
|
||||
endif
|
||||
elseif exists("c_no_bracket_error")
|
||||
if s:ft ==# 'cpp' && !exists("cpp_no_cpp11")
|
||||
if s:in_cpp_family && !exists("cpp_no_cpp11")
|
||||
syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,@cStringGroup,@Spell
|
||||
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
|
||||
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell
|
||||
@ -158,7 +161,7 @@ elseif exists("c_no_bracket_error")
|
||||
syn match cErrInParen display contained "[{}]\|<%\|%>"
|
||||
endif
|
||||
else
|
||||
if s:ft ==# 'cpp' && !exists("cpp_no_cpp11")
|
||||
if s:in_cpp_family && !exists("cpp_no_cpp11")
|
||||
syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,cErrInBracket,cCppBracket,@cStringGroup,@Spell
|
||||
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
|
||||
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cErrInBracket,cParen,cBracket,cString,@Spell
|
||||
@ -278,7 +281,7 @@ syn keyword cStorageClass static register auto volatile extern const
|
||||
if exists("c_gnu")
|
||||
syn keyword cStorageClass inline __attribute__
|
||||
endif
|
||||
if !exists("c_no_c99") && s:ft !=# 'cpp'
|
||||
if !exists("c_no_c99") && !s:in_cpp_family
|
||||
syn keyword cStorageClass inline restrict
|
||||
endif
|
||||
if !exists("c_no_c11")
|
||||
@ -420,7 +423,7 @@ endif
|
||||
syn cluster cLabelGroup contains=cUserLabel
|
||||
syn match cUserCont display "^\s*\zs\I\i*\s*:$" contains=@cLabelGroup
|
||||
syn match cUserCont display ";\s*\zs\I\i*\s*:$" contains=@cLabelGroup
|
||||
if s:ft ==# 'cpp'
|
||||
if s:in_cpp_family
|
||||
syn match cUserCont display "^\s*\zs\%(class\|struct\|enum\)\@!\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup
|
||||
syn match cUserCont display ";\s*\zs\%(class\|struct\|enum\)\@!\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup
|
||||
else
|
||||
|
@ -2,13 +2,16 @@
|
||||
" Language: C++
|
||||
" Current Maintainer: vim-jp (https://github.com/vim-jp/vim-cpp)
|
||||
" Previous Maintainer: Ken Shan <ccshan@post.harvard.edu>
|
||||
" Last Change: 2019 Dec 18
|
||||
" Last Change: 2021 Jan 12
|
||||
|
||||
" quit when a syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
" inform C syntax that the file was included from cpp.vim
|
||||
let b:filetype_in_cpp_family = 1
|
||||
|
||||
" Read the C syntax to start with
|
||||
runtime! syntax/c.vim
|
||||
unlet b:current_syntax
|
||||
|
Loading…
Reference in New Issue
Block a user