mirror of
https://github.com/neovim/neovim.git
synced 2024-12-19 10:45:16 -07:00
parent
c1dd4e83b4
commit
dd2bc06411
@ -976,7 +976,7 @@ to write anyway add a '!' to the command.
|
||||
|
||||
*write-permissions*
|
||||
When writing a new file the permissions are read-write. For unix the mask is
|
||||
0666 with additionally umask applied. When writing a file that was read Vim
|
||||
0o666 with additionally umask applied. When writing a file that was read Vim
|
||||
will preserve the permissions, but clear the s-bit.
|
||||
|
||||
*write-readonly*
|
||||
|
@ -1168,7 +1168,7 @@ x A single character, with no special meaning, matches itself
|
||||
\b <BS>
|
||||
\n line break, see above |/[\n]|
|
||||
\d123 decimal number of character
|
||||
\o40 octal number of character up to 0377
|
||||
\o40 octal number of character up to 0o377
|
||||
\x20 hexadecimal number of character up to 0xff
|
||||
\u20AC hex. number of multibyte character up to 0xffff
|
||||
\U1234 hex. number of multibyte character up to 0xffffffff
|
||||
@ -1205,7 +1205,8 @@ x A single character, with no special meaning, matches itself
|
||||
\%d123 Matches the character specified with a decimal number. Must be
|
||||
followed by a non-digit.
|
||||
\%o40 Matches the character specified with an octal number up to 0377.
|
||||
Numbers below 040 must be followed by a non-octal digit or a non-digit.
|
||||
Numbers below 0o40 must be followed by a non-octal digit or a
|
||||
non-digit.
|
||||
\%x2a Matches the character specified with up to two hexadecimal characters.
|
||||
\%u20AC Matches the character specified with up to four hexadecimal
|
||||
characters.
|
||||
|
@ -50,7 +50,7 @@ which moves to the previous end of a word:
|
||||
|
||||
This is a line with example text ~
|
||||
<----<----x---->------------>
|
||||
2ge ge e we
|
||||
2ge ge e 2e
|
||||
|
||||
If you are at the last word of a line, the "w" command will take you to the
|
||||
first word in the next line. Thus you can use this to move through a
|
||||
|
@ -122,14 +122,14 @@ starts with a zero. "017" is decimal 15. A binary number starts with "0b" or
|
||||
decimal number, it will be interpreted as an octal number!
|
||||
The ":echo" command always prints decimal numbers. Example: >
|
||||
|
||||
:echo 0x7f 036
|
||||
:echo 0x7f 0o36
|
||||
< 127 30 ~
|
||||
|
||||
A number is made negative with a minus sign. This also works for hexadecimal,
|
||||
octal and binary numbers. A minus sign is also used for subtraction. Compare
|
||||
this with the previous example: >
|
||||
|
||||
:echo 0x7f -036
|
||||
:echo 0x7f -0o36
|
||||
< 97 ~
|
||||
|
||||
White space in an expression is ignored. However, it's recommended to use it
|
||||
@ -137,7 +137,7 @@ for separating items, to make the expression easier to read. For example, to
|
||||
avoid the confusion with a negative number above, put a space between the
|
||||
minus sign and the following number: >
|
||||
|
||||
:echo 0x7f - 036
|
||||
:echo 0x7f - 0o36
|
||||
|
||||
==============================================================================
|
||||
*41.2* Variables
|
||||
|
@ -1,87 +1,83 @@
|
||||
" Vim ftplugin file
|
||||
" Language: Erlang
|
||||
" Language: Erlang (http://www.erlang.org)
|
||||
" Maintainer: Csaba Hoch <csaba.hoch@gmail.com>
|
||||
" Author: Oscar Hellström <oscar@oscarh.net>
|
||||
" Contributors: Ricardo Catalinas Jiménez <jimenezrick@gmail.com>
|
||||
" Eduardo Lopez (http://github.com/tapichu)
|
||||
" Arvid Bjurklint (http://github.com/slarwise)
|
||||
" Last Update: 2021-Jan-08
|
||||
" License: Vim license
|
||||
" Version: 2012/01/25
|
||||
" URL: https://github.com/vim-erlang/vim-erlang-runtime
|
||||
|
||||
if exists('b:did_ftplugin')
|
||||
finish
|
||||
else
|
||||
let b:did_ftplugin = 1
|
||||
endif
|
||||
|
||||
if exists('s:did_function_definitions')
|
||||
call s:SetErlangOptions()
|
||||
finish
|
||||
else
|
||||
let s:did_function_definitions = 1
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
if !exists('g:erlang_keywordprg')
|
||||
let g:erlang_keywordprg = 'erl -man'
|
||||
let &l:keywordprg = get(g:, 'erlang_keywordprg', 'erl -man')
|
||||
|
||||
if get(g:, 'erlang_folding', 0)
|
||||
setlocal foldmethod=expr
|
||||
setlocal foldexpr=GetErlangFold(v:lnum)
|
||||
setlocal foldtext=ErlangFoldText()
|
||||
endif
|
||||
|
||||
if !exists('g:erlang_folding')
|
||||
let g:erlang_folding = 0
|
||||
endif
|
||||
setlocal comments=:%%%,:%%,:%
|
||||
setlocal commentstring=%%s
|
||||
|
||||
setlocal formatoptions+=ro
|
||||
|
||||
setlocal suffixesadd=.erl,.hrl
|
||||
|
||||
let &l:include = '^\s*-\%(include\|include_lib\)\s*("\zs\f*\ze")'
|
||||
let &l:define = '^\s*-\%(define\|record\|type\|opaque\)'
|
||||
|
||||
let s:erlang_fun_begin = '^\a\w*(.*$'
|
||||
let s:erlang_fun_end = '^[^%]*\.\s*\(%.*\)\?$'
|
||||
|
||||
function s:SetErlangOptions()
|
||||
if g:erlang_folding
|
||||
setlocal foldmethod=expr
|
||||
setlocal foldexpr=GetErlangFold(v:lnum)
|
||||
setlocal foldtext=ErlangFoldText()
|
||||
endif
|
||||
if !exists('*GetErlangFold')
|
||||
function GetErlangFold(lnum)
|
||||
let lnum = a:lnum
|
||||
let line = getline(lnum)
|
||||
|
||||
setlocal comments=:%%%,:%%,:%
|
||||
setlocal commentstring=%%s
|
||||
if line =~ s:erlang_fun_end
|
||||
return '<1'
|
||||
endif
|
||||
|
||||
setlocal formatoptions+=ro
|
||||
let &l:keywordprg = g:erlang_keywordprg
|
||||
endfunction
|
||||
if line =~ s:erlang_fun_begin && foldlevel(lnum - 1) == 1
|
||||
return '1'
|
||||
endif
|
||||
|
||||
function GetErlangFold(lnum)
|
||||
let lnum = a:lnum
|
||||
let line = getline(lnum)
|
||||
if line =~ s:erlang_fun_begin
|
||||
return '>1'
|
||||
endif
|
||||
|
||||
if line =~ s:erlang_fun_end
|
||||
return '<1'
|
||||
endif
|
||||
return '='
|
||||
endfunction
|
||||
endif
|
||||
|
||||
if line =~ s:erlang_fun_begin && foldlevel(lnum - 1) == 1
|
||||
return '1'
|
||||
endif
|
||||
if !exists('*ErlangFoldText')
|
||||
function ErlangFoldText()
|
||||
let line = getline(v:foldstart)
|
||||
let foldlen = v:foldend - v:foldstart + 1
|
||||
let lines = ' ' . foldlen . ' lines: ' . substitute(line, "[\ \t]*", '', '')
|
||||
if foldlen < 10
|
||||
let lines = ' ' . lines
|
||||
endif
|
||||
let retval = '+' . v:folddashes . lines
|
||||
|
||||
if line =~ s:erlang_fun_begin
|
||||
return '>1'
|
||||
endif
|
||||
return retval
|
||||
endfunction
|
||||
endif
|
||||
|
||||
return '='
|
||||
endfunction
|
||||
|
||||
function ErlangFoldText()
|
||||
let line = getline(v:foldstart)
|
||||
let foldlen = v:foldend - v:foldstart + 1
|
||||
let lines = ' ' . foldlen . ' lines: ' . substitute(line, "[\ \t]*", '', '')
|
||||
if foldlen < 10
|
||||
let lines = ' ' . lines
|
||||
endif
|
||||
let retval = '+' . v:folddashes . lines
|
||||
|
||||
return retval
|
||||
endfunction
|
||||
|
||||
call s:SetErlangOptions()
|
||||
|
||||
let b:undo_ftplugin = "setlocal foldmethod< foldexpr< foldtext<"
|
||||
\ . " comments< commentstring< formatoptions<"
|
||||
let b:undo_ftplugin = "setlocal keywordprg< foldmethod< foldexpr< foldtext<"
|
||||
\ . " comments< commentstring< formatoptions< suffixesadd< include<"
|
||||
\ . " define<"
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: sw=2 et
|
||||
|
@ -2,7 +2,7 @@
|
||||
" Language: fstab file
|
||||
" Maintainer: Radu Dineiu <radu.dineiu@gmail.com>
|
||||
" URL: https://raw.github.com/rid9/vim-fstab/master/ftplugin/fstab.vim
|
||||
" Last Change: 2020 Dec 29
|
||||
" Last Change: 2021 Jan 02
|
||||
" Version: 1.0
|
||||
"
|
||||
" Credits:
|
||||
@ -16,4 +16,4 @@ let b:did_ftplugin = 1
|
||||
setlocal commentstring=#%s
|
||||
let b:undo_ftplugin = "setlocal commentstring<"
|
||||
|
||||
" vim: ts=8 ft=vim
|
||||
" vim: ts=8 ft=vim
|
||||
|
@ -6,7 +6,16 @@
|
||||
" See https://swift.org/LICENSE.txt for license information
|
||||
" See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
|
||||
"
|
||||
" Vim maintainer: Emir SARI <bitigchi@me.com>
|
||||
" Vim maintainer: Emir SARI <bitigchi@me.com>
|
||||
" Last Change: 2021 Jan 08
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
|
||||
let b:did_ftplugin = 1
|
||||
let b:undo_ftplugin = "setlocal comments< expandtab< tabstop< shiftwidth< smartindent<"
|
||||
|
||||
setlocal comments=s1:/*,mb:*,ex:*/,:///,://
|
||||
setlocal expandtab
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim filetype plugin
|
||||
" Language: Vim
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2020 Aug 14
|
||||
" Last Change: 2021 Jan 05
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists("b:did_ftplugin")
|
||||
@ -48,18 +48,24 @@ setlocal isk+=#
|
||||
" Use :help to lookup the keyword under the cursor with K.
|
||||
setlocal keywordprg=:help
|
||||
|
||||
" Set 'comments' to format dashed lists in comments
|
||||
" Avoid that #{} starts a comment.
|
||||
setlocal com=sO:\"\ -,mO:\"\ \ ,sO:#\ -,mO:#\ \ ,eO:##,:\",b:#
|
||||
" if "\n" .. getline(1, 10)->join("\n") =~# '\n\s*vim9\%[script]\>'
|
||||
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
|
||||
else
|
||||
setlocal com=sO:\"\ -,mO:\"\ \ ,:\"
|
||||
setlocal commentstring=#%s
|
||||
endif
|
||||
|
||||
|
||||
" Format comments to be up to 78 characters long
|
||||
if &tw == 0
|
||||
setlocal tw=78
|
||||
endif
|
||||
|
||||
" Comments start with a double quote; in Vim9 script # would also work
|
||||
setlocal commentstring=\"%s
|
||||
|
||||
" Prefer Vim help instead of manpages.
|
||||
setlocal keywordprg=:help
|
||||
|
||||
|
@ -227,4 +227,4 @@ endfunction
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim:sw=2
|
||||
" vim:sw=2
|
||||
|
@ -21,8 +21,27 @@ let cmd =
|
||||
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
" INDENT_EXE let g:vim_indent_cont = 5
|
||||
|
||||
let list = [
|
||||
\ 'one',
|
||||
\ 'two']
|
||||
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
" INDENT_EXE unlet g:vim_indent_cont
|
||||
|
||||
let list = [
|
||||
'one',
|
||||
'two',
|
||||
]
|
||||
echo
|
||||
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
" INDENT_AT this-line
|
||||
func Some()
|
||||
let f = x " this-line
|
||||
|
@ -21,8 +21,27 @@ let cmd =
|
||||
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
" INDENT_EXE let g:vim_indent_cont = 5
|
||||
|
||||
let list = [
|
||||
\ 'one',
|
||||
\ 'two']
|
||||
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
" INDENT_EXE unlet g:vim_indent_cont
|
||||
|
||||
let list = [
|
||||
'one',
|
||||
'two',
|
||||
]
|
||||
echo
|
||||
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
" INDENT_AT this-line
|
||||
func Some()
|
||||
let f = x " this-line
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim indent file
|
||||
" Language: Vim script
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2020 Sep 27
|
||||
" Last Change: 2021 Jan 06
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists("b:did_indent")
|
||||
@ -52,6 +52,7 @@ function GetVimIndentIntern()
|
||||
return 0
|
||||
endif
|
||||
let prev_text = getline(lnum)
|
||||
let found_cont = 0
|
||||
|
||||
" Add a 'shiftwidth' after :if, :while, :try, :catch, :finally, :function
|
||||
" and :else. Add it three times for a line that starts with '\' or '"\ '
|
||||
@ -83,6 +84,7 @@ function GetVimIndentIntern()
|
||||
endif
|
||||
|
||||
if cur_text =~ s:lineContPat && v:lnum > 1 && prev_text !~ s:lineContPat
|
||||
let found_cont = 1
|
||||
if exists("g:vim_indent_cont")
|
||||
let ind = ind + g:vim_indent_cont
|
||||
else
|
||||
@ -114,10 +116,50 @@ function GetVimIndentIntern()
|
||||
endif
|
||||
endif
|
||||
|
||||
" For a line starting with "}" find the matching "{". If it is at the start
|
||||
" of the line align with it, probably end of a block.
|
||||
" Use the mapped "%" from matchit to find the match, otherwise we may match
|
||||
" a { inside a comment or string.
|
||||
if cur_text =~ '^\s*}'
|
||||
if maparg('%') != ''
|
||||
exe v:lnum
|
||||
silent! normal %
|
||||
if line('.') < v:lnum && getline('.') =~ '^\s*{'
|
||||
let ind = indent('.')
|
||||
endif
|
||||
else
|
||||
" todo: use searchpair() to find a match
|
||||
endif
|
||||
endif
|
||||
|
||||
" Below a line starting with "}" find the matching "{". If it is at the
|
||||
" end of the line we must be below the end of a dictionary.
|
||||
if prev_text =~ '^\s*}'
|
||||
if maparg('%') != ''
|
||||
exe lnum
|
||||
silent! normal %
|
||||
if line('.') == lnum || getline('.') !~ '^\s*{'
|
||||
let ind = ind - shiftwidth()
|
||||
endif
|
||||
else
|
||||
" todo: use searchpair() to find a match
|
||||
endif
|
||||
endif
|
||||
|
||||
" Below a line starting with "]" we must be below the end of a list.
|
||||
if prev_text =~ '^\s*]'
|
||||
let ind = ind - shiftwidth()
|
||||
endif
|
||||
|
||||
" A line ending in "{"/"[} is most likely the start of a dict/list literal,
|
||||
" indent the next line more. Not for a continuation line.
|
||||
if prev_text =~ '[{[]\s*$' && !found_cont
|
||||
let ind = ind + shiftwidth()
|
||||
endif
|
||||
|
||||
" Subtract a 'shiftwidth' on a :endif, :endwhile, :catch, :finally, :endtry,
|
||||
" :endfun, :else and :augroup END.
|
||||
if cur_text =~ '^\s*\(ene\@!\|}\|cat\|finall\|el\|aug\%[roup]\s\+[eE][nN][dD]\)'
|
||||
if cur_text =~ '^\s*\(ene\@!\|cat\|finall\|el\|aug\%[roup]\s\+[eE][nN][dD]\)'
|
||||
let ind = ind - shiftwidth()
|
||||
endif
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
"
|
||||
" Author: Bram Moolenaar
|
||||
" Copyright: Vim license applies, see ":help license"
|
||||
" Last Change: 2020 Dec 07
|
||||
" Last Change: 2021 Jan 03
|
||||
"
|
||||
" WORK IN PROGRESS - Only the basics work
|
||||
" Note: On MS-Windows you need a recent version of gdb. The one included with
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim ABAP syntax file
|
||||
" Language: SAP - ABAP/R4
|
||||
" Maintainer: Marius Piedallu van Wyk <lailoken@gmail.com>
|
||||
" Last Change: 2018 Dec 12
|
||||
" Last Change: 2021 Jan 02
|
||||
" Comment: Thanks to EPI-USE Labs for all your assistance. :)
|
||||
|
||||
" Quit when a syntax file was already loaded
|
||||
@ -193,4 +193,4 @@ hi def link abapHex Number
|
||||
|
||||
let b:current_syntax = "abap"
|
||||
|
||||
" vim: ts=8 sw=2
|
||||
" vim: ts=8 sw=2
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim syntax file
|
||||
" Language: PROLOG
|
||||
" Maintainer: Anton Kochkov <anton.kochkov@gmail.com>
|
||||
" Last Change: 2019 Aug 29
|
||||
" Last Change: 2021 Jan 05
|
||||
|
||||
" There are two sets of highlighting in here:
|
||||
" If the "prolog_highlighting_clean" variable exists, it is rather sparse.
|
||||
@ -21,16 +21,16 @@ syn case match
|
||||
" Very simple highlighting for comments, clause heads and
|
||||
" character codes. It respects prolog strings and atoms.
|
||||
|
||||
syn region prologCComment start=+/\*+ end=+\*/+
|
||||
syn match prologComment +%.*+
|
||||
syn region prologCComment start=+/\*+ end=+\*/+ contains=@Spell
|
||||
syn match prologComment +%.*+ contains=@Spell
|
||||
|
||||
if !exists("prolog_highlighting_no_keyword")
|
||||
syn keyword prologKeyword module meta_predicate multifile dynamic
|
||||
endif
|
||||
syn match prologCharCode +0'\\\=.+
|
||||
syn region prologString start=+"+ skip=+\\\\\|\\"+ end=+"+
|
||||
syn region prologString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@Spell
|
||||
syn region prologAtom start=+'+ skip=+\\\\\|\\'+ end=+'+
|
||||
syn region prologClause matchgroup=prologClauseHead start=+^\s*[a-z]\w*+ matchgroup=Normal end=+\.\s\|\.$+ contains=ALLBUT,prologClause
|
||||
syn region prologClause matchgroup=prologClauseHead start=+^\s*[a-z]\w*+ matchgroup=Normal end=+\.\s\|\.$+ contains=ALLBUT,prologClause contains=@NoSpell
|
||||
|
||||
if !exists("prolog_highlighting_clean")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user