diff --git a/.gitignore b/.gitignore index a7cf0647ad..0249838d76 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,3 @@ -# This is .gitignore - # Unixen: object and executable files. *.o src/vim diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000000..b03f03e68e --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,54 @@ +# Contributing to Vim + +Patches are welcome in whatever form. +Discussions about patches happen on the vim-dev maillist. +If you create a pull request on GitHub it will be +forwarded to the vim-dev maillist. You can also send your patch there +directly. An attachment with a unified diff format is preferred. +Information about the maillist can be found [on the Vim website]. + +[on the Vim website]: http://www.vim.org/maillist.php#vim-dev + +Please consider adding a test. Test coverage isn't very good yet, this needs +to improve. Look through recent patches for examples. The tests are located +under "src/testdir". + + +# Reporting issues + +We use GitHub issues, but that is not a requirement. Writing to the Vim +maillist is also fine. + +Please use the GitHub issues only for actual issues. If you are not 100% sure +that your problem is a Vim issue, please first discuss this on the Vim user +maillist. Try reproducing the problem without any plugins or settings: + + vim -N -u NONE + +If you report an issue, please describe exactly how to reproduce it. +For example, don't say "insert some text" but say what you did exactly: +"ahere is some text<Esc>". +Ideally, the steps you list can be used to write a test to verify the problem +is fixed. + +Feel free to report even the smallest problem, also typos in the documentation. + +You can find known issues in the todo file: ":help todo". +Or open [the todo file] on GitHub to see the latest version. + +[the todo file]: https://github.com/vim/vim/blob/master/runtime/doc/todo.txt + + +# Syntax, indent and other runtime files + +The latest version of these files can be obtained from the repository. +They are usually not updated with numbered patches. + +If you find a problem with one of these files or have a suggestion for +improvement, please first try to contact the maintainer directly. +Look in the header of the file for the name and email address. + +The maintainer will take care of issues and send updates to Bram for +distribution with Vim. + +If the maintainer does not react, contact the vim-dev maillist. diff --git a/Filelist b/Filelist index 522375472a..166e2f4fa6 100644 --- a/Filelist +++ b/Filelist @@ -481,6 +481,8 @@ SRC_EXTRA = \ # runtime files for all distributions RT_ALL = \ README.txt \ + README.md \ + CONTRIBUTING.md \ runtime/bugreport.vim \ runtime/doc/*.awk \ runtime/doc/*.pl \ diff --git a/README.md b/README.md new file mode 100644 index 0000000000..384c4ec8d7 --- /dev/null +++ b/README.md @@ -0,0 +1,112 @@ +`README.md` for version 7.4 of Vim: Vi IMproved. + + +## What is VIM ## + +Vim is an almost compatible version of the UNIX editor Vi. Many new features +have been added: multi-level undo, syntax highlighting, command line history, +on-line help, spell checking, filename completion, block operations, etc. +There is also a Graphical User Interface (GUI) available. See +`runtime/doc/vi_diff.txt` for differences with Vi. + +This editor is very useful for editing programs and other plain text files. +All commands are given with normal keyboard characters, so those who can type +with ten fingers can work very fast. Additionally, function keys can be +defined by the user, and the mouse can be used. + +Vim runs under Amiga DOS, MS-DOS, MS-Windows (95, 98, Me, NT, 2000, XP, Vista, +7), Atari MiNT, Macintosh, BeOS, VMS, RISC OS, OS/2 and almost all flavours of +UNIX. Porting to other systems should not be very difficult. + + +## Distribution ## + +There are separate distributions for Unix, PC, Amiga and some other systems. +This `README.md` file comes with the runtime archive. It includes the +documentation, syntax files and other files that are used at runtime. To run +Vim you must get either one of the binary archives or a source archive. +Which one you need depends on the system you want to run it on and whether you +want or must compile it yourself. Check http://www.vim.org/download.php for +an overview of currently available distributions. + + +## Documentation ## + +The vim tutor is a one hour training course for beginners. Mostly it can be +started as `vimtutor`. See `:help tutor` for more information. + +The best is to use `:help` in Vim. If you don't have an executable yet, read +`runtime/doc/help.txt`. It contains pointers to the other documentation +files. The User Manual reads like a book and is recommended to learn to use +Vim. See `:help user-manual`. + + +## Copying ## + +Vim is Charityware. You can use and copy it as much as you like, but you are +encouraged to make a donation to help orphans in Uganda. Please read the file +`runtime/doc/uganda.txt` for details (do `:help uganda` inside Vim). + +Summary of the license: There are no restrictions on using or distributing an +unmodified copy of Vim. Parts of Vim may also be distributed, but the license +text must always be included. For modified versions a few restrictions apply. +The license is GPL compatible, you may compile Vim with GPL libraries and +distribute it. + + +## Sponsoring ## + +Fixing bugs and adding new features takes a lot of time and effort. To show +your appreciation for the work and motivate Bram and others to continue +working on Vim please send a donation. + +Since Bram is back to a paid job the money will now be used to help children +in Uganda. See `runtime/doc/uganda.txt`. But at the same time donations +increase Bram's motivation to keep working on Vim! + +For the most recent information about sponsoring look on the Vim web site: + http://www.vim.org/sponsor/ + + +## Compiling ## + +If you obtained a binary distribution you don't need to compile Vim. If you +obtained a source distribution, all the stuff for compiling Vim is in the +`src` directory. See `src/INSTALL` for instructions. + + +## Installation ## + +See one of these files for system-specific instructions: + + README_ami.txt Amiga + README_unix.txt Unix + README_dos.txt MS-DOS and MS-Windows + README_os2.txt OS/2 + README_mac.txt Macintosh + README_vms.txt VMS + +There are more `README_*.txt` files, depending on the distribution you used. + + +## Information ## + +The latest news about Vim can be found on the Vim home page: + http://www.vim.org/ + +If you have problems, have a look at the Vim documentation or tips: + http://www.vim.org/docs.php + http://vim.wikia.com/wiki/Vim_Tips_Wiki + +If you still have problems or any other questions, use one of the mailing +lists to discuss them with Vim users and developers: + http://www.vim.org/maillist.php + +If nothing else works, report bugs directly: + Bram Moolenaar + + +## Main author ## + +Send any other comments, patches, flowers and suggestions to: + Bram Moolenaar diff --git a/README.txt b/README.txt index 647e7c672a..e706d750b5 100644 --- a/README.txt +++ b/README.txt @@ -94,8 +94,9 @@ INFORMATION The latest news about Vim can be found on the Vim home page: http://www.vim.org/ -If you have problems, have a look at the Vim FAQ: - http://vimdoc.sf.net/vimfaq.html +If you have problems, have a look at the Vim documentation or tips: + http://www.vim.org/docs.php + http://vim.wikia.com/wiki/Vim_Tips_Wiki If you still have problems or any other questions, use one of the mailing lists to discuss them with Vim users and developers: diff --git a/runtime/autoload/phpcomplete.vim b/runtime/autoload/phpcomplete.vim index 6dcddfd43e..7f25d9df33 100644 --- a/runtime/autoload/phpcomplete.vim +++ b/runtime/autoload/phpcomplete.vim @@ -3,7 +3,7 @@ " Maintainer: Dávid Szabó ( complex857 AT gmail DOT com ) " Previous Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl ) " URL: https://github.com/shawncplus/phpcomplete.vim -" Last Change: 2015 Apr 02 +" Last Change: 2015 Jul 13 " " OPTIONS: " @@ -318,7 +318,7 @@ function! phpcomplete#CompleteGeneral(base, current_namespace, imports) " {{{ \ '^&\?\zs[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\ze') if f_name =~? '^'.substitute(a:base, '\\', '\\\\', 'g') let f_args = matchstr(i, - \ '^&\?[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*(\zs.\{-}\ze)\_s*\({\|$\)') + \ '^&\?[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*(\zs.\{-}\ze)\_s*\(;\|{\|$\)') let int_functions[f_name.'('] = f_args.')' endif endfor @@ -646,7 +646,7 @@ function! phpcomplete#CompleteUnknownClass(base, context) " {{{ let f_name = matchstr(i, \ '^&\?\zs[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\ze') let f_args = matchstr(i, - \ '^&\?[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*(\zs.\{-}\ze)\_s*\({\|$\)') + \ '^&\?[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*(\zs.\{-}\ze)\_s*\(;\|{\|$\)') let int_functions[f_name.'('] = f_args.')' endfor @@ -981,7 +981,7 @@ function! phpcomplete#CompleteUserClass(context, base, sccontent, visibility) " let f_name = matchstr(i, \ 'function\s*&\?\zs[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\ze') let f_args = matchstr(i, - \ 'function\s*&\?[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*(\zs.\{-}\ze)\_s*\({\|\_$\)') + \ 'function\s*&\?[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*(\zs.\{-}\ze)\_s*\(;\|{\|\_$\)') if f_name != '' && stridx(f_name, '__') != 0 let c_functions[f_name.'('] = f_args if g:phpcomplete_parse_docblock_comments @@ -1379,8 +1379,8 @@ function! phpcomplete#GetCallChainReturnType(classname_candidate, class_candidat " Get Structured information of all classes and subclasses including namespace and includes " try to find the method's return type in docblock comment for classstructure in classcontents - let doclock_target_pattern = 'function\s\+&\?'.method.'\|\(public\|private\|protected\|var\).\+\$'.method - let doc_str = phpcomplete#GetDocBlock(split(classstructure.content, '\n'), doclock_target_pattern) + let docblock_target_pattern = 'function\s\+&\?'.method.'\|\(public\|private\|protected\|var\).\+\$'.method + let doc_str = phpcomplete#GetDocBlock(split(classstructure.content, '\n'), docblock_target_pattern) if doc_str != '' break endif @@ -1659,7 +1659,7 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor " function declaration line if line =~? 'function\(\s\+'.function_name_pattern.'\)\?\s*(' - let function_lines = join(reverse(lines), " ") + let function_lines = join(reverse(copy(lines)), " ") " search for type hinted arguments if function_lines =~? 'function\(\s\+'.function_name_pattern.'\)\?\s*(.\{-}'.class_name_pattern.'\s\+'.object && !object_is_array let f_args = matchstr(function_lines, '\cfunction\(\s\+'.function_name_pattern.'\)\?\s*(\zs.\{-}\ze)') @@ -1700,10 +1700,12 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor " try to find the next non-comment or string ";" char let start_col = match(line, '^\s*'.object.'\C\s*=\zs&\?\s\+\(clone\)\?\s*'.variable_name_pattern) - let filelines = reverse(lines) - let [pos, char] = s:getNextCharWithPos(filelines, [a:start_line - i - 1, start_col]) + let filelines = reverse(copy(lines)) + let [pos, char] = s:getNextCharWithPos(filelines, [len(filelines) - i, start_col]) let chars_read = 1 let last_pos = pos + " function_boundary == 0 if we are not in a function + let real_lines_offset = len(function_boundary) == 1 ? 1 : function_boundary[0][0] " read while end of the file while char != 'EOF' && chars_read < 1000 let last_pos = pos @@ -1711,7 +1713,11 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor let chars_read += 1 " we got a candidate if char == ';' - let synIDName = synIDattr(synID(pos[0] + 1, pos[1] + 1, 0), 'name') + " pos values is relative to the function's lines, + " line 0 need to be offsetted with the line number + " where te function was started to get the line number + " in real buffer terms + let synIDName = synIDattr(synID(real_lines_offset + pos[0], pos[1] + 1, 0), 'name') " it's not a comment or string, end search if synIDName !~? 'comment\|string' break @@ -1719,7 +1725,7 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor endif endwhile - let prev_context = phpcomplete#GetCurrentInstruction(last_pos[0] + 1, last_pos[1], b:phpbegin) + let prev_context = phpcomplete#GetCurrentInstruction(real_lines_offset + last_pos[0], last_pos[1], b:phpbegin) if prev_context == '' " cannot get previous context give up return @@ -1739,13 +1745,14 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor " assignment for the variable in question with a function on the right hand side if line =~# '^\s*'.object.'\s*=&\?\s*'.function_invocation_pattern - " try to find the next non-comment or string ";" char let start_col = match(line, '\C^\s*'.object.'\s*=\zs&\?\s*'.function_invocation_pattern) - let filelines = reverse(lines) - let [pos, char] = s:getNextCharWithPos(filelines, [a:start_line - i - 1, start_col]) + let filelines = reverse(copy(lines)) + let [pos, char] = s:getNextCharWithPos(filelines, [len(filelines) - i, start_col]) let chars_read = 1 let last_pos = pos + " function_boundary == 0 if we are not in a function + let real_lines_offset = len(function_boundary) == 1 ? 1 : function_boundary[0][0] " read while end of the file while char != 'EOF' && chars_read < 1000 let last_pos = pos @@ -1753,7 +1760,11 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor let chars_read += 1 " we got a candidate if char == ';' - let synIDName = synIDattr(synID(pos[0] + 1, pos[1] + 1, 0), 'name') + " pos values is relative to the function's lines, + " line 0 need to be offsetted with the line number + " where te function was started to get the line number + " in real buffer terms + let synIDName = synIDattr(synID(real_lines_offset + pos[0], pos[1] + 1, 0), 'name') " it's not a comment or string, end search if synIDName !~? 'comment\|string' break @@ -1761,7 +1772,7 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor endif endwhile - let prev_context = phpcomplete#GetCurrentInstruction(last_pos[0] + 1, last_pos[1], b:phpbegin) + let prev_context = phpcomplete#GetCurrentInstruction(real_lines_offset + last_pos[0], last_pos[1], b:phpbegin) if prev_context == '' " cannot get previous context give up return @@ -1864,6 +1875,9 @@ function! phpcomplete#GetClassLocation(classname, namespace) " {{{ if has_key(g:php_builtin_classes, tolower(a:classname)) && (a:namespace == '' || a:namespace == '\') return 'VIMPHP_BUILTINOBJECT' endif + if has_key(g:php_builtin_interfaces, tolower(a:classname)) && (a:namespace == '' || a:namespace == '\') + return 'VIMPHP_BUILTINOBJECT' + endif if a:namespace == '' || a:namespace == '\' let search_namespace = '\' @@ -1876,7 +1890,7 @@ function! phpcomplete#GetClassLocation(classname, namespace) " {{{ let i = 1 while i < line('.') let line = getline(line('.')-i) - if line =~? '^\s*\(abstract\s\+\|final\s\+\)*\s*\(class\|interface\|trait\)\s*'.a:classname.'\(\s\+\|$\)' && tolower(current_namespace) == search_namespace + if line =~? '^\s*\(abstract\s\+\|final\s\+\)*\s*\(class\|interface\|trait\)\s*'.a:classname.'\(\s\+\|$\|{\)' && tolower(current_namespace) == search_namespace return expand('%:p') else let i += 1 @@ -2048,9 +2062,18 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam let content = join(getline(cfline, endline), "\n") " Catch extends if content =~? 'extends' - let extends_class = matchstr(content, 'class\_s\+'.a:class_name.'\_s\+extends\_s\+\zs'.class_name_pattern.'\ze') + let extends_string = matchstr(content, '\(class\|interface\)\_s\+'.a:class_name.'\_.\+extends\_s\+\zs\('.class_name_pattern.'\(,\|\_s\)*\)\+\ze\(extends\|{\)') + let extended_classes = map(split(extends_string, '\(,\|\_s\)\+'), 'substitute(v:val, "\\_s\\+", "", "g")') + else + let extended_classes = '' + endif + + " Catch implements + if content =~? 'implements' + let implements_string = matchstr(content, 'class\_s\+'.a:class_name.'\_.\+implements\_s\+\zs\('.class_name_pattern.'\(,\|\_s\)*\)\+\ze') + let implemented_interfaces = map(split(implements_string, '\(,\|\_s\)\+'), 'substitute(v:val, "\\_s\\+", "", "g")') else - let extends_class = '' + let implemented_interfaces = [] endif call searchpair('{', '', '}', 'W') let class_closing_bracket_line = line('.') @@ -2108,8 +2131,11 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam \ }) let all_extends = used_traits - if extends_class != '' - call add(all_extends, extends_class) + if len(extended_classes) > 0 + call extend(all_extends, extended_classes) + endif + if len(implemented_interfaces) > 0 + call extend(all_extends, implemented_interfaces) endif if len(all_extends) > 0 for class in all_extends @@ -2119,11 +2145,16 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam endif let classlocation = phpcomplete#GetClassLocation(class, namespace) if classlocation == "VIMPHP_BUILTINOBJECT" - let result += [phpcomplete#GenerateBuiltinClassStub(g:php_builtin_classes[tolower(class)])] + if has_key(g:php_builtin_classes, tolower(class)) + let result += [phpcomplete#GenerateBuiltinClassStub('class', g:php_builtin_classes[tolower(class)])] + endif + if has_key(g:php_builtin_interfaces, tolower(class)) + let result += [phpcomplete#GenerateBuiltinClassStub('interface', g:php_builtin_interfaces[tolower(class)])] + endif elseif classlocation != '' && filereadable(classlocation) let full_file_path = fnamemodify(classlocation, ':p') let result += phpcomplete#GetClassContentsStructure(full_file_path, readfile(full_file_path), class) - elseif tolower(current_namespace) == tolower(namespace) + elseif tolower(current_namespace) == tolower(namespace) && match(join(a:file_lines, "\n"), '\c\(class\|interface\|trait\)\_s\+'.class.'\(\>\|$\)') != -1 " try to find the declaration in the same file. let result += phpcomplete#GetClassContentsStructure(full_file_path, a:file_lines, class) endif @@ -2144,43 +2175,53 @@ function! phpcomplete#GetClassContents(classlocation, class_name) " {{{ endfunction " }}} -function! phpcomplete#GenerateBuiltinClassStub(class_info) " {{{ - let re = 'class '.a:class_info['name']." {" - for [name, initializer] in items(a:class_info.constants) - let re .= "\n\tconst ".name." = ".initializer.";" - endfor - for [name, info] in items(a:class_info.properties) - let re .= "\n\t// @var $".name." ".info.type - let re .= "\n\tpublic $".name.";" - endfor - for [name, info] in items(a:class_info.static_properties) - let re .= "\n\t// @var ".name." ".info.type - let re .= "\n\tpublic static ".name." = ".info.initializer.";" - endfor - for [name, info] in items(a:class_info.methods) - if name =~ '^__' - continue - endif - let re .= "\n\t/**" - let re .= "\n\t * ".name - let re .= "\n\t *" - let re .= "\n\t * @return ".info.return_type - let re .= "\n\t */" - let re .= "\n\tpublic function ".name."(".info.signature."){" - let re .= "\n\t}" - endfor - for [name, info] in items(a:class_info.static_methods) - let re .= "\n\t/**" - let re .= "\n\t * ".name - let re .= "\n\t *" - let re .= "\n\t * @return ".info.return_type - let re .= "\n\t */" - let re .= "\n\tpublic static function ".name."(".info.signature."){" - let re .= "\n\t}" - endfor +function! phpcomplete#GenerateBuiltinClassStub(type, class_info) " {{{ + let re = a:type.' '.a:class_info['name']." {" + if has_key(a:class_info, 'constants') + for [name, initializer] in items(a:class_info.constants) + let re .= "\n\tconst ".name." = ".initializer.";" + endfor + endif + if has_key(a:class_info, 'properties') + for [name, info] in items(a:class_info.properties) + let re .= "\n\t// @var $".name." ".info.type + let re .= "\n\tpublic $".name.";" + endfor + endif + if has_key(a:class_info, 'static_properties') + for [name, info] in items(a:class_info.static_properties) + let re .= "\n\t// @var ".name." ".info.type + let re .= "\n\tpublic static ".name." = ".info.initializer.";" + endfor + endif + if has_key(a:class_info, 'methods') + for [name, info] in items(a:class_info.methods) + if name =~ '^__' + continue + endif + let re .= "\n\t/**" + let re .= "\n\t * ".name + let re .= "\n\t *" + let re .= "\n\t * @return ".info.return_type + let re .= "\n\t */" + let re .= "\n\tpublic function ".name."(".info.signature."){" + let re .= "\n\t}" + endfor + endif + if has_key(a:class_info, 'static_methods') + for [name, info] in items(a:class_info.static_methods) + let re .= "\n\t/**" + let re .= "\n\t * ".name + let re .= "\n\t *" + let re .= "\n\t * @return ".info.return_type + let re .= "\n\t */" + let re .= "\n\tpublic static function ".name."(".info.signature."){" + let re .= "\n\t}" + endfor + endif let re .= "\n}" - return { 'class': a:class_info['name'], + return { a:type : a:class_info['name'], \ 'content': re, \ 'namespace': '', \ 'imports': {}, @@ -2204,8 +2245,11 @@ function! phpcomplete#GetDocBlock(sccontent, search) " {{{ " start backward serch for the comment block while l != 0 let line = a:sccontent[l] - " if comment end found save line position and end search - if line =~? '^\s*\*/' + " if it's a one line docblock like comment and we can just return it right away + if line =~? '^\s*\/\*\*.\+\*\/\s*$' + return substitute(line, '\v^\s*(\/\*\*\s*)|(\s*\*\/)\s*$', '', 'g') + "... or if comment end found save line position and end search + elseif line =~? '^\s*\*/' let comment_end = l break " ... or the line doesn't blank (only whitespace or nothing) end search @@ -2227,6 +2271,7 @@ function! phpcomplete#GetDocBlock(sccontent, search) " {{{ endif let l -= 1 endwhile + " no docblock comment start found if comment_start == -1 return '' @@ -2388,7 +2433,15 @@ function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{ break endif let block_end_pos = searchpairpos('{', '', '}\|\%$', 'W', 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment"') - silent! exec block_start_pos[0].','.block_end_pos[0].'d' + + if block_end_pos != [0, 0] + " end of the block found, just delete it + silent! exec block_start_pos[0].','.block_end_pos[0].'d _' + else + " block pair not found, use block start as beginning and the end + " of the buffer instead + silent! exec block_start_pos[0].',$d _' + endif endwhile normal! G @@ -2407,8 +2460,8 @@ function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{ while i < file_length let line = file_lines[i] - if line =~? '^\s*namespace\s*'.namespace_name_pattern - let current_namespace = matchstr(line, '\c^\s*namespace\s*\zs'.namespace_name_pattern.'\ze') + if line =~? '^\(| + indicates what option has been set. + + Is not triggered on startup and for the 'key' + option for obvious reasons. + + Usage example: Check for the existence of the + directory in the 'backupdir' and 'undodir' + options, create the directory if it doesn't + exist yet. + + Note: It's a bad idea to reset an option + during this autocommand, this may break a + plugin. You can always use `:noa` to prevent + triggering this autocommand. + *QuickFixCmdPre* QuickFixCmdPre Before a quickfix command is run (|:make|, |:lmake|, |:grep|, |:lgrep|, |:grepadd|, @@ -1046,7 +1072,7 @@ Instead of a pattern buffer-local autocommands use one of these forms: Examples: > :au CursorHold echo 'hold' :au CursorHold echo 'hold' - :au CursorHold echo 'hold' + :au BufNewFile * au CursorHold echo 'hold' All the commands for autocommands also work with buffer-local autocommands, simply use the special string instead of the pattern. Examples: > diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt index 36e0e44f59..63caeff914 100644 --- a/runtime/doc/change.txt +++ b/runtime/doc/change.txt @@ -1,4 +1,4 @@ -*change.txt* For Vim version 7.4. Last change: 2015 Feb 10 +*change.txt* For Vim version 7.4. Last change: 2015 Aug 04 VIM REFERENCE MANUAL by Bram Moolenaar @@ -379,10 +379,43 @@ Adding and subtracting ~ CTRL-A Add [count] to the number or alphabetic character at or after the cursor. {not in Vi} + *v_CTRL-A* +{Visual}CTRL-A Add [count] to the number or alphabetic character in + the highlighted text. {not in Vi} + + *v_g_CTRL-A* +{Visual}g CTRL-A Add [count] to the number or alphabetic character in + the highlighted text. If several lines are + highlighted, each one will be incremented by an + additional [count] (so effectively creating a + [count] incrementing sequence). {not in Vi} + For Example, if you have this list of numbers: + 1. ~ + 1. ~ + 1. ~ + 1. ~ + Move to the second "1." and Visually select three + lines, pressing g CTRL-A results in: + 1. ~ + 2. ~ + 3. ~ + 4. ~ + *CTRL-X* CTRL-X Subtract [count] from the number or alphabetic character at or after the cursor. {not in Vi} + *v_CTRL-X* +{Visual}CTRL-X Subtract [count] from the number or alphabetic + character in the highlighted text. {not in Vi} + + *v_g_CTRL-X* +{Visual}g CTRL-X Subtract [count] from the number or alphabetic + character in the highlighted text. If several lines + are highlighted, each value will be decremented by an + additional [count] (so effectively creating a [count] + decrementing sequence). {not in Vi} + The CTRL-A and CTRL-X commands work for (signed) decimal numbers, unsigned octal and hexadecimal numbers and alphabetic characters. This depends on the 'nrformats' option. @@ -399,6 +432,10 @@ octal and hexadecimal numbers and alphabetic characters. This depends on the under or after the cursor. This is useful to make lists with an alphabetic index. +For decimals a leading negative sign is considered for incrementing/ +decrementing, for octal and hex values, it won't be considered. +To ignore the sign Visually select the number before using CTRL-A or CTRL-X. + For numbers with leading zeros (including all octal and hexadecimal numbers), Vim preserves the number of characters in the number when possible. CTRL-A on "0077" results in "0100", CTRL-X on "0x100" results in "0x0ff". @@ -597,9 +634,9 @@ For other systems the tmpnam() library function is used. may add [flags], see |:s_flags|. Note that after `:substitute` the '&' flag can't be used, it's recognized as a pattern separator. - The space between `:substitute` and the 'c', 'g' and - 'r' flags isn't required, but in scripts it's a good - idea to keep it to avoid confusion. + The space between `:substitute` and the 'c', 'g', + 'i', 'I' and 'r' flags isn't required, but in scripts + it's a good idea to keep it to avoid confusion. :[range]~[&][flags] [count] *:~* Repeat last substitute with same substitute string diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt index d3da61ceb7..94fe977cc7 100644 --- a/runtime/doc/cmdline.txt +++ b/runtime/doc/cmdline.txt @@ -1,4 +1,4 @@ -*cmdline.txt* For Vim version 7.4. Last change: 2014 Sep 06 +*cmdline.txt* For Vim version 7.4. Last change: 2015 Jul 28 VIM REFERENCE MANUAL by Bram Moolenaar @@ -597,6 +597,7 @@ starts editing the three files "foo bar", "goes to" and "school ". When you want to use the special characters '"' or '|' in a command, or want to use '%' or '#' in a file name, precede them with a backslash. The backslash is not required in a range and in the ":substitute" command. +See also |`=|. *:_!* The '!' (bang) character after an Ex command makes the command behave in a @@ -749,13 +750,13 @@ to insert special things while typing you can use the CTRL-R command. For example, "%" stands for the current file name, while CTRL-R % inserts the current file name right away. See |c_CTRL-R|. -Note: If you want to avoid the special characters in a Vim script you may want -to use |fnameescape()|. +Note: If you want to avoid the effects of special characters in a Vim script +you may want to use |fnameescape()|. Also see |`=|. In Ex commands, at places where a file name can be used, the following characters have a special meaning. These can also be used in the expression -function expand() |expand()|. +function |expand()|. % Is replaced with the current file name. *:_%* *c_%* # Is replaced with the alternate file name. *:_#* *c_#* This is remembered for every window. @@ -790,6 +791,7 @@ it, no matter how many backslashes. # alternate.file \# # \\# \# +Also see |`=|. *:* *:* *:* ** *:* ** *:* ** @@ -811,7 +813,7 @@ Note: these are typed literally, they are not special keys! only when the file name isn't used to match with (for FileType, Syntax and SpellFileMissing events). When executing a ":source" command, is replaced with the - file name of the sourced file. *E498* + file name of the sourced file. *E498* When executing a function, is replaced with "function {function-name}"; function call nesting is indicated like this: @@ -880,7 +882,7 @@ These modifiers can be given, in this order: :gs?pat?sub? Substitute all occurrences of "pat" with "sub". Otherwise this works like ":s". - :S Escape special characters for use with a shell command (see + :S Escape special characters for use with a shell command (see |shellescape()|). Must be the last one. Examples: > :!dir :S :call system('chmod +w -- ' . expand('%:S')) @@ -933,9 +935,8 @@ name). This is included for backwards compatibility with version 3.0, the Note: Where a file name is expected wildcards expansion is done. On Unix the shell is used for this, unless it can be done internally (for speed). -Backticks also work, like in > +Unless in |restricted-mode|, backticks work also, like in > :n `echo *.c` -(backtick expansion is not possible in |restricted-mode|) But expansion is only done if there are any wildcards before expanding the '%', '#', etc.. This avoids expanding wildcards inside a file name. If you want to expand the result of , add a wildcard character to it. @@ -946,6 +947,7 @@ Examples: (alternate file name is "?readme?") :e #.* :e {files matching "?readme?.*"} :cd :cd {file name under cursor} :cd * :cd {file name under cursor plus "*" and then expanded} +Also see |`=|. When the expanded argument contains a "!" and it is used for a shell command (":!cmd", ":r !cmd" or ":w !cmd"), the "!" is escaped with a backslash to @@ -972,6 +974,8 @@ for the file "$home" in the root directory. A few examples: /\$home file "$home" in root directory \\$home file "\\", followed by expanded $home +Also see |`=|. + ============================================================================== 7. Command-line window *cmdline-window* *cmdwin* *command-line-window* diff --git a/runtime/doc/diff.txt b/runtime/doc/diff.txt index 4923273589..beb0137dbc 100644 --- a/runtime/doc/diff.txt +++ b/runtime/doc/diff.txt @@ -1,4 +1,4 @@ -*diff.txt* For Vim version 7.4. Last change: 2015 Feb 03 +*diff.txt* For Vim version 7.4. Last change: 2015 Jul 03 VIM REFERENCE MANUAL by Bram Moolenaar @@ -132,8 +132,9 @@ file for a moment and come back to the same file and be in diff mode again. if the current window does not have 'diff' set then no options in it are changed. -The ":diffoff" command resets the relevant options to the values they had when -using |:diffsplit|, |:diffpatch| , |:diffthis|. or starting Vim in diff mode. +The `:diffoff` command resets the relevant options to the values they had when +using `:diffsplit`, `:diffpatch` , `:diffthis`. or starting Vim in diff mode. +When using `:diffoff` twice the last saved values are restored. Otherwise they are set to their default value: 'diff' off diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt index 816d45f434..49a96f6a66 100644 --- a/runtime/doc/editing.txt +++ b/runtime/doc/editing.txt @@ -1,4 +1,4 @@ -*editing.txt* For Vim version 7.4. Last change: 2015 Feb 27 +*editing.txt* For Vim version 7.4. Last change: 2015 Aug 25 VIM REFERENCE MANUAL by Bram Moolenaar @@ -412,25 +412,38 @@ Finds files: /usr/include/sys/types.h /usr/inc_old/types.h *backtick-expansion* *`-expansion* -On Unix and a few other systems you can also use backticks in the file name, -for example: > - :e `find . -name ver\\*.c -print` -The backslashes before the star are required to prevent "ver*.c" to be -expanded by the shell before executing the find program. +On Unix and a few other systems you can also use backticks for the file name +argument, for example: > + :next `find . -name ver\\*.c -print` + :view `ls -t *.patch \| head -n1` +The backslashes before the star are required to prevent the shell from +expanding "ver*.c" prior to execution of the find program. The backslash +before the shell pipe symbol "|" prevents Vim from parsing it as command +termination. This also works for most other systems, with the restriction that the backticks must be around the whole item. It is not possible to have text directly before the first or just after the last backtick. *`=* -You can have the backticks expanded as a Vim expression, instead of an -external command, by using the syntax `={expr}` e.g.: > +You can have the backticks expanded as a Vim expression, instead of as an +external command, by putting an equal sign right after the first backtick, +e.g.: > :e `=tempname()` The expression can contain just about anything, thus this can also be used to avoid the special meaning of '"', '|', '%' and '#'. However, 'wildignore' does apply like to other wildcards. + +Environment variables in the expression are expanded when evaluating the +expression, thus this works: > + :e `=$HOME . '/.vimrc'` +This does not work, $HOME is inside a string and used literally: > + :e `='$HOME' . '/.vimrc'` + If the expression returns a string then names are to be separated with line breaks. When the result is a |List| then each item is used as a name. Line breaks also separate names. +Note that such expressions are only supported in places where a filename is +expected as an argument to an Ex-command. *++opt* *[++opt]* The [++opt] argument can be used to force the value of 'fileformat', @@ -1363,7 +1376,7 @@ There are a few things to remember when editing binary files: - characters are shown on the screen as ^@. You can enter them with "CTRL-V CTRL-@" or "CTRL-V 000" {Vi cannot handle characters in the file} -- To insert a character in the file split up a line. When writing the +- To insert a character in the file split a line. When writing the buffer to a file a will be written for the . - Vim normally appends an at the end of the file if there is none. Setting the 'binary' option prevents this. If you want to add the final @@ -1393,7 +1406,8 @@ reveal it to others. The 'viminfo' file is not encrypted. You could do this to edit very secret text: > :set noundofile viminfo= :noswapfile edit secrets.txt -Keep in mind that without a swap file you risk losing your work in a crash. +Keep in mind that without a swap file you risk losing your work in the event +of a crash or a power failure. WARNING: If you make a typo when entering the key and then write the file and exit, the text will be lost! diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index fff08e0561..a105477ab8 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 7.4. Last change: 2015 Jun 19 +*eval.txt* For Vim version 7.4. Last change: 2015 Jul 21 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1005,7 +1005,7 @@ function. Example: > -string *string* *expr-string* *E114* +string *string* *String* *expr-string* *E114* ------ "string" string constant *expr-quote* @@ -1330,6 +1330,12 @@ v:cmdbang Set like v:cmdarg for a file read/write command. When a "!" can only be used in autocommands. For user commands || can be used. + *v:completed_item* *completed_item-variable* +v:completed_item + |Dictionary| containing the |complete-items| for the most + recently completed word after |CompleteDone|. The + |Dictionary| is empty if the completion failed. + *v:count* *count-variable* v:count The count given for the last Normal mode command. Can be used to get the count before a mapping. Read-only. Example: > @@ -1462,7 +1468,9 @@ v:hlsearch Variable that indicates whether search highlighting is on. requires |+extra_search|. Setting this variable to zero acts the like |:nohlsearch| command, setting it to one acts like > let &hlsearch = &hlsearch -< +< Note that the value is restored when returning from a + function. |function-search-undo|. + *v:insertmode* *insertmode-variable* v:insertmode Used for the |InsertEnter| and |InsertChange| autocommand events. Values: @@ -1527,6 +1535,15 @@ v:oldfiles List of file names that is loaded from the |viminfo| file on than String this will cause trouble. {only when compiled with the |+viminfo| feature} + *v:option_new* +v:option_new New value of the option. Valid while executing an |OptionSet| + autocommand. + *v:option_old* +v:option_old Old value of the option. Valid while executing an |OptionSet| + autocommand. + *v:option_type* +v:option_type Scope of the set command. Valid while executing an + |OptionSet| autocommand. Can be either "global" or "local" *v:operator* *operator-variable* v:operator The last operator given in Normal mode. This is a single character except for commands starting with or , @@ -1805,6 +1822,7 @@ getbufvar( {expr}, {varname} [, {def}]) any variable {varname} in buffer {expr} getchar( [expr]) Number get one character from the user getcharmod( ) Number modifiers for the last typed character +getcharsearch() Dict last character search getcmdline() String return the current command-line getcmdpos() Number return cursor position in command-line getcmdtype() String return current command-line type @@ -1954,6 +1972,7 @@ server2client( {clientid}, {string}) Number send reply string serverlist() String get a list of available servers setbufvar( {expr}, {varname}, {val}) set {varname} in buffer {expr} to {val} +setcharsearch( {dict}) Dict set character search from {dict} setcmdpos( {pos}) Number set cursor position in command-line setline( {lnum}, {line}) Number set line {lnum} to {line} setloclist( {nr}, {list}[, {action}]) @@ -3344,6 +3363,26 @@ getcharmod() *getcharmod()* character itself are obtained. Thus Shift-a results in "A" without a modifier. +getcharsearch() *getcharsearch()* + Return the current character search information as a {dict} + with the following entries: + + char character previously used for a character + search (|t|, |f|, |T|, or |F|); empty string + if no character search has been performed + forward direction of character search; 1 for forward, + 0 for backward + until type of character search; 1 for a |t| or |T| + character search, 0 for an |f| or |F| + character search + + This can be useful to always have |;| and |,| search + forward/backward regardless of the direction of the previous + character search: > + :nnoremap ; getcharsearch().forward ? ';' : ',' + :nnoremap , getcharsearch().forward ? ',' : ';' +< Also see |setcharsearch()|. + getcmdline() *getcmdline()* Return the current command-line. Only works when the command line is being edited, thus requires use of |c_CTRL-\_e| or @@ -4388,7 +4427,7 @@ match({expr}, {pat}[, {start}[, {count}]]) *match()* done like 'magic' is set and 'cpoptions' is empty. *matchadd()* *E798* *E799* *E801* -matchadd({group}, {pattern}[, {priority}[, {id}]]) +matchadd({group}, {pattern}[, {priority}[, {id} [, {dict}]]]) Defines a pattern to be highlighted in the current window (a "match"). It will be highlighted with {group}. Returns an identification number (ID), which can be used to delete the @@ -4396,6 +4435,8 @@ matchadd({group}, {pattern}[, {priority}[, {id}]]) Matching is case sensitive and magic, unless case sensitivity or magicness are explicitly overridden in {pattern}. The 'magic', 'smartcase' and 'ignorecase' options are not used. + The "Conceal" value is special, it causes the match to be + concealed. The optional {priority} argument assigns a priority to the match. A match with a high priority will have its @@ -4413,9 +4454,18 @@ matchadd({group}, {pattern}[, {priority}[, {id}]]) message will appear and the match will not be added. An ID is specified as a positive integer (zero excluded). IDs 1, 2 and 3 are reserved for |:match|, |:2match| and |:3match|, - respectively. If the {id} argument is not specified, + respectively. If the {id} argument is not specified or -1, |matchadd()| automatically chooses a free ID. + The optional {dict} argmument allows for further custom + values. Currently this is used to specify a match specifc + conceal character that will be shown for |hl-Conceal| + highlighted matches. The dict can have the following members: + + conceal Special character to show instead of the + match (only for |hl-Conceal| highlighed + matches, see |:syn-cchar|) + The number of matches is not limited, as it is the case with the |:match| commands. @@ -4429,7 +4479,7 @@ matchadd({group}, {pattern}[, {priority}[, {id}]]) available from |getmatches()|. All matches can be deleted in one operation by |clearmatches()|. -matchaddpos({group}, {pos}[, {priority}[, {id}]]) *matchaddpos()* +matchaddpos({group}, {pos}[, {priority}[, {id}[, {dict}]]]) *matchaddpos()* Same as |matchadd()|, but requires a list of positions {pos} instead of a pattern. This command is faster than |matchadd()| because it does not require to handle regular expressions and @@ -4889,7 +4939,7 @@ readfile({fname} [, {binary} [, {max}]]) separated with CR will result in a single long line (unless a NL appears somewhere). All NUL characters are replaced with a NL character. - When {binary/append} contains "b" binary mode is used: + When {binary} contains "b" binary mode is used: - When the last line ends in a NL an extra empty list item is added. - No CR characters are removed. @@ -5369,6 +5419,26 @@ setbufvar({expr}, {varname}, {val}) *setbufvar()* :call setbufvar("todo", "myvar", "foobar") < This function is not available in the |sandbox|. +setcharsearch() *setcharsearch()* + Set the current character search information to {dict}, + which contains one or more of the following entries: + + char character which will be used for a subsequent + |,| or |;| command; an empty string clears the + character search + forward direction of character search; 1 for forward, + 0 for backward + until type of character search; 1 for a |t| or |T| + character search, 0 for an |f| or |F| + character search + + This can be useful to save/restore a user's character search + from a script: > + :let prevsearch = getcharsearch() + :" Perform a command which clobbers user's search + :call setcharsearch(prevsearch) +< Also see |getcharsearch()|. + setcmdpos({pos}) *setcmdpos()* Set the cursor position in the command line to byte position {pos}. The first position is 1. @@ -5839,15 +5909,35 @@ str2nr( {expr} [, {base}]) *str2nr()* Text after the number is silently ignored. -strchars({expr}) *strchars()* +strchars({expr} [, {skipcc}]) *strchars()* The result is a Number, which is the number of characters - String {expr} occupies. Composing characters are counted - separately. + in String {expr}. + When {skipcc} is omitted or zero, composing characters are + counted separately. + When {skipcc} set to 1, Composing characters are ignored. Also see |strlen()|, |strdisplaywidth()| and |strwidth()|. + + {skipcc} is only available after 7.4.755. For backward + compatibility, you can define a wrapper function: > + if has("patch-7.4.755") + function s:strchars(str, skipcc) + return strchars(a:str, a:skipcc) + endfunction + else + function s:strchars(str, skipcc) + if a:skipcc + return strlen(substitute(a:str, ".", "x", "g")) + else + return strchars(a:str) + endif + endfunction + endif +< + strdisplaywidth({expr}[, {col}]) *strdisplaywidth()* The result is a Number, which is the number of display cells - String {expr} occupies on the screen when it starts a {col}. + String {expr} occupies on the screen when it starts at {col}. When {col} is omitted zero is used. Otherwise it is the screen column where to start. This matters for Tab characters. diff --git a/runtime/doc/help.txt b/runtime/doc/help.txt index 3d340a12bf..eae23bb7f3 100644 --- a/runtime/doc/help.txt +++ b/runtime/doc/help.txt @@ -1,4 +1,4 @@ -*help.txt* For Vim version 7.4. Last change: 2015 Apr 15 +*help.txt* For Vim version 7.4. Last change: 2015 Jun 21 VIM - main help file k @@ -198,6 +198,7 @@ Remarks about specific systems ~ Standard plugins ~ |pi_getscript.txt| Downloading latest version of Vim scripts |pi_gzip.txt| Reading and writing compressed files +|pi_logipat.txt| Logical operators on patterns |pi_netrw.txt| Reading and writing files over a network |pi_paren.txt| Highlight matching parens |pi_tar.txt| Tar file explorer diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt index 45dc58ef17..b0eae9fee1 100644 --- a/runtime/doc/insert.txt +++ b/runtime/doc/insert.txt @@ -1,4 +1,4 @@ -*insert.txt* For Vim version 7.4. Last change: 2015 May 22 +*insert.txt* For Vim version 7.4. Last change: 2015 Jun 20 VIM REFERENCE MANUAL by Bram Moolenaar @@ -82,8 +82,8 @@ CTRL-W Delete the word before the cursor (see |i_backspacing| about |word-motions|, for the definition of a word. *i_CTRL-U* CTRL-U Delete all entered characters before the cursor in the current - line. If there are no newly entereed characters and - 'backspace'is not empty, delete all characters before the + line. If there are no newly entered characters and + 'backspace' is not empty, delete all characters before the cursor in the current line. See |i_backspacing| about joining lines. *i_CTRL-I* *i_* *i_Tab* @@ -377,6 +377,9 @@ 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-L when 'insertmode' is set: go to Normal mode *i_CTRL-L* CTRL-G u break 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* + movement (but only if the cursor stays + within same the line) ----------------------------------------------------------------------- Note: If the cursor keys take you out of Insert mode, check the 'noesckeys' @@ -416,6 +419,28 @@ that, with CTRL-O u. Another example: > This breaks undo at each line break. It also expands abbreviations before this. +An example for using CTRL-G U: > + + inoremap U + inoremap U + inoremap col('.') == match(getline('.'), '\S') + 1 ? + \ repeat('U', col('.') - 1) : + \ (col('.') < match(getline('.'), '\S') ? + \ repeat('U', match(getline('.'), '\S') + 0) : + \ repeat('U', col('.') - 1 - match(getline('.'), '\S'))) + inoremap repeat('U', col('$') - col('.')) + inoremap ( ()U + +This makes it possible to use the cursor keys in Insert mode, without breaking +the undo sequence and therefore using |.| (redo) will work as expected. +Also entering a text like (with the "(" mapping from above): > + + Lorem ipsum (dolor + +will be repeatable by the |.|to the expected + + Lorem ipsum (dolor) + Using CTRL-O splits undo: the text typed before and after it is undone separately. If you want to avoid this (e.g., in a mapping) you might be able to use CTRL-R = |i_CTRL-R|. E.g., to call a function: > diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 0bb4ae61f5..1e601815f1 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1,4 +1,4 @@ -*options.txt* For Vim version 7.4. Last change: 2015 Jun 19 +*options.txt* For Vim version 7.4. Last change: 2015 Aug 25 VIM REFERENCE MANUAL by Bram Moolenaar @@ -50,9 +50,19 @@ achieve special effects. These options come in three forms: :se[t] {option}&vi Reset option to its Vi default value. {not in Vi} :se[t] {option}&vim Reset option to its Vim default value. {not in Vi} -:se[t] all& Set all options, except terminal options, to their - default value. The values of 'term', 'lines' and - 'columns' are not changed. {not in Vi} +:se[t] all& Set all options to their default value. The values of + these options are not changed: + all terminal options, starting with t_ + 'columns' + 'cryptmethod' + 'encoding' + 'key' + 'lines' + 'term' + 'ttymouse' + 'ttytype' + Warning: This may have a lot of side effects. + {not in Vi} *:set-args* *E487* *E521* :se[t] {option}={value} or @@ -1129,6 +1139,47 @@ A jump table for the options with a short description can be found at |Q_op|. expression evaluates to a |List| this is equal to using each List item as a string and putting "\n" in between them. + *'belloff'* *'bo'* +'belloff' 'bo' string (default "") + global + {not in Vi} + Specifies for which events the bell will not be rung. It is a comma + separated list of items. For each item that is present, the bell + will be silenced. This is most useful to specify specific events in + insert mode to be silenced. + + item meaning when present ~ + all All events. + backspace When hitting or and deleting results in an + error. + cursor Fail to move around using the cursor keys or + / in |Insert-mode|. + complete Error occurred when using |i_CTRL-X_CTRL-K| or + |i_CTRL-X_CTRL-T|. + copy Cannot copy char from insert mode using |i_CTRL-Y| or + |i_CTRL-E|. + ctrlg Unknown Char after in Insert mode. + error Other Error occurred (e.g. try to join last line) + (mostly used in |Normal-mode| or |Cmdline-mode|). + esc hitting in |Normal-mode|. + ex In |Visual-mode|, hitting |Q| results in an error. + hangul Error occurred when using hangul input. + insertmode Pressing in 'insertmode'. + lang Calling the beep module for Lua/Mzscheme/TCL. + mess No output available for |g<|. + showmatch Error occurred for 'showmatch' function. + operator Empty region error |cpo-E|. + register Unknown register after in |Insert-mode|. + shell Bell from shell output |:!|. + spell Error happened on spell suggest. + wildmode More matches in |cmdline-completion| available + (depends on the 'wildmode' setting). + + This is most useful, to fine tune when in insert mode the bell should + be rung. For normal mode and ex commands, the bell is often rung to + indicate that an error occurred. It can be silenced by adding the + "error" keyword. + *'binary'* *'bin'* *'nobinary'* *'nobin'* 'binary' 'bin' boolean (default off) local to buffer @@ -1832,6 +1883,14 @@ A jump table for the options with a short description can be found at |Q_op|. completion in the preview window. Only works in combination with "menu" or "menuone". + noinsert Do not insert any text for a match until the user selects + a match from the menu. Only works in combination with + "menu" or "menuone". No effect if "longest" is present. + + noselect Do not select a match in the menu, force the user to + select one from the menu. Only works in combination with + "menu" or "menuone". + *'concealcursor'* *'cocu'* 'concealcursor' 'cocu' string (default: "") @@ -2676,15 +2735,16 @@ A jump table for the options with a short description can be found at |Q_op|. local to buffer {not in Vi} When writing a file and this option is off and the 'binary' option - is on, no will be written for the last line in the file. This - option is automatically set when starting to edit a new file, unless - the file does not have an for the last line in the file, in - which case it is reset. Normally you don't have to set or reset this - option. When 'binary' is off the value is not used when writing the - file. When 'binary' is on it is used to remember the presence of a - for the last line in the file, so that when you write the file - the situation from the original file can be kept. But you can change - it if you want to. + is on, or 'fixeol' option is off, no will be written for the + last line in the file. This option is automatically set or reset when + starting to edit a new file, depending on whether file has an + for the last line in the file. Normally you don't have to set or + reset this option. + When 'binary' is off and 'fixeol' is on the value is not used when + writing the file. When 'binary' is on or 'fixeol' is off it is used + to remember the presence of a for the last line in the file, so + that when you write the file the situation from the original file can + be kept. But you can change it if you want to. *'equalalways'* *'ea'* *'noequalalways'* *'noea'* 'equalalways' 'ea' boolean (default on) @@ -2725,7 +2785,8 @@ A jump table for the options with a short description can be found at |Q_op|. makes a difference for error messages, the bell will be used always for a lot of errors without a message (e.g., hitting in Normal mode). See 'visualbell' on how to make the bell behave like a beep, - screen flash or do nothing. + screen flash or do nothing. See 'belloff' to finetune when to ring the + bell. *'errorfile'* *'ef'* 'errorfile' 'ef' string (Amiga default: "AztecC.Err", @@ -3069,6 +3130,17 @@ A jump table for the options with a short description can be found at |Q_op|. fold:c Folded |hl-Folded| diff:c DiffDelete |hl-DiffDelete| + *'fixendofline'* *'fixeol'* *'nofixendofline'* *'nofixeol'* +'fixendofline' 'fixeol' boolean (default on) + local to buffer + {not in Vi} + When writing a file and this option is on, at the end of file + will be restored if missing. Turn this option off if you want to + preserve the situation from the original file. + When the 'binary' option is set the value of this option doesn't + matter. + See the 'endofline' option. + *'fkmap'* *'fk'* *'nofkmap'* *'nofk'* 'fkmap' 'fk' boolean (default off) *E198* global @@ -3350,8 +3422,8 @@ A jump table for the options with a short description can be found at |Q_op|. modeline, see |sandbox-option|. That stops the option from working, since changing the buffer text is not allowed. - *'fsync'* *'fs'* *'nofsync'* *'nofs'* -'fsync' 'fs' boolean (default on) + *'fsync'* *'fs'* +'fsync' 'fs' boolean (default on) global {not in Vi} When on, the library function fsync() will be called after writing a diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt index 74350d051b..1f7a99c12c 100644 --- a/runtime/doc/quickref.txt +++ b/runtime/doc/quickref.txt @@ -1,4 +1,4 @@ -*quickref.txt* For Vim version 7.4. Last change: 2014 Nov 19 +*quickref.txt* For Vim version 7.4. Last change: 2015 Jul 21 VIM REFERENCE MANUAL by Bram Moolenaar @@ -620,6 +620,7 @@ Short explanation of each option: *option-list* 'balloondelay' 'bdlay' delay in mS before a balloon may pop up 'ballooneval' 'beval' switch on balloon evaluation 'balloonexpr' 'bexpr' expression to show in balloon +'belloff' 'bo' do not ring the bell for these reasons 'binary' 'bin' read/write/edit file in binary mode 'bioskey' 'biosk' MS-DOS: use bios calls for input characters 'blurradius' 'blur' transparency blur of the GUI window (MacVim only) @@ -697,6 +698,7 @@ Short explanation of each option: *option-list* 'fileignorecase' 'fic' ignore case when using file names 'filetype' 'ft' type of file, used for autocommands 'fillchars' 'fcs' characters to use for displaying special items +'fixendofline' 'fixeol' make sure last line in file has 'fkmap' 'fk' Farsi keyboard mapping 'foldclose' 'fcl' close a fold when the cursor leaves it 'foldcolumn' 'fdc' width of the column used to indicate folds @@ -711,10 +713,10 @@ Short explanation of each option: *option-list* 'foldnestmax' 'fdn' maximum fold depth 'foldopen' 'fdo' for which commands a fold will be opened 'foldtext' 'fdt' expression used to display for a closed fold +'formatexpr' 'fex' expression used with "gq" command 'formatlistpat' 'flp' pattern used to recognize a list header 'formatoptions' 'fo' how automatic formatting is to be done 'formatprg' 'fp' name of external program used with "gq" command -'formatexpr' 'fex' expression used with "gq" command 'fsync' 'fs' whether to invoke fsync() after file write 'fullscreen' 'fu' let vim cover the whole screen (MacVim only) 'fuoptions' 'fuopt' controls how 'fullscreen' behaves (MacVim only) @@ -735,15 +737,15 @@ Short explanation of each option: *option-list* 'helplang' 'hlg' preferred help languages 'hidden' 'hid' don't unload buffer when it is |abandon|ed 'highlight' 'hl' sets highlighting mode for various occasions -'hlsearch' 'hls' highlight matches with last search pattern 'history' 'hi' number of command-lines that are remembered 'hkmap' 'hk' Hebrew keyboard mapping 'hkmapp' 'hkp' phonetic Hebrew keyboard mapping +'hlsearch' 'hls' highlight matches with last search pattern 'icon' let Vim set the text of the window icon 'iconstring' string to use for the Vim icon text 'ignorecase' 'ic' ignore case in search patterns -'imactivatekey' 'imak' key that activates the X input method 'imactivatefunc' 'imaf' function to enable/disable the X input method +'imactivatekey' 'imak' key that activates the X input method 'imcmdline' 'imc' use IM when starting to edit a command line 'imdisable' 'imd' do not use the IM in any mode 'iminsert' 'imi' use :lmap or IM in Insert mode @@ -897,9 +899,9 @@ Short explanation of each option: *option-list* 'switchbuf' 'swb' sets behavior when switching to another buffer 'synmaxcol' 'smc' maximum column to find syntax items 'syntax' 'syn' syntax to be loaded for current buffer -'tabstop' 'ts' number of spaces that in file uses 'tabline' 'tal' custom format for the console tab pages line 'tabpagemax' 'tpm' maximum number of tab pages for |-p| and "tab all" +'tabstop' 'ts' number of spaces that in file uses 'tagbsearch' 'tbs' use binary searching in tags files 'taglength' 'tl' number of significant characters for a tag 'tagrelative' 'tr' file names in tag file are relative diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index c6070aa8d8..224e2da6b6 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -1,4 +1,4 @@ -*syntax.txt* For Vim version 7.4. Last change: 2015 Mar 29 +*syntax.txt* For Vim version 7.4. Last change: 2015 Aug 13 VIM REFERENCE MANUAL by Bram Moolenaar @@ -3445,7 +3445,7 @@ DEFINING KEYWORDS *:syn-keyword* :syntax keyword Type contained int long char :syntax keyword Type int long contained char :syntax keyword Type int long char contained -< *E789* +< *E789* *E890* When you have a keyword with an optional tail, like Ex commands in Vim, you can put the optional characters inside [], to define all the variations at once: > @@ -3699,6 +3699,7 @@ Whether or not it is actually concealed depends on the value of the 'conceallevel' option. The 'concealcursor' option is used to decide whether concealable items in the current line are displayed unconcealed to be able to edit the line. +Another way to conceal text with with |matchadd()|. concealends *:syn-concealends* @@ -4760,7 +4761,7 @@ guisp={color-name} *highlight-guisp* Orange Purple Violet In the Win32 and MacVim GUI versions, additional system colors are - available. See |win32-colors| and |macvim-colors| respectively. + available. See |win32-colors| and |macvim-colors|. You can also specify a color by its Red, Green and Blue values. The format is "#rrggbb", where diff --git a/runtime/doc/tags b/runtime/doc/tags index 91ccf21031..51b37bb815 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -76,6 +76,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME* 'bdir' options.txt /*'bdir'* 'bdlay' options.txt /*'bdlay'* 'beautify' vi_diff.txt /*'beautify'* +'belloff' options.txt /*'belloff'* 'beval' options.txt /*'beval'* 'bex' options.txt /*'bex'* 'bexpr' options.txt /*'bexpr'* @@ -91,6 +92,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME* 'bl' options.txt /*'bl'* 'blur' options.txt /*'blur'* 'blurradius' options.txt /*'blurradius'* +'bo' options.txt /*'bo'* 'bomb' options.txt /*'bomb'* 'breakat' options.txt /*'breakat'* 'breakindent' options.txt /*'breakindent'* @@ -248,6 +250,8 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME* 'fileignorecase' options.txt /*'fileignorecase'* 'filetype' options.txt /*'filetype'* 'fillchars' options.txt /*'fillchars'* +'fixendofline' options.txt /*'fixendofline'* +'fixeol' options.txt /*'fixeol'* 'fk' options.txt /*'fk'* 'fkmap' options.txt /*'fkmap'* 'fl' vi_diff.txt /*'fl'* @@ -548,11 +552,11 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME* 'nofen' options.txt /*'nofen'* 'nofic' options.txt /*'nofic'* 'nofileignorecase' options.txt /*'nofileignorecase'* +'nofixendofline' options.txt /*'nofixendofline'* +'nofixeol' options.txt /*'nofixeol'* 'nofk' options.txt /*'nofk'* 'nofkmap' options.txt /*'nofkmap'* 'nofoldenable' options.txt /*'nofoldenable'* -'nofs' options.txt /*'nofs'* -'nofsync' options.txt /*'nofsync'* 'nofu' options.txt /*'nofu'* 'nofullscreen' options.txt /*'nofullscreen'* 'nogd' options.txt /*'nogd'* @@ -4396,6 +4400,7 @@ E887 if_pyth.txt /*E887* E888 pattern.txt /*E888* E889 map.txt /*E889* E89 message.txt /*E89* +E890 syntax.txt /*E890* E90 message.txt /*E90* E91 options.txt /*E91* E92 message.txt /*E92* @@ -4523,6 +4528,7 @@ OffTheSpot mbyte.txt /*OffTheSpot* OnTheSpot mbyte.txt /*OnTheSpot* Operator-pending intro.txt /*Operator-pending* Operator-pending-mode intro.txt /*Operator-pending-mode* +OptionSet autocmd.txt /*OptionSet* OverTheSpot mbyte.txt /*OverTheSpot* P change.txt /*P* PATHEXT eval.txt /*PATHEXT* @@ -5265,6 +5271,7 @@ complete_CTRL-E insert.txt /*complete_CTRL-E* complete_CTRL-Y insert.txt /*complete_CTRL-Y* complete_add() eval.txt /*complete_add()* complete_check() eval.txt /*complete_check()* +completed_item-variable eval.txt /*completed_item-variable* completion-functions usr_41.txt /*completion-functions* complex-change change.txt /*complex-change* complex-repeat repeat.txt /*complex-repeat* @@ -6231,6 +6238,7 @@ getbufline() eval.txt /*getbufline()* getbufvar() eval.txt /*getbufvar()* getchar() eval.txt /*getchar()* getcharmod() eval.txt /*getcharmod()* +getcharsearch() eval.txt /*getcharsearch()* getcmdline() eval.txt /*getcmdline()* getcmdpos() eval.txt /*getcmdpos()* getcmdtype() eval.txt /*getcmdtype()* @@ -6412,6 +6420,7 @@ hebrew.txt hebrew.txt /*hebrew.txt* help helphelp.txt /*help* help-context help.txt /*help-context* help-summary usr_02.txt /*help-summary* +help-tags tags 1 help-translated helphelp.txt /*help-translated* help-writing helphelp.txt /*help-writing* help-xterm-window helphelp.txt /*help-xterm-window* @@ -7878,6 +7887,7 @@ session-file starting.txt /*session-file* set-option options.txt /*set-option* set-spc-auto spell.txt /*set-spc-auto* setbufvar() eval.txt /*setbufvar()* +setcharsearch() eval.txt /*setcharsearch()* setcmdpos() eval.txt /*setcmdpos()* setline() eval.txt /*setline()* setloclist() eval.txt /*setloclist()* @@ -8585,6 +8595,7 @@ v:charconvert_from eval.txt /*v:charconvert_from* v:charconvert_to eval.txt /*v:charconvert_to* v:cmdarg eval.txt /*v:cmdarg* v:cmdbang eval.txt /*v:cmdbang* +v:completed_item eval.txt /*v:completed_item* v:count eval.txt /*v:count* v:count1 eval.txt /*v:count1* v:ctype eval.txt /*v:ctype* @@ -8612,6 +8623,9 @@ v:mouse_lnum eval.txt /*v:mouse_lnum* v:mouse_win eval.txt /*v:mouse_win* v:oldfiles eval.txt /*v:oldfiles* v:operator eval.txt /*v:operator* +v:option_new eval.txt /*v:option_new* +v:option_old eval.txt /*v:option_old* +v:option_type eval.txt /*v:option_type* v:prevcount eval.txt /*v:prevcount* v:profiling eval.txt /*v:profiling* v:progname eval.txt /*v:progname* diff --git a/runtime/doc/term.txt b/runtime/doc/term.txt index 717989ad94..7e4942e3e1 100644 --- a/runtime/doc/term.txt +++ b/runtime/doc/term.txt @@ -1,4 +1,4 @@ -*term.txt* For Vim version 7.4. Last change: 2015 Feb 23 +*term.txt* For Vim version 7.4. Last change: 2015 Jun 25 VIM REFERENCE MANUAL by Bram Moolenaar @@ -301,6 +301,8 @@ Added by Vim (there are no standard codes for these): |xterm-8bit| |v:termresponse| |'ttymouse'| |xterm-codes| t_u7 request cursor position (for xterm) *t_u7* *'t_u7'* see |'ambiwidth'| + t_RB request terminal background color *t_RB* *'t_RB'* + see |'ambiwidth'| KEY CODES Note: Use the <> form if possible diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index fd2c7fb0f6..85192836d2 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1,4 +1,4 @@ -*todo.txt* For Vim version 7.4. Last change: 2015 Jun 19 +*todo.txt* For Vim version 7.4. Last change: 2015 Aug 25 VIM REFERENCE MANUAL by Bram Moolenaar @@ -35,6 +35,9 @@ not be repeated below, unless there is extra information. -------------------- Known bugs and current work ----------------------- Regexp problems: +- The regexp engines are not reentrant, causing havoc when interrupted by a + remote expression or something else. Move global variables onto the stack + or into an allocated struct. - The old engine does not find a match for "/\%#=1\(\)\{80}", the new engine matches everywhere. - Using win_linetabsize() can still be slow. Cache the result, store col and @@ -58,6 +61,8 @@ Regexp problems: - Using back reference before the capturing group sometimes works with the old engine, can we do this with the new engine? E.g. with "/\%(<\1>\)\@<=.*\%(<\/\(\w\+\)>\)\@=" matching text inside HTML tags. + This problem is probably the same: "\%(^\1.*$\n\)\@<=\(\d\+\).*$". + (guotuofeng, 2015 Jun 22) - Strange matching with "\(Hello\n\)\@<=A". (Anas Syed, 2015 Feb 12) - Problem with \v(A)@<=b+\1c. (Issue 334) - Diff highlighting can be very slow. (Issue 309) @@ -71,99 +76,54 @@ Regexp problems: Still using freed memory after using setloclist(). (lcd, 2014 Jul 23) More info Jul 24. Not clear why. -Better .ico file for Windows. (Pat Suwalski, 2015 Feb 13) -Waiting for response on remark from Edward Fox. - Problem that a previous silent ":throw" causes a following try/catch not to work. (ZyX, 2013 Sep 28) Problem using ":try" inside ":execute". (ZyX, 2013 Sep 15) -Regression for v_b_A. (Ingo Karkat, 2015 May 18) - ":cd C:\Windows\System32\drivers\etc*" does not work, even though the directory exists. (Sergio Gallelli, 2013 Dec 29) -Invalid memory access in regexp.c. (Dominique Pelle, 2015 May 23) - Using ":windo" to set options in all windows has the side effect that it changes the window layout and the current window. Make a variant that saves and restores. Use in the matchparen plugin. Perhaps we can use ":silent window"? -Patch for appending in Visual mode with 'linebreak' set. -(Christian Brabandt, 2015 Jun 1) - -Patch to make CTRL-A in Visual mode increment all Visually selected numbers. -Same for decrement with CTRL-X. (Christian Brabandt, 2015 Jun 8) -Update Jun 9. - -C indent: should recognize C11 raw strings. (Mark Lodato, 2015 Mar 1) -Need to recognize R"string" for 'cindent'. - -Updated phpcomplete. (Mikolaj Machowski, 2015 May 6) - -Patch to detect background terminal color in xterm. (Lubomir Rintel, 2015 Jun -1) - -Patch to fix that in command-line window first character is erased -when conceallevel is set. (Hirohito Higashi, 2015 May 12) - -Patch to make Lua 5.3 and later work. (Felix Schnizlein, 2015 Jun 11) - -Patch to make \U in a string accept up to 8 characters. (Christian Brabandt, -2015 Jun 12) Does this break existing scripts? +Illegal memory access, requires ASAN to see. (Dominique Pelle, 2015 Jul 28) Crash when changing the 'tags' option from a remote command. (Benjamin Fritz, 2015 Mar 18, stack trace Mar 20) -Patch on issue 361. - -Patch on issue 362. - Gvim: when both Tab and CTRL-I are mapped, use CTRL-I not for Tab. +Updated Breton spell script. (pull request 396, Dominique) + Can src/GvimExt/Make_cyg.mak be removed? Same for src/xxd/Make_cyg.mak Python: ":py raw_input('prompt')" doesn't work. (Manu Hack) +Patch to add CTRL-g U to not break undo for the following cursor movement +command. (Christian Brabandt, 2015 Aug 4) + MS-Windows: When editing a file with a leading space, writing it uses the wrong name. (Aram, 2014 Nov 7) Vim 7.4. Can't recognize the $ProgramFiles(x86) environment variable. Recognize it specifically? First try with the parens, then without. -Patch to force redraw after ":syn spell" command. (Christian, 2015 May 8) - -Patch for multi-byte characters in langmap and applying a mapping on them. -(Christian Brabandt, 2015 Jun 12) -Is this the right solution? - -Patch for langmap not working properly with mapping in Command-line mode. -Issue 376. - -Patch to add grepfile(). (Scott Prager, 2015 May 26) -Work in progress. - -Patch to make getregtype() return the right size for non-linux systems. -(Yasuhiro Matsumoto, 2014 Jul 8) -Breaks test_eval. Inefficient, can we only compute y_width when needed? - Value returned by virtcol() changes depending on how lines wrap. This is inconsistent with the documentation. Better greek spell checking. Issue 299. -Patch to add 'completeselect' option. Specifies how to select a candidate in -insert completion. (Shougo, 2013 May 29) -Update to add to existing 'completeopt'. 2013 May 30 -Updated update: Shougo 2015 Jun 12 +Add bzl filetype support. (David Barnett, 2015 Aug 11) When complete() first argument is before where insert started and 'backspace' is Vi compatible, the completion fails. (Hirohito Higashi, 2015 Feb 19) -Patch to fix equivalence classes in regexp. (Dominique Pelle, 2015 Jun 2) +Test 44 fails when [[=A=]] is changed to [[=À=]]. Caused by getcmdline() not +handling the 0x80 as a second byte correctly? (Dominique Pelle, 2015 Jun 10) Weird encryption problems on Windows. (Ben Fritz, 2015 Feb 13) Goes away when disabling the swap file. (might1, Feb 16) @@ -171,15 +131,62 @@ Goes away when disabling the swap file. (might1, Feb 16) MS-Windows: Crash opening very long file name starting with "\\". (Christian Brock, 2012 Jun 29) +Patch to improve IME handling in the MS-Windows console. +(Ken Takata, 2015 Aug 8) + +Patch to support Unicode I/O in the MS-Windows console. +(Ken Takata, 2015 Aug 8) Also by Yasuhiro Matsumoto. + The argument for "-S" is not taken literally, the ":so" command expands wildcards. Add a ":nowild" command modifier? (ZyX, 2015 March 4) +":set all&" still does not handle all side effects. Centralize handling side +effects for when set by the user, on init and when reset to default. + +Proposal to make options.txt easier to read. (Arnaud Decara, 2015 Aug 5) +Update Aug 14. + Build with Python on Mac does not always use the right library. (Kazunobu Kuriyama, 2015 Mar 28) +Example in editing.txt uses $HOME with the expectating that it ends in a +slash. For me it does, but perhaps not for everybody. Add a function that +inserts a slash when needed? pathconcat(dir, path) (Thilo Six, 2015 Aug 12) + ml_updatechunk() is slow when retrying for another encoding. (John Little, 2014 Sep 11) +Patch to fix that "zt" in diff mode doesn't always work properly. +(Christian Brabandt, 2015 Aug 6) Need to uncomment a line to not have filler +lines. + +Patch to fix checking global option value when not using it. +(Arnaud Decara, 2015 Jul 23) + +When 'showbreak' is set repeating a Visual operation counts the size of the +'showbreak' text as part of the operation. (Axel Bender, 2015 Jul 20) + +Patch to apply 'fileformats' when starting Vim. (Mike Williams, 2015 Jul 22) + +Patch for matchit plugin related to multibyte chars. (Ken Takata, 2015 Jul 22) + +Patch for multi-byte characters in langmap and applying a mapping on them. +(Christian Brabandt, 2015 Jun 12, update July 25) +Is this the right solution? + +Patch to add grepfile(). (Scott Prager, 2015 May 26) +Work in progress. + +Patch for global-local options consistency. (Arnaud Decara, 2015 Jul 22) +Is this right? + +Patch to have CTRL-A and CTRL-X update the '[ and '] marks. +(Yukihiro Nakadaira, 2015 Aug 23) + +Patch to make getregtype() return the right size for non-linux systems. +(Yasuhiro Matsumoto, 2014 Jul 8) +Breaks test_eval. Inefficient, can we only compute y_width when needed? + Patch to use different terminal mode settings for system(). (Hayaki Saito) Does this work for everybody? @@ -189,35 +196,19 @@ Patch to fix that wide characters do not work properly after exiting. Patch for man.vim. (SungHyun Nam, 2015 May 20) Doesn't work completely (Dominique Orban) +Patch to add a "literal" argument to bufnr(). (Olaf Dabrunz, 2015 Aug 4) + When a session file is created and there are "nofile" buffers, these are not filled. Need to trigger BufReadCmd autocommands. Also handle deleting the initial empty buffer better. (ZyX, 2015 March 8) Extended file attributes lost on write (backupcopy=no). Issue 306. -Patch to add an argument to ":ls" for specific kinds of buffers. -(Marcin Szamotulski, 2015 Jan 31) - -Crash when using R syntax. (Jakson Alves de Aquino, 2015 Jan 30) -Memory freed by ":syn clear" but still referenced, syntax items referenced -from two windows? Stopped happening (Feb 5). - -Patch for an extra argument to matchadd() for conceal. (Christian Brabandt, -2015 Feb 17, update Feb 19) - -Patch to add v:completed_item. (Shougo Matsu, 2013 Nov 29). -Update 2015 May 30. - Patch to add :lockjumps. (Carlo Baldassi, 2015 May 25) OK to not block marks? Mixup of highlighting when there is a match and SpellBad. (ZyX, 2015 Jan 1) -Patch on issue 79: use 'path' option for filename completion. - -Patch to add 'belloff' option. (Christian Brabandt, 2015 Jan 31) -Update Feb 6. - Patch for drag&drop reordering of GUI tab pages reordering. (Ken Takata, 2013 Nov 22, second one, also by Masamichi Abe) @@ -247,6 +238,11 @@ Adding "~" to 'cdpath' doesn't work for completion? (Davido, 2013 Aug 19) Should be easy to highlight all matches with 'incsearch'. Idea by Itchyny, 2015 Feb 6. +Patch to add ":ldo" and ":cdo", execute commands over quickfix list and +location list. (Yegappan Lakshmanan, 2013 Jun 2, update 2015 Mar 21) +Update by Florian Walch, 2015 Jul 1. +Update by Yegappan, 2015 Jul 24. + Plugins need to make a lot of effort, lots of mappings, to know what happened before pressing the key that triggers a plugin action. How about keeping the last N pressed keys, so that they do not need to be mapped? @@ -324,8 +320,6 @@ arguments. Patch to add :arglocal and :arglists. (Marcin Szamotulski, 2014 Aug 6) -PHP syntax is extremely slow. (Anhad Jai Singh, 2014 Jan 19) - Spell files use a latin single quote. Unicode also has another single quote: 0x2019. (Ron Aaron, 2014 Apr 4) New OpenOffice spell files support this with ICONV. But they are not @@ -447,8 +441,6 @@ Patch to define macros for hardcoded values. (Elias Diem, 2013 Dec 14) Several syntax file match "^\s*" which may get underlined if that's in the highlight group. Add a "\zs" after it? -Go through more coverity reports. - The undo file name can get too long. (Issue 346) For the path use a hash instead of dir%dir%dir%name hash%name. @@ -654,9 +646,6 @@ Win32: When 'autochdir' is on and 'encoding' is changed, files on the command line are opened again, but from the wrong directory. Apply 'autochdir' only after starting up? -Patch to add ":ldo" and ":cdo", execute commands over quickfix list and -location list. (Yegappan Lakshmanan, 2013 Jun 2, update 2015 Mar 21) - 8 "stl" and "stlnc" in 'fillchars' don't work for multi-byte characters. Patch by Christian Wellenbrock, 2013 Jul 5. @@ -841,7 +830,7 @@ effects? (Christian Brabandt, 2012 Aug 5, Update 2013 Aug 12) Would also need to do this for spellbadword() and spellsuggest(). Patch for variable tabstops. On github (Christian Brabandt, 2014 May 15) -Update Aug 16 (email). +Update 2015 Jul 25 (email). On 64 bit MS-Windows "long" is only 32 bits, but we sometimes need to store a 64 bits value. Change all number options to use nropt_T and define it to the @@ -1105,8 +1094,8 @@ Dominique can't reproduce it. ":function f(x) keepjumps" creates a function where every command is executed like it has ":keepjumps" before it. -Coverity: ask someone to create new user: Dominique. -Check if there are new reported defects: http://scan.coverity.com/rung2.html +Coverity: Check if there are new reported defects: +https://scan.coverity.com/projects/241 Patch to support :undo absolute jump to file save number. (Christian Brabandt, 2010 Nov 5) @@ -1142,7 +1131,7 @@ string value. Invalid read error in Farsi mode. (Dominique Pelle, 2009 Aug 2) -For running gvim on an USB stick: avoid the OLE registration. Use a command +For running gvim on a USB stick: avoid the OLE registration. Use a command line argument -noregister. When using an expression in 'statusline' leading white space sometimes goes @@ -4095,8 +4084,6 @@ Autocommands: 8 Autocommand for when modified files have been found, when getting input focus again (e.g., FileChangedFocus). Check when: getting focus, jumping to another buffer, ... -7 Autocommand for when an option is changed. Match buffer name or option - name? 8 Autocommands should not change registers. And marks? And the jumplist? And anything else? Add a command to save and restore these things. 8 Add autocommands, user functions and user commands to ":mkvimrc". diff --git a/runtime/doc/vim.man b/runtime/doc/vim.man index 5b9b83cb6c..9390caa0d6 100644 --- a/runtime/doc/vim.man +++ b/runtime/doc/vim.man @@ -1,4 +1,4 @@ -VIM(1) VIM(1) +VIM(1) General Commands Manual VIM(1) @@ -21,13 +21,13 @@ DESCRIPTION to edit all kinds of plain text. It is especially useful for editing programs. - There are a lot of enhancements above Vi: multi level undo, multi win- + There are a lot of enhancements above Vi: multi level undo, multi win‐ dows and buffers, syntax highlighting, command line editing, filename completion, on-line help, visual selection, etc.. See ":help vi_diff.txt" for a summary of the differences between Vim and Vi. While running Vim a lot of help can be obtained from the on-line help - system, with the ":help" command. See the ON-LINE HELP section below. + system, with the ":help" command. See the ON-LINE HELP section below. Most often Vim is started to edit a single file with the command @@ -38,44 +38,44 @@ DESCRIPTION vim [options] [filelist] If the filelist is missing, the editor will start with an empty buffer. - Otherwise exactly one out of the following four may be used to choose + Otherwise exactly one out of the following four may be used to choose one or more files to be edited. - file .. A list of filenames. The first one will be the current - file and read into the buffer. The cursor will be posi- + file .. A list of filenames. The first one will be the current + file and read into the buffer. The cursor will be posi‐ tioned on the first line of the buffer. You can get to the - other files with the ":next" command. To edit a file that + other files with the ":next" command. To edit a file that starts with a dash, precede the filelist with "--". - - The file to edit is read from stdin. Commands are read + - The file to edit is read from stdin. Commands are read from stderr, which should be a tty. -t {tag} The file to edit and the initial cursor position depends on - a "tag", a sort of goto label. {tag} is looked up in the + a "tag", a sort of goto label. {tag} is looked up in the tags file, the associated file becomes the current file and - the associated command is executed. Mostly this is used - for C programs, in which case {tag} could be a function + the associated command is executed. Mostly this is used + for C programs, in which case {tag} could be a function name. The effect is that the file containing that function - becomes the current file and the cursor is positioned on + becomes the current file and the cursor is positioned on the start of the function. See ":help tag-commands". -q [errorfile] - Start in quickFix mode. The file [errorfile] is read and - the first error is displayed. If [errorfile] is omitted, + Start in quickFix mode. The file [errorfile] is read and + the first error is displayed. If [errorfile] is omitted, the filename is obtained from the 'errorfile' option - (defaults to "AztecC.Err" for the Amiga, "errors.err" on - other systems). Further errors can be jumped to with the + (defaults to "AztecC.Err" for the Amiga, "errors.err" on + other systems). Further errors can be jumped to with the ":cn" command. See ":help quickfix". - Vim behaves differently, depending on the name of the command (the exe- + Vim behaves differently, depending on the name of the command (the exe‐ cutable may still be the same file). vim The "normal" way, everything is default. - ex Start in Ex mode. Go to Normal mode with the ":vi" command. + ex Start in Ex mode. Go to Normal mode with the ":vi" command. Can also be done with the "-e" argument. - view Start in read-only mode. You will be protected from writing + view Start in read-only mode. You will be protected from writing the files. Can also be done with the "-R" argument. gvim gview @@ -87,102 +87,102 @@ DESCRIPTION be done with the "-y" argument. rvim rview rgvim rgview - Like the above, but with restrictions. It will not be possi- - ble to start shell commands, or suspend Vim. Can also be + Like the above, but with restrictions. It will not be possi‐ + ble to start shell commands, or suspend Vim. Can also be done with the "-Z" argument. OPTIONS - The options may be given in any order, before or after filenames. + The options may be given in any order, before or after filenames. Options without an argument can be combined after a single dash. - +[num] For the first file the cursor will be positioned on line - "num". If "num" is missing, the cursor will be positioned + +[num] For the first file the cursor will be positioned on line + "num". If "num" is missing, the cursor will be positioned on the last line. - +/{pat} For the first file the cursor will be positioned on the - first occurrence of {pat}. See ":help search-pattern" for - the available search patterns. + +/{pat} For the first file the cursor will be positioned in the + line with the first occurrence of {pat}. See ":help + search-pattern" for the available search patterns. +{command} -c {command} - {command} will be executed after the first file has been - read. {command} is interpreted as an Ex command. If the - {command} contains spaces it must be enclosed in double - quotes (this depends on the shell that is used). Example: + {command} will be executed after the first file has been + read. {command} is interpreted as an Ex command. If the + {command} contains spaces it must be enclosed in double + quotes (this depends on the shell that is used). Example: Vim "+set si" main.c Note: You can use up to 10 "+" or "-c" commands. - -S {file} {file} will be sourced after the first file has been read. - This is equivalent to -c "source {file}". {file} cannot + -S {file} {file} will be sourced after the first file has been read. + This is equivalent to -c "source {file}". {file} cannot start with '-'. If {file} is omitted "Session.vim" is used (only works when -S is the last argument). --cmd {command} - Like using "-c", but the command is executed just before - processing any vimrc file. You can use up to 10 of these + Like using "-c", but the command is executed just before + processing any vimrc file. You can use up to 10 of these commands, independently from "-c" commands. - -A If Vim has been compiled with ARABIC support for editing - right-to-left oriented files and Arabic keyboard mapping, - this option starts Vim in Arabic mode, i.e. 'arabic' is + -A If Vim has been compiled with ARABIC support for editing + right-to-left oriented files and Arabic keyboard mapping, + this option starts Vim in Arabic mode, i.e. 'arabic' is set. Otherwise an error message is given and Vim aborts. - -b Binary mode. A few options will be set that makes it pos- + -b Binary mode. A few options will be set that makes it pos‐ sible to edit a binary or executable file. - -C Compatible. Set the 'compatible' option. This will make - Vim behave mostly like Vi, even though a .vimrc file + -C Compatible. Set the 'compatible' option. This will make + Vim behave mostly like Vi, even though a .vimrc file exists. - -d Start in diff mode. There should be two, three or four - file name arguments. Vim will open all the files and show + -d Start in diff mode. There should be two, three or four + file name arguments. Vim will open all the files and show differences between them. Works like vimdiff(1). - -d {device} Open {device} for use as a terminal. Only on the Amiga. + -d {device} Open {device} for use as a terminal. Only on the Amiga. Example: "-d con:20/30/600/150". - -D Debugging. Go to debugging mode when executing the first + -D Debugging. Go to debugging mode when executing the first command from a script. - -e Start Vim in Ex mode, just like the executable was called + -e Start Vim in Ex mode, just like the executable was called "ex". -E Start Vim in improved Ex mode, just like the executable was called "exim". - -f Foreground. For the GUI version, Vim will not fork and + -f Foreground. For the GUI version, Vim will not fork and detach from the shell it was started in. On the Amiga, Vim - is not restarted to open a new window. This option should - be used when Vim is executed by a program that will wait - for the edit session to finish (e.g. mail). On the Amiga + is not restarted to open a new window. This option should + be used when Vim is executed by a program that will wait + for the edit session to finish (e.g. mail). On the Amiga the ":sh" and ":!" commands will not work. - --nofork Foreground. For the GUI version, Vim will not fork and + --nofork Foreground. For the GUI version, Vim will not fork and detach from the shell it was started in. - -F If Vim has been compiled with FKMAP support for editing - right-to-left oriented files and Farsi keyboard mapping, - this option starts Vim in Farsi mode, i.e. 'fkmap' and - 'rightleft' are set. Otherwise an error message is given + -F If Vim has been compiled with FKMAP support for editing + right-to-left oriented files and Farsi keyboard mapping, + this option starts Vim in Farsi mode, i.e. 'fkmap' and + 'rightleft' are set. Otherwise an error message is given and Vim aborts. - -g If Vim has been compiled with GUI support, this option - enables the GUI. If no GUI support was compiled in, an + -g If Vim has been compiled with GUI support, this option + enables the GUI. If no GUI support was compiled in, an error message is given and Vim aborts. - -h Give a bit of help about the command line arguments and + -h Give a bit of help about the command line arguments and options. After this Vim exits. -H If Vim has been compiled with RIGHTLEFT support for editing - right-to-left oriented files and Hebrew keyboard mapping, - this option starts Vim in Hebrew mode, i.e. 'hkmap' and - 'rightleft' are set. Otherwise an error message is given + right-to-left oriented files and Hebrew keyboard mapping, + this option starts Vim in Hebrew mode, i.e. 'hkmap' and + 'rightleft' are set. Otherwise an error message is given and Vim aborts. -i {viminfo} - When using the viminfo file is enabled, this option sets - the filename to use, instead of the default "~/.viminfo". + When using the viminfo file is enabled, this option sets + the filename to use, instead of the default "~/.viminfo". This can also be used to skip the use of the .viminfo file, by giving the name "NONE". @@ -190,92 +190,92 @@ OPTIONS -l Lisp mode. Sets the 'lisp' and 'showmatch' options on. - -m Modifying files is disabled. Resets the 'write' option. - You can still modify the buffer, but writing a file is not + -m Modifying files is disabled. Resets the 'write' option. + You can still modify the buffer, but writing a file is not possible. - -M Modifications not allowed. The 'modifiable' and 'write' - options will be unset, so that changes are not allowed and - files can not be written. Note that these options can be + -M Modifications not allowed. The 'modifiable' and 'write' + options will be unset, so that changes are not allowed and + files can not be written. Note that these options can be set to enable making modifications. - -N No-compatible mode. Reset the 'compatible' option. This - will make Vim behave a bit better, but less Vi compatible, + -N No-compatible mode. Reset the 'compatible' option. This + will make Vim behave a bit better, but less Vi compatible, even though a .vimrc file does not exist. - -n No swap file will be used. Recovery after a crash will be - impossible. Handy if you want to edit a file on a very - slow medium (e.g. floppy). Can also be done with ":set + -n No swap file will be used. Recovery after a crash will be + impossible. Handy if you want to edit a file on a very + slow medium (e.g. floppy). Can also be done with ":set uc=0". Can be undone with ":set uc=200". - -nb Become an editor server for NetBeans. See the docs for + -nb Become an editor server for NetBeans. See the docs for details. -o[N] Open N windows stacked. When N is omitted, open one window for each file. - -O[N] Open N windows side by side. When N is omitted, open one + -O[N] Open N windows side by side. When N is omitted, open one window for each file. -p[N] Open N tab pages. When N is omitted, open one tab page for each file. - -R Read-only mode. The 'readonly' option will be set. You - can still edit the buffer, but will be prevented from acci- - dently overwriting a file. If you do want to overwrite a - file, add an exclamation mark to the Ex command, as in - ":w!". The -R option also implies the -n option (see - below). The 'readonly' option can be reset with ":set + -R Read-only mode. The 'readonly' option will be set. You + can still edit the buffer, but will be prevented from acci‐ + dently overwriting a file. If you do want to overwrite a + file, add an exclamation mark to the Ex command, as in + ":w!". The -R option also implies the -n option (see + below). The 'readonly' option can be reset with ":set noro". See ":help 'readonly'". - -r List swap files, with information about using them for + -r List swap files, with information about using them for recovery. - -r {file} Recovery mode. The swap file is used to recover a crashed - editing session. The swap file is a file with the same + -r {file} Recovery mode. The swap file is used to recover a crashed + editing session. The swap file is a file with the same filename as the text file with ".swp" appended. See ":help recovery". - -s Silent mode. Only when started as "Ex" or when the "-e" + -s Silent mode. Only when started as "Ex" or when the "-e" option was given before the "-s" option. -s {scriptin} - The script file {scriptin} is read. The characters in the - file are interpreted as if you had typed them. The same + The script file {scriptin} is read. The characters in the + file are interpreted as if you had typed them. The same can be done with the command ":source! {scriptin}". If the end of the file is reached before the editor exits, further characters are read from the keyboard. -T {terminal} - Tells Vim the name of the terminal you are using. Only - required when the automatic way doesn't work. Should be a - terminal known to Vim (builtin) or defined in the termcap + Tells Vim the name of the terminal you are using. Only + required when the automatic way doesn't work. Should be a + terminal known to Vim (builtin) or defined in the termcap or terminfo file. - -u {vimrc} Use the commands in the file {vimrc} for initializations. - All the other initializations are skipped. Use this to - edit a special kind of files. It can also be used to skip - all initializations by giving the name "NONE". See ":help + -u {vimrc} Use the commands in the file {vimrc} for initializations. + All the other initializations are skipped. Use this to + edit a special kind of files. It can also be used to skip + all initializations by giving the name "NONE". See ":help initialization" within vim for more details. - -U {gvimrc} Use the commands in the file {gvimrc} for GUI initializa- - tions. All the other GUI initializations are skipped. It - can also be used to skip all GUI initializations by giving - the name "NONE". See ":help gui-init" within vim for more + -U {gvimrc} Use the commands in the file {gvimrc} for GUI initializa‐ + tions. All the other GUI initializations are skipped. It + can also be used to skip all GUI initializations by giving + the name "NONE". See ":help gui-init" within vim for more details. - -V[N] Verbose. Give messages about which files are sourced and - for reading and writing a viminfo file. The optional num- + -V[N] Verbose. Give messages about which files are sourced and + for reading and writing a viminfo file. The optional num‐ ber N is the value for 'verbose'. Default is 10. - -v Start Vim in Vi mode, just like the executable was called - "vi". This only has effect when the executable is called + -v Start Vim in Vi mode, just like the executable was called + "vi". This only has effect when the executable is called "ex". -w {scriptout} - All the characters that you type are recorded in the file - {scriptout}, until you exit Vim. This is useful if you - want to create a script file to be used with "vim -s" or + All the characters that you type are recorded in the file + {scriptout}, until you exit Vim. This is useful if you + want to create a script file to be used with "vim -s" or ":source!". If the {scriptout} file exists, characters are appended. @@ -285,27 +285,27 @@ OPTIONS -x Use encryption when writing files. Will prompt for a crypt key. - -X Don't connect to the X server. Shortens startup time in a - terminal, but the window title and clipboard will not be + -X Don't connect to the X server. Shortens startup time in a + terminal, but the window title and clipboard will not be used. -y Start Vim in easy mode, just like the executable was called - "evim" or "eview". Makes Vim behave like a click-and-type + "evim" or "eview". Makes Vim behave like a click-and-type editor. - -Z Restricted mode. Works like the executable starts with + -Z Restricted mode. Works like the executable starts with "r". - -- Denotes the end of the options. Arguments after this will - be handled as a file name. This can be used to edit a + -- Denotes the end of the options. Arguments after this will + be handled as a file name. This can be used to edit a filename that starts with a '-'. --echo-wid GTK GUI only: Echo the Window ID on stdout. --help Give a help message and exit, just like "-h". - --literal Take file name arguments literally, do not expand wild- - cards. This has no effect on Unix where the shell expands + --literal Take file name arguments literally, do not expand wild‐ + cards. This has no effect on Unix where the shell expands wildcards. --noplugin Skip loading plugins. Implied by -u NONE. @@ -315,18 +315,18 @@ OPTIONS is given and the files are edited in the current Vim. --remote-expr {expr} - Connect to a Vim server, evaluate {expr} in it and print + Connect to a Vim server, evaluate {expr} in it and print the result on stdout. --remote-send {keys} Connect to a Vim server and send {keys} to it. --remote-silent - As --remote, but without the warning when no server is + As --remote, but without the warning when no server is found. --remote-wait - As --remote, but Vim does not exit until the files have + As --remote, but Vim does not exit until the files have been edited. --remote-wait-silent @@ -337,31 +337,31 @@ OPTIONS List the names of all Vim servers that can be found. --servername {name} - Use {name} as the server name. Used for the current Vim, + Use {name} as the server name. Used for the current Vim, unless used with a --remote argument, then it's the name of the server to connect to. --socketid {id} - GTK GUI only: Use the GtkPlug mechanism to run gvim in + GTK GUI only: Use the GtkPlug mechanism to run gvim in another window. --version Print version information and exit. ON-LINE HELP - Type ":help" in Vim to get started. Type ":help subject" to get help - on a specific subject. For example: ":help ZZ" to get help for the - "ZZ" command. Use and CTRL-D to complete subjects (":help cmd- - line-completion"). Tags are present to jump from one place to another + Type ":help" in Vim to get started. Type ":help subject" to get help + on a specific subject. For example: ":help ZZ" to get help for the + "ZZ" command. Use and CTRL-D to complete subjects (":help cmd‐ + line-completion"). Tags are present to jump from one place to another (sort of hypertext links, see ":help"). All documentation files can be viewed in this way, for example ":help syntax.txt". FILES /usr/local/lib/vim/doc/*.txt - The Vim documentation files. Use ":help doc-file-list" + The Vim documentation files. Use ":help doc-file-list" to get the complete list. /usr/local/lib/vim/doc/tags - The tags file used for finding information in the docu- + The tags file used for finding information in the docu‐ mentation files. /usr/local/lib/vim/syntax/syntax.vim @@ -381,7 +381,7 @@ FILES ~/.gvimrc Your personal gvim initializations. /usr/local/lib/vim/optwin.vim - Script used for the ":options" command, a nice way to + Script used for the ":options" command, a nice way to view and set options. /usr/local/lib/vim/menu.vim @@ -391,11 +391,11 @@ FILES Script to generate a bug report. See ":help bugs". /usr/local/lib/vim/filetype.vim - Script to detect the type of a file by its name. See + Script to detect the type of a file by its name. See ":help 'filetype'". /usr/local/lib/vim/scripts.vim - Script to detect the type of a file by its contents. + Script to detect the type of a file by its contents. See ":help 'filetype'". /usr/local/lib/vim/print/*.ps @@ -410,8 +410,8 @@ SEE ALSO AUTHOR Most of Vim was made by Bram Moolenaar, with a lot of help from others. See ":help credits" in Vim. - Vim is based on Stevie, worked on by: Tim Thompson, Tony Andrews and - G.R. (Fred) Walter. Although hardly any of the original code remains. + Vim is based on Stevie, worked on by: Tim Thompson, Tony Andrews and + G.R. (Fred) Walter. Although hardly any of the original code remains. BUGS Probably. See ":help todo" for a list of known problems. diff --git a/runtime/doc/windows.txt b/runtime/doc/windows.txt index 7f5d970eda..a7db69c520 100644 --- a/runtime/doc/windows.txt +++ b/runtime/doc/windows.txt @@ -1,4 +1,4 @@ -*windows.txt* For Vim version 7.4. Last change: 2015 Jan 31 +*windows.txt* For Vim version 7.4. Last change: 2015 Jul 21 VIM REFERENCE MANUAL by Bram Moolenaar @@ -986,9 +986,10 @@ A buffer can also be unlisted. This means it exists, but it is not in the list of buffers. |unlisted-buffer| -:files[!] *:files* -:buffers[!] *:buffers* *:ls* -:ls[!] Show all buffers. Example: +:files[!] [flags] *:files* +:buffers[!] [flags] *:buffers* *:ls* +:ls[!] [flags] + Show all buffers. Example: 1 #h "/test/text" line 1 ~ 2u "asdf" line 0 ~ @@ -1014,6 +1015,21 @@ list of buffers. |unlisted-buffer| + a modified buffer x a buffer with read errors + [flags] can be a combination of the following characters, + which restrict the buffers to be listed: + + modified buffers + - buffers with 'modifiable' off + = readonly buffers + a active buffers + u unloaded buffers (overrides the "!") + h hidden buffers + x buffers with a read error + % current buffer + # alternate buffer + Combining flags means they are "and"ed together, e.g.: + h+ hidden buffers which are modified + a+ active buffers which are modified + *:bad* *:badd* :bad[d] [+lnum] {fname} Add file name {fname} to the buffer list, without loading it. diff --git a/runtime/doc/xxd.man b/runtime/doc/xxd.man index 057c8e911b..7e1097fa99 100644 --- a/runtime/doc/xxd.man +++ b/runtime/doc/xxd.man @@ -1,4 +1,4 @@ -XXD(1) XXD(1) +XXD(1) General Commands Manual XXD(1) @@ -14,30 +14,29 @@ DESCRIPTION xxd creates a hex dump of a given file or standard input. It can also convert a hex dump back to its original binary form. Like uuencode(1) and uudecode(1) it allows the transmission of binary data in a `mail- - safe' ASCII representation, but has the advantage of decoding to stan- + safe' ASCII representation, but has the advantage of decoding to stan‐ dard output. Moreover, it can be used to perform binary file patching. OPTIONS - If no infile is given, standard input is read. If infile is specified - as a `-' character, then input is taken from standard input. If no + If no infile is given, standard input is read. If infile is specified + as a `-' character, then input is taken from standard input. If no outfile is given (or a `-' character is in its place), results are sent to standard output. - Note that a "lazy" parser is used which does not check for more than - the first option letter, unless the option is followed by a parameter. - Spaces between a single option letter and its parameter are optional. + Note that a "lazy" parser is used which does not check for more than + the first option letter, unless the option is followed by a parameter. + Spaces between a single option letter and its parameter are optional. Parameters to options can be specified in decimal, hexadecimal or octal notation. Thus -c8, -c 8, -c 010 and -cols 8 are all equivalent. - -a | -autoskip - toggle autoskip: A single '*' replaces nul-lines. Default off. + toggle autoskip: A single '*' replaces nul-lines. Default off. -b | -bits Switch to bits (binary digits) dump, rather than hexdump. This option writes octets as eight digits "1"s and "0"s instead of a normal hexadecimal dump. Each line is preceded by a line number - in hexadecimal and followed by an ascii (or ebcdic) representa- + in hexadecimal and followed by an ascii (or ebcdic) representa‐ tion. The command line switches -r, -p, -i do not work with this mode. @@ -50,25 +49,34 @@ OPTIONS to EBCDIC. This does not change the hexadecimal representation. The option is meaningless in combinations with -r, -p or -i. + -e Switch to little-endian hexdump. This option treats byte groups + as words in little-endian byte order. The default grouping of 4 + bytes may be changed using -g. This option only applies to hex‐ + dump, leaving the ASCII (or EBCDIC) representation unchanged. + The command line switches -r, -p, -i do not work with this mode. + -g bytes | -groupsize bytes separate the output of every bytes (two hex characters - or eight bit-digits each) by a whitespace. Specify -g 0 to sup- - press grouping. defaults to 2 in normal mode and 1 in - bits mode. Grouping does not apply to postscript or include - style. + or eight bit-digits each) by a whitespace. Specify -g 0 to sup‐ + press grouping. defaults to 2 in normal mode, 4 in lit‐ + tle-endian mode and 1 in bits mode. Grouping does not apply to + postscript or include style. -h | -help print a summary of available commands and exit. No hex dumping is performed. -i | -include - output in C include file style. A complete static array defini- + output in C include file style. A complete static array defini‐ tion is written (named after the input file), unless xxd reads from stdin. -l len | -len len stop after writing octets. + -o offset + add to the displayed file position. + -p | -ps | -postscript | -plain output in postscript continuous hexdump style. Also known as plain hexdump style. @@ -76,8 +84,8 @@ OPTIONS -r | -revert reverse operation: convert (or patch) hexdump into binary. If not writing to stdout, xxd writes into its output file without - truncating it. Use the combination -r -p to read plain hexadeci- - mal dumps without line number information and without a particu- + truncating it. Use the combination -r -p to read plain hexadeci‐ + mal dumps without line number information and without a particu‐ lar column layout. Additional Whitespace and line-breaks are allowed anywhere. @@ -101,7 +109,7 @@ OPTIONS CAVEATS xxd -r has some builtin magic while evaluating line number information. If the output file is seekable, then the linenumbers at the start of - each hexdump line may be out of order, lines may be missing, or over- + each hexdump line may be out of order, lines may be missing, or over‐ lapping. In these cases xxd will lseek(2) to the next position. If the output file is not seekable, only gaps are allowed, which will be filled by null-bytes. @@ -112,8 +120,8 @@ CAVEATS input line after reading enough columns of hexadecimal data (see option -c). This also means, that changes to the printable ascii (or ebcdic) columns are always ignored. Reverting a plain (or postscript) style - hexdump with xxd -r -p does not depend on the correct number of col- - umns. Here anything that looks like a pair of hex-digits is inter- + hexdump with xxd -r -p does not depend on the correct number of col‐ + umns. Here anything that looks like a pair of hex-digits is inter‐ preted. Note the difference between @@ -218,7 +226,6 @@ EXAMPLES % stty < /dev/term/b -echo -opost -isig -icanon min 1 % echo -n foo > /dev/term/b - RETURN VALUES The following error values are returned: @@ -256,7 +263,4 @@ AUTHOR Small changes by Bram Moolenaar. Edited by Juergen Weigert. - - - Manual page for xxd August 1996 XXD(1) diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 7529a60cc3..6bdedfdc99 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1,7 +1,7 @@ " Vim support file to detect file types " " Maintainer: Bram Moolenaar -" Last Change: 2015 Jun 06 +" Last Change: 2015 Aug 11 " Listen very carefully, I will say this only once if exists("did_load_filetypes") @@ -1168,7 +1168,7 @@ func! s:FTm() let n = 1 while n < 10 let line = getline(n) - if line =~ '^\s*\(#\s*\(include\|import\)\>\|/\*\|//\)' + if line =~ '^\s*\(#\s*\(include\|import\)\>\|@import\>\|/\*\|//\)' setf objc return endif @@ -1336,7 +1336,7 @@ func! s:FTmm() let n = 1 while n < 10 let line = getline(n) - if line =~ '^\s*\(#\s*\(include\|import\)\>\|/\*\)' + if line =~ '^\s*\(#\s*\(include\|import\)\>\|@import\>\|/\*\)' setf objcpp return endif @@ -1858,7 +1858,7 @@ au BufNewFile,BufRead sgml.catalog* call s:StarSetf('catalog') " Shell scripts (sh, ksh, bash, bash2, csh); Allow .profile_foo etc. " Gentoo ebuilds are actually bash scripts -au BufNewFile,BufRead .bashrc*,bashrc,bash.bashrc,.bash_profile*,.bash_logout*,.bash_aliases*,*.bash,*.ebuild call SetFileTypeSH("bash") +au BufNewFile,BufRead .bashrc*,bashrc,bash.bashrc,.bash[_-]profile*,.bash[_-]logout*,.bash[_-]aliases*,*.bash,*/{,.}bash[_-]completion{,.d,.sh}{,/*},*.ebuild,*.eclass call SetFileTypeSH("bash") au BufNewFile,BufRead .kshrc*,*.ksh call SetFileTypeSH("ksh") au BufNewFile,BufRead */etc/profile,.profile*,*.sh,*.env call SetFileTypeSH(getline(1)) @@ -2169,6 +2169,9 @@ au BufNewFile,BufRead *.tli setf tli " Telix Salt au BufNewFile,BufRead *.slt setf tsalt +" Tera Term Language +au BufRead,BufNewFile *.ttl setf teraterm + " Terminfo au BufNewFile,BufRead *.ti setf terminfo diff --git a/runtime/indent/sh.vim b/runtime/indent/sh.vim index 0394ee22e8..b2f35b23a7 100644 --- a/runtime/indent/sh.vim +++ b/runtime/indent/sh.vim @@ -1,8 +1,11 @@ " Vim indent file -" Language: Shell Script -" Maintainer: Peter Aronoff -" Original Author: Nikolai Weibull -" Latest Revision: 2014-08-22 +" Language: Shell Script +" Maintainer: Christian Brabandt +" Previous Maintainer: Peter Aronoff +" Original Author: Nikolai Weibull +" Latest Revision: 2015-07-28 +" License: Vim (see :h license) +" Repository: https://github.com/chrisbra/vim-sh-indent if exists("b:did_indent") finish @@ -10,7 +13,7 @@ endif let b:did_indent = 1 setlocal indentexpr=GetShIndent() -setlocal indentkeys+=0=then,0=do,0=else,0=elif,0=fi,0=esac,0=done,),0=;;,0=;& +setlocal indentkeys+=0=then,0=do,0=else,0=elif,0=fi,0=esac,0=done,0=end,),0=;;,0=;& setlocal indentkeys+=0=fin,0=fil,0=fip,0=fir,0=fix setlocal indentkeys-=:,0# setlocal nosmartindent @@ -54,8 +57,8 @@ function! GetShIndent() let ind = indent(lnum) let line = getline(lnum) - if line =~ '^\s*\%(if\|then\|do\|else\|elif\|case\|while\|until\|for\|select\)\>' - if line !~ '\<\%(fi\|esac\|done\)\>\s*\%(#.*\)\=$' + if line =~ '^\s*\%(if\|then\|do\|else\|elif\|case\|while\|until\|for\|select\|foreach\)\>' + if line !~ '\<\%(fi\|esac\|done\|end\)\>\s*\%(#.*\)\=$' let ind += s:indent_value('default') endif elseif s:is_case_label(line, pnum) @@ -76,7 +79,7 @@ function! GetShIndent() let pine = line let line = getline(v:lnum) - if line =~ '^\s*\%(then\|do\|else\|elif\|fi\|done\)\>' || line =~ '^\s*}' + if line =~ '^\s*\%(then\|do\|else\|elif\|fi\|done\|end\)\>' || line =~ '^\s*}' let ind -= s:indent_value('default') elseif line =~ '^\s*esac\>' && s:is_case_empty(getline(v:lnum - 1)) let ind -= s:indent_value('default') diff --git a/runtime/indent/teraterm.vim b/runtime/indent/teraterm.vim new file mode 100644 index 0000000000..ba24257b02 --- /dev/null +++ b/runtime/indent/teraterm.vim @@ -0,0 +1,67 @@ +" Vim indent file +" Language: Tera Term Language (TTL) +" Based on Tera Term Version 4.86 +" Maintainer: Ken Takata +" URL: https://github.com/k-takata/vim-teraterm +" Last Change: 2015 Jun 4 +" Filenames: *.ttl +" License: VIM License + +if exists("b:did_indent") + finish +endif +let b:did_indent = 1 + +setlocal nosmartindent +setlocal noautoindent +setlocal indentexpr=GetTeraTermIndent(v:lnum) +setlocal indentkeys=!^F,o,O,e +setlocal indentkeys+==elseif,=endif,=loop,=next,=enduntil,=endwhile + +if exists("*GetTeraTermIndent") + finish +endif + +" The shiftwidth() function is relatively new. +" Don't require it to exist. +if exists('*shiftwidth') + function s:sw() abort + return shiftwidth() + endfunction +else + function s:sw() abort + return &shiftwidth + endfunction +endif + +function! GetTeraTermIndent(lnum) + let l:prevlnum = prevnonblank(a:lnum-1) + if l:prevlnum == 0 + " top of file + return 0 + endif + + " grab the previous and current line, stripping comments. + let l:prevl = substitute(getline(l:prevlnum), ';.*$', '', '') + let l:thisl = substitute(getline(a:lnum), ';.*$', '', '') + let l:previ = indent(l:prevlnum) + + let l:ind = l:previ + + if l:prevl =~ '^\s*if\>.*\' + " previous line opened a block + let l:ind += s:sw() + endif + if l:thisl =~ '^\s*\%(elseif\|else\|endif\|enduntil\|endwhile\|loop\|next\)\>' + " this line closed a block + let l:ind -= s:sw() + endif + + return l:ind +endfunction + +" vim: ts=8 sw=2 sts=2 diff --git a/runtime/macros/matchit.vim b/runtime/macros/matchit.vim index 74c1a1eb92..70867b1f93 100644 --- a/runtime/macros/matchit.vim +++ b/runtime/macros/matchit.vim @@ -303,7 +303,7 @@ fun! s:CleanUp(options, mode, startline, startcol, ...) let regexp = s:Wholematch(matchline, a:1, currcol-1) let endcol = matchend(matchline, regexp) if endcol > currcol " This is NOT off by one! - execute "normal!" . (endcol - currcol) . "l" + call cursor(0, endcol) endif endif " a:0 endif " a:mode != "o" && etc. diff --git a/runtime/makemenu.vim b/runtime/makemenu.vim index b78fdfd601..839dbdac07 100644 --- a/runtime/makemenu.vim +++ b/runtime/makemenu.vim @@ -177,6 +177,7 @@ SynMenu DE.Doxygen.C\ with\ doxygen:c.doxygen SynMenu DE.Doxygen.C++\ with\ doxygen:cpp.doxygen SynMenu DE.Doxygen.IDL\ with\ doxygen:idl.doxygen SynMenu DE.Doxygen.Java\ with\ doxygen:java.doxygen +SynMenu DE.Doxygen.DataScript\ with\ doxygen:datascript.doxygen SynMenu DE.Dracula:dracula SynMenu DE.DSSSL:dsl SynMenu DE.DTD:dtd diff --git a/runtime/menu.vim b/runtime/menu.vim index 7b2be977fc..34f39eb1f8 100644 --- a/runtime/menu.vim +++ b/runtime/menu.vim @@ -17,7 +17,7 @@ if !exists("did_install_default_menus") let did_install_default_menus = 1 -if (exists("v:lang") || &langmenu != "") +if exists("v:lang") || &langmenu != "" " Try to find a menu translation file for the current language. if &langmenu != "" if &langmenu =~ "none" @@ -205,7 +205,7 @@ inoremenu