aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/_meta/options.lua
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2024-05-24 19:18:11 +0000
committerJosh Rahm <joshuarahm@gmail.com>2024-05-24 19:18:11 +0000
commitff7ed8f586589d620a806c3758fac4a47a8e7e15 (patch)
tree729bbcb92231538fa61dab6c3d890b025484b7f5 /runtime/lua/vim/_meta/options.lua
parent376914f419eb08fdf4c1a63a77e1f035898a0f10 (diff)
parent28c04948a1c887a1cc0cb64de79fa32631700466 (diff)
downloadrneovim-ff7ed8f586589d620a806c3758fac4a47a8e7e15.tar.gz
rneovim-ff7ed8f586589d620a806c3758fac4a47a8e7e15.tar.bz2
rneovim-ff7ed8f586589d620a806c3758fac4a47a8e7e15.zip
Merge remote-tracking branch 'upstream/master' into mix_20240309
Diffstat (limited to 'runtime/lua/vim/_meta/options.lua')
-rw-r--r--runtime/lua/vim/_meta/options.lua60
1 files changed, 38 insertions, 22 deletions
diff --git a/runtime/lua/vim/_meta/options.lua b/runtime/lua/vim/_meta/options.lua
index 757720d8fb..428b7c4d4f 100644
--- a/runtime/lua/vim/_meta/options.lua
+++ b/runtime/lua/vim/_meta/options.lua
@@ -11,10 +11,9 @@ vim.bo = vim.bo
---@field [integer] vim.wo
vim.wo = vim.wo
---- Allow CTRL-_ in Insert and Command-line mode. This is default off, to
---- avoid that users that accidentally type CTRL-_ instead of SHIFT-_ get
---- into reverse Insert mode, and don't know how to get out. See
---- 'revins'.
+--- Allow CTRL-_ in Insert mode. This is default off, to avoid that users
+--- that accidentally type CTRL-_ instead of SHIFT-_ get into reverse
+--- Insert mode, and don't know how to get out. See 'revins'.
---
--- @type boolean
vim.o.allowrevins = false
@@ -975,7 +974,7 @@ vim.bo.comments = vim.o.comments
vim.bo.com = vim.bo.comments
--- A template for a comment. The "%s" in the value is replaced with the
---- comment text. For example, C uses "/*%s*/". Currently only used to
+--- comment text. For example, C uses "/*%s*/". Used for `commenting` and to
--- add markers for folding, see `fold-marker`.
---
--- @type string
@@ -2626,6 +2625,8 @@ vim.go.gd = vim.go.gdefault
--- This is a scanf-like string that uses the same format as the
--- 'errorformat' option: see `errorformat`.
---
+--- If ripgrep ('grepprg') is available, this option defaults to `%f:%l:%c:%m`.
+---
--- @type string
vim.o.grepformat = "%f:%l:%m,%f:%l%m,%f %l%m"
vim.o.gfm = vim.o.grepformat
@@ -2637,12 +2638,6 @@ vim.go.gfm = vim.go.grepformat
--- line. The placeholder "$*" is allowed to specify where the arguments
--- will be included. Environment variables are expanded `:set_env`. See
--- `option-backslash` about including spaces and backslashes.
---- When your "grep" accepts the "-H" argument, use this to make ":grep"
---- also work well with a single file:
----
---- ```vim
---- set grepprg=grep\ -nH
---- ```
--- Special value: When 'grepprg' is set to "internal" the `:grep` command
--- works like `:vimgrep`, `:lgrep` like `:lvimgrep`, `:grepadd` like
--- `:vimgrepadd` and `:lgrepadd` like `:lvimgrepadd`.
@@ -2650,9 +2645,19 @@ vim.go.gfm = vim.go.grepformat
--- apply equally to 'grepprg'.
--- This option cannot be set from a `modeline` or in the `sandbox`, for
--- security reasons.
----
---- @type string
-vim.o.grepprg = "grep -n $* /dev/null"
+--- This option defaults to:
+--- - `rg --vimgrep -uu ` if ripgrep is available (`:checkhealth`),
+--- - `grep -HIn $* /dev/null` on Unix,
+--- - `findstr /n $* nul` on Windows.
+--- Ripgrep can perform additional filtering such as using .gitignore rules
+--- and skipping hidden files. This is disabled by default (see the -u option)
+--- to more closely match the behaviour of standard grep.
+--- You can make ripgrep match Vim's case handling using the
+--- -i/--ignore-case and -S/--smart-case options.
+--- An `OptionSet` autocmd can be used to set it up to match automatically.
+---
+--- @type string
+vim.o.grepprg = "grep -HIn $* /dev/null"
vim.o.gp = vim.o.grepprg
vim.bo.grepprg = vim.o.grepprg
vim.bo.gp = vim.bo.grepprg
@@ -5195,9 +5200,6 @@ vim.wo.scr = vim.wo.scroll
--- Minimum is 1, maximum is 100000.
--- Only in `terminal` buffers.
---
---- Note: Lines that are not visible and kept in scrollback are not
---- reflown when the terminal buffer is resized horizontally.
----
--- @type integer
vim.o.scrollback = -1
vim.o.scbk = vim.o.scrollback
@@ -6079,8 +6081,7 @@ vim.go.sta = vim.go.smarttab
--- highlighted with `hl-NonText`.
--- You may also want to add "lastline" to the 'display' option to show as
--- much of the last line as possible.
---- NOTE: only partly implemented, currently works with CTRL-E, CTRL-Y
---- and scrolling with the mouse.
+--- NOTE: partly implemented, doesn't work yet for `gj` and `gk`.
---
--- @type boolean
vim.o.smoothscroll = false
@@ -6746,6 +6747,8 @@ vim.bo.swf = vim.bo.swapfile
--- "split" when both are present.
--- uselast If included, jump to the previously used window when
--- jumping to errors with `quickfix` commands.
+--- If a window has 'winfixbuf' enabled, 'switchbuf' is currently not
+--- applied to the split window.
---
--- @type string
vim.o.switchbuf = "uselast"
@@ -6847,7 +6850,7 @@ vim.go.tpm = vim.go.tabpagemax
--- appear wrong in many places.
--- The value must be more than 0 and less than 10000.
---
---- There are four main ways to use tabs in Vim:
+--- There are five main ways to use tabs in Vim:
--- 1. Always keep 'tabstop' at 8, set 'softtabstop' and 'shiftwidth' to 4
--- (or 3 or whatever you prefer) and use 'noexpandtab'. Then Vim
--- will use a mix of tabs and spaces, but typing <Tab> and <BS> will
@@ -7443,6 +7446,7 @@ vim.bo.vts = vim.bo.vartabstop
---
--- Level Messages ~
--- ----------------------------------------------------------------------
+--- 1 Enables Lua tracing (see above). Does not produce messages.
--- 2 When a file is ":source"'ed, or `shada` file is read or written.
--- 3 UI info, terminal capabilities.
--- 4 Shell commands.
@@ -7863,8 +7867,8 @@ vim.wo.winbl = vim.wo.winblend
--- will scroll 'window' minus two lines, with a minimum of one.
--- When 'window' is equal to 'lines' minus one CTRL-F and CTRL-B scroll
--- in a much smarter way, taking care of wrapping lines.
---- When resizing the Vim window, the value is smaller than 1 or more than
---- or equal to 'lines' it will be set to 'lines' minus 1.
+--- When resizing the Vim window, and the value is smaller than 1 or more
+--- than or equal to 'lines' it will be set to 'lines' minus 1.
--- Note: Do not confuse this with the height of the Vim window, use
--- 'lines' for that.
---
@@ -7874,6 +7878,18 @@ vim.o.wi = vim.o.window
vim.go.window = vim.o.window
vim.go.wi = vim.go.window
+--- If enabled, the window and the buffer it is displaying are paired.
+--- For example, attempting to change the buffer with `:edit` will fail.
+--- Other commands which change a window's buffer such as `:cnext` will
+--- also skip any window with 'winfixbuf' enabled. However if an Ex
+--- command has a "!" modifier, it can force switching buffers.
+---
+--- @type boolean
+vim.o.winfixbuf = false
+vim.o.wfb = vim.o.winfixbuf
+vim.wo.winfixbuf = vim.o.winfixbuf
+vim.wo.wfb = vim.wo.winfixbuf
+
--- Keep the window height when windows are opened or closed and
--- 'equalalways' is set. Also for `CTRL-W_=`. Set by default for the
--- `preview-window` and `quickfix-window`.