aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'runtime')
-rw-r--r--runtime/autoload/remote/host.vim2
-rw-r--r--runtime/doc/eval.txt32
-rw-r--r--runtime/doc/nvim.txt9
-rw-r--r--runtime/doc/starting.txt41
-rw-r--r--runtime/doc/various.txt2
-rw-r--r--runtime/doc/vim_diff.txt2
-rw-r--r--runtime/plugin/matchit.vim30
7 files changed, 73 insertions, 45 deletions
diff --git a/runtime/autoload/remote/host.vim b/runtime/autoload/remote/host.vim
index 4ec2eeb5b7..eb5e87d7e1 100644
--- a/runtime/autoload/remote/host.vim
+++ b/runtime/autoload/remote/host.vim
@@ -121,7 +121,7 @@ endfunction
function! s:GetManifest() abort
let prefix = exists('$MYVIMRC')
\ ? $MYVIMRC
- \ : matchstr(get(split(capture('scriptnames'), '\n'), 0, ''), '\f\+$')
+ \ : matchstr(get(split(execute('scriptnames'), '\n'), 0, ''), '\f\+$')
return fnamemodify(expand(prefix, 1), ':h')
\.'/.'.fnamemodify(prefix, ':t').'-rplugin~'
endfunction
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index ba38a140d1..9ff97436bb 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1809,7 +1809,6 @@ byteidx({expr}, {nr}) Number byte index of {nr}'th char in {expr}
byteidxcomp({expr}, {nr}) Number byte index of {nr}'th char in {expr}
call({func}, {arglist} [, {dict}])
any call {func} with arguments {arglist}
-capture({command}) String capture output of {command}
ceil({expr}) Float round {expr} up
changenr() Number current change number
char2nr({expr}[, {utf8}]) Number ASCII/UTF8 value of first char in {expr}
@@ -1845,6 +1844,7 @@ escape({string}, {chars}) String escape {chars} in {string} with '\'
eval({string}) any evaluate {string} into its value
eventhandler() Number TRUE if inside an event handler
executable({expr}) Number 1 if executable {expr} exists
+execute({command}) String execute and capture output of {command}
exepath({expr}) String full path of the command {expr}
exists({expr}) Number TRUE if {expr} exists
extend({expr1}, {expr2} [, {expr3}])
@@ -2524,21 +2524,6 @@ call({func}, {arglist} [, {dict}]) *call()* *E699*
{dict} is for functions with the "dict" attribute. It will be
used to set the local variable "self". |Dictionary-function|
-capture({command}) *capture()*
- Capture output of {command}.
- If {command} is a |String|, returns {command} output.
- If {command} is a |List|, returns concatenated outputs.
- Examples: >
- echo capture('echon "foo"')
-< foo >
- echo capture(['echon "foo"', 'echon "bar"'])
-< foobar
- This function is not available in the |sandbox|.
- Note: {command} executes as if prepended with |:silent|
- (output is collected, but not displayed). If nested, an outer
- capture() will not observe the output of inner calls.
- Note: Text attributes (highlights) are not captured.
-
ceil({expr}) *ceil()*
Return the smallest integral value greater than or equal to
{expr} as a |Float| (round up).
@@ -2989,6 +2974,21 @@ executable({expr}) *executable()*
0 does not exist
-1 not implemented on this system
+execute({command}) *execute()*
+ Execute {command} and capture its output.
+ If {command} is a |String|, returns {command} output.
+ If {command} is a |List|, returns concatenated outputs.
+ Examples: >
+ echo execute('echon "foo"')
+< foo >
+ echo execute(['echon "foo"', 'echon "bar"'])
+< foobar
+ This function is not available in the |sandbox|.
+ Note: {command} executes as if prepended with |:silent|
+ (output is collected but not displayed). If nested, an outer
+ execute() will not observe output of the inner calls.
+ Note: Text attributes (highlights) are not captured.
+
exepath({expr}) *exepath()*
If {expr} is an executable and is either an absolute path, a
relative path or found in $PATH, return the full path.
diff --git a/runtime/doc/nvim.txt b/runtime/doc/nvim.txt
index 904fb3c16c..7dfbbd0cf0 100644
--- a/runtime/doc/nvim.txt
+++ b/runtime/doc/nvim.txt
@@ -18,10 +18,13 @@ Transitioning from Vim *nvim-from-vim*
To start the transition, link your previous configuration so Nvim can use it:
>
- mkdir -p ${XDG_CONFIG_HOME:=$HOME/.config}
- ln -s ~/.vim $XDG_CONFIG_HOME/nvim
- ln -s ~/.vimrc $XDG_CONFIG_HOME/nvim/init.vim
+ mkdir ~/.config
+ ln -s ~/.vim ~/.config/nvim
+ ln -s ~/.vimrc ~/.config/nvim/init.vim
<
+Note: If your system sets `$XDG_CONFIG_HOME`, use that instead of `~/.config`
+in the code above. Nvim follows the XDG |base-directories| convention.
+
See |provider-python| and |provider-clipboard| for additional software you
might need to use some features.
diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt
index 236ed65f46..8249f8e71f 100644
--- a/runtime/doc/starting.txt
+++ b/runtime/doc/starting.txt
@@ -14,6 +14,7 @@ Starting Vim *starting*
6. Saving settings |save-settings|
7. Views and Sessions |views-sessions|
8. The ShaDa file |shada-file|
+9. Base Directories |base-directories|
==============================================================================
1. Vim arguments *vim-arguments*
@@ -382,7 +383,7 @@ accordingly. Vim proceeds in this order:
name, "init.vim" is Neovim specific location for vimrc file. Also see
|vimrc-intro|.
- Places for your personal initializations:
+ 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
@@ -1083,7 +1084,7 @@ even if other entries (with known name/type/etc) are merged. |shada-merging|
SHADA FILE NAME *shada-file-name*
- The default name of the ShaDa file is "$XDG_DATA_HOME/nvim/shada/main.shada"
- for Unix. Default for $XDG_DATA_HOME is ~/.local/share.
+ for Unix. Default for $XDG_DATA_HOME is ~/.local/share. |base-directories|
- The 'n' flag in the 'shada' option can be used to specify another ShaDa
file name |'shada'|.
- The "-i" Vim argument can be used to set another file name, |-i|. When the
@@ -1370,4 +1371,40 @@ file when reading and include:
either contains more then one MessagePack object or it does not contain
complete MessagePack object.
+==============================================================================
+9. Base Directories *base-directories* *xdg*
+
+Nvim conforms to the XDG Base Directory Specification for application
+configuration and data file locations. This just means Nvim looks for some
+optional settings and uses them if they exist, otherwise defaults are chosen.
+https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
+
+CONFIGURATION DIRECTORY *$XDG_CONFIG_HOME*
+
+ Base directory default:
+ Unix: ~/.config
+ Windows: ~/AppData/Local
+
+ Nvim directory:
+ Unix: ~/.config/nvim/
+ Windows: ~/AppData/Local/nvim/
+
+DATA DIRECTORY *$XDG_DATA_HOME*
+
+ Base directory default:
+ Unix: ~/.local/share
+ Windows: ~/AppData/Local
+
+ Nvim directory:
+ Unix: ~/.local/share/nvim/
+ Windows: ~/AppData/Local/nvim-data/
+
+Note on Windows the configuration and data directory defaults are the same
+(for lack of an alternative), but the sub-directory for data is named
+"nvim-data" to separate it from the configuration sub-directory "nvim".
+
+Throughout other sections of the user manual, the defaults are used as generic
+placeholders, e.g. where "~/.config" is mentioned it should be understood to
+mean "$XDG_CONFIG_HOME or ~/.config".
+
vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt
index eb813866da..a1bf379d86 100644
--- a/runtime/doc/various.txt
+++ b/runtime/doc/various.txt
@@ -417,7 +417,7 @@ m *+xpm_w32* Win32 GUI only: pixmap support |w32-xpm-support|
the screen, put the commands in a function and call it
with ":silent call Function()".
Alternatives are the 'verbosefile' option or
- |capture()| function, these can be used in combination
+ |execute()| function, these can be used in combination
with ":redir".
:redi[r] >> {file} Redirect messages to file {file}. Append if {file}
diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt
index a5b1cbf9b1..937ed9e8ba 100644
--- a/runtime/doc/vim_diff.txt
+++ b/runtime/doc/vim_diff.txt
@@ -98,7 +98,7 @@ Commands:
|:CheckHealth|
Functions:
- |capture()|
+ |execute()| works with |:redir|
Events:
|TabNew|
diff --git a/runtime/plugin/matchit.vim b/runtime/plugin/matchit.vim
index 70867b1f93..8053b080e1 100644
--- a/runtime/plugin/matchit.vim
+++ b/runtime/plugin/matchit.vim
@@ -1,7 +1,8 @@
" matchit.vim: (global plugin) Extended "%" matching
-" Last Change: Fri Jan 25 10:00 AM 2008 EST
+" Last Change: Fri Jul 29 01:20 AM 2016 EST
" Maintainer: Benji Fisher PhD <benji@member.AMS.org>
" Version: 1.13.2, for Vim 6.3+
+" Fix from Tommy Allen included.
" URL: http://www.vim.org/script.php?script_id=39
" Documentation:
@@ -254,12 +255,7 @@ function! s:Match_wrapper(word, forward, mode) range
" Fifth step: actually start moving the cursor and call searchpair().
" Later, :execute restore_cursor to get to the original screen.
- let restore_cursor = virtcol(".") . "|"
- normal! g0
- let restore_cursor = line(".") . "G" . virtcol(".") . "|zs" . restore_cursor
- normal! H
- let restore_cursor = "normal!" . line(".") . "Gzt" . restore_cursor
- execute restore_cursor
+ let view = winsaveview()
call cursor(0, curcol + 1)
" normal! 0
" if curcol
@@ -273,7 +269,7 @@ function! s:Match_wrapper(word, forward, mode) range
let sp_return = searchpair(ini, mid, fin, flag, skip)
let final_position = "call cursor(" . line(".") . "," . col(".") . ")"
" Restore cursor position and original screen.
- execute restore_cursor
+ call winrestview(view)
normal! m'
if sp_return > 0
execute final_position
@@ -634,7 +630,7 @@ endfun
" idea to give it its own matching patterns.
fun! s:MultiMatch(spflag, mode)
if !exists("b:match_words") || b:match_words == ""
- return ""
+ return {}
end
let restore_options = (&ic ? "" : "no") . "ignorecase"
if exists("b:match_ignorecase")
@@ -694,15 +690,7 @@ fun! s:MultiMatch(spflag, mode)
let skip = 's:comment\|string'
endif
let skip = s:ParseSkip(skip)
- " let restore_cursor = line(".") . "G" . virtcol(".") . "|"
- " normal! H
- " let restore_cursor = "normal!" . line(".") . "Gzt" . restore_cursor
- let restore_cursor = virtcol(".") . "|"
- normal! g0
- let restore_cursor = line(".") . "G" . virtcol(".") . "|zs" . restore_cursor
- normal! H
- let restore_cursor = "normal!" . line(".") . "Gzt" . restore_cursor
- execute restore_cursor
+ let view = winsaveview()
" Third step: call searchpair().
" Replace '\('--but not '\\('--with '\%(' and ',' with '\|'.
@@ -720,14 +708,14 @@ fun! s:MultiMatch(spflag, mode)
while level
if searchpair(openpat, '', closepat, a:spflag, skip) < 1
call s:CleanUp(restore_options, a:mode, startline, startcol)
- return ""
+ return {}
endif
let level = level - 1
endwhile
- " Restore options and return a string to restore the original position.
+ " Restore options and return view dict to restore the original position.
call s:CleanUp(restore_options, a:mode, startline, startcol)
- return restore_cursor
+ return view
endfun
" Search backwards for "if" or "while" or "<tag>" or ...