mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
parent
1a07044c1c
commit
4cbeedf57b
95
runtime/autoload/bitbake.vim
Normal file
95
runtime/autoload/bitbake.vim
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
" Support for bitbake indenting, see runtime/indent/bitbake.vim
|
||||||
|
|
||||||
|
function s:is_bb_python_func_def(lnum)
|
||||||
|
let stack = synstack(a:lnum, 1)
|
||||||
|
if len(stack) == 0
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
return synIDattr(stack[0], "name") == "bbPyFuncDef"
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function bitbake#Indent(lnum)
|
||||||
|
if !has('syntax_items')
|
||||||
|
return -1
|
||||||
|
endif
|
||||||
|
|
||||||
|
let stack = synstack(a:lnum, 1)
|
||||||
|
if len(stack) == 0
|
||||||
|
return -1
|
||||||
|
endif
|
||||||
|
|
||||||
|
let name = synIDattr(stack[0], "name")
|
||||||
|
|
||||||
|
" TODO: support different styles of indentation for assignments. For now,
|
||||||
|
" we only support like this:
|
||||||
|
" VAR = " \
|
||||||
|
" value1 \
|
||||||
|
" value2 \
|
||||||
|
" "
|
||||||
|
"
|
||||||
|
" i.e. each value indented by shiftwidth(), with the final quote " completely unindented.
|
||||||
|
if name == "bbVarValue"
|
||||||
|
" Quote handling is tricky. kernel.bbclass has this line for instance:
|
||||||
|
" EXTRA_OEMAKE = " HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" " HOSTCPP="${BUILD_CPP}""
|
||||||
|
" Instead of trying to handle crazy cases like that, just assume that a
|
||||||
|
" double-quote on a line by itself (following an assignment) means the
|
||||||
|
" user is closing the assignment, and de-dent.
|
||||||
|
if getline(a:lnum) =~ '^\s*"$'
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
let prevstack = synstack(a:lnum - 1, 1)
|
||||||
|
if len(prevstack) == 0
|
||||||
|
return -1
|
||||||
|
endif
|
||||||
|
|
||||||
|
let prevname = synIDattr(prevstack[0], "name")
|
||||||
|
|
||||||
|
" Only indent if there was actually a continuation character on
|
||||||
|
" the previous line, to avoid misleading indentation.
|
||||||
|
let prevlinelastchar = synIDattr(synID(a:lnum - 1, col([a:lnum - 1, "$"]) - 1, 1), "name")
|
||||||
|
let prev_continued = prevlinelastchar == "bbContinue"
|
||||||
|
|
||||||
|
" Did the previous line introduce an assignment?
|
||||||
|
if index(["bbVarDef", "bbVarFlagDef"], prevname) != -1
|
||||||
|
if prev_continued
|
||||||
|
return shiftwidth()
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !prev_continued
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Autoindent can take it from here
|
||||||
|
return -1
|
||||||
|
endif
|
||||||
|
|
||||||
|
if index(["bbPyDefRegion", "bbPyFuncRegion"], name) != -1
|
||||||
|
let ret = python#GetIndent(a:lnum, function('s:is_bb_python_func_def'))
|
||||||
|
" Should normally always be indented by at least one shiftwidth; but allow
|
||||||
|
" return of -1 (defer to autoindent) or -2 (force indent to 0)
|
||||||
|
if ret == 0
|
||||||
|
return shiftwidth()
|
||||||
|
elseif ret == -2
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
return ret
|
||||||
|
endif
|
||||||
|
|
||||||
|
" TODO: GetShIndent doesn't detect tasks prepended with 'fakeroot'
|
||||||
|
" Need to submit a patch upstream to Vim to provide an extension point.
|
||||||
|
" Unlike the Python indenter, the Sh indenter is way too large to copy and
|
||||||
|
" modify here.
|
||||||
|
if name == "bbShFuncRegion"
|
||||||
|
return GetShIndent()
|
||||||
|
endif
|
||||||
|
|
||||||
|
" TODO:
|
||||||
|
" + heuristics for de-denting out of a bbPyDefRegion? e.g. when the user
|
||||||
|
" types an obvious BB keyword like addhandler or addtask, or starts
|
||||||
|
" writing a shell task. Maybe too hard to implement...
|
||||||
|
|
||||||
|
return -1
|
||||||
|
endfunction
|
228
runtime/autoload/python.vim
Normal file
228
runtime/autoload/python.vim
Normal file
@ -0,0 +1,228 @@
|
|||||||
|
" Support for Python indenting, see runtime/indent/python.vim
|
||||||
|
|
||||||
|
let s:keepcpo= &cpo
|
||||||
|
set cpo&vim
|
||||||
|
|
||||||
|
" See if the specified line is already user-dedented from the expected value.
|
||||||
|
function s:Dedented(lnum, expected)
|
||||||
|
return indent(a:lnum) <= a:expected - shiftwidth()
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
let s:maxoff = 50 " maximum number of lines to look backwards for ()
|
||||||
|
|
||||||
|
" Some other filetypes which embed Python have slightly different indent
|
||||||
|
" rules (e.g. bitbake). Those filetypes can pass an extra funcref to this
|
||||||
|
" function which is evaluated below.
|
||||||
|
function python#GetIndent(lnum, ...)
|
||||||
|
let ExtraFunc = a:0 > 0 ? a:1 : 0
|
||||||
|
|
||||||
|
" If this line is explicitly joined: If the previous line was also joined,
|
||||||
|
" line it up with that one, otherwise add two 'shiftwidth'
|
||||||
|
if getline(a:lnum - 1) =~ '\\$'
|
||||||
|
if a:lnum > 1 && getline(a:lnum - 2) =~ '\\$'
|
||||||
|
return indent(a:lnum - 1)
|
||||||
|
endif
|
||||||
|
return indent(a:lnum - 1) + (exists("g:pyindent_continue") ? eval(g:pyindent_continue) : (shiftwidth() * 2))
|
||||||
|
endif
|
||||||
|
|
||||||
|
" If the start of the line is in a string don't change the indent.
|
||||||
|
if has('syntax_items')
|
||||||
|
\ && synIDattr(synID(a:lnum, 1, 1), "name") =~ "String$"
|
||||||
|
return -1
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Search backwards for the previous non-empty line.
|
||||||
|
let plnum = prevnonblank(v:lnum - 1)
|
||||||
|
|
||||||
|
if plnum == 0
|
||||||
|
" This is the first non-empty line, use zero indent.
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
call cursor(plnum, 1)
|
||||||
|
|
||||||
|
" Identing inside parentheses can be very slow, regardless of the searchpair()
|
||||||
|
" timeout, so let the user disable this feature if he doesn't need it
|
||||||
|
let disable_parentheses_indenting = get(g:, "pyindent_disable_parentheses_indenting", 0)
|
||||||
|
|
||||||
|
if disable_parentheses_indenting == 1
|
||||||
|
let plindent = indent(plnum)
|
||||||
|
let plnumstart = plnum
|
||||||
|
else
|
||||||
|
" searchpair() can be slow sometimes, limit the time to 150 msec or what is
|
||||||
|
" put in g:pyindent_searchpair_timeout
|
||||||
|
let searchpair_stopline = 0
|
||||||
|
let searchpair_timeout = get(g:, 'pyindent_searchpair_timeout', 150)
|
||||||
|
|
||||||
|
" If the previous line is inside parenthesis, use the indent of the starting
|
||||||
|
" line.
|
||||||
|
" Trick: use the non-existing "dummy" variable to break out of the loop when
|
||||||
|
" going too far back.
|
||||||
|
let parlnum = searchpair('(\|{\|\[', '', ')\|}\|\]', 'nbW',
|
||||||
|
\ "line('.') < " . (plnum - s:maxoff) . " ? dummy :"
|
||||||
|
\ . " synIDattr(synID(line('.'), col('.'), 1), 'name')"
|
||||||
|
\ . " =~ '\\(Comment\\|Todo\\|String\\)$'",
|
||||||
|
\ searchpair_stopline, searchpair_timeout)
|
||||||
|
if parlnum > 0
|
||||||
|
if a:0 > 0 && ExtraFunc(parlnum)
|
||||||
|
" We may have found the opening brace of a bitbake Python task, e.g. 'python do_task {'
|
||||||
|
" If so, ignore it here - it will be handled later.
|
||||||
|
let parlnum = 0
|
||||||
|
let plindent = indent(plnum)
|
||||||
|
let plnumstart = plnum
|
||||||
|
else
|
||||||
|
let plindent = indent(parlnum)
|
||||||
|
let plnumstart = parlnum
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
let plindent = indent(plnum)
|
||||||
|
let plnumstart = plnum
|
||||||
|
endif
|
||||||
|
|
||||||
|
" When inside parenthesis: If at the first line below the parenthesis add
|
||||||
|
" two 'shiftwidth', otherwise same as previous line.
|
||||||
|
" i = (a
|
||||||
|
" + b
|
||||||
|
" + c)
|
||||||
|
call cursor(a:lnum, 1)
|
||||||
|
let p = searchpair('(\|{\|\[', '', ')\|}\|\]', 'bW',
|
||||||
|
\ "line('.') < " . (a:lnum - s:maxoff) . " ? dummy :"
|
||||||
|
\ . " synIDattr(synID(line('.'), col('.'), 1), 'name')"
|
||||||
|
\ . " =~ '\\(Comment\\|Todo\\|String\\)$'",
|
||||||
|
\ searchpair_stopline, searchpair_timeout)
|
||||||
|
if p > 0
|
||||||
|
if a:0 > 0 && ExtraFunc(p)
|
||||||
|
" Currently only used by bitbake
|
||||||
|
" Handle first non-empty line inside a bitbake Python task
|
||||||
|
if p == plnum
|
||||||
|
return shiftwidth()
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Handle the user actually trying to close a bitbake Python task
|
||||||
|
let line = getline(a:lnum)
|
||||||
|
if line =~ '^\s*}'
|
||||||
|
return -2
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Otherwise ignore the brace
|
||||||
|
let p = 0
|
||||||
|
else
|
||||||
|
if p == plnum
|
||||||
|
" When the start is inside parenthesis, only indent one 'shiftwidth'.
|
||||||
|
let pp = searchpair('(\|{\|\[', '', ')\|}\|\]', 'bW',
|
||||||
|
\ "line('.') < " . (a:lnum - s:maxoff) . " ? dummy :"
|
||||||
|
\ . " synIDattr(synID(line('.'), col('.'), 1), 'name')"
|
||||||
|
\ . " =~ '\\(Comment\\|Todo\\|String\\)$'",
|
||||||
|
\ searchpair_stopline, searchpair_timeout)
|
||||||
|
if pp > 0
|
||||||
|
return indent(plnum) + (exists("g:pyindent_nested_paren") ? eval(g:pyindent_nested_paren) : shiftwidth())
|
||||||
|
endif
|
||||||
|
return indent(plnum) + (exists("g:pyindent_open_paren") ? eval(g:pyindent_open_paren) : (shiftwidth() * 2))
|
||||||
|
endif
|
||||||
|
if plnumstart == p
|
||||||
|
return indent(plnum)
|
||||||
|
endif
|
||||||
|
return plindent
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
" Get the line and remove a trailing comment.
|
||||||
|
" Use syntax highlighting attributes when possible.
|
||||||
|
let pline = getline(plnum)
|
||||||
|
let pline_len = strlen(pline)
|
||||||
|
if has('syntax_items')
|
||||||
|
" If the last character in the line is a comment, do a binary search for
|
||||||
|
" the start of the comment. synID() is slow, a linear search would take
|
||||||
|
" too long on a long line.
|
||||||
|
if synIDattr(synID(plnum, pline_len, 1), "name") =~ "\\(Comment\\|Todo\\)$"
|
||||||
|
let min = 1
|
||||||
|
let max = pline_len
|
||||||
|
while min < max
|
||||||
|
let col = (min + max) / 2
|
||||||
|
if synIDattr(synID(plnum, col, 1), "name") =~ "\\(Comment\\|Todo\\)$"
|
||||||
|
let max = col
|
||||||
|
else
|
||||||
|
let min = col + 1
|
||||||
|
endif
|
||||||
|
endwhile
|
||||||
|
let pline = strpart(pline, 0, min - 1)
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
let col = 0
|
||||||
|
while col < pline_len
|
||||||
|
if pline[col] == '#'
|
||||||
|
let pline = strpart(pline, 0, col)
|
||||||
|
break
|
||||||
|
endif
|
||||||
|
let col = col + 1
|
||||||
|
endwhile
|
||||||
|
endif
|
||||||
|
|
||||||
|
" If the previous line ended with a colon, indent this line
|
||||||
|
if pline =~ ':\s*$'
|
||||||
|
return plindent + shiftwidth()
|
||||||
|
endif
|
||||||
|
|
||||||
|
" If the previous line was a stop-execution statement...
|
||||||
|
if getline(plnum) =~ '^\s*\(break\|continue\|raise\|return\|pass\)\>'
|
||||||
|
" See if the user has already dedented
|
||||||
|
if s:Dedented(a:lnum, indent(plnum))
|
||||||
|
" If so, trust the user
|
||||||
|
return -1
|
||||||
|
endif
|
||||||
|
" If not, recommend one dedent
|
||||||
|
return indent(plnum) - shiftwidth()
|
||||||
|
endif
|
||||||
|
|
||||||
|
" If the current line begins with a keyword that lines up with "try"
|
||||||
|
if getline(a:lnum) =~ '^\s*\(except\|finally\)\>'
|
||||||
|
let lnum = a:lnum - 1
|
||||||
|
while lnum >= 1
|
||||||
|
if getline(lnum) =~ '^\s*\(try\|except\)\>'
|
||||||
|
let ind = indent(lnum)
|
||||||
|
if ind >= indent(a:lnum)
|
||||||
|
return -1 " indent is already less than this
|
||||||
|
endif
|
||||||
|
return ind " line up with previous try or except
|
||||||
|
endif
|
||||||
|
let lnum = lnum - 1
|
||||||
|
endwhile
|
||||||
|
return -1 " no matching "try"!
|
||||||
|
endif
|
||||||
|
|
||||||
|
" If the current line begins with a header keyword, dedent
|
||||||
|
if getline(a:lnum) =~ '^\s*\(elif\|else\)\>'
|
||||||
|
|
||||||
|
" Unless the previous line was a one-liner
|
||||||
|
if getline(plnumstart) =~ '^\s*\(for\|if\|elif\|try\)\>'
|
||||||
|
return plindent
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Or the user has already dedented
|
||||||
|
if s:Dedented(a:lnum, plindent)
|
||||||
|
return -1
|
||||||
|
endif
|
||||||
|
|
||||||
|
return plindent - shiftwidth()
|
||||||
|
endif
|
||||||
|
|
||||||
|
" When after a () construct we probably want to go back to the start line.
|
||||||
|
" a = (b
|
||||||
|
" + c)
|
||||||
|
" here
|
||||||
|
if parlnum > 0
|
||||||
|
" ...unless the user has already dedented
|
||||||
|
if s:Dedented(a:lnum, plindent)
|
||||||
|
return -1
|
||||||
|
else
|
||||||
|
return plindent
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
return -1
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
let &cpo = s:keepcpo
|
||||||
|
unlet s:keepcpo
|
@ -1885,7 +1885,9 @@ exists({expr}) The result is a Number, which is |TRUE| if {expr} is
|
|||||||
To check for a supported command
|
To check for a supported command
|
||||||
always check the return value to be 2.
|
always check the return value to be 2.
|
||||||
:2match The |:2match| command.
|
:2match The |:2match| command.
|
||||||
:3match The |:3match| command.
|
:3match The |:3match| command (but you
|
||||||
|
probably should not use it, it is
|
||||||
|
reserved for internal usage)
|
||||||
#event autocommand defined for this event
|
#event autocommand defined for this event
|
||||||
#event#pattern autocommand defined for this event and
|
#event#pattern autocommand defined for this event and
|
||||||
pattern (the pattern is taken
|
pattern (the pattern is taken
|
||||||
@ -4905,8 +4907,10 @@ matchadd({group}, {pattern} [, {priority} [, {id} [, {dict}]]])
|
|||||||
message will appear and the match will not be added. An ID
|
message will appear and the match will not be added. An ID
|
||||||
is specified as a positive integer (zero excluded). IDs 1, 2
|
is specified as a positive integer (zero excluded). IDs 1, 2
|
||||||
and 3 are reserved for |:match|, |:2match| and |:3match|,
|
and 3 are reserved for |:match|, |:2match| and |:3match|,
|
||||||
respectively. If the {id} argument is not specified or -1,
|
respectively. 3 is reserved for use by the
|
||||||
|matchadd()| automatically chooses a free ID.
|
|matchparen| plugin.
|
||||||
|
If the {id} argument is not specified or -1, |matchadd()|
|
||||||
|
automatically chooses a free ID.
|
||||||
|
|
||||||
The optional {dict} argument allows for further custom
|
The optional {dict} argument allows for further custom
|
||||||
values. Currently this is used to specify a match specific
|
values. Currently this is used to specify a match specific
|
||||||
@ -6397,7 +6401,7 @@ searchcount([{options}]) *searchcount()*
|
|||||||
" to 1)
|
" to 1)
|
||||||
let result = searchcount()
|
let result = searchcount()
|
||||||
<
|
<
|
||||||
The function is useful to add the count to |statusline|: >
|
The function is useful to add the count to 'statusline': >
|
||||||
function! LastSearchCount() abort
|
function! LastSearchCount() abort
|
||||||
let result = searchcount(#{recompute: 0})
|
let result = searchcount(#{recompute: 0})
|
||||||
if empty(result)
|
if empty(result)
|
||||||
|
@ -502,7 +502,7 @@ documentation.
|
|||||||
Assuming you have followed the dbext-tutorial you can press <C-C>t to
|
Assuming you have followed the dbext-tutorial you can press <C-C>t to
|
||||||
display a list of tables. There is a delay while dbext is creating the table
|
display a list of tables. There is a delay while dbext is creating the table
|
||||||
list. After the list is displayed press <C-W>. This will remove both the
|
list. After the list is displayed press <C-W>. This will remove both the
|
||||||
popup window and the table name already chosen when the list became active. >
|
popup window and the table name already chosen when the list became active.
|
||||||
|
|
||||||
4.3.1 Table Completion: *sql-completion-tables*
|
4.3.1 Table Completion: *sql-completion-tables*
|
||||||
|
|
||||||
@ -510,7 +510,7 @@ Press <C-C>t to display a list of tables from within the database you
|
|||||||
have connected via the dbext plugin.
|
have connected via the dbext plugin.
|
||||||
NOTE: All of the SQL completion popups support typing a prefix before pressing
|
NOTE: All of the SQL completion popups support typing a prefix before pressing
|
||||||
the key map. This will limit the contents of the popup window to just items
|
the key map. This will limit the contents of the popup window to just items
|
||||||
beginning with those characters. >
|
beginning with those characters.
|
||||||
|
|
||||||
4.3.2 Column Completion: *sql-completion-columns*
|
4.3.2 Column Completion: *sql-completion-columns*
|
||||||
|
|
||||||
@ -583,13 +583,13 @@ popup a list of columns for the customer table. It does this by looking back
|
|||||||
to the beginning of the select statement and finding a list of the tables
|
to the beginning of the select statement and finding a list of the tables
|
||||||
specified in the FROM clause. In this case it notes that in the string
|
specified in the FROM clause. In this case it notes that in the string
|
||||||
"customer c", "c" is an alias for the customer table. The optional "AS"
|
"customer c", "c" is an alias for the customer table. The optional "AS"
|
||||||
keyword is also supported, "customer AS c". >
|
keyword is also supported, "customer AS c".
|
||||||
|
|
||||||
|
|
||||||
4.3.3 Procedure Completion: *sql-completion-procedures*
|
4.3.3 Procedure Completion: *sql-completion-procedures*
|
||||||
|
|
||||||
Similar to the table list, <C-C>p, will display a list of stored
|
Similar to the table list, <C-C>p, will display a list of stored
|
||||||
procedures stored within the database. >
|
procedures stored within the database.
|
||||||
|
|
||||||
4.3.4 View Completion: *sql-completion-views*
|
4.3.4 View Completion: *sql-completion-views*
|
||||||
|
|
||||||
|
@ -374,10 +374,10 @@ CTRL-G CTRL-J cursor one line down, insert start column *i_CTRL-G_CTRL-J*
|
|||||||
<S-ScrollWheelRight> move window one page right *i_<S-ScrollWheelRight>*
|
<S-ScrollWheelRight> move window one page right *i_<S-ScrollWheelRight>*
|
||||||
CTRL-O execute one command, return to Insert mode *i_CTRL-O*
|
CTRL-O execute one command, return to Insert mode *i_CTRL-O*
|
||||||
CTRL-\ CTRL-O like CTRL-O but don't move the cursor *i_CTRL-\_CTRL-O*
|
CTRL-\ CTRL-O like CTRL-O but don't move the cursor *i_CTRL-\_CTRL-O*
|
||||||
CTRL-G u break undo sequence, start new change *i_CTRL-G_u*
|
CTRL-G u close undo sequence, start new change *i_CTRL-G_u*
|
||||||
CTRL-G U don't break undo with next left/right cursor *i_CTRL-G_U*
|
CTRL-G U don't start a new undo block with the next *i_CTRL-G_U*
|
||||||
movement, if the cursor stays within the
|
left/right cursor movement, if the cursor
|
||||||
same the line
|
stays within the same line
|
||||||
-----------------------------------------------------------------------
|
-----------------------------------------------------------------------
|
||||||
|
|
||||||
The CTRL-O command sometimes has a side effect: If the cursor was beyond the
|
The CTRL-O command sometimes has a side effect: If the cursor was beyond the
|
||||||
@ -411,8 +411,8 @@ that, with CTRL-O u. Another example: >
|
|||||||
|
|
||||||
:inoremap <CR> <C-]><C-G>u<CR>
|
:inoremap <CR> <C-]><C-G>u<CR>
|
||||||
|
|
||||||
This breaks undo at each line break. It also expands abbreviations before
|
This starts a new undo block at each line break. It also expands
|
||||||
this.
|
abbreviations before this.
|
||||||
|
|
||||||
An example for using CTRL-G U: >
|
An example for using CTRL-G U: >
|
||||||
|
|
||||||
@ -426,9 +426,9 @@ An example for using CTRL-G U: >
|
|||||||
inoremap <expr> <End> repeat('<C-G>U<Right>', col('$') - col('.'))
|
inoremap <expr> <End> repeat('<C-G>U<Right>', col('$') - col('.'))
|
||||||
inoremap ( ()<C-G>U<Left>
|
inoremap ( ()<C-G>U<Left>
|
||||||
|
|
||||||
This makes it possible to use the cursor keys in Insert mode, without breaking
|
This makes it possible to use the cursor keys in Insert mode, without starting
|
||||||
the undo sequence and therefore using |.| (redo) will work as expected.
|
a new undo block and therefore using |.| (redo) will work as expected. Also
|
||||||
Also entering a text like (with the "(" mapping from above):
|
entering a text like (with the "(" mapping from above):
|
||||||
|
|
||||||
Lorem ipsum (dolor
|
Lorem ipsum (dolor
|
||||||
|
|
||||||
|
@ -610,19 +610,20 @@ two bytes 0xc3 0xa1. You don't want the 0xc3 byte to be mapped then or
|
|||||||
otherwise it would be impossible to type the á character.
|
otherwise it would be impossible to type the á character.
|
||||||
|
|
||||||
*<Leader>* *mapleader*
|
*<Leader>* *mapleader*
|
||||||
To define a mapping which uses the "mapleader" variable, the special string
|
To define a mapping which uses the "g:mapleader" variable, the special string
|
||||||
"<Leader>" can be used. It is replaced with the string value of "mapleader".
|
"<Leader>" can be used. It is replaced with the string value of
|
||||||
If "mapleader" is not set or empty, a backslash is used instead. Example: >
|
"g:mapleader". If "g:mapleader" is not set or empty, a backslash is used
|
||||||
:map <Leader>A oanother line<Esc>
|
instead. Example: >
|
||||||
|
map <Leader>A oanother line<Esc>
|
||||||
Works like: >
|
Works like: >
|
||||||
:map \A oanother line<Esc>
|
map \A oanother line<Esc>
|
||||||
But after: >
|
But after:
|
||||||
:let mapleader = ","
|
let mapleader = ","
|
||||||
It works like: >
|
It works like: >
|
||||||
:map ,A oanother line<Esc>
|
map ,A oanother line<Esc>
|
||||||
|
|
||||||
Note that the value of "mapleader" is used at the moment the mapping is
|
Note that the value of "g:mapleader" is used at the moment the mapping is
|
||||||
defined. Changing "mapleader" after that has no effect for already defined
|
defined. Changing "g:mapleader" after that has no effect for already defined
|
||||||
mappings.
|
mappings.
|
||||||
|
|
||||||
*<LocalLeader>* *maplocalleader*
|
*<LocalLeader>* *maplocalleader*
|
||||||
|
@ -3571,7 +3571,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
help. (Note that previously setting the global option to the empty
|
help. (Note that previously setting the global option to the empty
|
||||||
value did this, which is now deprecated.)
|
value did this, which is now deprecated.)
|
||||||
When the first character is ":", the command is invoked as a Vim
|
When the first character is ":", the command is invoked as a Vim
|
||||||
command prefixed with [count].
|
Ex command with [count] added as an argument if it is not zero.
|
||||||
When "man" or "man -s" is used, Vim will automatically translate
|
When "man" or "man -s" is used, Vim will automatically translate
|
||||||
a [count] for the "K" command to a section number.
|
a [count] for the "K" command to a section number.
|
||||||
See |option-backslash| about including spaces and backslashes.
|
See |option-backslash| about including spaces and backslashes.
|
||||||
|
@ -3917,7 +3917,7 @@ netrw:
|
|||||||
* Installed |g:netrw_clipboard| setting
|
* Installed |g:netrw_clipboard| setting
|
||||||
* Installed option bypass for |'guioptions'|
|
* Installed option bypass for |'guioptions'|
|
||||||
a/A settings
|
a/A settings
|
||||||
* Changed popup_beval() to |popup_atcursor|()
|
* Changed popup_beval() to |popup_atcursor()|
|
||||||
in netrw#ErrorMsg (lacygoill). Apparently
|
in netrw#ErrorMsg (lacygoill). Apparently
|
||||||
popup_beval doesn't reliably close the
|
popup_beval doesn't reliably close the
|
||||||
popup when the mouse is moved.
|
popup when the mouse is moved.
|
||||||
|
@ -108,13 +108,13 @@ change again. But you can do something like this: >
|
|||||||
|
|
||||||
After this a "u" command will undo the delete command and the previous
|
After this a "u" command will undo the delete command and the previous
|
||||||
change.
|
change.
|
||||||
*undo-break*
|
*undo-break* *undo-close-block*
|
||||||
To do the opposite, break a change into two undo blocks, in Insert mode use
|
To do the opposite, use a new undo block for the next change, in Insert mode
|
||||||
CTRL-G u. This is useful if you want an insert command to be undoable in
|
use CTRL-G u. This is useful if you want an insert command to be undoable in
|
||||||
parts. E.g., for each sentence. |i_CTRL-G_u|
|
parts. E.g., for each sentence. |i_CTRL-G_u|
|
||||||
|
|
||||||
Setting the value of 'undolevels' also breaks undo. Even when the new value
|
Setting the value of 'undolevels' also closes the undo block. Even when the
|
||||||
is equal to the old value: >
|
new value is equal to the old value: >
|
||||||
let &undolevels = &undolevels
|
let &undolevels = &undolevels
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
|
16
runtime/ftplugin/bitbake.vim
Normal file
16
runtime/ftplugin/bitbake.vim
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
" Vim filetype plugin file
|
||||||
|
" Language: Bitbake
|
||||||
|
" Maintainer: Gregory Anders <greg@gpanders.com>
|
||||||
|
" Repository: https://github.com/openembedded/bitbake
|
||||||
|
" Latest Revision: 2022-07-23
|
||||||
|
|
||||||
|
if exists("b:did_ftplugin")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let b:did_ftplugin = 1
|
||||||
|
|
||||||
|
setlocal commentstring=#%s
|
||||||
|
setlocal comments=:#
|
||||||
|
setlocal suffixesadd=.bb,.bbclass
|
||||||
|
|
||||||
|
let b:undo_ftplugin = "setl cms< com< sua<"
|
24
runtime/ftplugin/expect.vim
Normal file
24
runtime/ftplugin/expect.vim
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
" Vim filetype plugin file
|
||||||
|
" Language: Expect
|
||||||
|
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||||
|
" Last Change: 2022 Jul 16
|
||||||
|
|
||||||
|
if exists("b:did_ftplugin")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Syntax is similar to Tcl
|
||||||
|
runtime! ftplugin/tcl.vim
|
||||||
|
|
||||||
|
let s:cpo_save = &cpo
|
||||||
|
set cpo&vim
|
||||||
|
|
||||||
|
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
|
||||||
|
let b:browsefilter = "Expect Command Files (*.exp)\t*.exp\n" ..
|
||||||
|
\ "All Files (*.*)\t*.*\n"
|
||||||
|
endif
|
||||||
|
|
||||||
|
let &cpo = s:cpo_save
|
||||||
|
unlet s:cpo_save
|
||||||
|
|
||||||
|
" vim: nowrap sw=2 sts=2 ts=8
|
@ -1,16 +1,14 @@
|
|||||||
" Vim filetype plugin file
|
" Vim filetype plugin file
|
||||||
" Language: html
|
" Language: HTML
|
||||||
"
|
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||||
" This runtime file is looking for a new maintainer.
|
" Previous Maintainer: Dan Sharp
|
||||||
"
|
" Last Changed: 2022 Jul 20
|
||||||
" Former maintainer: Dan Sharp
|
|
||||||
" Last Changed: 20 Jan 2009
|
|
||||||
|
|
||||||
if exists("b:did_ftplugin") | finish | endif
|
if exists("b:did_ftplugin")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
let b:did_ftplugin = 1
|
let b:did_ftplugin = 1
|
||||||
|
|
||||||
" Make sure the continuation lines below do not cause problems in
|
|
||||||
" compatibility mode.
|
|
||||||
let s:save_cpo = &cpo
|
let s:save_cpo = &cpo
|
||||||
set cpo-=C
|
set cpo-=C
|
||||||
|
|
||||||
@ -18,36 +16,40 @@ setlocal matchpairs+=<:>
|
|||||||
setlocal commentstring=<!--%s-->
|
setlocal commentstring=<!--%s-->
|
||||||
setlocal comments=s:<!--,m:\ \ \ \ ,e:-->
|
setlocal comments=s:<!--,m:\ \ \ \ ,e:-->
|
||||||
|
|
||||||
if exists("g:ft_html_autocomment") && (g:ft_html_autocomment == 1)
|
let b:undo_ftplugin = "setlocal comments< commentstring< matchpairs<"
|
||||||
|
|
||||||
|
if get(g:, "ft_html_autocomment", 0)
|
||||||
setlocal formatoptions-=t formatoptions+=croql
|
setlocal formatoptions-=t formatoptions+=croql
|
||||||
|
let b:undo_ftplugin ..= " | setlocal formatoptions<"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if exists('&omnifunc')
|
if exists('&omnifunc')
|
||||||
setlocal omnifunc=htmlcomplete#CompleteTags
|
setlocal omnifunc=htmlcomplete#CompleteTags
|
||||||
call htmlcomplete#DetectOmniFlavor()
|
call htmlcomplete#DetectOmniFlavor()
|
||||||
|
let b:undo_ftplugin ..= " | setlocal omnifunc<"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" HTML: thanks to Johannes Zellner and Benji Fisher.
|
" HTML: thanks to Johannes Zellner and Benji Fisher.
|
||||||
if exists("loaded_matchit")
|
if exists("loaded_matchit") && !exists("b:match_words")
|
||||||
let b:match_ignorecase = 1
|
let b:match_ignorecase = 1
|
||||||
let b:match_words = '<:>,' .
|
let b:match_words = '<!--:-->,' ..
|
||||||
\ '<\@<=[ou]l\>[^>]*\%(>\|$\):<\@<=li\>:<\@<=/[ou]l>,' .
|
\ '<:>,' ..
|
||||||
\ '<\@<=dl\>[^>]*\%(>\|$\):<\@<=d[td]\>:<\@<=/dl>,' .
|
\ '<\@<=[ou]l\>[^>]*\%(>\|$\):<\@<=li\>:<\@<=/[ou]l>,' ..
|
||||||
\ '<\@<=\([^/][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>'
|
\ '<\@<=dl\>[^>]*\%(>\|$\):<\@<=d[td]\>:<\@<=/dl>,' ..
|
||||||
|
\ '<\@<=\([^/!][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>'
|
||||||
|
let b:html_set_match_words = 1
|
||||||
|
let b:undo_ftplugin ..= " | unlet! b:match_ignorecase b:match_words b:html_set_match_words"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Change the :browse e filter to primarily show HTML-related files.
|
" Change the :browse e filter to primarily show HTML-related files.
|
||||||
if has("gui_win32")
|
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
|
||||||
let b:browsefilter="HTML Files (*.html,*.htm)\t*.htm;*.html\n" .
|
let b:browsefilter = "HTML Files (*.html *.htm)\t*.htm;*.html\n" ..
|
||||||
\ "JavaScript Files (*.js)\t*.js\n" .
|
\ "JavaScript Files (*.js)\t*.js\n" ..
|
||||||
\ "Cascading StyleSheets (*.css)\t*.css\n" .
|
\ "Cascading StyleSheets (*.css)\t*.css\n" ..
|
||||||
\ "All Files (*.*)\t*.*\n"
|
\ "All Files (*.*)\t*.*\n"
|
||||||
|
let b:html_set_browsefilter = 1
|
||||||
|
let b:undo_ftplugin ..= " | unlet! b:browsefilter b:html_set_browsefilter"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Undo the stuff we changed.
|
|
||||||
let b:undo_ftplugin = "setlocal commentstring< matchpairs< omnifunc< comments< formatoptions<" .
|
|
||||||
\ " | unlet! b:match_ignorecase b:match_skip b:match_words b:browsefilter"
|
|
||||||
|
|
||||||
" Restore the saved compatibility options.
|
|
||||||
let &cpo = s:save_cpo
|
let &cpo = s:save_cpo
|
||||||
unlet s:save_cpo
|
unlet s:save_cpo
|
||||||
|
22
runtime/indent/bitbake.vim
Normal file
22
runtime/indent/bitbake.vim
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
" Vim indent file
|
||||||
|
" Language: BitBake
|
||||||
|
" Copyright: Copyright (C) 2019 Agilent Technologies, Inc.
|
||||||
|
" Maintainer: Chris Laplante <chris.laplante@agilent.com>
|
||||||
|
" License: You may redistribute this under the same terms as Vim itself
|
||||||
|
|
||||||
|
if exists("b:did_indent")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
runtime! indent/sh.vim
|
||||||
|
|
||||||
|
setlocal indentexpr=bitbake#Indent(v:lnum)
|
||||||
|
setlocal autoindent
|
||||||
|
setlocal nolisp
|
||||||
|
setlocal shiftwidth=4
|
||||||
|
setlocal expandtab
|
||||||
|
setlocal indentkeys+=<:>,=elif,=except,0=\"
|
||||||
|
|
||||||
|
let b:undo_indent .= ' inde< ai< lisp< sw< et< indk<'
|
||||||
|
|
||||||
|
let b:did_indent = 1
|
11
runtime/indent/expect.vim
Normal file
11
runtime/indent/expect.vim
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
" Vim indent file
|
||||||
|
" Language: Expect
|
||||||
|
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||||
|
" Last Change: 2022 Jul 16
|
||||||
|
|
||||||
|
if exists("b:did_indent")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Syntax is similar to Tcl
|
||||||
|
runtime! indent/tcl.vim
|
@ -14,7 +14,7 @@ let b:did_indent = 1
|
|||||||
setlocal nolisp " Make sure lisp indenting doesn't supersede us
|
setlocal nolisp " Make sure lisp indenting doesn't supersede us
|
||||||
setlocal autoindent " indentexpr isn't much help otherwise
|
setlocal autoindent " indentexpr isn't much help otherwise
|
||||||
|
|
||||||
setlocal indentexpr=GetPythonIndent(v:lnum)
|
setlocal indentexpr=python#GetIndent(v:lnum)
|
||||||
setlocal indentkeys+=<:>,=elif,=except
|
setlocal indentkeys+=<:>,=elif,=except
|
||||||
|
|
||||||
let b:undo_indent = "setl ai< inde< indk< lisp<"
|
let b:undo_indent = "setl ai< inde< indk< lisp<"
|
||||||
@ -23,206 +23,11 @@ let b:undo_indent = "setl ai< inde< indk< lisp<"
|
|||||||
if exists("*GetPythonIndent")
|
if exists("*GetPythonIndent")
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
let s:keepcpo= &cpo
|
|
||||||
set cpo&vim
|
|
||||||
|
|
||||||
" Come here when loading the script the first time.
|
|
||||||
|
|
||||||
let s:maxoff = 50 " maximum number of lines to look backwards for ()
|
|
||||||
|
|
||||||
" See if the specified line is already user-dedented from the expected value.
|
|
||||||
function s:Dedented(lnum, expected)
|
|
||||||
return indent(a:lnum) <= a:expected - shiftwidth()
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
|
" Keep this for backward compatibility, new scripts should use
|
||||||
|
" python#GetIndent()
|
||||||
function GetPythonIndent(lnum)
|
function GetPythonIndent(lnum)
|
||||||
|
return python#GetIndent(a:lnum)
|
||||||
" If this line is explicitly joined: If the previous line was also joined,
|
|
||||||
" line it up with that one, otherwise add two 'shiftwidth'
|
|
||||||
if getline(a:lnum - 1) =~ '\\$'
|
|
||||||
if a:lnum > 1 && getline(a:lnum - 2) =~ '\\$'
|
|
||||||
return indent(a:lnum - 1)
|
|
||||||
endif
|
|
||||||
return indent(a:lnum - 1) + (exists("g:pyindent_continue") ? eval(g:pyindent_continue) : (shiftwidth() * 2))
|
|
||||||
endif
|
|
||||||
|
|
||||||
" If the start of the line is in a string don't change the indent.
|
|
||||||
if has('syntax_items')
|
|
||||||
\ && synIDattr(synID(a:lnum, 1, 1), "name") =~ "String$"
|
|
||||||
return -1
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Search backwards for the previous non-empty line.
|
|
||||||
let plnum = prevnonblank(v:lnum - 1)
|
|
||||||
|
|
||||||
if plnum == 0
|
|
||||||
" This is the first non-empty line, use zero indent.
|
|
||||||
return 0
|
|
||||||
endif
|
|
||||||
|
|
||||||
call cursor(plnum, 1)
|
|
||||||
|
|
||||||
" Identing inside parentheses can be very slow, regardless of the searchpair()
|
|
||||||
" timeout, so let the user disable this feature if he doesn't need it
|
|
||||||
let disable_parentheses_indenting = get(g:, "pyindent_disable_parentheses_indenting", 0)
|
|
||||||
|
|
||||||
if disable_parentheses_indenting == 1
|
|
||||||
let plindent = indent(plnum)
|
|
||||||
let plnumstart = plnum
|
|
||||||
else
|
|
||||||
" searchpair() can be slow sometimes, limit the time to 150 msec or what is
|
|
||||||
" put in g:pyindent_searchpair_timeout
|
|
||||||
let searchpair_stopline = 0
|
|
||||||
let searchpair_timeout = get(g:, 'pyindent_searchpair_timeout', 150)
|
|
||||||
|
|
||||||
" If the previous line is inside parenthesis, use the indent of the starting
|
|
||||||
" line.
|
|
||||||
" Trick: use the non-existing "dummy" variable to break out of the loop when
|
|
||||||
" going too far back.
|
|
||||||
let parlnum = searchpair('(\|{\|\[', '', ')\|}\|\]', 'nbW',
|
|
||||||
\ "line('.') < " . (plnum - s:maxoff) . " ? dummy :"
|
|
||||||
\ . " synIDattr(synID(line('.'), col('.'), 1), 'name')"
|
|
||||||
\ . " =~ '\\(Comment\\|Todo\\|String\\)$'",
|
|
||||||
\ searchpair_stopline, searchpair_timeout)
|
|
||||||
if parlnum > 0
|
|
||||||
let plindent = indent(parlnum)
|
|
||||||
let plnumstart = parlnum
|
|
||||||
else
|
|
||||||
let plindent = indent(plnum)
|
|
||||||
let plnumstart = plnum
|
|
||||||
endif
|
|
||||||
|
|
||||||
" When inside parenthesis: If at the first line below the parenthesis add
|
|
||||||
" two 'shiftwidth', otherwise same as previous line.
|
|
||||||
" i = (a
|
|
||||||
" + b
|
|
||||||
" + c)
|
|
||||||
call cursor(a:lnum, 1)
|
|
||||||
let p = searchpair('(\|{\|\[', '', ')\|}\|\]', 'bW',
|
|
||||||
\ "line('.') < " . (a:lnum - s:maxoff) . " ? dummy :"
|
|
||||||
\ . " synIDattr(synID(line('.'), col('.'), 1), 'name')"
|
|
||||||
\ . " =~ '\\(Comment\\|Todo\\|String\\)$'",
|
|
||||||
\ searchpair_stopline, searchpair_timeout)
|
|
||||||
if p > 0
|
|
||||||
if p == plnum
|
|
||||||
" When the start is inside parenthesis, only indent one 'shiftwidth'.
|
|
||||||
let pp = searchpair('(\|{\|\[', '', ')\|}\|\]', 'bW',
|
|
||||||
\ "line('.') < " . (a:lnum - s:maxoff) . " ? dummy :"
|
|
||||||
\ . " synIDattr(synID(line('.'), col('.'), 1), 'name')"
|
|
||||||
\ . " =~ '\\(Comment\\|Todo\\|String\\)$'",
|
|
||||||
\ searchpair_stopline, searchpair_timeout)
|
|
||||||
if pp > 0
|
|
||||||
return indent(plnum) + (exists("g:pyindent_nested_paren") ? eval(g:pyindent_nested_paren) : shiftwidth())
|
|
||||||
endif
|
|
||||||
return indent(plnum) + (exists("g:pyindent_open_paren") ? eval(g:pyindent_open_paren) : (shiftwidth() * 2))
|
|
||||||
endif
|
|
||||||
if plnumstart == p
|
|
||||||
return indent(plnum)
|
|
||||||
endif
|
|
||||||
return plindent
|
|
||||||
endif
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
" Get the line and remove a trailing comment.
|
|
||||||
" Use syntax highlighting attributes when possible.
|
|
||||||
let pline = getline(plnum)
|
|
||||||
let pline_len = strlen(pline)
|
|
||||||
if has('syntax_items')
|
|
||||||
" If the last character in the line is a comment, do a binary search for
|
|
||||||
" the start of the comment. synID() is slow, a linear search would take
|
|
||||||
" too long on a long line.
|
|
||||||
if synIDattr(synID(plnum, pline_len, 1), "name") =~ "\\(Comment\\|Todo\\)$"
|
|
||||||
let min = 1
|
|
||||||
let max = pline_len
|
|
||||||
while min < max
|
|
||||||
let col = (min + max) / 2
|
|
||||||
if synIDattr(synID(plnum, col, 1), "name") =~ "\\(Comment\\|Todo\\)$"
|
|
||||||
let max = col
|
|
||||||
else
|
|
||||||
let min = col + 1
|
|
||||||
endif
|
|
||||||
endwhile
|
|
||||||
let pline = strpart(pline, 0, min - 1)
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
let col = 0
|
|
||||||
while col < pline_len
|
|
||||||
if pline[col] == '#'
|
|
||||||
let pline = strpart(pline, 0, col)
|
|
||||||
break
|
|
||||||
endif
|
|
||||||
let col = col + 1
|
|
||||||
endwhile
|
|
||||||
endif
|
|
||||||
|
|
||||||
" If the previous line ended with a colon, indent this line
|
|
||||||
if pline =~ ':\s*$'
|
|
||||||
return plindent + shiftwidth()
|
|
||||||
endif
|
|
||||||
|
|
||||||
" If the previous line was a stop-execution statement...
|
|
||||||
if getline(plnum) =~ '^\s*\(break\|continue\|raise\|return\|pass\)\>'
|
|
||||||
" See if the user has already dedented
|
|
||||||
if s:Dedented(a:lnum, indent(plnum))
|
|
||||||
" If so, trust the user
|
|
||||||
return -1
|
|
||||||
endif
|
|
||||||
" If not, recommend one dedent
|
|
||||||
return indent(plnum) - shiftwidth()
|
|
||||||
endif
|
|
||||||
|
|
||||||
" If the current line begins with a keyword that lines up with "try"
|
|
||||||
if getline(a:lnum) =~ '^\s*\(except\|finally\)\>'
|
|
||||||
let lnum = a:lnum - 1
|
|
||||||
while lnum >= 1
|
|
||||||
if getline(lnum) =~ '^\s*\(try\|except\)\>'
|
|
||||||
let ind = indent(lnum)
|
|
||||||
if ind >= indent(a:lnum)
|
|
||||||
return -1 " indent is already less than this
|
|
||||||
endif
|
|
||||||
return ind " line up with previous try or except
|
|
||||||
endif
|
|
||||||
let lnum = lnum - 1
|
|
||||||
endwhile
|
|
||||||
return -1 " no matching "try"!
|
|
||||||
endif
|
|
||||||
|
|
||||||
" If the current line begins with a header keyword, dedent
|
|
||||||
if getline(a:lnum) =~ '^\s*\(elif\|else\)\>'
|
|
||||||
|
|
||||||
" Unless the previous line was a one-liner
|
|
||||||
if getline(plnumstart) =~ '^\s*\(for\|if\|elif\|try\)\>'
|
|
||||||
return plindent
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Or the user has already dedented
|
|
||||||
if s:Dedented(a:lnum, plindent)
|
|
||||||
return -1
|
|
||||||
endif
|
|
||||||
|
|
||||||
return plindent - shiftwidth()
|
|
||||||
endif
|
|
||||||
|
|
||||||
" When after a () construct we probably want to go back to the start line.
|
|
||||||
" a = (b
|
|
||||||
" + c)
|
|
||||||
" here
|
|
||||||
if parlnum > 0
|
|
||||||
" ...unless the user has already dedented
|
|
||||||
if s:Dedented(a:lnum, plindent)
|
|
||||||
return -1
|
|
||||||
else
|
|
||||||
return plindent
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
return -1
|
|
||||||
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
let &cpo = s:keepcpo
|
|
||||||
unlet s:keepcpo
|
|
||||||
|
|
||||||
" vim:sw=2
|
" vim:sw=2
|
||||||
|
19
runtime/indent/testdir/bitbake.in
Normal file
19
runtime/indent/testdir/bitbake.in
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# vim: set filetype=bitbake :
|
||||||
|
|
||||||
|
# START_INDENT
|
||||||
|
FOO = " \
|
||||||
|
bar \
|
||||||
|
baz \
|
||||||
|
qux \
|
||||||
|
"
|
||||||
|
|
||||||
|
do_configure() {
|
||||||
|
oe_conf
|
||||||
|
}
|
||||||
|
|
||||||
|
python do_task() {
|
||||||
|
def foo(x):
|
||||||
|
if y:
|
||||||
|
print(x)
|
||||||
|
}
|
||||||
|
# END_INDENT
|
19
runtime/indent/testdir/bitbake.ok
Normal file
19
runtime/indent/testdir/bitbake.ok
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# vim: set filetype=bitbake :
|
||||||
|
|
||||||
|
# START_INDENT
|
||||||
|
FOO = " \
|
||||||
|
bar \
|
||||||
|
baz \
|
||||||
|
qux \
|
||||||
|
"
|
||||||
|
|
||||||
|
do_configure() {
|
||||||
|
oe_conf
|
||||||
|
}
|
||||||
|
|
||||||
|
python do_task() {
|
||||||
|
def foo(x):
|
||||||
|
if y:
|
||||||
|
print(x)
|
||||||
|
}
|
||||||
|
# END_INDENT
|
178
runtime/pack/dist/opt/shellmenu/plugin/shellmenu.vim
vendored
178
runtime/pack/dist/opt/shellmenu/plugin/shellmenu.vim
vendored
@ -7,88 +7,98 @@
|
|||||||
" Attached is a Vim script file for turning gvim into a shell script editor.
|
" Attached is a Vim script file for turning gvim into a shell script editor.
|
||||||
" It may also be used as an example how to use menus in Vim.
|
" It may also be used as an example how to use menus in Vim.
|
||||||
"
|
"
|
||||||
" Written by: Lennart Schultz <les@dmi.min.dk>
|
" Maintainer: Ada (Haowen) Yu <me@yuhaowen.com>
|
||||||
|
" Original author: Lennart Schultz <les@dmi.min.dk> (mail unreachable)
|
||||||
|
|
||||||
imenu Stmts.for for in
do
doneki kk0elli
|
" Make sure the '<' and 'C' flags are not included in 'cpoptions', otherwise
|
||||||
imenu Stmts.case case in
) ;;
esacbki k0elli
|
" <CR> would not be recognized. See ":help 'cpoptions'".
|
||||||
imenu Stmts.if if
then
fiki kk0elli
|
let s:cpo_save = &cpo
|
||||||
imenu Stmts.if-else if
then
else
fiki kki kk0elli
|
set cpo&vim
|
||||||
imenu Stmts.elif elif
then
ki kk0elli
|
|
||||||
imenu Stmts.while while
do
doneki kk0elli
|
imenu ShellMenu.Statements.for for in <CR>do<CR><CR>done<esc>ki <esc>kk0elli
|
||||||
imenu Stmts.break break
|
imenu ShellMenu.Statements.case case in<CR>) ;;<CR>esac<esc>bki <esc>k0elli
|
||||||
imenu Stmts.continue continue
|
imenu ShellMenu.Statements.if if <CR>then<CR><CR>fi<esc>ki <esc>kk0elli
|
||||||
imenu Stmts.function () {
}ki k0i
|
imenu ShellMenu.Statements.if-else if <CR>then<CR><CR>else<CR><CR>fi<esc>ki <esc>kki <esc>kk0elli
|
||||||
imenu Stmts.return return
|
imenu ShellMenu.Statements.elif elif <CR>then<CR><CR><esc>ki <esc>kk0elli
|
||||||
imenu Stmts.return-true return 0
|
imenu ShellMenu.Statements.while while do<CR><CR>done<esc>ki <esc>kk0elli
|
||||||
imenu Stmts.return-false return 1
|
imenu ShellMenu.Statements.break break
|
||||||
imenu Stmts.exit exit
|
imenu ShellMenu.Statements.continue continue
|
||||||
imenu Stmts.shift shift
|
imenu ShellMenu.Statements.function () {<CR><CR>}<esc>ki <esc>k0i
|
||||||
imenu Stmts.trap trap
|
imenu ShellMenu.Statements.return return
|
||||||
imenu Test.existence [ -e ]hi
|
imenu ShellMenu.Statements.return-true return 0
|
||||||
imenu Test.existence - file [ -f ]hi
|
imenu ShellMenu.Statements.return-false return 1
|
||||||
imenu Test.existence - file (not empty) [ -s ]hi
|
imenu ShellMenu.Statements.exit exit
|
||||||
imenu Test.existence - directory [ -d ]hi
|
imenu ShellMenu.Statements.shift shift
|
||||||
imenu Test.existence - executable [ -x ]hi
|
imenu ShellMenu.Statements.trap trap
|
||||||
imenu Test.existence - readable [ -r ]hi
|
imenu ShellMenu.Test.Existence [ -e ]<esc>hi
|
||||||
imenu Test.existence - writable [ -w ]hi
|
imenu ShellMenu.Test.Existence\ -\ file [ -f ]<esc>hi
|
||||||
imenu Test.String is empty [ x = "x$" ]hhi
|
imenu ShellMenu.Test.Existence\ -\ file\ (not\ empty) [ -s ]<esc>hi
|
||||||
imenu Test.String is not empty [ x != "x$" ]hhi
|
imenu ShellMenu.Test.Existence\ -\ directory [ -d ]<esc>hi
|
||||||
imenu Test.Strings is equal [ "" = "" ]hhhhhhhi
|
imenu ShellMenu.Test.Existence\ -\ executable [ -x ]<esc>hi
|
||||||
imenu Test.Strings is not equal [ "" != "" ]hhhhhhhhi
|
imenu ShellMenu.Test.Existence\ -\ readable [ -r ]<esc>hi
|
||||||
imenu Test.Values is greater than [ -gt ]hhhhhhi
|
imenu ShellMenu.Test.Existence\ -\ writable [ -w ]<esc>hi
|
||||||
imenu Test.Values is greater equal [ -ge ]hhhhhhi
|
imenu ShellMenu.Test.String\ is\ empty [ x = "x$" ]<esc>hhi
|
||||||
imenu Test.Values is equal [ -eq ]hhhhhhi
|
imenu ShellMenu.Test.String\ is\ not\ empty [ x != "x$" ]<esc>hhi
|
||||||
imenu Test.Values is not equal [ -ne ]hhhhhhi
|
imenu ShellMenu.Test.Strings\ are\ equal [ "" = "" ]<esc>hhhhhhhi
|
||||||
imenu Test.Values is less than [ -lt ]hhhhhhi
|
imenu ShellMenu.Test.Strings\ are\ not\ equal [ "" != "" ]<esc>hhhhhhhhi
|
||||||
imenu Test.Values is less equal [ -le ]hhhhhhi
|
imenu ShellMenu.Test.Value\ is\ greater\ than [ -gt ]<esc>hhhhhhi
|
||||||
imenu ParmSub.Substitute word if parm not set ${:-}hhi
|
imenu ShellMenu.Test.Value\ is\ greater\ equal [ -ge ]<esc>hhhhhhi
|
||||||
imenu ParmSub.Set parm to word if not set ${:=}hhi
|
imenu ShellMenu.Test.Values\ are\ equal [ -eq ]<esc>hhhhhhi
|
||||||
imenu ParmSub.Substitute word if parm set else nothing ${:+}hhi
|
imenu ShellMenu.Test.Values\ are\ not\ equal [ -ne ]<esc>hhhhhhi
|
||||||
imenu ParmSub.If parm not set print word and exit ${:?}hhi
|
imenu ShellMenu.Test.Value\ is\ less\ than [ -lt ]<esc>hhhhhhi
|
||||||
imenu SpShVars.Number of positional parameters ${#}
|
imenu ShellMenu.Test.Value\ is\ less\ equal [ -le ]<esc>hhhhhhi
|
||||||
imenu SpShVars.All positional parameters (quoted spaces) ${*}
|
imenu ShellMenu.ParmSub.Substitute\ word\ if\ parm\ not\ set ${:-}<esc>hhi
|
||||||
imenu SpShVars.All positional parameters (unquoted spaces) ${@}
|
imenu ShellMenu.ParmSub.Set\ parm\ to\ word\ if\ not\ set ${:=}<esc>hhi
|
||||||
imenu SpShVars.Flags set ${-}
|
imenu ShellMenu.ParmSub.Substitute\ word\ if\ parm\ set\ else\ nothing ${:+}<esc>hhi
|
||||||
imenu SpShVars.Return code of last command ${?}
|
imenu ShellMenu.ParmSub.If\ parm\ not\ set\ print\ word\ and\ exit ${:?}<esc>hhi
|
||||||
imenu SpShVars.Process number of this shell ${$}
|
imenu ShellMenu.SpShVars.Number\ of\ positional\ parameters ${#}
|
||||||
imenu SpShVars.Process number of last background command ${!}
|
imenu ShellMenu.SpShVars.All\ positional\ parameters\ (quoted\ spaces) ${*}
|
||||||
imenu Environ.HOME ${HOME}
|
imenu ShellMenu.SpShVars.All\ positional\ parameters\ (unquoted\ spaces) ${@}
|
||||||
imenu Environ.PATH ${PATH}
|
imenu ShellMenu.SpShVars.Flags\ set ${-}
|
||||||
imenu Environ.CDPATH ${CDPATH}
|
imenu ShellMenu.SpShVars.Return\ code\ of\ last\ command ${?}
|
||||||
imenu Environ.MAIL ${MAIL}
|
imenu ShellMenu.SpShVars.Process\ number\ of\ this\ shell ${$}
|
||||||
imenu Environ.MAILCHECK ${MAILCHECK}
|
imenu ShellMenu.SpShVars.Process\ number\ of\ last\ background\ command ${!}
|
||||||
imenu Environ.PS1 ${PS1}
|
imenu ShellMenu.Environ.HOME ${HOME}
|
||||||
imenu Environ.PS2 ${PS2}
|
imenu ShellMenu.Environ.PATH ${PATH}
|
||||||
imenu Environ.IFS ${IFS}
|
imenu ShellMenu.Environ.CDPATH ${CDPATH}
|
||||||
imenu Environ.SHACCT ${SHACCT}
|
imenu ShellMenu.Environ.MAIL ${MAIL}
|
||||||
imenu Environ.SHELL ${SHELL}
|
imenu ShellMenu.Environ.MAILCHECK ${MAILCHECK}
|
||||||
imenu Environ.LC_CTYPE ${LC_CTYPE}
|
imenu ShellMenu.Environ.PS1 ${PS1}
|
||||||
imenu Environ.LC_MESSAGES ${LC_MESSAGES}
|
imenu ShellMenu.Environ.PS2 ${PS2}
|
||||||
imenu Builtins.cd cd
|
imenu ShellMenu.Environ.IFS ${IFS}
|
||||||
imenu Builtins.echo echo
|
imenu ShellMenu.Environ.SHACCT ${SHACCT}
|
||||||
imenu Builtins.eval eval
|
imenu ShellMenu.Environ.SHELL ${SHELL}
|
||||||
imenu Builtins.exec exec
|
imenu ShellMenu.Environ.LC_CTYPE ${LC_CTYPE}
|
||||||
imenu Builtins.export export
|
imenu ShellMenu.Environ.LC_MESSAGES ${LC_MESSAGES}
|
||||||
imenu Builtins.getopts getopts
|
imenu ShellMenu.Builtins.cd cd
|
||||||
imenu Builtins.hash hash
|
imenu ShellMenu.Builtins.echo echo
|
||||||
imenu Builtins.newgrp newgrp
|
imenu ShellMenu.Builtins.eval eval
|
||||||
imenu Builtins.pwd pwd
|
imenu ShellMenu.Builtins.exec exec
|
||||||
imenu Builtins.read read
|
imenu ShellMenu.Builtins.export export
|
||||||
imenu Builtins.readonly readonly
|
imenu ShellMenu.Builtins.getopts getopts
|
||||||
imenu Builtins.return return
|
imenu ShellMenu.Builtins.hash hash
|
||||||
imenu Builtins.times times
|
imenu ShellMenu.Builtins.newgrp newgrp
|
||||||
imenu Builtins.type type
|
imenu ShellMenu.Builtins.pwd pwd
|
||||||
imenu Builtins.umask umask
|
imenu ShellMenu.Builtins.read read
|
||||||
imenu Builtins.wait wait
|
imenu ShellMenu.Builtins.readonly readonly
|
||||||
imenu Set.set set
|
imenu ShellMenu.Builtins.return return
|
||||||
imenu Set.unset unset
|
imenu ShellMenu.Builtins.times times
|
||||||
imenu Set.mark modified or modified variables set -a
|
imenu ShellMenu.Builtins.type type
|
||||||
imenu Set.exit when command returns non-zero exit code set -e
|
imenu ShellMenu.Builtins.umask umask
|
||||||
imenu Set.Disable file name generation set -f
|
imenu ShellMenu.Builtins.wait wait
|
||||||
imenu Set.remember function commands set -h
|
imenu ShellMenu.Set.set set
|
||||||
imenu Set.All keyword arguments are placed in the environment set -k
|
imenu ShellMenu.Set.unset unset
|
||||||
imenu Set.Read commands but do not execute them set -n
|
imenu ShellMenu.Set.Mark\ created\ or\ modified\ variables\ for\ export set -a
|
||||||
imenu Set.Exit after reading and executing one command set -t
|
imenu ShellMenu.Set.Exit\ when\ command\ returns\ non-zero\ status set -e
|
||||||
imenu Set.Treat unset variables as an error when substituting set -u
|
imenu ShellMenu.Set.Disable\ file\ name\ expansion set -f
|
||||||
imenu Set.Print shell input lines as they are read set -v
|
imenu ShellMenu.Set.Locate\ and\ remember\ commands\ when\ being\ looked\ up set -h
|
||||||
imenu Set.Print commands and their arguments as they are executed set -x
|
imenu ShellMenu.Set.All\ assignment\ statements\ are\ placed\ in\ the\ environment\ for\ a\ command set -k
|
||||||
|
imenu ShellMenu.Set.Read\ commands\ but\ do\ not\ execute\ them set -n
|
||||||
|
imenu ShellMenu.Set.Exit\ after\ reading\ and\ executing\ one\ command set -t
|
||||||
|
imenu ShellMenu.Set.Treat\ unset\ variables\ as\ an\ error\ when\ substituting set -u
|
||||||
|
imenu ShellMenu.Set.Print\ shell\ input\ lines\ as\ they\ are\ read set -v
|
||||||
|
imenu ShellMenu.Set.Print\ commands\ and\ their\ arguments\ as\ they\ are\ executed set -x
|
||||||
|
|
||||||
|
" Restore the previous value of 'cpoptions'.
|
||||||
|
let &cpo = s:cpo_save
|
||||||
|
unlet s:cpo_save
|
||||||
|
@ -18,6 +18,10 @@ fun! SetSyn(name)
|
|||||||
else
|
else
|
||||||
let name = a:name
|
let name = a:name
|
||||||
endif
|
endif
|
||||||
|
if a:name == "whitespace"
|
||||||
|
" do not replace the filetype but add whitespace on top
|
||||||
|
let name = &ft .. ".whitespace"
|
||||||
|
endif
|
||||||
if !exists("s:syntax_menu_synonly")
|
if !exists("s:syntax_menu_synonly")
|
||||||
exe "set ft=" . name
|
exe "set ft=" . name
|
||||||
if exists("g:syntax_manual")
|
if exists("g:syntax_manual")
|
||||||
|
126
runtime/syntax/bitbake.vim
Normal file
126
runtime/syntax/bitbake.vim
Normal file
@ -0,0 +1,126 @@
|
|||||||
|
" Vim syntax file
|
||||||
|
" Language: BitBake bb/bbclasses/inc
|
||||||
|
" Author: Chris Larson <kergoth@handhelds.org>
|
||||||
|
" Ricardo Salveti <rsalveti@rsalveti.net>
|
||||||
|
" Copyright: Copyright (C) 2004 Chris Larson <kergoth@handhelds.org>
|
||||||
|
" Copyright (C) 2008 Ricardo Salveti <rsalveti@rsalveti.net>
|
||||||
|
"
|
||||||
|
" This file is licensed under the MIT license, see COPYING.MIT in
|
||||||
|
" this source distribution for the terms.
|
||||||
|
"
|
||||||
|
" Syntax highlighting for bb, bbclasses and inc files.
|
||||||
|
"
|
||||||
|
" It's an entirely new type, just has specific syntax in shell and python code
|
||||||
|
|
||||||
|
if v:version < 600
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
if exists("b:current_syntax")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
syn include @python syntax/python.vim
|
||||||
|
unlet! b:current_syntax
|
||||||
|
|
||||||
|
" BitBake syntax
|
||||||
|
|
||||||
|
" Matching case
|
||||||
|
syn case match
|
||||||
|
|
||||||
|
" Indicates the error when nothing is matched
|
||||||
|
syn match bbUnmatched "."
|
||||||
|
|
||||||
|
" Comments
|
||||||
|
syn cluster bbCommentGroup contains=bbTodo,@Spell
|
||||||
|
syn keyword bbTodo COMBAK FIXME TODO XXX contained
|
||||||
|
syn match bbComment "#.*$" contains=@bbCommentGroup
|
||||||
|
|
||||||
|
" String helpers
|
||||||
|
syn match bbQuote +['"]+ contained
|
||||||
|
syn match bbDelimiter "[(){}=]" contained
|
||||||
|
syn match bbArrayBrackets "[\[\]]" contained
|
||||||
|
|
||||||
|
" BitBake strings
|
||||||
|
syn match bbContinue "\\$"
|
||||||
|
syn region bbString matchgroup=bbQuote start=+"+ skip=+\\$+ end=+"+ contained contains=bbTodo,bbContinue,bbVarDeref,bbVarPyValue,@Spell
|
||||||
|
syn region bbString matchgroup=bbQuote start=+'+ skip=+\\$+ end=+'+ contained contains=bbTodo,bbContinue,bbVarDeref,bbVarPyValue,@Spell
|
||||||
|
|
||||||
|
" Vars definition
|
||||||
|
syn match bbExport "^export" nextgroup=bbIdentifier skipwhite
|
||||||
|
syn keyword bbExportFlag export contained nextgroup=bbIdentifier skipwhite
|
||||||
|
syn match bbIdentifier "[a-zA-Z0-9\-_\.\/\+]\+" display contained
|
||||||
|
syn match bbVarDeref "${[a-zA-Z0-9\-_:\.\/\+]\+}" contained
|
||||||
|
syn match bbVarEq "\(:=\|+=\|=+\|\.=\|=\.\|?=\|??=\|=\)" contained nextgroup=bbVarValue
|
||||||
|
syn match bbVarDef "^\(export\s*\)\?\([a-zA-Z0-9\-_\.\/\+][${}a-zA-Z0-9\-_:\.\/\+]*\)\s*\(:=\|+=\|=+\|\.=\|=\.\|?=\|??=\|=\)\@=" contains=bbExportFlag,bbIdentifier,bbOverrideOperator,bbVarDeref nextgroup=bbVarEq
|
||||||
|
syn match bbVarValue ".*$" contained contains=bbString,bbVarDeref,bbVarPyValue
|
||||||
|
syn region bbVarPyValue start=+${@+ skip=+\\$+ end=+}+ contained contains=@python
|
||||||
|
|
||||||
|
" Vars metadata flags
|
||||||
|
syn match bbVarFlagDef "^\([a-zA-Z0-9\-_\.]\+\)\(\[[a-zA-Z0-9\-_\.+]\+\]\)\@=" contains=bbIdentifier nextgroup=bbVarFlagFlag
|
||||||
|
syn region bbVarFlagFlag matchgroup=bbArrayBrackets start="\[" end="\]\s*\(:=\|=\|.=\|=.|+=\|=+\|?=\)\@=" contained contains=bbIdentifier nextgroup=bbVarEq
|
||||||
|
|
||||||
|
" Includes and requires
|
||||||
|
syn keyword bbInclude inherit include require contained
|
||||||
|
syn match bbIncludeRest ".*$" contained contains=bbString,bbVarDeref
|
||||||
|
syn match bbIncludeLine "^\(inherit\|include\|require\)\s\+" contains=bbInclude nextgroup=bbIncludeRest
|
||||||
|
|
||||||
|
" Add taks and similar
|
||||||
|
syn keyword bbStatement addtask deltask addhandler after before EXPORT_FUNCTIONS contained
|
||||||
|
syn match bbStatementRest ".*$" skipwhite contained contains=bbStatement
|
||||||
|
syn match bbStatementLine "^\(addtask\|deltask\|addhandler\|after\|before\|EXPORT_FUNCTIONS\)\s\+" contains=bbStatement nextgroup=bbStatementRest
|
||||||
|
|
||||||
|
" OE Important Functions
|
||||||
|
syn keyword bbOEFunctions do_fetch do_unpack do_patch do_configure do_compile do_stage do_install do_package contained
|
||||||
|
|
||||||
|
" Generic Functions
|
||||||
|
syn match bbFunction "\h[0-9A-Za-z_\-\.]*" display contained contains=bbOEFunctions
|
||||||
|
|
||||||
|
syn keyword bbOverrideOperator append prepend remove contained
|
||||||
|
|
||||||
|
" BitBake shell metadata
|
||||||
|
syn include @shell syntax/sh.vim
|
||||||
|
unlet! b:current_syntax
|
||||||
|
|
||||||
|
syn keyword bbShFakeRootFlag fakeroot contained
|
||||||
|
syn match bbShFuncDef "^\(fakeroot\s*\)\?\([\.0-9A-Za-z_:${}\-\.]\+\)\(python\)\@<!\(\s*()\s*\)\({\)\@=" contains=bbShFakeRootFlag,bbFunction,bbOverrideOperator,bbVarDeref,bbDelimiter nextgroup=bbShFuncRegion skipwhite
|
||||||
|
syn region bbShFuncRegion matchgroup=bbDelimiter start="{\s*$" end="^}\s*$" contained contains=@shell
|
||||||
|
|
||||||
|
" Python value inside shell functions
|
||||||
|
syn region shDeref start=+${@+ skip=+\\$+ excludenl end=+}+ contained contains=@python
|
||||||
|
|
||||||
|
" BitBake python metadata
|
||||||
|
syn keyword bbPyFlag python contained
|
||||||
|
syn match bbPyFuncDef "^\(fakeroot\s*\)\?\(python\)\(\s\+[0-9A-Za-z_:${}\-\.]\+\)\?\(\s*()\s*\)\({\)\@=" contains=bbShFakeRootFlag,bbPyFlag,bbFunction,bbOverrideOperator,bbVarDeref,bbDelimiter nextgroup=bbPyFuncRegion skipwhite
|
||||||
|
syn region bbPyFuncRegion matchgroup=bbDelimiter start="{\s*$" end="^}\s*$" contained contains=@python
|
||||||
|
|
||||||
|
" BitBake 'def'd python functions
|
||||||
|
syn keyword bbPyDef def contained
|
||||||
|
syn region bbPyDefRegion start='^\(def\s\+\)\([0-9A-Za-z_-]\+\)\(\s*(.*)\s*\):\s*$' end='^\(\s\|$\)\@!' contains=@python
|
||||||
|
|
||||||
|
" Highlighting Definitions
|
||||||
|
hi def link bbUnmatched Error
|
||||||
|
hi def link bbInclude Include
|
||||||
|
hi def link bbTodo Todo
|
||||||
|
hi def link bbComment Comment
|
||||||
|
hi def link bbQuote String
|
||||||
|
hi def link bbString String
|
||||||
|
hi def link bbDelimiter Keyword
|
||||||
|
hi def link bbArrayBrackets Statement
|
||||||
|
hi def link bbContinue Special
|
||||||
|
hi def link bbExport Type
|
||||||
|
hi def link bbExportFlag Type
|
||||||
|
hi def link bbIdentifier Identifier
|
||||||
|
hi def link bbVarDeref PreProc
|
||||||
|
hi def link bbVarDef Identifier
|
||||||
|
hi def link bbVarValue String
|
||||||
|
hi def link bbShFakeRootFlag Type
|
||||||
|
hi def link bbFunction Function
|
||||||
|
hi def link bbPyFlag Type
|
||||||
|
hi def link bbPyDef Statement
|
||||||
|
hi def link bbStatement Statement
|
||||||
|
hi def link bbStatementRest Identifier
|
||||||
|
hi def link bbOEFunctions Special
|
||||||
|
hi def link bbVarPyValue PreProc
|
||||||
|
hi def link bbOverrideOperator Operator
|
||||||
|
|
||||||
|
let b:current_syntax = "bitbake"
|
@ -1,12 +1,9 @@
|
|||||||
" Vim syntax file
|
" Vim syntax file
|
||||||
" Language: HTML
|
" Language: HTML
|
||||||
" Previous Maintainer: Jorge Maldonado Ventura <jorgesumle@freakspot.net>
|
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||||
" Previous Maintainer: Claudio Fleiner <claudio@fleiner.com>
|
" Previous Maintainers: Jorge Maldonado Ventura <jorgesumle@freakspot.net>
|
||||||
" Repository: https://notabug.org/jorgesumle/vim-html-syntax
|
" Claudio Fleiner <claudio@fleiner.com>
|
||||||
" Last Change: 2021 Mar 02
|
" Last Change: 2022 Jul 20
|
||||||
" Included patch #7900 to fix comments
|
|
||||||
" Included patch #7916 to fix a few more things
|
|
||||||
"
|
|
||||||
|
|
||||||
" Please check :help html.vim for some comments and a description of the options
|
" Please check :help html.vim for some comments and a description of the options
|
||||||
|
|
||||||
@ -23,6 +20,9 @@ set cpo&vim
|
|||||||
|
|
||||||
syntax spell toplevel
|
syntax spell toplevel
|
||||||
|
|
||||||
|
syn include @htmlXml syntax/xml.vim
|
||||||
|
unlet b:current_syntax
|
||||||
|
|
||||||
syn case ignore
|
syn case ignore
|
||||||
|
|
||||||
" mark illegal characters
|
" mark illegal characters
|
||||||
@ -47,13 +47,13 @@ syn keyword htmlTagName contained cite code dd dfn dir div dl dt font
|
|||||||
syn keyword htmlTagName contained form hr html img
|
syn keyword htmlTagName contained form hr html img
|
||||||
syn keyword htmlTagName contained input isindex kbd li link map menu
|
syn keyword htmlTagName contained input isindex kbd li link map menu
|
||||||
syn keyword htmlTagName contained meta ol option param pre p samp span
|
syn keyword htmlTagName contained meta ol option param pre p samp span
|
||||||
syn keyword htmlTagName contained select small sub sup
|
syn keyword htmlTagName contained select small strike sub sup
|
||||||
syn keyword htmlTagName contained table td textarea th tr tt ul var xmp
|
syn keyword htmlTagName contained table td textarea th tr tt ul var xmp
|
||||||
syn match htmlTagName contained "\<\(b\|i\|u\|h[1-6]\|em\|strong\|head\|body\|title\)\>"
|
syn match htmlTagName contained "\<\%(b\|i\|u\|h[1-6]\|em\|strong\|head\|body\|title\)\>"
|
||||||
|
|
||||||
" new html 4.0 tags
|
" new html 4.0 tags
|
||||||
syn keyword htmlTagName contained abbr acronym bdo button col label
|
syn keyword htmlTagName contained abbr acronym bdo button col colgroup
|
||||||
syn keyword htmlTagName contained colgroup fieldset iframe ins legend
|
syn keyword htmlTagName contained del fieldset iframe ins label legend
|
||||||
syn keyword htmlTagName contained object optgroup q s tbody tfoot thead
|
syn keyword htmlTagName contained object optgroup q s tbody tfoot thead
|
||||||
|
|
||||||
" new html 5 tags
|
" new html 5 tags
|
||||||
@ -65,6 +65,15 @@ syn keyword htmlTagName contained progress rb rp rt rtc ruby section
|
|||||||
syn keyword htmlTagName contained slot source summary template time track
|
syn keyword htmlTagName contained slot source summary template time track
|
||||||
syn keyword htmlTagName contained video wbr
|
syn keyword htmlTagName contained video wbr
|
||||||
|
|
||||||
|
" svg and math tags
|
||||||
|
syn keyword htmlMathTagName contained math
|
||||||
|
syn keyword htmlSvgTagName contained svg
|
||||||
|
|
||||||
|
syn region htmlMath start="<math>" end="</math>" contains=@htmlXml transparent keepend
|
||||||
|
syn region htmlSvg start="<svg>" end="</svg>" contains=@htmlXml transparent keepend
|
||||||
|
|
||||||
|
syn cluster xmlTagHook add=htmlMathTagName,htmlSvgTagName
|
||||||
|
|
||||||
" legal arg names
|
" legal arg names
|
||||||
syn keyword htmlArg contained action
|
syn keyword htmlArg contained action
|
||||||
syn keyword htmlArg contained align alink alt archive background bgcolor
|
syn keyword htmlArg contained align alink alt archive background bgcolor
|
||||||
@ -77,7 +86,7 @@ syn keyword htmlArg contained marginwidth maxlength method name prompt
|
|||||||
syn keyword htmlArg contained rel rev rows rowspan scrolling selected shape
|
syn keyword htmlArg contained rel rev rows rowspan scrolling selected shape
|
||||||
syn keyword htmlArg contained size src start target text type url
|
syn keyword htmlArg contained size src start target text type url
|
||||||
syn keyword htmlArg contained usemap ismap valign value vlink vspace width wrap
|
syn keyword htmlArg contained usemap ismap valign value vlink vspace width wrap
|
||||||
syn match htmlArg contained "\<\(http-equiv\|href\|title\)="me=e-1
|
syn match htmlArg contained "\<\%(http-equiv\|href\|title\)="me=e-1
|
||||||
|
|
||||||
" aria attributes
|
" aria attributes
|
||||||
exe 'syn match htmlArg contained "\<aria-\%(' . join([
|
exe 'syn match htmlArg contained "\<aria-\%(' . join([
|
||||||
@ -103,7 +112,7 @@ syn match htmlArg contained "\<z-index\>"
|
|||||||
syn keyword htmlTagName contained marquee
|
syn keyword htmlTagName contained marquee
|
||||||
|
|
||||||
" html 4.0 arg names
|
" html 4.0 arg names
|
||||||
syn match htmlArg contained "\<\(accept-charset\|label\)\>"
|
syn match htmlArg contained "\<\%(accept-charset\|label\)\>"
|
||||||
syn keyword htmlArg contained abbr accept accesskey axis char charoff charset
|
syn keyword htmlArg contained abbr accept accesskey axis char charoff charset
|
||||||
syn keyword htmlArg contained cite classid codetype compact data datetime
|
syn keyword htmlArg contained cite classid codetype compact data datetime
|
||||||
syn keyword htmlArg contained declare defer dir disabled for frame
|
syn keyword htmlArg contained declare defer dir disabled for frame
|
||||||
@ -113,17 +122,22 @@ syn keyword htmlArg contained rules scheme scope span standby style
|
|||||||
syn keyword htmlArg contained summary tabindex valuetype version
|
syn keyword htmlArg contained summary tabindex valuetype version
|
||||||
|
|
||||||
" html 5 arg names
|
" html 5 arg names
|
||||||
syn keyword htmlArg contained allowfullscreen async autocomplete autofocus
|
syn keyword htmlArg contained allow autocapitalize as blocking decoding
|
||||||
syn keyword htmlArg contained autoplay challenge contenteditable contextmenu
|
syn keyword htmlArg contained enterkeyhint imagesizes imagesrcset inert
|
||||||
syn keyword htmlArg contained controls crossorigin default dirname download
|
syn keyword htmlArg contained integrity is itemid itemprop itemref itemscope
|
||||||
syn keyword htmlArg contained draggable dropzone form formaction formenctype
|
syn keyword htmlArg contained itemtype loading nomodule ping playsinline
|
||||||
syn keyword htmlArg contained formmethod formnovalidate formtarget hidden
|
syn keyword htmlArg contained referrerpolicy slot allowfullscreen async
|
||||||
syn keyword htmlArg contained high icon inputmode keytype kind list loop low
|
syn keyword htmlArg contained autocomplete autofocus autoplay challenge
|
||||||
syn keyword htmlArg contained max min minlength muted nonce novalidate open
|
syn keyword htmlArg contained contenteditable contextmenu controls crossorigin
|
||||||
syn keyword htmlArg contained optimum pattern placeholder poster preload
|
syn keyword htmlArg contained default dirname download draggable dropzone form
|
||||||
syn keyword htmlArg contained radiogroup required reversed sandbox spellcheck
|
syn keyword htmlArg contained formaction formenctype formmethod formnovalidate
|
||||||
syn keyword htmlArg contained sizes srcset srcdoc srclang step title translate
|
syn keyword htmlArg contained formtarget hidden high icon inputmode keytype
|
||||||
syn keyword htmlArg contained typemustmatch
|
syn keyword htmlArg contained kind list loop low max min minlength muted nonce
|
||||||
|
syn keyword htmlArg contained novalidate open optimum pattern placeholder
|
||||||
|
syn keyword htmlArg contained poster preload radiogroup required reversed
|
||||||
|
syn keyword htmlArg contained sandbox spellcheck sizes srcset srcdoc srclang
|
||||||
|
syn keyword htmlArg contained step title translate typemustmatch
|
||||||
|
syn match htmlArg contained "\<data-\h\%(\w\|[-.]\)*\%(\_s*=\)\@="
|
||||||
|
|
||||||
" special characters
|
" special characters
|
||||||
syn match htmlSpecialChar "&#\=[0-9A-Za-z]\{1,8};"
|
syn match htmlSpecialChar "&#\=[0-9A-Za-z]\{1,8};"
|
||||||
@ -146,18 +160,19 @@ syn region htmlComment start=+<!DOCTYPE+ end=+>+ keepend
|
|||||||
|
|
||||||
" server-parsed commands
|
" server-parsed commands
|
||||||
syn region htmlPreProc start=+<!--#+ end=+-->+ contains=htmlPreStmt,htmlPreError,htmlPreAttr
|
syn region htmlPreProc start=+<!--#+ end=+-->+ contains=htmlPreStmt,htmlPreError,htmlPreAttr
|
||||||
syn match htmlPreStmt contained "<!--#\(config\|echo\|exec\|fsize\|flastmod\|include\|printenv\|set\|if\|elif\|else\|endif\|geoguide\)\>"
|
syn match htmlPreStmt contained "<!--#\%(config\|echo\|exec\|fsize\|flastmod\|include\|printenv\|set\|if\|elif\|else\|endif\|geoguide\)\>"
|
||||||
syn match htmlPreError contained "<!--#\S*"ms=s+4
|
syn match htmlPreError contained "<!--#\S*"ms=s+4
|
||||||
syn match htmlPreAttr contained "\w\+=[^"]\S\+" contains=htmlPreProcAttrError,htmlPreProcAttrName
|
syn match htmlPreAttr contained "\w\+=[^"]\S\+" contains=htmlPreProcAttrError,htmlPreProcAttrName
|
||||||
syn region htmlPreAttr contained start=+\w\+="+ skip=+\\\\\|\\"+ end=+"+ contains=htmlPreProcAttrName keepend
|
syn region htmlPreAttr contained start=+\w\+="+ skip=+\\\\\|\\"+ end=+"+ contains=htmlPreProcAttrName keepend
|
||||||
syn match htmlPreProcAttrError contained "\w\+="he=e-1
|
syn match htmlPreProcAttrError contained "\w\+="he=e-1
|
||||||
syn match htmlPreProcAttrName contained "\(expr\|errmsg\|sizefmt\|timefmt\|var\|cgi\|cmd\|file\|virtual\|value\)="he=e-1
|
syn match htmlPreProcAttrName contained "\%(expr\|errmsg\|sizefmt\|timefmt\|var\|cgi\|cmd\|file\|virtual\|value\)="he=e-1
|
||||||
|
|
||||||
if !exists("html_no_rendering")
|
if !exists("html_no_rendering")
|
||||||
" rendering
|
" rendering
|
||||||
syn cluster htmlTop contains=@Spell,htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLink,javaScript,@htmlPreproc
|
syn cluster htmlTop contains=@Spell,htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLink,javaScript,@htmlPreproc
|
||||||
|
|
||||||
syn region htmlStrike start="<del\>" end="</del\_s*>"me=s-1 contains=@htmlTop
|
syn region htmlStrike start="<del\>" end="</del\_s*>"me=s-1 contains=@htmlTop
|
||||||
|
syn region htmlStrike start="<s\>" end="</s\_s*>"me=s-1 contains=@htmlTop
|
||||||
syn region htmlStrike start="<strike\>" end="</strike\_s*>"me=s-1 contains=@htmlTop
|
syn region htmlStrike start="<strike\>" end="</strike\_s*>"me=s-1 contains=@htmlTop
|
||||||
|
|
||||||
syn region htmlBold start="<b\>" end="</b\_s*>"me=s-1 contains=@htmlTop,htmlBoldUnderline,htmlBoldItalic
|
syn region htmlBold start="<b\>" end="</b\_s*>"me=s-1 contains=@htmlTop,htmlBoldUnderline,htmlBoldItalic
|
||||||
@ -242,7 +257,7 @@ if main_syntax != 'java' || exists("java_css")
|
|||||||
syn include @htmlCss syntax/css.vim
|
syn include @htmlCss syntax/css.vim
|
||||||
unlet b:current_syntax
|
unlet b:current_syntax
|
||||||
syn region cssStyle start=+<style+ keepend end=+</style>+ contains=@htmlCss,htmlTag,htmlEndTag,htmlCssStyleComment,@htmlPreproc
|
syn region cssStyle start=+<style+ keepend end=+</style>+ contains=@htmlCss,htmlTag,htmlEndTag,htmlCssStyleComment,@htmlPreproc
|
||||||
syn match htmlCssStyleComment contained "\(<!--\|-->\)"
|
syn match htmlCssStyleComment contained "\%(<!--\|-->\)"
|
||||||
syn region htmlCssDefinition matchgroup=htmlArg start='style="' keepend matchgroup=htmlString end='"' contains=css.*Attr,css.*Prop,cssComment,cssLength,cssColor,cssURL,cssImportant,cssError,cssString,@htmlPreproc
|
syn region htmlCssDefinition matchgroup=htmlArg start='style="' keepend matchgroup=htmlString end='"' contains=css.*Attr,css.*Prop,cssComment,cssLength,cssColor,cssURL,cssImportant,cssError,cssString,@htmlPreproc
|
||||||
hi def link htmlStyleArg htmlString
|
hi def link htmlStyleArg htmlString
|
||||||
endif
|
endif
|
||||||
@ -263,6 +278,8 @@ hi def link htmlEndTag Identifier
|
|||||||
hi def link htmlArg Type
|
hi def link htmlArg Type
|
||||||
hi def link htmlTagName htmlStatement
|
hi def link htmlTagName htmlStatement
|
||||||
hi def link htmlSpecialTagName Exception
|
hi def link htmlSpecialTagName Exception
|
||||||
|
hi def link htmlMathTagName htmlTagName
|
||||||
|
hi def link htmlSvgTagName htmlTagName
|
||||||
hi def link htmlValue String
|
hi def link htmlValue String
|
||||||
hi def link htmlSpecialChar Special
|
hi def link htmlSpecialChar Special
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
" Maintainer: Roland Hieber <rohieb+vim-iR0jGdkV@rohieb.name>, <https://github.com/rohieb>
|
" Maintainer: Roland Hieber <rohieb+vim-iR0jGdkV@rohieb.name>, <https://github.com/rohieb>
|
||||||
" Previous Maintainer: Claudio Fleiner <claudio@fleiner.com>
|
" Previous Maintainer: Claudio Fleiner <claudio@fleiner.com>
|
||||||
" URL: https://github.com/vim/vim/blob/master/runtime/syntax/make.vim
|
" URL: https://github.com/vim/vim/blob/master/runtime/syntax/make.vim
|
||||||
" Last Change: 2020 May 03
|
" Last Change: 2020 Oct 16
|
||||||
|
|
||||||
" quit when a syntax file was already loaded
|
" quit when a syntax file was already loaded
|
||||||
if exists("b:current_syntax")
|
if exists("b:current_syntax")
|
||||||
@ -45,19 +45,19 @@ syn match makeImplicit "^\.[A-Za-z0-9_./\t -]\+\s*:$"me=e-1
|
|||||||
syn match makeImplicit "^\.[A-Za-z0-9_./\t -]\+\s*:[^=]"me=e-2
|
syn match makeImplicit "^\.[A-Za-z0-9_./\t -]\+\s*:[^=]"me=e-2
|
||||||
|
|
||||||
syn region makeTarget transparent matchgroup=makeTarget
|
syn region makeTarget transparent matchgroup=makeTarget
|
||||||
\ start="^[~A-Za-z0-9_./$()%-][A-Za-z0-9_./\t $()%-]*:\{1,2}[^:=]"rs=e-1
|
\ start="^[~A-Za-z0-9_./$()%-][A-Za-z0-9_./\t $()%-]*&\?:\?:\{1,2}[^:=]"rs=e-1
|
||||||
\ end=";"re=e-1,me=e-1 end="[^\\]$"
|
\ end="[^\\]$"
|
||||||
\ keepend contains=makeIdent,makeSpecTarget,makeNextLine,makeComment,makeDString
|
\ keepend contains=makeIdent,makeSpecTarget,makeNextLine,makeComment,makeDString
|
||||||
\ skipnl nextGroup=makeCommands
|
\ skipnl nextGroup=makeCommands
|
||||||
syn match makeTarget "^[~A-Za-z0-9_./$()%*@-][A-Za-z0-9_./\t $()%*@-]*::\=\s*$"
|
syn match makeTarget "^[~A-Za-z0-9_./$()%*@-][A-Za-z0-9_./\t $()%*@-]*&\?::\=\s*$"
|
||||||
\ contains=makeIdent,makeSpecTarget,makeComment
|
\ contains=makeIdent,makeSpecTarget,makeComment
|
||||||
\ skipnl nextgroup=makeCommands,makeCommandError
|
\ skipnl nextgroup=makeCommands,makeCommandError
|
||||||
|
|
||||||
syn region makeSpecTarget transparent matchgroup=makeSpecTarget
|
syn region makeSpecTarget transparent matchgroup=makeSpecTarget
|
||||||
\ start="^\.\(SUFFIXES\|PHONY\|DEFAULT\|PRECIOUS\|IGNORE\|SILENT\|EXPORT_ALL_VARIABLES\|KEEP_STATE\|LIBPATTERNS\|NOTPARALLEL\|DELETE_ON_ERROR\|INTERMEDIATE\|POSIX\|SECONDARY\)\>\s*:\{1,2}[^:=]"rs=e-1
|
\ start="^\.\(SUFFIXES\|PHONY\|DEFAULT\|PRECIOUS\|IGNORE\|SILENT\|EXPORT_ALL_VARIABLES\|KEEP_STATE\|LIBPATTERNS\|NOTPARALLEL\|DELETE_ON_ERROR\|INTERMEDIATE\|POSIX\|SECONDARY\|ONESHELL\)\>\s*:\{1,2}[^:=]"rs=e-1
|
||||||
\ end="[^\\]$" keepend
|
\ end="[^\\]$" keepend
|
||||||
\ contains=makeIdent,makeSpecTarget,makeNextLine,makeComment skipnl nextGroup=makeCommands
|
\ contains=makeIdent,makeSpecTarget,makeNextLine,makeComment skipnl nextGroup=makeCommands
|
||||||
syn match makeSpecTarget "^\.\(SUFFIXES\|PHONY\|DEFAULT\|PRECIOUS\|IGNORE\|SILENT\|EXPORT_ALL_VARIABLES\|KEEP_STATE\|LIBPATTERNS\|NOTPARALLEL\|DELETE_ON_ERROR\|INTERMEDIATE\|POSIX\|SECONDARY\)\>\s*::\=\s*$"
|
syn match makeSpecTarget "^\.\(SUFFIXES\|PHONY\|DEFAULT\|PRECIOUS\|IGNORE\|SILENT\|EXPORT_ALL_VARIABLES\|KEEP_STATE\|LIBPATTERNS\|NOTPARALLEL\|DELETE_ON_ERROR\|INTERMEDIATE\|POSIX\|SECONDARY\|ONESHELL\)\>\s*::\=\s*$"
|
||||||
\ contains=makeIdent,makeComment
|
\ contains=makeIdent,makeComment
|
||||||
\ skipnl nextgroup=makeCommands,makeCommandError
|
\ skipnl nextgroup=makeCommands,makeCommandError
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user