mirror of
https://github.com/neovim/neovim.git
synced 2025-10-26 12:27:24 +00:00
@@ -2364,7 +2364,7 @@ fnamemodify({fname}, {mods}) *fnamemodify()*
|
||||
Example: >
|
||||
:echo fnamemodify("main.c", ":p:h")
|
||||
< results in: >
|
||||
/home/mool/vim/vim/src
|
||||
/home/user/vim/vim/src
|
||||
< If {mods} is empty or an unsupported modifier is used then
|
||||
{fname} is returned.
|
||||
Note: Environment variables don't work in {fname}, use
|
||||
|
||||
@@ -345,15 +345,7 @@ Note:
|
||||
mapping is recursive.
|
||||
- In Visual mode you can use `line('v')` and `col('v')` to get one end of the
|
||||
Visual area, the cursor is at the other end.
|
||||
- In Select mode, |:map| and |:vmap| command mappings are executed in
|
||||
Visual mode. Use |:smap| to handle Select mode differently. One particular
|
||||
edge case: >
|
||||
:vnoremap <C-K> <Esc>
|
||||
< This ends Visual mode when in Visual mode, but in Select mode it does not
|
||||
work, because Select mode is restored after executing the mapped keys. You
|
||||
need to use: >
|
||||
:snoremap <C-K> <Esc>
|
||||
<
|
||||
|
||||
*E5520*
|
||||
<Cmd> commands must terminate, that is, they must be followed by <CR> in the
|
||||
{rhs} of the mapping definition. |Command-line| mode is never entered.
|
||||
|
||||
@@ -499,6 +499,13 @@ work both in Visual mode and in Select mode. When these are used in Select
|
||||
mode Vim automatically switches to Visual mode, so that the same behavior as
|
||||
in Visual mode is effective. If you don't want this use |:xmap| or |:smap|.
|
||||
|
||||
One particular edge case: >
|
||||
:vnoremap <C-K> <Esc>
|
||||
This ends Visual mode when in Visual mode, but in Select mode it does not
|
||||
work, because Select mode is restored after executing the mapped keys. You
|
||||
need to use: >
|
||||
:snoremap <C-K> <Esc>
|
||||
<
|
||||
Users will expect printable characters to replace the selected area.
|
||||
Therefore avoid mapping printable characters in Select mode. Or use
|
||||
|:sunmap| after |:map| and |:vmap| to remove it for Select mode.
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
" Vim indent file
|
||||
" Language: confini
|
||||
|
||||
" Quit if an indent file was already loaded.
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
endif
|
||||
|
||||
" Use the cfg indenting, it's similar enough.
|
||||
runtime! indent/cfg.vim
|
||||
@@ -1,10 +0,0 @@
|
||||
" Vim indent file
|
||||
" Language: systemd.unit(5)
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
endif
|
||||
|
||||
" Looks a lot like dosini files.
|
||||
runtime! indent/dosini.vim
|
||||
@@ -2,7 +2,7 @@
|
||||
" Language: YAML
|
||||
" Maintainer: Nikolai Pavlov <zyx.vim@gmail.com>
|
||||
" Last Update: Lukas Reineke
|
||||
" Last Change: 2022 May 02
|
||||
" Last Change: 2022 Jun 17
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists('b:did_indent')
|
||||
@@ -44,30 +44,30 @@ function s:FindPrevLEIndentedLineMatchingRegex(lnum, regex)
|
||||
return plilnum
|
||||
endfunction
|
||||
|
||||
let s:mapkeyregex='\v^\s*\#@!\S@=%(\''%([^'']|\''\'')*\'''.
|
||||
\ '|\"%([^"\\]|\\.)*\"'.
|
||||
let s:mapkeyregex = '\v^\s*\#@!\S@=%(\''%([^'']|\''\'')*\''' ..
|
||||
\ '|\"%([^"\\]|\\.)*\"' ..
|
||||
\ '|%(%(\:\ )@!.)*)\:%(\ |$)'
|
||||
let s:liststartregex='\v^\s*%(\-%(\ |$))'
|
||||
let s:liststartregex = '\v^\s*%(\-%(\ |$))'
|
||||
|
||||
let s:c_ns_anchor_char = '\v%([\n\r\uFEFF \t,[\]{}]@!\p)'
|
||||
let s:c_ns_anchor_name = s:c_ns_anchor_char.'+'
|
||||
let s:c_ns_anchor_property = '\v\&'.s:c_ns_anchor_name
|
||||
let s:c_ns_anchor_name = s:c_ns_anchor_char .. '+'
|
||||
let s:c_ns_anchor_property = '\v\&' .. s:c_ns_anchor_name
|
||||
|
||||
let s:ns_word_char = '\v[[:alnum:]_\-]'
|
||||
let s:ns_tag_char = '\v%(%\x\x|'.s:ns_word_char.'|[#/;?:@&=+$.~*''()])'
|
||||
let s:c_named_tag_handle = '\v\!'.s:ns_word_char.'+\!'
|
||||
let s:ns_tag_char = '\v%(%\x\x|' .. s:ns_word_char .. '|[#/;?:@&=+$.~*''()])'
|
||||
let s:c_named_tag_handle = '\v\!' .. s:ns_word_char .. '+\!'
|
||||
let s:c_secondary_tag_handle = '\v\!\!'
|
||||
let s:c_primary_tag_handle = '\v\!'
|
||||
let s:c_tag_handle = '\v%('.s:c_named_tag_handle.
|
||||
\ '|'.s:c_secondary_tag_handle.
|
||||
\ '|'.s:c_primary_tag_handle.')'
|
||||
let s:c_ns_shorthand_tag = '\v'.s:c_tag_handle . s:ns_tag_char.'+'
|
||||
let s:c_tag_handle = '\v%(' .. s:c_named_tag_handle.
|
||||
\ '|' .. s:c_secondary_tag_handle.
|
||||
\ '|' .. s:c_primary_tag_handle .. ')'
|
||||
let s:c_ns_shorthand_tag = '\v' .. s:c_tag_handle .. s:ns_tag_char .. '+'
|
||||
let s:c_non_specific_tag = '\v\!'
|
||||
let s:ns_uri_char = '\v%(%\x\x|'.s:ns_word_char.'\v|[#/;?:@&=+$,.!~*''()[\]])'
|
||||
let s:c_verbatim_tag = '\v\!\<'.s:ns_uri_char.'+\>'
|
||||
let s:c_ns_tag_property = '\v'.s:c_verbatim_tag.
|
||||
\ '\v|'.s:c_ns_shorthand_tag.
|
||||
\ '\v|'.s:c_non_specific_tag
|
||||
let s:ns_uri_char = '\v%(%\x\x|' .. s:ns_word_char .. '\v|[#/;?:@&=+$,.!~*''()[\]])'
|
||||
let s:c_verbatim_tag = '\v\!\<' .. s:ns_uri_char.. '+\>'
|
||||
let s:c_ns_tag_property = '\v' .. s:c_verbatim_tag.
|
||||
\ '\v|' .. s:c_ns_shorthand_tag.
|
||||
\ '\v|' .. s:c_non_specific_tag
|
||||
|
||||
let s:block_scalar_header = '\v[|>]%([+-]?[1-9]|[1-9]?[+-])?'
|
||||
|
||||
@@ -142,9 +142,9 @@ function GetYAMLIndent(lnum)
|
||||
" - List with
|
||||
" multiline scalar
|
||||
return previndent+2
|
||||
elseif prevline =~# s:mapkeyregex . '\v\s*%(%('.s:c_ns_tag_property.
|
||||
\ '\v|'.s:c_ns_anchor_property.
|
||||
\ '\v|'.s:block_scalar_header.
|
||||
elseif prevline =~# s:mapkeyregex .. '\v\s*%(%(' .. s:c_ns_tag_property ..
|
||||
\ '\v|' .. s:c_ns_anchor_property ..
|
||||
\ '\v|' .. s:block_scalar_header ..
|
||||
\ '\v)%(\s+|\s*%(\#.*)?$))*'
|
||||
" Mapping with: value
|
||||
" that is multiline scalar
|
||||
|
||||
@@ -368,7 +368,7 @@ syn match vimSetMod contained "&vim\=\|[!&?<]\|all&"
|
||||
" Let: {{{2
|
||||
" ===
|
||||
syn keyword vimLet let unl[et] skipwhite nextgroup=vimVar,vimFuncVar,vimLetHereDoc
|
||||
VimFoldh syn region vimLetHereDoc matchgroup=vimLetHereDocStart start='=<<\s\+\%(trim\>\)\=\s*\z(\L\S*\)' matchgroup=vimLetHereDocStop end='^\s*\z1\s*$'
|
||||
VimFoldh syn region vimLetHereDoc matchgroup=vimLetHereDocStart start='=<<\s\+\%(trim\%(\s\+eval\)\=\|eval\%(\s\+trim\)\=\)\=\s*\z(\L\S*\)' matchgroup=vimLetHereDocStop end='^\s*\z1\s*$'
|
||||
|
||||
" Abbreviations: {{{2
|
||||
" =============
|
||||
|
||||
Reference in New Issue
Block a user