aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc/starting.txt
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2025-02-05 23:09:29 +0000
committerJosh Rahm <joshuarahm@gmail.com>2025-02-05 23:09:29 +0000
commitd5f194ce780c95821a855aca3c19426576d28ae0 (patch)
treed45f461b19f9118ad2bb1f440a7a08973ad18832 /runtime/doc/starting.txt
parentc5d770d311841ea5230426cc4c868e8db27300a8 (diff)
parent44740e561fc93afe3ebecfd3618bda2d2abeafb0 (diff)
downloadrneovim-rahm.tar.gz
rneovim-rahm.tar.bz2
rneovim-rahm.zip
Merge remote-tracking branch 'upstream/master' into mix_20240309HEADrahm
Diffstat (limited to 'runtime/doc/starting.txt')
-rw-r--r--runtime/doc/starting.txt52
1 files changed, 27 insertions, 25 deletions
diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt
index 3b0fa2b371..d8d5e42397 100644
--- a/runtime/doc/starting.txt
+++ b/runtime/doc/starting.txt
@@ -164,8 +164,7 @@ argument.
you can overwrite a file by adding an exclamation mark to
the Ex command, as in ":w!". The 'readonly' option can be
reset with ":set noro" (see the options chapter, |options|).
- Subsequent edits will not be done in readonly mode. Calling
- the executable "view" has the same effect as the -R argument.
+ Subsequent edits will not be done in readonly mode.
The 'updatecount' option will be set to 10000, meaning that
the swap file will not be updated automatically very often.
See |-M| for disallowing modifications.
@@ -207,12 +206,12 @@ argument.
:print
:set
With |:verbose| or 'verbose', other commands display on stderr: >
- nvim -es +":verbose echo 'foo'"
- nvim -V1 -es +foo
-
-< User |config| is skipped unless |-u| was given.
- Swap file is skipped (like |-n|).
- User |shada| is loaded (unless "-i NONE" is given).
+ nvim -es +"verbose echo 'foo'"
+ nvim -V1 -es +"echo 'foo'"
+<
+ Skips user |config| unless |-u| was given.
+ Disables |shada| unless |-i| was given.
+ Disables swapfile (like |-n|).
*-l*
-l {script} [args]
@@ -226,7 +225,8 @@ argument.
arguments. The {script} name is stored at `_G.arg[0]`.
Sets 'verbose' to 1 (like "-V1"), so Lua `print()` writes to
- output.
+ output, as well as other message-emitting functions like
+ |:echo|.
If {script} prints messages and doesn't cause Nvim to exit,
Nvim ensures output ends with a newline.
@@ -235,6 +235,11 @@ argument.
nvim +q -l foo.lua
< This loads Lua module "bar" before executing "foo.lua": >
nvim +"lua require('bar')" -l foo.lua
+< *lua-shebang*
+ You can set the "shebang" of the script so that Nvim executes
+ the script when called with "./" from a shell (remember to
+ "chmod u+x"): >
+ #!/usr/bin/env -S nvim -l
<
Skips user |config| unless |-u| was given.
Disables plugins unless 'loadplugins' was set.
@@ -243,7 +248,7 @@ argument.
*-ll*
-ll {script} [args]
- Execute a Lua script, similarly to |-l|, but the editor is not
+ Executes a Lua script, similarly to |-l|, but the editor is not
initialized. This gives a Lua environment similar to a worker
thread. See |lua-loop-threading|.
@@ -283,21 +288,18 @@ argument.
command from a script. |debug-mode|
*-n*
--n No |swap-file| will be used. Recovery after a crash will be
- impossible. Handy if you want to view or edit a file on a
- very slow medium (e.g., a floppy).
- Can also be done with ":set updatecount=0". You can switch it
- on again by setting the 'updatecount' option to some value,
- e.g., ":set uc=100".
- 'updatecount' is set to 0 AFTER executing commands from a
- vimrc file, but before the GUI initializations. Thus it
- overrides a setting for 'updatecount' in a vimrc file, but not
- in a gvimrc file. See |startup|.
- When you want to reduce accesses to the disk (e.g., for a
- laptop), don't use "-n", but set 'updatetime' and
- 'updatecount' to very big numbers, and type ":preserve" when
- you want to save your work. This way you keep the possibility
- for crash recovery.
+-n Disables |swap-file| by setting 'updatecount' to 0 (after
+ executing any |vimrc|). Recovery after a crash will be
+ impossible. Improves performance when working with a file on
+ a very slow medium (usb drive, network share).
+
+ Enable it again by setting 'updatecount' to some value, e.g.
+ ":set updatecount=100".
+
+ To reduce accesses to the disk, don't use "-n", but set
+ 'updatetime' and 'updatecount' to very big numbers, and type
+ ":preserve" when you want to save your work. This way you
+ keep the possibility for crash recovery.
*-o*
-o[N] Open N windows, split horizontally. If [N] is not given,