aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'runtime')
-rw-r--r--runtime/compiler/dart.vim26
-rw-r--r--runtime/compiler/dart2js.vim28
-rw-r--r--runtime/compiler/dart2native.vim28
-rw-r--r--runtime/compiler/dartanalyser.vim23
-rw-r--r--runtime/compiler/dartdevc.vim28
-rw-r--r--runtime/compiler/dartdoc.vim26
-rw-r--r--runtime/compiler/dartfmt.vim25
-rw-r--r--runtime/compiler/javac.vim15
-rw-r--r--runtime/compiler/rhino.vim30
-rw-r--r--runtime/doc/eval.txt12
-rw-r--r--runtime/doc/map.txt65
-rw-r--r--runtime/doc/message.txt2
-rw-r--r--runtime/doc/options.txt2
-rw-r--r--runtime/doc/pattern.txt22
-rw-r--r--runtime/doc/usr_03.txt17
-rw-r--r--runtime/doc/usr_41.txt48
-rw-r--r--runtime/ftplugin/spec.vim8
-rw-r--r--runtime/indent/json.vim22
-rw-r--r--runtime/keymap/french-azerty.vim81
-rw-r--r--runtime/keymap/german-qwertz.vim76
-rw-r--r--runtime/keymap/turkish-f.vim1
21 files changed, 489 insertions, 96 deletions
diff --git a/runtime/compiler/dart.vim b/runtime/compiler/dart.vim
new file mode 100644
index 0000000000..f9ebfe1b27
--- /dev/null
+++ b/runtime/compiler/dart.vim
@@ -0,0 +1,26 @@
+" Vim compiler file
+" Compiler: Dart VM
+" Maintainer: Doug Kearns <dougkearns@gmail.com>
+" Last Change: 2019 May 08
+
+if exists("current_compiler")
+ finish
+endif
+let current_compiler = "dart"
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+let s:cpo_save = &cpo
+set cpo&vim
+
+CompilerSet makeprg=dart
+CompilerSet errorformat=%E%f:%l:%c:\ Error:\ %m,
+ \%CTry\ %.%#,
+ \%Z\ %#^%\\+,
+ \%C%.%#,
+ \%-G%.%#
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
diff --git a/runtime/compiler/dart2js.vim b/runtime/compiler/dart2js.vim
new file mode 100644
index 0000000000..b6a4e4d530
--- /dev/null
+++ b/runtime/compiler/dart2js.vim
@@ -0,0 +1,28 @@
+" Vim compiler file
+" Compiler: Dart to JavaScript Compiler
+" Maintainer: Doug Kearns <dougkearns@gmail.com>
+" Last Change: 2019 May 08
+
+if exists("current_compiler")
+ finish
+endif
+let current_compiler = "dart2js"
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+let s:cpo_save = &cpo
+set cpo&vim
+
+CompilerSet makeprg=dart2js
+CompilerSet errorformat=%E%f:%l:%c:,
+ \%-GError:\ Compilation\ failed.,
+ \%CError:\ %m,
+ \%Z\ %#^%\\+,
+ \%C%.%#,
+ \%trror:\ %m,
+ \%-G%.%#
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
diff --git a/runtime/compiler/dart2native.vim b/runtime/compiler/dart2native.vim
new file mode 100644
index 0000000000..51bdab0cc3
--- /dev/null
+++ b/runtime/compiler/dart2native.vim
@@ -0,0 +1,28 @@
+" Vim compiler file
+" Compiler: Dart to Native Compiler
+" Maintainer: Doug Kearns <dougkearns@gmail.com>
+" Last Change: 2019 May 08
+
+if exists("current_compiler")
+ finish
+endif
+let current_compiler = "dart2native"
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+let s:cpo_save = &cpo
+set cpo&vim
+
+CompilerSet makeprg=dart2native
+CompilerSet errorformat=%E%f:%l:%c:\ Error:\ %m,
+ \%CTry\ %.%#,
+ \%Z\ %#^%\\+,
+ \%Z%$,
+ \%C%.%#,
+ \%E%f:\ %trror:\ %m,
+ \%-G%.%#
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
diff --git a/runtime/compiler/dartanalyser.vim b/runtime/compiler/dartanalyser.vim
new file mode 100644
index 0000000000..e691d80b61
--- /dev/null
+++ b/runtime/compiler/dartanalyser.vim
@@ -0,0 +1,23 @@
+" Vim compiler file
+" Compiler: Dart Analyzer
+" Maintainer: Doug Kearns <dougkearns@gmail.com>
+" Last Change: 2019 May 08
+
+if exists("current_compiler")
+ finish
+endif
+let current_compiler = "dartanalyzer"
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+let s:cpo_save = &cpo
+set cpo&vim
+
+CompilerSet makeprg=dartanalyzer\ --format\ machine
+CompilerSet errorformat=%t%\\w%\\+\|%\\w%\\+\|%\\w%\\+\|%f\|%l\|%c\|%\\d%\\+\|%m,
+ \%-G%.%#
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
diff --git a/runtime/compiler/dartdevc.vim b/runtime/compiler/dartdevc.vim
new file mode 100644
index 0000000000..e8d1988ed6
--- /dev/null
+++ b/runtime/compiler/dartdevc.vim
@@ -0,0 +1,28 @@
+" Vim compiler file
+" Compiler: Dart Development Compiler
+" Maintainer: Doug Kearns <dougkearns@gmail.com>
+" Last Change: 2019 May 08
+
+if exists("current_compiler")
+ finish
+endif
+let current_compiler = "dartdevc"
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+let s:cpo_save = &cpo
+set cpo&vim
+
+CompilerSet makeprg=dartdevc
+CompilerSet errorformat=%E%f:%l:%c:\ Error:\ %m,
+ \%CTry\ %.%#,
+ \%Z\ %#^%\\+,
+ \%Z%$,
+ \%C%.%#,
+ \%E%f:\ %trror:\ %m,
+ \%-G%.%#
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
diff --git a/runtime/compiler/dartdoc.vim b/runtime/compiler/dartdoc.vim
new file mode 100644
index 0000000000..26b38d8dd4
--- /dev/null
+++ b/runtime/compiler/dartdoc.vim
@@ -0,0 +1,26 @@
+" Vim compiler file
+" Compiler: Dart Documentation Generator
+" Maintainer: Doug Kearns <dougkearns@gmail.com>
+" Last Change: 2019 May 08
+
+if exists("current_compiler")
+ finish
+endif
+let current_compiler = "dartdoc"
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+let s:cpo_save = &cpo
+set cpo&vim
+
+CompilerSet makeprg=dartdoc
+CompilerSet errorformat=\ \ %tarning:\ %m,
+ \\ \ %trror:\ %m,
+ \%+EGeneration\ failed:\ %m,
+ \%+ISuccess!\ Docs\ generated\ into\ %f,
+ \%-G%.%#
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
diff --git a/runtime/compiler/dartfmt.vim b/runtime/compiler/dartfmt.vim
new file mode 100644
index 0000000000..2e4ab02ad3
--- /dev/null
+++ b/runtime/compiler/dartfmt.vim
@@ -0,0 +1,25 @@
+" Vim compiler file
+" Compiler: Dart Formatter
+" Maintainer: Doug Kearns <dougkearns@gmail.com>
+" Last Change: 2019 May 08
+
+if exists("current_compiler")
+ finish
+endif
+let current_compiler = "dartfmt"
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+let s:cpo_save = &cpo
+set cpo&vim
+
+CompilerSet makeprg=dartfmt
+CompilerSet errorformat=%Eline\ %l\\,\ column\ %c\ of\ %f:\ %m,
+ \%Z\ %\\{3}│\ %\\+^%\\+,
+ \%C%.%#,
+ \%-G%.%#
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
diff --git a/runtime/compiler/javac.vim b/runtime/compiler/javac.vim
index a50bdca8f2..8507efd67c 100644
--- a/runtime/compiler/javac.vim
+++ b/runtime/compiler/javac.vim
@@ -1,7 +1,7 @@
" Vim compiler file
-" Compiler: javac
+" Compiler: Java Development Kit Compiler
" Maintainer: Doug Kearns <dougkearns@gmail.com>
-" Last Change: 2004 Nov 27
+" Last Change: 2019 Oct 21
if exists("current_compiler")
finish
@@ -12,6 +12,15 @@ if exists(":CompilerSet") != 2 " older Vim always used :setlocal
command -nargs=* CompilerSet setlocal <args>
endif
+let s:cpo_save = &cpo
+set cpo&vim
+
CompilerSet makeprg=javac
+CompilerSet errorformat=%E%f:%l:\ error:\ %m,
+ \%W%f:%l:\ warning:\ %m,
+ \%-Z%p^,
+ \%-C%.%#,
+ \%-G%.%#
-CompilerSet errorformat=%E%f:%l:\ %m,%-Z%p^,%-C%.%#,%-G%.%#
+let &cpo = s:cpo_save
+unlet s:cpo_save
diff --git a/runtime/compiler/rhino.vim b/runtime/compiler/rhino.vim
new file mode 100644
index 0000000000..30f3dd3252
--- /dev/null
+++ b/runtime/compiler/rhino.vim
@@ -0,0 +1,30 @@
+" Vim compiler file
+" Compiler: Rhino Shell (JavaScript in Java)
+" Maintainer: Doug Kearns <dougkearns@gmail.com>
+" Last Change: 2019 Jul 10
+
+if exists("current_compiler")
+ finish
+endif
+let current_compiler = "rhino"
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+let s:cpo_save = &cpo
+set cpo&vim
+
+" CompilerSet makeprg=java\ -jar\ lib/rhino-X.X.XX.jar\ -w\ -strict
+
+CompilerSet makeprg=rhino
+CompilerSet errorformat=%-Gjs:\ %.%#Compilation\ produced%.%#,
+ \%Ejs:\ \"%f\"\\,\ line\ %l:\ %m,
+ \%Ejs:\ uncaught\ JavaScript\ runtime\ exception:\ %m,
+ \%Wjs:\ warning:\ \"%f\"\\,\ line\ %l:\ %m,
+ \%Zjs:\ %p^,
+ \%Cjs:\ %.%#,
+ \%-G%.%#
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index ba2b3d567c..0c5bf0b2d8 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -75,8 +75,9 @@ base, use |str2nr()|.
*TRUE* *FALSE* *Boolean*
For boolean operators Numbers are used. Zero is FALSE, non-zero is TRUE.
-You can also use |v:false| and |v:true|. When TRUE is returned from a
-function it is the Number one, FALSE is the number zero.
+You can also use |v:false| and |v:true|.
+When TRUE is returned from a function it is the Number one, FALSE is the
+number zero.
Note that in the command: >
:if "foo"
@@ -2818,7 +2819,7 @@ bufnr([{expr} [, {create}]])
the ":ls" command. For the use of {expr}, see |bufname()|
above.
If the buffer doesn't exist, -1 is returned. Or, if the
- {create} argument is present and not zero, a new, unlisted,
+ {create} argument is present and TRUE, a new, unlisted,
buffer is created and its number is returned.
bufnr("$") is the last buffer: >
:let last_buffer = bufnr("$")
@@ -8161,7 +8162,7 @@ str2list({expr} [, {utf8}]) *str2list()*
< |list2str()| does the opposite.
When {utf8} is omitted or zero, the current 'encoding' is used.
- With {utf8} set to 1, always treat the String as utf-8
+ With {utf8} set to TRUE, always treat the String as utf-8
characters. With utf-8 composing characters are handled
properly: >
str2list("á") returns [97, 769]
@@ -9136,7 +9137,8 @@ win_screenpos({nr}) *win_screenpos()*
Return the screen position of window {nr} as a list with two
numbers: [row, col]. The first window always has position
[1, 1], unless there is a tabline, then it is [2, 1].
- {nr} can be the window number or the |window-ID|.
+ {nr} can be the window number or the |window-ID|. Use zero
+ for the current window.
Return [0, 0] if the window cannot be found in the current
tabpage.
diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt
index 82c54925fd..9c72412179 100644
--- a/runtime/doc/map.txt
+++ b/runtime/doc/map.txt
@@ -180,7 +180,7 @@ Note that this works when the <nowait> mapping fully matches and is found
before any partial matches. This works when:
- There is only one matching buffer-local mapping, since these are always
found before global mappings.
-- There is another buffer-local mapping that partly matches, but it is was
+- There is another buffer-local mapping that partly matches, but it is
defined earlier (last defined mapping is found first).
*:map-<silent>* *:map-silent*
@@ -283,15 +283,8 @@ Here is an example that inserts a list number that increases: >
CTRL-L inserts the next number, CTRL-R resets the count. CTRL-R returns an
empty string, so that nothing is inserted.
-Note that there are some tricks to make special keys work and escape CSI bytes
-in the text. The |:map| command also does this, thus you must avoid that it
-is done twice. This does not work: >
- :imap <expr> <F3> "<Char-0x611B>"
-Because the <Char- sequence is escaped for being a |:imap| argument and then
-again for using <expr>. This does work: >
- :imap <expr> <F3> "\u611B"
-Using 0x80 as a single byte before other text does not work, it will be seen
-as a special key.
+Note that using 0x80 as a single byte before other text does not work, it will
+be seen as a special key.
*<Cmd>* *:map-cmd*
The <Cmd> pseudokey begins a "command mapping", which executes the command
@@ -814,35 +807,47 @@ g@{motion} Call the function set by the 'operatorfunc' option.
Here is an example that counts the number of spaces with <F4>: >
- nmap <silent> <F4> :set opfunc=CountSpaces<CR>g@
- vmap <silent> <F4> :<C-U>call CountSpaces(visualmode(), 1)<CR>
+ nnoremap <expr> <F4> CountSpaces()
+ xnoremap <expr> <F4> CountSpaces()
+ " doubling <F4> works on a line
+ nnoremap <expr> <F4><F4> CountSpaces() .. '_'
- function! CountSpaces(type, ...)
- let sel_save = &selection
- let &selection = "inclusive"
- let reg_save = @@
-
- if a:0 " Invoked from Visual mode, use gv command.
- silent exe "normal! gvy"
- elseif a:type == 'line'
- silent exe "normal! '[V']y"
- else
- silent exe "normal! `[v`]y"
+ function CountSpaces(type = '') abort
+ if a:type == ''
+ set opfunc=CountSpaces
+ return 'g@'
endif
- echomsg strlen(substitute(@@, '[^ ]', '', 'g'))
-
- let &selection = sel_save
- let @@ = reg_save
+ let sel_save = &selection
+ let reg_save = getreginfo('"')
+ let cb_save = &clipboard
+ let visual_marks_save = [getpos("'<"), getpos("'>")]
+
+ try
+ set clipboard= selection=inclusive
+ let commands = #{line: "'[V']y", char: "`[v`]y", block: "`[\<c-v>`]y"}
+ silent exe 'noautocmd keepjumps normal! ' .. get(commands, a:type, '')
+ echom getreg('"')->count(' ')
+ finally
+ call setreg('"', reg_save)
+ call setpos("'<", visual_marks_save[0])
+ call setpos("'>", visual_marks_save[1])
+ let &clipboard = cb_save
+ let &selection = sel_save
+ endtry
endfunction
+An <expr> mapping is used to be able to fetch any prefixed count and register.
+This also avoids using a command line, which would trigger CmdlineEnter and
+CmdlineLeave autocommands.
+
Note that the 'selection' option is temporarily set to "inclusive" to be able
to yank exactly the right text by using Visual mode from the '[ to the ']
mark.
-Also note that there is a separate mapping for Visual mode. It removes the
-"'<,'>" range that ":" inserts in Visual mode and invokes the function with
-visualmode() and an extra argument.
+Also note that the 'clipboard' option is temporarily emptied to avoid
+clobbering the `"*` or `"+` registers, if its value contains the item `unnamed`
+or `unnamedplus`.
==============================================================================
2. Abbreviations *abbreviations* *Abbreviations*
diff --git a/runtime/doc/message.txt b/runtime/doc/message.txt
index 85e11634fc..4df53a561e 100644
--- a/runtime/doc/message.txt
+++ b/runtime/doc/message.txt
@@ -68,7 +68,7 @@ Or view a list of recent messages with: >
See `:messages` above.
LIST OF MESSAGES
- *E222* *E228* *E232* *E256* *E293* *E298* *E304* *E317*
+ *E222* *E228* *E232* *E293* *E298* *E304* *E317*
*E318* *E356* *E438* *E439* *E440* *E316* *E320* *E322*
*E323* *E341* *E473* *E570* *E685* *E292* >
Add to read buffer
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 79dcea510c..a7ad94db6d 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -5256,7 +5256,7 @@ A jump table for the options with a short description can be found at |Q_op|.
of this option).
For MS-Windows the default is ">%s 2>&1". The output is directly
saved in a file and not echoed to the screen.
- For Unix the default it "| tee". The stdout of the compiler is saved
+ For Unix the default is "| tee". The stdout of the compiler is saved
in a file and echoed to the screen. If the 'shell' option is "csh" or
"tcsh" after initializations, the default becomes "|& tee". If the
'shell' option is "sh", "ksh", "mksh", "pdksh", "zsh", "zsh-beta",
diff --git a/runtime/doc/pattern.txt b/runtime/doc/pattern.txt
index 92147ecbce..406068982e 100644
--- a/runtime/doc/pattern.txt
+++ b/runtime/doc/pattern.txt
@@ -787,11 +787,12 @@ An ordinary atom can be:
^beep( the start of the C function "beep" (probably).
*/\^*
-\^ Matches literal '^'. Can be used at any position in the pattern.
+\^ Matches literal '^'. Can be used at any position in the pattern, but
+ not inside [].
*/\_^*
\_^ Matches start-of-line. |/zero-width| Can be used at any position in
- the pattern.
+ the pattern, but not inside [].
Example matches ~
\_s*\_^foo white space and blank lines and then "foo" at
start-of-line
@@ -802,12 +803,13 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on):
|/zero-width|
*/\$*
-\$ Matches literal '$'. Can be used at any position in the pattern.
+\$ Matches literal '$'. Can be used at any position in the pattern, but
+ not inside [].
*/\_$*
\_$ Matches end-of-line. |/zero-width| Can be used at any position in the
- pattern. Note that "a\_$b" never matches, since "b" cannot match an
- end-of-line. Use "a\nb" instead |/\n|.
+ pattern, but not inside []. Note that "a\_$b" never matches, since
+ "b" cannot match an end-of-line. Use "a\nb" instead |/\n|.
Example matches ~
foo\_$\_s* "foo" at end-of-line and following white space and
blank lines
@@ -830,8 +832,9 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on):
|/zero-width|
*/\zs*
-\zs Matches at any position, and sets the start of the match there: The
- next char is the first char of the whole match. |/zero-width|
+\zs Matches at any position, but not inside [], and sets the start of the
+ match there: The next char is the first char of the whole match.
+ |/zero-width|
Example: >
/^\s*\zsif
< matches an "if" at the start of a line, ignoring white space.
@@ -842,8 +845,9 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on):
This cannot be followed by a multi. *E888*
*/\ze*
-\ze Matches at any position, and sets the end of the match there: The
- previous char is the last char of the whole match. |/zero-width|
+\ze Matches at any position, but not inside [], and sets the end of the
+ match there: The previous char is the last char of the whole match.
+ |/zero-width|
Can be used multiple times, the last one encountered in a matching
branch is used.
Example: "end\ze\(if\|for\)" matches the "end" in "endif" and
diff --git a/runtime/doc/usr_03.txt b/runtime/doc/usr_03.txt
index b1b04f95c7..d42701b698 100644
--- a/runtime/doc/usr_03.txt
+++ b/runtime/doc/usr_03.txt
@@ -30,10 +30,11 @@ Table of contents: |usr_toc.txt|
To move the cursor forward one word, use the "w" command. Like most Vim
commands, you can use a numeric prefix to move past multiple words. For
-example, "3w" moves three words. This figure shows how it works:
+example, "3w" moves three words. This figure shows how it works (starting at
+the position marked with "x"):
This is a line with example text ~
- --->-->->----------------->
+ x-->-->->----------------->
w w w 3w
Notice that "w" moves to the start of the next word if it already is at the
@@ -41,15 +42,15 @@ start of a word.
The "b" command moves backward to the start of the previous word:
This is a line with example text ~
- <----<--<-<---------<---
+ <----<--<-<---------<--x
b b b 2b b
There is also the "e" command that moves to the next end of a word and "ge",
which moves to the previous end of a word:
This is a line with example text ~
- <- <--- -----> ---->
- ge ge e e
+ <----<----x---->------------>
+ 2ge ge e we
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
@@ -82,12 +83,12 @@ an <End> key it will do the same thing.
The "^" command moves to the first non-blank character of the line. The "0"
command (zero) moves to the very first character of the line, and the <Home>
-key does the same thing. In a picture:
+key does the same thing. In a picture ("." indicates a space):
^
- <------------
+ <-----------x
.....This is a line with example text ~
- <----------------- --------------->
+ <----------------x x-------------->
0 $
(the "....." indicates blanks here)
diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt
index 80c0592c7c..9505ac7909 100644
--- a/runtime/doc/usr_41.txt
+++ b/runtime/doc/usr_41.txt
@@ -327,9 +327,9 @@ Grouping is done with parentheses. No surprises here. Example: >
:echo (10 + 5) * 2
< 30 ~
-Strings can be concatenated with ".". Example: >
+Strings can be concatenated with ".." (see |expr6|). Example: >
- :echo "foo" . "bar"
+ :echo "foo" .. "bar"
< foobar ~
When the ":echo" command gets multiple arguments, it separates them with a
@@ -496,9 +496,9 @@ So far the commands in the script were executed by Vim directly. The
very powerful way to build commands and execute them.
An example is to jump to a tag, which is contained in a variable: >
- :execute "tag " . tag_name
+ :execute "tag " .. tag_name
-The "." is used to concatenate the string "tag " with the value of variable
+The ".." is used to concatenate the string "tag " with the value of variable
"tag_name". Suppose "tag_name" has the value "get_cmd", then the command that
will be executed is: >
@@ -514,7 +514,7 @@ This jumps to the first line and formats all lines with the "=" operator.
To make ":normal" work with an expression, combine ":execute" with it.
Example: >
- :execute "normal " . normal_commands
+ :execute "normal " .. normal_commands
The variable "normal_commands" must contain the Normal mode commands.
Make sure that the argument for ":normal" is a complete command. Otherwise
@@ -531,12 +531,12 @@ If you don't want to execute a string but evaluate it to get its expression
value, you can use the eval() function: >
:let optname = "path"
- :let optval = eval('&' . optname)
+ :let optval = eval('&' .. optname)
A "&" character is prepended to "path", thus the argument to eval() is
"&path". The result will then be the value of the 'path' option.
The same thing can be done with: >
- :exe 'let optval = &' . optname
+ :exe 'let optval = &' .. optname
==============================================================================
*41.6* Using functions
@@ -1136,7 +1136,7 @@ Example: >
: let n = n + len(split(getline(lnum)))
: let lnum = lnum + 1
: endwhile
- : echo "found " . n . " words"
+ : echo "found " .. n .. " words"
:endfunction
You can call this function with: >
@@ -1149,7 +1149,7 @@ It will be executed once and echo the number of words.
range, with the cursor in that line. Example: >
:function Number()
- : echo "line " . line(".") . " contains: " . getline(".")
+ : echo "line " .. line(".") .. " contains: " .. getline(".")
:endfunction
If you call this function with: >
@@ -1173,11 +1173,11 @@ so on. The variable "a:0" contains the number of extra arguments.
:function Show(start, ...)
: echohl Title
- : echo "start is " . a:start
+ : echo "start is " .. a:start
: echohl None
: let index = 1
: while index <= a:0
- : echo " Arg " . index . " is " . a:{index}
+ : echo " Arg " .. index .. " is " .. a:{index}
: let index = index + 1
: endwhile
: echo ""
@@ -1585,10 +1585,10 @@ Another useful mechanism is the ":finally" command: >
:let tmp = tempname()
:try
- : exe ".,$write " . tmp
- : exe "!filter " . tmp
+ : exe ".,$write " .. tmp
+ : exe "!filter " .. tmp
: .,$delete
- : exe "$read " . tmp
+ : exe "$read " .. tmp
:finally
: call delete(tmp)
:endtry
@@ -1939,8 +1939,8 @@ prepending it with "s:".
We will define a function that adds a new typing correction: >
30 function s:Add(from, correct)
- 31 let to = input("type the correction for " . a:from . ": ")
- 32 exe ":iabbrev " . a:from . " " . to
+ 31 let to = input("type the correction for " .. a:from .. ": ")
+ 32 exe ":iabbrev " .. a:from .. " " .. to
..
36 endfunction
@@ -2045,7 +2045,7 @@ a few lines to count the number of corrections: >
30 function s:Add(from, correct)
..
34 let s:count = s:count + 1
- 35 echo s:count . " corrections now"
+ 35 echo s:count .. " corrections now"
36 endfunction
First s:count is initialized to 4 in the script itself. When later the
@@ -2088,11 +2088,11 @@ Here is the resulting complete example: >
28 noremap <SID>Add :call <SID>Add(expand("<cword>"), 1)<CR>
29
30 function s:Add(from, correct)
- 31 let to = input("type the correction for " . a:from . ": ")
- 32 exe ":iabbrev " . a:from . " " . to
+ 31 let to = input("type the correction for " .. a:from .. ": ")
+ 32 exe ":iabbrev " .. a:from .. " " .. to
33 if a:correct | exe "normal viws\<C-R>\" \b\e" | endif
34 let s:count = s:count + 1
- 35 echo s:count . " corrections now"
+ 35 echo s:count .. " corrections now"
36 endfunction
37
38 if !exists(":Correct")
@@ -2340,7 +2340,7 @@ should be undone. Set the b:undo_ftplugin variable to the commands that will
undo the settings in your filetype plugin. Example: >
let b:undo_ftplugin = "setlocal fo< com< tw< commentstring<"
- \ . "| unlet b:match_ignorecase b:match_words b:match_skip"
+ \ .. "| unlet b:match_ignorecase b:match_words b:match_skip"
Using ":setlocal" with "<" after the option name resets the option to its
global value. That is mostly the best way to reset the option value.
@@ -2461,17 +2461,17 @@ The following example shows how it's done: >
map <F19> :call BufNetWrite('something')<CR>
let s:did_load = 1
- exe 'au FuncUndefined BufNet* source ' . expand('<sfile>')
+ exe 'au FuncUndefined BufNet* source ' .. expand('<sfile>')
finish
endif
function BufNetRead(...)
- echo 'BufNetRead(' . string(a:000) . ')'
+ echo 'BufNetRead(' .. string(a:000) .. ')'
" read functionality here
endfunction
function BufNetWrite(...)
- echo 'BufNetWrite(' . string(a:000) . ')'
+ echo 'BufNetWrite(' .. string(a:000) .. ')'
" write functionality here
endfunction
diff --git a/runtime/ftplugin/spec.vim b/runtime/ftplugin/spec.vim
index 2a961f8244..2b33bc81aa 100644
--- a/runtime/ftplugin/spec.vim
+++ b/runtime/ftplugin/spec.vim
@@ -183,12 +183,10 @@ if !exists("*s:ParseRpmVars")
endif
let varname = strpart(a:str, start+2, end-(start+2))
execute a:strline
- let definestr = "^[ \t]*%(?:global|define)[ \t]\\+" . varname . "[ \t]\\+\\(.*\\)$"
+ let definestr = "^[ \t]*%\\(define\\|global\\)[ \t]\\+".varname."[ \t]\\+\\(.*\\)$"
let linenum = search(definestr, "bW")
- if (linenum != -1)
- let ret = ret . substitute(getline(linenum), definestr, "\\1", "")
- else
- let ret = ret . strpart(str, start, end+1-start)
+ if (linenum != 0)
+ let ret = ret . substitute(getline(linenum), definestr, "\\2", "")
endif
endwhile
return ret
diff --git a/runtime/indent/json.vim b/runtime/indent/json.vim
index b66a03d81b..c649e37013 100644
--- a/runtime/indent/json.vim
+++ b/runtime/indent/json.vim
@@ -1,7 +1,7 @@
" Vim indent file
" Language: JSON
" Mantainer: Eli Parra <eli@elzr.com> https://github.com/elzr/vim-json
-" Last Change: 2017 Jun 13
+" Last Change: 2020 Aug 30
" https://github.com/jakar/vim-json/commit/20b650e22aa750c4ab6a66aa646bdd95d7cd548a#diff-e81fc111b2052e306d126bd9989f7b7c
" Original Author: Rogerz Zhang <rogerz.zhang at gmail.com> http://github.com/rogerz/vim-json
" Acknowledgement: Based off of vim-javascript maintained by Darrick Wiebe
@@ -19,7 +19,7 @@ let b:did_indent = 1
setlocal nosmartindent
" Now, set up our indentation expression and keys that trigger it.
-setlocal indentexpr=GetJSONIndent()
+setlocal indentexpr=GetJSONIndent(v:lnum)
setlocal indentkeys=0{,0},0),0[,0],!^F,o,O,e
" Only define the function once.
@@ -86,26 +86,28 @@ endfunction
" 3. GetJSONIndent Function {{{1
" =========================
-function GetJSONIndent()
+function GetJSONIndent(...)
" 3.1. Setup {{{2
" ----------
+ " For the current line, use the first argument if given, else v:lnum
+ let clnum = a:0 ? a:1 : v:lnum
- " Set up variables for restoring position in file. Could use v:lnum here.
+ " Set up variables for restoring position in file. Could use clnum here.
let vcol = col('.')
" 3.2. Work on the current line {{{2
" -----------------------------
" Get the current line.
- let line = getline(v:lnum)
+ let line = getline(clnum)
let ind = -1
" If we got a closing bracket on an empty line, find its match and indent
" according to it.
let col = matchend(line, '^\s*[]}]')
- if col > 0 && !s:IsInString(v:lnum, col)
- call cursor(v:lnum, col)
+ if col > 0 && !s:IsInString(clnum, col)
+ call cursor(clnum, col)
let bs = strpart('{}[]', stridx('}]', line[col - 1]) * 2, 2)
let pairstart = escape(bs[0], '[')
@@ -122,14 +124,14 @@ function GetJSONIndent()
endif
" If we are in a multi-line string, don't do anything to it.
- if s:IsInString(v:lnum, matchend(line, '^\s*') + 1)
+ if s:IsInString(clnum, matchend(line, '^\s*') + 1)
return indent('.')
endif
" 3.3. Work on the previous line. {{{2
" -------------------------------
- let lnum = prevnonblank(v:lnum - 1)
+ let lnum = prevnonblank(clnum - 1)
if lnum == 0
return 0
@@ -151,7 +153,7 @@ function GetJSONIndent()
if counts[0] == '1' || counts[1] == '1' || counts[2] == '1'
return ind + shiftwidth()
else
- call cursor(v:lnum, vcol)
+ call cursor(clnum, vcol)
end
endif
diff --git a/runtime/keymap/french-azerty.vim b/runtime/keymap/french-azerty.vim
new file mode 100644
index 0000000000..b0fd758e97
--- /dev/null
+++ b/runtime/keymap/french-azerty.vim
@@ -0,0 +1,81 @@
+" Vim Keymap file for French standard keyboard layout (without AltGr keys as
+" they don't work reliably in all version of vim)
+
+" Maintainer: Yerlan Sergaziyev <yerlaser@outlook.com>
+" Last Changed: 2020-07-18
+
+scriptencoding utf-8
+
+let b:keymap_name = "fr"
+
+loadkeymap
+1 & ASCII AMPERSAND
+2 é LATIN SMALL LETTER E WITH ACUTE
+3 " ASCII DOUBLE QUOTES
+4 ' ASCII SINGLE QUOTE
+5 ( ASCII LEFT PARENTHESIS
+6 - ASCII MINUS
+7 è LATIN SMALL LETTER E WITH GRAVE
+8 _ ASCII UNDERSCORE
+9 ç LATIN SMALL LETTER C WITH CEDILLA
+0 à LATIN SMALL LETTER A WITH GRAVE
+- ) ASCII RIGHT PARENTHESIS
+! 1 ASCII DIGIT 1
+@ 2 ASCII DIGIT 2
+# 3 ASCII DIGIT 3
+$ 4 ASCII DIGIT 4
+% 5 ASCII DIGIT 5
+^ 6 ASCII DIGIT 6
+& 7 ASCII DIGIT 7
+* 8 ASCII DIGIT 8
+( 9 ASCII DIGIT 9
+) 0 ASCII DIGIT 0
+_ ° DEGREE SIGN
+q a LATIN SMALL LETTER A
+a q LATIN SMALL LETTER Q
+z w LATIN SMALL LETTER W
+w z LATIN SMALL LETTER Z
+Q A LATIN CAPITAL LETTER A
+A Q LATIN CAPITAL LETTER Q
+Z W LATIN CAPITAL LETTER W
+W Z LATIN CAPITAL LETTER Z
+[[ ^ ASCII CIRCUMFLEX
+[q â LATIN SMALL LETTER A WITH CIRCUMFLEX
+[e ê LATIN SMALL LETTER E WITH CIRCUMFLEX
+[u û LATIN SMALL LETTER U WITH CIRCUMFLEX
+[i î LATIN SMALL LETTER I WITH CIRCUMFLEX
+[o ô LATIN SMALL LETTER O WITH CIRCUMFLEX
+[Q Â LATIN CAPITAL LETTER A WITH CIRCUMFLEX
+[E Ê LATIN CAPITAL LETTER E WITH CIRCUMFLEX
+[U Û LATIN CAPITAL LETTER U WITH CIRCUMFLEX
+[I Î LATIN CAPITAL LETTER I WITH CIRCUMFLEX
+[O Ô LATIN CAPITAL LETTER O WITH CIRCUMFLEX
+{{ ¨ UMLAUT
+{q ä LATIN SMALL LETTER A WITH UMLAUT
+{e ë LATIN SMALL LETTER E WITH UMLAUT
+{y ÿ LATIN SMALL LETTER Y WITH UMLAUT
+{u ü LATIN SMALL LETTER U WITH UMLAUT
+{i ï LATIN SMALL LETTER I WITH UMLAUT
+{o ö LATIN SMALL LETTER O WITH UMLAUT
+{Q Ä LATIN CAPITAL LETTER A WITH UMLAUT
+{E Ë LATIN CAPITAL LETTER E WITH UMLAUT
+{Y Ÿ LATIN CAPITAL LETTER Y WITH UMLAUT
+{U Ü LATIN CAPITAL LETTER U WITH UMLAUT
+{I Ï LATIN CAPITAL LETTER I WITH UMLAUT
+{O Ö LATIN CAPITAL LETTER O WITH UMLAUT
+] $ ASCII GRAVE
+} £ POUND SIGN
+; m LATIN SMALL LETTER M
+: M LATIN CAPITAL LETTER M
+' ù LATIN SMALL LETTER U WITH GRAVE
+\" % ASCII PERCENT
+\\ * ASCII ASTERISK
+| µ GREEK LETTER MU
+m , ASCII COMMA
+M ? ASCII QUESTION MARK
+, ; ASCII SEMICOLON
+< . ASCII DOT
+. : ASCII COLON
+> / ASCII SLASH
+/ ! ASCII EXCLAMATION MARK
+? § SECTION SIGN
diff --git a/runtime/keymap/german-qwertz.vim b/runtime/keymap/german-qwertz.vim
new file mode 100644
index 0000000000..c2ccb1bfe2
--- /dev/null
+++ b/runtime/keymap/german-qwertz.vim
@@ -0,0 +1,76 @@
+" Vim Keymap file for German standard keyboard layout (without AltGr keys as
+" they don't work reliably in all version of vim)
+
+" Maintainer: Yerlan Sergaziyev <yerlaser@outlook.com>
+" Last Changed: 2020-07-18
+
+scriptencoding utf-8
+
+let b:keymap_name = "de"
+
+loadkeymap
+`` ^ ASCII CIRCUMFLEX
+`e ê LATIN SMALL LETTER E WITH CIRCUMFLEX
+`u û LATIN SMALL LETTER U WITH CIRCUMFLEX
+`i î LATIN SMALL LETTER I WITH CIRCUMFLEX
+`o ô LATIN SMALL LETTER O WITH CIRCUMFLEX
+`a â LATIN SMALL LETTER A WITH CIRCUMFLEX
+`E Ê LATIN CAPITAL LETTER E WITH CIRCUMFLEX
+`U Û LATIN CAPITAL LETTER U WITH CIRCUMFLEX
+`I Î LATIN CAPITAL LETTER I WITH CIRCUMFLEX
+`O Ô LATIN CAPITAL LETTER O WITH CIRCUMFLEX
+`A Â LATIN CAPITAL LETTER A WITH CIRCUMFLEX
+- ß LATIN SMALL LETTER SZ
+== ´ ASCII ACUTE ACCENT
+=e é LATIN SMALL LETTER E WITH ACUTE
+=u ú LATIN SMALL LETTER U WITH ACUTE
+=i í LATIN SMALL LETTER I WITH ACUTE
+=o ó LATIN SMALL LETTER O WITH ACUTE
+=a á LATIN SMALL LETTER A WITH ACUTE
+=z ý LATIN SMALL LETTER Y WITH ACUTE
+=E É LATIN CAPITAL LETTER E WITH ACUTE
+=U Ú LATIN CAPITAL LETTER U WITH ACUTE
+=I Í LATIN CAPITAL LETTER I WITH ACUTE
+=O Ó LATIN CAPITAL LETTER O WITH ACUTE
+=A Á LATIN CAPITAL LETTER A WITH ACUTE
+=Z Ý LATIN CAPITAL LETTER Y WITH ACUTE
+=S ẞ LATIN CAPITAL LETTER SZ
+++ ` ASCII GRAVE
++e è LATIN SMALL LETTER E WITH GRAVE
++u ù LATIN SMALL LETTER U WITH GRAVE
++i ì LATIN SMALL LETTER I WITH GRAVE
++o ò LATIN SMALL LETTER O WITH GRAVE
++a à LATIN SMALL LETTER A WITH GRAVE
++E È LATIN CAPITAL LETTER E WITH GRAVE
++U Ù LATIN CAPITAL LETTER U WITH GRAVE
++I Ì LATIN CAPITAL LETTER I WITH GRAVE
++O Ò LATIN CAPITAL LETTER O WITH GRAVE
++A À LATIN CAPITAL LETTER A WITH GRAVE
+y z LATIN SMALL LETTER Z
+[ ü LATIN SMALL LETTER U WITH UMLAUT
+] + ASCII PLUS
+\\ # ASCII NUMBER SIGN
+; ö LATIN SMALL LETTER O WITH UMLAUT
+' ä LATIN SMALL LETTER A WITH UMLAUT
+z y LATIN SMALL LETTER Y
+/ - ASCII MINUS
+~ ° DEGREE SIGN
+@ " ASCII DOUBLE QUOTES
+# § SECTION SIGN
+^ & ASCII AMPERSAND
+& / ASCII SLASH
+* ( ASCII LEFT PARENTHESIS
+( ) ASCII RIGHT PARENTHESIS
+) = ASCII EQUAL SIGN
+_ ? ASCII QUESTION MARK
++ ` ASCII GRAVE
+Y Z LATIN CAPITAL LETTER Z
+{ Ü LATIN CAPITAL LETTER U WITH UMLAUT
+} * ASCII ASTERISK
+| ' ASCII SINGLE QUOTE
+: Ö LATIN CAPITAL LETTER O WITH UMLAUT
+\" Ä LATIN CAPITAL LETTER A WITH UMLAUT
+Z Y LATIN CAPITAL LETTER Y
+< ; ASCII SEMICOLON
+> : ASCII COLON
+? _ ASCII UNDERSCORE
diff --git a/runtime/keymap/turkish-f.vim b/runtime/keymap/turkish-f.vim
index 95472cf0b2..f03c5eb3e2 100644
--- a/runtime/keymap/turkish-f.vim
+++ b/runtime/keymap/turkish-f.vim
@@ -110,3 +110,4 @@ n z LATIN SMALL LETTER Z
˙ ₺ TURKISH LIRA SIGN
¬ £ POUND SIGN
… ¥ YEN SIGN
+« ` GRAVE ACCENT