From 4de70f5b9581bd0e35e7af3b6fb1eb835d538555 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Thu, 1 Nov 2018 05:24:44 +0100 Subject: doc - update standard-plugin-list. closes #8388 --- runtime/doc/deprecated.txt | 5 +++-- runtime/doc/help.txt | 3 +++ runtime/doc/pi_msgpack.txt | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/deprecated.txt b/runtime/doc/deprecated.txt index 7c98b81867..92a6bd6b4f 100644 --- a/runtime/doc/deprecated.txt +++ b/runtime/doc/deprecated.txt @@ -42,10 +42,11 @@ Functions ~ *last_buffer_nr()* Obsolete name for bufnr("$"). Modifiers ~ +*cpo-<* *:menu-* -*:menu-special* <> notation is always enabled. |cpo-<| +*:menu-special* <> notation is always enabled. *:map-* -*:map-special* <> notation is always enabled. |cpo-<| +*:map-special* <> notation is always enabled. Normal commands ~ *]f* diff --git a/runtime/doc/help.txt b/runtime/doc/help.txt index 976402c915..c2ad25aeda 100644 --- a/runtime/doc/help.txt +++ b/runtime/doc/help.txt @@ -160,6 +160,9 @@ Versions ~ *standard-plugin-list* Standard plugins ~ |pi_gzip.txt| Reading and writing compressed files +|pi_health.txt| Healthcheck framework +|pi_matchit.txt| Extended "%" matching +|pi_msgpack.txt| msgpack utilities |pi_netrw.txt| Reading and writing files over a network |pi_paren.txt| Highlight matching parens |pi_spec.txt| Filetype plugin to work with rpm spec files diff --git a/runtime/doc/pi_msgpack.txt b/runtime/doc/pi_msgpack.txt index 2484a13878..951b897f55 100644 --- a/runtime/doc/pi_msgpack.txt +++ b/runtime/doc/pi_msgpack.txt @@ -1,4 +1,4 @@ -*pi_msgpack.txt* Nvim +*pi_msgpack.txt* msgpack utilities Author: Nikolay Pavlov Copyright: (c) 2015 by Nikolay Pavlov -- cgit From f679abef3e518864b262f9e916c14ca6ff6ef4e4 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 4 Nov 2018 13:43:12 +0100 Subject: runtime: delete rrhelper.vim --- runtime/plugin/README.txt | 19 ------------------ runtime/plugin/rrhelper.vim | 48 --------------------------------------------- 2 files changed, 67 deletions(-) delete mode 100644 runtime/plugin/README.txt delete mode 100644 runtime/plugin/rrhelper.vim (limited to 'runtime') diff --git a/runtime/plugin/README.txt b/runtime/plugin/README.txt deleted file mode 100644 index 37e22e57c0..0000000000 --- a/runtime/plugin/README.txt +++ /dev/null @@ -1,19 +0,0 @@ -The plugin directory is for standard Vim plugin scripts. - -All files here ending in .vim will be sourced by Vim when it starts up. -Look in the file for hints on how it can be disabled without deleting it. - -getscriptPlugin.vim get latest version of Vim scripts -gzip.vim edit compressed files -matchparen.vim highlight paren matching the one under the cursor -netrwPlugin.vim edit files over a network and browse (remote) directories -rrhelper.vim used for --remote-wait editing -spellfile.vim download a spellfile when it's missing -tarPlugin.vim edit (compressed) tar files -tohtml.vim convert a file with syntax highlighting to HTML -vimballPlugin.vim create and unpack .vba files -zipPlugin.vim edit zip archives - -Note: the explorer.vim plugin is no longer here, the netrw.vim plugin has -taken over browsing directories (also for remote directories). - diff --git a/runtime/plugin/rrhelper.vim b/runtime/plugin/rrhelper.vim deleted file mode 100644 index b09cbc10b9..0000000000 --- a/runtime/plugin/rrhelper.vim +++ /dev/null @@ -1,48 +0,0 @@ -" Vim plugin with helper function(s) for --remote-wait -" Maintainer: Flemming Madsen -" Last Change: 2008 May 29 - -" Has this already been loaded? -if exists("loaded_rrhelper") || !has("clientserver") - finish -endif -let loaded_rrhelper = 1 - -" Setup answers for a --remote-wait client who will assume -" a SetupRemoteReplies() function in the command server - -function SetupRemoteReplies() - let cnt = 0 - let max = argc() - - let id = expand("") - if id == 0 - return - endif - while cnt < max - " Handle same file from more clients and file being more than once - " on the command line by encoding this stuff in the group name - let uniqueGroup = "RemoteReply_".id."_".cnt - - " Path separators are always forward slashes for the autocommand pattern. - " Escape special characters with a backslash. - let f = substitute(argv(cnt), '\\', '/', "g") - if exists('*fnameescape') - let f = fnameescape(f) - else - let f = escape(f, " \t\n*?[{`$\\%#'\"|!<") - endif - execute "augroup ".uniqueGroup - execute "autocmd ".uniqueGroup." BufUnload ". f ." call DoRemoteReply('".id."', '".cnt."', '".uniqueGroup."', '". f ."')" - let cnt = cnt + 1 - endwhile - augroup END -endfunc - -function DoRemoteReply(id, cnt, group, file) - call server2client(a:id, a:cnt) - execute 'autocmd! '.a:group.' BufUnload '.a:file - execute 'augroup! '.a:group -endfunc - -" vim: set sw=2 sts=2 : -- cgit From 2ee4ce0639d9c41f3c06eb03b46061d954e8ea28 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 4 Nov 2018 22:59:39 +0100 Subject: doc: merge sponsor.txt into intro.txt Also mention how to donate to Nvim. closes #8603 --- runtime/doc/debug.txt | 8 +- runtime/doc/intro.txt | 157 ++++++++++------------------------- runtime/doc/sponsor.txt | 216 ------------------------------------------------ runtime/doc/usr_01.txt | 6 +- 4 files changed, 50 insertions(+), 337 deletions(-) delete mode 100644 runtime/doc/sponsor.txt (limited to 'runtime') diff --git a/runtime/doc/debug.txt b/runtime/doc/debug.txt index 441d31c7b9..835b35b388 100644 --- a/runtime/doc/debug.txt +++ b/runtime/doc/debug.txt @@ -162,12 +162,8 @@ In WinDbg: choose Open Crash Dump on the File menu. Follow the instructions in *get-ms-debuggers* 3.5 Obtaining Microsoft Debugging Tools ~ -The Debugging Tools for Windows (including WinDbg) can be downloaded from - http://www.microsoft.com/whdc/devtools/debugging/default.mspx -This includes the WinDbg debugger. - -Visual C++ 2005 Express Edition can be downloaded for free from: - http://msdn.microsoft.com/vstudio/express/visualC/default.aspx +Visual Studio 2017 Community Edition can be downloaded for free from: + https://visualstudio.microsoft.com/downloads/ ========================================================================= vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/intro.txt b/runtime/doc/intro.txt index bf2e86ae46..b74079e74e 100644 --- a/runtime/doc/intro.txt +++ b/runtime/doc/intro.txt @@ -1,7 +1,7 @@ *intro.txt* Nvim - VIM REFERENCE MANUAL by Bram Moolenaar + NVIM REFERENCE MANUAL Introduction to Vim *ref* *reference* @@ -9,7 +9,7 @@ Introduction to Vim *ref* *reference* Type |gO| to see the table of contents. ============================================================================== -1. Introduction *intro* +Introduction *intro* Vim stands for Vi IMproved. It used to be Vi IMitation, but there are so many improvements that a name change was appropriate. Vim is a text editor which @@ -28,8 +28,8 @@ is not located in the default place. You can jump to subjects like with tags: Use CTRL-] to jump to a subject under the cursor, use CTRL-T to jump back. *pronounce* -Vim is pronounced as one word, like Jim, not vi-ai-em. It's written with a -capital, since it's a name, again like Jim. +Vim is pronounced as one word, like Jim. Nvim is pronounced as N-vim, or, +continuing with the Jim simile, N-Jim, which sounds like Ninja. This manual is a reference for all the Vim commands and options. This is not an introduction to the use of Vi or Vim, it gets a bit complicated here and @@ -37,134 +37,67 @@ there. For beginners, there is a hands-on |tutor|. To learn using Vim, read the user manual |usr_toc.txt|. *book* -There are many books on Vi that contain a section for beginners. There are -two books I can recommend: +There are many books on Vi and Vim. We recommend these books: - "Vim - Vi Improved" by Steve Oualline + "Practical Vim" by Drew Neil + "Modern Vim" by Drew Neil + https://vimcasts.org/publications/ -This is the very first book completely dedicated to Vim. It is very good for -beginners. The most often used commands are explained with pictures and -examples. The less often used commands are also explained, the more advanced -features are summarized. There is a comprehensive index and a quick -reference. Parts of this book have been included in the user manual -|frombook|. -Published by New Riders Publishing. ISBN: 0735710015 -For more information try one of these: - http://iccf-holland.org/click5.html - http://www.vim.org/iccf/click5.html +"Practical Vim" is a popular because of its focus on quickly learning common +editing tasks with Vim. "Modern Vim" explores new features introduced by Nvim +and Vim 8. - "Learning the Vi editor" by Linda Lamb and Arnold Robbins + "Vim - Vi Improved" by Steve Oualline -This is a book about Vi that includes a chapter on Vim (in the sixth edition). -The first steps in Vi are explained very well. The commands that Vim adds are -only briefly mentioned. There is also a German translation. -Published by O'Reilly. ISBN: 1-56592-426-6. +This is the first book dedicated to Vim. Parts of it were included in the +user manual. |frombook| ISBN: 0735710015 +For more information try one of these: + https://iccf-holland.org/click5.html + https://www.vim.org/iccf/click5.html ============================================================================== -2. Vim on the internet *internet* +Nvim on the interwebs *internet* *www* *WWW* *faq* *FAQ* *distribution* *download* -The Vim pages contain the most recent information about Vim. They also -contain links to the most recent version of Vim. The FAQ is a list of -Frequently Asked Questions. Read this if you have problems. - - Vim home page: http://www.vim.org/ - Vim FAQ: http://vimdoc.sf.net/ - Downloading: ftp://ftp.vim.org/pub/vim/MIRRORS - - -Usenet News group where Vim is discussed: *news* *usenet* - comp.editors -This group is also for other editors. If you write about Vim, don't forget to -mention that. - - *mail-list* *maillist* -There are several mailing lists for Vim: - *vim-use* *vim_use* - For discussions about using existing versions of Vim: Useful mappings, - questions, answers, where to get a specific version, etc. There are - quite a few people watching this list and answering questions, also - for beginners. Don't hesitate to ask your question here. - *vim-dev* *vim_dev* *vimdev* - For discussions about changing Vim: New features, porting, patches, - beta-test versions, etc. - *vim-announce* *vim_announce* - Announcements about new versions of Vim; also for beta-test versions - and ports to different systems. This is a read-only list. - *vim-mac* *vim_mac* - For discussions about using and improving the Macintosh version of - Vim. - -See http://www.vim.org/maillist.php for the latest information. - -NOTE: -- You can only send messages to these lists if you have subscribed! -- You need to send the messages from the same location as where you subscribed - from (to avoid spam mail). -- Maximum message size is 40000 characters. - - *subscribe-maillist* -If you want to join, send a message to - -Make sure that your "From:" address is correct. Then the list server will -give you help on how to subscribe. - - *maillist-archive* -For more information and archives look on the Vim maillist page: -http://www.vim.org/maillist.php + + Nvim home page: https://neovim.io/ + Nvim FAQ: https://github.com/neovim/neovim/wiki/FAQ + Downloads: https://github.com/neovim/neovim/releases + Vim FAQ: https://vimhelp.appspot.com/vim_faq.txt.html + Vim home page: https://www.vim.org/ Bug reports: *bugs* *bug-reports* *bugreport.vim* Report bugs on GitHub: https://github.com/neovim/neovim/issues -Please be brief; all the time that is spent on answering mail is subtracted -from the time that is spent on improving Vim! Always give a reproducible -example and try to find out which settings or other things trigger the bug. +Be brief, yet complete. Always give a reproducible example and try to find +out which settings or other things trigger the bug. -Preferably start Vim with: > - vim --clean -u reproduce.vim -Where reproduce.vim is a script that reproduces the problem. Try different -machines, if relevant (is this an MS-Windows specific bug perhaps?). +If Nvim crashes, try to get a backtrace. See |debug.txt|. -Send me patches if you can! +============================================================================== +Sponsor Vim/Nvim development *sponsor* *register* -It will help to include information about the version of Vim you are using and -your setup. You can get the information with this command: > - :so $VIMRUNTIME/bugreport.vim -This will create a file "bugreport.txt" in the current directory, with a lot -of information of your environment. Before sending this out, check if it -doesn't contain any confidential information! +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. -If Vim crashes, please try to find out where. You can find help on this here: -|debug.txt|. +Since Bram is back to a paid job the money will now be used to help children +in Uganda. See |uganda|. But at the same time donations increase Bram's +motivation to keep working on Vim! -In case of doubt or when you wonder if the problem has already been fixed but -you can't find a fix for it, become a member of the vim-dev maillist and ask -your question there. |maillist| +For the most recent information about sponsoring look on the Vim web site: - *year-2000* *Y2K* -Since Vim internally doesn't use dates for editing, there is no year 2000 -problem to worry about. Vim does use the time in the form of seconds since -January 1st 1970. It is used for a time-stamp check of the edited file and -the swap file, which is not critical and should only cause warning messages. + https://www.vim.org/sponsor/ -There might be a year 2038 problem, when the seconds don't fit in a 32 bit int -anymore. This depends on the compiler, libraries and operating system. -Specifically, time_t and the ctime() function are used. And the time_t is -stored in four bytes in the swap file. But that's only used for printing a -file date/time for recovery, it will never affect normal editing. -The Vim strftime() function directly uses the strftime() system function. -localtime() uses the time() system function. getftime() uses the time -returned by the stat() system function. If your system libraries are year -2000 compliant, Vim is too. +Neovim development is funded separately from Vim: -The user may create scripts for Vim that use external commands. These might -introduce Y2K problems, but those are not really part of Vim itself. + https://neovim.io/sponsors/ ============================================================================== -3. Credits *credits* *author* *Bram* *Moolenaar* +Credits *credits* *author* *Bram* *Moolenaar* Most of Vim was written by Bram Moolenaar . @@ -273,7 +206,7 @@ Elvis Another Vi clone, made by Steve Kirkendall. Very compact but isn't freely available. ============================================================================== -4. Notation *notation* +Notation *notation* When syntax highlighting is used to read this, text that is not typed literally is often highlighted with the Special group. These are items in [], @@ -494,7 +427,7 @@ examples and use them directly. Or type them literally, including the '<' and ":autocmd"! ============================================================================== -5. Modes, introduction *vim-modes-intro* *vim-modes* +Modes, introduction *vim-modes-intro* *vim-modes* Vim has seven BASIC modes: @@ -579,7 +512,7 @@ Insert Select mode Entered when starting Select mode from Insert mode. is shown at the bottom of the window. ============================================================================== -6. Switching from mode to mode *mode-switching* +Switching from mode to mode *mode-switching* If for any reason you do not know which mode you are in, you can always get back to Normal mode by typing twice. This doesn't work for Ex mode @@ -650,7 +583,7 @@ Q or gQ Switch to Ex mode. This is like typing ":" commands Use the ":vi" command |:visual| to exit this mode. ============================================================================== -7. The window contents *window-contents* +The window contents *window-contents* In Normal mode and Insert/Replace mode the screen window will show the current contents of the buffer: What You See Is What You Get. There are two @@ -773,7 +706,7 @@ On most Unix systems, resizing the window is recognized and handled correctly by Vim. ============================================================================== -8. Definitions *definitions* +Definitions *definitions* buffer Contains lines of text, usually read from a file. screen The whole area that Vim uses to work in. This can be diff --git a/runtime/doc/sponsor.txt b/runtime/doc/sponsor.txt deleted file mode 100644 index cb6bdad358..0000000000 --- a/runtime/doc/sponsor.txt +++ /dev/null @@ -1,216 +0,0 @@ -*sponsor.txt* Nvim - - - VIM REFERENCE MANUAL by Bram Moolenaar - - - -SPONSOR VIM DEVELOPMENT *sponsor* - -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 |uganda|. 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/ - -More explanations can be found in the |sponsor-faq|. - - -REGISTERED VIM USER *register* - -You can become a registered Vim user by sending at least 10 euro. This works -similar to sponsoring Vim, see |sponsor| above. Registration was made -possible for the situation where your boss or bookkeeper may be willing to -register software, but does not like the terms "sponsoring" and "donation". - -More explanations can be found in the |register-faq|. - - -VOTE FOR FEATURES *vote-for-features* - -To give registered Vim users and sponsors an advantage over lurkers they can -vote for the items Bram should work on. How does this voting work? - -1. You send at least 10 euro. See below for ways to transfer money - |send-money|. - -2. You will be e-mailed a registration key. Enter this key on your account - page on the Vim website. You can easily create an account if you don't - have one yet. - -3. You can enter your votes on the voting page. There is a link to that page - on your account page after entering a registration key. Your votes will - be counted for two years. - -4. The voting results appear on the results page, which is visible for - everybody: http://www.vim.org/sponsor/vote_results.php - -Additionally, once you have sent 100 euro or more in total, your name appears -in the "Vim hall of honour": http://www.vim.org/sponsor/hall_of_honour.php -But only if you enable this on your account page. - - -HOW TO SEND MONEY *send-money* - -Credit card Through PayPal, see the PayPal site for information: - https://www.paypal.com/en_US/mrb/pal=XAC62PML3GF8Q - The e-mail address for sending sponsorship money is: - donate@vim.org - The e-mail address for Vim registration is: - register@vim.org - Using Euro is preferred, other currencies are also accepted. - In Euro countries a bank transfer is preferred, this has lower - costs. - -Other methods See |iccf-donations|. - Include "Vim sponsor" or "Vim registration" in the comment of - your money transfer. Send me an e-mail that mentions the - amount you transferred if you want to vote for features and - show others you are a registered Vim user or sponsor. - -Cash Small amounts can be sent with ordinary mail. Put something - around the money, so that it's not noticeable from the - outside. Mention your e-mail address if you want to vote for - features and show others you are a registered Vim user or - sponsor. - -You can use this permanent address: - Bram Moolenaar - Finsterruetihof 1 - 8134 Adliswil - Switzerland - - - -QUESTIONS AND ANSWERS *sponsor-faq* *register-faq* - -Why should I give money? - -If you do not show your appreciation for Vim then Bram will be less motivated -to fix bugs and add new features. He will do something else instead. - - -How much money should I send? - -That is up to you. The more you give, the more children will be helped. -An indication for individuals that use Vim at home: 10 Euro per year. For -professional use: 30 Euro per year per person. Send at least 10 euro to be -able to vote for features. - - -What do I get in return? - -Each registered Vim user and sponsor who donates at least 10 euro will be able -to vote for new features. These votes will give priority to the work on Vim. -The votes are valid for two years. The more money you send the more your -votes count |votes-counted|. - -If you send 100 Euro or more in total you will be mentioned on the "Vim hall -of honour" page on the Vim web site. But only if you enable this on your -account page. You can also select whether the amount will be visible. - - -How do I become a Vim sponsor or registered Vim user? - -Send money, as explained above |send-money| and include your e-mail address. -When the money has been received you will receive a unique registration key. -This key can be used on the Vim website to activate voting on your Vim -account. You will then get an extra page where you can vote for features and -choose whether others will be able to see that you donated. There is a link -to this page on your "My Account" page. - - -What is the difference between sponsoring and registering? - -It has a different name. Use the term "registration" if your boss doesn't -like "sponsoring" or "donation". The benefits are the same. - - -How can I send money? - -See |send-money|. Check the web site for the most recent information: -http://www.vim.org/sponsor/ - - -Why don't you use the SourceForge donation system? - -SourceForge takes 5% of the donations for themselves. If you want to support -SourceForge you can send money to them directly. - - -I cannot afford to send money, may I still use Vim? - -Yes. - - -I did not register Vim, can I use all available features? - -Yes. - - -I noticed a bug, do I need to register before I can report it? - -No, suggestions for improving Vim can always be given. For improvements use -the developer |maillist|, for reporting bugs see |bugs|. - - -How are my votes counted? *votes-counted* - -You may vote when you send 10 euro or more. You can enter up to ten votes. -You can select the same item several times to give it more points. You can -also enter three counter votes, these count as negative points. - -When you send 30 euro or more the points are doubled. Above 100 euro they -count four times, above 300 euro they count six times, above 1000 euro ten -times. - - -Can I change my votes? - -You can change your votes any time you like, up to two years after you -sent money. The points will be counted right away. - - -Can I add an item to vote on? - -Not directly. You can suggest items to vote on to Bram. He will consider -fitting your item into the list. - - -How about Charityware? - -Currently the Vim donations go to |uganda| anyway. Thus it doesn't matter if -you sponsor Vim or ICCF. Except that Vim sponsoring will allow you to vote -for features. - - -I donated $$$, now please add feature XYZ! - -There is no direct relation between your donation and the work Bram does. -Otherwise you would be paying for work and we would have to pay tax over the -donation. If you want to hire Bram for specific work, contact him directly, -don't use the donation system. - - -Are the donations tax deductible? - -That depends on your country. The donations to help the children in |Uganda| -are tax deductible in Holland, Germany, Canada and in the USA. See the ICCF -website http://iccf-holland.org/donate.html. You must send an e-mail to Bram -to let him know that the donation is done because of the use of Vim. - - -Can you send me a bill? - -No, because there is no relation between the money you send and the work that -is done. But a receipt is possible. - - - - vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/usr_01.txt b/runtime/doc/usr_01.txt index f96043c409..3deaf181e5 100644 --- a/runtime/doc/usr_01.txt +++ b/runtime/doc/usr_01.txt @@ -68,9 +68,9 @@ For more info see |vimrc|. ============================================================================== *01.3* Using the Vim tutor *tutor* *vimtutor* -Instead of reading the text (boring!) you can use the vimtutor to learn your -first Vim commands. This is a 30 minute tutorial that teaches the most basic -Vim functionality hands-on. +Instead of reading the text (boring!) you can use :Tutor to learn your first +Vim commands. This is a 30 minute tutorial that teaches the most basic Vim +functionality hands-on. To start the tutorial, execute > -- cgit From 1bbbd5f0ff27e75fd0d68f16cf1817cb19218bb4 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 5 Nov 2018 01:54:24 +0100 Subject: build: `make helphtml` --- runtime/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'runtime') diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt index 70e4ca2eec..ad706af087 100644 --- a/runtime/CMakeLists.txt +++ b/runtime/CMakeLists.txt @@ -68,9 +68,9 @@ foreach(DF ${DOCFILES}) endforeach() add_custom_target(helptags - COMMAND ${CMAKE_COMMAND} -E remove ${GENERATED_RUNTIME_DIR}/doc/* + COMMAND ${CMAKE_COMMAND} -E remove doc/* COMMAND ${CMAKE_COMMAND} -E copy_directory - ${PROJECT_SOURCE_DIR}/runtime/doc ${GENERATED_RUNTIME_DIR}/doc + ${PROJECT_SOURCE_DIR}/runtime/doc doc COMMAND "${PROJECT_BINARY_DIR}/bin/nvim" -u NONE -i NONE -e --headless -c "helptags ++t doc" -c quit DEPENDS @@ -87,7 +87,7 @@ add_custom_command(OUTPUT ${GENERATED_HELP_TAGS} add_custom_target(doc_html COMMAND make html DEPENDS - ${GENERATED_HELP_TAGS} + helptags WORKING_DIRECTORY "${GENERATED_RUNTIME_DIR}/doc" ) -- cgit From 72b1ce7f30f8bdc60ba6e2bcfd2eca5e687b6f3e Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 5 Nov 2018 02:47:22 +0100 Subject: doc: fix/remove broken tag references --- runtime/doc/api.txt | 4 ++-- runtime/doc/autocmd.txt | 4 ++-- runtime/doc/cmdline.txt | 2 +- runtime/doc/eval.txt | 4 ++-- runtime/doc/if_lua.txt | 5 ++--- runtime/doc/index.txt | 1 - runtime/doc/options.txt | 8 +++----- runtime/doc/remote.txt | 5 ----- runtime/doc/sign.txt | 1 - runtime/doc/ui.txt | 2 +- runtime/doc/usr_05.txt | 2 +- runtime/doc/usr_45.txt | 3 +-- runtime/doc/various.txt | 2 +- 13 files changed, 16 insertions(+), 27 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index e816d0ae76..712a8878ba 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -97,7 +97,7 @@ nvim_buf_lines_event[{buf}, {changedtick}, {firstline}, {lastline}, {linedata}, When {changedtick} is |v:null| this means the screen lines (display) changed but not the buffer contents. {linedata} contains the changed screen lines. - This happens when |inccommand| shows a buffer preview. + This happens when 'inccommand' shows a buffer preview. Properties:~ {buf} API buffer handle (buffer number) @@ -138,7 +138,7 @@ nvim_buf_changedtick_event[{buf}, {changedtick}] *nvim_buf_changedtick_event* nvim_buf_detach_event[{buf}] *nvim_buf_detach_event* When buffer is detached (i.e. updates are disabled). Triggered explicitly by - |nvim_buf_detach| or implicitly in these cases: + |nvim_buf_detach()| or implicitly in these cases: - Buffer was |abandon|ed and 'hidden' is not set. - Buffer was reloaded, e.g. with |:edit| or an external change triggered |:checktime| or 'autoread'. diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt index 75a26bf614..a2772e2485 100644 --- a/runtime/doc/autocmd.txt +++ b/runtime/doc/autocmd.txt @@ -278,7 +278,7 @@ Name triggered by ~ |VimEnter| after doing all the startup stuff |GUIEnter| after starting the GUI successfully |GUIFailed| after starting the GUI failed -|TermResponse| after the terminal response to |t_RV| is received +|TermResponse| after the terminal response to t_RV is received |QuitPre| when using `:quit`, before deciding whether to exit |ExitPre| when using a command that may make Vim exit |VimLeavePre| before exiting Nvim, before writing the shada file @@ -989,7 +989,7 @@ TermClose When a |terminal| job ends. TermOpen When a |terminal| job is starting. Can be used to configure the terminal buffer. *TermResponse* -TermResponse After the response to |t_RV| is received from +TermResponse After the response to t_RV is received from the terminal. The value of |v:termresponse| can be used to do things depending on the terminal version. Note that this event may be diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt index d4f8d170ef..3f22fcb504 100644 --- a/runtime/doc/cmdline.txt +++ b/runtime/doc/cmdline.txt @@ -212,7 +212,7 @@ CTRL-\ e {expr} *c_CTRL-\_e* *c_CTRL-Y* CTRL-Y When there is a modeless selection, copy the selection into - the clipboard. |modeless-selection| + the clipboard. If there is no selection CTRL-Y is inserted as a character. CTRL-M or CTRL-J *c_CTRL-M* *c_CTRL-J* *c_* *c_* *c_CR* diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index f03189485c..91986a9442 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -2925,7 +2925,7 @@ confirm({msg} [, {choices} [, {default} [, {type}]]]) made. It returns the number of the choice. For the first choice this is 1. - {msg} is displayed in a |dialog| with {choices} as the + {msg} is displayed in a dialog with {choices} as the alternatives. When {choices} is missing or empty, "&OK" is used (and translated). {msg} is a String, use '\n' to include a newline. Only on @@ -8560,7 +8560,7 @@ tag_old_static Compiled with support for old static tags |tag-old-static|. tag_any_white Compiled with support for any white characters in tags files |tag-any-white|. -termresponse Compiled with support for |t_RV| and |v:termresponse|. +termresponse Compiled with support for t_RV and |v:termresponse|. textobjects Compiled with support for |text-objects|. timers Compiled with |timer_start()| support. title Compiled with window title support |'title'|. diff --git a/runtime/doc/if_lua.txt b/runtime/doc/if_lua.txt index 17c1a8a329..9dbbf87995 100644 --- a/runtime/doc/if_lua.txt +++ b/runtime/doc/if_lua.txt @@ -229,8 +229,7 @@ shared between command calls. All Lua default libraries are available. In addition, Lua "print" function has its output redirected to the Nvim message area, with arguments separated by a white space instead of a tab. -Lua uses the "vim" module (see |lua-vim|) to issue commands to Nvim -and manage buffers (|lua-buffer|) and windows (|lua-window|). However, +Lua uses the "vim" module (see |lua-vim|) to issue commands to Nvim. However, procedures that alter buffer content, open new buffers, and change cursor position are restricted when the command is executed in the |sandbox|. @@ -261,7 +260,7 @@ vim.stricmp(a, b) *lua-vim.stricmp* greater then b or a is lesser then b respectively. vim.type_idx *lua-vim.type_idx* - Type index for use in |lua-special-tables|. Specifying one of the + Type index for use in |lua-special-tbl|. Specifying one of the values from |lua-vim.types| allows typing the empty table (it is unclear whether empty lua table represents empty list or empty array) and forcing integral numbers to be |Float|. See |lua-special-tbl| for diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt index ed3f9a1776..7024a57333 100644 --- a/runtime/doc/index.txt +++ b/runtime/doc/index.txt @@ -1472,7 +1472,6 @@ tag command action ~ |:sfind| :sf[ind] split current window and edit file in 'path' |:sfirst| :sfir[st] split window and go to first file in the argument list -|:simalt| :sim[alt] Win32 GUI: simulate Windows ALT key |:sign| :sig[n] manipulate signs |:silent| :sil[ent] run a command silently |:sleep| :sl[eep] do nothing for a few seconds diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 7cf3aa1d60..d1e84c5aec 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1485,7 +1485,7 @@ A jump table for the options with a short description can be found at |Q_op|. global When 'confirm' is on, certain operations that would normally fail because of unsaved changes to a buffer, e.g. ":q" and ":e", - instead raise a |dialog| asking if you wish to save the current + instead raise a dialog asking if you wish to save the current file(s). You can still use a ! to unconditionally |abandon| a buffer. If 'confirm' is off you can still activate confirmation for one command only (this is most useful in mappings) with the |:confirm| @@ -2803,8 +2803,7 @@ A jump table for the options with a short description can be found at |Q_op|. :set guifont=* < will bring up a font requester, where you can pick the font you want. - The font name depends on the GUI used. See |setting-guifont| for a - way to set 'guifont' for various systems. + The font name depends on the GUI used. For Mac OSX you can use something like this: > :set guifont=Monaco:h10 @@ -6586,8 +6585,7 @@ A jump table for the options with a short description can be found at |Q_op|. menu. This conflicts with the use of the ALT key for mappings and entering special characters. This option tells what to do: no Don't use ALT keys for menus. ALT key combinations can be - mapped, but there is no automatic handling. This can then be - done with the |:simalt| command. + mapped, but there is no automatic handling. yes ALT key handling is done by the windowing system. ALT key combinations cannot be mapped. menu Using ALT in combination with a character that is a menu diff --git a/runtime/doc/remote.txt b/runtime/doc/remote.txt index 142d7b492a..6c2ceb45be 100644 --- a/runtime/doc/remote.txt +++ b/runtime/doc/remote.txt @@ -167,11 +167,6 @@ a client and send strings to other instances of Vim on the same X11 display. When an X11 GUI Vim (gvim) is started, it will try to register a send-server name on the 'VimRegistry' property on the root window. -A non GUI Vim with access to the X11 display (|xterm-clipboard| enabled), can -also act as a command server if a server name is explicitly given with the ---servername argument, or when Vim was build with the |+autoservername| -feature. - An empty --servername argument will cause the command server to be disabled. To send commands to a Vim server from another application, read the source diff --git a/runtime/doc/sign.txt b/runtime/doc/sign.txt index a26c0a3ac9..273d2b984c 100644 --- a/runtime/doc/sign.txt +++ b/runtime/doc/sign.txt @@ -79,7 +79,6 @@ DEFINING A SIGN. *:sign-define* *E255* *E160* *E612* will cause redraw problems. toolkit supports ~ Win32 .bmp, .ico, .cur - pixmap (.xpm) |+xpm_w32| linehl={group} Highlighting group used for the whole line the sign is placed diff --git a/runtime/doc/ui.txt b/runtime/doc/ui.txt index a0f1b0770e..3477e53545 100644 --- a/runtime/doc/ui.txt +++ b/runtime/doc/ui.txt @@ -167,7 +167,7 @@ the editor. mouse support is active. Some options like 'ambiwidth' have already taken effect on the grid, where appropriate empty cells are added, however a UI might still use such options when rendering raw text - sent from Nvim, like for |ui-ext-cmdline|. + sent from Nvim, like for |ui-cmdline|. ["mode_change", mode, mode_idx] The mode changed. The first parameter `mode` is a string representing diff --git a/runtime/doc/usr_05.txt b/runtime/doc/usr_05.txt index 38e858801b..af17d75656 100644 --- a/runtime/doc/usr_05.txt +++ b/runtime/doc/usr_05.txt @@ -321,7 +321,7 @@ Where can you find plugins? - Some come with Vim. You can find them in the directory $VIMRUNTIME/macros and its sub-directories and under $VIM/vimfiles/pack/dist/opt/. - Download from the net. There is a large collection on http://www.vim.org. -- They are sometimes posted in a Vim |maillist|. +- They are sometimes posted in a Vim maillist. - You could write one yourself, see |write-plugin|. diff --git a/runtime/doc/usr_45.txt b/runtime/doc/usr_45.txt index ae2aae7596..be33f0be6d 100644 --- a/runtime/doc/usr_45.txt +++ b/runtime/doc/usr_45.txt @@ -203,8 +203,7 @@ USING UNICODE IN A UNICODE TERMINAL There are terminals that support Unicode directly. The standard xterm that comes with XFree86 is one of them. Let's use that as an example. - First of all, the xterm must have been compiled with Unicode support. See -|UTF8-xterm| how to check that and how to compile it when needed. + First of all, the xterm must have been compiled with Unicode support. Start the xterm with the "-u8" argument. You might also need so specify a font. Example: > diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt index 11ee8f8ca9..5f40ccf2ec 100644 --- a/runtime/doc/various.txt +++ b/runtime/doc/various.txt @@ -381,7 +381,7 @@ T *+tag_binary* binary searching in tags file |tag-binary-search| N *+tag_old_static* old method for static tags |tag-old-static| m *+tag_any_white* any white space allowed in tags file |tag-any-white| B *+termguicolors* 24-bit color in xterm-compatible terminals support -N *+termresponse* support for |t_RV| and |v:termresponse| +N *+termresponse* support for t_RV and |v:termresponse| N *+textobjects* |text-objects| selection N *+timers* the |timer_start()| function N *+title* Setting the window 'title' and 'icon' -- cgit From b96730bc3bc71e03004b9720bcd0ac67a2a7bb85 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 5 Nov 2018 03:50:22 +0100 Subject: doc: API --- runtime/doc/api.txt | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index 712a8878ba..e16b6b7e75 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -638,7 +638,7 @@ nvim_set_client_info({name}, {version}, {type}, {methods}, Clients might define their own keys, but the following are suggested: "website" Website of client (for instance github repository) - "license" Informal descripton of the + "license" Informal description of the license, such as "Apache 2", "GPLv3" or "MIT" "logo" URI or path to image, preferably small logo or icon. .png or .svg @@ -862,8 +862,7 @@ nvim_buf_line_count({buffer}) *nvim_buf_line_count()* {buffer} Buffer handle Return: ~ - Line count, or `0` if the buffer has been unloaded (see - |api-buffer|). + Line count, or 0 for unloaded buffer. |api-buffer| nvim_buf_attach({buffer}, {send_buffer}, {opts}) *nvim_buf_attach()* Activate updates from this buffer to the current channel. @@ -912,8 +911,7 @@ nvim_buf_get_lines({buffer}, {start}, {end}, {strict_indexing}) error. Return: ~ - Array of lines. If the buffer has been unloaded then an - empty array will be returned instead. (See |api-buffer|.) + Array of lines, or empty array for unloaded buffer. *nvim_buf_set_lines()* nvim_buf_set_lines({buffer}, {start}, {end}, {strict_indexing}, @@ -940,6 +938,25 @@ nvim_buf_set_lines({buffer}, {start}, {end}, {strict_indexing}, error. {replacement} Array of lines to use as replacement +nvim_buf_get_offset({buffer}, {index}) *nvim_buf_get_offset()* + Returns the byte offset for a line. + + Line 1 (index=0) has offset 0. UTF-8 bytes are counted. EOL is + one byte. 'fileformat' and 'fileencoding' are ignored. The + line index just after the last line gives the total byte-count + of the buffer. A final EOL byte is counted if it would be + written, see 'eol'. + + Unlike |line2byte()|, throws error for out-of-bounds indexing. + Returns -1 for unloaded buffer. + + Parameters: ~ + {buffer} Buffer handle + {index} Line index + + Return: ~ + Integer byte offset, or -1 for unloaded buffer. + nvim_buf_get_var({buffer}, {name}) *nvim_buf_get_var()* Gets a buffer-scoped (b:) variable. @@ -1106,8 +1123,8 @@ nvim_buf_add_highlight({buffer}, {src_id}, {hl_group}, {line}, *nvim_buf_clear_highlight()* nvim_buf_clear_highlight({buffer}, {src_id}, {line_start}, {line_end}) - Clears highlights from a given source group and a range of - lines + Clears highlights and virtual text from a given source id and + range of lines To clear a source group in the entire buffer, pass in 0 and -1 to line_start and line_end respectively. @@ -1132,6 +1149,10 @@ nvim_buf_set_virtual_text({buffer}, {src_id}, {line}, {chunks}, the right of the ordinary text, this will contain the |lcs- eol| char if set, otherwise just be a space. + The same src_id can be used for both virtual text and + highlights added by nvim_buf_add_highlight. Virtual text is + cleared using nvim_buf_clear_highlight. + Parameters: ~ {buffer} Buffer handle {src_id} Source group to use or 0 to use a new group, or -- cgit From 520ec3dbfd208c99f9b184ab0a4baeab9a93b556 Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Sat, 3 Nov 2018 14:40:22 +0100 Subject: UI/TUI: improvements and cleanups for scrolling and clearing - TUI: _never_ rely on BCE for implicit clearing, only explicit commands. - TUI: use unibi_erase_chars when possible. - TUI: use end-exclusive ranges for invalid and cleared areas - screen: scrolling leaves scrolled in aree undefined. This is a conservative change, a client assuming the old semantics will still behave correctly. - screen: factor out vsep handling from line drawing. This is needed anyway for the multigrid refactor. - screen: simplifications of win_do_lines --- runtime/doc/ui.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/ui.txt b/runtime/doc/ui.txt index 3477e53545..c021f236c8 100644 --- a/runtime/doc/ui.txt +++ b/runtime/doc/ui.txt @@ -325,14 +325,14 @@ numerical highlight `id`:s to the actual attributes. +-------------------------+ src_top | | src (moved up) and dst | | |-------------------------| dst_bot | - | src (cleared) | | + | src (invalid) | | +=========================+ src_bot < If `rows` is less than zero, move a rectangle in the SR down, this can happen while scrolling up. > +=========================+ src_top - | src (cleared) | | + | src (invalid) | | |------------------------ | dst_top | | src (moved down) and dst| | +-------------------------+ src_bot | @@ -348,6 +348,10 @@ numerical highlight `id`:s to the actual attributes. end-exclusive, which is consistent with API conventions, but different from `set_scroll_region` which was end-inclusive. + The scrolled-in area will be filled using |ui-event-grid_line| directly + after the scroll event. The UI thus doesn't need to clear this area as + part of handling the scroll event. + ============================================================================== Legacy Grid Events (cell based) *ui-grid-old* -- cgit From 05f9c7c2f7f52a5b4b1a72a49dab99dc21195c7d Mon Sep 17 00:00:00 2001 From: ainola <42895189+ainola@users.noreply.github.com> Date: Tue, 13 Nov 2018 11:01:37 -0700 Subject: clipboard: support Wayland (#9230) Fixes #9213 --- runtime/autoload/provider/clipboard.vim | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'runtime') diff --git a/runtime/autoload/provider/clipboard.vim b/runtime/autoload/provider/clipboard.vim index 87a0315073..b763d28570 100644 --- a/runtime/autoload/provider/clipboard.vim +++ b/runtime/autoload/provider/clipboard.vim @@ -71,6 +71,12 @@ function! provider#clipboard#Executable() abort let s:paste['*'] = s:paste['+'] let s:cache_enabled = 0 return 'pbcopy' + elseif exists('$WAYLAND_DISPLAY') && executable('wl-copy') && executable('wl-paste') + let s:copy['+'] = 'wl-copy --foreground' + let s:paste['+'] = 'wl-paste --no-newline' + let s:copy['*'] = 'wl-copy --foreground --primary' + let s:paste['*'] = 'wl-paste --no-newline --primary' + return 'wl-copy' elseif exists('$DISPLAY') && executable('xsel') && s:cmd_ok('xsel -o -b') let s:copy['+'] = 'xsel --nodetach -i -b' let s:paste['+'] = 'xsel -o -b' -- cgit From 24ce4c62332e29b0c252e4ec64764cfb3d54bc65 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Tue, 13 Nov 2018 21:13:13 -0500 Subject: vim-patch:8.1.0115: the matchparen plugin may throw an error Problem: The matchparen plugin may throw an error. Solution: Change the skip argument from zero to "0". https://github.com/vim/vim/commit/b7a5ab112ab2267c54acdb6a326642afcd797bc4 --- runtime/plugin/matchparen.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime') diff --git a/runtime/plugin/matchparen.vim b/runtime/plugin/matchparen.vim index 23d4beea87..d53fb22df0 100644 --- a/runtime/plugin/matchparen.vim +++ b/runtime/plugin/matchparen.vim @@ -114,7 +114,7 @@ function! s:Highlight_Matching_Pair() " within those syntax types (i.e., not skip). Otherwise, the cursor is " outside of the syntax types and s_skip should keep its value so we skip any " matching pair inside the syntax types. - execute 'if' s_skip '| let s_skip = 0 | endif' + execute 'if' s_skip '| let s_skip = "0" | endif' " Limit the search to lines visible in the window. let stoplinebottom = line('w$') -- cgit From 091ae1e63fb36b28ec8a0cadfcfbb4e90859af1b Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Tue, 13 Nov 2018 21:13:28 -0500 Subject: vim-patch:8.1.0143: matchit and matchparen don't handle E363 Problem: Matchit and matchparen don't handle E363. Solution: Catch the E363 error. (Christian Brabandt) https://github.com/vim/vim/commit/3d1d6475f9665660c80cc53a7da2d5450b8b8d08 --- runtime/plugin/matchit.vim | 12 +++++++++--- runtime/plugin/matchparen.vim | 34 ++++++++++++++++++++++------------ 2 files changed, 31 insertions(+), 15 deletions(-) (limited to 'runtime') diff --git a/runtime/plugin/matchit.vim b/runtime/plugin/matchit.vim index e3171e5cbb..3b0a8112dc 100644 --- a/runtime/plugin/matchit.vim +++ b/runtime/plugin/matchit.vim @@ -1,5 +1,5 @@ " matchit.vim: (global plugin) Extended "%" matching -" Last Change: 2017 Sep 15 +" Last Change: 2018 Jul 3 by Christian Brabandt " Maintainer: Benji Fisher PhD " Version: 1.13.3, for Vim 6.3+ " Fix from Tommy Allen included. @@ -268,7 +268,7 @@ function! s:Match_wrapper(word, forward, mode) range " execute "normal!" . curcol . "l" " endif if skip =~ 'synID' && !(has("syntax") && exists("g:syntax_on")) - let skip = "0" + let skip = '0' else execute "if " . skip . "| let skip = '0' | endif" endif @@ -708,10 +708,16 @@ fun! s:MultiMatch(spflag, mode) let openpat = substitute(openpat, ',', '\\|', 'g') let closepat = substitute(close, '\(\\\@ -" Last Change: 2018 Jun 23 +" Last Change: 2018 Jul 3 " Exit quickly when: " - this plugin was already loaded (or disabled) @@ -103,18 +103,28 @@ function! s:Highlight_Matching_Pair() call cursor(c_lnum, c_col - before) endif - " Build an expression that detects whether the current cursor position is in - " certain syntax types (string, comment, etc.), for use as searchpairpos()'s - " skip argument. - " We match "escape" for special items, such as lispEscapeSpecial. - let s_skip = '!empty(filter(map(synstack(line("."), col(".")), ''synIDattr(v:val, "name")''), ' . + if !has("syntax") || !exists("g:syntax_on") + let s_skip = "0" + else + " Build an expression that detects whether the current cursor position is + " in certain syntax types (string, comment, etc.), for use as + " searchpairpos()'s skip argument. + " We match "escape" for special items, such as lispEscapeSpecial. + let s_skip = '!empty(filter(map(synstack(line("."), col(".")), ''synIDattr(v:val, "name")''), ' . \ '''v:val =~? "string\\|character\\|singlequote\\|escape\\|comment"''))' - " If executing the expression determines that the cursor is currently in - " one of the syntax types, then we want searchpairpos() to find the pair - " within those syntax types (i.e., not skip). Otherwise, the cursor is - " outside of the syntax types and s_skip should keep its value so we skip any - " matching pair inside the syntax types. - execute 'if' s_skip '| let s_skip = "0" | endif' + " If executing the expression determines that the cursor is currently in + " one of the syntax types, then we want searchpairpos() to find the pair + " within those syntax types (i.e., not skip). Otherwise, the cursor is + " outside of the syntax types and s_skip should keep its value so we skip + " any matching pair inside the syntax types. + " Catch if this throws E363: pattern uses more memory than 'maxmempattern'. + try + execute 'if ' . s_skip . ' | let s_skip = "0" | endif' + catch /^Vim\%((\a\+)\)\=:E363/ + " We won't find anything, so skip searching, should keep Vim responsive. + return + endtry + endif " Limit the search to lines visible in the window. let stoplinebottom = line('w$') -- cgit From 9e59fdf5f6522d91f1fb282465d3c6c0b8093daf Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Tue, 13 Nov 2018 21:30:29 -0500 Subject: vim-patch:8.1.0311: filtering entries in a quickfix list is not easy Problem: Filtering entries in a quickfix list is not easy. Solution: Add the cfilter plugin. (Yegappan Lakshmanan) https://github.com/vim/vim/commit/8c5e0093c9badced73e382915fb024a5c3ea463b --- runtime/pack/dist/opt/cfilter/plugin/cfilter.vim | 43 ++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 runtime/pack/dist/opt/cfilter/plugin/cfilter.vim (limited to 'runtime') diff --git a/runtime/pack/dist/opt/cfilter/plugin/cfilter.vim b/runtime/pack/dist/opt/cfilter/plugin/cfilter.vim new file mode 100644 index 0000000000..7a6464fc98 --- /dev/null +++ b/runtime/pack/dist/opt/cfilter/plugin/cfilter.vim @@ -0,0 +1,43 @@ +" cfilter.vim: Plugin to filter entries from a quickfix/location list +" Last Change: May 12, 2018 +" Maintainer: Yegappan Lakshmanan (yegappan AT yahoo DOT com) +" Version: 1.0 +" +" Commands to filter the quickfix list: +" :Cfilter[!] {pat} +" Create a new quickfix list from entries matching {pat} in the current +" quickfix list. Both the file name and the text of the entries are +" matched against {pat}. If ! is supplied, then entries not matching +" {pat} are used. +" :Lfilter[!] {pat} +" Same as :Cfilter but operates on the current location list. +" +if exists("loaded_cfilter") + finish +endif +let loaded_cfilter = 1 + +func s:Qf_filter(qf, pat, bang) + if a:qf + let Xgetlist = function('getqflist') + let Xsetlist = function('setqflist') + let cmd = ':Cfilter' . a:bang + else + let Xgetlist = function('getloclist', [0]) + let Xsetlist = function('setloclist', [0]) + let cmd = ':Lfilter' . a:bang + endif + + if a:bang == '!' + let cond = 'v:val.text !~# a:pat && bufname(v:val.bufnr) !~# a:pat' + else + let cond = 'v:val.text =~# a:pat || bufname(v:val.bufnr) =~# a:pat' + endif + + let items = filter(Xgetlist(), cond) + let title = cmd . ' ' . a:pat + call Xsetlist([], ' ', {'title' : title, 'items' : items}) +endfunc + +com! -nargs=+ -bang Cfilter call s:Qf_filter(1, , ) +com! -nargs=+ -bang Lfilter call s:Qf_filter(0, , ) -- cgit From f6c6567cb1bbc14750e487907b19eb59ce79434c Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Tue, 13 Nov 2018 22:32:37 -0500 Subject: vim-patch:8.1.0352: browsing compressed tar files does not always work Problem: Browsing compressed tar files does not always work. Solution: Use the "file" command to get the compression type. https://github.com/vim/vim/commit/d4a1aabe372ccb95aec968f4d54503231b1f956c --- runtime/autoload/tar.vim | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) (limited to 'runtime') diff --git a/runtime/autoload/tar.vim b/runtime/autoload/tar.vim index d92fe1b180..dc670dbd14 100644 --- a/runtime/autoload/tar.vim +++ b/runtime/autoload/tar.vim @@ -153,15 +153,14 @@ fun! tar#Browse(tarfile) let tarfile=substitute(system("cygpath -u ".shellescape(tarfile,0)),'\n$','','e') endif - let gzip_command = s:get_gzip_command(tarfile) - let curlast= line("$") if tarfile =~# '\.\(gz\|tgz\)$' + let gzip_command = s:get_gzip_command(tarfile) " call Decho("1: exe silent r! gzip -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - ") exe "sil! r! " . gzip_command . " -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - " elseif tarfile =~# '\.lrp' " call Decho("2: exe silent r! cat -- ".shellescape(tarfile,1)."|gzip -d -c -|".g:tar_cmd." -".g:tar_browseoptions." - ") - exe "sil! r! cat -- ".shellescape(tarfile,1)."|" . gzip_command . " -d -c -|".g:tar_cmd." -".g:tar_browseoptions." - " + exe "sil! r! cat -- ".shellescape(tarfile,1)."|gzip -d -c -|".g:tar_cmd." -".g:tar_browseoptions." - " elseif tarfile =~# '\.\(bz2\|tbz\|tb2\)$' " call Decho("3: exe silent r! bzip2 -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - ") exe "sil! r! bzip2 -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - " @@ -291,17 +290,16 @@ fun! tar#Read(fname,mode) let tar_secure= " " endif - let gzip_command = s:get_gzip_command(tarfile) - if tarfile =~# '\.bz2$' " call Decho("7: exe silent r! bzip2 -d -c ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp) exe "sil! r! bzip2 -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp elseif tarfile =~# '\.\(gz\|tgz\)$' + let gzip_command = s:get_gzip_command(tarfile) " call Decho("5: exe silent r! gzip -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd.' -'.g:tar_readoptions.' - '.tar_secure.shellescape(fname,1)) exe "sil! r! " . gzip_command . " -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp elseif tarfile =~# '\.lrp$' " call Decho("6: exe silent r! cat ".shellescape(tarfile,1)." | gzip -d -c - | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp) - exe "sil! r! cat -- ".shellescape(tarfile,1)." | " . gzip_command . " -d -c - | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp + exe "sil! r! cat -- ".shellescape(tarfile,1)." | gzip -d -c - | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp elseif tarfile =~# '\.lzma$' " call Decho("7: exe silent r! lzma -d -c ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp) exe "sil! r! lzma -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp @@ -589,8 +587,9 @@ fun! tar#Vimuntar(...) " if necessary, decompress the tarball; then, extract it if tartail =~ '\.tgz' - if executable("bzip2") - silent exe "!bzip2 -d ".shellescape(tartail) + let gzip_command = s:get_gzip_command(tarfile) + if executable(gzip_command) + silent exe "!" . gzip_command . " -d ".shellescape(tartail) elseif executable("gunzip") silent exe "!gunzip ".shellescape(tartail) elseif executable("gzip") @@ -630,11 +629,24 @@ fun! tar#Vimuntar(...) endfun func s:get_gzip_command(file) - if a:file =~# 'z$' && executable('bzip2') - " Some .tgz files are actually compressed with bzip2. Since bzip2 can - " handle the format from gzip, use it if the command exists. + " Try using the "file" command to get the actual compression type, since + " there is no standard way for the naming: ".tgz", ".tbz", ".txz", etc. + " If the "file" command doesn't work fall back to just using the file name. + if a:file =~# 'z$' + let filetype = system('file ' . a:file) + if filetype =~ 'bzip2 compressed' && executable('bzip2') + return 'bzip2' + endif + if filetype =~ 'XZ compressed' && executable('xz') + return 'xz' + endif + endif + if a:file =~# 'bz2$' return 'bzip2' endif + if a:file =~# 'xz$' + return 'xz' + endif return 'gzip' endfunc -- cgit From 3ea14d53664ca7dba648e650d4047e01a8518231 Mon Sep 17 00:00:00 2001 From: Marco Hinz Date: Sat, 17 Nov 2018 15:27:09 +0100 Subject: health/python: 'neovim' module was renamed to 'pynvim' --- runtime/autoload/health/provider.vim | 22 +++++++++++----------- runtime/autoload/provider/pythonx.vim | 12 ++++++------ 2 files changed, 17 insertions(+), 17 deletions(-) (limited to 'runtime') diff --git a/runtime/autoload/health/provider.vim b/runtime/autoload/health/provider.vim index 9a04649bfa..a99b600aba 100644 --- a/runtime/autoload/health/provider.vim +++ b/runtime/autoload/health/provider.vim @@ -152,10 +152,10 @@ function! s:check_clipboard() abort endif endfunction -" Get the latest Neovim Python client version from PyPI. +" Get the latest Neovim Python client (pynvim) version from PyPI. function! s:latest_pypi_version() abort let pypi_version = 'unable to get pypi response' - let pypi_response = s:download('https://pypi.python.org/pypi/neovim/json') + let pypi_response = s:download('https://pypi.python.org/pypi/pynvim/json') if !empty(pypi_response) try let pypi_data = json_decode(pypi_response) @@ -192,9 +192,9 @@ function! s:version_info(python) abort let nvim_path = s:trim(s:system([ \ a:python, '-c', \ 'import sys; sys.path.remove(""); ' . - \ 'import neovim; print(neovim.__file__)'])) + \ 'import pynvim; print(pynvim.__file__)'])) if s:shell_error || empty(nvim_path) - return [python_version, 'unable to load neovim Python module', pypi_version, + return [python_version, 'unable to load pynvim Python module', pypi_version, \ nvim_path] endif @@ -206,13 +206,13 @@ function! s:version_info(python) abort return a == b ? 0 : a > b ? 1 : -1 endfunction - " Try to get neovim.VERSION (added in 0.1.11dev). + " Try to get pynvim.VERSION (added in 0.1.11dev). let nvim_version = s:system([a:python, '-c', - \ 'from neovim import VERSION as v; '. + \ 'from pynvim import VERSION as v; '. \ 'print("{}.{}.{}{}".format(v.major, v.minor, v.patch, v.prerelease))'], \ '', 1, 1) if empty(nvim_version) - let nvim_version = 'unable to find neovim Python module version' + let nvim_version = 'unable to find pynvim Python module version' let base = fnamemodify(nvim_path, ':h') let metas = glob(base.'-*/METADATA', 1, 1) \ + glob(base.'-*/PKG-INFO', 1, 1) @@ -293,7 +293,7 @@ function! s:check_python(version) abort let [pyname, pythonx_errs] = provider#pythonx#Detect(a:version) if empty(pyname) - call health#report_warn('No Python interpreter was found with the neovim ' + call health#report_warn('No Python interpreter was found with the pynvim ' \ . 'module. Using the first available for diagnostics.') elseif exists('g:'.host_prog_var) let python_bin = pyname @@ -352,7 +352,7 @@ function! s:check_python(version) abort call health#report_warn('pyenv is not set up optimally.', [ \ printf('Create a virtualenv specifically ' \ . 'for Neovim using pyenv, and set `g:%s`. This will avoid ' - \ . 'the need to install the Neovim Python module in each ' + \ . 'the need to install the pynvim module in each ' \ . 'version/virtualenv.', host_prog_var) \ ]) elseif !empty(venv) @@ -366,7 +366,7 @@ function! s:check_python(version) abort call health#report_warn('Your virtualenv is not set up optimally.', [ \ printf('Create a virtualenv specifically ' \ . 'for Neovim and use `g:%s`. This will avoid ' - \ . 'the need to install Neovim''s Python module in each ' + \ . 'the need to install the pynvim module in each ' \ . 'virtualenv.', host_prog_var) \ ]) endif @@ -420,7 +420,7 @@ function! s:check_python(version) abort if s:is_bad_response(current) call health#report_error( \ "Neovim Python client is not installed.\nError: ".current, - \ ['Run in shell: pip' . a:version . ' install neovim']) + \ ['Run in shell: pip' . a:version . ' install pynvim']) endif if s:is_bad_response(latest) diff --git a/runtime/autoload/provider/pythonx.vim b/runtime/autoload/provider/pythonx.vim index b51c398410..189159ab9e 100644 --- a/runtime/autoload/provider/pythonx.vim +++ b/runtime/autoload/provider/pythonx.vim @@ -10,7 +10,7 @@ function! provider#pythonx#Require(host) abort " Python host arguments let prog = (ver == '2' ? provider#python#Prog() : provider#python3#Prog()) - let args = [prog, '-c', 'import sys; sys.path.remove(""); import neovim; neovim.start_host()'] + let args = [prog, '-c', 'import sys; sys.path.remove(""); import pynvim; pynvim.start_host()'] " Collect registered Python plugins into args let python_plugins = remote#host#PluginsForHost(a:host.name) @@ -62,17 +62,17 @@ function! s:check_interpreter(prog, major_ver) abort let min_version = (a:major_ver == 2) ? '2.6' : '3.3' - " Try to load neovim module, and output Python version. + " Try to load pynvim module, and output Python version. " Return codes: - " 0 Neovim module can be loaded. - " 2 Neovim module cannot be loaded. + " 0 pynvim module can be loaded. + " 2 pynvim module cannot be loaded. " Otherwise something else went wrong (e.g. 1 or 127). let prog_ver = system([ a:prog , '-c' , \ 'import sys; ' . \ 'sys.path.remove(""); ' . \ 'sys.stdout.write(str(sys.version_info[0]) + "." + str(sys.version_info[1])); ' . \ 'import pkgutil; ' . - \ 'exit(2*int(pkgutil.get_loader("neovim") is None))' + \ 'exit(2*int(pkgutil.get_loader("pynvim") is None))' \ ]) if v:shell_error == 2 || v:shell_error == 0 @@ -87,7 +87,7 @@ function! s:check_interpreter(prog, major_ver) abort endif if v:shell_error == 2 - return [0, prog_path.' does not have the "neovim" module. :help provider-python'] + return [0, prog_path.' does not have the "pynvim" module. :help provider-python'] elseif v:shell_error == 127 " This can happen with pyenv's shims. return [0, prog_path . ' does not exist: ' . prog_ver] -- cgit From 0c2ca48e5f27ed2dc2cecceffaa83976ee7e9e3e Mon Sep 17 00:00:00 2001 From: Marco Hinz Date: Sat, 17 Nov 2018 15:30:06 +0100 Subject: doc/python: 'neovim' module was renamed to 'pynvim' --- runtime/doc/provider.txt | 16 ++++++++-------- runtime/doc/remote_plugin.txt | 10 +++++----- 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/provider.txt b/runtime/doc/provider.txt index 0e26dc4515..058e0546cd 100644 --- a/runtime/doc/provider.txt +++ b/runtime/doc/provider.txt @@ -19,23 +19,23 @@ Note: Only the Vim 7.3 API is supported; bindeval (Vim 7.4) is not. PYTHON QUICKSTART ~ -Install the "neovim" Python package: +Install the "pynvim" Python package: - Run |:checkhealth| to see if you already have the package (some package - managers install the "neovim" Python package with Nvim itself). + managers install the "pynvim" Python package with Nvim itself). - For Python 2 plugins, make sure Python 2.7 is available in your $PATH, then install the package systemwide: > - sudo pip2 install --upgrade neovim + sudo pip2 install --upgrade pynvim < or for the current user: > - pip2 install --user --upgrade neovim + pip2 install --user --upgrade pynvim < If "pip2" is missing, try "pip". - For Python 3 plugins, make sure Python 3.4+ is available in your $PATH, then install the package systemwide: > - sudo pip3 install --upgrade neovim + sudo pip3 install --upgrade pynvim < or for the current user: > - pip3 install --user --upgrade neovim + pip3 install --user --upgrade pynvim < If "pip3" is missing, try "pip". - The `--upgrade` flag ensures you have the latest version even if a previous @@ -64,14 +64,14 @@ PYTHON VIRTUALENVS ~ If you plan to use per-project virtualenvs often, you should assign one virtualenv for Neovim and hard-code the interpreter path via -|g:python3_host_prog| (or |g:python_host_prog|) so that the "neovim" package +|g:python3_host_prog| (or |g:python_host_prog|) so that the "pynvim" package is not required for each virtualenv. Example using pyenv: > pyenv install 3.4.4 pyenv virtualenv 3.4.4 py3nvim pyenv activate py3nvim - pip install neovim + pip install pynvim pyenv which python # Note the path The last command reports the interpreter path, add it to your init.vim: > let g:python3_host_prog = '/path/to/py3nvim/bin/python' diff --git a/runtime/doc/remote_plugin.txt b/runtime/doc/remote_plugin.txt index eeb9cf8150..6a9874660b 100644 --- a/runtime/doc/remote_plugin.txt +++ b/runtime/doc/remote_plugin.txt @@ -42,15 +42,15 @@ what a Python plugin looks like. This plugin exports a command, a function, and an autocmd. The plugin is called 'Limit', and all it does is limit the number of requests made to it. Here's the plugin source code: > - import neovim + import pynvim - @neovim.plugin + @pynvim.plugin class Limit(object): def __init__(self, vim): self.vim = vim self.calls = 0 - @neovim.command('Cmd', range='', nargs='*', sync=True) + @pynvim.command('Cmd', range='', nargs='*', sync=True) def command_handler(self, args, range): self._increment_calls() self.vim.current.line = ( @@ -58,14 +58,14 @@ of requests made to it. Here's the plugin source code: args, range)) - @neovim.autocmd('BufEnter', pattern='*.py', eval='expand("")', + @pynvim.autocmd('BufEnter', pattern='*.py', eval='expand("")', sync=True) def autocmd_handler(self, filename): self._increment_calls() self.vim.current.line = ( 'Autocmd: Called %s times, file: %s' % (self.calls, filename)) - @neovim.function('Func') + @pynvim.function('Func') def function_handler(self, args): self._increment_calls() self.vim.current.line = ( -- cgit From 443cd04d5b00c57d791681065b2016cbe4228044 Mon Sep 17 00:00:00 2001 From: Marco Hinz Date: Sun, 18 Nov 2018 15:46:55 +0100 Subject: provider/python: refactoring --- runtime/autoload/provider/pythonx.vim | 48 ++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 21 deletions(-) (limited to 'runtime') diff --git a/runtime/autoload/provider/pythonx.vim b/runtime/autoload/provider/pythonx.vim index 189159ab9e..55d9db821a 100644 --- a/runtime/autoload/provider/pythonx.vim +++ b/runtime/autoload/provider/pythonx.vim @@ -54,46 +54,52 @@ function! provider#pythonx#Detect(major_ver) abort \ . ":\n" . join(errors, "\n")] endfunction -function! s:check_interpreter(prog, major_ver) abort +" Returns array: [interpreter_exitcode, interpreter_version] +function! s:check_for_package(prog, package) abort + let prog_version = system([a:prog, '-c' , printf( + \ 'import sys; ' . + \ 'sys.path.remove(""); ' . + \ 'sys.stdout.write(str(sys.version_info[0]) + "." + str(sys.version_info[1])); ' . + \ 'import pkgutil; ' . + \ 'exit(2*int(pkgutil.get_loader("%s") is None))', + \ a:package)]) + return [v:shell_error, prog_version] +endfunction + +function! s:check_interpreter(prog, major_version) abort let prog_path = exepath(a:prog) if prog_path ==# '' return [0, a:prog . ' not found in search path or not executable.'] endif - let min_version = (a:major_ver == 2) ? '2.6' : '3.3' + let min_version = (a:major_version == 2) ? '2.6' : '3.3' " Try to load pynvim module, and output Python version. - " Return codes: + " Exit codes: " 0 pynvim module can be loaded. " 2 pynvim module cannot be loaded. " Otherwise something else went wrong (e.g. 1 or 127). - let prog_ver = system([ a:prog , '-c' , - \ 'import sys; ' . - \ 'sys.path.remove(""); ' . - \ 'sys.stdout.write(str(sys.version_info[0]) + "." + str(sys.version_info[1])); ' . - \ 'import pkgutil; ' . - \ 'exit(2*int(pkgutil.get_loader("pynvim") is None))' - \ ]) + let [prog_exitcode, prog_version] = s:check_for_package(a:prog, 'pynvim') - if v:shell_error == 2 || v:shell_error == 0 + if prog_exitcode == 2 || prog_exitcode == 0 " Check version only for expected return codes. - if prog_ver !~ '^' . a:major_ver - return [0, prog_path . ' is Python ' . prog_ver . ' and cannot provide Python ' - \ . a:major_ver . '.'] - elseif prog_ver =~ '^' . a:major_ver && prog_ver < min_version - return [0, prog_path . ' is Python ' . prog_ver . ' and cannot provide Python >= ' + if prog_version !~ '^' . a:major_version + return [0, prog_path . ' is Python ' . prog_version . ' and cannot provide Python ' + \ . a:major_version . '.'] + elseif prog_version =~ '^' . a:major_version && prog_version < min_version + return [0, prog_path . ' is Python ' . prog_version . ' and cannot provide Python >= ' \ . min_version . '.'] endif endif - if v:shell_error == 2 + if prog_exitcode == 2 return [0, prog_path.' does not have the "pynvim" module. :help provider-python'] - elseif v:shell_error == 127 + elseif prog_exitcode == 127 " This can happen with pyenv's shims. - return [0, prog_path . ' does not exist: ' . prog_ver] - elseif v:shell_error + return [0, prog_path . ' does not exist: ' . prog_version] + elseif prog_exitcode return [0, 'Checking ' . prog_path . ' caused an unknown error. ' - \ . '(' . v:shell_error . ', output: ' . prog_ver . ')' + \ . '(' . prog_exitcode . ', output: ' . prog_version . ')' \ . ' Report this at https://github.com/neovim/neovim'] endif -- cgit From 57fef7c74dca1059e45ec9c061555f22af8973cf Mon Sep 17 00:00:00 2001 From: Marco Hinz Date: Sun, 18 Nov 2018 21:38:34 +0100 Subject: health/python: slightly improve output --- runtime/autoload/health/provider.vim | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'runtime') diff --git a/runtime/autoload/health/provider.vim b/runtime/autoload/health/provider.vim index a99b600aba..d4e4badb91 100644 --- a/runtime/autoload/health/provider.vim +++ b/runtime/autoload/health/provider.vim @@ -410,16 +410,16 @@ function! s:check_python(version) abort call health#report_warn('Python 3.3+ is recommended.') endif - call health#report_info('Python'.a:version.' version: ' . pyversion) + call health#report_info('Python version: ' . pyversion) if s:is_bad_response(status) - call health#report_info(printf('%s-neovim version: %s (%s)', pyname, current, status)) + call health#report_info(printf('pynvim version: %s (%s)', current, status)) else - call health#report_info(printf('%s-neovim version: %s', pyname, current)) + call health#report_info(printf('pynvim version: %s', current)) endif if s:is_bad_response(current) call health#report_error( - \ "Neovim Python client is not installed.\nError: ".current, + \ "pynvim is not installed.\nError: ".current, \ ['Run in shell: pip' . a:version . ' install pynvim']) endif @@ -427,11 +427,9 @@ function! s:check_python(version) abort call health#report_warn('Could not contact PyPI to get latest version.') call health#report_error('HTTP request failed: '.latest) elseif s:is_bad_response(status) - call health#report_warn(printf('Latest %s-neovim is NOT installed: %s', - \ pyname, latest)) + call health#report_warn(printf('Latest pynvim is NOT installed: %s', latest)) elseif !s:is_bad_response(current) - call health#report_ok(printf('Latest %s-neovim is installed: %s', - \ pyname, latest)) + call health#report_ok(printf('Latest pynvim is installed.')) endif endif -- cgit From deb18a050ef522791c48c7c8c549a2c4b2043be0 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Tue, 20 Nov 2018 10:52:49 +0100 Subject: defaults: background=dark #2894 (#9205) By historical accident, Nvim defaults to background=light. So on a dark background, `:colorscheme default` looks completely wrong. The "smart" logic that Vim uses is confusing for anyone who uses Vim on multiple platforms, so rather than mimic that, pick the (hopefully) most common default. - Since Neovim is dark-powered, we assume most users have dark backgrounds. - Most of the GUIs tend to have a dark background by default. ref #6289 --- runtime/doc/options.txt | 43 ++++++++++--------------------------------- runtime/doc/vim_diff.txt | 1 + 2 files changed, 11 insertions(+), 33 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index d1e84c5aec..29d9a60aa2 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -703,47 +703,24 @@ A jump table for the options with a short description can be found at |Q_op|. been set. *'background'* *'bg'* -'background' 'bg' string (default "dark" or "light", see below) - global - When set to "dark", Vim will try to use colors that look good on a - dark background. When set to "light", Vim will try to use colors that - look good on a light background. Any other value is illegal. - Vim tries to set the default value according to the terminal used. - This will not always be correct. - Setting this option does not change the background color, it tells Vim - what the background color looks like. For changing the background - color, see |:hi-normal|. - - When 'background' is set Vim will adjust the default color groups for - the new value. But the colors used for syntax highlighting will not - change. *g:colors_name* +'background' 'bg' string (default "dark") + global + When set to "dark" or "light", Nvim will adjust the default color + groups for a dark or light background, respectively. + + This option does NOT change the background color, it tells Nvim what + the "inherited" (terminal/GUI) background looks like. + See |:hi-normal| if you want to set the background color explicitly. + *g:colors_name* When a color scheme is loaded (the "g:colors_name" variable is set) setting 'background' will cause the color scheme to be reloaded. If the color scheme adjusts to the value of 'background' this will work. However, if the color scheme sets 'background' itself the effect may be undone. First delete the "g:colors_name" variable when needed. - When setting 'background' to the default value with: > - :set background& -< Vim will guess the value. In the GUI this should work correctly, - in other cases Vim might not be able to guess the right value. - - When starting the GUI, the default value for 'background' will be - "light". When the value is not set in the gvimrc, and Vim detects - that the background is actually quite dark, 'background' is set to - "dark". But this happens only AFTER the gvimrc file has been read - (because the window needs to be opened to find the actual background - color). To get around this, force the GUI window to be opened by - putting a ":gui" command in the gvimrc file, before where the value - of 'background' is used (e.g., before ":syntax on"). - - For Windows the default is "dark". "dark" should be used if $COLORFGBG - suggests a dark background (not yet implemented). Otherwise the default - is "light". - Normally this option would be set in the vimrc file. Possibly depending on the terminal name. Example: > - :if $TERM == "xterm" + :if $TERM ==# "xterm" : set background=dark :endif < When this option is set, the default settings for the highlight groups diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index 4fbfb0d7a0..3915763eed 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -27,6 +27,7 @@ a complete and centralized reference of those differences. - 'autoindent' is set by default - 'autoread' is set by default +- 'background' always defaults to "dark" - 'backspace' defaults to "indent,eol,start" - 'backupdir' defaults to .,~/.local/share/nvim/backup (|xdg|) - 'belloff' defaults to "all" -- cgit From f1a787d292d1508ffebb2b70f6c9f86fc84044b9 Mon Sep 17 00:00:00 2001 From: Marco Hinz Date: Tue, 20 Nov 2018 09:57:43 +0100 Subject: health/python: warn if pynvim upgrade failed Reference: https://github.com/neovim/neovim/wiki/Following-HEAD#20181118 --- runtime/autoload/health/provider.vim | 13 ++++++++++++- runtime/autoload/provider/pythonx.vim | 13 +++++++------ 2 files changed, 19 insertions(+), 7 deletions(-) (limited to 'runtime') diff --git a/runtime/autoload/health/provider.vim b/runtime/autoload/health/provider.vim index d4e4badb91..9cd8b3801b 100644 --- a/runtime/autoload/health/provider.vim +++ b/runtime/autoload/health/provider.vim @@ -400,6 +400,8 @@ function! s:check_python(version) abort endfor endif + let pip = 'pip' . (a:version == 2 ? '' : '3') + if !empty(python_bin) let [pyversion, current, latest, status] = s:version_info(python_bin) if a:version != str2nr(pyversion) @@ -415,12 +417,21 @@ function! s:check_python(version) abort call health#report_info(printf('pynvim version: %s (%s)', current, status)) else call health#report_info(printf('pynvim version: %s', current)) + let [module_found, _msg] = provider#pythonx#CheckForModule(python_bin, + \ 'neovim', a:version) + if !module_found + call health#report_error('Importing "neovim" failed.', + \ "Reinstall \"pynvim\" and optionally \"neovim\" packages.\n" . + \ pip ." uninstall pynvim neovim\n" . + \ pip ." install pynvim\n" . + \ pip ." install neovim # only if needed by third-party software") + endif endif if s:is_bad_response(current) call health#report_error( \ "pynvim is not installed.\nError: ".current, - \ ['Run in shell: pip' . a:version . ' install pynvim']) + \ ['Run in shell: '. pip .' install pynvim']) endif if s:is_bad_response(latest) diff --git a/runtime/autoload/provider/pythonx.vim b/runtime/autoload/provider/pythonx.vim index 55d9db821a..258aff61b3 100644 --- a/runtime/autoload/provider/pythonx.vim +++ b/runtime/autoload/provider/pythonx.vim @@ -40,7 +40,7 @@ function! provider#pythonx#Detect(major_ver) abort let errors = [] for prog in progs - let [result, err] = s:check_interpreter(prog, a:major_ver) + let [result, err] = provider#pythonx#CheckForModule(prog, 'pynvim', a:major_ver) if result return [prog, err] endif @@ -54,19 +54,20 @@ function! provider#pythonx#Detect(major_ver) abort \ . ":\n" . join(errors, "\n")] endfunction -" Returns array: [interpreter_exitcode, interpreter_version] -function! s:check_for_package(prog, package) abort +" Returns array: [prog_exitcode, prog_version] +function! s:import_module(prog, module) abort let prog_version = system([a:prog, '-c' , printf( \ 'import sys; ' . \ 'sys.path.remove(""); ' . \ 'sys.stdout.write(str(sys.version_info[0]) + "." + str(sys.version_info[1])); ' . \ 'import pkgutil; ' . \ 'exit(2*int(pkgutil.get_loader("%s") is None))', - \ a:package)]) + \ a:module)]) return [v:shell_error, prog_version] endfunction -function! s:check_interpreter(prog, major_version) abort +" Returns array: [was_success, error_message] +function! provider#pythonx#CheckForModule(prog, module, major_version) abort let prog_path = exepath(a:prog) if prog_path ==# '' return [0, a:prog . ' not found in search path or not executable.'] @@ -79,7 +80,7 @@ function! s:check_interpreter(prog, major_version) abort " 0 pynvim module can be loaded. " 2 pynvim module cannot be loaded. " Otherwise something else went wrong (e.g. 1 or 127). - let [prog_exitcode, prog_version] = s:check_for_package(a:prog, 'pynvim') + let [prog_exitcode, prog_version] = s:import_module(a:prog, 'pynvim') if prog_exitcode == 2 || prog_exitcode == 0 " Check version only for expected return codes. -- cgit From 108566e7b6f1b331dac8e339280c230bf39c137d Mon Sep 17 00:00:00 2001 From: Bjorn Neergaard Date: Wed, 21 Nov 2018 04:24:40 -0700 Subject: clipboard.vim: check for win32yank.exe #9263 Win32 allows omitting the `.exe` extension, but WSL does not. --- runtime/autoload/provider/clipboard.vim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'runtime') diff --git a/runtime/autoload/provider/clipboard.vim b/runtime/autoload/provider/clipboard.vim index b763d28570..0c65198d78 100644 --- a/runtime/autoload/provider/clipboard.vim +++ b/runtime/autoload/provider/clipboard.vim @@ -101,9 +101,9 @@ function! provider#clipboard#Executable() abort let s:copy['*'] = s:copy['+'] let s:paste['*'] = s:paste['+'] return 'doitclient' - elseif executable('win32yank') - let s:copy['+'] = 'win32yank -i --crlf' - let s:paste['+'] = 'win32yank -o --lf' + elseif executable('win32yank.exe') + let s:copy['+'] = 'win32yank.exe -i --crlf' + let s:paste['+'] = 'win32yank.exe -o --lf' let s:copy['*'] = s:copy['+'] let s:paste['*'] = s:paste['+'] return 'win32yank' -- cgit From 30857030e848e4a727a889e51d4618ab9b30651f Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Fri, 16 Nov 2018 02:00:04 +0100 Subject: doc - develop.txt is for design/guidelines; architecture/concepts should live elsewhere (currently src/nvim/README.md) - move dev-jargon to intro.txt - replace https://neovim.io/community (deprecated) with https://neovim.io/#chat - avoids CmdlineEnter/Leave https://github.com/vim/vim/issues/2889 --- runtime/doc/api.txt | 96 +++++++++++++++++++++++++++++++++++-------------- runtime/doc/autocmd.txt | 18 +++++----- runtime/doc/develop.txt | 48 ++++--------------------- runtime/doc/help.txt | 1 + runtime/doc/intro.txt | 39 ++++++++++++++------ runtime/doc/map.txt | 3 ++ 6 files changed, 117 insertions(+), 88 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index e16b6b7e75..66fb5bda82 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -478,6 +478,9 @@ nvim_err_writeln({str}) *nvim_err_writeln()* nvim_list_bufs() *nvim_list_bufs()* Gets the current list of buffer handles + Includes unlisted (unloaded/deleted) buffers, like `:ls!`. Use + |nvim_buf_is_loaded()| to check if a buffer is loaded. + Return: ~ List of buffer handles @@ -529,6 +532,30 @@ nvim_set_current_tabpage({tabpage}) *nvim_set_current_tabpage()* Parameters: ~ {tabpage} Tabpage handle +nvim_create_namespace({name}) *nvim_create_namespace()* + create a new namespace, or get one with an exisiting name + + Namespaces are currently used for buffer highlighting and + virtual text, see |nvim_buf_add_highlight| and + |nvim_buf_set_virtual_text|. + + Namespaces can have a name of be anonymous. If `name` is a + non-empty string, and a namespace already exists with that + name,the existing namespace id is returned. If an empty string + is used, a new anonymous namespace is returned. + + Parameters: ~ + {name} Name of the namespace or empty string + + Return: ~ + the namespace id + +nvim_get_namespaces() *nvim_get_namespaces()* + Get existing named namespaces + + Return: ~ + dict that maps from names to namespace ids. + nvim_subscribe({event}) *nvim_subscribe()* Subscribes to event broadcasts @@ -1082,35 +1109,36 @@ nvim_buf_get_mark({buffer}, {name}) *nvim_buf_get_mark()* (row, col) tuple *nvim_buf_add_highlight()* -nvim_buf_add_highlight({buffer}, {src_id}, {hl_group}, {line}, +nvim_buf_add_highlight({buffer}, {ns_id}, {hl_group}, {line}, {col_start}, {col_end}) Adds a highlight to buffer. Useful for plugins that dynamically generate highlights to a buffer (like a semantic highlighter or linter). The function - adds a single highlight to a buffer. Unlike matchaddpos() + adds a single highlight to a buffer. Unlike |matchaddpos()| highlights follow changes to line numbering (as lines are inserted/removed above the highlighted line), like signs and marks do. - `src_id` is useful for batch deletion/updating of a set of - highlights. When called with `src_id = 0`, an unique source id - is generated and returned. Successive calls can pass that - `src_id` to associate new highlights with the same source - group. All highlights in the same group can be cleared with - `nvim_buf_clear_highlight`. If the highlight never will be - manually deleted, pass `src_id = -1`. + Namespaces are used for batch deletion/updating of a set of + highlights. To create a namespace, use |nvim_create_namespace| + which returns a namespace id. Pass it in to this function as + `ns_id` to add highlights to the namespace. All highlights in + the same namespace can then be cleared with single call to + |nvim_buf_clear_highlight|. If the highlight never will be + deleted by an API call, pass `ns_id = -1`. - If `hl_group` is the empty string no highlight is added, but a - new `src_id` is still returned. This is useful for an external - plugin to synchrounously request an unique `src_id` at - initialization, and later asynchronously add and clear - highlights in response to buffer changes. + As a shorthand, `ns_id = 0` can be used to create a new + namespace for the highlight, the allocated id is then + returned. If `hl_group` is the empty string no highlight is + added, but a new `ns_id` is still returned. This is supported + for backwards compatibility, new code should use + |nvim_create_namespace| to create a new empty namespace. Parameters: ~ {buffer} Buffer handle - {src_id} Source group to use or 0 to use a new group, - or -1 for ungrouped highlight + {ns_id} namespace to use or -1 for ungrouped + highlight {hl_group} Name of the highlight group to use {line} Line to highlight (zero-indexed) {col_start} Start of (byte-indexed) column range to @@ -1119,10 +1147,10 @@ nvim_buf_add_highlight({buffer}, {src_id}, {hl_group}, {line}, highlight, or -1 to highlight to end of line Return: ~ - The src_id that was used + The ns_id that was used *nvim_buf_clear_highlight()* -nvim_buf_clear_highlight({buffer}, {src_id}, {line_start}, {line_end}) +nvim_buf_clear_highlight({buffer}, {ns_id}, {line_start}, {line_end}) Clears highlights and virtual text from a given source id and range of lines @@ -1131,15 +1159,13 @@ nvim_buf_clear_highlight({buffer}, {src_id}, {line_start}, {line_end}) Parameters: ~ {buffer} Buffer handle - {src_id} Highlight source group to clear, or -1 to - clear all. + {ns_id} Namespace to clear, or -1 to clear all. {line_start} Start of range of lines to clear {line_end} End of range of lines to clear (exclusive) or -1 to clear to end of file. *nvim_buf_set_virtual_text()* -nvim_buf_set_virtual_text({buffer}, {src_id}, {line}, {chunks}, - {opts}) +nvim_buf_set_virtual_text({buffer}, {ns_id}, {line}, {chunks}, {opts}) Set the virtual text (annotation) for a buffer line. By default (and currently the only option) the text will be @@ -1149,13 +1175,22 @@ nvim_buf_set_virtual_text({buffer}, {src_id}, {line}, {chunks}, the right of the ordinary text, this will contain the |lcs- eol| char if set, otherwise just be a space. - The same src_id can be used for both virtual text and - highlights added by nvim_buf_add_highlight. Virtual text is - cleared using nvim_buf_clear_highlight. + Namespaces are used to support batch deletion/updating of + virtual text. To create a namespace, use + |nvim_create_namespace|. Virtual text is cleared using + |nvim_buf_clear_highlight|. The same `ns_id` can be used for + both virtual text and highlights added by + |nvim_buf_add_highlight|, both can then be cleared with a + single call to |nvim_buf_clear_highlight|. If the virtual text + never will be cleared by an API call, pass `src_id = -1`. + + As a shorthand, `ns_id = 0` can be used to create a new + namespace for the virtual text, the allocated id is then + returned. Parameters: ~ {buffer} Buffer handle - {src_id} Source group to use or 0 to use a new group, or + {ns_id} Namespace to use or 0 to create a namespace, or -1 for a ungrouped annotation {line} Line to annotate with virtual text (zero- indexed) @@ -1166,7 +1201,7 @@ nvim_buf_set_virtual_text({buffer}, {src_id}, {line}, {chunks}, {opts} Optional parameters. Currently not used. Return: ~ - The src_id that was used + The ns_id that was used ============================================================================== @@ -1181,6 +1216,13 @@ nvim_win_get_buf({window}) *nvim_win_get_buf()* Return: ~ Buffer handle +nvim_win_set_buf({window}, {buffer}) *nvim_win_set_buf()* + Sets the current buffer in a window, without side-effects + + Parameters: ~ + {window} Window handle + {buffer} Buffer handle + nvim_win_get_cursor({window}) *nvim_win_get_cursor()* Gets the cursor position in the window diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt index a2772e2485..4702656c41 100644 --- a/runtime/doc/autocmd.txt +++ b/runtime/doc/autocmd.txt @@ -526,20 +526,18 @@ CmdlineChanged After a change was made to the text in the command line. Be careful not to mess up the command line, it may cause Vim to lock up. *CmdlineEnter* -CmdlineEnter After moving the cursor to the command line, - where the user can type a command or search - string. - is set to a single character, - indicating the type of command-line. - |cmdline-char| +CmdlineEnter After entering the command-line (including + non-interactive use of ":" in a mapping: use + || instead to avoid this). + is set to the |cmdline-char|. Sets these |v:event| keys: cmdlevel cmdtype *CmdlineLeave* -CmdlineLeave Before leaving the command line. - is set to a single character, - indicating the type of command-line. - |cmdline-char| +CmdlineLeave Before leaving the command-line (including + non-interactive use of ":" in a mapping: use + || instead to avoid this). + is set to the |cmdline-char|. Sets these |v:event| keys: abort (mutable) cmdlevel diff --git a/runtime/doc/develop.txt b/runtime/doc/develop.txt index cd81236f32..bcf43142ad 100644 --- a/runtime/doc/develop.txt +++ b/runtime/doc/develop.txt @@ -6,19 +6,20 @@ Development of Nvim *development* -Nvim is open source software. Everybody is encouraged to contribute. - https://github.com/neovim/neovim/blob/master/CONTRIBUTING.md +This reference describes design constraints and guidelines, for developing +Nvim applications or Nvim itself. +Architecture and internal concepts are covered in src/nvim/README.md -See src/nvim/README.md for an overview of the source code. +Nvim is free and open source. Everybody is encouraged to contribute. + https://github.com/neovim/neovim/blob/master/CONTRIBUTING.md Type |gO| to see the table of contents. ============================================================================== Design goals *design-goals* -Most important things come first (roughly). - -Note that some items conflict; this is intentional. A balance must be found. +Most important things come first (roughly). Some items conflict; this is +intentional. A balance must be found. NVIM IS... IMPROVED *design-improved* @@ -81,41 +82,6 @@ include the kitchen sink... but it's good for plumbing." Developer guidelines *dev* -JARGON *dev-jargon* - -API client ~ -All external UIs and remote plugins (as opposed to regular Vim plugins) are -"clients" in general; but we call something an "API client" if its purpose is -to abstract or wrap the RPC API for the convenience of other applications -(just like a REST client or SDK such as boto3 for AWS: you can speak AWS REST -using an HTTP client like curl, but boto3 wraps that in a convenient python -interface). For example, the Nvim lua-client is an API client: - https://github.com/neovim/lua-client - -Host ~ -A plugin "host" is both a client (of the Nvim API) and a server (of an -external platform, e.g. python). It is a remote plugin that hosts other -plugins. - -Remote plugin ~ -Arbitrary code registered via |:UpdateRemotePlugins|, that runs in a separate -process and communicates with Nvim via the |api|. - -Window ~ -The word "window" is commonly used for several things: A window on the screen, -the xterm window, a window inside Vim to view a buffer. -To avoid confusion, other items that are sometimes called window have been -given another name. Here is an overview of the related items: - -screen The whole display. -shell The Vim application. This can cover the whole screen (e.g., - when running in a console) or part of it (xterm or GUI). -window View on a buffer. There can be several windows in Vim, - together with the command line, menubar, toolbar, etc. they - fit in the shell. -frame Windows are kept in a tree of frames. Each frame contains - a column, row, or window ("leaf" frame). - PROVIDERS *dev-provider* A goal of Nvim is to allow extension of the editor without special knowledge diff --git a/runtime/doc/help.txt b/runtime/doc/help.txt index c2ad25aeda..edecc655dd 100644 --- a/runtime/doc/help.txt +++ b/runtime/doc/help.txt @@ -150,6 +150,7 @@ GUI ~ Interfaces ~ |if_cscop.txt| using Cscope with Vim +|if_lua.txt| Lua interface |if_pyth.txt| Python interface |if_ruby.txt| Ruby interface |sign.txt| debugging signs diff --git a/runtime/doc/intro.txt b/runtime/doc/intro.txt index b74079e74e..fee7d9aa69 100644 --- a/runtime/doc/intro.txt +++ b/runtime/doc/intro.txt @@ -94,7 +94,7 @@ For the most recent information about sponsoring look on the Vim web site: Neovim development is funded separately from Vim: - https://neovim.io/sponsors/ + https://neovim.io/#sponsor ============================================================================== Credits *credits* *author* *Bram* *Moolenaar* @@ -702,18 +702,15 @@ window. You may make the window as small as you like, but if it gets too small not a single line will fit in it. Make it at least 40 characters wide to be able to read most messages on the last line. -On most Unix systems, resizing the window is recognized and handled correctly -by Vim. - ============================================================================== -Definitions *definitions* +Definitions *definitions* *jargon* - buffer Contains lines of text, usually read from a file. - screen The whole area that Vim uses to work in. This can be - a terminal emulator window. Also called "the Vim - window". + buffer Contains lines of text, usually from a file. + screen The whole area that Nvim uses to display things. window A view on a buffer. There can be multiple windows for one buffer. + frame Windows are kept in a tree of frames. Each frame + contains a column, row, or window ("leaf" frame). A screen contains one or more windows, separated by status lines and with the command line at the bottom. @@ -746,7 +743,7 @@ A difference is made between four types of lines: lines with wrapping, line breaks, etc. applied. They can only be as long as the width of the window allows, longer lines are wrapped or truncated. - screen lines The lines of the screen that Vim uses. Consists of + screen lines The lines of the screen that Nvim uses. Consists of the window lines of all windows, with status lines and the command line added. They can only be as long as the width of the screen allows. When the command @@ -770,5 +767,27 @@ buffer lines logical lines window lines screen lines ~ 5. ddd 13. (command line) 6. ~ + +API client ~ +All external UIs and remote plugins (as opposed to regular Vim plugins) are +"clients" in general; but we call something an "API client" if its purpose is +to abstract or wrap the RPC API for the convenience of other applications +(just like a REST client or SDK such as boto3 for AWS: you can speak AWS REST +using an HTTP client like curl, but boto3 wraps that in a convenient python +interface). For example, the Nvim lua-client is an API client: + https://github.com/neovim/lua-client + + +Host ~ +A plugin "host" is both a client (of the Nvim API) and a server (of an +external platform, e.g. python). It is a remote plugin that hosts other +plugins. + + +Remote plugin ~ +Arbitrary code registered via |:UpdateRemotePlugins|, that runs in a separate +process and communicates with Nvim via the |api|. + + ============================================================================== vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt index 30e7f644b3..fa5e10b5e5 100644 --- a/runtime/doc/map.txt +++ b/runtime/doc/map.txt @@ -286,6 +286,9 @@ current mode (instead of always going to normal-mode). Visual-mode is preserved, so tricks with |gv| are not needed. Commands can be invoked directly in cmdline-mode (which otherwise would require timer hacks). +Because avoids mode-changes (unlike ":") it does not trigger +|CmdlineEnter| and |CmdlineLeave| events. This helps performance. + Unlike mappings, there are no special restrictions on the command: it is executed as if an (unrestricted) |autocmd| was invoked or an async event event was processed. -- cgit From 519224f6bd248b419d16720d23417c6ed8df447b Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 19 Nov 2018 21:53:19 +0100 Subject: matchit.vim: s:MultiMatch(): return Dict --- runtime/plugin/matchit.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime') diff --git a/runtime/plugin/matchit.vim b/runtime/plugin/matchit.vim index 3b0a8112dc..c160522f90 100644 --- a/runtime/plugin/matchit.vim +++ b/runtime/plugin/matchit.vim @@ -716,7 +716,7 @@ fun! s:MultiMatch(spflag, mode) execute "if " . skip . "| let skip = '0' | endif" catch /^Vim\%((\a\+)\)\=:E363/ " We won't find anything, so skip searching, should keep Vim responsive. - return + return {} endtry endif mark ' -- cgit From a9e368a7050c86dff36d80dc1cced21de14dd3ac Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Fri, 30 Nov 2018 22:43:08 -0500 Subject: vim-patch:8.1.0553: it is not easy to edit a script that was sourced (#9298) Problem: It is not easy to edit a script that was sourced. Solution: Add a count to ":scriptnames", so that ":script 40" edits the script with script ID 40. https://github.com/vim/vim/commit/07dc18ffa4e7ed202f219fe2fd3d6f58246f71f9 --- runtime/doc/repeat.txt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'runtime') diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt index 82a8c4c5cc..23ae3458ea 100644 --- a/runtime/doc/repeat.txt +++ b/runtime/doc/repeat.txt @@ -305,6 +305,9 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|. first sourced. The number is used for the script ID ||. +:scr[iptnames][!] {scriptId} *:script* + Edit script {scriptId}. Suggested name is ":script". + *:fini* *:finish* *E168* :fini[sh] Stop sourcing a script. Can only be used in a Vim script file. This is a quick way to skip the rest of -- cgit From 0f00f31cbd9b13b41a0d3d976d192bbbeac9cbe8 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sat, 1 Dec 2018 02:41:31 +0100 Subject: VimL/confirm(): Show dialog even if :silent closes #8788 related #9034 --- runtime/doc/various.txt | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt index 5f40ccf2ec..d78dd90f18 100644 --- a/runtime/doc/various.txt +++ b/runtime/doc/various.txt @@ -517,14 +517,9 @@ m *+xim* X input method |xim| :silent! /^begin :if v:errmsg != "" : ... pattern was not found -< ":silent" will also avoid the hit-enter prompt. When - using this for an external command, this may cause the - screen to be messed up. Use |CTRL-L| to clean it up - then. - ":silent menu ..." defines a menu that will not echo a - Command-line command. The command will still produce - messages though. Use ":silent" in the command itself - to avoid that: ":silent menu .... :silent command". +< ":silent" also skips the hit-enter prompt. + Dialogs that prompt for user input (|confirm()|, + 'swapfile', …) are never silent. *:uns* *:unsilent* :uns[ilent] {command} Execute {command} not silently. Only makes a -- cgit From 30940f809b1e6dbd4de4f3e76fdb5336d06cd20a Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sat, 1 Dec 2018 15:32:41 +0100 Subject: doc: deprecate inputdialog() input() is functionally equivalent. GUI support for dialogs is implicit and does not depend on choosing inputdialog() vs input(). --- runtime/doc/deprecated.txt | 1 + runtime/doc/eval.txt | 16 ---------------- 2 files changed, 1 insertion(+), 16 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/deprecated.txt b/runtime/doc/deprecated.txt index 92a6bd6b4f..4369ad7894 100644 --- a/runtime/doc/deprecated.txt +++ b/runtime/doc/deprecated.txt @@ -37,6 +37,7 @@ Functions ~ *file_readable()* Obsolete name for |filereadable()|. *highlight_exists()* Obsolete name for |hlexists()|. *highlightID()* Obsolete name for |hlID()|. +*inputdialog()* Use |input()| instead. *jobclose()* Obsolete name for |chanclose()| *jobsend()* Obsolete name for |chansend()| *last_buffer_nr()* Obsolete name for bufnr("$"). diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 91986a9442..9bd73df7fe 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -2137,8 +2137,6 @@ index({list}, {expr} [, {start} [, {ic}]]) Number index in {list} where {expr} appears input({prompt} [, {text} [, {completion}]]) String get input from the user -inputdialog({prompt} [, {text} [, {completion}]]) - String like input() but in a GUI dialog inputlist({textlist}) Number let the user pick from a choice list inputrestore() Number restore typeahead inputsave() Number save and clear typeahead @@ -4915,20 +4913,6 @@ input({opts}) : call inputrestore() :endfunction -inputdialog({prompt} [, {text} [, {cancelreturn}]]) *inputdialog()* -inputdialog({opts}) - Like |input()|, but when the GUI is running and text dialogs - are supported, a dialog window pops up to input the text. - Example: > - :let n = inputdialog("value for shiftwidth", shiftwidth()) - :if n != "" - : let &sw = n - :endif -< When the dialog is cancelled {cancelreturn} is returned. When - omitted an empty string is returned. - Hitting works like pressing the OK button. Hitting - works like pressing the Cancel button. - inputlist({textlist}) *inputlist()* {textlist} must be a |List| of strings. This |List| is displayed, one string per line. The user will be prompted to -- cgit From 799d9c32157c841c3b8d355fa98a5ace435eef07 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sat, 1 Dec 2018 18:50:26 +0100 Subject: clipboard: Prefer xclip (#9302) The order was swapped in #4150 to prefer `xsel` but there wasn't a clear explanation. Meanwhile, `xsel` has been neglected upstream. Let's trying preferring `xclip` again, we've had a few reports of problems with `xsel`. closes #7237 ref #5853 ref #7449 --- runtime/autoload/provider/clipboard.vim | 12 ++++++------ runtime/doc/provider.txt | 5 +++-- 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'runtime') diff --git a/runtime/autoload/provider/clipboard.vim b/runtime/autoload/provider/clipboard.vim index 0c65198d78..0ddfdf7e49 100644 --- a/runtime/autoload/provider/clipboard.vim +++ b/runtime/autoload/provider/clipboard.vim @@ -77,18 +77,18 @@ function! provider#clipboard#Executable() abort let s:copy['*'] = 'wl-copy --foreground --primary' let s:paste['*'] = 'wl-paste --no-newline --primary' return 'wl-copy' - elseif exists('$DISPLAY') && executable('xsel') && s:cmd_ok('xsel -o -b') - let s:copy['+'] = 'xsel --nodetach -i -b' - let s:paste['+'] = 'xsel -o -b' - let s:copy['*'] = 'xsel --nodetach -i -p' - let s:paste['*'] = 'xsel -o -p' - return 'xsel' elseif exists('$DISPLAY') && executable('xclip') let s:copy['+'] = 'xclip -quiet -i -selection clipboard' let s:paste['+'] = 'xclip -o -selection clipboard' let s:copy['*'] = 'xclip -quiet -i -selection primary' let s:paste['*'] = 'xclip -o -selection primary' return 'xclip' + elseif exists('$DISPLAY') && executable('xsel') && s:cmd_ok('xsel -o -b') + let s:copy['+'] = 'xsel --nodetach -i -b' + let s:paste['+'] = 'xsel -o -b' + let s:copy['*'] = 'xsel --nodetach -i -p' + let s:paste['*'] = 'xsel -o -p' + return 'xsel' elseif executable('lemonade') let s:copy['+'] = 'lemonade copy' let s:paste['+'] = 'lemonade paste' diff --git a/runtime/doc/provider.txt b/runtime/doc/provider.txt index 058e0546cd..4de411a60e 100644 --- a/runtime/doc/provider.txt +++ b/runtime/doc/provider.txt @@ -150,9 +150,10 @@ The presence of a working clipboard tool implicitly enables the '+' and '*' registers. Nvim looks for these clipboard tools, in order of priority: - |g:clipboard| - - pbcopy/pbpaste (macOS) - - xsel (if $DISPLAY is set) + - pbcopy, pbpaste (macOS) + - wl-copy, wl-paste (if $WAYLAND_DISPLAY is set) - xclip (if $DISPLAY is set) + - xsel (if $DISPLAY is set) - lemonade (for SSH) https://github.com/pocke/lemonade - doitclient (for SSH) http://www.chiark.greenend.org.uk/~sgtatham/doit/ - win32yank (Windows) -- cgit From 07ad5d71ab97a84dc9c59b3507bf7898040d24cf Mon Sep 17 00:00:00 2001 From: Rui Abreu Ferreira Date: Sat, 1 Dec 2018 15:30:50 +0000 Subject: clipboard: Support custom VimL functions #9304 Up to now g:clipboard["copy"] only supported string values invoked as system commands. This commit enables the use of VimL functions instead. The function signatures are the same as in provider/clipboard.vim. A clipboard provider is expected to store and return a list of lines (i.e. the text) and a register type (as seen in setreg()). cache_enabled is ignored if "copy" is provided by a VimL function. --- runtime/autoload/provider/clipboard.vim | 25 ++++++++++++++++++++++--- runtime/doc/provider.txt | 27 ++++++++++++++++++++++++--- 2 files changed, 46 insertions(+), 6 deletions(-) (limited to 'runtime') diff --git a/runtime/autoload/provider/clipboard.vim b/runtime/autoload/provider/clipboard.vim index 0ddfdf7e49..8bbb72f933 100644 --- a/runtime/autoload/provider/clipboard.vim +++ b/runtime/autoload/provider/clipboard.vim @@ -55,11 +55,22 @@ endfunction function! provider#clipboard#Executable() abort if exists('g:clipboard') if type({}) isnot# type(g:clipboard) - \ || type({}) isnot# type(get(g:clipboard, 'copy', v:null)) - \ || type({}) isnot# type(get(g:clipboard, 'paste', v:null)) let s:err = 'clipboard: invalid g:clipboard' return '' endif + + if type(get(g:clipboard, 'copy', v:null)) isnot# v:t_dict + \ && type(get(g:clipboard, 'copy', v:null)) isnot# v:t_func + let s:err = "clipboard: invalid g:clipboard['copy']" + return '' + endif + + if type(get(g:clipboard, 'paste', v:null)) isnot# v:t_dict + \ && type(get(g:clipboard, 'paste', v:null)) isnot# v:t_func + let s:err = "clipboard: invalid g:clipboard['paste']" + return '' + endif + let s:copy = get(g:clipboard, 'copy', { '+': v:null, '*': v:null }) let s:paste = get(g:clipboard, 'paste', { '+': v:null, '*': v:null }) let s:cache_enabled = get(g:clipboard, 'cache_enabled', 0) @@ -127,7 +138,9 @@ if empty(provider#clipboard#Executable()) endif function! s:clipboard.get(reg) abort - if s:selections[a:reg].owner > 0 + if type(s:paste[a:reg]) == v:t_func + return s:paste[a:reg]() + elseif s:selections[a:reg].owner > 0 return s:selections[a:reg].data end return s:try_cmd(s:paste[a:reg]) @@ -141,6 +154,12 @@ function! s:clipboard.set(lines, regtype, reg) abort end return 0 end + + if type(s:copy[a:reg]) == v:t_func + call s:copy[a:reg](a:lines, a:regtype) + return 0 + end + if s:cache_enabled == 0 call s:try_cmd(s:copy[a:reg], a:lines) return 0 diff --git a/runtime/doc/provider.txt b/runtime/doc/provider.txt index 4de411a60e..930c73d06e 100644 --- a/runtime/doc/provider.txt +++ b/runtime/doc/provider.txt @@ -160,7 +160,9 @@ registers. Nvim looks for these clipboard tools, in order of priority: - tmux (if $TMUX is set) *g:clipboard* -To configure a custom clipboard tool, set `g:clipboard` to a dictionary: > +To configure a custom clipboard tool, set g:clipboard to a dictionary. +For example this configuration integrates the tmux clipboard: > + let g:clipboard = { \ 'name': 'myClipboard', \ 'copy': { @@ -174,9 +176,28 @@ To configure a custom clipboard tool, set `g:clipboard` to a dictionary: > \ 'cache_enabled': 1, \ } -If `cache_enabled` is |TRUE| then when a selection is copied, Nvim will cache +If "cache_enabled" is |TRUE| then when a selection is copied Nvim will cache the selection until the copy command process dies. When pasting, if the copy -process has not died, the cached selection is applied. +process has not died the cached selection is applied. + +g:clipboard can also use functions (see |lambda|) instead of strings. +For example this configuration uses the g:foo variable as a fake clipboard: > + + let g:clipboard = { + \ 'name': 'myClipboard', + \ 'copy': { + \ '+': {lines, regtype -> extend(g:, {'foo': [lines, regtype]}) }, + \ '*': {lines, regtype -> extend(g:, {'foo': [lines, regtype]}) }, + \ }, + \ 'paste': { + \ '+': {-> get(g:, 'foo', [])}, + \ '*': {-> get(g:, 'foo', [])}, + \ }, + \ } + +The "copy" function stores a list of lines and the register type. The "paste" +function returns the clipboard as a `[lines, regtype]` list, where `lines` is +a list of lines and `regtype` is a register type conforming to |setreg()|. ============================================================================== X11 selection mechanism *clipboard-x11* *x11-selection* -- cgit From 8b42249cddf6b257e2eee808a41f3d6dd5af6846 Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Sat, 1 Dec 2018 16:44:36 +0100 Subject: RPC: turn errors from async calls into notifications Previously, nvim sent a response with invalid request id (UINT64_MAX). In functionaltests, catch unexpected error notifications in after_each(). --- runtime/doc/api.txt | 17 +++++++++++++++-- runtime/doc/develop.txt | 2 ++ 2 files changed, 17 insertions(+), 2 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index 66fb5bda82..0219488088 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -79,6 +79,19 @@ As Nvim evolves the API may change in compliance with this CONTRACT: - Existing items will not be removed (after release). - Deprecated functions will not be removed until Nvim version 2.0 +============================================================================== +Global events *api-global-events* + +When a client invokes an API request as an async notification, it is not +possible for Nvim to send an error response. Instead, in case of error, the +following notification will be sent to the client: + + *nvim_error_event* +nvim_error_event[{type}, {message}] + +{type} is a numeric id as defined by `api_info().error_types`, and {message} is +a string with the error message. + ============================================================================== Buffer update events *api-buffer-updates* @@ -206,7 +219,7 @@ Example using the Nvim python-client: buf.clear_highlight(src) < If the highlights don't need to be deleted or updated, just pass -1 as -src_id (this is the default in python). Use |nvim_buf_clear_highlight()| to +src_id (this is the default in python). Use |nvim_buf_clear_namespace()| to clear highlights from a specific source, in a specific line range or the entire buffer by passing in the line range 0, -1 (the latter is the default in python as used above). @@ -218,7 +231,7 @@ An example of calling the api from vimscript: > call nvim_buf_add_highlight(0, src, "Identifier", 0, 5, -1) " later - call nvim_buf_clear_highlight(0, src, 0, -1) + call nvim_buf_clear_namespace(0, src, 0, -1) > ============================================================================== Global Functions *api-global* diff --git a/runtime/doc/develop.txt b/runtime/doc/develop.txt index bcf43142ad..2c919f9104 100644 --- a/runtime/doc/develop.txt +++ b/runtime/doc/develop.txt @@ -181,6 +181,8 @@ Standard Features ~ - Clients should call |nvim_set_client_info()| after connecting, so users and plugins can detect the client by handling the |ChanInfo| event. This avoids the need for special variables or other client hints. +- Clients should handle |nvim_error_event| notifications, which will be sent + if an async request to nvim was rejected or caused an error. Package Naming ~ -- cgit From d207440f1e739172477083078d4a6fe7858e772b Mon Sep 17 00:00:00 2001 From: "@equalsraf" Date: Tue, 4 Dec 2018 20:38:20 +0000 Subject: clipboard: Revert unused check #9309 PR #9304 added support for functions in clipboard providers. As part of the PR I meant to move two checks in the provider code out of an if statement into separate statements and adding additional checks for g:clipboard attributes - as it turns out the code is wrong and it does not implement additional checks while it adds two conditions that make very little sense type(g:clipboard['copy']) #isnot# v:t_func what would make sense would be something along the lines of type(g:clipboard['copy']['+']) #isnot# v:t_func but might not be what we want either, so I'm reverting this. --- runtime/autoload/provider/clipboard.vim | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'runtime') diff --git a/runtime/autoload/provider/clipboard.vim b/runtime/autoload/provider/clipboard.vim index 8bbb72f933..fd32e03666 100644 --- a/runtime/autoload/provider/clipboard.vim +++ b/runtime/autoload/provider/clipboard.vim @@ -55,22 +55,12 @@ endfunction function! provider#clipboard#Executable() abort if exists('g:clipboard') if type({}) isnot# type(g:clipboard) + \ || type({}) isnot# type(get(g:clipboard, 'copy', v:null)) + \ || type({}) isnot# type(get(g:clipboard, 'paste', v:null)) let s:err = 'clipboard: invalid g:clipboard' return '' endif - if type(get(g:clipboard, 'copy', v:null)) isnot# v:t_dict - \ && type(get(g:clipboard, 'copy', v:null)) isnot# v:t_func - let s:err = "clipboard: invalid g:clipboard['copy']" - return '' - endif - - if type(get(g:clipboard, 'paste', v:null)) isnot# v:t_dict - \ && type(get(g:clipboard, 'paste', v:null)) isnot# v:t_func - let s:err = "clipboard: invalid g:clipboard['paste']" - return '' - endif - let s:copy = get(g:clipboard, 'copy', { '+': v:null, '*': v:null }) let s:paste = get(g:clipboard, 'paste', { '+': v:null, '*': v:null }) let s:cache_enabled = get(g:clipboard, 'cache_enabled', 0) -- cgit From e509576e531acf6a97ef5b471e25bbe8c77414a8 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Wed, 5 Dec 2018 00:11:28 +0100 Subject: provider/lang: expand() g:foo_host_prog (#9312) Before this commit, if user does this: let g:node_host_prog = '~/.nvm/versions/node/v11.3.0/bin/neovim-node-host' the "~/" is not expanded to user's home directory. `:help g:ruby_host_prog` suggests a path with "~/" so technically we already claimed to support this. closes https://github.com/neovim/node-client/issues/102 --- runtime/autoload/provider/node.vim | 2 +- runtime/autoload/provider/pythonx.vim | 4 ++-- runtime/autoload/provider/ruby.vim | 2 +- runtime/doc/eval.txt | 6 ++---- 4 files changed, 6 insertions(+), 8 deletions(-) (limited to 'runtime') diff --git a/runtime/autoload/provider/node.vim b/runtime/autoload/provider/node.vim index 48ea10aed6..35882849bd 100644 --- a/runtime/autoload/provider/node.vim +++ b/runtime/autoload/provider/node.vim @@ -49,7 +49,7 @@ endfunction function! provider#node#Detect() abort if exists('g:node_host_prog') - return g:node_host_prog + return expand(g:node_host_prog) endif if !s:is_minimum_version(v:null, 6, 0) return '' diff --git a/runtime/autoload/provider/pythonx.vim b/runtime/autoload/provider/pythonx.vim index 258aff61b3..b8e2ded00d 100644 --- a/runtime/autoload/provider/pythonx.vim +++ b/runtime/autoload/provider/pythonx.vim @@ -24,13 +24,13 @@ endfunction function! provider#pythonx#Detect(major_ver) abort if a:major_ver == 2 if exists('g:python_host_prog') - return [g:python_host_prog, ''] + return [expand(g:python_host_prog), ''] else let progs = ['python2', 'python2.7', 'python2.6', 'python'] endif else if exists('g:python3_host_prog') - return [g:python3_host_prog, ''] + return [expand(g:python3_host_prog), ''] else let progs = ['python3', 'python3.7', 'python3.6', 'python3.5', \ 'python3.4', 'python3.3', 'python'] diff --git a/runtime/autoload/provider/ruby.vim b/runtime/autoload/provider/ruby.vim index ed9436750b..3b4c6c4839 100644 --- a/runtime/autoload/provider/ruby.vim +++ b/runtime/autoload/provider/ruby.vim @@ -45,7 +45,7 @@ endfunction function! s:detect() if exists("g:ruby_host_prog") - return g:ruby_host_prog + return expand(g:ruby_host_prog) elseif has('win32') return exepath('neovim-ruby-host.bat') else diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 9bd73df7fe..6dffd6f05e 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -3379,9 +3379,7 @@ expand({expr} [, {nosuf} [, {list}]]) *expand()* If {list} is given and it is |TRUE|, a List will be returned. Otherwise the result is a String and when there are several - matches, they are separated by characters. [Note: in - version 5.0 a space was used, which caused problems when a - file name contains a space] + matches, they are separated by characters. If the expansion fails, the result is an empty string. A name for a non-existing file is not included, unless {expr} does @@ -3442,7 +3440,7 @@ expand({expr} [, {nosuf} [, {list}]]) *expand()* all "README" files in the current directory and below: > :echo expand("**/README") < - Expand() can also be used to expand variables and environment + expand() can also be used to expand variables and environment variables that are only known in a shell. But this can be slow, because a shell may be used to do the expansion. See |expr-env-expand|. -- cgit From 857a7312d015350c9637548310c7a187637d3ca4 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 9 Dec 2018 01:31:34 +0100 Subject: doc (#9288) - misc - doc: `:help config`. closes #9329 - cleanup test/README.md --- runtime/doc/api.txt | 28 ++++++++++++++-------------- runtime/doc/starting.txt | 25 +++++++++++-------------- 2 files changed, 25 insertions(+), 28 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index 0219488088..7dab69df22 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -1138,7 +1138,7 @@ nvim_buf_add_highlight({buffer}, {ns_id}, {hl_group}, {line}, which returns a namespace id. Pass it in to this function as `ns_id` to add highlights to the namespace. All highlights in the same namespace can then be cleared with single call to - |nvim_buf_clear_highlight|. If the highlight never will be + |nvim_buf_clear_namespace|. If the highlight never will be deleted by an API call, pass `ns_id = -1`. As a shorthand, `ns_id = 0` can be used to create a new @@ -1162,20 +1162,21 @@ nvim_buf_add_highlight({buffer}, {ns_id}, {hl_group}, {line}, Return: ~ The ns_id that was used - *nvim_buf_clear_highlight()* -nvim_buf_clear_highlight({buffer}, {ns_id}, {line_start}, {line_end}) - Clears highlights and virtual text from a given source id and - range of lines + *nvim_buf_clear_namespace()* +nvim_buf_clear_namespace({buffer}, {ns_id}, {line_start}, {line_end}) + Clears namespaced objects, highlights and virtual text, from a + line range - To clear a source group in the entire buffer, pass in 0 and -1 + To clear the namespace in the entire buffer, pass in 0 and -1 to line_start and line_end respectively. Parameters: ~ {buffer} Buffer handle - {ns_id} Namespace to clear, or -1 to clear all. + {ns_id} Namespace to clear, or -1 to clear all + namespaces. {line_start} Start of range of lines to clear {line_end} End of range of lines to clear (exclusive) - or -1 to clear to end of file. + or -1 to clear to end of buffer. *nvim_buf_set_virtual_text()* nvim_buf_set_virtual_text({buffer}, {ns_id}, {line}, {chunks}, {opts}) @@ -1184,18 +1185,17 @@ nvim_buf_set_virtual_text({buffer}, {ns_id}, {line}, {chunks}, {opts}) By default (and currently the only option) the text will be placed after the buffer text. Virtual text will never cause reflow, rather virtual text will be truncated at the end of - the screen line. The virtual text will begin after one cell to - the right of the ordinary text, this will contain the |lcs- - eol| char if set, otherwise just be a space. + the screen line. The virtual text will begin one cell (|lcs- + eol| or space) after the ordinary text. Namespaces are used to support batch deletion/updating of virtual text. To create a namespace, use |nvim_create_namespace|. Virtual text is cleared using - |nvim_buf_clear_highlight|. The same `ns_id` can be used for + |nvim_buf_clear_namespace|. The same `ns_id` can be used for both virtual text and highlights added by |nvim_buf_add_highlight|, both can then be cleared with a - single call to |nvim_buf_clear_highlight|. If the virtual text - never will be cleared by an API call, pass `src_id = -1`. + single call to |nvim_buf_clear_namespace|. If the virtual text + never will be cleared by an API call, pass `ns_id = -1`. As a shorthand, `ns_id = 0` can be used to create a new namespace for the virtual text, the allocated id is then diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt index 1da2441929..450d2967b4 100644 --- a/runtime/doc/starting.txt +++ b/runtime/doc/starting.txt @@ -410,20 +410,17 @@ accordingly. Vim proceeds in this order: 3. Execute Ex commands, from environment variables and/or files An environment variable is read as one Ex command line, where multiple - commands must be separated with '|' or "". - *init.vim* *vimrc* *exrc* - A file that contains initialization commands is called a "vimrc" file. - Each line in a vimrc file is executed as an Ex command line. It is - sometimes also referred to as "exrc" file. They are the same type of - file, but "exrc" is what Vi always used, "vimrc" is a Vim specific - name, "init.vim" is Neovim specific location for vimrc file. Also see - |vimrc-intro|. - - Places for your personal initializations (see |base-directories|): - Unix $XDG_CONFIG_HOME/nvim/init.vim - (default for $XDG_CONFIG_HOME is ~/.config) - Windows $XDG_CONFIG_HOME/nvim/init.vim - (default for $XDG_CONFIG_HOME is ~/AppData/Local) + commands must be separated with '|' or . + *config* *init.vim* *vimrc* *exrc* + A file that contains initialization commands is generically called + a "vimrc" or config file. Each line in a vimrc file is executed as an + Ex command line. See also |vimrc-intro| and |base-directories|. + + The Nvim config file is named "init.vim", located at: + Unix ~/.config/nvim/init.vim + Windows ~/AppData/Local/nvim/init.vim + Or if |$XDG_CONFIG_HOME| is defined: + $XDG_CONFIG_HOME/nvim/init.vim RECOMMENDATION: Put all your Vim configuration stuff in the $HOME/.config/nvim/ directory. That makes it easy to copy it to -- cgit From cf1ffa91667a482c6355f5999b9e97ccc0b4126a Mon Sep 17 00:00:00 2001 From: Anatolii Sakhnik Date: Sun, 2 Dec 2018 22:58:07 +0200 Subject: vim-patch:8.1.0360: using an external diff program is slow and inflexible Problem: Using an external diff program is slow and inflexible. Solution: Include the xdiff library. (Christian Brabandt) Use it by default. https://github.com/vim/vim/commit/e828b7621cf9065a3582be0c4dd1e0e846e335bf vim-patch:8.1.0360 vim-patch:8.1.0364 vim-patch:8.1.0366 vim-patch:8.1.0370 vim-patch:8.1.0377 vim-patch:8.1.0378 vim-patch:8.1.0381 vim-patch:8.1.0396 vim-patch:8.1.0432 --- runtime/doc/diff.txt | 9 ++++++--- runtime/doc/options.txt | 30 +++++++++++++++++++++++++----- 2 files changed, 31 insertions(+), 8 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/diff.txt b/runtime/doc/diff.txt index 766240dfb0..ab002b4dcb 100644 --- a/runtime/doc/diff.txt +++ b/runtime/doc/diff.txt @@ -27,7 +27,9 @@ The second and following arguments may also be a directory name. Vim will then append the file name of the first argument to the directory name to find the file. -This only works when a standard "diff" command is available. See 'diffexpr'. +By default an internal diff library will be used. When 'diffopt' or +'diffexpr' has been set an external "diff" command will be used. This only +works when such a diff program is available. Diffs are local to the current tab page |tab-page|. You can't see diffs with a window in another tab page. This does make it possible to have several @@ -332,8 +334,9 @@ between file1 and file2: > The ">" is replaced with the value of 'shellredir'. -The output of "diff" must be a normal "ed" style diff. Do NOT use a context -diff. This example explains the format that Vim expects: > +The output of "diff" must be a normal "ed" style diff or a unified diff. Do +NOT use a context diff. This example explains the format that Vim expects for +the "ed" style diff: > 1a2 > bbb diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 29d9a60aa2..606e148a83 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1859,8 +1859,8 @@ A jump table for the options with a short description can be found at |Q_op|. *'dex'* *'diffexpr'* 'diffexpr' 'dex' string (default "") global - Expression which is evaluated to obtain an ed-style diff file from two - versions of a file. See |diff-diffexpr|. + Expression which is evaluated to obtain a diff file (either ed-style + or unified-style) from two versions of a file. See |diff-diffexpr|. This option cannot be set from a |modeline| or in the |sandbox|, for security reasons. @@ -1925,11 +1925,31 @@ A jump table for the options with a short description can be found at |Q_op|. foldcolumn:{n} Set the 'foldcolumn' option to {n} when starting diff mode. Without this 2 is used. - Examples: > + internal Use the internal diff library. This is + ignored when 'diffexpr' is set. *E960* + When running out of memory when writing a + buffer this item will be ignored for diffs + involving that buffer. Set the 'verbose' + option to see when this happens. + + indent-heuristic + Use the indent heuristic for the internal + diff library. + + algorithm:{text} Use the specified diff algorithm with the + internal diff engine. Currently supported + algorithms are: + myers the default algorithm + minimal spend extra time to generate the + smallest possible diff + patience patience diff algorithm + histogram histogram diff algorithm - :set diffopt=filler,context:4 + Examples: > + :set diffopt=internal,filler,context:4 :set diffopt= - :set diffopt=filler,foldcolumn:3 + :set diffopt=internal,filler,foldcolumn:3 + :set diffopt-=internal " do NOT use the internal diff parser < *'digraph'* *'dg'* *'nodigraph'* *'nodg'* 'digraph' 'dg' boolean (default off) -- cgit From 2c92a4d0c8a398c8a7dfd1666fdcfd2ab89cc887 Mon Sep 17 00:00:00 2001 From: Anatolii Sakhnik Date: Sun, 9 Dec 2018 19:26:12 +0200 Subject: vim-patch:8.1.0397: no event triggered after updating diffs Problem: No event triggered after updating diffs. Solution: Add the DiffUpdated event. https://github.com/vim/vim/commit/e8fa05b5bc2d6d76bf5af50176a63655d00d1110 --- runtime/doc/autocmd.txt | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'runtime') diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt index 4702656c41..c34dbaaf60 100644 --- a/runtime/doc/autocmd.txt +++ b/runtime/doc/autocmd.txt @@ -628,6 +628,11 @@ CursorMoved After the cursor was moved in Normal or Visual CursorMovedI After the cursor was moved in Insert mode. Not triggered when the popup menu is visible. Otherwise the same as CursorMoved. + *DiffUpdated* +DiffUpdated After diffs have been updated. Depending on + what kind of diff is being used (internal or + external) this can be triggered on every + change or when doing |:diffupdate|. *DirChanged* DirChanged After the |current-directory| was changed. Sets these |v:event| keys: -- cgit From 61d0dfee32ce9a9fb2497b02558df02eabb61d1b Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Wed, 12 Dec 2018 00:17:27 +0100 Subject: provider: repurpose E319 In Vim (and some vestigial parts of Nvim) E319 was a placeholder for ex_ni commands, i.e. commands that are only available in certain builds of Vim. That is obviously counter to Nvim's goals: all Nvim commands are available on all platforms and build types (the remaining ex_ni commands are actually just missing providers). We need an error id for "missing provider", so it makes sense to use E319 for that purpose. ref #9344 ref #3577 --- runtime/doc/message.txt | 9 --------- runtime/doc/provider.txt | 13 ++++++++++--- 2 files changed, 10 insertions(+), 12 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/message.txt b/runtime/doc/message.txt index d52905fc36..a46648119e 100644 --- a/runtime/doc/message.txt +++ b/runtime/doc/message.txt @@ -514,15 +514,6 @@ command. The script can then again read another script. This can continue for about 14 levels. When more nesting is done, Vim assumes that there is a recursive loop somewhere and stops with this error message. - *E319* > - The command is not available in this version - -You have used a command that is not present in the version of Vim you are -using. When compiling Vim, many different features can be enabled or -disabled. This depends on how big Vim has chosen to be and the operating -system. See |+feature-list| for when which feature is available. The -|:version| command shows which feature Vim was compiled with. - *E300* > Swap file already exists (symlink attack?) diff --git a/runtime/doc/provider.txt b/runtime/doc/provider.txt index 930c73d06e..6ed3c230b9 100644 --- a/runtime/doc/provider.txt +++ b/runtime/doc/provider.txt @@ -4,14 +4,21 @@ NVIM REFERENCE MANUAL by Thiago de Arruda -Providers *provider* +Providers *provider* -Nvim delegates some features to dynamic "providers". +Nvim delegates some features to dynamic "providers". This document describes +the providers and how to install them. + *E319* +Use of a feature requiring a missing provider is an error: > + + E319: No "foo" provider found. Run ":checkhealth provider" + +Run the |:checkhealth| command, and review the sections below. Type |gO| to see the table of contents. ============================================================================== -Python integration *provider-python* +Python integration *provider-python* Nvim supports Python |remote-plugin|s and the Vim legacy |python2| and |python3| interfaces (which are implemented as remote-plugins). -- cgit From 6c602be33a5176fd1101e8cff45dd2a85b0e512e Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Wed, 31 Jan 2018 16:17:05 +0100 Subject: vim-patch:8.0.1445: cannot act on edits in the command line Problem: Cannot act on edits in the command line. Solution: Add the CmdlineChanged autocommand event. (xtal8, closes vim/vim#2603, closes vim/vim#2524) https://github.com/vim/vim/commit/153b704e20f9c269450a7d3ea8cafcf942579ab7 --- runtime/doc/autocmd.txt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt index c34dbaaf60..d7b74f99c2 100644 --- a/runtime/doc/autocmd.txt +++ b/runtime/doc/autocmd.txt @@ -521,10 +521,11 @@ CmdUndefined When a user command is used but it isn't command is defined. An alternative is to always define the user command and have it invoke an autoloaded function. See |autoload|. - *CmdlineChanged* -CmdlineChanged After a change was made to the text in the - command line. Be careful not to mess up - the command line, it may cause Vim to lock up. + *CmdlineChanged* +CmdlineChanged After a change was made to the text inside + command line. Be careful not to mess up the + command line, it may cause Vim to lock up. + is set to the |cmdline-char|. *CmdlineEnter* CmdlineEnter After entering the command-line (including non-interactive use of ":" in a mapping: use -- cgit From 314f6ea3678c09f9824242a10abbe4a2fb2ccff3 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Sat, 15 Dec 2018 23:40:41 -0500 Subject: startup: Use $XDG_CONFIG_DIRS/nvim/sysinit.vim if it exists Closes #8994 --- runtime/doc/starting.txt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt index 450d2967b4..82e73035d8 100644 --- a/runtime/doc/starting.txt +++ b/runtime/doc/starting.txt @@ -436,10 +436,11 @@ accordingly. Vim proceeds in this order: If Vim was started in Ex mode with the "-s" argument, all following initializations until 4. are skipped. Only the "-u" option is interpreted. - *system-vimrc* - a. For Unix, MS-Windows, and Macintosh, the system vimrc file is read for - initializations. The path of this file is shown with the - ":version" command. Mostly it's "$VIM/vimrc". + *system-vimrc* *sysinit.vim* + a. The system vimrc file is read for initializations. If + nvim/sysinit.vim file exists in one of $XDG_CONFIG_DIRS, it will be + used. Otherwise, the system vimrc file is used. The path of this file + is shown with the ":version" command. Mostly it's "$VIM/sysinit.vim". *VIMINIT* *EXINIT* *$MYVIMRC* b. Four places are searched for initializations. The first that exists -- cgit From e6d0dea42b28a4814546bcf699ce277c365ebfc1 Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Tue, 27 Nov 2018 16:29:43 +0100 Subject: test: Lua 5.2/5.3 compat #9280 Make the code run both on Lua 5.1 (which is the default for Neovim, and is what LuaJIT provides) and Lua 5.2+. --- runtime/lua/man.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'runtime') diff --git a/runtime/lua/man.lua b/runtime/lua/man.lua index b0fbe9cc35..0c67e45dc4 100644 --- a/runtime/lua/man.lua +++ b/runtime/lua/man.lua @@ -1,4 +1,5 @@ local buf_hls = {} +local unpack = table.unpack or unpack -- luacheck: ignore local function highlight_line(line, linenr) local chars = {} -- cgit From 221f6fffad12beaa928ccedae336d64b7b1c1208 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Thu, 29 Nov 2018 22:51:20 +0100 Subject: runtime/lua/vim/compat.lua ref #9280 Introduce the `vim.compat` module, to help environments with system Lua 5.2+ run the build/tests. Include the module implicitly in all tests. ref #8677 legacy `vim` module: beep buffer command dict eval firstline lastline line list open type window --- runtime/lua/man.lua | 3 ++- runtime/lua/vim/compat.lua | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 runtime/lua/vim/compat.lua (limited to 'runtime') diff --git a/runtime/lua/man.lua b/runtime/lua/man.lua index 0c67e45dc4..e9f60138f4 100644 --- a/runtime/lua/man.lua +++ b/runtime/lua/man.lua @@ -1,5 +1,6 @@ +require('vim.compat') + local buf_hls = {} -local unpack = table.unpack or unpack -- luacheck: ignore local function highlight_line(line, linenr) local chars = {} diff --git a/runtime/lua/vim/compat.lua b/runtime/lua/vim/compat.lua new file mode 100644 index 0000000000..168979bb95 --- /dev/null +++ b/runtime/lua/vim/compat.lua @@ -0,0 +1,12 @@ +-- Lua 5.1 forward-compatibility layer. +-- For background see https://github.com/neovim/neovim/pull/9280 +-- +-- Reference the lua-compat-5.2 project for hints: +-- https://github.com/keplerproject/lua-compat-5.2/blob/c164c8f339b95451b572d6b4b4d11e944dc7169d/compat52/mstrict.lua +-- https://github.com/keplerproject/lua-compat-5.2/blob/c164c8f339b95451b572d6b4b4d11e944dc7169d/tests/test.lua + +local lua_version = _VERSION:sub(-3) + +if lua_version >= "5.2" then + unpack = table.unpack -- luacheck: ignore 121 143 +end -- cgit From 127b8569e63d57321fc4cd77b7e55781f1447365 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Fri, 30 Nov 2018 21:30:05 +0100 Subject: lint --- runtime/lua/man.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'runtime') diff --git a/runtime/lua/man.lua b/runtime/lua/man.lua index e9f60138f4..1da8ed85fc 100644 --- a/runtime/lua/man.lua +++ b/runtime/lua/man.lua @@ -12,9 +12,9 @@ local function highlight_line(line, linenr) local attr = NONE local byte = 0 -- byte offset - local function end_attr_hl(attr) + local function end_attr_hl(attr_) for i, hl in ipairs(hls) do - if hl.attr == attr and hl.final == -1 then + if hl.attr == attr_ and hl.final == -1 then hl.final = byte hls[i] = hl end @@ -108,7 +108,7 @@ local function highlight_line(line, linenr) -- the range 0x20 - 0x3f, then 'm'. (See ECMA-48, sections 5.4 & 8.3.117) local sgr = prev_char:match("^%[([\032-\063]*)m$") if sgr then - local match = '' + local match while sgr and #sgr > 0 do -- Match against SGR parameters, which may be separated by ';' match, sgr = sgr:match("^(%d*);?(.*)") -- cgit