From b65e484f181d5755b0247eb7cef15d30a25842ac Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Tue, 20 Jun 2023 19:49:35 +0800 Subject: [PATCH] feat('neodev'): bundle neodev to `lang#lua` layer --- autoload/SpaceVim/layers/lang/lua.vim | 1 + .../.github/ISSUE_TEMPLATE/bug_report.yml | 89 + .../ISSUE_TEMPLATE/feature_request.yml | 36 + bundle/neodev.nvim/.github/workflows/ci.yml | 72 + .../neodev.nvim/.github/workflows/types.yml | 70 + bundle/neodev.nvim/.gitignore | 8 + bundle/neodev.nvim/.neoconf.json | 18 + bundle/neodev.nvim/BUILD.md | 11 + bundle/neodev.nvim/CHANGELOG.md | 266 + bundle/neodev.nvim/LICENSE | 201 + bundle/neodev.nvim/README.md | 143 + bundle/neodev.nvim/doc/lua-dev.txt | 163 + bundle/neodev.nvim/doc/neodev.nvim.txt | 166 + bundle/neodev.nvim/lua/lua-dev.lua | 6 + bundle/neodev.nvim/lua/neodev/config.lua | 57 + bundle/neodev.nvim/lua/neodev/init.lua | 39 + bundle/neodev.nvim/lua/neodev/lsp.lua | 97 + bundle/neodev.nvim/lua/neodev/luals.lua | 110 + bundle/neodev.nvim/lua/neodev/util.lua | 87 + bundle/neodev.nvim/selene.toml | 1 + bundle/neodev.nvim/stylua.toml | 3 + bundle/neodev.nvim/types/nightly/alias.lua | 11 + bundle/neodev.nvim/types/nightly/api.lua | 3035 +++++++++ bundle/neodev.nvim/types/nightly/cmd.lua | 3080 +++++++++ bundle/neodev.nvim/types/nightly/lpeg.lua | 637 ++ bundle/neodev.nvim/types/nightly/lua.lua | 310 + .../neodev.nvim/types/nightly/options.1.lua | 4353 ++++++++++++ .../neodev.nvim/types/nightly/options.2.lua | 4642 +++++++++++++ .../neodev.nvim/types/nightly/options.3.lua | 2650 ++++++++ bundle/neodev.nvim/types/nightly/options.lua | 4307 ++++++++++++ bundle/neodev.nvim/types/nightly/uv.lua | 3982 +++++++++++ bundle/neodev.nvim/types/nightly/vim.fn.1.lua | 5150 ++++++++++++++ bundle/neodev.nvim/types/nightly/vim.fn.lua | 5917 ++++++++++++++++ bundle/neodev.nvim/types/nightly/vim.lua | 40 + bundle/neodev.nvim/types/override/api.lua | 2 + bundle/neodev.nvim/types/override/lua.lua | 13 + bundle/neodev.nvim/types/override/options.lua | 27 + bundle/neodev.nvim/types/override/vim.fn.lua | 73 + bundle/neodev.nvim/types/stable/alias.lua | 11 + bundle/neodev.nvim/types/stable/api.lua | 3060 +++++++++ bundle/neodev.nvim/types/stable/cmd.lua | 3086 +++++++++ bundle/neodev.nvim/types/stable/lpeg.lua | 637 ++ bundle/neodev.nvim/types/stable/lua.lua | 310 + bundle/neodev.nvim/types/stable/options.1.lua | 4400 ++++++++++++ bundle/neodev.nvim/types/stable/options.2.lua | 4662 +++++++++++++ bundle/neodev.nvim/types/stable/options.3.lua | 2549 +++++++ bundle/neodev.nvim/types/stable/options.lua | 4300 ++++++++++++ bundle/neodev.nvim/types/stable/uv.lua | 3982 +++++++++++ bundle/neodev.nvim/types/stable/vim.fn.1.lua | 4841 +++++++++++++ bundle/neodev.nvim/types/stable/vim.fn.lua | 6008 +++++++++++++++++ bundle/neodev.nvim/types/stable/vim.lua | 40 + bundle/neodev.nvim/vim.toml | 2 + 52 files changed, 77761 insertions(+) create mode 100644 bundle/neodev.nvim/.github/ISSUE_TEMPLATE/bug_report.yml create mode 100644 bundle/neodev.nvim/.github/ISSUE_TEMPLATE/feature_request.yml create mode 100644 bundle/neodev.nvim/.github/workflows/ci.yml create mode 100644 bundle/neodev.nvim/.github/workflows/types.yml create mode 100644 bundle/neodev.nvim/.gitignore create mode 100644 bundle/neodev.nvim/.neoconf.json create mode 100644 bundle/neodev.nvim/BUILD.md create mode 100644 bundle/neodev.nvim/CHANGELOG.md create mode 100644 bundle/neodev.nvim/LICENSE create mode 100644 bundle/neodev.nvim/README.md create mode 100644 bundle/neodev.nvim/doc/lua-dev.txt create mode 100644 bundle/neodev.nvim/doc/neodev.nvim.txt create mode 100644 bundle/neodev.nvim/lua/lua-dev.lua create mode 100644 bundle/neodev.nvim/lua/neodev/config.lua create mode 100644 bundle/neodev.nvim/lua/neodev/init.lua create mode 100644 bundle/neodev.nvim/lua/neodev/lsp.lua create mode 100644 bundle/neodev.nvim/lua/neodev/luals.lua create mode 100644 bundle/neodev.nvim/lua/neodev/util.lua create mode 100644 bundle/neodev.nvim/selene.toml create mode 100644 bundle/neodev.nvim/stylua.toml create mode 100644 bundle/neodev.nvim/types/nightly/alias.lua create mode 100644 bundle/neodev.nvim/types/nightly/api.lua create mode 100644 bundle/neodev.nvim/types/nightly/cmd.lua create mode 100644 bundle/neodev.nvim/types/nightly/lpeg.lua create mode 100644 bundle/neodev.nvim/types/nightly/lua.lua create mode 100644 bundle/neodev.nvim/types/nightly/options.1.lua create mode 100644 bundle/neodev.nvim/types/nightly/options.2.lua create mode 100644 bundle/neodev.nvim/types/nightly/options.3.lua create mode 100644 bundle/neodev.nvim/types/nightly/options.lua create mode 100644 bundle/neodev.nvim/types/nightly/uv.lua create mode 100644 bundle/neodev.nvim/types/nightly/vim.fn.1.lua create mode 100644 bundle/neodev.nvim/types/nightly/vim.fn.lua create mode 100644 bundle/neodev.nvim/types/nightly/vim.lua create mode 100644 bundle/neodev.nvim/types/override/api.lua create mode 100644 bundle/neodev.nvim/types/override/lua.lua create mode 100644 bundle/neodev.nvim/types/override/options.lua create mode 100644 bundle/neodev.nvim/types/override/vim.fn.lua create mode 100644 bundle/neodev.nvim/types/stable/alias.lua create mode 100644 bundle/neodev.nvim/types/stable/api.lua create mode 100644 bundle/neodev.nvim/types/stable/cmd.lua create mode 100644 bundle/neodev.nvim/types/stable/lpeg.lua create mode 100644 bundle/neodev.nvim/types/stable/lua.lua create mode 100644 bundle/neodev.nvim/types/stable/options.1.lua create mode 100644 bundle/neodev.nvim/types/stable/options.2.lua create mode 100644 bundle/neodev.nvim/types/stable/options.3.lua create mode 100644 bundle/neodev.nvim/types/stable/options.lua create mode 100644 bundle/neodev.nvim/types/stable/uv.lua create mode 100644 bundle/neodev.nvim/types/stable/vim.fn.1.lua create mode 100644 bundle/neodev.nvim/types/stable/vim.fn.lua create mode 100644 bundle/neodev.nvim/types/stable/vim.lua create mode 100644 bundle/neodev.nvim/vim.toml diff --git a/autoload/SpaceVim/layers/lang/lua.vim b/autoload/SpaceVim/layers/lang/lua.vim index 6693c1c25..e8c724839 100644 --- a/autoload/SpaceVim/layers/lang/lua.vim +++ b/autoload/SpaceVim/layers/lang/lua.vim @@ -75,6 +75,7 @@ function! SpaceVim#layers#lang#lua#plugins() abort let plugins = [] " Improved Lua 5.3 syntax and indentation support for Vim call add(plugins, [g:_spacevim_root_dir . 'bundle/vim-lua', {'on_ft' : 'lua'}]) + call add(plugins, [g:_spacevim_root_dir . 'bundle/neodev.nvim', {'merged' : 0}]) return plugins endfunction diff --git a/bundle/neodev.nvim/.github/ISSUE_TEMPLATE/bug_report.yml b/bundle/neodev.nvim/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 000000000..ef6290c2a --- /dev/null +++ b/bundle/neodev.nvim/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,89 @@ +name: Bug Report +description: File a bug/issue +title: "bug: " +labels: [bug] +body: + - type: markdown + attributes: + value: | + **Before** reporting an issue, make sure to read the [documentation](https://github.com/folke/neodev.nvim) and search [existing issues](https://github.com/folke/neodev.nvim/issues). Usage questions such as ***"How do I...?"*** belong in [Discussions](https://github.com/folke/neodev.nvim/discussions) and will be closed. + - type: checkboxes + attributes: + label: Did you check docs and existing issues? + description: Make sure you checked all of the below before submitting an issue + options: + - label: I have read all the neodev.nvim docs + required: true + - label: I have searched the existing issues of neodev.nvim + required: true + - label: I have searched the existing issues of plugins related to this issue + required: true + - type: input + attributes: + label: "Neovim version (nvim -v)" + placeholder: "0.8.0 commit db1b0ee3b30f" + validations: + required: true + - type: input + attributes: + label: "Operating system/version" + placeholder: "MacOS 11.5" + validations: + required: true + - type: textarea + attributes: + label: Describe the bug + description: A clear and concise description of what the bug is. Please include any related errors you see in Neovim. + validations: + required: true + - type: textarea + attributes: + label: Steps To Reproduce + description: Steps to reproduce the behavior. + placeholder: | + 1. + 2. + 3. + validations: + required: true + - type: textarea + attributes: + label: Expected Behavior + description: A concise description of what you expected to happen. + validations: + required: true + - type: textarea + attributes: + label: Repro + description: Minimal `init.lua` to reproduce this issue. Save as `repro.lua` and run with `nvim -u repro.lua` + value: | + -- DO NOT change the paths and don't remove the colorscheme + local root = vim.fn.fnamemodify("./.repro", ":p") + + -- set stdpaths to use .repro + for _, name in ipairs({ "config", "data", "state", "cache" }) do + vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name + end + + -- bootstrap lazy + local lazypath = root .. "/plugins/lazy.nvim" + if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, }) + end + vim.opt.runtimepath:prepend(lazypath) + + -- install plugins + local plugins = { + "folke/tokyonight.nvim", + "folke/neodev.nvim", + -- add any other plugins here + } + require("lazy").setup(plugins, { + root = root .. "/plugins", + }) + + vim.cmd.colorscheme("tokyonight") + -- add anything else here + render: Lua + validations: + required: false diff --git a/bundle/neodev.nvim/.github/ISSUE_TEMPLATE/feature_request.yml b/bundle/neodev.nvim/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 000000000..501ab8e94 --- /dev/null +++ b/bundle/neodev.nvim/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,36 @@ +name: Feature Request +description: Suggest a new feature +title: "feature: " +labels: [enhancement] +body: + - type: checkboxes + attributes: + label: Did you check the docs? + description: Make sure you read all the docs before submitting a feature request + options: + - label: I have read all the neodev.nvim docs + required: true + - type: textarea + validations: + required: true + attributes: + label: Is your feature request related to a problem? Please describe. + description: A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + - type: textarea + validations: + required: true + attributes: + label: Describe the solution you'd like + description: A clear and concise description of what you want to happen. + - type: textarea + validations: + required: true + attributes: + label: Describe alternatives you've considered + description: A clear and concise description of any alternative solutions or features you've considered. + - type: textarea + validations: + required: false + attributes: + label: Additional context + description: Add any other context or screenshots about the feature request here. diff --git a/bundle/neodev.nvim/.github/workflows/ci.yml b/bundle/neodev.nvim/.github/workflows/ci.yml new file mode 100644 index 000000000..b679f76b8 --- /dev/null +++ b/bundle/neodev.nvim/.github/workflows/ci.yml @@ -0,0 +1,72 @@ +name: CI +on: + push: + pull_request: + +jobs: + tests: + strategy: + matrix: + # os: [ubuntu-latest, windows-latest] + os: [ubuntu-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + - name: Install Neovim + shell: bash + run: | + mkdir -p /tmp/nvim + wget -q https://github.com/neovim/neovim/releases/download/nightly/nvim.appimage -O /tmp/nvim/nvim.appimage + cd /tmp/nvim + chmod a+x ./nvim.appimage + ./nvim.appimage --appimage-extract + echo "/tmp/nvim/squashfs-root/usr/bin/" >> $GITHUB_PATH + - name: Run Tests + run: | + nvim --version + [ ! -d tests ] && exit 0 + nvim --headless -u tests/init.lua -c "PlenaryBustedDirectory tests/ {minimal_init = 'tests/init.lua', sequential = true}" + docs: + runs-on: ubuntu-latest + needs: tests + if: ${{ github.ref == 'refs/heads/main' }} + steps: + - uses: actions/checkout@v3 + - name: panvimdoc + uses: kdheepak/panvimdoc@main + with: + vimdoc: neodev.nvim + version: "Neovim >= 0.8.0" + demojify: true + treesitter: true + - name: Push changes + uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: "chore(build): auto-generate vimdoc" + commit_user_name: "github-actions[bot]" + commit_user_email: "github-actions[bot]@users.noreply.github.com" + commit_author: "github-actions[bot] " + release: + name: release + if: ${{ github.ref == 'refs/heads/main' }} + needs: + - docs + - tests + runs-on: ubuntu-latest + steps: + - uses: google-github-actions/release-please-action@v3 + id: release + with: + release-type: simple + package-name: neodev.nvim + - uses: actions/checkout@v3 + - name: tag stable versions + if: ${{ steps.release.outputs.release_created }} + run: | + git config user.name github-actions[bot] + git config user.email github-actions[bot]@users.noreply.github.com + git remote add gh-token "https://${{ secrets.GITHUB_TOKEN }}@github.com/google-github-actions/release-please-action.git" + git tag -d stable || true + git push origin :stable || true + git tag -a stable -m "Last Stable Release" + git push origin stable diff --git a/bundle/neodev.nvim/.github/workflows/types.yml b/bundle/neodev.nvim/.github/workflows/types.yml new file mode 100644 index 000000000..69a68799e --- /dev/null +++ b/bundle/neodev.nvim/.github/workflows/types.yml @@ -0,0 +1,70 @@ +name: Types +on: + workflow_dispatch: + schedule: + # Run this every hour + - cron: "0 * * * *" + +jobs: + build-types-nightly: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - name: Setup ./data + run: mkdir ./data + - name: Install dependencies + run: | + sudo apt-get -y install doxygen luajit python3-msgpack + - name: Install Neovim + shell: bash + run: | + mkdir -p /tmp/nvim + wget -q https://github.com/neovim/neovim/releases/download/nightly/nvim.appimage -O /tmp/nvim/nvim.appimage + cd /tmp/nvim + chmod a+x ./nvim.appimage + ./nvim.appimage --appimage-extract + echo "/tmp/nvim/squashfs-root/usr/bin/" >> $GITHUB_PATH + - name: Clone Neovim's repo and run gen_vimdoc.py + run: | + git clone --depth=1 https://github.com/neovim/neovim.git ./data/neovim + cd ./data/neovim + python3 ./scripts/gen_vimdoc.py + - name: Generate new docs + run: | + nvim --version + cp ./data/neovim/runtime/doc/*.mpack ./data/ + nvim -u NONE -E -R --headless --cmd "set rtp^=." --cmd "packloadall" --cmd "luafile lua/neodev/build/init.lua" --cmd q + - name: Push changes + uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: "chore: auto-generated types for Neovim nightly" + commit_user_name: "github-actions[bot]" + commit_user_email: "github-actions[bot]@users.noreply.github.com" + commit_author: "github-actions[bot] " + build-types-stable: + needs: build-types-nightly + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - name: Pull Updates + run: git pull + - name: Install Neovim + shell: bash + run: | + mkdir -p /tmp/nvim + wget -q https://github.com/neovim/neovim/releases/download/stable/nvim.appimage -O /tmp/nvim/nvim.appimage + cd /tmp/nvim + chmod a+x ./nvim.appimage + ./nvim.appimage --appimage-extract + echo "/tmp/nvim/squashfs-root/usr/bin/" >> $GITHUB_PATH + - name: Generate new docs + run: | + nvim --version + nvim -u NONE -E -R --headless --cmd "set rtp^=." --cmd "packloadall" --cmd "luafile lua/neodev/build/init.lua" --cmd q + - name: Push changes + uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: "chore: auto-generated types for Neovim stable" + commit_user_name: "github-actions[bot]" + commit_user_email: "github-actions[bot]@users.noreply.github.com" + commit_author: "github-actions[bot] " diff --git a/bundle/neodev.nvim/.gitignore b/bundle/neodev.nvim/.gitignore new file mode 100644 index 000000000..cc5457ab8 --- /dev/null +++ b/bundle/neodev.nvim/.gitignore @@ -0,0 +1,8 @@ +tt.* +.tests +doc/tags +debug +.repro +foo.* +*.log +data diff --git a/bundle/neodev.nvim/.neoconf.json b/bundle/neodev.nvim/.neoconf.json new file mode 100644 index 000000000..0690d1adf --- /dev/null +++ b/bundle/neodev.nvim/.neoconf.json @@ -0,0 +1,18 @@ +{ + "neodev": { + "library": { + "enabled": true, + "plugins": ["neoconf.nvim", "nvim-lspconfig"] + } + }, + "neoconf": { + "plugins": { + "lua_ls": { + "enabled": true + } + } + }, + "lspconfig": { + "sumneko_lua": {} + } +} diff --git a/bundle/neodev.nvim/BUILD.md b/bundle/neodev.nvim/BUILD.md new file mode 100644 index 000000000..41d744b4a --- /dev/null +++ b/bundle/neodev.nvim/BUILD.md @@ -0,0 +1,11 @@ +# Updating Lua API Docs + +1. Clone the neovim repo somewhere on your system +2. Run `./scripts/gen_vimdoc.py` +3. Copy `neovim/runtime/doc/*.mpack` files to the **neodev.nvim** data directory +4. Open the file `neodev.nvim/lua/build/api.lua` in Neovim +5. Execute `:luafile %` +6. You'll see a lot of annotations that might be changed due to your local + system setup, so you can ignore those +7. Check if the changes you intended are present +8. Create a PR with your code changes, and **without** the new EmmyLua annotations diff --git a/bundle/neodev.nvim/CHANGELOG.md b/bundle/neodev.nvim/CHANGELOG.md new file mode 100644 index 000000000..5191f76bc --- /dev/null +++ b/bundle/neodev.nvim/CHANGELOG.md @@ -0,0 +1,266 @@ +# Changelog + +## [2.5.2](https://github.com/folke/neodev.nvim/compare/v2.5.1...v2.5.2) (2023-03-24) + + +### Bug Fixes + +* parameter type for vim.fn.getline() ([#144](https://github.com/folke/neodev.nvim/issues/144)) ([ab56354](https://github.com/folke/neodev.nvim/commit/ab56354e0e85c3c3f20f770c699fb0038ce7bf42)) + +## [2.5.1](https://github.com/folke/neodev.nvim/compare/v2.5.0...v2.5.1) (2023-03-12) + + +### Bug Fixes + +* **lua_ls:** plugin name detection of symlinked plugins ([#140](https://github.com/folke/neodev.nvim/issues/140)) ([a60eaee](https://github.com/folke/neodev.nvim/commit/a60eaee19e0c3dcb7e54c64fe9bcfb71420a95c0)) + +## [2.5.0](https://github.com/folke/neodev.nvim/compare/v2.4.2...v2.5.0) (2023-03-10) + + +### Features + +* **luv:** use the luv addon instead of the deprecated 3rd party ([f06c113](https://github.com/folke/neodev.nvim/commit/f06c11344f76fadf2cd497b9490125dfc02946cb)) + +## [2.4.2](https://github.com/folke/neodev.nvim/compare/v2.4.1...v2.4.2) (2023-03-08) + + +### Bug Fixes + +* parameter types for searchpair and searchpairpos ([#130](https://github.com/folke/neodev.nvim/issues/130)) ([c87f69c](https://github.com/folke/neodev.nvim/commit/c87f69c856505ea778f6fd883a90397e55c8e59d)) + +## [2.4.1](https://github.com/folke/neodev.nvim/compare/v2.4.0...v2.4.1) (2023-02-28) + + +### Bug Fixes + +* parameter types for vim.wait and vim.fn.input ([#131](https://github.com/folke/neodev.nvim/issues/131)) ([55d3a74](https://github.com/folke/neodev.nvim/commit/55d3a747af136da527067e9fe59ad0bb938ecd50)) + +## [2.4.0](https://github.com/folke/neodev.nvim/compare/v2.3.0...v2.4.0) (2023-02-13) + + +### Features + +* added lua_ls luv builtin library. Fixes [#127](https://github.com/folke/neodev.nvim/issues/127) ([8c32d8b](https://github.com/folke/neodev.nvim/commit/8c32d8b4e765de26b27b76f0072e7c12038cde52)) + +## [2.3.0](https://github.com/folke/neodev.nvim/compare/v2.2.1...v2.3.0) (2023-02-13) + + +### Features + +* **luv:** more luv types ([39bb79b](https://github.com/folke/neodev.nvim/commit/39bb79b688300b0b4672ec83c564d72749482116)) + +## [2.2.1](https://github.com/folke/neodev.nvim/compare/v2.2.0...v2.2.1) (2023-02-12) + + +### Bug Fixes + +* s/sumneko_lua/lua_ls/ ([#124](https://github.com/folke/neodev.nvim/issues/124)) ([307d0fb](https://github.com/folke/neodev.nvim/commit/307d0fbce02068eebdaa4ef7da279fdb1bfe6d8e)) +* sumneko_lua -> lua_ls ([5076ebb](https://github.com/folke/neodev.nvim/commit/5076ebbcbfd0e2164d91ff2073a6f21a561804df)) + +## [2.2.0](https://github.com/folke/neodev.nvim/compare/v2.1.0...v2.2.0) (2023-02-10) + + +### Features + +* add more luv methods and types ([#122](https://github.com/folke/neodev.nvim/issues/122)) ([fc01efe](https://github.com/folke/neodev.nvim/commit/fc01efe11447a99808b06e362d95a296218fed68)) + +## [2.1.0](https://github.com/folke/neodev.nvim/compare/v2.0.1...v2.1.0) (2023-02-08) + + +### Features + +* Add `treesitter.query` and `treesitter.language` to stable ([#119](https://github.com/folke/neodev.nvim/issues/119)) ([4b6ade9](https://github.com/folke/neodev.nvim/commit/4b6ade9bb879aad4d1b2e94e82c36957262ead53)) +* add class to vim.api and vim.loop ([e27c03b](https://github.com/folke/neodev.nvim/commit/e27c03b3e312c08e2d4aeed2a0f76199a9729529)) + + +### Bug Fixes + +* handle cases where `vim.fn.stdpath("config")` does not exist. Fixes [#109](https://github.com/folke/neodev.nvim/issues/109) ([fc20483](https://github.com/folke/neodev.nvim/commit/fc20483383dac11b97df43c83db1bbbd35305172)) +* provide a class for vim.api ([#117](https://github.com/folke/neodev.nvim/issues/117)) ([9737bfc](https://github.com/folke/neodev.nvim/commit/9737bfc085cbb8879c19471a65b12fe9bd1ae878)) +* revert [#117](https://github.com/folke/neodev.nvim/issues/117) ([dd63031](https://github.com/folke/neodev.nvim/commit/dd630312eb978f554006a020554d64c197887644)) +* use integer for buffer, window, etc ([#116](https://github.com/folke/neodev.nvim/issues/116)) ([71e3e0c](https://github.com/folke/neodev.nvim/commit/71e3e0c2239593e29e06ecc725ba346e29d3186a)) + +## [2.0.1](https://github.com/folke/neodev.nvim/compare/v2.0.0...v2.0.1) (2023-01-15) + + +### Bug Fixes + +* ignore lua directory ([82c8586](https://github.com/folke/neodev.nvim/commit/82c85862e2aaa9c0b63f3176eb8dc513803f2865)) +* **lsp:** make sure everything works when lua root not found. Fixes [#108](https://github.com/folke/neodev.nvim/issues/108) ([31cba85](https://github.com/folke/neodev.nvim/commit/31cba8554a8e37ecf240fa2e242f0e43e72ae930)) + +## [2.0.0](https://github.com/folke/neodev.nvim/compare/v1.0.0...v2.0.0) (2023-01-11) + + +### ⚠ BREAKING CHANGES + +* `config.pathStrict` is now enabled by default. Needs sumneko >= 3.6.0. Much better performance + +### Features + +* **options:** allow setting an option to its type ([1569664](https://github.com/folke/neodev.nvim/commit/156966470d19a8b095f9ae620720be3fb85a3772)) + + +### Bug Fixes + +* simplified and improved plugin/config detection ([a34a9e7](https://github.com/folke/neodev.nvim/commit/a34a9e7e775f1513466940c31285292b7b8375de)) + + +### Performance Improvements + +* `config.pathStrict` is now enabled by default. Needs sumneko >= 3.6.0. Much better performance ([5ff32d4](https://github.com/folke/neodev.nvim/commit/5ff32d4d50491f94667733362a52d0fe178e4714)) + +## 1.0.0 (2023-01-04) + + +### ⚠ BREAKING CHANGES + +* removed config.plugin_library in favor of config.override for easier customization +* rewrite with easier setup and configuration. Backward compatible, but refer to the docs to use the optimized setup + +### Features + +* added [@meta](https://github.com/meta) to generated emmy-lua files ([97a3399](https://github.com/folke/neodev.nvim/commit/97a33996a1618bdc6647384fd605940c5adce743)) +* added [@see](https://github.com/see) for `seealso` from help docs ([1e8a2b4](https://github.com/folke/neodev.nvim/commit/1e8a2b4427a73cf3f0a51f42c52cc367e71f04f5)) +* added annotations for vim.filetype, vim.F, vim.fs, vim.health, vim.inspect ([2be3d3f](https://github.com/folke/neodev.nvim/commit/2be3d3ffc17609319090289561842a75dcbf5daf)) +* added config.runtime() for new vim.fn parser ([87adbea](https://github.com/folke/neodev.nvim/commit/87adbeafc4d2813447e6a75c8f209cb2d637b178)) +* added configuration option to set the runtime_path (slow). Fixes [#29](https://github.com/folke/neodev.nvim/issues/29) ([f7fecb7](https://github.com/folke/neodev.nvim/commit/f7fecb7deda6fe244b6a5b8edfca21128009baf5)) +* added docs for options and vim.fn functions ([4eb0e89](https://github.com/folke/neodev.nvim/commit/4eb0e894795251e5381c55ef87e7a0053ad0659c)) +* added function to check if a fiven fqname is a lua object ([3d1d469](https://github.com/folke/neodev.nvim/commit/3d1d4698a05be1099162812bf7893fb873f6a297)) +* added luv docs ([e38838a](https://github.com/folke/neodev.nvim/commit/e38838a558a5f80d6a9c8ad7d0044c884254463b)) +* added missing types ([76e7b48](https://github.com/folke/neodev.nvim/commit/76e7b48122a251b98057cc71823bdc50aa289016)) +* added option shortnames to vim.opt, o, go, bo, wo, opt_local, opt_global ([309eca5](https://github.com/folke/neodev.nvim/commit/309eca5584eba48d2b77f3668b3c5db3dee7e838)) +* added options ([9ec4a9c](https://github.com/folke/neodev.nvim/commit/9ec4a9c73b102163055d8d4e52edd833f9c22151)) +* added overrides for vim.fn.expand and vim.fn.sign_define. Fixes [#72](https://github.com/folke/neodev.nvim/issues/72) ([868db41](https://github.com/folke/neodev.nvim/commit/868db41830bae23c70b4ed044f64f60870bc8f37)) +* added overrides for vim.fn.glob ([43f51e9](https://github.com/folke/neodev.nvim/commit/43f51e9b86d1637644f0fbba5e1e11bef4341750)) +* added overrides for vim.loop.new_timer() ([d15370e](https://github.com/folke/neodev.nvim/commit/d15370ee520a169bf6224668ccca175489833948)) +* added possibility to define [@overload](https://github.com/overload) annotations ([a77f5db](https://github.com/folke/neodev.nvim/commit/a77f5dbfe2e972789c989e2f3909354b482705c0)) +* added possibility to override auto generated annotations ([9d6b75b](https://github.com/folke/neodev.nvim/commit/9d6b75ba119cf825fb92830188724e6f0f31e4ed)) +* added support for lazy.nvim ([6136979](https://github.com/folke/neodev.nvim/commit/61369790e4205b74f1667587b3dc5867716500eb)) +* added support for vim.opt methods. Fixes [#73](https://github.com/folke/neodev.nvim/issues/73) ([9e56a56](https://github.com/folke/neodev.nvim/commit/9e56a56301a297bf8d0c675349c101023a723c22)) +* added support for vimdoc code blocks ([6d8ce16](https://github.com/folke/neodev.nvim/commit/6d8ce1602a166c03695aaa976252bcb0fd49a7dc)) +* added types for vim.cmd.* ([9962a1d](https://github.com/folke/neodev.nvim/commit/9962a1dd0db41ab6745be2d9e4b3dc70d1aa188c)) +* added vim.diagnostic & vim.ui ([58796ba](https://github.com/folke/neodev.nvim/commit/58796ba3f0f7b3ab2197670998555f299cb3f471)) +* added vim.treesitter.highlighter ([5ca1178](https://github.com/folke/neodev.nvim/commit/5ca117883f37c64ee15f4d6a8ba8ca9a673bfffe)) +* added vim.treesitter.language ([8d2a950](https://github.com/folke/neodev.nvim/commit/8d2a950045450927d8f7652ef26548b28f3137c8)) +* added warnings on old-style setup ([17e73ce](https://github.com/folke/neodev.nvim/commit/17e73ce2f9616d5b967e9f3996f3c3b84912ef99)) +* added workspace support ([681c0fc](https://github.com/folke/neodev.nvim/commit/681c0fc46c49108ec4da9e190c7bfe0ec1393d83)) +* aded experimental option pathStrict. You need the latest sumneko nightly for this ([60f1ec9](https://github.com/folke/neodev.nvim/commit/60f1ec9d73c7f8fb5537050f38b8921698315e55)) +* allow config without using lspconfig. Fixes [#83](https://github.com/folke/neodev.nvim/issues/83) ([3b6b644](https://github.com/folke/neodev.nvim/commit/3b6b6442a036729d950f1b92924ac0f5827638ea)) +* better type infer ([6b9ae84](https://github.com/folke/neodev.nvim/commit/6b9ae848c4b804a9f9179abcc72ee38e824a2fd8)) +* debug log ([fdab800](https://github.com/folke/neodev.nvim/commit/fdab800ea2a9d4a62b67fe87109b937e6d85f5bf)) +* docs.fqn ([8f61232](https://github.com/folke/neodev.nvim/commit/8f61232f815e134efdf4cf06e1cd6342f4e369ab)) +* enable call snippets ([a267319](https://github.com/folke/neodev.nvim/commit/a26731909a6790ab80a4c7bc0c25b8d7402c35e9)) +* enable lua-dev by default for the Neovim runtime directory when needed ([0001b27](https://github.com/folke/neodev.nvim/commit/0001b27ddce0a1cc620d325577cba9f3b48f9cad)) +* fix indent of doc comments ([5abb32a](https://github.com/folke/neodev.nvim/commit/5abb32ab07a2e01726095dcc9bf224f874eeac69)) +* fixed detection of definitions for vim.keymap ([63bdf08](https://github.com/folke/neodev.nvim/commit/63bdf085b17ff55c938763ca1f6c346af119277c)) +* fixed option docs ([fb82dcc](https://github.com/folke/neodev.nvim/commit/fb82dcc58d7839a60a0da008049dc42c663bebae)) +* format code blocks as markdown ([e85a190](https://github.com/folke/neodev.nvim/commit/e85a19015ceb8498f6e80cb0094eb2dc45603bde)) +* full support of vim.go, wo, bo, o, opt, opt_local, opt_global ([261d29c](https://github.com/folke/neodev.nvim/commit/261d29c44328eb4b703e49ba4a6ae4e5297a96fc)) +* generated types for stable (Neovim 0.8.0) ([4366cad](https://github.com/folke/neodev.nvim/commit/4366cada45729a4224cbdf9b34f085b678c64796)) +* handle special Lua keywords ([142d456](https://github.com/folke/neodev.nvim/commit/142d456011e0a5df302e5cced535ecaa13be631a)) +* hidden option to make sumneko use a different neovim runtime for testing ([d55299f](https://github.com/folke/neodev.nvim/commit/d55299fea0655a416d94cb11badcd342ec54d7f4)) +* implemented optional parameters for lua api functions ([ee8e6af](https://github.com/folke/neodev.nvim/commit/ee8e6af506fc94763c59d336258de48b9f500988)) +* improved docs.functions ([c3a6a8c](https://github.com/folke/neodev.nvim/commit/c3a6a8c77af8dc04a064fe9b75d68bf3c56e4d4d)) +* improved vim.api and vim parsers ([60fce6d](https://github.com/folke/neodev.nvim/commit/60fce6dd0c60376f3a2d2253b314c6088ad067a9)) +* initial version ([26bd607](https://github.com/folke/neodev.nvim/commit/26bd607564940dc56575b792d799366a0da56c1f)) +* integrate with settings.nvim ([d95e691](https://github.com/folke/neodev.nvim/commit/d95e69166dbbef775140aecd02508db13c3606bb)) +* integration with neoconf.nvim ([77e8aec](https://github.com/folke/neodev.nvim/commit/77e8aec83549db4f575aa99cd8e2a88ac85db662)) +* keep original formatting when parsing docs ([6cf4af1](https://github.com/folke/neodev.nvim/commit/6cf4af1a026d63e676bddbdf8ad5b3fd726f1218)) +* lua-dev is now neodev ([b43d272](https://github.com/folke/neodev.nvim/commit/b43d2726829c0fe2d3950372e13177daaff14ea4)) +* lua-dev now properly sets up jsonls for .luarc.json, the sumneko local config files ([fb62007](https://github.com/folke/neodev.nvim/commit/fb620072c444404b2b55e9a0d8ba6d6f9e2dac69)) +* lua.txt doc parser ([0e7a16b](https://github.com/folke/neodev.nvim/commit/0e7a16b070c6be725573bc8cc2b0d69694cefc62)) +* merge defs of vim._editor in `vim` ([858bcd6](https://github.com/folke/neodev.nvim/commit/858bcd6840fa9578d14915f05fc15ca9b0959517)) +* merge in lspconfig options ([1f7ee38](https://github.com/folke/neodev.nvim/commit/1f7ee38d0f4e3972c3768e360979f5670aba2070)) +* more luv annotations ([b50621a](https://github.com/folke/neodev.nvim/commit/b50621a868004292372d91a03c88923b36659d99)) +* new options parser ([0c65251](https://github.com/folke/neodev.nvim/commit/0c65251ef6f93c795b6d44e339d97670a3500e8b)) +* new parser ([42e9c51](https://github.com/folke/neodev.nvim/commit/42e9c5126904d6715ece660224610f3a38e4b8d4)) +* new vim functions parser ([4d9ee97](https://github.com/folke/neodev.nvim/commit/4d9ee97048c6b541c363cc99dce24c3e77527631)) +* only load missing functions from mpack on nightly. hidden functions ([f0bf928](https://github.com/folke/neodev.nvim/commit/f0bf928719bf1b7eb0ee905e787c29e9a332e25f)) +* optionally supply a list of plugins to add to the workspace [#2](https://github.com/folke/neodev.nvim/issues/2) ([1fb6cc8](https://github.com/folke/neodev.nvim/commit/1fb6cc81ca98aab4d46ded1d39dcd29a44e48fcc)) +* parse luv return values from docs ([107b7d9](https://github.com/folke/neodev.nvim/commit/107b7d9413b8134a72ea838a624679f5a4e4fdf9)) +* proper typing for vim.g, vim.v, vim.b, vim.w and vim.t ([b16231e](https://github.com/folke/neodev.nvim/commit/b16231e7af55be112fcb867fd7b5eddf2993e9da)) +* properly configure runtime.path to make require work for plugins (slow). Fixes [#23](https://github.com/folke/neodev.nvim/issues/23) ([274f72b](https://github.com/folke/neodev.nvim/commit/274f72b6bc5c199f6d2d33956f9aa0603d4c3367)) +* properly parse optional params like (*opts) ([48cca93](https://github.com/folke/neodev.nvim/commit/48cca93b6d5da62db8da46c6d81b8fde2f4c8914)) +* removed config.plugin_library in favor of config.override for easier customization ([46a2eb0](https://github.com/folke/neodev.nvim/commit/46a2eb009062bef889dd05913f92c2c11a57b189)) +* replace code regions by markdown lua code blocks ([23df3f4](https://github.com/folke/neodev.nvim/commit/23df3f4f5403dbf24ccc1c8fc998db5298a0d377)) +* rewrite with easier setup and configuration. Backward compatible, but refer to the docs to use the optimized setup ([ae74bc9](https://github.com/folke/neodev.nvim/commit/ae74bc9987638da2e122aaaf155d6519f07e6197)) +* set correct default option ([e9e1da3](https://github.com/folke/neodev.nvim/commit/e9e1da34d8faa4843fd6d860bc12f552fe2e4a2a)) +* snippet option for setup ([#47](https://github.com/folke/neodev.nvim/issues/47)) ([8553f1c](https://github.com/folke/neodev.nvim/commit/8553f1c89aa53d2e9bb94b728bdf3ebd0abb625d)) +* types for nightly ([3e97b3e](https://github.com/folke/neodev.nvim/commit/3e97b3e87fae815863a6276e14af734102d28be8)) +* types for stable ([499bc32](https://github.com/folke/neodev.nvim/commit/499bc3286050ec5bf2332ee8c6cd726e10e75e6f)) +* updated all the docs for Neovim 0.6 ([1933c7e](https://github.com/folke/neodev.nvim/commit/1933c7e014e69484572b7fa1bf73bc51c42f10f4)) +* updated docs to 0.7 ([6063731](https://github.com/folke/neodev.nvim/commit/60637315d665652c59a6a4f99a82f2308d11dd8f)) +* updated emmy lua files ([5e6caa9](https://github.com/folke/neodev.nvim/commit/5e6caa92b83a07a516d481593344bed1e6eebd6a)) +* util.error ([c771c04](https://github.com/folke/neodev.nvim/commit/c771c040cb63cdbd2f01ae8698befb64011bbe93)) +* vim.fn functions ([b1e7776](https://github.com/folke/neodev.nvim/commit/b1e7776e4c7adeaa799002cb8ee25fecdc40f444)) +* vim.lua for nightly ([cae3dfa](https://github.com/folke/neodev.nvim/commit/cae3dfa0380c9a08a27c947f7de5ee719e087ff2)) +* vimdoc parser ([ac2a760](https://github.com/folke/neodev.nvim/commit/ac2a7601c8c5d2160512d74746286ea9f9580a09)) +* when param name is string, and unknown type, then use string ([ddb8162](https://github.com/folke/neodev.nvim/commit/ddb816294b62d7ab76ecbe0f26f2bfb8aef4a5e1)) + + +### Bug Fixes + +* add correct neovim config directory when pathstrict ([d20c601](https://github.com/folke/neodev.nvim/commit/d20c601836c05039926cbfec0b895a3028af70af)) +* add lua directories to workspace.library ([563e365](https://github.com/folke/neodev.nvim/commit/563e365b96ea5848e950e216929c08c69d3f4dda)) +* add vim itself to globals ([2c9311b](https://github.com/folke/neodev.nvim/commit/2c9311b5e45b2ad71843e7e9d49ce31f59cca630)) +* added .luarc.jsonc validation also to jsonls ([8e2f046](https://github.com/folke/neodev.nvim/commit/8e2f04638f9cb6c297d16c4feef85a6f7615fafb)) +* added # for parameter docs ([3c7dfda](https://github.com/folke/neodev.nvim/commit/3c7dfda68549b6152bc0aa3c04f81a87ee9af9f9)) +* added support for builtin libraries and meta/3rd libraries ([8d47e3a](https://github.com/folke/neodev.nvim/commit/8d47e3a488eb8a05f6699036f98f8a9a7f41776b)) +* added vim.log.levels ([4331626](https://github.com/folke/neodev.nvim/commit/4331626b02f636433b504b9ab6a8c11fb9de4a24)) +* alias `buffer` type ([#103](https://github.com/folke/neodev.nvim/issues/103)) ([23b58ff](https://github.com/folke/neodev.nvim/commit/23b58ff4e486d32fe9740dcdec0084ee419e1522)) +* append on_new_config instead of replacing it ([cff0972](https://github.com/folke/neodev.nvim/commit/cff09720d23f84fa4ae46005857d7c5d7a1a4844)) +* append to existing workspace.library instead of replacing ([b4bc26d](https://github.com/folke/neodev.nvim/commit/b4bc26d91ab17b84e8f15926c18b0c0abea3b690)) +* better detection of nvim config and plugins where root-dir is incorrect ([d6212c1](https://github.com/folke/neodev.nvim/commit/d6212c1527bb5fb4dbb593318cd937ad2d4d6eee)) +* better method of finding typed directory [#6](https://github.com/folke/neodev.nvim/issues/6) ([2e1a816](https://github.com/folke/neodev.nvim/commit/2e1a81633bab27e2535d1ccf5f47dda0ba49b0ce)) +* better package path ([03a44ec](https://github.com/folke/neodev.nvim/commit/03a44ec6a54b0a025a633978e8541584a02e46d9)) +* broke require path completion again ([9da602d](https://github.com/folke/neodev.nvim/commit/9da602d023ca1af73ac2ea3813798592c904566d)) +* correctly process global_local options ([2815a2a](https://github.com/folke/neodev.nvim/commit/2815a2acb5a0cd9a11aaadb8256af15c7bf7d513)) +* docs ([7b96f30](https://github.com/folke/neodev.nvim/commit/7b96f30ca6af998b4e3caa9c3886539e3ae83384)) +* **docs:** update sumneko_lua setup example ([#67](https://github.com/folke/neodev.nvim/issues/67)) ([8b2b228](https://github.com/folke/neodev.nvim/commit/8b2b228673a88baa9267cb4a9ceb5862b5ee5df4)) +* don't add arena parameters to functions ([99ee7f2](https://github.com/folke/neodev.nvim/commit/99ee7f21e07f9979b8cf14f24ce24d49aca11494)) +* don't include lua docs in generated docs. They are correctly set up through `types/vim.lua` ([130b35e](https://github.com/folke/neodev.nvim/commit/130b35e0f671c5729d106a4fe113129cb979e4b1)) +* don't skip anything from shared, otherwise builtin lua function docs are missing like notify ([24d8cf9](https://github.com/folke/neodev.nvim/commit/24d8cf99ccdaf8ef370f3f2165538fa296cd8122)) +* dont add root_dir to workspace library. Fixes [#21](https://github.com/folke/neodev.nvim/issues/21) ([e958850](https://github.com/folke/neodev.nvim/commit/e9588503e68fa32ac08b83d9cb7e42ec31b8907d)) +* fixed lua-dev schema for settings.nvim ([d6900dc](https://github.com/folke/neodev.nvim/commit/d6900dc94a40a3215d1a8debdaaa3036c3df17e5)) +* fixed requiring files and require path ([3c18da8](https://github.com/folke/neodev.nvim/commit/3c18da83e7d4e4199857721301b9ec52bd99e487)) +* get all the lua docs for internal lua functions ([6b0d9b0](https://github.com/folke/neodev.nvim/commit/6b0d9b0559defd9840402610824aeb9339ef1319)) +* improved emmy lua annotations ([4f5a10f](https://github.com/folke/neodev.nvim/commit/4f5a10f192c1fc2b080afc852a85403b1296da8e)) +* indentation from docs ([a4e5103](https://github.com/folke/neodev.nvim/commit/a4e5103fd91e9db6d9ac924df3fff94eaca8402a)) +* line context ([fbcdd6d](https://github.com/folke/neodev.nvim/commit/fbcdd6da18c124aa0f36a5981302ff29cd644115)) +* **luv:** also parse sync return values ([7b495ec](https://github.com/folke/neodev.nvim/commit/7b495ec693ad0bd42268f12f678fdeffa2f62b98)) +* make options generation deterministic ([136ec0e](https://github.com/folke/neodev.nvim/commit/136ec0eceaef775147034e35c35ff80ad407b7da)) +* more markdown code blocks ([5b620d9](https://github.com/folke/neodev.nvim/commit/5b620d9059d28ff75aadb50b9a2be80ba0b88272)) +* more neodev renames ([d23076d](https://github.com/folke/neodev.nvim/commit/d23076d66ab87cf2d2feae7d5ff4f3cf4f0c754d)) +* move settings to lua-dev ([c62617e](https://github.com/folke/neodev.nvim/commit/c62617ee4f15e04e0e5a96f3a824a3a1c838df53)) +* mpack functions can have multiple docs ([2c2293c](https://github.com/folke/neodev.nvim/commit/2c2293cede37c19ca2cc8349fafaa8a7fe132f7d)) +* multi-line comments for parameters ([acfa55b](https://github.com/folke/neodev.nvim/commit/acfa55b291c83e6fa40a006ea824d92d624c11b6)) +* new settings.nvim API ([6477ca9](https://github.com/folke/neodev.nvim/commit/6477ca95d081e2b2397a993699c8ff643c632f85)) +* options now have proper types ([d9bd9b4](https://github.com/folke/neodev.nvim/commit/d9bd9b488e83939e746b8150f2b684e72bb1275e)) +* other way to prevent name change issues ([d3f7002](https://github.com/folke/neodev.nvim/commit/d3f70023d925b0c2e3084bb08a42aad3b2c2f027)) +* parse incorrect function signatures with missing {} ([7eb0f15](https://github.com/folke/neodev.nvim/commit/7eb0f15fe8eaef3c4204e12cd3a94e183dd8f843)) +* prepend "lua/" to package path ([b24f225](https://github.com/folke/neodev.nvim/commit/b24f22588eab04d604be7816cf5dfe09f96e7245)) +* remove duplication of lua/ ([#66](https://github.com/folke/neodev.nvim/issues/66)) ([ec50266](https://github.com/folke/neodev.nvim/commit/ec50266039f0e71178be8c1d22211f48af498efe)) +* remove root_dir from library. otherwise rename is broken ([b9b721a](https://github.com/folke/neodev.nvim/commit/b9b721a5bed76374ae7d96a6a211737954e241c7)) +* remove vimconfig from workspace library. not needed [#1](https://github.com/folke/neodev.nvim/issues/1) ([0faabb9](https://github.com/folke/neodev.nvim/commit/0faabb95aec5af07f4416a8adb3ff6a218f6a855)) +* replace `dict(something)` by `dict`, otherwise sumneko fails to render the hover ([4667d53](https://github.com/folke/neodev.nvim/commit/4667d535e7d811f5003bf57f786a0ce05ce6f516)) +* replace invalid param name characters ([e5a553c](https://github.com/folke/neodev.nvim/commit/e5a553c6ffd661ab6f42be3f6992baf42f452445)) +* resolve realpath of neovim config ([42eab7e](https://github.com/folke/neodev.nvim/commit/42eab7e0a7950f0322794a580ff10f56d1d15ee7)) +* set proper runtime.path for require completion ([7840b31](https://github.com/folke/neodev.nvim/commit/7840b31c020c04076dde9fb9e45a9f653320b3e4)) +* sort functions before writing ([72c4e61](https://github.com/folke/neodev.nvim/commit/72c4e61a6d69e9907c271893a0822142fda1facf)) +* sort vim.fn functions before writing file ([cc55fd1](https://github.com/folke/neodev.nvim/commit/cc55fd1b8aa7da0d8f75e2fa711095388fc54f0f)) +* sumneko library should be a list instead of a dict ([14004d2](https://github.com/folke/neodev.nvim/commit/14004d29ff2d408367b1e6757b0923e67e319325)) +* types for stable ([901660d](https://github.com/folke/neodev.nvim/commit/901660d70dfa98f1afe9304bf8e580125f591f12)) +* use correct key for special lsp library paths ([f879e53](https://github.com/folke/neodev.nvim/commit/f879e53f9d4efcc0035a3b395a66ac5794954c74)) +* use default values for vim.opt ([#87](https://github.com/folke/neodev.nvim/issues/87)) ([66b67cf](https://github.com/folke/neodev.nvim/commit/66b67cf8833a98f5e4f92821e4320be82f160916)) +* use existing library on settings.Lua.workspace ([cf3b028](https://github.com/folke/neodev.nvim/commit/cf3b028043e86e0e659568aede9d0c8273800b3e)) +* use lazy.plugins() ([c87f3c9](https://github.com/folke/neodev.nvim/commit/c87f3c9ffb256846e2a51f0292537073ca62d4d0)) +* workspace.library uses a map ([350b579](https://github.com/folke/neodev.nvim/commit/350b579498a7eeeab33f0ff6496e4fa1d807469a)) + + +### Performance Improvements + +* add /lua to plugin directories ([6bf74db](https://github.com/folke/neodev.nvim/commit/6bf74dbe456711d410b905fb5fb4acb87fb4ce0c)) +* disable callSnippets for now. Too slow ([616b559](https://github.com/folke/neodev.nvim/commit/616b559dff0307adbe62606f806c2b568a6322d5)) +* disable legacy setup mechanism, but still show warning ([82423f5](https://github.com/folke/neodev.nvim/commit/82423f569d51c79733f5599fb11fb8df46b324d6)) +* dont use glob to find lua dirs. Check bufs instead. Fixes [#80](https://github.com/folke/neodev.nvim/issues/80) ([97ebf23](https://github.com/folke/neodev.nvim/commit/97ebf23c0d4f5a11f1d68a5abd468751b14980a1)) +* remove runtime path again. way too slow ([e151df6](https://github.com/folke/neodev.nvim/commit/e151df68973b3aca4c88f6d602f89574d7d32200)) diff --git a/bundle/neodev.nvim/LICENSE b/bundle/neodev.nvim/LICENSE new file mode 100644 index 000000000..261eeb9e9 --- /dev/null +++ b/bundle/neodev.nvim/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/bundle/neodev.nvim/README.md b/bundle/neodev.nvim/README.md new file mode 100644 index 000000000..8fdb58681 --- /dev/null +++ b/bundle/neodev.nvim/README.md @@ -0,0 +1,143 @@ +# 💻 neodev.nvim + +Neovim setup for init.lua and plugin development with full signature help, docs and +completion for the nvim lua API. + +![image](https://user-images.githubusercontent.com/292349/201495543-ff532160-c8bd-4651-a16f-4fb682c9b945.png) + +## ✨ Features + +- Automatically configures **lua-language-server** for your **Neovim** config, **Neovim** runtime and plugin + directories +- [Annotations](https://github.com/LuaLS/lua-language-server/wiki/Annotations) for completion, hover and signatures of: + - Vim functions + - Neovim api functions + - `vim.opt` + - [vim.loop](https://github.com/luvit/luv) +- properly configures the `require` path. +- adds all plugins in `opt` and `start` to the workspace so you get completion + for all installed plugins +- properly configure the vim runtime + +## ⚡️ Requirements + +- Neovim >= 0.7.0 +- completion plugin like [nvim-cmp](https://github.com/hrsh7th/nvim-cmp) + +## 📦 Installation + +Install the plugin with your preferred package manager: + +### [lazy.nvim](https://github.com/folke/lazy.nvim) + +```lua +{ "folke/neodev.nvim", opts = {} } +``` + +### [vim-plug](https://github.com/junegunn/vim-plug) + +```vim +Plug 'folke/neodev.nvim' +``` + +## ⚙️ Configuration + +**neodev** comes with the following defaults: + +```lua +{ + library = { + enabled = true, -- when not enabled, neodev will not change any settings to the LSP server + -- these settings will be used for your Neovim config directory + runtime = true, -- runtime path + types = true, -- full signature, docs and completion of vim.api, vim.treesitter, vim.lsp and others + plugins = true, -- installed opt or start plugins in packpath + -- you can also specify the list of plugins to make available as a workspace library + -- plugins = { "nvim-treesitter", "plenary.nvim", "telescope.nvim" }, + }, + setup_jsonls = true, -- configures jsonls to provide completion for project specific .luarc.json files + -- for your Neovim config directory, the config.library settings will be used as is + -- for plugin directories (root_dirs having a /lua directory), config.library.plugins will be disabled + -- for any other directory, config.library.enabled will be set to false + override = function(root_dir, options) end, + -- With lspconfig, Neodev will automatically setup your lua-language-server + -- If you disable this, then you have to set {before_init=require("neodev.lsp").before_init} + -- in your lsp start options + lspconfig = true, + -- much faster, but needs a recent built of lua-language-server + -- needs lua-language-server >= 3.6.0 + pathStrict = true, +} +``` + +## 🚀 Setup + +**neodev** will **ONLY** change the **lua_ls** settings for: + +- your Neovim config directory +- your Neovim runtime directory +- any plugin directory (this is an lsp root_dir that contains a `/lua` + directory) + +For any other `root_dir`, **neodev** will **NOT** change any settings. + +> **TIP** with [neoconf.nvim](https://github.com/folke/neoconf.nvim), you can easily set project local **Neodev** settings. +> See the example [.neoconf.json](https://github.com/folke/neodev.nvim/blob/main/.neoconf.json) file in this repository + +```lua +-- IMPORTANT: make sure to setup neodev BEFORE lspconfig +require("neodev").setup({ + -- add any options here, or leave empty to use the default settings +}) + +-- then setup your lsp server as usual +local lspconfig = require('lspconfig') + +-- example to setup lua_ls and enable call snippets +lspconfig.lua_ls.setup({ + settings = { + Lua = { + completion = { + callSnippet = "Replace" + } + } + } +}) +``` + +
+Example for setting up **neodev** that overrides the settings for `/etc/nixos` + +```lua +-- You can override the default detection using the override function +-- EXAMPLE: If you want a certain directory to be configured differently, you can override its settings +require("neodev").setup({ + override = function(root_dir, library) + if require("neodev.util").has_file(root_dir, "/etc/nixos") then + library.enabled = true + library.plugins = true + end + end, +}) +``` + +
+ +It's possible to setup Neodev without lspconfig, by configuring the `before_init` +of the options passed to `vim.lsp.start`. + +
+Example without lspconfig + +```lua +-- dont run neodev.setup +vim.lsp.start({ + name = "lua-language-server", + cmd = { "lua-language-server" }, + before_init = require("neodev.lsp").before_init, + root_dir = vim.fn.getcwd(), + settings = { Lua = {} }, +}) +``` + +
diff --git a/bundle/neodev.nvim/doc/lua-dev.txt b/bundle/neodev.nvim/doc/lua-dev.txt new file mode 100644 index 000000000..3fcae1a84 --- /dev/null +++ b/bundle/neodev.nvim/doc/lua-dev.txt @@ -0,0 +1,163 @@ +*lua-dev.txt* For NVIM v0.5.0 Last change: 2022 October 14 + +============================================================================== +Table of Contents *lua-dev-table-of-contents* + +1. lua-dev |lua-dev-lua-dev| + - Features |lua-dev-features| + - Requirements |lua-dev-requirements| + - Installation |lua-dev-installation| + - Configuration |lua-dev-configuration| + - Setup |lua-dev-setup| + - How? |lua-dev-how?| + +============================================================================== +1. lua-dev *lua-dev-lua-dev* + +Dev setup for init.lua and plugin development with full signature help, docs +and completion for the nvim lua API. + +
+ +

image

+
+ +
+ +

image

+
+ +FEATURES *lua-dev-features* + + +- Automatically configures **lua-language-server** for your **Neovim** config, **Neovim** runtime and plugin + directories +- Annotations for completion, hover and signatures of: + - Vim functions + - Neovim api functions + - `vim.opt` + - vim.loop +- properly configures the `require` path. +- adds all plugins in `opt` and `start` to the workspace so you get completion + for all installed plugins +- properly configure the vim runtime + + +REQUIREMENTS *lua-dev-requirements* + + +- Neovim >= 0.7.0 +- completion plugin like nvim-cmp + + +INSTALLATION *lua-dev-installation* + +Install the plugin with your preferred package manager: + +PACKER ~ + +> + use "folke/lua-dev.nvim" +< + + +VIM-PLUG ~ + +> + Plug 'folke/lua-dev.nvim' +< + + +CONFIGURATION *lua-dev-configuration* + +**lua-dev** comes with the following defaults: + +> + { + library = { + enabled = true, -- when not enabled, lua-dev will not change any settings to the LSP server + -- these settings will be used for your Neovim config directory + runtime = true, -- runtime path + types = true, -- full signature, docs and completion of vim.api, vim.treesitter, vim.lsp and others + plugins = true, -- installed opt or start plugins in packpath + -- you can also specify the list of plugins to make available as a workspace library + -- plugins = { "nvim-treesitter", "plenary.nvim", "telescope.nvim" }, + }, + setup_jsonls = true, -- configures jsonls to provide completion for project specific .luarc.json files + -- for your Neovim config directory, the config.library settings will be used as is + -- for plugin directories (root_dirs having a /lua directory), config.library.plugins will be disabled + -- for any other directory, config.library.enabled will be set to false + override = function(root_dir, options) end, + + } +< + + +SETUP *lua-dev-setup* + +**lua-dev** will **ONLY** change the **lua_ls** settings for: + + +- your Neovim config directory +- your Neovim runtime directory +- any plugin directory (this is an lsp root_dir that contains a `/lua` + directory) + + +For any other `root_dir`, **lua-dev** will **NOT** change any settings. + +> + -- IMPORTANT: make sure to setup lua-dev BEFORE lspconfig + require("lua-dev").setup({ + -- add any options here, or leave empty to use the default settings + }) + + -- then setup your lsp server as usual + local lspconfig = require('lspconfig') + + -- example to setup sumneko and enable call snippets + lspconfig.lua_ls.setup({ + settings = { + Lua = { + completion = { + callSnippet = "Replace" + } + } + } + }) +< + + +Example for setting up **lua-dev** that overrides the settings for `/etc/nixos` + +> + -- You can override the default detection using the override function + -- EXAMPLE: If you want a certain directory to be configured differently, you can override its settings + require("lua-dev").setup({ + override = function(root_dir, library) + if require("lua-dev.util").has_file(root_dir, "/etc/nixos") then + library.enabled = true + library.plugins = true + end + end, + }) +< + + +HOW? *lua-dev-how?* + +**Neovim** includes a script + to +generate the nvim docs. That script also creates message pack files containing +all the API metadata in a structured way. Unfortunately these files are not +packaged in the releases. + +Using the message pack files, I converted all the API data to EmmyLua +annotations + and +make them available for the Sumneko LSP + as a workspace library. + +Generated by panvimdoc + +vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/bundle/neodev.nvim/doc/neodev.nvim.txt b/bundle/neodev.nvim/doc/neodev.nvim.txt new file mode 100644 index 000000000..b89d7bcf5 --- /dev/null +++ b/bundle/neodev.nvim/doc/neodev.nvim.txt @@ -0,0 +1,166 @@ +*neodev.nvim.txt* For Neovim >= 0.8.0 Last change: 2023 May 30 + +============================================================================== +Table of Contents *neodev.nvim-table-of-contents* + +1. neodev.nvim |neodev.nvim-neodev.nvim| + - Features |neodev.nvim-neodev.nvim-features| + - Requirements |neodev.nvim-neodev.nvim-requirements| + - Installation |neodev.nvim-neodev.nvim-installation| + - Configuration |neodev.nvim-neodev.nvim-configuration| + - Setup |neodev.nvim-neodev.nvim-setup| + +============================================================================== +1. neodev.nvim *neodev.nvim-neodev.nvim* + +Neovim setup for init.lua and plugin development with full signature help, docs +and completion for the nvim lua API. + + +FEATURES *neodev.nvim-neodev.nvim-features* + +- Automatically configures **lua-language-server** for your **Neovim** config, **Neovim** runtime and plugin + directories +- Annotations for completion, hover and signatures of: + - Vim functions + - Neovim api functions + - `vim.opt` + - vim.loop +- properly configures the `require` path. +- adds all plugins in `opt` and `start` to the workspace so you get completion + for all installed plugins +- properly configure the vim runtime + + +REQUIREMENTS *neodev.nvim-neodev.nvim-requirements* + +- Neovim >= 0.7.0 +- completion plugin like nvim-cmp + + +INSTALLATION *neodev.nvim-neodev.nvim-installation* + +Install the plugin with your preferred package manager: + + +LAZY.NVIM ~ + +>lua + { "folke/neodev.nvim", opts = {} } +< + + +VIM-PLUG ~ + +>vim + Plug 'folke/neodev.nvim' +< + + +CONFIGURATION *neodev.nvim-neodev.nvim-configuration* + +**neodev** comes with the following defaults: + +>lua + { + library = { + enabled = true, -- when not enabled, neodev will not change any settings to the LSP server + -- these settings will be used for your Neovim config directory + runtime = true, -- runtime path + types = true, -- full signature, docs and completion of vim.api, vim.treesitter, vim.lsp and others + plugins = true, -- installed opt or start plugins in packpath + -- you can also specify the list of plugins to make available as a workspace library + -- plugins = { "nvim-treesitter", "plenary.nvim", "telescope.nvim" }, + }, + setup_jsonls = true, -- configures jsonls to provide completion for project specific .luarc.json files + -- for your Neovim config directory, the config.library settings will be used as is + -- for plugin directories (root_dirs having a /lua directory), config.library.plugins will be disabled + -- for any other directory, config.library.enabled will be set to false + override = function(root_dir, options) end, + -- With lspconfig, Neodev will automatically setup your lua-language-server + -- If you disable this, then you have to set {before_init=require("neodev.lsp").before_init} + -- in your lsp start options + lspconfig = true, + -- much faster, but needs a recent built of lua-language-server + -- needs lua-language-server >= 3.6.0 + pathStrict = true, + } +< + + +SETUP *neodev.nvim-neodev.nvim-setup* + +**neodev** will **ONLY** change the **lua_ls** settings for: + +- your Neovim config directory +- your Neovim runtime directory +- any plugin directory (this is an lsp root_dir that contains a `/lua` + directory) + +For any other `root_dir`, **neodev** will **NOT** change any settings. + + + **TIP** with neoconf.nvim , you can + easily set project local **Neodev** settings. See the example .neoconf.json + file in this + repository +>lua + -- IMPORTANT: make sure to setup neodev BEFORE lspconfig + require("neodev").setup({ + -- add any options here, or leave empty to use the default settings + }) + + -- then setup your lsp server as usual + local lspconfig = require('lspconfig') + + -- example to setup lua_ls and enable call snippets + lspconfig.lua_ls.setup({ + settings = { + Lua = { + completion = { + callSnippet = "Replace" + } + } + } + }) +< + +Example for setting up **neodev** that overrides the settings for `/etc/nixos` ~ + +>lua + -- You can override the default detection using the override function + -- EXAMPLE: If you want a certain directory to be configured differently, you can override its settings + require("neodev").setup({ + override = function(root_dir, library) + if require("neodev.util").has_file(root_dir, "/etc/nixos") then + library.enabled = true + library.plugins = true + end + end, + }) +< + +It’s possible to setup Neodev without lspconfig, by configuring the +`before_init` of the options passed to `vim.lsp.start`. + +Example without lspconfig ~ + +>lua + -- dont run neodev.setup + vim.lsp.start({ + name = "lua-language-server", + cmd = { "lua-language-server" }, + before_init = require("neodev.lsp").before_init, + root_dir = vim.fn.getcwd(), + settings = { Lua = {} }, + }) +< + +============================================================================== +2. Links *neodev.nvim-links* + +1. *image*: https://user-images.githubusercontent.com/292349/201495543-ff532160-c8bd-4651-a16f-4fb682c9b945.png + +Generated by panvimdoc + +vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/bundle/neodev.nvim/lua/lua-dev.lua b/bundle/neodev.nvim/lua/lua-dev.lua new file mode 100644 index 000000000..23193b7ec --- /dev/null +++ b/bundle/neodev.nvim/lua/lua-dev.lua @@ -0,0 +1,6 @@ +vim.notify( + "'lua-dev' was renamed to 'neodev'. Please update your config.", + vim.log.levels.WARN, + { title = "neodev.nvim" } +) +return require("neodev") diff --git a/bundle/neodev.nvim/lua/neodev/config.lua b/bundle/neodev.nvim/lua/neodev/config.lua new file mode 100644 index 000000000..dcef4dca1 --- /dev/null +++ b/bundle/neodev.nvim/lua/neodev/config.lua @@ -0,0 +1,57 @@ +local M = {} + +--- @class LuaDevOptions +M.defaults = { + library = { + enabled = true, -- when not enabled, neodev will not change any settings to the LSP server + -- these settings will be used for your neovim config directory + runtime = true, -- runtime path + types = true, -- full signature, docs and completion of vim.api, vim.treesitter, vim.lsp and others + ---@type boolean|string[] + plugins = true, -- installed opt or start plugins in packpath + -- you can also specify the list of plugins to make available as a workspace library + -- plugins = { "nvim-treesitter", "plenary.nvim", "telescope.nvim" }, + }, + setup_jsonls = true, -- configures jsonls to provide completion for .luarc.json files + -- for your neovim config directory, the config.library settings will be used as is + -- for plugin directories (root_dirs having a /lua directory), config.library.plugins will be disabled + -- for any other directory, config.library.enabled will be set to false + override = function(root_dir, options) end, + -- With lspconfig, Neodev will automatically setup your lua-language-server + -- If you disable this, then you have to set {before_init=require("neodev.lsp").before_init} + -- in your lsp start options + lspconfig = true, + -- much faster, but needs a recent built of lua-language-server + -- needs lua-language-server >= 3.6.0 + pathStrict = true, + debug = false, +} + +--- @type LuaDevOptions +M.options = {} + +function M.setup(options) + M.options = vim.tbl_deep_extend("force", {}, M.defaults, options or {}) +end + +function M.types() + return M.root("/types/" .. M.version()) +end + +---@param root? string +function M.root(root) + local f = debug.getinfo(1, "S").source:sub(2) + return vim.loop.fs_realpath(vim.fn.fnamemodify(f, ":h:h:h") .. "/" .. (root or "")) +end + +---@return "nightly" | "stable" +function M.version() + return vim.version().prerelease and "nightly" or "stable" +end + +---@return LuaDevOptions +function M.merge(options) + return vim.tbl_deep_extend("force", {}, M.options, options or {}) +end + +return M diff --git a/bundle/neodev.nvim/lua/neodev/init.lua b/bundle/neodev.nvim/lua/neodev/init.lua new file mode 100644 index 000000000..35ce21fe5 --- /dev/null +++ b/bundle/neodev.nvim/lua/neodev/init.lua @@ -0,0 +1,39 @@ +local M = {} + +local function neoconf(config) + pcall(function() + require("neoconf.plugins").register({ + on_schema = function(schema) + schema:import("neodev", config.defaults) + schema:set("neodev.library.plugins", { + description = "true/false or an array of plugin names to enable", + anyOf = { + { type = "boolean" }, + { type = "array", items = { type = "string" } }, + }, + }) + end, + }) + end) +end + +---@param opts? LuaDevOptions +function M.setup(opts) + local config = require("neodev.config") + config.setup(opts) + + if config.options.lspconfig then + require("neodev.lsp").setup() + end + + neoconf(config) + + -- leave this for now for backward compatibility + return { + settings = { + legacy = true, + }, + } +end + +return M diff --git a/bundle/neodev.nvim/lua/neodev/lsp.lua b/bundle/neodev.nvim/lua/neodev/lsp.lua new file mode 100644 index 000000000..52148ef05 --- /dev/null +++ b/bundle/neodev.nvim/lua/neodev/lsp.lua @@ -0,0 +1,97 @@ +local util = require("neodev.util") + +local M = {} + +function M.setup() + local opts = require("neodev.config").options + + local lsputil = require("lspconfig.util") + local hook = lsputil.add_hook_after + lsputil.on_setup = hook(lsputil.on_setup, function(config) + if opts.setup_jsonls and config.name == "jsonls" then + M.setup_jsonls(config) + end + if config.name == "lua_ls" then + config.on_new_config = hook(config.on_new_config, M.on_new_config) + -- config.before_init = hook(config.before_init, M.before_init) + end + end) +end + +function M.setup_jsonls(config) + local schemas = config.settings.json and config.settings.json.schemas or {} + table.insert(schemas, { + name = "LuaLS Settings", + url = "https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json", + fileMatch = { ".luarc.json", ".luarc.jsonc" }, + }) + config.settings = vim.tbl_deep_extend("force", config.settings, { + json = { + schemas = schemas, + validate = { + enable = true, + }, + }, + }) +end + +function M.before_init(params, config) + M.on_new_config(config, params.rootPath) +end + +function M.on_new_config(config, root_dir) + -- don't do anything when old style setup was used + if config.settings.legacy then + util.warn( + "You're using the old way of setting up neodev (previously lua-dev).\nPlease check the docs at https://github.com/folke/neodev.nvim#-setup" + ) + return + end + + local lua_root = util.find_root() + + local opts = require("neodev.config").merge() + + opts.library.enabled = util.is_nvim_config() + + if not opts.library.enabled and lua_root then + opts.library.enabled = true + opts.library.plugins = false + end + + pcall(function() + opts = require("neoconf").get("neodev", opts, { file = root_dir }) + end) + + pcall(opts.override, root_dir, opts.library) + + local library = config.settings + and config.settings.Lua + and config.settings.Lua.workspace + and config.settings.Lua.workspace.library + or {} + + local ignoreDir = config.settings + and config.settings.Lua + and config.settings.Lua.workspace + and config.settings.Lua.workspace.ignoreDir + or {} + + if opts.library.enabled then + config.settings = + vim.tbl_deep_extend("force", config.settings or {}, require("neodev.luals").setup(opts, config.settings).settings) + for _, lib in ipairs(library) do + table.insert(config.settings.Lua.workspace.library, lib) + end + + if require("neodev.config").options.pathStrict and lua_root then + table.insert(config.settings.Lua.workspace.library, lua_root) + end + + for _, dir in ipairs(ignoreDir) do + table.insert(config.settings.Lua.workspace.ignoreDir, dir) + end + end +end + +return M diff --git a/bundle/neodev.nvim/lua/neodev/luals.lua b/bundle/neodev.nvim/lua/neodev/luals.lua new file mode 100644 index 000000000..76ad4f5f9 --- /dev/null +++ b/bundle/neodev.nvim/lua/neodev/luals.lua @@ -0,0 +1,110 @@ +local config = require("neodev.config") + +local M = {} + +---@param opts LuaDevOptions +function M.library(opts) + opts = config.merge(opts) + local ret = {} + + if opts.library.types then + table.insert(ret, config.types()) + end + + local function add(lib, filter) + ---@diagnostic disable-next-line: param-type-mismatch + for _, p in ipairs(vim.fn.expand(lib .. "/lua", false, true)) do + local plugin_name = vim.fn.fnamemodify(p, ":h:t") + p = vim.loop.fs_realpath(p) + if p and (not filter or filter[plugin_name]) then + if config.options.pathStrict then + table.insert(ret, p) + else + table.insert(ret, vim.fn.fnamemodify(p, ":h")) + end + end + end + end + + if opts.library.runtime then + add(type(opts.library.runtime) == "string" and opts.library.runtime or "$VIMRUNTIME") + end + + if opts.library.plugins then + ---@type table + local filter + if type(opts.library.plugins) == "table" then + filter = {} + for _, p in pairs(opts.library.plugins) do + filter[p] = true + end + end + for _, site in pairs(vim.split(vim.o.packpath, ",")) do + add(site .. "/pack/*/opt/*", filter) + add(site .. "/pack/*/start/*", filter) + end + -- add support for lazy.nvim + if package.loaded["lazy"] then + for _, plugin in ipairs(require("lazy").plugins()) do + add(plugin.dir, filter) + end + end + end + + return ret +end + +---@param settings? lspconfig.settings.lua_ls +function M.path(settings) + if config.options.pathStrict then + return { "?.lua", "?/init.lua" } + end + + settings = settings or {} + local runtime = settings.Lua and settings.Lua.runtime or {} + local meta = runtime.meta or "${version} ${language} ${encoding}" + meta = meta:gsub("%${version}", runtime.version or "LuaJIT") + meta = meta:gsub("%${language}", "en-us") + meta = meta:gsub("%${encoding}", runtime.fileEncoding or "utf8") + + return { + -- paths for builtin libraries + ("meta/%s/?.lua"):format(meta), + ("meta/%s/?/init.lua"):format(meta), + -- paths for meta/3rd libraries + "library/?.lua", + "library/?/init.lua", + -- Neovim lua files, config and plugins + "lua/?.lua", + "lua/?/init.lua", + } +end + +---@param opts? LuaDevOptions +---@param settings? lspconfig.settings.lua_ls +function M.setup(opts, settings) + opts = config.merge(opts) + return { + ---@type lspconfig.settings.lua_ls + settings = { + Lua = { + runtime = { + version = "LuaJIT", + path = M.path(settings), + pathStrict = config.options.pathStrict, + }, + ---@diagnostic disable-next-line: undefined-field + completion = opts.snippet and { callSnippet = "Replace" } or nil, + workspace = { + -- Make the server aware of Neovim runtime files + library = M.library(opts), + -- when pathStrict=false, we need to add the other types to ignoreDir, + -- otherwise they get indexed + ignoreDir = { config.version() == "stable" and "types/nightly" or "types/stable", "lua" }, + }, + }, + }, + } +end + +return M diff --git a/bundle/neodev.nvim/lua/neodev/util.lua b/bundle/neodev.nvim/lua/neodev/util.lua new file mode 100644 index 000000000..c06fb9411 --- /dev/null +++ b/bundle/neodev.nvim/lua/neodev/util.lua @@ -0,0 +1,87 @@ +local config = require("neodev.config") + +local M = {} + +--- find the root directory that has /lua +---@param path string? +---@return string? +function M.find_root(path) + path = path or vim.api.nvim_buf_get_name(0) + return vim.fs.find({ "lua" }, { path = path, upward = true, type = "directory" })[1] +end + +function M.fetch(url) + local fd = io.popen(string.format("curl -s -k %q", url)) + if not fd then + error(("Could not download %s"):format(url)) + end + local ret = fd:read("*a") + fd:close() + return ret +end + +function M.is_nvim_config() + local path = vim.loop.fs_realpath(vim.api.nvim_buf_get_name(0)) + if path then + path = vim.fs.normalize(path) + local config_root = vim.loop.fs_realpath(vim.fn.stdpath("config")) or vim.fn.stdpath("config") + config_root = vim.fs.normalize(config_root) + return path:find(config_root, 1, true) == 1 + end + return false +end + +function M.keys(tbl) + local ret = vim.tbl_keys(tbl) + table.sort(ret) + return ret +end + +---@generic K +---@generic V +---@param tbl table +---@param fn fun(key: K, value: V) +function M.for_each(tbl, fn) + local keys = M.keys(tbl) + for _, key in ipairs(keys) do + fn(key, tbl[key]) + end +end + +---@param file string +---@param flags? string +---@return string +function M.read_file(file, flags) + local fd = io.open(file, "r" .. (flags or "")) + if not fd then + error(("Could not open file %s for reading"):format(file)) + end + local data = fd:read("*a") + fd:close() + return data +end + +function M.write_file(file, data) + local fd = io.open(file, "w+") + if not fd then + error(("Could not open file %s for writing"):format(file)) + end + fd:write(data) + fd:close() +end + +function M.debug(msg) + if config.options.debug then + M.error(msg) + end +end + +function M.error(msg) + vim.notify_once(msg, vim.log.levels.ERROR, { title = "neodev.nvim" }) +end + +function M.warn(msg) + vim.notify_once(msg, vim.log.levels.WARN, { title = "neodev.nvim" }) +end + +return M diff --git a/bundle/neodev.nvim/selene.toml b/bundle/neodev.nvim/selene.toml new file mode 100644 index 000000000..6540d6f99 --- /dev/null +++ b/bundle/neodev.nvim/selene.toml @@ -0,0 +1 @@ +std="lua51+vim" diff --git a/bundle/neodev.nvim/stylua.toml b/bundle/neodev.nvim/stylua.toml new file mode 100644 index 000000000..5d6c50dce --- /dev/null +++ b/bundle/neodev.nvim/stylua.toml @@ -0,0 +1,3 @@ +indent_type = "Spaces" +indent_width = 2 +column_width = 120 \ No newline at end of file diff --git a/bundle/neodev.nvim/types/nightly/alias.lua b/bundle/neodev.nvim/types/nightly/alias.lua new file mode 100644 index 000000000..68f7752bd --- /dev/null +++ b/bundle/neodev.nvim/types/nightly/alias.lua @@ -0,0 +1,11 @@ +---@meta + +---@alias blob number +---@alias buffer integer +---@alias channel integer +---@alias float number +---@alias job number +---@alias object any +---@alias sends number +---@alias tabpage integer +---@alias window integer diff --git a/bundle/neodev.nvim/types/nightly/api.lua b/bundle/neodev.nvim/types/nightly/api.lua new file mode 100644 index 000000000..7d1edf97b --- /dev/null +++ b/bundle/neodev.nvim/types/nightly/api.lua @@ -0,0 +1,3035 @@ +---@meta + +---@class vim.api +vim.api = {} + + +--- @param buffer buffer +--- @param first number +--- @param last number +function vim.api.nvim__buf_redraw_range(buffer, first, last) end + +--- @param buffer buffer +function vim.api.nvim__buf_stats(buffer) end + +function vim.api.nvim__get_lib_dir() end + +-- Find files in runtime directories +-- +-- Attributes: ~ +-- |api-fast| +-- +-- Parameters: ~ +-- • {pat} pattern of files to search for +-- • {all} whether to return all matches or only the first +-- • {opts} is_lua: only search lua subdirs +-- +-- Return: ~ +-- list of absolute paths to the found files +--- @param opts? table +function vim.api.nvim__get_runtime(pat, all, opts) end + +-- Returns object given as argument. +-- +-- This API function is used for testing. One should not rely on its presence +-- in plugins. +-- +-- Parameters: ~ +-- • {obj} Object to return. +-- +-- Return: ~ +-- its argument. +function vim.api.nvim__id(obj) end + +-- Returns array given as argument. +-- +-- This API function is used for testing. One should not rely on its presence +-- in plugins. +-- +-- Parameters: ~ +-- • {arr} Array to return. +-- +-- Return: ~ +-- its argument. +function vim.api.nvim__id_array(arr) end + +-- Returns dictionary given as argument. +-- +-- This API function is used for testing. One should not rely on its presence +-- in plugins. +-- +-- Parameters: ~ +-- • {dct} Dictionary to return. +-- +-- Return: ~ +-- its argument. +function vim.api.nvim__id_dictionary(dct) end + +-- Returns floating-point value given as argument. +-- +-- This API function is used for testing. One should not rely on its presence +-- in plugins. +-- +-- Parameters: ~ +-- • {flt} Value to return. +-- +-- Return: ~ +-- its argument. +function vim.api.nvim__id_float(flt) end + +-- NB: if your UI doesn't use hlstate, this will not return hlstate first +-- time. +--- @param col number +function vim.api.nvim__inspect_cell(grid, row, col) end + +function vim.api.nvim__runtime_inspect() end + +--- @param path string +function vim.api.nvim__screenshot(path) end + +-- Gets internal stats. +-- +-- Return: ~ +-- Map of various internal stats. +function vim.api.nvim__stats() end + +--- @param str string +function vim.api.nvim__unpack(str) 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()| highlights follow changes to line +-- numbering (as lines are inserted/removed above the highlighted line), like +-- signs and marks do. +-- +-- 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_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 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, or 0 for current buffer +-- • {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 highlight +-- • {col_end} End of (byte-indexed) column range to highlight, or -1 to +-- highlight to end of line +-- +-- Return: ~ +-- The ns_id that was used +--- @param buffer buffer +--- @param ns_id number +--- @param hl_group string +--- @param line number +--- @param col_start number +--- @param col_end number +--- @return number +function vim.api.nvim_buf_add_highlight(buffer, ns_id, hl_group, line, col_start, col_end) end + +-- Activates buffer-update events on a channel, or as Lua callbacks. +-- +-- Example (Lua): capture buffer updates in a global `events` variable (use "print(vim.inspect(events))" to see its contents): +-- ```lua +-- events = {} +-- vim.api.nvim_buf_attach(0, false, { +-- on_lines=function(...) table.insert(events, {...}) end}) +-- ``` +-- +-- Parameters: ~ +-- • {buffer} Buffer handle, or 0 for current buffer +-- • {send_buffer} True if the initial notification should contain the +-- whole buffer: first notification will be +-- `nvim_buf_lines_event`. Else the first notification +-- will be `nvim_buf_changedtick_event`. Not for Lua +-- callbacks. +-- • {opts} Optional parameters. +-- • on_lines: Lua callback invoked on change. Return `true` to detach. Args: +-- • the string "lines" +-- • buffer handle +-- • b:changedtick +-- • first line that changed (zero-indexed) +-- • last line that was changed +-- • last line in the updated range +-- • byte count of previous contents +-- • deleted_codepoints (if `utf_sizes` is true) +-- • deleted_codeunits (if `utf_sizes` is true) +-- +-- • on_bytes: lua callback invoked on change. This +-- callback receives more granular information about the +-- change compared to on_lines. Return `true` to detach. Args: +-- • the string "bytes" +-- • buffer handle +-- • b:changedtick +-- • start row of the changed text (zero-indexed) +-- • start column of the changed text +-- • byte offset of the changed text (from the start of +-- the buffer) +-- • old end row of the changed text +-- • old end column of the changed text +-- • old end byte length of the changed text +-- • new end row of the changed text +-- • new end column of the changed text +-- • new end byte length of the changed text +-- +-- • on_changedtick: Lua callback invoked on changedtick +-- increment without text change. Args: +-- • the string "changedtick" +-- • buffer handle +-- • b:changedtick +-- +-- • on_detach: Lua callback invoked on detach. Args: +-- • the string "detach" +-- • buffer handle +-- +-- • on_reload: Lua callback invoked on reload. The entire +-- buffer content should be considered changed. Args: +-- • the string "reload" +-- • buffer handle +-- +-- • utf_sizes: include UTF-32 and UTF-16 size of the +-- replaced region, as args to `on_lines`. +-- • preview: also attach to command preview (i.e. +-- 'inccommand') events. +-- +-- Return: ~ +-- False if attach failed (invalid parameter, or buffer isn't loaded); +-- otherwise True. TODO: LUA_API_NO_EVAL +-- +-- See also: ~ +-- • |nvim_buf_detach()| +-- • |api-buffer-updates-lua| +--- @param buffer buffer +--- @param send_buffer boolean +--- @param opts table +--- @return boolean +function vim.api.nvim_buf_attach(buffer, send_buffer, opts) end + +-- call a function with buffer as temporary current buffer +-- +-- This temporarily switches current buffer to "buffer". If the current +-- window already shows "buffer", the window is not switched If a window +-- inside the current tabpage (including a float) already shows the buffer +-- One of these windows will be set as current window temporarily. Otherwise +-- a temporary scratch window (called the "autocmd window" for historical +-- reasons) will be used. +-- +-- This is useful e.g. to call vimL functions that only work with the current +-- buffer/window currently, like |termopen()|. +-- +-- Attributes: ~ +-- Lua |vim.api| only +-- +-- Parameters: ~ +-- • {buffer} Buffer handle, or 0 for current buffer +-- • {fun} Function to call inside the buffer (currently lua callable +-- only) +-- +-- Return: ~ +-- Return value of function. NB: will deepcopy lua values currently, use +-- upvalues to send lua references in and out. +--- @param buffer buffer +--- @param fun fun() +--- @return object +function vim.api.nvim_buf_call(buffer, fun) end + +-- Clears |namespace|d objects (highlights, |extmarks|, virtual text) from a +-- region. +-- +-- Lines are 0-indexed. |api-indexing| To clear the namespace in the entire +-- buffer, specify line_start=0 and line_end=-1. +-- +-- Parameters: ~ +-- • {buffer} Buffer handle, or 0 for current buffer +-- • {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 buffer. +--- @param buffer buffer +--- @param ns_id number +--- @param line_start number +--- @param line_end number +function vim.api.nvim_buf_clear_namespace(buffer, ns_id, line_start, line_end) end + +-- Creates a buffer-local command |user-commands|. +-- +-- Parameters: ~ +-- • {buffer} Buffer handle, or 0 for current buffer. +-- +-- See also: ~ +-- • nvim_create_user_command +--- @param buffer buffer +--- @param name string +--- @param command object +--- @param opts? table +function vim.api.nvim_buf_create_user_command(buffer, name, command, opts) end + +-- Removes an |extmark|. +-- +-- Parameters: ~ +-- • {buffer} Buffer handle, or 0 for current buffer +-- • {ns_id} Namespace id from |nvim_create_namespace()| +-- • {id} Extmark id +-- +-- Return: ~ +-- true if the extmark was found, else false +--- @param buffer buffer +--- @param ns_id number +--- @param id number +--- @return boolean +function vim.api.nvim_buf_del_extmark(buffer, ns_id, id) end + +-- Unmaps a buffer-local |mapping| for the given mode. +-- +-- Parameters: ~ +-- • {buffer} Buffer handle, or 0 for current buffer +-- +-- See also: ~ +-- • |nvim_del_keymap()| +--- @param buffer buffer +--- @param mode string +--- @param lhs string +function vim.api.nvim_buf_del_keymap(buffer, mode, lhs) end + +-- Deletes a named mark in the buffer. See |mark-motions|. +-- +-- Note: +-- only deletes marks set in the buffer, if the mark is not set in the +-- buffer it will return false. +-- +-- Parameters: ~ +-- • {buffer} Buffer to set the mark on +-- • {name} Mark name +-- +-- Return: ~ +-- true if the mark was deleted, else false. +-- +-- See also: ~ +-- • |nvim_buf_set_mark()| +-- • |nvim_del_mark()| +--- @param buffer buffer +--- @param name string +--- @return boolean +function vim.api.nvim_buf_del_mark(buffer, name) end + +-- Delete a buffer-local user-defined command. +-- +-- Only commands created with |:command-buffer| or +-- |nvim_buf_create_user_command()| can be deleted with this function. +-- +-- Parameters: ~ +-- • {buffer} Buffer handle, or 0 for current buffer. +-- • {name} Name of the command to delete. +--- @param buffer buffer +--- @param name string +function vim.api.nvim_buf_del_user_command(buffer, name) end + +-- Removes a buffer-scoped (b:) variable +-- +-- Parameters: ~ +-- • {buffer} Buffer handle, or 0 for current buffer +-- • {name} Variable name +--- @param buffer buffer +--- @param name string +function vim.api.nvim_buf_del_var(buffer, name) end + +-- Deletes the buffer. See |:bwipeout| +-- +-- Attributes: ~ +-- not allowed when |textlock| is active +-- +-- Parameters: ~ +-- • {buffer} Buffer handle, or 0 for current buffer +-- • {opts} Optional parameters. Keys: +-- • force: Force deletion and ignore unsaved changes. +-- • unload: Unloaded only, do not delete. See |:bunload| +--- @param buffer buffer +--- @param opts table +function vim.api.nvim_buf_delete(buffer, opts) end + +-- Gets a changed tick of a buffer +-- +-- Parameters: ~ +-- • {buffer} Buffer handle, or 0 for current buffer +-- +-- Return: ~ +-- `b:changedtick` value. +--- @param buffer buffer +--- @return number +function vim.api.nvim_buf_get_changedtick(buffer) end + +-- Gets a map of buffer-local |user-commands|. +-- +-- Parameters: ~ +-- • {buffer} Buffer handle, or 0 for current buffer +-- • {opts} Optional parameters. Currently not used. +-- +-- Return: ~ +-- Map of maps describing commands. +--- @param buffer buffer +--- @param opts? table +--- @return table +function vim.api.nvim_buf_get_commands(buffer, opts) end + +-- Gets the position (0-indexed) of an |extmark|. +-- +-- Parameters: ~ +-- • {buffer} Buffer handle, or 0 for current buffer +-- • {ns_id} Namespace id from |nvim_create_namespace()| +-- • {id} Extmark id +-- • {opts} Optional parameters. Keys: +-- • details: Whether to include the details dict +-- • hl_name: Whether to include highlight group name instead +-- of id, true if omitted +-- +-- Return: ~ +-- 0-indexed (row, col) tuple or empty list () if extmark id was absent +--- @param buffer buffer +--- @param ns_id number +--- @param id number +--- @param opts table +--- @return any[] +function vim.api.nvim_buf_get_extmark_by_id(buffer, ns_id, id, opts) end + +-- Gets |extmarks| in "traversal order" from a |charwise| region defined by +-- buffer positions (inclusive, 0-indexed |api-indexing|). +-- +-- Region can be given as (row,col) tuples, or valid extmark ids (whose +-- positions define the bounds). 0 and -1 are understood as (0,0) and (-1,-1) +-- respectively, thus the following are equivalent: +-- ```lua +-- vim.api.nvim_buf_get_extmarks(0, my_ns, 0, -1, {}) +-- vim.api.nvim_buf_get_extmarks(0, my_ns, {0,0}, {-1,-1}, {}) +-- ``` +-- +-- If `end` is less than `start`, traversal works backwards. (Useful with +-- `limit`, to get the first marks prior to a given position.) +-- +-- Example: +-- ```lua +-- local api = vim.api +-- local pos = api.nvim_win_get_cursor(0) +-- local ns = api.nvim_create_namespace('my-plugin') +-- -- Create new extmark at line 1, column 1. +-- local m1 = api.nvim_buf_set_extmark(0, ns, 0, 0, {}) +-- -- Create new extmark at line 3, column 1. +-- local m2 = api.nvim_buf_set_extmark(0, ns, 2, 0, {}) +-- -- Get extmarks only from line 3. +-- local ms = api.nvim_buf_get_extmarks(0, ns, {2,0}, {2,0}, {}) +-- -- Get all marks in this buffer + namespace. +-- local all = api.nvim_buf_get_extmarks(0, ns, 0, -1, {}) +-- print(vim.inspect(ms)) +-- ``` +-- +-- Parameters: ~ +-- • {buffer} Buffer handle, or 0 for current buffer +-- • {ns_id} Namespace id from |nvim_create_namespace()| or -1 for all +-- namespaces +-- • {start} Start of range: a 0-indexed (row, col) or valid extmark id +-- (whose position defines the bound). |api-indexing| +-- • {end} End of range (inclusive): a 0-indexed (row, col) or valid +-- extmark id (whose position defines the bound). +-- |api-indexing| +-- • {opts} Optional parameters. Keys: +-- • limit: Maximum number of marks to return +-- • details: Whether to include the details dict +-- • hl_name: Whether to include highlight group name instead +-- of id, true if omitted +-- • type: Filter marks by type: "highlight", "sign", +-- "virt_text" and "virt_lines" +-- +-- Return: ~ +-- List of [extmark_id, row, col] tuples in "traversal order". +--- @param buffer buffer +--- @param ns_id number +--- @param start object +--- @param end_ object +--- @param opts table +--- @return any[] +function vim.api.nvim_buf_get_extmarks(buffer, ns_id, start, end_, opts) end + +-- Gets a list of buffer-local |mapping| definitions. +-- +-- Parameters: ~ +-- • {mode} Mode short-name ("n", "i", "v", ...) +-- • {buffer} Buffer handle, or 0 for current buffer +-- +-- Return: ~ +-- Array of |maparg()|-like dictionaries describing mappings. The +-- "buffer" key holds the associated buffer handle. +--- @param buffer buffer +--- @param mode string +--- @return any[] +function vim.api.nvim_buf_get_keymap(buffer, mode) end + +-- Gets a line-range from the buffer. +-- +-- Indexing is zero-based, end-exclusive. Negative indices are interpreted as +-- length+1+index: -1 refers to the index past the end. So to get the last +-- element use start=-2 and end=-1. +-- +-- Out-of-bounds indices are clamped to the nearest valid value, unless +-- `strict_indexing` is set. +-- +-- Parameters: ~ +-- • {buffer} Buffer handle, or 0 for current buffer +-- • {start} First line index +-- • {end} Last line index, exclusive +-- • {strict_indexing} Whether out-of-bounds should be an error. +-- +-- Return: ~ +-- Array of lines, or empty array for unloaded buffer. +--- @param buffer buffer +--- @param start number +--- @param end_ number +--- @param strict_indexing boolean +--- @return string[] +function vim.api.nvim_buf_get_lines(buffer, start, end_, strict_indexing) end + +-- Returns a tuple (row,col) representing the position of the named mark. See +-- |mark-motions|. +-- +-- Marks are (1,0)-indexed. |api-indexing| +-- +-- Parameters: ~ +-- • {buffer} Buffer handle, or 0 for current buffer +-- • {name} Mark name +-- +-- Return: ~ +-- (row, col) tuple, (0, 0) if the mark is not set, or is an +-- uppercase/file mark set in another buffer. +-- +-- See also: ~ +-- • |nvim_buf_set_mark()| +-- • |nvim_buf_del_mark()| +--- @param buffer buffer +--- @param name string +--- @return number[] +function vim.api.nvim_buf_get_mark(buffer, name) end + +-- Gets the full file name for the buffer +-- +-- Parameters: ~ +-- • {buffer} Buffer handle, or 0 for current buffer +-- +-- Return: ~ +-- Buffer name +--- @param buffer buffer +--- @return string +function vim.api.nvim_buf_get_name(buffer) end + +-- Returns the byte offset of a line (0-indexed). |api-indexing| +-- +-- 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, or 0 for current buffer +-- • {index} Line index +-- +-- Return: ~ +-- Integer byte offset, or -1 for unloaded buffer. +--- @param buffer buffer +--- @param index number +--- @return number +function vim.api.nvim_buf_get_offset(buffer, index) end + +--- @return object +function vim.api.nvim_buf_get_option() end + +-- Gets a range from the buffer. +-- +-- This differs from |nvim_buf_get_lines()| in that it allows retrieving only +-- portions of a line. +-- +-- Indexing is zero-based. Row indices are end-inclusive, and column indices +-- are end-exclusive. +-- +-- Prefer |nvim_buf_get_lines()| when retrieving entire lines. +-- +-- Parameters: ~ +-- • {buffer} Buffer handle, or 0 for current buffer +-- • {start_row} First line index +-- • {start_col} Starting column (byte offset) on first line +-- • {end_row} Last line index, inclusive +-- • {end_col} Ending column (byte offset) on last line, exclusive +-- • {opts} Optional parameters. Currently unused. +-- +-- Return: ~ +-- Array of lines, or empty array for unloaded buffer. +--- @param buffer buffer +--- @param start_row number +--- @param start_col number +--- @param end_row number +--- @param end_col number +--- @param opts table +--- @return string[] +function vim.api.nvim_buf_get_text(buffer, start_row, start_col, end_row, end_col, opts) end + +-- Gets a buffer-scoped (b:) variable. +-- +-- Parameters: ~ +-- • {buffer} Buffer handle, or 0 for current buffer +-- • {name} Variable name +-- +-- Return: ~ +-- Variable value +--- @param buffer buffer +--- @param name string +--- @return object +function vim.api.nvim_buf_get_var(buffer, name) end + +-- Checks if a buffer is valid and loaded. See |api-buffer| for more info +-- about unloaded buffers. +-- +-- Parameters: ~ +-- • {buffer} Buffer handle, or 0 for current buffer +-- +-- Return: ~ +-- true if the buffer is valid and loaded, false otherwise. +--- @param buffer buffer +--- @return boolean +function vim.api.nvim_buf_is_loaded(buffer) end + +-- Checks if a buffer is valid. +-- +-- Note: +-- Even if a buffer is valid it may have been unloaded. See |api-buffer| +-- for more info about unloaded buffers. +-- +-- Parameters: ~ +-- • {buffer} Buffer handle, or 0 for current buffer +-- +-- Return: ~ +-- true if the buffer is valid, false otherwise. +--- @param buffer buffer +--- @return boolean +function vim.api.nvim_buf_is_valid(buffer) end + +-- Returns the number of lines in the given buffer. +-- +-- Parameters: ~ +-- • {buffer} Buffer handle, or 0 for current buffer +-- +-- Return: ~ +-- Line count, or 0 for unloaded buffer. |api-buffer| +--- @param buffer buffer +--- @return number +function vim.api.nvim_buf_line_count(buffer) end + +-- Creates or updates an |extmark|. +-- +-- By default a new extmark is created when no id is passed in, but it is +-- also possible to create a new mark by passing in a previously unused id or +-- move an existing mark by passing in its id. The caller must then keep +-- track of existing and unused ids itself. (Useful over RPC, to avoid +-- waiting for the return value.) +-- +-- Using the optional arguments, it is possible to use this to highlight a +-- range of text, and also to associate virtual text to the mark. +-- +-- Parameters: ~ +-- • {buffer} Buffer handle, or 0 for current buffer +-- • {ns_id} Namespace id from |nvim_create_namespace()| +-- • {line} Line where to place the mark, 0-based. |api-indexing| +-- • {col} Column where to place the mark, 0-based. |api-indexing| +-- • {opts} Optional parameters. +-- • id : id of the extmark to edit. +-- • end_row : ending line of the mark, 0-based inclusive. +-- • end_col : ending col of the mark, 0-based exclusive. +-- • hl_group : name of the highlight group used to highlight +-- this mark. +-- • hl_eol : when true, for a multiline highlight covering the +-- EOL of a line, continue the highlight for the rest of the +-- screen line (just like for diff and cursorline highlight). +-- • virt_text : virtual text to link to this mark. A list of +-- [text, highlight] tuples, each representing a text chunk +-- with specified highlight. `highlight` element can either +-- be a single highlight group, or an array of multiple +-- highlight groups that will be stacked (highest priority +-- last). A highlight group can be supplied either as a +-- string or as an integer, the latter which can be obtained +-- using |nvim_get_hl_id_by_name()|. +-- • virt_text_pos : position of virtual text. Possible values: +-- • "eol": right after eol character (default) +-- • "overlay": display over the specified column, without +-- shifting the underlying text. +-- • "right_align": display right aligned in the window. +-- • "inline": display at the specified column, and shift the +-- buffer text to the right as needed +-- +-- • virt_text_win_col : position the virtual text at a fixed +-- window column (starting from the first text column) +-- • virt_text_hide : hide the virtual text when the background +-- text is selected or hidden because of scrolling with +-- 'nowrap' or 'smoothscroll'. Currently only affects +-- "overlay" virt_text. +-- • hl_mode : control how highlights are combined with the +-- highlights of the text. Currently only affects virt_text +-- highlights, but might affect `hl_group` in later versions. +-- • "replace": only show the virt_text color. This is the +-- default +-- • "combine": combine with background text color +-- • "blend": blend with background text color. +-- +-- • virt_lines : virtual lines to add next to this mark This +-- should be an array over lines, where each line in turn is +-- an array over [text, highlight] tuples. In general, buffer +-- and window options do not affect the display of the text. +-- In particular 'wrap' and 'linebreak' options do not take +-- effect, so the number of extra screen lines will always +-- match the size of the array. However the 'tabstop' buffer +-- option is still used for hard tabs. By default lines are +-- placed below the buffer line containing the mark. +-- • virt_lines_above: place virtual lines above instead. +-- • virt_lines_leftcol: Place extmarks in the leftmost column +-- of the window, bypassing sign and number columns. +-- • ephemeral : for use with |nvim_set_decoration_provider()| +-- callbacks. The mark will only be used for the current +-- redraw cycle, and not be permantently stored in the +-- buffer. +-- • right_gravity : boolean that indicates the direction the +-- extmark will be shifted in when new text is inserted (true +-- for right, false for left). Defaults to true. +-- • end_right_gravity : boolean that indicates the direction +-- the extmark end position (if it exists) will be shifted in +-- when new text is inserted (true for right, false for +-- left). Defaults to false. +-- • priority: a priority value for the highlight group or sign +-- attribute. For example treesitter highlighting uses a +-- value of 100. +-- • strict: boolean that indicates extmark should not be +-- placed if the line or column value is past the end of the +-- buffer or end of the line respectively. Defaults to true. +-- • sign_text: string of length 1-2 used to display in the +-- sign column. Note: ranges are unsupported and decorations +-- are only applied to start_row +-- • sign_hl_group: name of the highlight group used to +-- highlight the sign column text. Note: ranges are +-- unsupported and decorations are only applied to start_row +-- • number_hl_group: name of the highlight group used to +-- highlight the number column. Note: ranges are unsupported +-- and decorations are only applied to start_row +-- • line_hl_group: name of the highlight group used to +-- highlight the whole line. Note: ranges are unsupported and +-- decorations are only applied to start_row +-- • cursorline_hl_group: name of the highlight group used to +-- highlight the line when the cursor is on the same line as +-- the mark and 'cursorline' is enabled. Note: ranges are +-- unsupported and decorations are only applied to start_row +-- • conceal: string which should be either empty or a single +-- character. Enable concealing similar to |:syn-conceal|. +-- When a character is supplied it is used as |:syn-cchar|. +-- "hl_group" is used as highlight for the cchar if provided, +-- otherwise it defaults to |hl-Conceal|. +-- • spell: boolean indicating that spell checking should be +-- performed within this extmark +-- • ui_watched: boolean that indicates the mark should be +-- drawn by a UI. When set, the UI will receive win_extmark +-- events. Note: the mark is positioned by virt_text +-- attributes. Can be used together with virt_text. +-- +-- Return: ~ +-- Id of the created/updated extmark +--- @param buffer buffer +--- @param ns_id number +--- @param line number +--- @param col number +--- @param opts? table +--- @return number +function vim.api.nvim_buf_set_extmark(buffer, ns_id, line, col, opts) end + +-- Sets a buffer-local |mapping| for the given mode. +-- +-- Parameters: ~ +-- • {buffer} Buffer handle, or 0 for current buffer +-- +-- See also: ~ +-- • |nvim_set_keymap()| +--- @param buffer buffer +--- @param mode string +--- @param lhs string +--- @param rhs string +--- @param opts? table +function vim.api.nvim_buf_set_keymap(buffer, mode, lhs, rhs, opts) end + +-- Sets (replaces) a line-range in the buffer. +-- +-- Indexing is zero-based, end-exclusive. Negative indices are interpreted as +-- length+1+index: -1 refers to the index past the end. So to change or +-- delete the last element use start=-2 and end=-1. +-- +-- To insert lines at a given index, set `start` and `end` to the same index. +-- To delete a range of lines, set `replacement` to an empty array. +-- +-- Out-of-bounds indices are clamped to the nearest valid value, unless +-- `strict_indexing` is set. +-- +-- Attributes: ~ +-- not allowed when |textlock| is active +-- +-- Parameters: ~ +-- • {buffer} Buffer handle, or 0 for current buffer +-- • {start} First line index +-- • {end} Last line index, exclusive +-- • {strict_indexing} Whether out-of-bounds should be an error. +-- • {replacement} Array of lines to use as replacement +-- +-- See also: ~ +-- • |nvim_buf_set_text()| +--- @param buffer buffer +--- @param start number +--- @param end_ number +--- @param strict_indexing boolean +--- @param replacement string[] +function vim.api.nvim_buf_set_lines(buffer, start, end_, strict_indexing, replacement) end + +-- Sets a named mark in the given buffer, all marks are allowed +-- file/uppercase, visual, last change, etc. See |mark-motions|. +-- +-- Marks are (1,0)-indexed. |api-indexing| +-- +-- Note: +-- Passing 0 as line deletes the mark +-- +-- Parameters: ~ +-- • {buffer} Buffer to set the mark on +-- • {name} Mark name +-- • {line} Line number +-- • {col} Column/row number +-- • {opts} Optional parameters. Reserved for future use. +-- +-- Return: ~ +-- true if the mark was set, else false. +-- +-- See also: ~ +-- • |nvim_buf_del_mark()| +-- • |nvim_buf_get_mark()| +--- @param buffer buffer +--- @param name string +--- @param line number +--- @param col number +--- @param opts table +--- @return boolean +function vim.api.nvim_buf_set_mark(buffer, name, line, col, opts) end + +-- Sets the full file name for a buffer +-- +-- Parameters: ~ +-- • {buffer} Buffer handle, or 0 for current buffer +-- • {name} Buffer name +--- @param buffer buffer +--- @param name string +function vim.api.nvim_buf_set_name(buffer, name) end + +function vim.api.nvim_buf_set_option() end + +-- Sets (replaces) a range in the buffer +-- +-- This is recommended over |nvim_buf_set_lines()| when only modifying parts +-- of a line, as extmarks will be preserved on non-modified parts of the +-- touched lines. +-- +-- Indexing is zero-based. Row indices are end-inclusive, and column indices +-- are end-exclusive. +-- +-- To insert text at a given `(row, column)` location, use `start_row = +-- end_row = row` and `start_col = end_col = col`. To delete the text in a +-- range, use `replacement = {}`. +-- +-- Prefer |nvim_buf_set_lines()| if you are only adding or deleting entire +-- lines. +-- +-- Parameters: ~ +-- • {buffer} Buffer handle, or 0 for current buffer +-- • {start_row} First line index +-- • {start_col} Starting column (byte offset) on first line +-- • {end_row} Last line index, inclusive +-- • {end_col} Ending column (byte offset) on last line, exclusive +-- • {replacement} Array of lines to use as replacement +-- +-- See also: ~ +-- • |nvim_buf_set_lines()| +--- @param buffer buffer +--- @param start_row number +--- @param start_col number +--- @param end_row number +--- @param end_col number +--- @param replacement string[] +function vim.api.nvim_buf_set_text(buffer, start_row, start_col, end_row, end_col, replacement) end + +-- Sets a buffer-scoped (b:) variable +-- +-- Parameters: ~ +-- • {buffer} Buffer handle, or 0 for current buffer +-- • {name} Variable name +-- • {value} Variable value +--- @param buffer buffer +--- @param name string +--- @param value object +function vim.api.nvim_buf_set_var(buffer, name, value) end + +-- Calls a VimL |Dictionary-function| with the given arguments. +-- +-- On execution error: fails with VimL error, updates v:errmsg. +-- +-- Parameters: ~ +-- • {dict} Dictionary, or String evaluating to a VimL |self| dict +-- • {fn} Name of the function defined on the VimL dict +-- • {args} Function arguments packed in an Array +-- +-- Return: ~ +-- Result of the function call +--- @param dict object +--- @param fn string +--- @param args any[] +--- @return object +function vim.api.nvim_call_dict_function(dict, fn, args) end + +-- Calls a VimL function with the given arguments. +-- +-- On execution error: fails with VimL error, updates v:errmsg. +-- +-- Parameters: ~ +-- • {fn} Function to call +-- • {args} Function arguments packed in an Array +-- +-- Return: ~ +-- Result of the function call +--- @param fn string +--- @param args any[] +--- @return object +function vim.api.nvim_call_function(fn, args) end + +-- Send data to channel `id`. For a job, it writes it to the stdin of the +-- process. For the stdio channel |channel-stdio|, it writes to Nvim's +-- stdout. For an internal terminal instance (|nvim_open_term()|) it writes +-- directly to terminal output. See |channel-bytes| for more information. +-- +-- This function writes raw data, not RPC messages. If the channel was +-- created with `rpc=true` then the channel expects RPC messages, use +-- |vim.rpcnotify()| and |vim.rpcrequest()| instead. +-- +-- Attributes: ~ +-- |RPC| only +-- Lua |vim.api| only +-- +-- Parameters: ~ +-- • {chan} id of the channel +-- • {data} data to write. 8-bit clean: can contain NUL bytes. +--- @param chan number +--- @param data string +function vim.api.nvim_chan_send(chan, data) end + +-- Clear all autocommands that match the corresponding {opts}. To delete a +-- particular autocmd, see |nvim_del_autocmd()|. +-- +-- Parameters: ~ +-- • {opts} Parameters +-- • event: (string|table) Examples: +-- • event: "pat1" +-- • event: { "pat1" } +-- • event: { "pat1", "pat2", "pat3" } +-- +-- • pattern: (string|table) +-- • pattern or patterns to match exactly. +-- • For example, if you have `*.py` as that pattern for the +-- autocmd, you must pass `*.py` exactly to clear it. +-- `test.py` will not match the pattern. +-- +-- • defaults to clearing all patterns. +-- • NOTE: Cannot be used with {buffer} +-- +-- • buffer: (bufnr) +-- • clear only |autocmd-buflocal| autocommands. +-- • NOTE: Cannot be used with {pattern} +-- +-- • group: (string|int) The augroup name or id. +-- • NOTE: If not passed, will only delete autocmds not in any group. +--- @param opts? table +function vim.api.nvim_clear_autocmds(opts) end + +-- Executes an Ex command. +-- +-- Unlike |nvim_command()| this command takes a structured Dictionary instead +-- of a String. This allows for easier construction and manipulation of an Ex +-- command. This also allows for things such as having spaces inside a +-- command argument, expanding filenames in a command that otherwise doesn't +-- expand filenames, etc. Command arguments may also be Number, Boolean or +-- String. +-- +-- The first argument may also be used instead of count for commands that +-- support it in order to make their usage simpler with |vim.cmd()|. For +-- example, instead of `vim.cmd.bdelete{ count = 2 }`, you may do +-- `vim.cmd.bdelete(2)`. +-- +-- On execution error: fails with VimL error, updates v:errmsg. +-- +-- Parameters: ~ +-- • {cmd} Command to execute. Must be a Dictionary that can contain the +-- same values as the return value of |nvim_parse_cmd()| except +-- "addr", "nargs" and "nextcmd" which are ignored if provided. +-- All values except for "cmd" are optional. +-- • {opts} Optional parameters. +-- • output: (boolean, default false) Whether to return command +-- output. +-- +-- Return: ~ +-- Command output (non-error, non-shell |:!|) if `output` is true, else +-- empty string. +-- +-- See also: ~ +-- • |nvim_exec2()| +-- • |nvim_command()| +--- @param cmd? table +--- @param opts? table +--- @return string +function vim.api.nvim_cmd(cmd, opts) end + +-- Executes an Ex command. +-- +-- On execution error: fails with VimL error, updates v:errmsg. +-- +-- Prefer using |nvim_cmd()| or |nvim_exec2()| over this. To evaluate +-- multiple lines of Vim script or an Ex command directly, use +-- |nvim_exec2()|. To construct an Ex command using a structured format and +-- then execute it, use |nvim_cmd()|. To modify an Ex command before +-- evaluating it, use |nvim_parse_cmd()| in conjunction with |nvim_cmd()|. +-- +-- Parameters: ~ +-- • {command} Ex command string +--- @param command string +function vim.api.nvim_command(command) end + +-- Create or get an autocommand group |autocmd-groups|. +-- +-- To get an existing group id, do: +-- ```lua +-- local id = vim.api.nvim_create_augroup("MyGroup", { +-- clear = false +-- }) +-- ``` +-- +-- Parameters: ~ +-- • {name} String: The name of the group +-- • {opts} Dictionary Parameters +-- • clear (bool) optional: defaults to true. Clear existing +-- commands if the group already exists |autocmd-groups|. +-- +-- Return: ~ +-- Integer id of the created group. +-- +-- See also: ~ +-- • |autocmd-groups| +--- @param name string +--- @param opts? table +--- @return number +function vim.api.nvim_create_augroup(name, opts) end + +-- Creates an |autocommand| event handler, defined by `callback` (Lua function or Vimscript function name string) or `command` (Ex command string). +-- +-- Example using Lua callback: +-- ```lua +-- vim.api.nvim_create_autocmd({"BufEnter", "BufWinEnter"}, { +-- pattern = {"*.c", "*.h"}, +-- callback = function(ev) +-- print(string.format('event fired: %s', vim.inspect(ev))) +-- end +-- }) +-- ``` +-- +-- Example using an Ex command as the handler: +-- ```lua +-- vim.api.nvim_create_autocmd({"BufEnter", "BufWinEnter"}, { +-- pattern = {"*.c", "*.h"}, +-- command = "echo 'Entering a C or C++ file'", +-- }) +-- ``` +-- +-- Note: `pattern` is NOT automatically expanded (unlike with |:autocmd|), thus names like +-- "$HOME" and "~" must be expanded explicitly: +-- ```lua +-- pattern = vim.fn.expand("~") .. "/some/path/*.py" +-- ``` +-- +-- Parameters: ~ +-- • {event} (string|array) Event(s) that will trigger the handler +-- (`callback` or `command`). +-- • {opts} Options dict: +-- • group (string|integer) optional: autocommand group name or +-- id to match against. +-- • pattern (string|array) optional: pattern(s) to match +-- literally |autocmd-pattern|. +-- • buffer (integer) optional: buffer number for buffer-local +-- autocommands |autocmd-buflocal|. Cannot be used with +-- {pattern}. +-- • desc (string) optional: description (for documentation and +-- troubleshooting). +-- • callback (function|string) optional: Lua function (or +-- Vimscript function name, if string) called when the +-- event(s) is triggered. Lua callback can return true to +-- delete the autocommand, and receives a table argument with +-- these keys: +-- • id: (number) autocommand id +-- • event: (string) name of the triggered event +-- |autocmd-events| +-- • group: (number|nil) autocommand group id, if any +-- • match: (string) expanded value of || +-- • buf: (number) expanded value of || +-- • file: (string) expanded value of || +-- • data: (any) arbitrary data passed from +-- |nvim_exec_autocmds()| +-- +-- • command (string) optional: Vim command to execute on event. +-- Cannot be used with {callback} +-- • once (boolean) optional: defaults to false. Run the +-- autocommand only once |autocmd-once|. +-- • nested (boolean) optional: defaults to false. Run nested +-- autocommands |autocmd-nested|. +-- +-- Return: ~ +-- Autocommand id (number) +-- +-- See also: ~ +-- • |autocommand| +-- • |nvim_del_autocmd()| +--- @param event object +--- @param opts? table +--- @return number +function vim.api.nvim_create_autocmd(event, opts) end + +-- Creates a new, empty, unnamed buffer. +-- +-- Parameters: ~ +-- • {listed} Sets 'buflisted' +-- • {scratch} Creates a "throwaway" |scratch-buffer| for temporary work +-- (always 'nomodified'). Also sets 'nomodeline' on the +-- buffer. +-- +-- Return: ~ +-- Buffer handle, or 0 on error +-- +-- See also: ~ +-- • buf_open_scratch +--- @param listed boolean +--- @param scratch boolean +--- @return buffer +function vim.api.nvim_create_buf(listed, scratch) end + +-- Creates a new namespace or gets an existing one. +-- +-- Namespaces are used for buffer highlights and virtual text, see +-- |nvim_buf_add_highlight()| and |nvim_buf_set_extmark()|. +-- +-- Namespaces can be named or anonymous. If `name` matches an existing +-- namespace, the associated id is returned. If `name` is an empty string a +-- new, anonymous namespace is created. +-- +-- Parameters: ~ +-- • {name} Namespace name or empty string +-- +-- Return: ~ +-- Namespace id +--- @param name string +--- @return number +function vim.api.nvim_create_namespace(name) end + +-- Creates a global |user-commands| command. +-- +-- For Lua usage see |lua-guide-commands-create|. +-- +-- Example: +-- ```vim +-- :call nvim_create_user_command('SayHello', 'echo "Hello world!"', {'bang': v:true}) +-- :SayHello +-- Hello world! +-- ``` +-- +-- Parameters: ~ +-- • {name} Name of the new user command. Must begin with an uppercase +-- letter. +-- • {command} Replacement command to execute when this user command is +-- executed. When called from Lua, the command can also be a +-- Lua function. The function is called with a single table +-- argument that contains the following keys: +-- • name: (string) Command name +-- • args: (string) The args passed to the command, if any +-- || +-- • fargs: (table) The args split by unescaped whitespace +-- (when more than one argument is allowed), if any +-- || +-- • nargs: (string) Number of arguments |:command-nargs| +-- • bang: (boolean) "true" if the command was executed with a +-- ! modifier || +-- • line1: (number) The starting line of the command range +-- || +-- • line2: (number) The final line of the command range +-- || +-- • range: (number) The number of items in the command range: +-- 0, 1, or 2 || +-- • count: (number) Any count supplied || +-- • reg: (string) The optional register, if specified || +-- • mods: (string) Command modifiers, if any || +-- • smods: (table) Command modifiers in a structured format. +-- Has the same structure as the "mods" key of +-- |nvim_parse_cmd()|. +-- • {opts} Optional |command-attributes|. +-- • Set boolean attributes such as |:command-bang| or +-- |:command-bar| to true (but not |:command-buffer|, use +-- |nvim_buf_create_user_command()| instead). +-- • "complete" |:command-complete| also accepts a Lua +-- function which works like +-- |:command-completion-customlist|. +-- • Other parameters: +-- • desc: (string) Used for listing the command when a Lua +-- function is used for {command}. +-- • force: (boolean, default true) Override any previous +-- definition. +-- • preview: (function) Preview callback for 'inccommand' +-- |:command-preview| +--- @param name string +--- @param command object +--- @param opts? table +function vim.api.nvim_create_user_command(name, command, opts) end + +-- Delete an autocommand group by id. +-- +-- To get a group id one can use |nvim_get_autocmds()|. +-- +-- NOTE: behavior differs from |:augroup-delete|. When deleting a group, +-- autocommands contained in this group will also be deleted and cleared. +-- This group will no longer exist. +-- +-- Parameters: ~ +-- • {id} Integer The id of the group. +-- +-- See also: ~ +-- • |nvim_del_augroup_by_name()| +-- • |nvim_create_augroup()| +--- @param id number +function vim.api.nvim_del_augroup_by_id(id) end + +-- Delete an autocommand group by name. +-- +-- NOTE: behavior differs from |:augroup-delete|. When deleting a group, +-- autocommands contained in this group will also be deleted and cleared. +-- This group will no longer exist. +-- +-- Parameters: ~ +-- • {name} String The name of the group. +-- +-- See also: ~ +-- • |autocmd-groups| +--- @param name string +function vim.api.nvim_del_augroup_by_name(name) end + +-- Delete an autocommand by id. +-- +-- NOTE: Only autocommands created via the API have an id. +-- +-- Parameters: ~ +-- • {id} Integer The id returned by nvim_create_autocmd +-- +-- See also: ~ +-- • |nvim_create_autocmd()| +--- @param id number +function vim.api.nvim_del_autocmd(id) end + +-- Deletes the current line. +-- +-- Attributes: ~ +-- not allowed when |textlock| is active +function vim.api.nvim_del_current_line() end + +-- Unmaps a global |mapping| for the given mode. +-- +-- To unmap a buffer-local mapping, use |nvim_buf_del_keymap()|. +-- +-- See also: ~ +-- • |nvim_set_keymap()| +--- @param mode string +--- @param lhs string +function vim.api.nvim_del_keymap(mode, lhs) end + +-- Deletes an uppercase/file named mark. See |mark-motions|. +-- +-- Note: +-- fails with error if a lowercase or buffer local named mark is used. +-- +-- Parameters: ~ +-- • {name} Mark name +-- +-- Return: ~ +-- true if the mark was deleted, else false. +-- +-- See also: ~ +-- • |nvim_buf_del_mark()| +-- • |nvim_get_mark()| +--- @param name string +--- @return boolean +function vim.api.nvim_del_mark(name) end + +-- Delete a user-defined command. +-- +-- Parameters: ~ +-- • {name} Name of the command to delete. +--- @param name string +function vim.api.nvim_del_user_command(name) end + +-- Removes a global (g:) variable. +-- +-- Parameters: ~ +-- • {name} Variable name +--- @param name string +function vim.api.nvim_del_var(name) end + +-- Echo a message. +-- +-- Parameters: ~ +-- • {chunks} A list of [text, hl_group] arrays, each representing a text +-- chunk with specified highlight. `hl_group` element can be +-- omitted for no highlight. +-- • {history} if true, add to |message-history|. +-- • {opts} Optional parameters. +-- • verbose: Message was printed as a result of 'verbose' +-- option if Nvim was invoked with -V3log_file, the message +-- will be redirected to the log_file and suppressed from +-- direct output. +--- @param chunks any[] +--- @param history boolean +--- @param opts? table +function vim.api.nvim_echo(chunks, history, opts) end + +-- Writes a message to the Vim error buffer. Does not append "\n", the +-- message is buffered (won't display) until a linefeed is written. +-- +-- Parameters: ~ +-- • {str} Message +--- @param str string +function vim.api.nvim_err_write(str) end + +-- Writes a message to the Vim error buffer. Appends "\n", so the buffer is +-- flushed (and displayed). +-- +-- Parameters: ~ +-- • {str} Message +-- +-- See also: ~ +-- • nvim_err_write() +--- @param str string +function vim.api.nvim_err_writeln(str) end + +-- Evaluates a VimL |expression|. Dictionaries and Lists are recursively +-- expanded. +-- +-- On execution error: fails with VimL error, updates v:errmsg. +-- +-- Parameters: ~ +-- • {expr} VimL expression string +-- +-- Return: ~ +-- Evaluation result or expanded object +--- @param expr string +--- @return object +function vim.api.nvim_eval(expr) end + +-- Evaluates statusline string. +-- +-- Attributes: ~ +-- |api-fast| +-- +-- Parameters: ~ +-- • {str} Statusline string (see 'statusline'). +-- • {opts} Optional parameters. +-- • winid: (number) |window-ID| of the window to use as context +-- for statusline. +-- • maxwidth: (number) Maximum width of statusline. +-- • fillchar: (string) Character to fill blank spaces in the +-- statusline (see 'fillchars'). Treated as single-width even +-- if it isn't. +-- • highlights: (boolean) Return highlight information. +-- • use_winbar: (boolean) Evaluate winbar instead of statusline. +-- • use_tabline: (boolean) Evaluate tabline instead of +-- statusline. When true, {winid} is ignored. Mutually +-- exclusive with {use_winbar}. +-- • use_statuscol_lnum: (number) Evaluate statuscolumn for this +-- line number instead of statusline. +-- +-- Return: ~ +-- Dictionary containing statusline information, with these keys: +-- • str: (string) Characters that will be displayed on the statusline. +-- • width: (number) Display width of the statusline. +-- • highlights: Array containing highlight information of the +-- statusline. Only included when the "highlights" key in {opts} is +-- true. Each element of the array is a |Dictionary| with these keys: +-- • start: (number) Byte index (0-based) of first character that uses +-- the highlight. +-- • group: (string) Name of highlight group. +--- @param str string +--- @param opts? table +--- @return table +function vim.api.nvim_eval_statusline(str, opts) end + +-- Executes Vimscript (multiline block of Ex commands), like anonymous +-- |:source|. +-- +-- Unlike |nvim_command()| this function supports heredocs, script-scope +-- (s:), etc. +-- +-- On execution error: fails with VimL error, updates v:errmsg. +-- +-- Parameters: ~ +-- • {src} Vimscript code +-- • {opts} Optional parameters. +-- • output: (boolean, default false) Whether to capture and +-- return all (non-error, non-shell |:!|) output. +-- +-- Return: ~ +-- Dictionary containing information about execution, with these keys: +-- • output: (string|nil) Output if `opts.output` is true. +-- +-- See also: ~ +-- • |execute()| +-- • |nvim_command()| +-- • |nvim_cmd()| +--- @param src string +--- @param opts? table +--- @return table +function vim.api.nvim_exec2(src, opts) end + +-- Execute all autocommands for {event} that match the corresponding {opts} +-- |autocmd-execute|. +-- +-- Parameters: ~ +-- • {event} (String|Array) The event or events to execute +-- • {opts} Dictionary of autocommand options: +-- • group (string|integer) optional: the autocommand group name +-- or id to match against. |autocmd-groups|. +-- • pattern (string|array) optional: defaults to "*" +-- |autocmd-pattern|. Cannot be used with {buffer}. +-- • buffer (integer) optional: buffer number +-- |autocmd-buflocal|. Cannot be used with {pattern}. +-- • modeline (bool) optional: defaults to true. Process the +-- modeline after the autocommands ||. +-- • data (any): arbitrary data to send to the autocommand +-- callback. See |nvim_create_autocmd()| for details. +-- +-- See also: ~ +-- • |:doautocmd| +--- @param event object +--- @param opts? table +function vim.api.nvim_exec_autocmds(event, opts) end + +-- Sends input-keys to Nvim, subject to various quirks controlled by `mode` +-- flags. This is a blocking call, unlike |nvim_input()|. +-- +-- On execution error: does not fail, but updates v:errmsg. +-- +-- To input sequences like use |nvim_replace_termcodes()| (typically +-- with escape_ks=false) to replace |keycodes|, then pass the result to +-- nvim_feedkeys(). +-- +-- Example: +-- ```vim +-- :let key = nvim_replace_termcodes("", v:true, v:false, v:true) +-- :call nvim_feedkeys(key, 'n', v:false) +-- ``` +-- +-- Parameters: ~ +-- • {keys} to be typed +-- • {mode} behavior flags, see |feedkeys()| +-- • {escape_ks} If true, escape K_SPECIAL bytes in `keys`. This should be +-- false if you already used |nvim_replace_termcodes()|, and +-- true otherwise. +-- +-- See also: ~ +-- • feedkeys() +-- • vim_strsave_escape_ks +--- @param keys string +--- @param mode string +--- @param escape_ks boolean +function vim.api.nvim_feedkeys(keys, mode, escape_ks) end + +-- Gets the option information for all options. +-- +-- The dictionary has the full option names as keys and option metadata +-- dictionaries as detailed at |nvim_get_option_info2()|. +-- +-- Return: ~ +-- dictionary of all options +--- @return table +function vim.api.nvim_get_all_options_info() end + +-- Get all autocommands that match the corresponding {opts}. +-- +-- These examples will get autocommands matching ALL the given criteria: +-- ```lua +-- -- Matches all criteria +-- autocommands = vim.api.nvim_get_autocmds({ +-- group = "MyGroup", +-- event = {"BufEnter", "BufWinEnter"}, +-- pattern = {"*.c", "*.h"} +-- }) +-- +-- -- All commands from one group +-- autocommands = vim.api.nvim_get_autocmds({ +-- group = "MyGroup", +-- }) +-- ``` +-- +-- NOTE: When multiple patterns or events are provided, it will find all the +-- autocommands that match any combination of them. +-- +-- Parameters: ~ +-- • {opts} Dictionary with at least one of the following: +-- • group (string|integer): the autocommand group name or id to +-- match against. +-- • event (string|array): event or events to match against +-- |autocmd-events|. +-- • pattern (string|array): pattern or patterns to match against +-- |autocmd-pattern|. Cannot be used with {buffer} +-- • buffer: Buffer number or list of buffer numbers for buffer +-- local autocommands |autocmd-buflocal|. Cannot be used with +-- {pattern} +-- +-- Return: ~ +-- Array of autocommands matching the criteria, with each item containing +-- the following fields: +-- • id (number): the autocommand id (only when defined with the API). +-- • group (integer): the autocommand group id. +-- • group_name (string): the autocommand group name. +-- • desc (string): the autocommand description. +-- • event (string): the autocommand event. +-- • command (string): the autocommand command. Note: this will be empty +-- if a callback is set. +-- • callback (function|string|nil): Lua function or name of a Vim script +-- function which is executed when this autocommand is triggered. +-- • once (boolean): whether the autocommand is only run once. +-- • pattern (string): the autocommand pattern. If the autocommand is +-- buffer local |autocmd-buffer-local|: +-- • buflocal (boolean): true if the autocommand is buffer local. +-- • buffer (number): the buffer number. +--- @param opts? table +--- @return any[] +function vim.api.nvim_get_autocmds(opts) end + +-- Gets information about a channel. +-- +-- Return: ~ +-- Dictionary describing a channel, with these keys: +-- • "id" Channel id. +-- • "argv" (optional) Job arguments list. +-- • "stream" Stream underlying the channel. +-- • "stdio" stdin and stdout of this Nvim instance +-- • "stderr" stderr of this Nvim instance +-- • "socket" TCP/IP socket or named pipe +-- • "job" Job with communication over its stdio. +-- +-- • "mode" How data received on the channel is interpreted. +-- • "bytes" Send and receive raw bytes. +-- • "terminal" |terminal| instance interprets ASCII sequences. +-- • "rpc" |RPC| communication on the channel is active. +-- +-- • "pty" (optional) Name of pseudoterminal. On a POSIX system this is a +-- device path like "/dev/pts/1". If the name is unknown, the key will +-- still be present if a pty is used (e.g. for conpty on Windows). +-- • "buffer" (optional) Buffer with connected |terminal| instance. +-- • "client" (optional) Info about the peer (client on the other end of +-- the RPC channel), if provided by it via |nvim_set_client_info()|. +--- @param chan number +--- @return table +function vim.api.nvim_get_chan_info(chan) end + +-- Returns the 24-bit RGB value of a |nvim_get_color_map()| color name or +-- "#rrggbb" hexadecimal string. +-- +-- Example: +-- ```vim +-- :echo nvim_get_color_by_name("Pink") +-- :echo nvim_get_color_by_name("#cbcbcb") +-- ``` +-- +-- Parameters: ~ +-- • {name} Color name or "#rrggbb" string +-- +-- Return: ~ +-- 24-bit RGB value, or -1 for invalid argument. +--- @param name string +--- @return number +function vim.api.nvim_get_color_by_name(name) end + +-- Returns a map of color names and RGB values. +-- +-- Keys are color names (e.g. "Aqua") and values are 24-bit RGB color values +-- (e.g. 65535). +-- +-- Return: ~ +-- Map of color names and RGB values. +--- @return table +function vim.api.nvim_get_color_map() end + +-- Gets a map of global (non-buffer-local) Ex commands. +-- +-- Currently only |user-commands| are supported, not builtin Ex commands. +-- +-- Parameters: ~ +-- • {opts} Optional parameters. Currently only supports {"builtin":false} +-- +-- Return: ~ +-- Map of maps describing commands. +--- @param opts? table +--- @return table +function vim.api.nvim_get_commands(opts) end + +-- Gets a map of the current editor state. +-- +-- Parameters: ~ +-- • {opts} Optional parameters. +-- • types: List of |context-types| ("regs", "jumps", "bufs", +-- "gvars", …) to gather, or empty for "all". +-- +-- Return: ~ +-- map of global |context|. +--- @param opts? table +--- @return table +function vim.api.nvim_get_context(opts) end + +-- Gets the current buffer. +-- +-- Return: ~ +-- Buffer handle +--- @return buffer +function vim.api.nvim_get_current_buf() end + +-- Gets the current line. +-- +-- Return: ~ +-- Current line string +--- @return string +function vim.api.nvim_get_current_line() end + +-- Gets the current tabpage. +-- +-- Return: ~ +-- Tabpage handle +--- @return tabpage +function vim.api.nvim_get_current_tabpage() end + +-- Gets the current window. +-- +-- Return: ~ +-- Window handle +--- @return window +function vim.api.nvim_get_current_win() end + +-- Gets all or specific highlight groups in a namespace. +-- +-- Parameters: ~ +-- • {ns_id} Get highlight groups for namespace ns_id +-- |nvim_get_namespaces()|. Use 0 to get global highlight groups +-- |:highlight|. +-- • {opts} Options dict: +-- • name: (string) Get a highlight definition by name. +-- • id: (integer) Get a highlight definition by id. +-- • link: (boolean, default true) Show linked group name +-- instead of effective definition |:hi-link|. +-- +-- Return: ~ +-- Highlight groups as a map from group name to a highlight definition +-- map as in |nvim_set_hl()|, or only a single highlight definition map +-- if requested by name or id. +-- +-- Note: +-- When the `link` attribute is defined in the highlight definition map, +-- other attributes will not be taking effect (see |:hi-link|). +--- @param ns_id number +--- @param opts? table +--- @return table +function vim.api.nvim_get_hl(ns_id, opts) end + +-- Gets a highlight group by name +-- +-- similar to |hlID()|, but allocates a new ID if not present. +--- @param name string +--- @return number +function vim.api.nvim_get_hl_id_by_name(name) end + +-- Gets a list of global (non-buffer-local) |mapping| definitions. +-- +-- Parameters: ~ +-- • {mode} Mode short-name ("n", "i", "v", ...) +-- +-- Return: ~ +-- Array of |maparg()|-like dictionaries describing mappings. The +-- "buffer" key is always zero. +--- @param mode string +--- @return any[] +function vim.api.nvim_get_keymap(mode) end + +-- Return a tuple (row, col, buffer, buffername) representing the position of +-- the uppercase/file named mark. See |mark-motions|. +-- +-- Marks are (1,0)-indexed. |api-indexing| +-- +-- Note: +-- fails with error if a lowercase or buffer local named mark is used. +-- +-- Parameters: ~ +-- • {name} Mark name +-- • {opts} Optional parameters. Reserved for future use. +-- +-- Return: ~ +-- 4-tuple (row, col, buffer, buffername), (0, 0, 0, '') if the mark is +-- not set. +-- +-- See also: ~ +-- • |nvim_buf_set_mark()| +-- • |nvim_del_mark()| +--- @param name string +--- @param opts table +--- @return any[] +function vim.api.nvim_get_mark(name, opts) end + +-- Gets the current mode. |mode()| "blocking" is true if Nvim is waiting for +-- input. +-- +-- Return: ~ +-- Dictionary { "mode": String, "blocking": Boolean } +-- +-- Attributes: ~ +-- |api-fast| +--- @return table +function vim.api.nvim_get_mode() end + +-- Gets existing, non-anonymous |namespace|s. +-- +-- Return: ~ +-- dict that maps from names to namespace ids. +--- @return table +function vim.api.nvim_get_namespaces() end + +--- @return object +function vim.api.nvim_get_option() end + +--- @return table +function vim.api.nvim_get_option_info() end + +-- Gets the option information for one option from arbitrary buffer or window +-- +-- Resulting dictionary has keys: +-- • name: Name of the option (like 'filetype') +-- • shortname: Shortened name of the option (like 'ft') +-- • type: type of option ("string", "number" or "boolean") +-- • default: The default value for the option +-- • was_set: Whether the option was set. +-- • last_set_sid: Last set script id (if any) +-- • last_set_linenr: line number where option was set +-- • last_set_chan: Channel where option was set (0 for local) +-- • scope: one of "global", "win", or "buf" +-- • global_local: whether win or buf option has a global value +-- • commalist: List of comma separated values +-- • flaglist: List of single char flags +-- +-- When {scope} is not provided, the last set information applies to the +-- local value in the current buffer or window if it is available, otherwise +-- the global value information is returned. This behavior can be disabled by +-- explicitly specifying {scope} in the {opts} table. +-- +-- Parameters: ~ +-- • {name} Option name +-- • {opts} Optional parameters +-- • scope: One of "global" or "local". Analogous to |:setglobal| +-- and |:setlocal|, respectively. +-- • win: |window-ID|. Used for getting window local options. +-- • buf: Buffer number. Used for getting buffer local options. +-- Implies {scope} is "local". +-- +-- Return: ~ +-- Option Information +--- @param name string +--- @param opts? table +--- @return table +function vim.api.nvim_get_option_info2(name, opts) end + +-- Gets the value of an option. The behavior of this function matches that of +-- |:set|: the local value of an option is returned if it exists; otherwise, +-- the global value is returned. Local values always correspond to the +-- current buffer or window, unless "buf" or "win" is set in {opts}. +-- +-- Parameters: ~ +-- • {name} Option name +-- • {opts} Optional parameters +-- • scope: One of "global" or "local". Analogous to |:setglobal| +-- and |:setlocal|, respectively. +-- • win: |window-ID|. Used for getting window local options. +-- • buf: Buffer number. Used for getting buffer local options. +-- Implies {scope} is "local". +-- • filetype: |filetype|. Used to get the default option for a +-- specific filetype. Cannot be used with any other option. +-- Note: this will trigger |ftplugin| and all |FileType| +-- autocommands for the corresponding filetype. +-- +-- Return: ~ +-- Option value +--- @param name string +--- @param opts? table +--- @return object +function vim.api.nvim_get_option_value(name, opts) end + +-- Gets info describing process `pid`. +-- +-- Return: ~ +-- Map of process properties, or NIL if process not found. +--- @param pid number +--- @return object +function vim.api.nvim_get_proc(pid) end + +-- Gets the immediate children of process `pid`. +-- +-- Return: ~ +-- Array of child process ids, empty if process not found. +--- @param pid number +--- @return any[] +function vim.api.nvim_get_proc_children(pid) end + +-- Find files in runtime directories +-- +-- "name" can contain wildcards. For example +-- nvim_get_runtime_file("colors/*.vim", true) will return all color scheme +-- files. Always use forward slashes (/) in the search pattern for +-- subdirectories regardless of platform. +-- +-- It is not an error to not find any files. An empty array is returned then. +-- +-- Attributes: ~ +-- |api-fast| +-- +-- Parameters: ~ +-- • {name} pattern of files to search for +-- • {all} whether to return all matches or only the first +-- +-- Return: ~ +-- list of absolute paths to the found files +--- @param name string +--- @param all boolean +--- @return string[] +function vim.api.nvim_get_runtime_file(name, all) end + +-- Gets a global (g:) variable. +-- +-- Parameters: ~ +-- • {name} Variable name +-- +-- Return: ~ +-- Variable value +--- @param name string +--- @return object +function vim.api.nvim_get_var(name) end + +-- Gets a v: variable. +-- +-- Parameters: ~ +-- • {name} Variable name +-- +-- Return: ~ +-- Variable value +--- @param name string +--- @return object +function vim.api.nvim_get_vvar(name) end + +-- Queues raw user-input. Unlike |nvim_feedkeys()|, this uses a low-level +-- input buffer and the call is non-blocking (input is processed +-- asynchronously by the eventloop). +-- +-- On execution error: does not fail, but updates v:errmsg. +-- +-- Note: +-- |keycodes| like are translated, so "<" is special. To input a +-- literal "<", send . +-- +-- Note: +-- For mouse events use |nvim_input_mouse()|. The pseudokey form +-- "" is deprecated since |api-level| 6. +-- +-- Attributes: ~ +-- |api-fast| +-- +-- Parameters: ~ +-- • {keys} to be typed +-- +-- Return: ~ +-- Number of bytes actually written (can be fewer than requested if the +-- buffer becomes full). +--- @param keys string +--- @return number +function vim.api.nvim_input(keys) end + +-- Send mouse event from GUI. +-- +-- Non-blocking: does not wait on any result, but queues the event to be +-- processed soon by the event loop. +-- +-- Note: +-- Currently this doesn't support "scripting" multiple mouse events by +-- calling it multiple times in a loop: the intermediate mouse positions +-- will be ignored. It should be used to implement real-time mouse input +-- in a GUI. The deprecated pseudokey form ("") of +-- |nvim_input()| has the same limitation. +-- +-- Attributes: ~ +-- |api-fast| +-- +-- Parameters: ~ +-- • {button} Mouse button: one of "left", "right", "middle", "wheel", +-- "move". +-- • {action} For ordinary buttons, one of "press", "drag", "release". +-- For the wheel, one of "up", "down", "left", "right". +-- Ignored for "move". +-- • {modifier} String of modifiers each represented by a single char. The +-- same specifiers are used as for a key press, except that +-- the "-" separator is optional, so "C-A-", "c-a" and "CA" +-- can all be used to specify Ctrl+Alt+click. +-- • {grid} Grid number if the client uses |ui-multigrid|, else 0. +-- • {row} Mouse row-position (zero-based, like redraw events) +-- • {col} Mouse column-position (zero-based, like redraw events) +--- @param button string +--- @param action string +--- @param modifier string +--- @param grid number +--- @param row number +--- @param col number +function vim.api.nvim_input_mouse(button, action, modifier, grid, row, col) end + +-- 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 +--- @return any[] +function vim.api.nvim_list_bufs() end + +-- Get information about all open channels. +-- +-- Return: ~ +-- Array of Dictionaries, each describing a channel with the format +-- specified at |nvim_get_chan_info()|. +--- @return any[] +function vim.api.nvim_list_chans() end + +-- Gets the paths contained in |runtime-search-path|. +-- +-- Return: ~ +-- List of paths +--- @return string[] +function vim.api.nvim_list_runtime_paths() end + +-- Gets the current list of tabpage handles. +-- +-- Return: ~ +-- List of tabpage handles +--- @return any[] +function vim.api.nvim_list_tabpages() end + +-- Gets a list of dictionaries representing attached UIs. +-- +-- Return: ~ +-- Array of UI dictionaries, each with these keys: +-- • "height" Requested height of the UI +-- • "width" Requested width of the UI +-- • "rgb" true if the UI uses RGB colors (false implies |cterm-colors|) +-- • "ext_..." Requested UI extensions, see |ui-option| +-- • "chan" |channel-id| of remote UI +--- @return any[] +function vim.api.nvim_list_uis() end + +-- Gets the current list of window handles. +-- +-- Return: ~ +-- List of window handles +--- @return any[] +function vim.api.nvim_list_wins() end + +-- Sets the current editor state from the given |context| map. +-- +-- Parameters: ~ +-- • {dict} |Context| map. +--- @param dict table +--- @return object +function vim.api.nvim_load_context(dict) end + +-- Notify the user with a message +-- +-- Relays the call to vim.notify . By default forwards your message in the +-- echo area but can be overridden to trigger desktop notifications. +-- +-- Parameters: ~ +-- • {msg} Message to display to the user +-- • {log_level} The log level +-- • {opts} Reserved for future use. +--- @param msg string +--- @param log_level number +--- @param opts table +--- @return object +function vim.api.nvim_notify(msg, log_level, opts) end + +-- Open a terminal instance in a buffer +-- +-- By default (and currently the only option) the terminal will not be +-- connected to an external process. Instead, input send on the channel will +-- be echoed directly by the terminal. This is useful to display ANSI +-- terminal sequences returned as part of a rpc message, or similar. +-- +-- Note: to directly initiate the terminal using the right size, display the +-- buffer in a configured window before calling this. For instance, for a +-- floating display, first create an empty buffer using |nvim_create_buf()|, +-- then display it using |nvim_open_win()|, and then call this function. Then +-- |nvim_chan_send()| can be called immediately to process sequences in a +-- virtual terminal having the intended size. +-- +-- Parameters: ~ +-- • {buffer} the buffer to use (expected to be empty) +-- • {opts} Optional parameters. +-- • on_input: lua callback for input sent, i e keypresses in +-- terminal mode. Note: keypresses are sent raw as they would +-- be to the pty master end. For instance, a carriage return +-- is sent as a "\r", not as a "\n". |textlock| applies. It +-- is possible to call |nvim_chan_send()| directly in the +-- callback however. ["input", term, bufnr, data] +-- +-- Return: ~ +-- Channel id, or 0 on error +--- @param buffer buffer +--- @param opts table +--- @return number +function vim.api.nvim_open_term(buffer, opts) end + +-- Open a new window. +-- +-- Currently this is used to open floating and external windows. Floats are +-- windows that are drawn above the split layout, at some anchor position in +-- some other window. Floats can be drawn internally or by external GUI with +-- the |ui-multigrid| extension. External windows are only supported with +-- multigrid GUIs, and are displayed as separate top-level windows. +-- +-- For a general overview of floats, see |api-floatwin|. +-- +-- Exactly one of `external` and `relative` must be specified. The `width` +-- and `height` of the new window must be specified. +-- +-- With relative=editor (row=0,col=0) refers to the top-left corner of the +-- screen-grid and (row=Lines-1,col=Columns-1) refers to the bottom-right +-- corner. Fractional values are allowed, but the builtin implementation +-- (used by non-multigrid UIs) will always round down to nearest integer. +-- +-- Out-of-bounds values, and configurations that make the float not fit +-- inside the main editor, are allowed. The builtin implementation truncates +-- values so floats are fully within the main screen grid. External GUIs +-- could let floats hover outside of the main window like a tooltip, but this +-- should not be used to specify arbitrary WM screen positions. +-- +-- Example (Lua): window-relative float +-- ```lua +-- vim.api.nvim_open_win(0, false, +-- {relative='win', row=3, col=3, width=12, height=3}) +-- ``` +-- +-- Example (Lua): buffer-relative float (travels as buffer is scrolled) +-- ```lua +-- vim.api.nvim_open_win(0, false, +-- {relative='win', width=12, height=3, bufpos={100,10}}) +-- ``` +-- +-- Attributes: ~ +-- not allowed when |textlock| is active +-- +-- Parameters: ~ +-- • {buffer} Buffer to display, or 0 for current buffer +-- • {enter} Enter the window (make it the current window) +-- • {config} Map defining the window configuration. Keys: +-- • relative: Sets the window layout to "floating", placed at +-- (row,col) coordinates relative to: +-- • "editor" The global editor grid +-- • "win" Window given by the `win` field, or current +-- window. +-- • "cursor" Cursor position in current window. +-- • "mouse" Mouse position +-- +-- • win: |window-ID| for relative="win". +-- • anchor: Decides which corner of the float to place at +-- (row,col): +-- • "NW" northwest (default) +-- • "NE" northeast +-- • "SW" southwest +-- • "SE" southeast +-- +-- • width: Window width (in character cells). Minimum of 1. +-- • height: Window height (in character cells). Minimum of 1. +-- • bufpos: Places float relative to buffer text (only when +-- relative="win"). Takes a tuple of zero-indexed [line, +-- column]. `row` and `col` if given are applied relative to this position, else they +-- default to: +-- • `row=1` and `col=0` if `anchor` is "NW" or "NE" +-- • `row=0` and `col=0` if `anchor` is "SW" or "SE" (thus +-- like a tooltip near the buffer text). +-- +-- • row: Row position in units of "screen cell height", may be +-- fractional. +-- • col: Column position in units of "screen cell width", may +-- be fractional. +-- • focusable: Enable focus by user actions (wincmds, mouse +-- events). Defaults to true. Non-focusable windows can be +-- entered by |nvim_set_current_win()|. +-- • external: GUI should display the window as an external +-- top-level window. Currently accepts no other positioning +-- configuration together with this. +-- • zindex: Stacking order. floats with higher `zindex` go on top on floats with lower indices. Must be larger +-- than zero. The following screen elements have hard-coded +-- z-indices: +-- • 100: insert completion popupmenu +-- • 200: message scrollback +-- • 250: cmdline completion popupmenu (when +-- wildoptions+=pum) The default value for floats are 50. +-- In general, values below 100 are recommended, unless +-- there is a good reason to overshadow builtin elements. +-- +-- • style: (optional) Configure the appearance of the window. +-- Currently only supports one value: +-- • "minimal" Nvim will display the window with many UI +-- options disabled. This is useful when displaying a +-- temporary float where the text should not be edited. +-- Disables 'number', 'relativenumber', 'cursorline', +-- 'cursorcolumn', 'foldcolumn', 'spell' and 'list' +-- options. 'signcolumn' is changed to `auto` and +-- 'colorcolumn' is cleared. 'statuscolumn' is changed to +-- empty. The end-of-buffer region is hidden by setting +-- `eob` flag of 'fillchars' to a space char, and clearing +-- the |hl-EndOfBuffer| region in 'winhighlight'. +-- +-- • border: Style of (optional) window border. This can either +-- be a string or an array. The string values are +-- • "none": No border (default). +-- • "single": A single line box. +-- • "double": A double line box. +-- • "rounded": Like "single", but with rounded corners ("╭" +-- etc.). +-- • "solid": Adds padding by a single whitespace cell. +-- • "shadow": A drop shadow effect by blending with the +-- background. +-- • If it is an array, it should have a length of eight or +-- any divisor of eight. The array will specifify the eight +-- chars building up the border in a clockwise fashion +-- starting with the top-left corner. As an example, the +-- double box style could be specified as [ "╔", "═" ,"╗", +-- "║", "╝", "═", "╚", "║" ]. If the number of chars are +-- less than eight, they will be repeated. Thus an ASCII +-- border could be specified as [ "/", "-", "\\", "|" ], or +-- all chars the same as [ "x" ]. An empty string can be +-- used to turn off a specific border, for instance, [ "", +-- "", "", ">", "", "", "", "<" ] will only make vertical +-- borders but not horizontal ones. By default, +-- `FloatBorder` highlight is used, which links to +-- `WinSeparator` when not defined. It could also be +-- specified by character: [ ["+", "MyCorner"], ["x", +-- "MyBorder"] ]. +-- +-- • title: Title (optional) in window border, String or list. +-- List is [text, highlight] tuples. if is string the default +-- highlight group is `FloatTitle`. +-- • title_pos: Title position must set with title option. +-- value can be of `left` `center` `right` default is left. +-- • noautocmd: If true then no buffer-related autocommand +-- events such as |BufEnter|, |BufLeave| or |BufWinEnter| may +-- fire from calling this function. +-- +-- Return: ~ +-- Window handle, or 0 on error +--- @param buffer buffer +--- @param enter boolean +--- @param config? table +--- @return window +function vim.api.nvim_open_win(buffer, enter, config) end + +-- Writes a message to the Vim output buffer. Does not append "\n", the +-- message is buffered (won't display) until a linefeed is written. +-- +-- Parameters: ~ +-- • {str} Message +--- @param str string +function vim.api.nvim_out_write(str) end + +-- Parse command line. +-- +-- Doesn't check the validity of command arguments. +-- +-- Attributes: ~ +-- |api-fast| +-- +-- Parameters: ~ +-- • {str} Command line string to parse. Cannot contain "\n". +-- • {opts} Optional parameters. Reserved for future use. +-- +-- Return: ~ +-- Dictionary containing command information, with these keys: +-- • cmd: (string) Command name. +-- • range: (array) (optional) Command range (|| ||). +-- Omitted if command doesn't accept a range. Otherwise, has no +-- elements if no range was specified, one element if only a single +-- range item was specified, or two elements if both range items were +-- specified. +-- • count: (number) (optional) Command ||. Omitted if command +-- cannot take a count. +-- • reg: (string) (optional) Command ||. Omitted if command +-- cannot take a register. +-- • bang: (boolean) Whether command contains a || (!) modifier. +-- • args: (array) Command arguments. +-- • addr: (string) Value of |:command-addr|. Uses short name or "line" +-- for -addr=lines. +-- • nargs: (string) Value of |:command-nargs|. +-- • nextcmd: (string) Next command if there are multiple commands +-- separated by a |:bar|. Empty if there isn't a next command. +-- • magic: (dictionary) Which characters have special meaning in the +-- command arguments. +-- • file: (boolean) The command expands filenames. Which means +-- characters such as "%", "#" and wildcards are expanded. +-- • bar: (boolean) The "|" character is treated as a command separator +-- and the double quote character (") is treated as the start of a +-- comment. +-- +-- • mods: (dictionary) |:command-modifiers|. +-- • filter: (dictionary) |:filter|. +-- • pattern: (string) Filter pattern. Empty string if there is no +-- filter. +-- • force: (boolean) Whether filter is inverted or not. +-- +-- • silent: (boolean) |:silent|. +-- • emsg_silent: (boolean) |:silent!|. +-- • unsilent: (boolean) |:unsilent|. +-- • sandbox: (boolean) |:sandbox|. +-- • noautocmd: (boolean) |:noautocmd|. +-- • browse: (boolean) |:browse|. +-- • confirm: (boolean) |:confirm|. +-- • hide: (boolean) |:hide|. +-- • horizontal: (boolean) |:horizontal|. +-- • keepalt: (boolean) |:keepalt|. +-- • keepjumps: (boolean) |:keepjumps|. +-- • keepmarks: (boolean) |:keepmarks|. +-- • keeppatterns: (boolean) |:keeppatterns|. +-- • lockmarks: (boolean) |:lockmarks|. +-- • noswapfile: (boolean) |:noswapfile|. +-- • tab: (integer) |:tab|. -1 when omitted. +-- • verbose: (integer) |:verbose|. -1 when omitted. +-- • vertical: (boolean) |:vertical|. +-- • split: (string) Split modifier string, is an empty string when +-- there's no split modifier. If there is a split modifier it can be +-- one of: +-- • "aboveleft": |:aboveleft|. +-- • "belowright": |:belowright|. +-- • "topleft": |:topleft|. +-- • "botright": |:botright|. +--- @param str string +--- @param opts table +--- @return table +function vim.api.nvim_parse_cmd(str, opts) end + +-- Parse a VimL expression. +-- +-- Attributes: ~ +-- |api-fast| +-- +-- Parameters: ~ +-- • {expr} Expression to parse. Always treated as a single line. +-- • {flags} Flags: +-- • "m" if multiple expressions in a row are allowed (only +-- the first one will be parsed), +-- • "E" if EOC tokens are not allowed (determines whether +-- they will stop parsing process or be recognized as an +-- operator/space, though also yielding an error). +-- • "l" when needing to start parsing with lvalues for +-- ":let" or ":for". Common flag sets: +-- • "m" to parse like for ":echo". +-- • "E" to parse like for "=". +-- • empty string for ":call". +-- • "lm" to parse for ":let". +-- • {highlight} If true, return value will also include "highlight" key +-- containing array of 4-tuples (arrays) (Integer, Integer, +-- Integer, String), where first three numbers define the +-- highlighted region and represent line, starting column +-- and ending column (latter exclusive: one should highlight +-- region [start_col, end_col)). +-- +-- Return: ~ +-- +-- • AST: top-level dictionary with these keys: +-- • "error": Dictionary with error, present only if parser saw some +-- error. Contains the following keys: +-- • "message": String, error message in printf format, translated. +-- Must contain exactly one "%.*s". +-- • "arg": String, error message argument. +-- +-- • "len": Amount of bytes successfully parsed. With flags equal to "" +-- that should be equal to the length of expr string. (“Successfully +-- parsed” here means “participated in AST creation”, not “till the +-- first error”.) +-- • "ast": AST, either nil or a dictionary with these keys: +-- • "type": node type, one of the value names from ExprASTNodeType +-- stringified without "kExprNode" prefix. +-- • "start": a pair [line, column] describing where node is +-- "started" where "line" is always 0 (will not be 0 if you will be +-- using nvim_parse_viml() on e.g. ":let", but that is not present +-- yet). Both elements are Integers. +-- • "len": “length” of the node. This and "start" are there for +-- debugging purposes primary (debugging parser and providing debug +-- information). +-- • "children": a list of nodes described in top/"ast". There always +-- is zero, one or two children, key will not be present if node +-- has no children. Maximum number of children may be found in +-- node_maxchildren array. +-- +-- • Local values (present only for certain nodes): +-- • "scope": a single Integer, specifies scope for "Option" and +-- "PlainIdentifier" nodes. For "Option" it is one of ExprOptScope +-- values, for "PlainIdentifier" it is one of ExprVarScope values. +-- • "ident": identifier (without scope, if any), present for "Option", +-- "PlainIdentifier", "PlainKey" and "Environment" nodes. +-- • "name": Integer, register name (one character) or -1. Only present +-- for "Register" nodes. +-- • "cmp_type": String, comparison type, one of the value names from +-- ExprComparisonType, stringified without "kExprCmp" prefix. Only +-- present for "Comparison" nodes. +-- • "ccs_strategy": String, case comparison strategy, one of the value +-- names from ExprCaseCompareStrategy, stringified without +-- "kCCStrategy" prefix. Only present for "Comparison" nodes. +-- • "augmentation": String, augmentation type for "Assignment" nodes. +-- Is either an empty string, "Add", "Subtract" or "Concat" for "=", +-- "+=", "-=" or ".=" respectively. +-- • "invert": Boolean, true if result of comparison needs to be +-- inverted. Only present for "Comparison" nodes. +-- • "ivalue": Integer, integer value for "Integer" nodes. +-- • "fvalue": Float, floating-point value for "Float" nodes. +-- • "svalue": String, value for "SingleQuotedString" and +-- "DoubleQuotedString" nodes. +--- @param expr string +--- @param flags string +--- @param highlight boolean +--- @return table +function vim.api.nvim_parse_expression(expr, flags, highlight) end + +-- Pastes at cursor, in any mode. +-- +-- Invokes the `vim.paste` handler, which handles each mode appropriately. +-- Sets redo/undo. Faster than |nvim_input()|. Lines break at LF ("\n"). +-- +-- Errors ('nomodifiable', `vim.paste()` failure, …) are reflected in `err` +-- but do not affect the return value (which is strictly decided by +-- `vim.paste()`). On error, subsequent calls are ignored ("drained") until +-- the next paste is initiated (phase 1 or -1). +-- +-- Attributes: ~ +-- not allowed when |textlock| is active +-- +-- Parameters: ~ +-- • {data} Multiline input. May be binary (containing NUL bytes). +-- • {crlf} Also break lines at CR and CRLF. +-- • {phase} -1: paste in a single call (i.e. without streaming). To +-- "stream" a paste, call `nvim_paste` sequentially with these `phase` values: +-- • 1: starts the paste (exactly once) +-- • 2: continues the paste (zero or more times) +-- • 3: ends the paste (exactly once) +-- +-- Return: ~ +-- +-- • true: Client may continue pasting. +-- • false: Client must cancel the paste. +--- @param data string +--- @param crlf boolean +--- @param phase number +--- @return boolean +function vim.api.nvim_paste(data, crlf, phase) end + +-- Puts text at cursor, in any mode. +-- +-- Compare |:put| and |p| which are always linewise. +-- +-- Attributes: ~ +-- not allowed when |textlock| is active +-- +-- Parameters: ~ +-- • {lines} |readfile()|-style list of lines. |channel-lines| +-- • {type} Edit behavior: any |getregtype()| result, or: +-- • "b" |blockwise-visual| mode (may include width, e.g. "b3") +-- • "c" |charwise| mode +-- • "l" |linewise| mode +-- • "" guess by contents, see |setreg()| +-- • {after} If true insert after cursor (like |p|), or before (like +-- |P|). +-- • {follow} If true place cursor at end of inserted text. +--- @param lines string[] +--- @param type string +--- @param after boolean +--- @param follow boolean +function vim.api.nvim_put(lines, type, after, follow) end + +-- Replaces terminal codes and |keycodes| (, , ...) in a string with +-- the internal representation. +-- +-- Parameters: ~ +-- • {str} String to be converted. +-- • {from_part} Legacy Vim parameter. Usually true. +-- • {do_lt} Also translate . Ignored if `special` is false. +-- • {special} Replace |keycodes|, e.g. becomes a "\r" char. +-- +-- See also: ~ +-- • replace_termcodes +-- • cpoptions +--- @param str string +--- @param from_part boolean +--- @param do_lt boolean +--- @param special boolean +--- @return string +function vim.api.nvim_replace_termcodes(str, from_part, do_lt, special) end + +-- Selects an item in the completion popup menu. +-- +-- If neither |ins-completion| nor |cmdline-completion| popup menu is active +-- this API call is silently ignored. Useful for an external UI using +-- |ui-popupmenu| to control the popup menu with the mouse. Can also be used +-- in a mapping; use |:map-cmd| or a Lua mapping to ensure the mapping +-- doesn't end completion mode. +-- +-- Parameters: ~ +-- • {item} Index (zero-based) of the item to select. Value of -1 +-- selects nothing and restores the original text. +-- • {insert} For |ins-completion|, whether the selection should be +-- inserted in the buffer. Ignored for |cmdline-completion|. +-- • {finish} Finish the completion and dismiss the popup menu. Implies +-- {insert}. +-- • {opts} Optional parameters. Reserved for future use. +--- @param item number +--- @param insert boolean +--- @param finish boolean +--- @param opts table +function vim.api.nvim_select_popupmenu_item(item, insert, finish, opts) end + +-- Sets the current buffer. +-- +-- Attributes: ~ +-- not allowed when |textlock| is active +-- +-- Parameters: ~ +-- • {buffer} Buffer handle +--- @param buffer buffer +function vim.api.nvim_set_current_buf(buffer) end + +-- Changes the global working directory. +-- +-- Parameters: ~ +-- • {dir} Directory path +--- @param dir string +function vim.api.nvim_set_current_dir(dir) end + +-- Sets the current line. +-- +-- Attributes: ~ +-- not allowed when |textlock| is active +-- +-- Parameters: ~ +-- • {line} Line contents +--- @param line string +function vim.api.nvim_set_current_line(line) end + +-- Sets the current tabpage. +-- +-- Attributes: ~ +-- not allowed when |textlock| is active +-- +-- Parameters: ~ +-- • {tabpage} Tabpage handle +--- @param tabpage tabpage +function vim.api.nvim_set_current_tabpage(tabpage) end + +-- Sets the current window. +-- +-- Attributes: ~ +-- not allowed when |textlock| is active +-- +-- Parameters: ~ +-- • {window} Window handle +--- @param window window +function vim.api.nvim_set_current_win(window) end + +-- Set or change decoration provider for a |namespace| +-- +-- This is a very general purpose interface for having lua callbacks being +-- triggered during the redraw code. +-- +-- The expected usage is to set |extmarks| for the currently redrawn buffer. +-- |nvim_buf_set_extmark()| can be called to add marks on a per-window or +-- per-lines basis. Use the `ephemeral` key to only use the mark for the +-- current screen redraw (the callback will be called again for the next +-- redraw ). +-- +-- Note: this function should not be called often. Rather, the callbacks +-- themselves can be used to throttle unneeded callbacks. the `on_start` +-- callback can return `false` to disable the provider until the next redraw. +-- Similarly, return `false` in `on_win` will skip the `on_lines` calls for +-- that window (but any extmarks set in `on_win` will still be used). A +-- plugin managing multiple sources of decoration should ideally only set one +-- provider, and merge the sources internally. You can use multiple `ns_id` +-- for the extmarks set/modified inside the callback anyway. +-- +-- Note: doing anything other than setting extmarks is considered +-- experimental. Doing things like changing options are not explicitly +-- forbidden, but is likely to have unexpected consequences (such as 100% CPU +-- consumption). doing `vim.rpcnotify` should be OK, but `vim.rpcrequest` is +-- quite dubious for the moment. +-- +-- Note: It is not allowed to remove or update extmarks in 'on_line' +-- callbacks. +-- +-- Attributes: ~ +-- Lua |vim.api| only +-- +-- Parameters: ~ +-- • {ns_id} Namespace id from |nvim_create_namespace()| +-- • {opts} Table of callbacks: +-- • on_start: called first on each screen redraw ["start", +-- tick] +-- • on_buf: called for each buffer being redrawn (before window +-- callbacks) ["buf", bufnr, tick] +-- • on_win: called when starting to redraw a specific window. +-- ["win", winid, bufnr, topline, botline_guess] +-- • on_line: called for each buffer line being redrawn. (The +-- interaction with fold lines is subject to change) ["win", +-- winid, bufnr, row] +-- • on_end: called at the end of a redraw cycle ["end", tick] +--- @param ns_id number +--- @param opts? table +function vim.api.nvim_set_decoration_provider(ns_id, opts) end + +-- Sets a highlight group. +-- +-- Note: +-- Unlike the `:highlight` command which can update a highlight group, +-- this function completely replaces the definition. For example: +-- `nvim_set_hl(0, 'Visual', {})` will clear the highlight group +-- 'Visual'. +-- +-- Note: +-- The fg and bg keys also accept the string values `"fg"` or `"bg"` +-- which act as aliases to the corresponding foreground and background +-- values of the Normal group. If the Normal group has not been defined, +-- using these values results in an error. +-- +-- Note: +-- If `link` is used in combination with other attributes; only the +-- `link` will take effect (see |:hi-link|). +-- +-- Parameters: ~ +-- • {ns_id} Namespace id for this highlight |nvim_create_namespace()|. +-- Use 0 to set a highlight group globally |:highlight|. +-- Highlights from non-global namespaces are not active by +-- default, use |nvim_set_hl_ns()| or |nvim_win_set_hl_ns()| to +-- activate them. +-- • {name} Highlight group name, e.g. "ErrorMsg" +-- • {val} Highlight definition map, accepts the following keys: +-- • fg (or foreground): color name or "#RRGGBB", see note. +-- • bg (or background): color name or "#RRGGBB", see note. +-- • sp (or special): color name or "#RRGGBB" +-- • blend: integer between 0 and 100 +-- • bold: boolean +-- • standout: boolean +-- • underline: boolean +-- • undercurl: boolean +-- • underdouble: boolean +-- • underdotted: boolean +-- • underdashed: boolean +-- • strikethrough: boolean +-- • italic: boolean +-- • reverse: boolean +-- • nocombine: boolean +-- • link: name of another highlight group to link to, see +-- |:hi-link|. +-- • default: Don't override existing definition |:hi-default| +-- • ctermfg: Sets foreground of cterm color |ctermfg| +-- • ctermbg: Sets background of cterm color |ctermbg| +-- • cterm: cterm attribute map, like |highlight-args|. If not +-- set, cterm attributes will match those from the attribute +-- map documented above. +--- @param ns_id number +--- @param name string +--- @param val? table +function vim.api.nvim_set_hl(ns_id, name, val) end + +-- Set active namespace for highlights defined with |nvim_set_hl()|. This can +-- be set for a single window, see |nvim_win_set_hl_ns()|. +-- +-- Parameters: ~ +-- • {ns_id} the namespace to use +--- @param ns_id number +function vim.api.nvim_set_hl_ns(ns_id) end + +-- Set active namespace for highlights defined with |nvim_set_hl()| while +-- redrawing. +-- +-- This function meant to be called while redrawing, primarily from +-- |nvim_set_decoration_provider()| on_win and on_line callbacks, which are +-- allowed to change the namespace during a redraw cycle. +-- +-- Attributes: ~ +-- |api-fast| +-- +-- Parameters: ~ +-- • {ns_id} the namespace to activate +--- @param ns_id number +function vim.api.nvim_set_hl_ns_fast(ns_id) end + +-- Sets a global |mapping| for the given mode. +-- +-- To set a buffer-local mapping, use |nvim_buf_set_keymap()|. +-- +-- Unlike |:map|, leading/trailing whitespace is accepted as part of the +-- {lhs} or {rhs}. Empty {rhs} is ||. |keycodes| are replaced as usual. +-- +-- Example: +-- ```vim +-- call nvim_set_keymap('n', ' ', '', {'nowait': v:true}) +-- ``` +-- +-- is equivalent to: +-- ```vim +-- nmap +-- ``` +-- +-- Parameters: ~ +-- • {mode} Mode short-name (map command prefix: "n", "i", "v", "x", …) or +-- "!" for |:map!|, or empty string for |:map|. "ia", "ca" or +-- "!a" for abbreviation in Insert mode, Cmdline mode, or both, +-- respectively +-- • {lhs} Left-hand-side |{lhs}| of the mapping. +-- • {rhs} Right-hand-side |{rhs}| of the mapping. +-- • {opts} Optional parameters map: Accepts all |:map-arguments| as keys +-- except ||, values are booleans (default false). Also: +-- • "noremap" non-recursive mapping |:noremap| +-- • "desc" human-readable description. +-- • "callback" Lua function called in place of {rhs}. +-- • "replace_keycodes" (boolean) When "expr" is true, replace +-- keycodes in the resulting string (see +-- |nvim_replace_termcodes()|). Returning nil from the Lua +-- "callback" is equivalent to returning an empty string. +--- @param mode string +--- @param lhs string +--- @param rhs string +--- @param opts? table +function vim.api.nvim_set_keymap(mode, lhs, rhs, opts) end + +function vim.api.nvim_set_option() end + +-- Sets the value of an option. The behavior of this function matches that of +-- |:set|: for global-local options, both the global and local value are set +-- unless otherwise specified with {scope}. +-- +-- Note the options {win} and {buf} cannot be used together. +-- +-- Parameters: ~ +-- • {name} Option name +-- • {value} New option value +-- • {opts} Optional parameters +-- • scope: One of "global" or "local". Analogous to +-- |:setglobal| and |:setlocal|, respectively. +-- • win: |window-ID|. Used for setting window local option. +-- • buf: Buffer number. Used for setting buffer local option. +--- @param name string +--- @param value object +--- @param opts? table +function vim.api.nvim_set_option_value(name, value, opts) end + +-- Sets a global (g:) variable. +-- +-- Parameters: ~ +-- • {name} Variable name +-- • {value} Variable value +--- @param name string +--- @param value object +function vim.api.nvim_set_var(name, value) end + +-- Sets a v: variable, if it is not readonly. +-- +-- Parameters: ~ +-- • {name} Variable name +-- • {value} Variable value +--- @param name string +--- @param value object +function vim.api.nvim_set_vvar(name, value) end + +-- Calculates the number of display cells occupied by `text`. Control +-- characters including count as one cell. +-- +-- Parameters: ~ +-- • {text} Some text +-- +-- Return: ~ +-- Number of cells +--- @param text string +--- @return number +function vim.api.nvim_strwidth(text) end + +-- Removes a tab-scoped (t:) variable +-- +-- Parameters: ~ +-- • {tabpage} Tabpage handle, or 0 for current tabpage +-- • {name} Variable name +--- @param tabpage tabpage +--- @param name string +function vim.api.nvim_tabpage_del_var(tabpage, name) end + +-- Gets the tabpage number +-- +-- Parameters: ~ +-- • {tabpage} Tabpage handle, or 0 for current tabpage +-- +-- Return: ~ +-- Tabpage number +--- @param tabpage tabpage +--- @return number +function vim.api.nvim_tabpage_get_number(tabpage) end + +-- Gets a tab-scoped (t:) variable +-- +-- Parameters: ~ +-- • {tabpage} Tabpage handle, or 0 for current tabpage +-- • {name} Variable name +-- +-- Return: ~ +-- Variable value +--- @param tabpage tabpage +--- @param name string +--- @return object +function vim.api.nvim_tabpage_get_var(tabpage, name) end + +-- Gets the current window in a tabpage +-- +-- Parameters: ~ +-- • {tabpage} Tabpage handle, or 0 for current tabpage +-- +-- Return: ~ +-- Window handle +--- @param tabpage tabpage +--- @return window +function vim.api.nvim_tabpage_get_win(tabpage) end + +-- Checks if a tabpage is valid +-- +-- Parameters: ~ +-- • {tabpage} Tabpage handle, or 0 for current tabpage +-- +-- Return: ~ +-- true if the tabpage is valid, false otherwise +--- @param tabpage tabpage +--- @return boolean +function vim.api.nvim_tabpage_is_valid(tabpage) end + +-- Gets the windows in a tabpage +-- +-- Parameters: ~ +-- • {tabpage} Tabpage handle, or 0 for current tabpage +-- +-- Return: ~ +-- List of windows in `tabpage` +--- @param tabpage tabpage +--- @return any[] +function vim.api.nvim_tabpage_list_wins(tabpage) end + +-- Sets a tab-scoped (t:) variable +-- +-- Parameters: ~ +-- • {tabpage} Tabpage handle, or 0 for current tabpage +-- • {name} Variable name +-- • {value} Variable value +--- @param tabpage tabpage +--- @param name string +--- @param value object +function vim.api.nvim_tabpage_set_var(tabpage, name, value) end + +-- Calls a function with window as temporary current window. +-- +-- Attributes: ~ +-- Lua |vim.api| only +-- +-- Parameters: ~ +-- • {window} Window handle, or 0 for current window +-- • {fun} Function to call inside the window (currently lua callable +-- only) +-- +-- Return: ~ +-- Return value of function. NB: will deepcopy lua values currently, use +-- upvalues to send lua references in and out. +-- +-- See also: ~ +-- • |win_execute()| +-- • |nvim_buf_call()| +--- @param window window +--- @param fun fun() +--- @return object +function vim.api.nvim_win_call(window, fun) end + +-- Closes the window (like |:close| with a |window-ID|). +-- +-- Attributes: ~ +-- not allowed when |textlock| is active +-- +-- Parameters: ~ +-- • {window} Window handle, or 0 for current window +-- • {force} Behave like `:close!` The last window of a buffer with +-- unwritten changes can be closed. The buffer will become +-- hidden, even if 'hidden' is not set. +--- @param window window +--- @param force boolean +function vim.api.nvim_win_close(window, force) end + +-- Removes a window-scoped (w:) variable +-- +-- Parameters: ~ +-- • {window} Window handle, or 0 for current window +-- • {name} Variable name +--- @param window window +--- @param name string +function vim.api.nvim_win_del_var(window, name) end + +-- Gets the current buffer in a window +-- +-- Parameters: ~ +-- • {window} Window handle, or 0 for current window +-- +-- Return: ~ +-- Buffer handle +--- @param window window +--- @return buffer +function vim.api.nvim_win_get_buf(window) end + +-- Gets window configuration. +-- +-- The returned value may be given to |nvim_open_win()|. +-- +-- `relative` is empty for normal windows. +-- +-- Parameters: ~ +-- • {window} Window handle, or 0 for current window +-- +-- Return: ~ +-- Map defining the window configuration, see |nvim_open_win()| +--- @param window window +--- @return table +function vim.api.nvim_win_get_config(window) end + +-- Gets the (1,0)-indexed, buffer-relative cursor position for a given window +-- (different windows showing the same buffer have independent cursor +-- positions). |api-indexing| +-- +-- Parameters: ~ +-- • {window} Window handle, or 0 for current window +-- +-- Return: ~ +-- (row, col) tuple +-- +-- See also: ~ +-- • |getcurpos()| +--- @param window window +--- @return number[] +function vim.api.nvim_win_get_cursor(window) end + +-- Gets the window height +-- +-- Parameters: ~ +-- • {window} Window handle, or 0 for current window +-- +-- Return: ~ +-- Height as a count of rows +--- @param window window +--- @return number +function vim.api.nvim_win_get_height(window) end + +-- Gets the window number +-- +-- Parameters: ~ +-- • {window} Window handle, or 0 for current window +-- +-- Return: ~ +-- Window number +--- @param window window +--- @return number +function vim.api.nvim_win_get_number(window) end + +--- @return object +function vim.api.nvim_win_get_option() end + +-- Gets the window position in display cells. First position is zero. +-- +-- Parameters: ~ +-- • {window} Window handle, or 0 for current window +-- +-- Return: ~ +-- (row, col) tuple with the window position +--- @param window window +--- @return number[] +function vim.api.nvim_win_get_position(window) end + +-- Gets the window tabpage +-- +-- Parameters: ~ +-- • {window} Window handle, or 0 for current window +-- +-- Return: ~ +-- Tabpage that contains the window +--- @param window window +--- @return tabpage +function vim.api.nvim_win_get_tabpage(window) end + +-- Gets a window-scoped (w:) variable +-- +-- Parameters: ~ +-- • {window} Window handle, or 0 for current window +-- • {name} Variable name +-- +-- Return: ~ +-- Variable value +--- @param window window +--- @param name string +--- @return object +function vim.api.nvim_win_get_var(window, name) end + +-- Gets the window width +-- +-- Parameters: ~ +-- • {window} Window handle, or 0 for current window +-- +-- Return: ~ +-- Width as a count of columns +--- @param window window +--- @return number +function vim.api.nvim_win_get_width(window) end + +-- Closes the window and hide the buffer it contains (like |:hide| with a +-- |window-ID|). +-- +-- Like |:hide| the buffer becomes hidden unless another window is editing +-- it, or 'bufhidden' is `unload`, `delete` or `wipe` as opposed to |:close| +-- or |nvim_win_close()|, which will close the buffer. +-- +-- Attributes: ~ +-- not allowed when |textlock| is active +-- +-- Parameters: ~ +-- • {window} Window handle, or 0 for current window +--- @param window window +function vim.api.nvim_win_hide(window) end + +-- Checks if a window is valid +-- +-- Parameters: ~ +-- • {window} Window handle, or 0 for current window +-- +-- Return: ~ +-- true if the window is valid, false otherwise +--- @param window window +--- @return boolean +function vim.api.nvim_win_is_valid(window) end + +-- Sets the current buffer in a window, without side effects +-- +-- Attributes: ~ +-- not allowed when |textlock| is active +-- +-- Parameters: ~ +-- • {window} Window handle, or 0 for current window +-- • {buffer} Buffer handle +--- @param window window +--- @param buffer buffer +function vim.api.nvim_win_set_buf(window, buffer) end + +-- Configures window layout. Currently only for floating and external windows +-- (including changing a split window to those layouts). +-- +-- When reconfiguring a floating window, absent option keys will not be +-- changed. `row`/`col` and `relative` must be reconfigured together. +-- +-- Parameters: ~ +-- • {window} Window handle, or 0 for current window +-- • {config} Map defining the window configuration, see |nvim_open_win()| +-- +-- See also: ~ +-- • |nvim_open_win()| +--- @param window window +--- @param config? table +function vim.api.nvim_win_set_config(window, config) end + +-- Sets the (1,0)-indexed cursor position in the window. |api-indexing| This +-- scrolls the window even if it is not the current one. +-- +-- Parameters: ~ +-- • {window} Window handle, or 0 for current window +-- • {pos} (row, col) tuple representing the new position +--- @param window window +--- @param pos number[] +function vim.api.nvim_win_set_cursor(window, pos) end + +-- Sets the window height. +-- +-- Parameters: ~ +-- • {window} Window handle, or 0 for current window +-- • {height} Height as a count of rows +--- @param window window +--- @param height number +function vim.api.nvim_win_set_height(window, height) end + +-- Set highlight namespace for a window. This will use highlights defined +-- with |nvim_set_hl()| for this namespace, but fall back to global +-- highlights (ns=0) when missing. +-- +-- This takes precedence over the 'winhighlight' option. +-- +-- Parameters: ~ +-- • {ns_id} the namespace to use +--- @param window window +--- @param ns_id number +function vim.api.nvim_win_set_hl_ns(window, ns_id) end + +function vim.api.nvim_win_set_option() end + +-- Sets a window-scoped (w:) variable +-- +-- Parameters: ~ +-- • {window} Window handle, or 0 for current window +-- • {name} Variable name +-- • {value} Variable value +--- @param window window +--- @param name string +--- @param value object +function vim.api.nvim_win_set_var(window, name, value) end + +-- Sets the window width. This will only succeed if the screen is split +-- vertically. +-- +-- Parameters: ~ +-- • {window} Window handle, or 0 for current window +-- • {width} Width as a count of columns +--- @param window window +--- @param width number +function vim.api.nvim_win_set_width(window, width) end + diff --git a/bundle/neodev.nvim/types/nightly/cmd.lua b/bundle/neodev.nvim/types/nightly/cmd.lua new file mode 100644 index 000000000..6cfb6ff24 --- /dev/null +++ b/bundle/neodev.nvim/types/nightly/cmd.lua @@ -0,0 +1,3080 @@ +---@meta + +-- append text +function vim.cmd.a(...)end + +-- enter abbreviation +function vim.cmd.ab(...)end + +-- enter abbreviation +function vim.cmd.abbreviate(...)end + +-- remove all abbreviations +function vim.cmd.abc(...)end + +-- remove all abbreviations +function vim.cmd.abclear(...)end + +-- make split window appear left or above +function vim.cmd.abo(...)end + +-- make split window appear left or above +function vim.cmd.aboveleft(...)end + +-- open a window for each file in the argument +function vim.cmd.al(...)end + +-- open a window for each file in the argument +function vim.cmd.all(...)end + +-- enter new menu item for all modes +function vim.cmd.am(...)end + +-- enter new menu item for all modes +function vim.cmd.amenu(...)end + +-- enter a new menu for all modes that will not +function vim.cmd.an(...)end + +-- enter a new menu for all modes that will not +function vim.cmd.anoremenu(...)end + +-- append text +function vim.cmd.append(...)end + +-- print the argument list +function vim.cmd.ar(...)end + +-- add items to the argument list +function vim.cmd.arga(...)end + +-- add items to the argument list +function vim.cmd.argadd(...)end + +-- delete items from the argument list +function vim.cmd.argd(...)end + +-- remove duplicates from the argument list +function vim.cmd.argded(...)end + +-- remove duplicates from the argument list +function vim.cmd.argdedupe(...)end + +-- delete items from the argument list +function vim.cmd.argdelete(...)end + +-- do a command on all items in the argument list +function vim.cmd.argdo(...)end + +-- add item to the argument list and edit it +function vim.cmd.arge(...)end + +-- add item to the argument list and edit it +function vim.cmd.argedit(...)end + +-- define the global argument list +function vim.cmd.argg(...)end + +-- define the global argument list +function vim.cmd.argglobal(...)end + +-- define a local argument list +function vim.cmd.argl(...)end + +-- define a local argument list +function vim.cmd.arglocal(...)end + +-- print the argument list +function vim.cmd.args(...)end + +-- go to specific file in the argument list +function vim.cmd.argu(...)end + +-- go to specific file in the argument list +function vim.cmd.argument(...)end + +-- print ascii value of character under the cursor +function vim.cmd.as(...)end + +-- print ascii value of character under the cursor +function vim.cmd.ascii(...)end + +-- enter or show autocommands +function vim.cmd.au(...)end + +-- select the autocommand group to use +function vim.cmd.aug(...)end + +-- select the autocommand group to use +function vim.cmd.augroup(...)end + +-- remove menu for all modes +function vim.cmd.aun(...)end + +-- remove menu for all modes +function vim.cmd.aunmenu(...)end + +-- enter or show autocommands +function vim.cmd.autocmd(...)end + +-- go to specific buffer in the buffer list +function vim.cmd.b(...)end + +-- go to previous buffer in the buffer list +function vim.cmd.bN(...)end + +-- go to previous buffer in the buffer list +function vim.cmd.bNext(...)end + +-- open a window for each buffer in the buffer list +function vim.cmd.ba(...)end + +-- add buffer to the buffer list +function vim.cmd.bad(...)end + +-- add buffer to the buffer list +function vim.cmd.badd(...)end + +-- open a window for each buffer in the buffer list +function vim.cmd.ball(...)end + +-- like ":badd" but also set the alternate file +function vim.cmd.balt(...)end + +-- remove a buffer from the buffer list +function vim.cmd.bd(...)end + +-- remove a buffer from the buffer list +function vim.cmd.bdelete(...)end + +-- make split window appear right or below +function vim.cmd.bel(...)end + +-- make split window appear right or below +function vim.cmd.belowright(...)end + +-- go to first buffer in the buffer list +function vim.cmd.bf(...)end + +-- go to first buffer in the buffer list +function vim.cmd.bfirst(...)end + +-- go to last buffer in the buffer list +function vim.cmd.bl(...)end + +-- go to last buffer in the buffer list +function vim.cmd.blast(...)end + +-- go to next buffer in the buffer list that has +function vim.cmd.bm(...)end + +-- go to next buffer in the buffer list that has +function vim.cmd.bmodified(...)end + +-- go to next buffer in the buffer list +function vim.cmd.bn(...)end + +-- go to next buffer in the buffer list +function vim.cmd.bnext(...)end + +-- make split window appear at bottom or far right +function vim.cmd.bo(...)end + +-- make split window appear at bottom or far right +function vim.cmd.botright(...)end + +-- go to previous buffer in the buffer list +function vim.cmd.bp(...)end + +-- go to previous buffer in the buffer list +function vim.cmd.bprevious(...)end + +-- go to first buffer in the buffer list +function vim.cmd.br(...)end + +-- break out of while loop +function vim.cmd.brea(...)end + +-- break out of while loop +vim.cmd["break"] = function(...)end + +-- add a debugger breakpoint +function vim.cmd.breaka(...)end + +-- add a debugger breakpoint +function vim.cmd.breakadd(...)end + +-- delete a debugger breakpoint +function vim.cmd.breakd(...)end + +-- delete a debugger breakpoint +function vim.cmd.breakdel(...)end + +-- list debugger breakpoints +function vim.cmd.breakl(...)end + +-- list debugger breakpoints +function vim.cmd.breaklist(...)end + +-- go to first buffer in the buffer list +function vim.cmd.brewind(...)end + +-- use file selection dialog +function vim.cmd.bro(...)end + +-- use file selection dialog +function vim.cmd.browse(...)end + +-- execute command in each listed buffer +function vim.cmd.bufdo(...)end + +-- go to specific buffer in the buffer list +function vim.cmd.buffer(...)end + +-- list all files in the buffer list +function vim.cmd.buffers(...)end + +-- unload a specific buffer +function vim.cmd.bun(...)end + +-- unload a specific buffer +function vim.cmd.bunload(...)end + +-- really delete a buffer +function vim.cmd.bw(...)end + +-- really delete a buffer +function vim.cmd.bwipeout(...)end + +-- replace a line or series of lines +function vim.cmd.c(...)end + +-- go to previous error +function vim.cmd.cN(...)end + +-- go to previous error +function vim.cmd.cNext(...)end + +-- go to last error in previous file +function vim.cmd.cNf(...)end + +-- go to last error in previous file +function vim.cmd.cNfile(...)end + +-- like ":abbreviate" but for Command-line mode +function vim.cmd.ca(...)end + +-- like ":abbreviate" but for Command-line mode +function vim.cmd.cabbrev(...)end + +-- clear all abbreviations for Command-line mode +function vim.cmd.cabc(...)end + +-- clear all abbreviations for Command-line mode +function vim.cmd.cabclear(...)end + +-- go to error above current line +function vim.cmd.cabo(...)end + +-- go to error above current line +function vim.cmd.cabove(...)end + +-- add errors from buffer +function vim.cmd.cad(...)end + +-- add errors from buffer +function vim.cmd.caddbuffer(...)end + +-- add errors from expr +function vim.cmd.cadde(...)end + +-- add errors from expr +function vim.cmd.caddexpr(...)end + +-- add error message to current quickfix list +function vim.cmd.caddf(...)end + +-- add error message to current quickfix list +function vim.cmd.caddfile(...)end + +-- go to error after current cursor +function vim.cmd.caf(...)end + +-- go to error after current cursor +function vim.cmd.cafter(...)end + +-- call a function +function vim.cmd.cal(...)end + +-- call a function +function vim.cmd.call(...)end + +-- part of a :try command +function vim.cmd.cat(...)end + +-- part of a :try command +function vim.cmd.catch(...)end + +-- parse error messages and jump to first error +function vim.cmd.cb(...)end + +-- go to error before current cursor +function vim.cmd.cbef(...)end + +-- go to error before current cursor +function vim.cmd.cbefore(...)end + +-- go to error below current line +function vim.cmd.cbel(...)end + +-- go to error below current line +function vim.cmd.cbelow(...)end + +-- scroll to the bottom of the quickfix window +function vim.cmd.cbo(...)end + +-- scroll to the bottom of the quickfix window +function vim.cmd.cbottom(...)end + +-- parse error messages and jump to first error +function vim.cmd.cbuffer(...)end + +-- go to specific error +function vim.cmd.cc(...)end + +-- close quickfix window +function vim.cmd.ccl(...)end + +-- close quickfix window +function vim.cmd.cclose(...)end + +-- change directory +function vim.cmd.cd(...)end + +-- execute command in each valid error list entry +function vim.cmd.cdo(...)end + +-- format lines at the center +function vim.cmd.ce(...)end + +-- format lines at the center +function vim.cmd.center(...)end + +-- read errors from expr and jump to first +function vim.cmd.cex(...)end + +-- read errors from expr and jump to first +function vim.cmd.cexpr(...)end + +-- read file with error messages and jump to first +function vim.cmd.cf(...)end + +-- execute command in each file in error list +function vim.cmd.cfd(...)end + +-- execute command in each file in error list +function vim.cmd.cfdo(...)end + +-- read file with error messages and jump to first +function vim.cmd.cfile(...)end + +-- go to the specified error, default first one +function vim.cmd.cfir(...)end + +-- go to the specified error, default first one +function vim.cmd.cfirst(...)end + +-- read file with error messages +function vim.cmd.cg(...)end + +-- get errors from buffer +function vim.cmd.cgetb(...)end + +-- get errors from buffer +function vim.cmd.cgetbuffer(...)end + +-- get errors from expr +function vim.cmd.cgete(...)end + +-- get errors from expr +function vim.cmd.cgetexpr(...)end + +-- read file with error messages +function vim.cmd.cgetfile(...)end + +-- replace a line or series of lines +function vim.cmd.change(...)end + +-- print the change list +function vim.cmd.changes(...)end + +-- change directory +function vim.cmd.chd(...)end + +-- change directory +function vim.cmd.chdir(...)end + +-- run healthchecks +function vim.cmd.che(...)end + +-- run healthchecks +function vim.cmd.checkhealth(...)end + +-- list included files +function vim.cmd.checkp(...)end + +-- list included files +function vim.cmd.checkpath(...)end + +-- check timestamp of loaded buffers +function vim.cmd.checkt(...)end + +-- check timestamp of loaded buffers +function vim.cmd.checktime(...)end + +-- list the error lists +function vim.cmd.chi(...)end + +-- list the error lists +function vim.cmd.chistory(...)end + +-- list all errors +function vim.cmd.cl(...)end + +-- go to the specified error, default last one +function vim.cmd.cla(...)end + +-- go to the specified error, default last one +function vim.cmd.clast(...)end + +-- clear the jump list +function vim.cmd.cle(...)end + +-- clear the jump list +function vim.cmd.clearjumps(...)end + +-- list all errors +function vim.cmd.clist(...)end + +-- close current window +function vim.cmd.clo(...)end + +-- close current window +function vim.cmd.close(...)end + +-- like ":map" but for Command-line mode +function vim.cmd.cm(...)end + +-- like ":map" but for Command-line mode +function vim.cmd.cmap(...)end + +-- clear all mappings for Command-line mode +function vim.cmd.cmapc(...)end + +-- clear all mappings for Command-line mode +function vim.cmd.cmapclear(...)end + +-- add menu for Command-line mode +function vim.cmd.cme(...)end + +-- add menu for Command-line mode +function vim.cmd.cmenu(...)end + +-- go to next error +function vim.cmd.cn(...)end + +-- go to newer error list +function vim.cmd.cnew(...)end + +-- go to newer error list +function vim.cmd.cnewer(...)end + +-- go to next error +function vim.cmd.cnext(...)end + +-- go to first error in next file +function vim.cmd.cnf(...)end + +-- go to first error in next file +function vim.cmd.cnfile(...)end + +-- like ":noremap" but for Command-line mode +function vim.cmd.cno(...)end + +-- like ":noreabbrev" but for Command-line mode +function vim.cmd.cnorea(...)end + +-- like ":noreabbrev" but for Command-line mode +function vim.cmd.cnoreabbrev(...)end + +-- like ":noremap" but for Command-line mode +function vim.cmd.cnoremap(...)end + +-- like ":noremenu" but for Command-line mode +function vim.cmd.cnoreme(...)end + +-- like ":noremenu" but for Command-line mode +function vim.cmd.cnoremenu(...)end + +-- copy lines +function vim.cmd.co(...)end + +-- go to older error list +function vim.cmd.col(...)end + +-- go to older error list +function vim.cmd.colder(...)end + +-- load a specific color scheme +function vim.cmd.colo(...)end + +-- load a specific color scheme +function vim.cmd.colorscheme(...)end + +-- create user-defined command +function vim.cmd.com(...)end + +-- clear all user-defined commands +function vim.cmd.comc(...)end + +-- clear all user-defined commands +function vim.cmd.comclear(...)end + +-- create user-defined command +function vim.cmd.command(...)end + +-- do settings for a specific compiler +function vim.cmd.comp(...)end + +-- do settings for a specific compiler +function vim.cmd.compiler(...)end + +-- go back to :while +function vim.cmd.con(...)end + +-- prompt user when confirmation required +function vim.cmd.conf(...)end + +-- prompt user when confirmation required +function vim.cmd.confirm(...)end + +-- create a variable as a constant +function vim.cmd.cons(...)end + +-- create a variable as a constant +function vim.cmd.const(...)end + +-- go back to :while +function vim.cmd.continue(...)end + +-- open quickfix window +function vim.cmd.cope(...)end + +-- open quickfix window +function vim.cmd.copen(...)end + +-- copy lines +function vim.cmd.copy(...)end + +-- go to previous error +function vim.cmd.cp(...)end + +-- go to last error in previous file +function vim.cmd.cpf(...)end + +-- go to last error in previous file +function vim.cmd.cpfile(...)end + +-- go to previous error +function vim.cmd.cprevious(...)end + +-- quit Vim with an error code +function vim.cmd.cq(...)end + +-- quit Vim with an error code +function vim.cmd.cquit(...)end + +-- go to the specified error, default first one +function vim.cmd.cr(...)end + +-- go to the specified error, default first one +function vim.cmd.crewind(...)end + +-- like ":unmap" but for Command-line mode +function vim.cmd.cu(...)end + +-- like ":unabbrev" but for Command-line mode +function vim.cmd.cuna(...)end + +-- like ":unabbrev" but for Command-line mode +function vim.cmd.cunabbrev(...)end + +-- like ":unmap" but for Command-line mode +function vim.cmd.cunmap(...)end + +-- remove menu for Command-line mode +function vim.cmd.cunme(...)end + +-- remove menu for Command-line mode +function vim.cmd.cunmenu(...)end + +-- open or close quickfix window +function vim.cmd.cw(...)end + +-- open or close quickfix window +function vim.cmd.cwindow(...)end + +-- short for |:delete| with the 'p' flag +function vim.cmd.d(...)end + +-- run a command in debugging mode +function vim.cmd.deb(...)end + +-- run a command in debugging mode +function vim.cmd.debug(...)end + +-- read debug mode commands from normal input +function vim.cmd.debugg(...)end + +-- read debug mode commands from normal input +function vim.cmd.debuggreedy(...)end + +-- delete user-defined command +function vim.cmd.delc(...)end + +-- delete user-defined command +function vim.cmd.delcommand(...)end + +-- delete lines +function vim.cmd.delete(...)end + +-- short for |:delete| with the 'p' flag +function vim.cmd.deletep(...)end + +-- delete a user function +function vim.cmd.delf(...)end + +-- delete a user function +function vim.cmd.delfunction(...)end + +-- delete marks +function vim.cmd.delm(...)end + +-- delete marks +function vim.cmd.delmarks(...)end + +-- display registers +function vim.cmd.di(...)end + +-- update 'diff' buffers +function vim.cmd.dif(...)end + +-- remove differences in current buffer +function vim.cmd.diffg(...)end + +-- remove differences in current buffer +function vim.cmd.diffget(...)end + +-- switch off diff mode +function vim.cmd.diffo(...)end + +-- switch off diff mode +function vim.cmd.diffoff(...)end + +-- apply a patch and show differences +function vim.cmd.diffp(...)end + +-- apply a patch and show differences +function vim.cmd.diffpatch(...)end + +-- remove differences in other buffer +function vim.cmd.diffpu(...)end + +-- remove differences in other buffer +function vim.cmd.diffput(...)end + +-- show differences with another file +function vim.cmd.diffs(...)end + +-- show differences with another file +function vim.cmd.diffsplit(...)end + +-- make current window a diff window +function vim.cmd.diffthis(...)end + +-- update 'diff' buffers +function vim.cmd.diffupdate(...)end + +-- show or enter digraphs +function vim.cmd.dig(...)end + +-- show or enter digraphs +function vim.cmd.digraphs(...)end + +-- display registers +function vim.cmd.display(...)end + +-- jump to #define +function vim.cmd.dj(...)end + +-- jump to #define +function vim.cmd.djump(...)end + +-- short for |:delete| with the 'l' flag +function vim.cmd.dl(...)end + +-- list #defines +function vim.cmd.dli(...)end + +-- list #defines +function vim.cmd.dlist(...)end + +-- apply autocommands to current buffer +vim.cmd["do"] = function(...)end + +-- apply autocommands for all loaded buffers +function vim.cmd.doautoa(...)end + +-- apply autocommands for all loaded buffers +function vim.cmd.doautoall(...)end + +-- apply autocommands to current buffer +function vim.cmd.doautocmd(...)end + +-- jump to window editing file or edit file in +function vim.cmd.dr(...)end + +-- jump to window editing file or edit file in +function vim.cmd.drop(...)end + +-- list one #define +function vim.cmd.ds(...)end + +-- list one #define +function vim.cmd.dsearch(...)end + +-- split window and jump to #define +function vim.cmd.dsp(...)end + +-- split window and jump to #define +function vim.cmd.dsplit(...)end + +-- edit a file +function vim.cmd.e(...)end + +-- go to older change, undo +function vim.cmd.ea(...)end + +-- go to older change, undo +function vim.cmd.earlier(...)end + +-- echoes the result of expressions +function vim.cmd.ec(...)end + +-- echoes the result of expressions +function vim.cmd.echo(...)end + +-- like :echo, show like an error and use history +function vim.cmd.echoe(...)end + +-- like :echo, show like an error and use history +function vim.cmd.echoerr(...)end + +-- set highlighting for echo commands +function vim.cmd.echoh(...)end + +-- set highlighting for echo commands +function vim.cmd.echohl(...)end + +-- same as :echo, put message in history +function vim.cmd.echom(...)end + +-- same as :echo, put message in history +function vim.cmd.echomsg(...)end + +-- same as :echo, but without +function vim.cmd.echon(...)end + +-- edit a file +function vim.cmd.edit(...)end + +-- part of an :if command +function vim.cmd.el(...)end + +-- part of an :if command +vim.cmd["else"] = function(...)end + +-- part of an :if command +function vim.cmd.elsei(...)end + +-- part of an :if command +vim.cmd["elseif"] = function(...)end + +-- execute a menu by name +function vim.cmd.em(...)end + +-- execute a menu by name +function vim.cmd.emenu(...)end + +-- end previous :if +function vim.cmd.en(...)end + +-- end of a user function started with :function +function vim.cmd.endf(...)end + +-- end previous :for +function vim.cmd.endfo(...)end + +-- end previous :for +function vim.cmd.endfor(...)end + +-- end of a user function started with :function +function vim.cmd.endfunction(...)end + +-- end previous :if +function vim.cmd.endif(...)end + +-- end previous :try +function vim.cmd.endt(...)end + +-- end previous :try +function vim.cmd.endtry(...)end + +-- end previous :while +function vim.cmd.endw(...)end + +-- end previous :while +function vim.cmd.endwhile(...)end + +-- edit a new, unnamed buffer +function vim.cmd.ene(...)end + +-- edit a new, unnamed buffer +function vim.cmd.enew(...)end + +-- evaluate an expression and discard the result +function vim.cmd.ev(...)end + +-- evaluate an expression and discard the result +function vim.cmd.eval(...)end + +-- same as ":edit" +function vim.cmd.ex(...)end + +-- execute result of expressions +function vim.cmd.exe(...)end + +-- execute result of expressions +function vim.cmd.execute(...)end + +-- same as ":xit" +function vim.cmd.exi(...)end + +-- same as ":xit" +function vim.cmd.exit(...)end + +-- overview of Ex commands +function vim.cmd.exu(...)end + +-- overview of Ex commands +function vim.cmd.exusage(...)end + +-- show or set the current file name +function vim.cmd.f(...)end + +-- show or set the current file name +function vim.cmd.file(...)end + +-- list all files in the buffer list +function vim.cmd.files(...)end + +-- switch file type detection on/off +function vim.cmd.filet(...)end + +-- switch file type detection on/off +function vim.cmd.filetype(...)end + +-- filter output of following command +function vim.cmd.filt(...)end + +-- filter output of following command +function vim.cmd.filter(...)end + +-- find file in 'path' and edit it +function vim.cmd.fin(...)end + +-- part of a :try command +function vim.cmd.fina(...)end + +-- part of a :try command +function vim.cmd.finally(...)end + +-- find file in 'path' and edit it +function vim.cmd.find(...)end + +-- quit sourcing a Vim script +function vim.cmd.fini(...)end + +-- quit sourcing a Vim script +function vim.cmd.finish(...)end + +-- go to the first file in the argument list +function vim.cmd.fir(...)end + +-- go to the first file in the argument list +function vim.cmd.first(...)end + +-- create a fold +function vim.cmd.fo(...)end + +-- create a fold +function vim.cmd.fold(...)end + +-- close folds +function vim.cmd.foldc(...)end + +-- close folds +function vim.cmd.foldclose(...)end + +-- execute command on lines not in a closed fold +function vim.cmd.foldd(...)end + +-- execute command on lines in a closed fold +function vim.cmd.folddoc(...)end + +-- execute command on lines in a closed fold +function vim.cmd.folddoclosed(...)end + +-- execute command on lines not in a closed fold +function vim.cmd.folddoopen(...)end + +-- open folds +function vim.cmd.foldo(...)end + +-- open folds +function vim.cmd.foldopen(...)end + +-- for loop +vim.cmd["for"] = function(...)end + +-- define a user function +function vim.cmd.fu(...)end + +-- define a user function +vim.cmd["function"] = function(...)end + +-- execute commands for matching lines +function vim.cmd.g(...)end + +-- execute commands for matching lines +function vim.cmd.global(...)end + +-- go to byte in the buffer +function vim.cmd.go(...)end + +-- go to byte in the buffer +vim.cmd["goto"] = function(...)end + +-- run 'grepprg' and jump to first match +function vim.cmd.gr(...)end + +-- run 'grepprg' and jump to first match +function vim.cmd.grep(...)end + +-- like :grep, but append to current list +function vim.cmd.grepa(...)end + +-- like :grep, but append to current list +function vim.cmd.grepadd(...)end + +-- start the GUI +function vim.cmd.gu(...)end + +-- start the GUI +function vim.cmd.gui(...)end + +-- start the GUI +function vim.cmd.gv(...)end + +-- start the GUI +function vim.cmd.gvim(...)end + +-- open a help window +function vim.cmd.h(...)end + +-- open a help window +function vim.cmd.help(...)end + +-- close one help window +function vim.cmd.helpc(...)end + +-- close one help window +function vim.cmd.helpclose(...)end + +-- like ":grep" but searches help files +function vim.cmd.helpg(...)end + +-- like ":grep" but searches help files +function vim.cmd.helpgrep(...)end + +-- generate help tags for a directory +function vim.cmd.helpt(...)end + +-- generate help tags for a directory +function vim.cmd.helptags(...)end + +-- specify highlighting methods +function vim.cmd.hi(...)end + +-- hide current buffer for a command +function vim.cmd.hid(...)end + +-- hide current buffer for a command +function vim.cmd.hide(...)end + +-- specify highlighting methods +function vim.cmd.highlight(...)end + +-- print a history list +function vim.cmd.his(...)end + +-- print a history list +function vim.cmd.history(...)end + +-- following window command work horizontally +function vim.cmd.hor(...)end + +-- following window command work horizontally +function vim.cmd.horizontal(...)end + +-- insert text +function vim.cmd.i(...)end + +-- like ":abbrev" but for Insert mode +function vim.cmd.ia(...)end + +-- like ":abbrev" but for Insert mode +function vim.cmd.iabbrev(...)end + +-- like ":abclear" but for Insert mode +function vim.cmd.iabc(...)end + +-- like ":abclear" but for Insert mode +function vim.cmd.iabclear(...)end + +-- execute commands when condition met +vim.cmd["if"] = function(...)end + +-- jump to definition of identifier +function vim.cmd.ij(...)end + +-- jump to definition of identifier +function vim.cmd.ijump(...)end + +-- list lines where identifier matches +function vim.cmd.il(...)end + +-- list lines where identifier matches +function vim.cmd.ilist(...)end + +-- like ":map" but for Insert mode +function vim.cmd.im(...)end + +-- like ":map" but for Insert mode +function vim.cmd.imap(...)end + +-- like ":mapclear" but for Insert mode +function vim.cmd.imapc(...)end + +-- like ":mapclear" but for Insert mode +function vim.cmd.imapclear(...)end + +-- add menu for Insert mode +function vim.cmd.ime(...)end + +-- add menu for Insert mode +function vim.cmd.imenu(...)end + +-- like ":noremap" but for Insert mode +function vim.cmd.ino(...)end + +-- like ":noreabbrev" but for Insert mode +function vim.cmd.inorea(...)end + +-- like ":noreabbrev" but for Insert mode +function vim.cmd.inoreabbrev(...)end + +-- like ":noremap" but for Insert mode +function vim.cmd.inoremap(...)end + +-- like ":noremenu" but for Insert mode +function vim.cmd.inoreme(...)end + +-- like ":noremenu" but for Insert mode +function vim.cmd.inoremenu(...)end + +-- insert text +function vim.cmd.insert(...)end + +-- print the introductory message +function vim.cmd.int(...)end + +-- print the introductory message +function vim.cmd.intro(...)end + +-- list one line where identifier matches +function vim.cmd.is(...)end + +-- list one line where identifier matches +function vim.cmd.isearch(...)end + +-- split window and jump to definition of +function vim.cmd.isp(...)end + +-- split window and jump to definition of +function vim.cmd.isplit(...)end + +-- like ":unmap" but for Insert mode +function vim.cmd.iu(...)end + +-- like ":unabbrev" but for Insert mode +function vim.cmd.iuna(...)end + +-- like ":unabbrev" but for Insert mode +function vim.cmd.iunabbrev(...)end + +-- like ":unmap" but for Insert mode +function vim.cmd.iunmap(...)end + +-- remove menu for Insert mode +function vim.cmd.iunme(...)end + +-- remove menu for Insert mode +function vim.cmd.iunmenu(...)end + +-- join lines +function vim.cmd.j(...)end + +-- join lines +function vim.cmd.join(...)end + +-- print the jump list +function vim.cmd.ju(...)end + +-- print the jump list +function vim.cmd.jumps(...)end + +-- set a mark +function vim.cmd.k(...)end + +-- following command keeps marks where they are +function vim.cmd.kee(...)end + +-- following command keeps the alternate file +function vim.cmd.keepa(...)end + +-- following command keeps the alternate file +function vim.cmd.keepalt(...)end + +-- following command keeps jumplist and marks +function vim.cmd.keepj(...)end + +-- following command keeps jumplist and marks +function vim.cmd.keepjumps(...)end + +-- following command keeps marks where they are +function vim.cmd.keepmarks(...)end + +-- following command keeps search pattern history +function vim.cmd.keepp(...)end + +-- following command keeps search pattern history +function vim.cmd.keeppatterns(...)end + +-- print lines +function vim.cmd.l(...)end + +-- go to previous entry in location list +function vim.cmd.lN(...)end + +-- go to previous entry in location list +function vim.cmd.lNext(...)end + +-- go to last entry in previous file +function vim.cmd.lNf(...)end + +-- go to last entry in previous file +function vim.cmd.lNfile(...)end + +-- go to the last file in the argument list +function vim.cmd.la(...)end + +-- go to location above current line +function vim.cmd.lab(...)end + +-- go to location above current line +function vim.cmd.labove(...)end + +-- add locations from expr +function vim.cmd.lad(...)end + +-- add locations from buffer +function vim.cmd.laddb(...)end + +-- add locations from buffer +function vim.cmd.laddbuffer(...)end + +-- add locations from expr +function vim.cmd.laddexpr(...)end + +-- add locations to current location list +function vim.cmd.laddf(...)end + +-- add locations to current location list +function vim.cmd.laddfile(...)end + +-- go to location after current cursor +function vim.cmd.laf(...)end + +-- go to location after current cursor +function vim.cmd.lafter(...)end + +-- set the language (locale) +function vim.cmd.lan(...)end + +-- set the language (locale) +function vim.cmd.language(...)end + +-- go to the last file in the argument list +function vim.cmd.last(...)end + +-- go to newer change, redo +function vim.cmd.lat(...)end + +-- go to newer change, redo +function vim.cmd.later(...)end + +-- parse locations and jump to first location +function vim.cmd.lb(...)end + +-- go to location before current cursor +function vim.cmd.lbef(...)end + +-- go to location before current cursor +function vim.cmd.lbefore(...)end + +-- go to location below current line +function vim.cmd.lbel(...)end + +-- go to location below current line +function vim.cmd.lbelow(...)end + +-- scroll to the bottom of the location window +function vim.cmd.lbo(...)end + +-- scroll to the bottom of the location window +function vim.cmd.lbottom(...)end + +-- parse locations and jump to first location +function vim.cmd.lbuffer(...)end + +-- change directory locally +function vim.cmd.lc(...)end + +-- change directory locally +function vim.cmd.lcd(...)end + +-- change directory locally +function vim.cmd.lch(...)end + +-- change directory locally +function vim.cmd.lchdir(...)end + +-- close location window +function vim.cmd.lcl(...)end + +-- close location window +function vim.cmd.lclose(...)end + +-- execute command in valid location list entries +function vim.cmd.ld(...)end + +-- execute command in valid location list entries +function vim.cmd.ldo(...)end + +-- left align lines +function vim.cmd.le(...)end + +-- left align lines +function vim.cmd.left(...)end + +-- make split window appear left or above +function vim.cmd.lefta(...)end + +-- make split window appear left or above +function vim.cmd.leftabove(...)end + +-- assign a value to a variable or option +function vim.cmd.let(...)end + +-- read locations from expr and jump to first +function vim.cmd.lex(...)end + +-- read locations from expr and jump to first +function vim.cmd.lexpr(...)end + +-- read file with locations and jump to first +function vim.cmd.lf(...)end + +-- execute command in each file in location list +function vim.cmd.lfd(...)end + +-- execute command in each file in location list +function vim.cmd.lfdo(...)end + +-- read file with locations and jump to first +function vim.cmd.lfile(...)end + +-- go to the specified location, default first one +function vim.cmd.lfir(...)end + +-- go to the specified location, default first one +function vim.cmd.lfirst(...)end + +-- read file with locations +function vim.cmd.lg(...)end + +-- get locations from buffer +function vim.cmd.lgetb(...)end + +-- get locations from buffer +function vim.cmd.lgetbuffer(...)end + +-- get locations from expr +function vim.cmd.lgete(...)end + +-- get locations from expr +function vim.cmd.lgetexpr(...)end + +-- read file with locations +function vim.cmd.lgetfile(...)end + +-- run 'grepprg' and jump to first match +function vim.cmd.lgr(...)end + +-- run 'grepprg' and jump to first match +function vim.cmd.lgrep(...)end + +-- like :grep, but append to current list +function vim.cmd.lgrepa(...)end + +-- like :grep, but append to current list +function vim.cmd.lgrepadd(...)end + +-- like ":helpgrep" but uses location list +function vim.cmd.lh(...)end + +-- like ":helpgrep" but uses location list +function vim.cmd.lhelpgrep(...)end + +-- list the location lists +function vim.cmd.lhi(...)end + +-- list the location lists +function vim.cmd.lhistory(...)end + +-- print lines +function vim.cmd.list(...)end + +-- go to specific location +function vim.cmd.ll(...)end + +-- go to the specified location, default last one +function vim.cmd.lla(...)end + +-- go to the specified location, default last one +function vim.cmd.llast(...)end + +-- list all locations +function vim.cmd.lli(...)end + +-- list all locations +function vim.cmd.llist(...)end + +-- like ":map!" but includes Lang-Arg mode +function vim.cmd.lm(...)end + +-- execute external command 'makeprg' and parse +function vim.cmd.lmak(...)end + +-- execute external command 'makeprg' and parse +function vim.cmd.lmake(...)end + +-- like ":map!" but includes Lang-Arg mode +function vim.cmd.lmap(...)end + +-- like ":mapclear!" but includes Lang-Arg mode +function vim.cmd.lmapc(...)end + +-- like ":mapclear!" but includes Lang-Arg mode +function vim.cmd.lmapclear(...)end + +-- like ":noremap!" but includes Lang-Arg mode +function vim.cmd.ln(...)end + +-- go to next location +function vim.cmd.lne(...)end + +-- go to newer location list +function vim.cmd.lnew(...)end + +-- go to newer location list +function vim.cmd.lnewer(...)end + +-- go to next location +function vim.cmd.lnext(...)end + +-- go to first location in next file +function vim.cmd.lnf(...)end + +-- go to first location in next file +function vim.cmd.lnfile(...)end + +-- like ":noremap!" but includes Lang-Arg mode +function vim.cmd.lnoremap(...)end + +-- load view for current window from a file +function vim.cmd.lo(...)end + +-- load the following keymaps until EOF +function vim.cmd.loadk(...)end + +-- load the following keymaps until EOF +function vim.cmd.loadkeymap(...)end + +-- load view for current window from a file +function vim.cmd.loadview(...)end + +-- following command keeps marks where they are +function vim.cmd.loc(...)end + +-- following command keeps marks where they are +function vim.cmd.lockmarks(...)end + +-- lock variables +function vim.cmd.lockv(...)end + +-- lock variables +function vim.cmd.lockvar(...)end + +-- go to older location list +function vim.cmd.lol(...)end + +-- go to older location list +function vim.cmd.lolder(...)end + +-- open location window +function vim.cmd.lope(...)end + +-- open location window +function vim.cmd.lopen(...)end + +-- go to previous location +function vim.cmd.lp(...)end + +-- go to last location in previous file +function vim.cmd.lpf(...)end + +-- go to last location in previous file +function vim.cmd.lpfile(...)end + +-- go to previous location +function vim.cmd.lprevious(...)end + +-- go to the specified location, default first one +function vim.cmd.lr(...)end + +-- go to the specified location, default first one +function vim.cmd.lrewind(...)end + +-- list all buffers +function vim.cmd.ls(...)end + +-- jump to tag and add matching tags to the +function vim.cmd.lt(...)end + +-- jump to tag and add matching tags to the +function vim.cmd.ltag(...)end + +-- like ":unmap!" but includes Lang-Arg mode +function vim.cmd.lu(...)end + +-- execute |Lua| command +function vim.cmd.lua(...)end + +-- execute Lua command for each line +function vim.cmd.luad(...)end + +-- execute Lua command for each line +function vim.cmd.luado(...)end + +-- execute |Lua| script file +function vim.cmd.luaf(...)end + +-- execute |Lua| script file +function vim.cmd.luafile(...)end + +-- like ":unmap!" but includes Lang-Arg mode +function vim.cmd.lunmap(...)end + +-- search for pattern in files +function vim.cmd.lv(...)end + +-- search for pattern in files +function vim.cmd.lvimgrep(...)end + +-- like :vimgrep, but append to current list +function vim.cmd.lvimgrepa(...)end + +-- like :vimgrep, but append to current list +function vim.cmd.lvimgrepadd(...)end + +-- open or close location window +function vim.cmd.lw(...)end + +-- open or close location window +function vim.cmd.lwindow(...)end + +-- move lines +function vim.cmd.m(...)end + +-- set a mark +function vim.cmd.ma(...)end + +-- execute external command 'makeprg' and parse +function vim.cmd.mak(...)end + +-- execute external command 'makeprg' and parse +function vim.cmd.make(...)end + +-- show or enter a mapping +function vim.cmd.map(...)end + +-- clear all mappings for Normal and Visual mode +function vim.cmd.mapc(...)end + +-- clear all mappings for Normal and Visual mode +function vim.cmd.mapclear(...)end + +-- set a mark +function vim.cmd.mark(...)end + +-- list all marks +function vim.cmd.marks(...)end + +-- define a match to highlight +function vim.cmd.mat(...)end + +-- define a match to highlight +function vim.cmd.match(...)end + +-- enter a new menu item +function vim.cmd.me(...)end + +-- enter a new menu item +function vim.cmd.menu(...)end + +-- add a menu translation item +function vim.cmd.menut(...)end + +-- add a menu translation item +function vim.cmd.menutranslate(...)end + +-- view previously displayed messages +function vim.cmd.mes(...)end + +-- view previously displayed messages +function vim.cmd.messages(...)end + +-- write current mappings and settings to a file +function vim.cmd.mk(...)end + +-- write current mappings and settings to a file +function vim.cmd.mkexrc(...)end + +-- write session info to a file +function vim.cmd.mks(...)end + +-- write session info to a file +function vim.cmd.mksession(...)end + +-- produce .spl spell file +function vim.cmd.mksp(...)end + +-- produce .spl spell file +function vim.cmd.mkspell(...)end + +-- write current mappings and settings to a file +function vim.cmd.mkv(...)end + +-- write view of current window to a file +function vim.cmd.mkvie(...)end + +-- write view of current window to a file +function vim.cmd.mkview(...)end + +-- write current mappings and settings to a file +function vim.cmd.mkvimrc(...)end + +-- show or change the screen mode +function vim.cmd.mod(...)end + +-- show or change the screen mode +function vim.cmd.mode(...)end + +-- move lines +function vim.cmd.move(...)end + +-- go to next file in the argument list +function vim.cmd.n(...)end + +-- create a new empty window +function vim.cmd.new(...)end + +-- go to next file in the argument list +function vim.cmd.next(...)end + +-- like ":map" but for Normal mode +function vim.cmd.nm(...)end + +-- like ":map" but for Normal mode +function vim.cmd.nmap(...)end + +-- clear all mappings for Normal mode +function vim.cmd.nmapc(...)end + +-- clear all mappings for Normal mode +function vim.cmd.nmapclear(...)end + +-- add menu for Normal mode +function vim.cmd.nme(...)end + +-- add menu for Normal mode +function vim.cmd.nmenu(...)end + +-- like ":noremap" but for Normal mode +function vim.cmd.nn(...)end + +-- like ":noremap" but for Normal mode +function vim.cmd.nnoremap(...)end + +-- like ":noremenu" but for Normal mode +function vim.cmd.nnoreme(...)end + +-- like ":noremenu" but for Normal mode +function vim.cmd.nnoremenu(...)end + +-- enter a mapping that will not be remapped +function vim.cmd.no(...)end + +-- following commands don't trigger autocommands +function vim.cmd.noa(...)end + +-- following commands don't trigger autocommands +function vim.cmd.noautocmd(...)end + +-- suspend 'hlsearch' highlighting +function vim.cmd.noh(...)end + +-- suspend 'hlsearch' highlighting +function vim.cmd.nohlsearch(...)end + +-- enter an abbreviation that will not be +function vim.cmd.norea(...)end + +-- enter an abbreviation that will not be +function vim.cmd.noreabbrev(...)end + +-- enter a mapping that will not be remapped +function vim.cmd.noremap(...)end + +-- enter a menu that will not be remapped +function vim.cmd.noreme(...)end + +-- enter a menu that will not be remapped +function vim.cmd.noremenu(...)end + +-- execute Normal mode commands +function vim.cmd.norm(...)end + +-- execute Normal mode commands +function vim.cmd.normal(...)end + +-- following commands don't create a swap file +function vim.cmd.nos(...)end + +-- following commands don't create a swap file +function vim.cmd.noswapfile(...)end + +-- print lines with line number +function vim.cmd.nu(...)end + +-- print lines with line number +function vim.cmd.number(...)end + +-- like ":unmap" but for Normal mode +function vim.cmd.nun(...)end + +-- like ":unmap" but for Normal mode +function vim.cmd.nunmap(...)end + +-- remove menu for Normal mode +function vim.cmd.nunme(...)end + +-- remove menu for Normal mode +function vim.cmd.nunmenu(...)end + +-- list files that have marks in the |shada| file +function vim.cmd.ol(...)end + +-- list files that have marks in the |shada| file +function vim.cmd.oldfiles(...)end + +-- like ":map" but for Operator-pending mode +function vim.cmd.om(...)end + +-- like ":map" but for Operator-pending mode +function vim.cmd.omap(...)end + +-- remove all mappings for Operator-pending mode +function vim.cmd.omapc(...)end + +-- remove all mappings for Operator-pending mode +function vim.cmd.omapclear(...)end + +-- add menu for Operator-pending mode +function vim.cmd.ome(...)end + +-- add menu for Operator-pending mode +function vim.cmd.omenu(...)end + +-- close all windows except the current one +function vim.cmd.on(...)end + +-- close all windows except the current one +function vim.cmd.only(...)end + +-- like ":noremap" but for Operator-pending mode +function vim.cmd.ono(...)end + +-- like ":noremap" but for Operator-pending mode +function vim.cmd.onoremap(...)end + +-- like ":noremenu" but for Operator-pending mode +function vim.cmd.onoreme(...)end + +-- like ":noremenu" but for Operator-pending mode +function vim.cmd.onoremenu(...)end + +-- open the options-window +function vim.cmd.opt(...)end + +-- open the options-window +function vim.cmd.options(...)end + +-- like ":unmap" but for Operator-pending mode +function vim.cmd.ou(...)end + +-- like ":unmap" but for Operator-pending mode +function vim.cmd.ounmap(...)end + +-- remove menu for Operator-pending mode +function vim.cmd.ounme(...)end + +-- remove menu for Operator-pending mode +function vim.cmd.ounmenu(...)end + +-- set new local syntax highlight for this window +function vim.cmd.ow(...)end + +-- set new local syntax highlight for this window +function vim.cmd.ownsyntax(...)end + +-- print lines +function vim.cmd.p(...)end + +-- add a plugin from 'packpath' +function vim.cmd.pa(...)end + +-- add a plugin from 'packpath' +function vim.cmd.packadd(...)end + +-- load all packages under 'packpath' +function vim.cmd.packl(...)end + +-- load all packages under 'packpath' +function vim.cmd.packloadall(...)end + +-- close preview window +function vim.cmd.pc(...)end + +-- close preview window +function vim.cmd.pclose(...)end + +-- execute perl command +function vim.cmd.pe(...)end + +-- edit file in the preview window +function vim.cmd.ped(...)end + +-- edit file in the preview window +function vim.cmd.pedit(...)end + +-- execute perl command +function vim.cmd.perl(...)end + +-- execute perl command for each line +function vim.cmd.perld(...)end + +-- execute perl command for each line +function vim.cmd.perldo(...)end + +-- execute perl script file +function vim.cmd.perlf(...)end + +-- execute perl script file +function vim.cmd.perlfile(...)end + +-- jump to older entry in tag stack +function vim.cmd.po(...)end + +-- jump to older entry in tag stack +function vim.cmd.pop(...)end + +-- popup a menu by name +function vim.cmd.popu(...)end + +-- popup a menu by name +function vim.cmd.popup(...)end + +-- ":pop" in preview window +function vim.cmd.pp(...)end + +-- ":pop" in preview window +function vim.cmd.ppop(...)end + +-- write all text to swap file +function vim.cmd.pre(...)end + +-- write all text to swap file +function vim.cmd.preserve(...)end + +-- go to previous file in argument list +function vim.cmd.prev(...)end + +-- go to previous file in argument list +function vim.cmd.previous(...)end + +-- print lines +function vim.cmd.print(...)end + +-- profiling functions and scripts +function vim.cmd.prof(...)end + +-- stop profiling a function or script +function vim.cmd.profd(...)end + +-- stop profiling a function or script +function vim.cmd.profdel(...)end + +-- profiling functions and scripts +function vim.cmd.profile(...)end + +-- like ":ijump" but shows match in preview window +function vim.cmd.ps(...)end + +-- like ":ijump" but shows match in preview window +function vim.cmd.psearch(...)end + +-- show tag in preview window +function vim.cmd.pt(...)end + +-- |:tNext| in preview window +function vim.cmd.ptN(...)end + +-- |:tNext| in preview window +function vim.cmd.ptNext(...)end + +-- show tag in preview window +function vim.cmd.ptag(...)end + +-- |:trewind| in preview window +function vim.cmd.ptf(...)end + +-- |:trewind| in preview window +function vim.cmd.ptfirst(...)end + +-- |:tjump| and show tag in preview window +function vim.cmd.ptj(...)end + +-- |:tjump| and show tag in preview window +function vim.cmd.ptjump(...)end + +-- |:tlast| in preview window +function vim.cmd.ptl(...)end + +-- |:tlast| in preview window +function vim.cmd.ptlast(...)end + +-- |:tnext| in preview window +function vim.cmd.ptn(...)end + +-- |:tnext| in preview window +function vim.cmd.ptnext(...)end + +-- |:tprevious| in preview window +function vim.cmd.ptp(...)end + +-- |:tprevious| in preview window +function vim.cmd.ptprevious(...)end + +-- |:trewind| in preview window +function vim.cmd.ptr(...)end + +-- |:trewind| in preview window +function vim.cmd.ptrewind(...)end + +-- |:tselect| and show tag in preview window +function vim.cmd.pts(...)end + +-- |:tselect| and show tag in preview window +function vim.cmd.ptselect(...)end + +-- insert contents of register in the text +function vim.cmd.pu(...)end + +-- insert contents of register in the text +function vim.cmd.put(...)end + +-- print current directory +function vim.cmd.pw(...)end + +-- print current directory +function vim.cmd.pwd(...)end + +-- execute Python command +function vim.cmd.py(...)end + +-- execute Python 3 command +function vim.cmd.py3(...)end + +-- execute Python 3 command for each line +function vim.cmd.py3d(...)end + +-- execute Python 3 command for each line +function vim.cmd.py3do(...)end + +-- execute Python 3 script file +function vim.cmd.py3f(...)end + +-- execute Python 3 script file +function vim.cmd.py3file(...)end + +-- execute Python command for each line +function vim.cmd.pyd(...)end + +-- execute Python command for each line +function vim.cmd.pydo(...)end + +-- execute Python script file +function vim.cmd.pyf(...)end + +-- execute Python script file +function vim.cmd.pyfile(...)end + +-- execute Python command +function vim.cmd.python(...)end + +-- same as :py3 +function vim.cmd.python3(...)end + +-- same as :pyx +function vim.cmd.pythonx(...)end + +-- execute |python_x| command +function vim.cmd.pyx(...)end + +-- execute |python_x| command for each line +function vim.cmd.pyxd(...)end + +-- execute |python_x| command for each line +function vim.cmd.pyxdo(...)end + +-- execute |python_x| script file +function vim.cmd.pyxf(...)end + +-- execute |python_x| script file +function vim.cmd.pyxfile(...)end + +-- quit current window (when one window quit Vim) +function vim.cmd.q(...)end + +-- quit Vim +function vim.cmd.qa(...)end + +-- quit Vim +function vim.cmd.qall(...)end + +-- quit current window (when one window quit Vim) +function vim.cmd.quit(...)end + +-- quit Vim +function vim.cmd.quita(...)end + +-- quit Vim +function vim.cmd.quitall(...)end + +-- read file into the text +function vim.cmd.r(...)end + +-- read file into the text +function vim.cmd.read(...)end + +-- recover a file from a swap file +function vim.cmd.rec(...)end + +-- recover a file from a swap file +function vim.cmd.recover(...)end + +-- redo one undone change +function vim.cmd.red(...)end + +-- redirect messages to a file or register +function vim.cmd.redi(...)end + +-- redirect messages to a file or register +function vim.cmd.redir(...)end + +-- redo one undone change +function vim.cmd.redo(...)end + +-- force a redraw of the display +function vim.cmd.redr(...)end + +-- force a redraw of the display +function vim.cmd.redraw(...)end + +-- force a redraw of the status line(s) and +function vim.cmd.redraws(...)end + +-- force a redraw of the status line(s) and +function vim.cmd.redrawstatus(...)end + +-- force a redraw of the tabline +function vim.cmd.redrawt(...)end + +-- force a redraw of the tabline +function vim.cmd.redrawtabline(...)end + +-- display the contents of registers +function vim.cmd.reg(...)end + +-- display the contents of registers +function vim.cmd.registers(...)end + +-- change current window height +function vim.cmd.res(...)end + +-- change current window height +function vim.cmd.resize(...)end + +-- change tab size +function vim.cmd.ret(...)end + +-- change tab size +function vim.cmd.retab(...)end + +-- return from a user function +function vim.cmd.retu(...)end + +-- return from a user function +vim.cmd["return"] = function(...)end + +-- go to the first file in the argument list +function vim.cmd.rew(...)end + +-- go to the first file in the argument list +function vim.cmd.rewind(...)end + +-- right align text +function vim.cmd.ri(...)end + +-- right align text +function vim.cmd.right(...)end + +-- make split window appear right or below +function vim.cmd.rightb(...)end + +-- make split window appear right or below +function vim.cmd.rightbelow(...)end + +-- read from |shada| file +function vim.cmd.rsh(...)end + +-- read from |shada| file +function vim.cmd.rshada(...)end + +-- source vim scripts in 'runtimepath' +function vim.cmd.ru(...)end + +-- execute Ruby command +function vim.cmd.rub(...)end + +-- execute Ruby command +function vim.cmd.ruby(...)end + +-- execute Ruby command for each line +function vim.cmd.rubyd(...)end + +-- execute Ruby command for each line +function vim.cmd.rubydo(...)end + +-- execute Ruby script file +function vim.cmd.rubyf(...)end + +-- execute Ruby script file +function vim.cmd.rubyfile(...)end + +-- read undo information from a file +function vim.cmd.rund(...)end + +-- read undo information from a file +function vim.cmd.rundo(...)end + +-- source vim scripts in 'runtimepath' +function vim.cmd.runtime(...)end + +-- find and replace text +function vim.cmd.s(...)end + +-- split window and go to previous file in +function vim.cmd.sN(...)end + +-- split window and go to previous file in +function vim.cmd.sNext(...)end + +-- split window and go to specific file in +function vim.cmd.sa(...)end + +-- open a window for each file in argument list +function vim.cmd.sal(...)end + +-- open a window for each file in argument list +function vim.cmd.sall(...)end + +-- execute a command in the sandbox +function vim.cmd.san(...)end + +-- execute a command in the sandbox +function vim.cmd.sandbox(...)end + +-- split window and go to specific file in +function vim.cmd.sargument(...)end + +-- save file under another name. +function vim.cmd.sav(...)end + +-- save file under another name. +function vim.cmd.saveas(...)end + +-- split window and go to specific file in the +function vim.cmd.sb(...)end + +-- split window and go to previous file in the +function vim.cmd.sbN(...)end + +-- split window and go to previous file in the +function vim.cmd.sbNext(...)end + +-- open a window for each file in the buffer list +function vim.cmd.sba(...)end + +-- open a window for each file in the buffer list +function vim.cmd.sball(...)end + +-- split window and go to first file in the +function vim.cmd.sbf(...)end + +-- split window and go to first file in the +function vim.cmd.sbfirst(...)end + +-- split window and go to last file in buffer +function vim.cmd.sbl(...)end + +-- split window and go to last file in buffer +function vim.cmd.sblast(...)end + +-- split window and go to modified file in the +function vim.cmd.sbm(...)end + +-- split window and go to modified file in the +function vim.cmd.sbmodified(...)end + +-- split window and go to next file in the buffer +function vim.cmd.sbn(...)end + +-- split window and go to next file in the buffer +function vim.cmd.sbnext(...)end + +-- split window and go to previous file in the +function vim.cmd.sbp(...)end + +-- split window and go to previous file in the +function vim.cmd.sbprevious(...)end + +-- split window and go to first file in the +function vim.cmd.sbr(...)end + +-- split window and go to first file in the +function vim.cmd.sbrewind(...)end + +-- split window and go to specific file in the +function vim.cmd.sbuffer(...)end + +-- list names of all sourced Vim scripts +function vim.cmd.scr(...)end + +-- encoding used in sourced Vim script +function vim.cmd.scripte(...)end + +-- encoding used in sourced Vim script +function vim.cmd.scriptencoding(...)end + +-- list names of all sourced Vim scripts +function vim.cmd.scriptnames(...)end + +-- show or set options +function vim.cmd.se(...)end + +-- show or set options +function vim.cmd.set(...)end + +-- set 'filetype', unless it was set already +function vim.cmd.setf(...)end + +-- set 'filetype', unless it was set already +function vim.cmd.setfiletype(...)end + +-- show global values of options +function vim.cmd.setg(...)end + +-- show global values of options +function vim.cmd.setglobal(...)end + +-- show or set options locally +function vim.cmd.setl(...)end + +-- show or set options locally +function vim.cmd.setlocal(...)end + +-- split current window and edit file in 'path' +function vim.cmd.sf(...)end + +-- split current window and edit file in 'path' +function vim.cmd.sfind(...)end + +-- split window and go to first file in the +function vim.cmd.sfir(...)end + +-- split window and go to first file in the +function vim.cmd.sfirst(...)end + +-- manipulate signs +function vim.cmd.sig(...)end + +-- manipulate signs +function vim.cmd.sign(...)end + +-- run a command silently +function vim.cmd.sil(...)end + +-- run a command silently +function vim.cmd.silent(...)end + +-- do nothing for a few seconds +function vim.cmd.sl(...)end + +-- split window and go to last file in the +function vim.cmd.sla(...)end + +-- split window and go to last file in the +function vim.cmd.slast(...)end + +-- do nothing for a few seconds +function vim.cmd.sleep(...)end + +-- :substitute with 'magic' +function vim.cmd.sm(...)end + +-- :substitute with 'magic' +function vim.cmd.smagic(...)end + +-- like ":map" but for Select mode +function vim.cmd.smap(...)end + +-- remove all mappings for Select mode +function vim.cmd.smapc(...)end + +-- remove all mappings for Select mode +function vim.cmd.smapclear(...)end + +-- add menu for Select mode +function vim.cmd.sme(...)end + +-- add menu for Select mode +function vim.cmd.smenu(...)end + +-- split window and go to next file in the +function vim.cmd.sn(...)end + +-- split window and go to next file in the +function vim.cmd.snext(...)end + +-- :substitute with 'nomagic' +function vim.cmd.sno(...)end + +-- :substitute with 'nomagic' +function vim.cmd.snomagic(...)end + +-- like ":noremap" but for Select mode +function vim.cmd.snor(...)end + +-- like ":noremap" but for Select mode +function vim.cmd.snoremap(...)end + +-- like ":noremenu" but for Select mode +function vim.cmd.snoreme(...)end + +-- like ":noremenu" but for Select mode +function vim.cmd.snoremenu(...)end + +-- read Vim or Ex commands from a file +function vim.cmd.so(...)end + +-- sort lines +function vim.cmd.sor(...)end + +-- sort lines +function vim.cmd.sort(...)end + +-- read Vim or Ex commands from a file +function vim.cmd.source(...)end + +-- split current window +function vim.cmd.sp(...)end + +-- add good word for spelling +function vim.cmd.spe(...)end + +-- split window and fill with all correct words +function vim.cmd.spelld(...)end + +-- split window and fill with all correct words +function vim.cmd.spelldump(...)end + +-- add good word for spelling +function vim.cmd.spellgood(...)end + +-- show info about loaded spell files +function vim.cmd.spelli(...)end + +-- show info about loaded spell files +function vim.cmd.spellinfo(...)end + +-- replace all bad words like last |z=| +function vim.cmd.spellr(...)end + +-- add rare word for spelling +function vim.cmd.spellra(...)end + +-- add rare word for spelling +function vim.cmd.spellrare(...)end + +-- replace all bad words like last |z=| +function vim.cmd.spellrepall(...)end + +-- remove good or bad word +function vim.cmd.spellu(...)end + +-- remove good or bad word +function vim.cmd.spellundo(...)end + +-- add spelling mistake +function vim.cmd.spellw(...)end + +-- add spelling mistake +function vim.cmd.spellwrong(...)end + +-- split current window +function vim.cmd.split(...)end + +-- split window and go to previous file in the +function vim.cmd.spr(...)end + +-- split window and go to previous file in the +function vim.cmd.sprevious(...)end + +-- split window and go to first file in the +function vim.cmd.sre(...)end + +-- split window and go to first file in the +function vim.cmd.srewind(...)end + +-- suspend the editor or escape to a shell +function vim.cmd.st(...)end + +-- split window and jump to a tag +function vim.cmd.sta(...)end + +-- split window and jump to a tag +function vim.cmd.stag(...)end + +-- start Insert mode +function vim.cmd.star(...)end + +-- start Virtual Replace mode +function vim.cmd.startg(...)end + +-- start Virtual Replace mode +function vim.cmd.startgreplace(...)end + +-- start Insert mode +function vim.cmd.startinsert(...)end + +-- start Replace mode +function vim.cmd.startr(...)end + +-- start Replace mode +function vim.cmd.startreplace(...)end + +-- do ":tjump" and split window +function vim.cmd.stj(...)end + +-- do ":tjump" and split window +function vim.cmd.stjump(...)end + +-- suspend the editor or escape to a shell +function vim.cmd.stop(...)end + +-- stop Insert mode +function vim.cmd.stopi(...)end + +-- stop Insert mode +function vim.cmd.stopinsert(...)end + +-- do ":tselect" and split window +function vim.cmd.sts(...)end + +-- do ":tselect" and split window +function vim.cmd.stselect(...)end + +-- find and replace text +function vim.cmd.substitute(...)end + +-- same as ":unhide" +function vim.cmd.sun(...)end + +-- same as ":unhide" +function vim.cmd.sunhide(...)end + +-- like ":unmap" but for Select mode +function vim.cmd.sunm(...)end + +-- like ":unmap" but for Select mode +function vim.cmd.sunmap(...)end + +-- remove menu for Select mode +function vim.cmd.sunme(...)end + +-- remove menu for Select mode +function vim.cmd.sunmenu(...)end + +-- same as ":stop" +function vim.cmd.sus(...)end + +-- same as ":stop" +function vim.cmd.suspend(...)end + +-- split window and edit file read-only +function vim.cmd.sv(...)end + +-- split window and edit file read-only +function vim.cmd.sview(...)end + +-- show the name of the current swap file +function vim.cmd.sw(...)end + +-- show the name of the current swap file +function vim.cmd.swapname(...)end + +-- syntax highlighting +function vim.cmd.sy(...)end + +-- sync scroll binding +function vim.cmd.sync(...)end + +-- sync scroll binding +function vim.cmd.syncbind(...)end + +-- syntax highlighting +function vim.cmd.syntax(...)end + +-- measure syntax highlighting speed +function vim.cmd.synti(...)end + +-- measure syntax highlighting speed +function vim.cmd.syntime(...)end + +-- same as ":copy" +function vim.cmd.t(...)end + +-- jump to previous matching tag +function vim.cmd.tN(...)end + +-- jump to previous matching tag +function vim.cmd.tNext(...)end + +-- jump to tag +function vim.cmd.ta(...)end + +-- create new tab when opening new window +function vim.cmd.tab(...)end + +-- go to previous tab page +function vim.cmd.tabN(...)end + +-- go to previous tab page +function vim.cmd.tabNext(...)end + +-- close current tab page +function vim.cmd.tabc(...)end + +-- close current tab page +function vim.cmd.tabclose(...)end + +-- execute command in each tab page +function vim.cmd.tabdo(...)end + +-- edit a file in a new tab page +function vim.cmd.tabe(...)end + +-- edit a file in a new tab page +function vim.cmd.tabedit(...)end + +-- find file in 'path', edit it in a new tab page +function vim.cmd.tabf(...)end + +-- find file in 'path', edit it in a new tab page +function vim.cmd.tabfind(...)end + +-- go to first tab page +function vim.cmd.tabfir(...)end + +-- go to first tab page +function vim.cmd.tabfirst(...)end + +-- go to last tab page +function vim.cmd.tabl(...)end + +-- go to last tab page +function vim.cmd.tablast(...)end + +-- move tab page to other position +function vim.cmd.tabm(...)end + +-- move tab page to other position +function vim.cmd.tabmove(...)end + +-- go to next tab page +function vim.cmd.tabn(...)end + +-- edit a file in a new tab page +function vim.cmd.tabnew(...)end + +-- go to next tab page +function vim.cmd.tabnext(...)end + +-- close all tab pages except the current one +function vim.cmd.tabo(...)end + +-- close all tab pages except the current one +function vim.cmd.tabonly(...)end + +-- go to previous tab page +function vim.cmd.tabp(...)end + +-- go to previous tab page +function vim.cmd.tabprevious(...)end + +-- go to first tab page +function vim.cmd.tabr(...)end + +-- go to first tab page +function vim.cmd.tabrewind(...)end + +-- list the tab pages and what they contain +function vim.cmd.tabs(...)end + +-- jump to tag +function vim.cmd.tag(...)end + +-- show the contents of the tag stack +function vim.cmd.tags(...)end + +-- change directory for tab page +function vim.cmd.tc(...)end + +-- change directory for tab page +function vim.cmd.tcd(...)end + +-- change directory for tab page +function vim.cmd.tch(...)end + +-- change directory for tab page +function vim.cmd.tchdir(...)end + +-- open a terminal buffer +function vim.cmd.te(...)end + +-- open a terminal buffer +function vim.cmd.terminal(...)end + +-- jump to first matching tag +function vim.cmd.tf(...)end + +-- jump to first matching tag +function vim.cmd.tfirst(...)end + +-- throw an exception +function vim.cmd.th(...)end + +-- throw an exception +function vim.cmd.throw(...)end + +-- like ":tselect", but jump directly when there +function vim.cmd.tj(...)end + +-- like ":tselect", but jump directly when there +function vim.cmd.tjump(...)end + +-- jump to last matching tag +function vim.cmd.tl(...)end + +-- jump to last matching tag +function vim.cmd.tlast(...)end + +-- add menu for |Terminal-mode| +function vim.cmd.tlm(...)end + +-- add menu for |Terminal-mode| +function vim.cmd.tlmenu(...)end + +-- like ":noremenu" but for |Terminal-mode| +function vim.cmd.tln(...)end + +-- like ":noremenu" but for |Terminal-mode| +function vim.cmd.tlnoremenu(...)end + +-- remove menu for |Terminal-mode| +function vim.cmd.tlu(...)end + +-- remove menu for |Terminal-mode| +function vim.cmd.tlunmenu(...)end + +-- define menu tooltip +function vim.cmd.tm(...)end + +-- like ":map" but for |Terminal-mode| +function vim.cmd.tma(...)end + +-- like ":map" but for |Terminal-mode| +function vim.cmd.tmap(...)end + +-- remove all mappings for |Terminal-mode| +function vim.cmd.tmapc(...)end + +-- remove all mappings for |Terminal-mode| +function vim.cmd.tmapclear(...)end + +-- define menu tooltip +function vim.cmd.tmenu(...)end + +-- jump to next matching tag +function vim.cmd.tn(...)end + +-- jump to next matching tag +function vim.cmd.tnext(...)end + +-- like ":noremap" but for |Terminal-mode| +function vim.cmd.tno(...)end + +-- like ":noremap" but for |Terminal-mode| +function vim.cmd.tnoremap(...)end + +-- make split window appear at top or far left +function vim.cmd.to(...)end + +-- make split window appear at top or far left +function vim.cmd.topleft(...)end + +-- jump to previous matching tag +function vim.cmd.tp(...)end + +-- jump to previous matching tag +function vim.cmd.tprevious(...)end + +-- jump to first matching tag +function vim.cmd.tr(...)end + +-- jump to first matching tag +function vim.cmd.trewind(...)end + +-- add or remove file from trust database +function vim.cmd.trust(...)end + +-- execute commands, abort on error or exception +function vim.cmd.try(...)end + +-- list matching tags and select one +function vim.cmd.ts(...)end + +-- list matching tags and select one +function vim.cmd.tselect(...)end + +-- remove menu tooltip +function vim.cmd.tu(...)end + +-- like ":unmap" but for |Terminal-mode| +function vim.cmd.tunma(...)end + +-- like ":unmap" but for |Terminal-mode| +function vim.cmd.tunmap(...)end + +-- remove menu tooltip +function vim.cmd.tunmenu(...)end + +-- undo last change(s) +function vim.cmd.u(...)end + +-- remove abbreviation +function vim.cmd.una(...)end + +-- remove abbreviation +function vim.cmd.unabbreviate(...)end + +-- undo last change(s) +function vim.cmd.undo(...)end + +-- join next change with previous undo block +function vim.cmd.undoj(...)end + +-- join next change with previous undo block +function vim.cmd.undojoin(...)end + +-- list leafs of the undo tree +function vim.cmd.undol(...)end + +-- list leafs of the undo tree +function vim.cmd.undolist(...)end + +-- open a window for each loaded file in the +function vim.cmd.unh(...)end + +-- open a window for each loaded file in the +function vim.cmd.unhide(...)end + +-- delete variable +function vim.cmd.unl(...)end + +-- delete variable +function vim.cmd.unlet(...)end + +-- unlock variables +function vim.cmd.unlo(...)end + +-- unlock variables +function vim.cmd.unlockvar(...)end + +-- remove mapping +function vim.cmd.unm(...)end + +-- remove mapping +function vim.cmd.unmap(...)end + +-- remove menu +function vim.cmd.unme(...)end + +-- remove menu +function vim.cmd.unmenu(...)end + +-- run a command not silently +function vim.cmd.uns(...)end + +-- run a command not silently +function vim.cmd.unsilent(...)end + +-- write buffer if modified +function vim.cmd.up(...)end + +-- write buffer if modified +function vim.cmd.update(...)end + +-- execute commands for not matching lines +function vim.cmd.v(...)end + +-- print version number and other info +function vim.cmd.ve(...)end + +-- execute command with 'verbose' set +function vim.cmd.verb(...)end + +-- execute command with 'verbose' set +function vim.cmd.verbose(...)end + +-- print version number and other info +function vim.cmd.version(...)end + +-- make following command split vertically +function vim.cmd.vert(...)end + +-- make following command split vertically +function vim.cmd.vertical(...)end + +-- execute commands for not matching lines +function vim.cmd.vglobal(...)end + +-- same as ":edit", but turns off "Ex" mode +function vim.cmd.vi(...)end + +-- edit a file read-only +function vim.cmd.vie(...)end + +-- edit a file read-only +function vim.cmd.view(...)end + +-- search for pattern in files +function vim.cmd.vim(...)end + +-- search for pattern in files +function vim.cmd.vimgrep(...)end + +-- like :vimgrep, but append to current list +function vim.cmd.vimgrepa(...)end + +-- like :vimgrep, but append to current list +function vim.cmd.vimgrepadd(...)end + +-- same as ":edit", but turns off "Ex" mode +function vim.cmd.visual(...)end + +-- overview of Normal mode commands +function vim.cmd.viu(...)end + +-- overview of Normal mode commands +function vim.cmd.viusage(...)end + +-- like ":map" but for Visual+Select mode +function vim.cmd.vm(...)end + +-- like ":map" but for Visual+Select mode +function vim.cmd.vmap(...)end + +-- remove all mappings for Visual+Select mode +function vim.cmd.vmapc(...)end + +-- remove all mappings for Visual+Select mode +function vim.cmd.vmapclear(...)end + +-- add menu for Visual+Select mode +function vim.cmd.vme(...)end + +-- add menu for Visual+Select mode +function vim.cmd.vmenu(...)end + +-- like ":noremap" but for Visual+Select mode +function vim.cmd.vn(...)end + +-- create a new empty window, vertically split +function vim.cmd.vne(...)end + +-- create a new empty window, vertically split +function vim.cmd.vnew(...)end + +-- like ":noremap" but for Visual+Select mode +function vim.cmd.vnoremap(...)end + +-- like ":noremenu" but for Visual+Select mode +function vim.cmd.vnoreme(...)end + +-- like ":noremenu" but for Visual+Select mode +function vim.cmd.vnoremenu(...)end + +-- split current window vertically +function vim.cmd.vs(...)end + +-- split current window vertically +function vim.cmd.vsplit(...)end + +-- like ":unmap" but for Visual+Select mode +function vim.cmd.vu(...)end + +-- like ":unmap" but for Visual+Select mode +function vim.cmd.vunmap(...)end + +-- remove menu for Visual+Select mode +function vim.cmd.vunme(...)end + +-- remove menu for Visual+Select mode +function vim.cmd.vunmenu(...)end + +-- write to a file +function vim.cmd.w(...)end + +-- write to a file and go to previous file in +function vim.cmd.wN(...)end + +-- write to a file and go to previous file in +function vim.cmd.wNext(...)end + +-- write all (changed) buffers +function vim.cmd.wa(...)end + +-- write all (changed) buffers +function vim.cmd.wall(...)end + +-- execute loop for as long as condition met +function vim.cmd.wh(...)end + +-- execute loop for as long as condition met +vim.cmd["while"] = function(...)end + +-- get or set window size (obsolete) +function vim.cmd.wi(...)end + +-- execute a Window (CTRL-W) command +function vim.cmd.winc(...)end + +-- execute a Window (CTRL-W) command +function vim.cmd.wincmd(...)end + +-- execute command in each window +function vim.cmd.windo(...)end + +-- get or set window position +function vim.cmd.winp(...)end + +-- get or set window position +function vim.cmd.winpos(...)end + +-- get or set window size (obsolete) +function vim.cmd.winsize(...)end + +-- write to a file and go to next file in +function vim.cmd.wn(...)end + +-- write to a file and go to next file in +function vim.cmd.wnext(...)end + +-- write to a file and go to previous file in +function vim.cmd.wp(...)end + +-- write to a file and go to previous file in +function vim.cmd.wprevious(...)end + +-- write to a file and quit window or Vim +function vim.cmd.wq(...)end + +-- write all changed buffers and quit Vim +function vim.cmd.wqa(...)end + +-- write all changed buffers and quit Vim +function vim.cmd.wqall(...)end + +-- write to a file +function vim.cmd.write(...)end + +-- write to ShaDa file +function vim.cmd.wsh(...)end + +-- write to ShaDa file +function vim.cmd.wshada(...)end + +-- write undo information to a file +function vim.cmd.wu(...)end + +-- write undo information to a file +function vim.cmd.wundo(...)end + +-- write if buffer changed and close window +function vim.cmd.x(...)end + +-- same as ":wqall" +function vim.cmd.xa(...)end + +-- same as ":wqall" +function vim.cmd.xall(...)end + +-- write if buffer changed and close window +function vim.cmd.xit(...)end + +-- like ":map" but for Visual mode +function vim.cmd.xm(...)end + +-- like ":map" but for Visual mode +function vim.cmd.xmap(...)end + +-- remove all mappings for Visual mode +function vim.cmd.xmapc(...)end + +-- remove all mappings for Visual mode +function vim.cmd.xmapclear(...)end + +-- add menu for Visual mode +function vim.cmd.xme(...)end + +-- add menu for Visual mode +function vim.cmd.xmenu(...)end + +-- like ":noremap" but for Visual mode +function vim.cmd.xn(...)end + +-- like ":noremap" but for Visual mode +function vim.cmd.xnoremap(...)end + +-- like ":noremenu" but for Visual mode +function vim.cmd.xnoreme(...)end + +-- like ":noremenu" but for Visual mode +function vim.cmd.xnoremenu(...)end + +-- like ":unmap" but for Visual mode +function vim.cmd.xu(...)end + +-- like ":unmap" but for Visual mode +function vim.cmd.xunmap(...)end + +-- remove menu for Visual mode +function vim.cmd.xunme(...)end + +-- remove menu for Visual mode +function vim.cmd.xunmenu(...)end + +-- yank lines into a register +function vim.cmd.y(...)end + +-- yank lines into a register +function vim.cmd.yank(...)end + +-- print some lines +function vim.cmd.z(...)end + diff --git a/bundle/neodev.nvim/types/nightly/lpeg.lua b/bundle/neodev.nvim/types/nightly/lpeg.lua new file mode 100644 index 000000000..6c4b0a029 --- /dev/null +++ b/bundle/neodev.nvim/types/nightly/lpeg.lua @@ -0,0 +1,637 @@ +---@meta + +--- +---@meta +---The definitions are developed in this repository: https://github.com/LuaCATS/lpeg + +--- +---This type definition is based on the [HTML documentation](http://www.inf.puc-rio.br/~roberto/lpeg/) of the LPeg library. A different HTML documentation can be found at http://stevedonovan.github.io/lua-stdlibs/modules/lpeg.html. +--- +---*LPeg* is a new pattern-matching library for Lua, +---based on +---[Parsing Expression Grammars](https://bford.info/packrat/) (PEGs). +---This text is a reference manual for the library. +---For a more formal treatment of LPeg, +---as well as some discussion about its implementation, +---see +---[A Text Pattern-Matching Tool based on Parsing Expression Grammars](http://www.inf.puc-rio.br/~roberto/docs/peg.pdf). +---(You may also be interested in my +---[talk about LPeg](https://vimeo.com/1485123) +---given at the III Lua Workshop.) +--- +---Following the Snobol tradition, +---LPeg defines patterns as first-class objects. +---That is, patterns are regular Lua values +---(represented by userdata). +---The library offers several functions to create +---and compose patterns. +---With the use of metamethods, +---several of these functions are provided as infix or prefix +---operators. +---On the one hand, +---the result is usually much more verbose than the typical +---encoding of patterns using the so called +---*regular expressions* +---(which typically are not regular expressions in the formal sense). +---On the other hand, +---first-class patterns allow much better documentation +---(as it is easy to comment the code, +---to break complex definitions in smaller parts, etc.) +---and are extensible, +---as we can define new functions to create and compose patterns. +--- +---😱 [Types](https://github.com/LuaCATS/lpeg/blob/main/library/lpeg.lua) incomplete or incorrect? 🙏 [Please contribute!](https://github.com/LuaCATS/lpeg/pulls) +local lpeg = {} + +--- +---😱 [Types](https://github.com/LuaCATS/lpeg/blob/main/library/lpeg.lua) incomplete or incorrect? 🙏 [Please contribute!](https://github.com/LuaCATS/lpeg/pulls) +---@class Pattern +---@operator add(Pattern): Pattern +---@operator mul(Pattern): Pattern +---@operator mul(Capture): Pattern +---@operator div(string): Capture +---@operator div(number): Capture +---@operator div(table): Capture +---@operator div(function): Capture +---@operator pow(number): Pattern +local Pattern = {} + +--- +---😱 [Types](https://github.com/LuaCATS/lpeg/blob/main/library/lpeg.lua) incomplete or incorrect? 🙏 [Please contribute!](https://github.com/LuaCATS/lpeg/pulls) +---@alias Capture Pattern +---@operator add(Capture): Pattern +---@operator mul(Capture): Pattern +---@operator mul(Pattern): Pattern +---@operator div(string): Capture +---@operator div(number): Capture +---@operator div(table): Capture +---@operator div(function): Capture +---@operator pow(number): Pattern + +--- +---Match the given `pattern` against the `subject` string. +--- +---If the match succeeds, +---returns the index in the subject of the first character after the match, +---or the captured values +---(if the pattern captured any value). +--- +---An optional numeric argument `init` makes the match +---start at that position in the subject string. +---As usual in Lua libraries, +---a negative value counts from the end. +--- +---Unlike typical pattern-matching functions, +---`match` works only in anchored mode; +---that is, it tries to match the pattern with a prefix of +---the given subject string (at position `init`), +---not with an arbitrary substring of the subject. +---So, if we want to find a pattern anywhere in a string, +---we must either write a loop in Lua or write a pattern that +---matches anywhere. +---This second approach is easy and quite efficient; +--- +---__Example:__ +--- +---```lua +---local pattern = lpeg.R("az") ^ 1 * -1 +---assert(pattern:match("hello") == 6) +---assert(lpeg.match(pattern, "hello") == 6) +---assert(pattern:match("1 hello") == nil) +---``` +--- +---@param pattern Pattern +---@param subject string +---@param init? integer +--- +---@return integer|Capture +--- +---😱 [Types](https://github.com/LuaCATS/lpeg/blob/main/library/lpeg.lua) incomplete or incorrect? 🙏 [Please contribute!](https://github.com/LuaCATS/lpeg/pulls) +function lpeg.match(pattern, subject, init) end + +--- +---Match the given `pattern` against the `subject` string. +--- +---If the match succeeds, +---returns the index in the subject of the first character after the match, +---or the captured values +---(if the pattern captured any value). +--- +---An optional numeric argument `init` makes the match +---start at that position in the subject string. +---As usual in Lua libraries, +---a negative value counts from the end. +--- +---Unlike typical pattern-matching functions, +---`match` works only in anchored mode; +---that is, it tries to match the pattern with a prefix of +---the given subject string (at position `init`), +---not with an arbitrary substring of the subject. +---So, if we want to find a pattern anywhere in a string, +---we must either write a loop in Lua or write a pattern that +---matches anywhere. +---This second approach is easy and quite efficient; +--- +---__Example:__ +--- +---```lua +---local pattern = lpeg.R("az") ^ 1 * -1 +---assert(pattern:match("hello") == 6) +---assert(lpeg.match(pattern, "hello") == 6) +---assert(pattern:match("1 hello") == nil) +---``` +--- +---@param subject string +---@param init? integer +--- +---@return integer|Capture +--- +---😱 [Types](https://github.com/LuaCATS/lpeg/blob/main/library/lpeg.lua) incomplete or incorrect? 🙏 [Please contribute!](https://github.com/LuaCATS/lpeg/pulls) +function Pattern:match(subject, init) end + +--- +---Return the string `"pattern"` if the given value is a pattern, otherwise `nil`. +--- +---@return 'pattern'|nil +--- +---😱 [Types](https://github.com/LuaCATS/lpeg/blob/main/library/lpeg.lua) incomplete or incorrect? 🙏 [Please contribute!](https://github.com/LuaCATS/lpeg/pulls) +function lpeg.type(value) end + +--- +---Return a string with the running version of LPeg. +--- +---@return string +--- +---😱 [Types](https://github.com/LuaCATS/lpeg/blob/main/library/lpeg.lua) incomplete or incorrect? 🙏 [Please contribute!](https://github.com/LuaCATS/lpeg/pulls) +function lpeg.version() end + +--- +---Set a limit for the size of the backtrack stack used by LPeg to +---track calls and choices. +--- +---The default limit is `400`. +---Most well-written patterns need little backtrack levels and +---therefore you seldom need to change this limit; +---before changing it you should try to rewrite your +---pattern to avoid the need for extra space. +---Nevertheless, a few useful patterns may overflow. +---Also, with recursive grammars, +---subjects with deep recursion may also need larger limits. +--- +---@param max integer +--- +---😱 [Types](https://github.com/LuaCATS/lpeg/blob/main/library/lpeg.lua) incomplete or incorrect? 🙏 [Please contribute!](https://github.com/LuaCATS/lpeg/pulls) +function lpeg.setmaxstack(max) end + +--- +---Convert the given value into a proper pattern. +--- +---This following rules are applied: +--- +---* If the argument is a pattern, +---it is returned unmodified. +--- +---* If the argument is a string, +---it is translated to a pattern that matches the string literally. +--- +---* If the argument is a non-negative number `n`, +---the result is a pattern that matches exactly `n` characters. +--- +---* If the argument is a negative number `-n`, +---the result is a pattern that +---succeeds only if the input string has less than `n` characters left: +---`lpeg.P(-n)` +---is equivalent to `-lpeg.P(n)` +---(see the unary minus operation). +--- +---* If the argument is a boolean, +---the result is a pattern that always succeeds or always fails +---(according to the boolean value), +---without consuming any input. +--- +---* If the argument is a table, +---it is interpreted as a grammar +---(see Grammars). +--- +---* If the argument is a function, +---returns a pattern equivalent to a +---match-time captureover the empty string. +--- +---@param value Pattern|string|integer|boolean|table|function +--- +---@return Pattern +--- +---😱 [Types](https://github.com/LuaCATS/lpeg/blob/main/library/lpeg.lua) incomplete or incorrect? 🙏 [Please contribute!](https://github.com/LuaCATS/lpeg/pulls) +function lpeg.P(value) end + +--- +---Return a pattern that +---matches only if the input string at the current position +---is preceded by `patt`. +--- +---Pattern `patt` must match only strings +---with some fixed length, +---and it cannot contain captures. +--- +---Like the and predicate, +---this pattern never consumes any input, +---independently of success or failure. +--- +---@param pattern Pattern +--- +---@return Pattern +--- +---😱 [Types](https://github.com/LuaCATS/lpeg/blob/main/library/lpeg.lua) incomplete or incorrect? 🙏 [Please contribute!](https://github.com/LuaCATS/lpeg/pulls) +function lpeg.B(pattern) end + +--- +---Return a pattern that matches any single character +---belonging to one of the given ranges. +--- +---Each `range` is a string `xy` of length 2, +---representing all characters with code +---between the codes of `x` and `y` +---(both inclusive). +--- +---As an example, the pattern +---`lpeg.R("09")` matches any digit, +---and `lpeg.R("az", "AZ")` matches any ASCII letter. +--- +---__Example:__ +--- +---```lua +---local pattern = lpeg.R("az") ^ 1 * -1 +---assert(pattern:match("hello") == 6) +---``` +--- +---@param ... string +--- +---@return Pattern +--- +---😱 [Types](https://github.com/LuaCATS/lpeg/blob/main/library/lpeg.lua) incomplete or incorrect? 🙏 [Please contribute!](https://github.com/LuaCATS/lpeg/pulls) +function lpeg.R(...) end + +--- +---Return a pattern that matches any single character that +---appears in the given string. +---(The `S` stands for Set.) +--- +---As an example, the pattern +---`lpeg.S("+-*/")` matches any arithmetic operator. +--- +---Note that, if `s` is a character +---(that is, a string of length 1), +---then `lpeg.P(s)` is equivalent to `lpeg.S(s)` +---which is equivalent to `lpeg.R(s..s)`. +---Note also that both `lpeg.S("")` and `lpeg.R()` +---are patterns that always fail. +--- +---@param string string +--- +---@return Pattern +--- +---😱 [Types](https://github.com/LuaCATS/lpeg/blob/main/library/lpeg.lua) incomplete or incorrect? 🙏 [Please contribute!](https://github.com/LuaCATS/lpeg/pulls) +function lpeg.S(string) end + +--- +---Create a non-terminal (a variable) for a grammar. +--- +---This operation creates a non-terminal (a variable) +---for a grammar. +---The created non-terminal refers to the rule indexed by `v` +---in the enclosing grammar. +--- +---__Example:__ +--- +---```lua +---local b = lpeg.P({"(" * ((1 - lpeg.S "()") + lpeg.V(1)) ^ 0 * ")"}) +---assert(b:match('((string))') == 11) +---assert(b:match('(') == nil) +---``` +--- +---@param v string|integer +--- +---@return Pattern +--- +---😱 [Types](https://github.com/LuaCATS/lpeg/blob/main/library/lpeg.lua) incomplete or incorrect? 🙏 [Please contribute!](https://github.com/LuaCATS/lpeg/pulls) +function lpeg.V(v) end + +--- +---@class Locale +---@field alnum userdata +---@field alpha userdata +---@field cntrl userdata +---@field digit userdata +---@field graph userdata +---@field lower userdata +---@field print userdata +---@field punct userdata +---@field space userdata +---@field upper userdata +---@field xdigit userdata + +--- +---Return a table with patterns for matching some character classes +---according to the current locale. +--- +---The table has fields named +---`alnum`, +---`alpha`, +---`cntrl`, +---`digit`, +---`graph`, +---`lower`, +---`print`, +---`punct`, +---`space`, +---`upper`, and +---`xdigit`, +---each one containing a correspondent pattern. +---Each pattern matches any single character that belongs to its class. +-- +---If called with an argument `table`, +---then it creates those fields inside the given table and +---returns that table. +--- +---__Example:__ +--- +---```lua +---lpeg.locale(lpeg) +---local space = lpeg.space^0 +---local name = lpeg.C(lpeg.alpha^1) * space +---local sep = lpeg.S(",;") * space +---local pair = lpeg.Cg(name * "=" * space * name) * sep^-1 +---local list = lpeg.Cf(lpeg.Ct("") * pair^0, rawset) +---local t = list:match("a=b, c = hi; next = pi") +---assert(t.a == 'b') +---assert(t.c == 'hi') +---assert(t.next == 'pi') +--- +---local locale = lpeg.locale() +---assert(type(locale.digit) == 'userdata') +---``` +--- +---@param tab? table +--- +---@return Locale +--- +---😱 [Types](https://github.com/LuaCATS/lpeg/blob/main/library/lpeg.lua) incomplete or incorrect? 🙏 [Please contribute!](https://github.com/LuaCATS/lpeg/pulls) +function lpeg.locale(tab) end + +--- +---Create a simple capture. +--- +---Creates a simple capture, +---which captures the substring of the subject that matches `patt`. +---The captured value is a string. +---If `patt` has other captures, +---their values are returned after this one. +--- +---__Example:__ +--- +---```lua +---local function split (s, sep) +--- sep = lpeg.P(sep) +--- local elem = lpeg.C((1 - sep)^0) +--- local p = elem * (sep * elem)^0 +--- return lpeg.match(p, s) +---end +--- +---local a, b, c = split('a,b,c', ',') +---assert(a == 'a') +---assert(b == 'b') +---assert(c == 'c') +---``` +--- +---@param patt Pattern +--- +---@return Capture +--- +---😱 [Types](https://github.com/LuaCATS/lpeg/blob/main/library/lpeg.lua) incomplete or incorrect? 🙏 [Please contribute!](https://github.com/LuaCATS/lpeg/pulls) +function lpeg.C(patt) end + +--- +---Create an argument capture. +--- +---This pattern matches the empty string and +---produces the value given as the nth extra +---argument given in the call to `lpeg.match`. +--- +---@param n integer +--- +---@return Capture +--- +---😱 [Types](https://github.com/LuaCATS/lpeg/blob/main/library/lpeg.lua) incomplete or incorrect? 🙏 [Please contribute!](https://github.com/LuaCATS/lpeg/pulls) +function lpeg.Carg(n) end + +--- +---Create a back capture. +--- +---This pattern matches the empty string and +---produces the values produced by the most recent +---group capture named `name` +---(where `name` can be any Lua value). +--- +---Most recent means the last +---complete +---outermost +---group capture with the given name. +---A Complete capture means that the entire pattern +---corresponding to the capture has matched. +---An Outermost capture means that the capture is not inside +---another complete capture. +--- +---In the same way that LPeg does not specify when it evaluates captures, +---it does not specify whether it reuses +---values previously produced by the group +---or re-evaluates them. +--- +---@param name any +--- +---@return Capture +--- +---😱 [Types](https://github.com/LuaCATS/lpeg/blob/main/library/lpeg.lua) incomplete or incorrect? 🙏 [Please contribute!](https://github.com/LuaCATS/lpeg/pulls) +function lpeg.Cb(name) end + +--- +---Create a constant capture. +--- +---This pattern matches the empty string and +---produces all given values as its captured values. +--- +---@param ... any +--- +---@return Capture +--- +---😱 [Types](https://github.com/LuaCATS/lpeg/blob/main/library/lpeg.lua) incomplete or incorrect? 🙏 [Please contribute!](https://github.com/LuaCATS/lpeg/pulls) +function lpeg.Cc(...) end + +--- +---Create a fold capture. +--- +---If `patt` produces a list of captures +---C1 C2 ... Cn, +---this capture will produce the value +---`func(...func(func(C1, C2), C3)...,Cn)`, +---that is, it will fold +---(or accumulate, or reduce) +---the captures from `patt` using function `func`. +--- +---This capture assumes that `patt` should produce +---at least one capture with at least one value (of any type), +---which becomes the initial value of an accumulator. +---(If you need a specific initial value, +---you may prefix a constant captureto `patt`.) +---For each subsequent capture, +---LPeg calls `func` +---with this accumulator as the first argument and all values produced +---by the capture as extra arguments; +---the first result from this call +---becomes the new value for the accumulator. +---The final value of the accumulator becomes the captured value. +--- +---__Example:__ +--- +---```lua +---local number = lpeg.R("09") ^ 1 / tonumber +---local list = number * ("," * number) ^ 0 +---local function add(acc, newvalue) return acc + newvalue end +---local sum = lpeg.Cf(list, add) +---assert(sum:match("10,30,43") == 83) +---``` +--- +---@param patt Pattern +---@param func fun(acc, newvalue) +--- +---@return Capture +--- +---😱 [Types](https://github.com/LuaCATS/lpeg/blob/main/library/lpeg.lua) incomplete or incorrect? 🙏 [Please contribute!](https://github.com/LuaCATS/lpeg/pulls) +function lpeg.Cf(patt, func) end + +--- +---Create a group capture. +--- +---It groups all values returned by `patt` +---into a single capture. +---The group may be anonymous (if no name is given) +---or named with the given name +---(which can be any non-nil Lua value). +--- +---@param patt Pattern +---@param name? string +--- +---@return Capture +--- +---😱 [Types](https://github.com/LuaCATS/lpeg/blob/main/library/lpeg.lua) incomplete or incorrect? 🙏 [Please contribute!](https://github.com/LuaCATS/lpeg/pulls) +function lpeg.Cg(patt, name) end + +--- +---Create a position capture. +--- +---It matches the empty string and +---captures the position in the subject where the match occurs. +---The captured value is a number. +--- +---__Example:__ +--- +---```lua +---local I = lpeg.Cp() +---local function anywhere(p) return lpeg.P({I * p * I + 1 * lpeg.V(1)}) end + +---local match_start, match_end = anywhere("world"):match("hello world!") +---assert(match_start == 7) +---assert(match_end == 12) +---``` +--- +---@return Capture +--- +---😱 [Types](https://github.com/LuaCATS/lpeg/blob/main/library/lpeg.lua) incomplete or incorrect? 🙏 [Please contribute!](https://github.com/LuaCATS/lpeg/pulls) +function lpeg.Cp() end + +--- +---Create a substitution capture. +--- +---This function creates a substitution capture, +---which captures the substring of the subject that matches `patt`, +---with substitutions. +---For any capture inside `patt` with a value, +---the substring that matched the capture is replaced by the capture value +---(which should be a string). +---The final captured value is the string resulting from +---all replacements. +--- +---__Example:__ +--- +---```lua +---local function gsub (s, patt, repl) +--- patt = lpeg.P(patt) +--- patt = lpeg.Cs((patt / repl + 1)^0) +--- return lpeg.match(patt, s) +---end +---assert(gsub('Hello, xxx!', 'xxx', 'World') == 'Hello, World!') +---``` +--- +---@param patt Pattern +--- +---@return Capture +--- +---😱 [Types](https://github.com/LuaCATS/lpeg/blob/main/library/lpeg.lua) incomplete or incorrect? 🙏 [Please contribute!](https://github.com/LuaCATS/lpeg/pulls) +function lpeg.Cs(patt) end + +--- +---Create a table capture. +--- +---This capture returns a table with all values from all anonymous captures +---made by `patt` inside this table in successive integer keys, +---starting at 1. +---Moreover, +---for each named capture group created by `patt`, +---the first value of the group is put into the table +---with the group name as its key. +---The captured value is only the table. +--- +---@param patt Pattern|'' +--- +---@return Capture +--- +---😱 [Types](https://github.com/LuaCATS/lpeg/blob/main/library/lpeg.lua) incomplete or incorrect? 🙏 [Please contribute!](https://github.com/LuaCATS/lpeg/pulls) +function lpeg.Ct(patt) end + +--- +---Create a match-time capture. +--- +---Unlike all other captures, +---this one is evaluated immediately when a match occurs +---(even if it is part of a larger pattern that fails later). +---It forces the immediate evaluation of all its nested captures +---and then calls `function`. +--- +---The given function gets as arguments the entire subject, +---the current position (after the match of `patt`), +---plus any capture values produced by `patt`. +--- +---The first value returned by `function` +---defines how the match happens. +---If the call returns a number, +---the match succeeds +---and the returned number becomes the new current position. +---(Assuming a subject sand current position i, +---the returned number must be in the range [i, len(s) + 1].) +---If the call returns true, +---the match succeeds without consuming any input. +---(So, to return trueis equivalent to return i.) +---If the call returns false, nil, or no value, +---the match fails. +--- +---Any extra values returned by the function become the +---values produced by the capture. +--- +---@param patt Pattern +---@param fn function +--- +---@return Capture +--- +---😱 [Types](https://github.com/LuaCATS/lpeg/blob/main/library/lpeg.lua) incomplete or incorrect? 🙏 [Please contribute!](https://github.com/LuaCATS/lpeg/pulls) +function lpeg.Cmt(patt, fn) end + +return lpeg diff --git a/bundle/neodev.nvim/types/nightly/lua.lua b/bundle/neodev.nvim/types/nightly/lua.lua new file mode 100644 index 000000000..2b355bccc --- /dev/null +++ b/bundle/neodev.nvim/types/nightly/lua.lua @@ -0,0 +1,310 @@ +---@meta + + + +-- Invokes |vim-function| or |user-function| {func} with arguments {...}. +-- See also |vim.fn|. +-- Equivalent to: +-- ```lua +-- vim.fn[func]({...}) +-- ``` +--- @param func fun() +function vim.call(func, ...) end + +-- Run diff on strings {a} and {b}. Any indices returned by this function, +-- either directly or via callback arguments, are 1-based. +-- +-- Examples: +-- ```lua +-- vim.diff('a\n', 'b\nc\n') +-- -- => +-- -- @@ -1 +1,2 @@ +-- -- -a +-- -- +b +-- -- +c +-- +-- vim.diff('a\n', 'b\nc\n', {result_type = 'indices'}) +-- -- => +-- -- { +-- -- {1, 1, 1, 2} +-- -- } +-- ``` +-- Parameters: ~ +-- • {a} First string to compare +-- • {b} Second string to compare +-- • {opts} Optional parameters: +-- • `on_hunk` (callback): +-- Invoked for each hunk in the diff. Return a negative number +-- to cancel the callback for any remaining hunks. +-- Args: +-- • `start_a` (integer): Start line of hunk in {a}. +-- • `count_a` (integer): Hunk size in {a}. +-- • `start_b` (integer): Start line of hunk in {b}. +-- • `count_b` (integer): Hunk size in {b}. +-- • `result_type` (string): Form of the returned diff: +-- • "unified": (default) String in unified format. +-- • "indices": Array of hunk locations. +-- Note: This option is ignored if `on_hunk` is used. +-- • `linematch` (boolean|integer): Run linematch on the resulting hunks +-- from xdiff. When integer, only hunks upto this size in +-- lines are run through linematch. Requires `result_type = indices`, +-- ignored otherwise. +-- • `algorithm` (string): +-- Diff algorithm to use. Values: +-- • "myers" the default algorithm +-- • "minimal" spend extra time to generate the +-- smallest possible diff +-- • "patience" patience diff algorithm +-- • "histogram" histogram diff algorithm +-- • `ctxlen` (integer): Context length +-- • `interhunkctxlen` (integer): +-- Inter hunk context length +-- • `ignore_whitespace` (boolean): +-- Ignore whitespace +-- • `ignore_whitespace_change` (boolean): +-- Ignore whitespace change +-- • `ignore_whitespace_change_at_eol` (boolean) +-- Ignore whitespace change at end-of-line. +-- • `ignore_cr_at_eol` (boolean) +-- Ignore carriage return at end-of-line +-- • `ignore_blank_lines` (boolean) +-- Ignore blank lines +-- • `indent_heuristic` (boolean): +-- Use the indent heuristic for the internal +-- diff library. +-- +-- Return: ~ +-- See {opts.result_type}. nil if {opts.on_hunk} is given. +--- @param opts table +function vim.diff(a, b, opts) end + +-- The result is a String, which is the text {str} converted from +-- encoding {from} to encoding {to}. When the conversion fails `nil` is +-- returned. When some characters could not be converted they +-- are replaced with "?". +-- The encoding names are whatever the iconv() library function +-- can accept, see ":Man 3 iconv". +-- +-- Parameters: ~ +-- • {str} (string) Text to convert +-- • {from} (string) Encoding of {str} +-- • {to} (string) Target encoding +-- +-- Returns: ~ +-- Converted string if conversion succeeds, `nil` otherwise. +--- @param str string +--- @param from number +--- @param to number +--- @param opts? table +function vim.iconv(str, from, to, opts) end + +-- Returns true if the code is executing as part of a "fast" event handler, +-- where most of the API is disabled. These are low-level events (e.g. +-- |lua-loop-callbacks|) which can be invoked whenever Nvim polls for input. +-- When this is `false` most API functions are callable (but may be subject +-- to other restrictions such as |textlock|). +function vim.in_fast_event() end + +-- Decodes (or "unpacks") the JSON-encoded {str} to a Lua object. +-- +-- {opts} is a table with the key `luanil = { object: bool, array: bool }` +-- that controls whether `null` in JSON objects or arrays should be converted +-- to Lua `nil` instead of `vim.NIL`. +--- @param str string +--- @param opts? table +function vim.json.decode(str, opts) end + +-- Encodes (or "packs") Lua object {obj} as JSON in a Lua string. +function vim.json.encode(obj) end + +-- Decodes (or "unpacks") the msgpack-encoded {str} to a Lua object. +--- @param str string +function vim.mpack.decode(str) end + +-- Encodes (or "packs") Lua object {obj} as msgpack in a Lua string. +function vim.mpack.encode(obj) end + +-- Parse the Vim regex {re} and return a regex object. Regexes are "magic" +-- and case-sensitive by default, regardless of 'magic' and 'ignorecase'. +-- They can be controlled with flags, see |/magic| and |/ignorecase|. +function vim.regex(re) end + +-- Sends {event} to {channel} via |RPC| and returns immediately. If {channel} +-- is 0, the event is broadcast to all channels. +-- +-- This function also works in a fast callback |lua-loop-callbacks|. +--- @param args? any[] +--- @param ...? any +function vim.rpcnotify(channel, method, args, ...) end + +-- Sends a request to {channel} to invoke {method} via |RPC| and blocks until +-- a response is received. +-- +-- Note: NIL values as part of the return value is represented as |vim.NIL| +-- special value +--- @param args? any[] +--- @param ...? any +function vim.rpcrequest(channel, method, args, ...) end + +-- Schedules {callback} to be invoked soon by the main event-loop. Useful +-- to avoid |textlock| or other temporary restrictions. +--- @param callback fun() +function vim.schedule(callback) end + +-- Check {str} for spelling errors. Similar to the Vimscript function +-- |spellbadword()|. +-- +-- Note: The behaviour of this function is dependent on: 'spelllang', +-- 'spellfile', 'spellcapcheck' and 'spelloptions' which can all be local to +-- the buffer. Consider calling this with |nvim_buf_call()|. +-- +-- Example: +-- ```lua +-- vim.spell.check("the quik brown fox") +-- -- => +-- -- { +-- -- {'quik', 'bad', 5} +-- -- } +-- ``` +-- Parameters: ~ +-- • {str} String to spell check. +-- +-- Return: ~ +-- List of tuples with three items: +-- - The badly spelled word. +-- - The type of the spelling error: +-- "bad" spelling mistake +-- "rare" rare word +-- "local" word only valid in another region +-- "caps" word should start with Capital +-- - The position in {str} where the word begins. +--- @param str string +function vim.spell.check(str) end + +-- Convert UTF-32 or UTF-16 {index} to byte index. If {use_utf16} is not +-- supplied, it defaults to false (use UTF-32). Returns the byte index. +-- +-- Invalid UTF-8 and NUL is treated like by |vim.str_byteindex()|. +-- An {index} in the middle of a UTF-16 sequence is rounded upwards to +-- the end of that sequence. +--- @param str string +--- @param index number +--- @param use_utf16? any +function vim.str_byteindex(str, index, use_utf16) end + +-- Convert byte index to UTF-32 and UTF-16 indices. If {index} is not +-- supplied, the length of the string is used. All indices are zero-based. +-- Returns two values: the UTF-32 and UTF-16 indices respectively. +-- +-- Embedded NUL bytes are treated as terminating the string. Invalid UTF-8 +-- bytes, and embedded surrogates are counted as one code point each. An +-- {index} in the middle of a UTF-8 sequence is rounded upwards to the end of +-- that sequence. +--- @param str string +--- @param index? number +function vim.str_utfindex(str, index) end + +-- Compares strings case-insensitively. Returns 0, 1 or -1 if strings are +-- equal, {a} is greater than {b} or {a} is lesser than {b}, respectively. +function vim.stricmp(a, b) end + +-- Attach to ui events, similar to |nvim_ui_attach()| but receive events +-- as lua callback. Can be used to implement screen elements like +-- popupmenu or message handling in lua. +-- +-- {options} should be a dictionary-like table, where `ext_...` options should +-- be set to true to receive events for the respective external element. +-- +-- {callback} receives event name plus additional parameters. See |ui-popupmenu| +-- and the sections below for event format for respective events. +-- +-- WARNING: This api is considered experimental. Usability will vary for +-- different screen elements. In particular `ext_messages` behavior is subject +-- to further changes and usability improvements. This is expected to be +-- used to handle messages when setting 'cmdheight' to zero (which is +-- likewise experimental). +-- +-- Example (stub for a |ui-popupmenu| implementation): +-- ```lua +-- +-- ns = vim.api.nvim_create_namespace('my_fancy_pum') +-- +-- vim.ui_attach(ns, {ext_popupmenu=true}, function(event, ...) +-- if event == "popupmenu_show" then +-- local items, selected, row, col, grid = ... +-- print("display pum ", #items) +-- elseif event == "popupmenu_select" then +-- local selected = ... +-- print("selected", selected) +-- elseif event == "popupmenu_hide" then +-- print("FIN") +-- end +-- end) +-- ``` +--- @param ns number +--- @param options table +--- @param callback fun() +function vim.ui_attach(ns, options, callback) end + +-- Detach a callback previously attached with |vim.ui_attach()| for the +-- given namespace {ns}. +--- @param ns number +function vim.ui_detach(ns) end + +-- Wait for {time} in milliseconds until {callback} returns `true`. +-- +-- Executes {callback} immediately and at approximately {interval} +-- milliseconds (default 200). Nvim still processes other events during +-- this time. +-- +-- Parameters: ~ +-- • {time} Number of milliseconds to wait +-- • {callback} Optional callback. Waits until {callback} returns true +-- • {interval} (Approximate) number of milliseconds to wait between polls +-- • {fast_only} If true, only |api-fast| events will be processed. +-- If called from while in an |api-fast| event, will +-- automatically be set to `true`. +-- +-- Returns: ~ +-- If {callback} returns `true` during the {time}: +-- `true, nil` +-- +-- If {callback} never returns `true` during the {time}: +-- `false, -1` +-- +-- If {callback} is interrupted during the {time}: +-- `false, -2` +-- +-- If {callback} errors, the error is raised. +-- +-- Examples: +-- ```lua +-- +-- --- +-- -- Wait for 100 ms, allowing other events to process +-- vim.wait(100, function() end) +-- +-- --- +-- -- Wait for 100 ms or until global variable set. +-- vim.wait(100, function() return vim.g.waiting_for_var end) +-- +-- --- +-- -- Wait for 1 second or until global variable set, checking every ~500 ms +-- vim.wait(1000, function() return vim.g.waiting_for_var end, 500) +-- +-- --- +-- -- Schedule a function to set a value in 100ms +-- vim.defer_fn(function() vim.g.timer_result = true end, 100) +-- +-- -- Would wait ten seconds if results blocked. Actually only waits 100 ms +-- if vim.wait(10000, function() return vim.g.timer_result end) then +-- print('Only waiting a little bit of time!') +-- end +-- ``` +--- @param time number +--- @param condition? fun(): boolean +--- @param interval? number +--- @param fast_only? boolean +--- @return boolean, nil|number +function vim.wait(time, condition, interval, fast_only) end + diff --git a/bundle/neodev.nvim/types/nightly/options.1.lua b/bundle/neodev.nvim/types/nightly/options.1.lua new file mode 100644 index 000000000..e4caf3c0b --- /dev/null +++ b/bundle/neodev.nvim/types/nightly/options.1.lua @@ -0,0 +1,4353 @@ +---@meta + +-- `'diff'` boolean (default off) +-- local to window +-- Join the current window in the group of windows that shows differences +-- between files. See |diff-mode|. +vim.wo.diff = false +-- `'fillchars'` `'fcs'` string (default "") +-- global or local to window |global-local| +-- Characters to fill the statuslines, vertical separators and special +-- lines in the window. +-- It is a comma-separated list of items. Each item has a name, a colon +-- and the value of that item: +-- +-- item default Used for ~ +-- stl ' ' or `'^'` statusline of the current window +-- stlnc ' ' or `'='` statusline of the non-current windows +-- wbr ' ' window bar +-- horiz `'─'` or `'-'` horizontal separators |:split| +-- horizup `'┴'` or `'-'` upwards facing horizontal separator +-- horizdown `'┬'` or `'-'` downwards facing horizontal separator +-- vert `'│'` or `'|'` vertical separators |:vsplit| +-- vertleft `'┤'` or `'|'` left facing vertical separator +-- vertright `'├'` or `'|'` right facing vertical separator +-- verthoriz `'┼'` or `'+'` overlapping vertical and horizontal +-- separator +-- fold `'·'` or `'-'` filling `'foldtext'` +-- foldopen `'-'` mark the beginning of a fold +-- foldclose `'+'` show a closed fold +-- foldsep `'│'` or `'|'` open fold middle marker +-- diff `'-'` deleted lines of the `'diff'` option +-- msgsep ' ' message separator `'display'` +-- eob `'~'` empty lines at the end of a buffer +-- lastline `'@'` `'display'` contains lastline/truncate +-- +-- Any one that is omitted will fall back to the default. For "stl" and +-- "stlnc" the space will be used when there is highlighting, `'^'` or `'='` +-- otherwise. +-- +-- Note that "horiz", "horizup", "horizdown", "vertleft", "vertright" and +-- "verthoriz" are only used when `'laststatus'` is 3, since only vertical +-- window separators are used otherwise. +-- +-- If `'ambiwidth'` is "double" then "horiz", "horizup", "horizdown", +-- "vert", "vertleft", "vertright", "verthoriz", "foldsep" and "fold" +-- default to single-byte alternatives. +-- +-- Example: > +-- :set fillchars=stl:^,stlnc:=,vert:│,fold:·,diff:- +-- < This is similar to the default, except that these characters will also +-- be used when there is highlighting. +-- +-- For the "stl", "stlnc", "foldopen", "foldclose" and "foldsep" items +-- single-byte and multibyte characters are supported. But double-width +-- characters are not supported. +-- +-- The highlighting used for these items: +-- item highlight group ~ +-- stl StatusLine |hl-StatusLine| +-- stlnc StatusLineNC |hl-StatusLineNC| +-- wbr WinBar |hl-WinBar| or |hl-WinBarNC| +-- horiz WinSeparator |hl-WinSeparator| +-- horizup WinSeparator |hl-WinSeparator| +-- horizdown WinSeparator |hl-WinSeparator| +-- vert WinSeparator |hl-WinSeparator| +-- vertleft WinSeparator |hl-WinSeparator| +-- vertright WinSeparator |hl-WinSeparator| +-- verthoriz WinSeparator |hl-WinSeparator| +-- fold Folded |hl-Folded| +-- diff DiffDelete |hl-DiffDelete| +-- eob EndOfBuffer |hl-EndOfBuffer| +-- lastline NonText |hl-NonText| +vim.wo.fillchars = "" +vim.wo.fcs = vim.wo.fillchars +-- `'foldcolumn'` `'fdc'` string (default "0") +-- local to window +-- When and how to draw the foldcolumn. Valid values are: +-- "auto": resize to the minimum amount of folds to display. +-- "auto:[1-9]": resize to accommodate multiple folds up to the +-- selected level +-- 0: to disable foldcolumn +-- "[1-9]": to display a fixed number of columns +-- See |folding|. +vim.wo.foldcolumn = "0" +vim.wo.fdc = vim.wo.foldcolumn +-- `'foldenable'` `'fen'` boolean (default on) +-- local to window +-- When off, all folds are open. This option can be used to quickly +-- switch between showing all text unfolded and viewing the text with +-- folds (including manually opened or closed folds). It can be toggled +-- with the |zi| command. The `'foldcolumn'` will remain blank when +-- `'foldenable'` is off. +-- This option is set by commands that create a new fold or close a fold. +-- See |folding|. +vim.wo.foldenable = true +vim.wo.fen = vim.wo.foldenable +-- `'foldexpr'` `'fde'` string (default: "0") +-- local to window +-- The expression used for when `'foldmethod'` is "expr". It is evaluated +-- for each line to obtain its fold level. The context is set to the +-- script where `'foldexpr'` was set, script-local items can be accessed. +-- See |fold-expr| for the usage. +-- +-- The expression will be evaluated in the |sandbox| if set from a +-- modeline, see |sandbox-option|. +-- This option can't be set from a |modeline| when the `'diff'` option is +-- on or the `'modelineexpr'` option is off. +-- +-- It is not allowed to change text or jump to another window while +-- evaluating `'foldexpr'` |textlock|. +vim.wo.foldexpr = "0" +vim.wo.fde = vim.wo.foldexpr +-- `'foldignore'` `'fdi'` string (default: "#") +-- local to window +-- Used only when `'foldmethod'` is "indent". Lines starting with +-- characters in `'foldignore'` will get their fold level from surrounding +-- lines. White space is skipped before checking for this character. +-- The default "#" works well for C programs. See |fold-indent|. +vim.wo.foldignore = "#" +vim.wo.fdi = vim.wo.foldignore +-- `'foldlevel'` `'fdl'` number (default: 0) +-- local to window +-- Sets the fold level: Folds with a higher level will be closed. +-- Setting this option to zero will close all folds. Higher numbers will +-- close fewer folds. +-- This option is set by commands like |zm|, |zM| and |zR|. +-- See |fold-foldlevel|. +vim.wo.foldlevel = 0 +vim.wo.fdl = vim.wo.foldlevel +-- `'foldmarker'` `'fmr'` string (default: "{{{,}}}") +-- local to window +-- The start and end marker used when `'foldmethod'` is "marker". There +-- must be one comma, which separates the start and end marker. The +-- marker is a literal string (a regular expression would be too slow). +-- See |fold-marker|. +vim.wo.foldmarker = "{{{,}}}" +vim.wo.fmr = vim.wo.foldmarker +-- `'foldmethod'` `'fdm'` string (default: "manual") +-- local to window +-- The kind of folding used for the current window. Possible values: +-- |fold-manual| manual Folds are created manually. +-- |fold-indent| indent Lines with equal indent form a fold. +-- |fold-expr| expr `'foldexpr'` gives the fold level of a line. +-- |fold-marker| marker Markers are used to specify folds. +-- |fold-syntax| syntax Syntax highlighting items specify folds. +-- |fold-diff| diff Fold text that is not changed. +vim.wo.foldmethod = "manual" +vim.wo.fdm = vim.wo.foldmethod +-- `'foldminlines'` `'fml'` number (default: 1) +-- local to window +-- Sets the number of screen lines above which a fold can be displayed +-- closed. Also for manually closed folds. With the default value of +-- one a fold can only be closed if it takes up two or more screen lines. +-- Set to zero to be able to close folds of just one screen line. +-- Note that this only has an effect on what is displayed. After using +-- "zc" to close a fold, which is displayed open because it's smaller +-- than `'foldminlines'` , a following "zc" may close a containing fold. +vim.wo.foldminlines = 1 +vim.wo.fml = vim.wo.foldminlines +-- `'foldnestmax'` `'fdn'` number (default: 20) +-- local to window +-- Sets the maximum nesting of folds for the "indent" and "syntax" +-- methods. This avoids that too many folds will be created. Using more +-- than 20 doesn't work, because the internal limit is 20. +vim.wo.foldnestmax = 20 +vim.wo.fdn = vim.wo.foldnestmax +-- `'foldtext'` `'fdt'` string (default: "foldtext()") +-- local to window +-- An expression which is used to specify the text displayed for a closed +-- fold. The context is set to the script where `'foldexpr'` was set, +-- script-local items can be accessed. See |fold-foldtext| for the +-- usage. +-- +-- The expression will be evaluated in the |sandbox| if set from a +-- modeline, see |sandbox-option|. +-- This option cannot be set in a modeline when `'modelineexpr'` is off. +-- +-- It is not allowed to change text or jump to another window while +-- evaluating `'foldtext'` |textlock|. +vim.wo.foldtext = "foldtext()" +vim.wo.fdt = vim.wo.foldtext +-- `'linebreak'` `'lbr'` boolean (default off) +-- local to window +-- If on, Vim will wrap long lines at a character in `'breakat'` rather +-- than at the last character that fits on the screen. Unlike +-- `'wrapmargin'` and `'textwidth'` , this does not insert s in the file, +-- it only affects the way the file is displayed, not its contents. +-- If `'breakindent'` is set, line is visually indented. Then, the value +-- of `'showbreak'` is used to put in front of wrapped lines. This option +-- is not used when the `'wrap'` option is off. +-- Note that characters after an are mostly not displayed +-- with the right amount of white space. +vim.wo.linebreak = false +vim.wo.lbr = vim.wo.linebreak +-- `'list'` boolean (default off) +-- local to window +-- List mode: By default, show tabs as ">", trailing spaces as "-", and +-- non-breakable space characters as "+". Useful to see the difference +-- between tabs and spaces and for trailing blanks. Further changed by +-- the `'listchars'` option. +-- +-- The cursor is displayed at the start of the space a Tab character +-- occupies, not at the end as usual in Normal mode. To get this cursor +-- position while displaying Tabs with spaces, use: > +-- :set list lcs=tab:\ \ +-- < +-- Note that list mode will also affect formatting (set with `'textwidth'` +-- or `'wrapmargin'` ) when `'cpoptions'` includes `'L'` . See `'listchars'` for +-- changing the way tabs are displayed. +vim.wo.list = false +-- `'listchars'` `'lcs'` string (default: "tab:> ,trail:-,nbsp:+") +-- global or local to window |global-local| +-- Strings to use in `'list'` mode and for the |:list| command. It is a +-- comma-separated list of string settings. +-- +-- +-- eol:c Character to show at the end of each line. When +-- omitted, there is no extra character at the end of the +-- line. +-- +-- tab:xy[z] Two or three characters to be used to show a tab. +-- The third character is optional. +-- +-- tab:xy The `'x'` is always used, then `'y'` as many times as will +-- fit. Thus "tab:>-" displays: > +-- > +-- >- +-- >-- +-- etc. +-- < +-- tab:xyz The `'z'` is always used, then `'x'` is prepended, and +-- then `'y'` is used as many times as will fit. Thus +-- "tab:<->" displays: > +-- > +-- <> +-- <-> +-- <--> +-- etc. +-- < +-- When "tab:" is omitted, a tab is shown as ^I. +-- +-- space:c Character to show for a space. When omitted, spaces +-- are left blank. +-- +-- multispace:c... +-- One or more characters to use cyclically to show for +-- multiple consecutive spaces. Overrides the "space" +-- setting, except for single spaces. When omitted, the +-- "space" setting is used. For example, +-- `:set listchars=multispace:---+` shows ten consecutive +-- spaces as: > +-- ---+---+-- +-- < +-- +-- lead:c Character to show for leading spaces. When omitted, +-- leading spaces are blank. Overrides the "space" and +-- "multispace" settings for leading spaces. You can +-- combine it with "tab:", for example: > +-- :set listchars+=tab:>-,lead:. +-- < +-- +-- leadmultispace:c... +-- Like the |lcs-multispace| value, but for leading +-- spaces only. Also overrides |lcs-lead| for leading +-- multiple spaces. +-- `:set listchars=leadmultispace:---+` shows ten +-- consecutive leading spaces as: > +-- ---+---+--XXX +-- < +-- Where "XXX" denotes the first non-blank characters in +-- the line. +-- +-- trail:c Character to show for trailing spaces. When omitted, +-- trailing spaces are blank. Overrides the "space" and +-- "multispace" settings for trailing spaces. +-- +-- extends:c Character to show in the last column, when `'wrap'` is +-- off and the line continues beyond the right of the +-- screen. +-- +-- precedes:c Character to show in the first visible column of the +-- physical line, when there is text preceding the +-- character visible in the first column. +-- +-- conceal:c Character to show in place of concealed text, when +-- `'conceallevel'` is set to 1. A space when omitted. +-- +-- nbsp:c Character to show for a non-breakable space character +-- (0xA0 (160 decimal) and U+202F). Left blank when +-- omitted. +-- +-- The characters `':'` and `','` should not be used. UTF-8 characters can +-- be used. All characters must be single width. +-- +-- Each character can be specified as hex: > +-- set listchars=eol:\\x24 +-- set listchars=eol:\\u21b5 +-- set listchars=eol:\\U000021b5 +-- < Note that a double backslash is used. The number of hex characters +-- must be exactly 2 for \\x, 4 for \\u and 8 for \\U. +-- +-- Examples: > +-- :set lcs=tab:>-,trail:- +-- :set lcs=tab:>-,eol:<,nbsp:% +-- :set lcs=extends:>,precedes:< +-- < |hl-NonText| highlighting will be used for "eol", "extends" and +-- "precedes". |hl-Whitespace| for "nbsp", "space", "tab", "multispace", +-- "lead" and "trail". +vim.wo.listchars = "tab:> ,trail:-,nbsp:+" +vim.wo.lcs = vim.wo.listchars +-- `'number'` `'nu'` boolean (default off) +-- local to window +-- Print the line number in front of each line. When the `'n'` option is +-- excluded from `'cpoptions'` a wrapped line will not use the column of +-- line numbers. +-- Use the `'numberwidth'` option to adjust the room for the line number. +-- When a long, wrapped line doesn't start with the first character, `'-'` +-- characters are put before the number. +-- For highlighting see |hl-LineNr|, |hl-CursorLineNr|, and the +-- |:sign-define| "numhl" argument. +-- +-- The `'relativenumber'` option changes the displayed number to be +-- relative to the cursor. Together with `'number'` there are these +-- four combinations (cursor in line 3): +-- +-- `'nonu'` `'nu'` `'nonu'` `'nu'` +-- `'nornu'` `'nornu'` `'rnu'` `'rnu'` +-- > +-- |apple | 1 apple | 2 apple | 2 apple +-- |pear | 2 pear | 1 pear | 1 pear +-- |nobody | 3 nobody | 0 nobody |3 nobody +-- |there | 4 there | 1 there | 1 there +-- < +vim.wo.number = false +vim.wo.nu = vim.wo.number +-- `'numberwidth'` `'nuw'` number (default: 4) +-- local to window +-- Minimal number of columns to use for the line number. Only relevant +-- when the `'number'` or `'relativenumber'` option is set or printing lines +-- with a line number. Since one space is always between the number and +-- the text, there is one less character for the number itself. +-- The value is the minimum width. A bigger width is used when needed to +-- fit the highest line number in the buffer respectively the number of +-- rows in the window, depending on whether `'number'` or `'relativenumber'` +-- is set. Thus with the Vim default of 4 there is room for a line number +-- up to 999. When the buffer has 1000 lines five columns will be used. +-- The minimum value is 1, the maximum value is 20. +vim.wo.numberwidth = 4 +vim.wo.nuw = vim.wo.numberwidth +-- `'previewwindow'` `'pvw'` boolean (default off) +-- local to window +-- Identifies the preview window. Only one window can have this option +-- set. It's normally not set directly, but by using one of the commands +-- |:ptag|, |:pedit|, etc. +vim.wo.previewwindow = false +vim.wo.pvw = vim.wo.previewwindow +-- `'relativenumber'` `'rnu'` boolean (default off) +-- local to window +-- Show the line number relative to the line with the cursor in front of +-- each line. Relative line numbers help you use the |count| you can +-- precede some vertical motion commands (e.g. j k + -) with, without +-- having to calculate it yourself. Especially useful in combination with +-- other commands (e.g. y d c < > gq gw =). +-- When the `'n'` option is excluded from `'cpoptions'` a wrapped +-- line will not use the column of line numbers. +-- The `'numberwidth'` option can be used to set the room used for the line +-- number. +-- When a long, wrapped line doesn't start with the first character, `'-'` +-- characters are put before the number. +-- See |hl-LineNr| and |hl-CursorLineNr| for the highlighting used for +-- the number. +-- +-- The number in front of the cursor line also depends on the value of +-- `'number'` , see |number_relativenumber| for all combinations of the two +-- options. +vim.wo.relativenumber = false +vim.wo.rnu = vim.wo.relativenumber +-- `'rightleft'` `'rl'` boolean (default off) +-- local to window +-- When on, display orientation becomes right-to-left, i.e., characters +-- that are stored in the file appear from the right to the left. +-- Using this option, it is possible to edit files for languages that +-- are written from the right to the left such as Hebrew and Arabic. +-- This option is per window, so it is possible to edit mixed files +-- simultaneously, or to view the same file in both ways (this is +-- useful whenever you have a mixed text file with both right-to-left +-- and left-to-right strings so that both sets are displayed properly +-- in different windows). Also see |rileft.txt|. +vim.wo.rightleft = false +vim.wo.rl = vim.wo.rightleft +-- `'rightleftcmd'` `'rlc'` string (default "search") +-- local to window +-- Each word in this option enables the command line editing to work in +-- right-to-left mode for a group of commands: +-- +-- search "/" and "?" commands +-- +-- This is useful for languages such as Hebrew, Arabic and Farsi. +-- The `'rightleft'` option must be set for `'rightleftcmd'` to take effect. +vim.wo.rightleftcmd = "search" +vim.wo.rlc = vim.wo.rightleftcmd +-- `'scroll'` `'scr'` number (default: half the window height) +-- local to window +-- Number of lines to scroll with CTRL-U and CTRL-D commands. Will be +-- set to half the number of lines in the window when the window size +-- changes. This may happen when enabling the |status-line| or +-- `'tabline'` option after setting the `'scroll'` option. +-- If you give a count to the CTRL-U or CTRL-D command it will +-- be used as the new value for `'scroll'` . Reset to half the window +-- height with ":set scroll=0". +vim.wo.scroll = 0 +vim.wo.scr = vim.wo.scroll +-- `'scrollbind'` `'scb'` boolean (default off) +-- local to window +-- See also |scroll-binding|. When this option is set, the current +-- window scrolls as other scrollbind windows (windows that also have +-- this option set) scroll. This option is useful for viewing the +-- differences between two versions of a file, see `'diff'` . +-- See |`'scrollopt'` | for options that determine how this option should be +-- interpreted. +-- This option is mostly reset when splitting a window to edit another +-- file. This means that ":split | edit file" results in two windows +-- with scroll-binding, but ":split file" does not. +vim.wo.scrollbind = false +vim.wo.scb = vim.wo.scrollbind +-- `'scrolloff'` `'so'` number (default 0) +-- global or local to window |global-local| +-- Minimal number of screen lines to keep above and below the cursor. +-- This will make some context visible around where you are working. If +-- you set it to a very large value (999) the cursor line will always be +-- in the middle of the window (except at the start or end of the file or +-- when long lines wrap). +-- After using the local value, go back the global value with one of +-- these two: > +-- setlocal scrolloff< +-- setlocal scrolloff=-1 +-- < For scrolling horizontally see `'sidescrolloff'` . +vim.wo.scrolloff = 0 +vim.wo.so = vim.wo.scrolloff +-- `'showbreak'` `'sbr'` string (default "") +-- global or local to window |global-local| +-- String to put at the start of lines that have been wrapped. Useful +-- values are "> " or "+++ ": > +-- :set showbreak=>\ +-- < Note the backslash to escape the trailing space. It's easier like +-- this: > +-- :let &showbreak = '+++ ' +-- < Only printable single-cell characters are allowed, excluding and +-- comma (in a future version the comma might be used to separate the +-- part that is shown at the end and at the start of a line). +-- The |hl-NonText| highlight group determines the highlighting. +-- Note that tabs after the showbreak will be displayed differently. +-- If you want the `'showbreak'` to appear in between line numbers, add the +-- "n" flag to `'cpoptions'` . +-- A window-local value overrules a global value. If the global value is +-- set and you want no value in the current window use NONE: > +-- :setlocal showbreak=NONE +-- < +vim.wo.showbreak = "" +vim.wo.sbr = vim.wo.showbreak +-- `'sidescrolloff'` `'siso'` number (default 0) +-- global or local to window |global-local| +-- The minimal number of screen columns to keep to the left and to the +-- right of the cursor if `'nowrap'` is set. Setting this option to a +-- value greater than 0 while having |`'sidescroll'` | also at a non-zero +-- value makes some context visible in the line you are scrolling in +-- horizontally (except at beginning of the line). Setting this option +-- to a large value (like 999) has the effect of keeping the cursor +-- horizontally centered in the window, as long as one does not come too +-- close to the beginning of the line. +-- After using the local value, go back the global value with one of +-- these two: > +-- setlocal sidescrolloff< +-- setlocal sidescrolloff=-1 +-- < +-- Example: Try this together with `'sidescroll'` and `'listchars'` as +-- in the following example to never allow the cursor to move +-- onto the "extends" character: > +-- +-- :set nowrap sidescroll=1 listchars=extends:>,precedes:< +-- :set sidescrolloff=1 +-- < +vim.wo.sidescrolloff = 0 +vim.wo.siso = vim.wo.sidescrolloff +-- `'signcolumn'` `'scl'` string (default "auto") +-- local to window +-- When and how to draw the signcolumn. Valid values are: +-- "auto" only when there is a sign to display +-- "auto:[1-9]" resize to accommodate multiple signs up to the +-- given number (maximum 9), e.g. "auto:4" +-- "auto:[1-8]-[2-9]" +-- resize to accommodate multiple signs up to the +-- given maximum number (maximum 9) while keeping +-- at least the given minimum (maximum 8) fixed +-- space. The minimum number should always be less +-- than the maximum number, e.g. "auto:2-5" +-- "no" never +-- "yes" always +-- "yes:[1-9]" always, with fixed space for signs up to the given +-- number (maximum 9), e.g. "yes:3" +-- "number" display signs in the `'number'` column. If the number +-- column is not present, then behaves like "auto". +-- +-- Note regarding "orphaned signs": with signcolumn numbers higher than +-- 1, deleting lines will also remove the associated signs automatically, +-- in contrast to the default Vim behavior of keeping and grouping them. +-- This is done in order for the signcolumn appearance not appear weird +-- during line deletion. +vim.wo.signcolumn = "auto" +vim.wo.scl = vim.wo.signcolumn +-- `'smoothscroll'` `'sms'` boolean (default off) +-- local to window +-- Scrolling works with screen lines. When `'wrap'` is set and the first +-- line in the window wraps part of it may not be visible, as if it is +-- above the window. "<<<" is displayed at the start of the first line, +-- 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. +vim.wo.smoothscroll = false +vim.wo.sms = vim.wo.smoothscroll +-- `'spell'` boolean (default off) +-- local to window +-- When on spell checking will be done. See |spell|. +-- The languages are specified with `'spelllang'` . +vim.wo.spell = false +-- `'statuscolumn'` `'stc'` string (default: empty) +-- local to window +-- EXPERIMENTAL +-- When non-empty, this option determines the content of the area to the +-- side of a window, normally containing the fold, sign and number columns. +-- The format of this option is like that of `'statusline'` . +-- +-- Some of the items from the `'statusline'` format are different for +-- `'statuscolumn'` : +-- +-- %l line number of currently drawn line +-- %r relative line number of currently drawn line +-- %s sign column for currently drawn line +-- %C fold column for currently drawn line +-- +-- NOTE: To draw the sign and fold columns, their items must be included in +-- `'statuscolumn'` . Even when they are not included, the status column width +-- will adapt to the `'signcolumn'` and `'foldcolumn'` width. +-- +-- The |v:lnum| variable holds the line number to be drawn. +-- The |v:relnum| variable holds the relative line number to be drawn. +-- The |v:virtnum| variable is negative when drawing virtual lines, zero +-- when drawing the actual buffer line, and positive when +-- drawing the wrapped part of a buffer line. +-- +-- NOTE: The %@ click execute function item is supported as well but the +-- specified function will be the same for each row in the same column. +-- It cannot be switched out through a dynamic `'statuscolumn'` format, the +-- handler should be written with this in mind. +-- +-- Examples: >vim +-- " Relative number with bar separator and click handlers: +-- :set statuscolumn=%@SignCb@%s%=%T%@NumCb@%r│%T +-- +-- " Right aligned relative cursor line number: +-- :let &stc='%=%{v:relnum?v:relnum:v:lnum} ' +-- +-- " Line numbers in hexadecimal for non wrapped part of lines: +-- :let &stc='%=%{v:virtnum>0?"":printf("%x",v:lnum)} ' +-- +-- " Human readable line numbers with thousands separator: +-- :let &stc=`'%{substitute(v:lnum,"\\d\\zs\\ze\\'` +-- . `'%(\\d\\d\\d\\)\\+$",",","g")}'` +-- +-- " Both relative and absolute line numbers with different +-- " highlighting for odd and even relative numbers: +-- :let &stc=`'%#NonText#%{&nu?v:lnum:""}'` . +-- '%=%{&rnu&&(v:lnum%2)?"\ ".v:relnum:""}' . +-- '%#LineNr#%{&rnu&&!(v:lnum%2)?"\ ".v:relnum:""}' +-- +-- < WARNING: this expression is evaluated for each screen line so defining +-- an expensive expression can negatively affect render performance. +vim.wo.statuscolumn = "" +vim.wo.stc = vim.wo.statuscolumn +-- `'statusline'` `'stl'` string (default empty) +-- global or local to window |global-local| +-- When non-empty, this option determines the content of the status line. +-- Also see |status-line|. +-- +-- The option consists of printf style `'%'` items interspersed with +-- normal text. Each status line item is of the form: +-- %-0{minwid}.{maxwid}{item} +-- All fields except the {item} are optional. A single percent sign can +-- be given as "%%". +-- +-- When the option starts with "%!" then it is used as an expression, +-- evaluated and the result is used as the option value. Example: > +-- :set statusline=%!MyStatusLine() +-- < The variable will be set to the |window-ID| of the +-- window that the status line belongs to. +-- The result can contain %{} items that will be evaluated too. +-- Note that the "%!" expression is evaluated in the context of the +-- current window and buffer, while %{} items are evaluated in the +-- context of the window that the statusline belongs to. +-- +-- When there is error while evaluating the option then it will be made +-- empty to avoid further errors. Otherwise screen updating would loop. +-- When the result contains unprintable characters the result is +-- unpredictable. +-- +-- Note that the only effect of `'ruler'` when this option is set (and +-- `'laststatus'` is 2 or 3) is controlling the output of |CTRL-G|. +-- +-- field meaning ~ +-- - Left justify the item. The default is right justified +-- when minwid is larger than the length of the item. +-- 0 Leading zeroes in numeric items. Overridden by "-". +-- minwid Minimum width of the item, padding as set by "-" & "0". +-- Value must be 50 or less. +-- maxwid Maximum width of the item. Truncation occurs with a "<" +-- on the left for text items. Numeric items will be +-- shifted down to maxwid-2 digits followed by ">"number +-- where number is the amount of missing digits, much like +-- an exponential notation. +-- item A one letter code as described below. +-- +-- Following is a description of the possible statusline items. The +-- second character in "item" is the type: +-- N for number +-- S for string +-- F for flags as described below +-- - not applicable +-- +-- item meaning ~ +-- f S Path to the file in the buffer, as typed or relative to current +-- directory. +-- F S Full path to the file in the buffer. +-- t S File name (tail) of file in the buffer. +-- m F Modified flag, text is "[+]"; "[-]" if `'modifiable'` is off. +-- M F Modified flag, text is ",+" or ",-". +-- r F Readonly flag, text is "[RO]". +-- R F Readonly flag, text is ",RO". +-- h F Help buffer flag, text is "[help]". +-- H F Help buffer flag, text is ",HLP". +-- w F Preview window flag, text is "[Preview]". +-- W F Preview window flag, text is ",PRV". +-- y F Type of file in the buffer, e.g., "[vim]". See `'filetype'` . +-- Y F Type of file in the buffer, e.g., ",VIM". See `'filetype'` . +-- q S "[Quickfix List]", "[Location List]" or empty. +-- k S Value of "b:keymap_name" or `'keymap'` when |:lmap| mappings are +-- being used: "" +-- n N Buffer number. +-- b N Value of character under cursor. +-- B N As above, in hexadecimal. +-- o N Byte number in file of byte under cursor, first byte is 1. +-- Mnemonic: Offset from start of file (with one added) +-- O N As above, in hexadecimal. +-- l N Line number. +-- L N Number of lines in buffer. +-- c N Column number (byte index). +-- v N Virtual column number (screen column). +-- V N Virtual column number as -{num}. Not displayed if equal to `'c'` . +-- p N Percentage through file in lines as in |CTRL-G|. +-- P S Percentage through file of displayed window. This is like the +-- percentage described for `'ruler'` . Always 3 in length, unless +-- translated. +-- S S `'showcmd'` content, see `'showcmdloc'` . +-- a S Argument list status as in default title. ({current} of {max}) +-- Empty if the argument file count is zero or one. +-- { NF Evaluate expression between "%{" and "}" and substitute result. +-- Note that there is no "%" before the closing "}". The +-- expression cannot contain a "}" character, call a function to +-- work around that. See |stl-%{| below. +-- `{%` - This is almost same as "{" except the result of the expression is +-- re-evaluated as a statusline format string. Thus if the +-- return value of expr contains "%" items they will get expanded. +-- The expression can contain the "}" character, the end of +-- expression is denoted by "%}". +-- For example: > +-- func! Stl_filename() abort +-- return "%t" +-- endfunc +-- < `stl=%{Stl_filename()}` results in `"%t"` +-- `stl=%{%Stl_filename()%}` results in `"Name of current file"` +-- %} - End of "{%" expression +-- ( - Start of item group. Can be used for setting the width and +-- alignment of a section. Must be followed by %) somewhere. +-- ) - End of item group. No width fields allowed. +-- T N For `'tabline'` : start of tab page N label. Use %T or %X to end +-- the label. Clicking this label with left mouse button switches +-- to the specified tab page. +-- X N For `'tabline'` : start of close tab N label. Use %X or %T to end +-- the label, e.g.: %3Xclose%X. Use %999X for a "close current +-- tab" label. Clicking this label with left mouse button closes +-- specified tab page. +-- @ N Start of execute function label. Use %X or %T to +-- end the label, e.g.: %10@SwitchBuffer@foo.c%X. Clicking this +-- label runs specified function: in the example when clicking once +-- using left mouse button on "foo.c" "SwitchBuffer(10, 1, `'l'` , +-- ' ')" expression will be run. Function receives the +-- following arguments in order: +-- 1. minwid field value or zero if no N was specified +-- 2. number of mouse clicks to detect multiple clicks +-- 3. mouse button used: "l", "r" or "m" for left, right or middle +-- button respectively; one should not rely on third argument +-- being only "l", "r" or "m": any other non-empty string value +-- that contains only ASCII lower case letters may be expected +-- for other mouse buttons +-- 4. modifiers pressed: string which contains "s" if shift +-- modifier was pressed, "c" for control, "a" for alt and "m" +-- for meta; currently if modifier is not pressed string +-- contains space instead, but one should not rely on presence +-- of spaces or specific order of modifiers: use |stridx()| to +-- test whether some modifier is present; string is guaranteed +-- to contain only ASCII letters and spaces, one letter per +-- modifier; "?" modifier may also be present, but its presence +-- is a bug that denotes that new mouse button recognition was +-- added without modifying code that reacts on mouse clicks on +-- this label. +-- Use |getmousepos()|.winid in the specified function to get the +-- corresponding window id of the clicked item. +-- < - Where to truncate line if too long. Default is at the start. +-- No width fields allowed. +-- = - Separation point between alignment sections. Each section will +-- be separated by an equal number of spaces. With one %= what +-- comes after it will be right-aligned. With two %= there is a +-- middle part, with white space left and right of it. +-- No width fields allowed. +-- # - Set highlight group. The name must follow and then a # again. +-- Thus use %#HLname# for highlight group HLname. The same +-- highlighting is used, also for the statusline of non-current +-- windows. +-- * - Set highlight group to User{N}, where {N} is taken from the +-- minwid field, e.g. %1*. Restore normal highlight with %* or %0*. +-- The difference between User{N} and StatusLine will be applied to +-- StatusLineNC for the statusline of non-current windows. +-- The number N must be between 1 and 9. See |hl-User1..9| +-- +-- When displaying a flag, Vim removes the leading comma, if any, when +-- that flag comes right after plaintext. This will make a nice display +-- when flags are used like in the examples below. +-- +-- When all items in a group becomes an empty string (i.e. flags that are +-- not set) and a minwid is not set for the group, the whole group will +-- become empty. This will make a group like the following disappear +-- completely from the statusline when none of the flags are set. > +-- :set statusline=...%(\ [%M%R%H]%)... +-- < Beware that an expression is evaluated each and every time the status +-- line is displayed. +-- +-- While evaluating %{} the current buffer and current window will be set +-- temporarily to that of the window (and buffer) whose statusline is +-- currently being drawn. The expression will evaluate in this context. +-- The variable "g:actual_curbuf" is set to the `bufnr()` number of the +-- real current buffer and "g:actual_curwin" to the |window-ID| of the +-- real current window. These values are strings. +-- +-- The `'statusline'` option will be evaluated in the |sandbox| if set from +-- a modeline, see |sandbox-option|. +-- This option cannot be set in a modeline when `'modelineexpr'` is off. +-- +-- It is not allowed to change text or jump to another window while +-- evaluating `'statusline'` |textlock|. +-- +-- If the statusline is not updated when you want it (e.g., after setting +-- a variable that's used in an expression), you can force an update by +-- using `:redrawstatus`. +-- +-- A result of all digits is regarded a number for display purposes. +-- Otherwise the result is taken as flag text and applied to the rules +-- described above. +-- +-- Watch out for errors in expressions. They may render Vim unusable! +-- If you are stuck, hold down `':'` or `'Q'` to get a prompt, then quit and +-- edit your vimrc or whatever with "vim --clean" to get it right. +-- +-- Examples: +-- Emulate standard status line with `'ruler'` set > +-- :set statusline=%<%f\ %h%m%r%=%-14.(%l,%c%V%)\ %P +-- < Similar, but add ASCII value of char under the cursor (like "ga") > +-- :set statusline=%<%f%h%m%r%=%b\ 0x%B\ \ %l,%c%V\ %P +-- < Display byte count and byte value, modified flag in red. > +-- :set statusline=%<%f%=\ [%1%n%R%H]\ %-19(%3l,%02c%03V%)%O`'%02b'` +-- :hi User1 term=inverse,bold cterm=inverse,bold ctermfg=red +-- < Display a ,GZ flag if a compressed file is loaded > +-- :set statusline=...%r%{VarExists(`'b:gzflag'` ,'\ [GZ]')}%h... +-- < In the |:autocmd|'s: > +-- :let b:gzflag = 1 +-- < And: > +-- :unlet b:gzflag +-- < And define this function: > +-- :function VarExists(var, val) +-- : if exists(a:var) | return a:val | else | return `''` | endif +-- :endfunction +-- < +vim.wo.statusline = "" +vim.wo.stl = vim.wo.statusline +-- `'virtualedit'` `'ve'` string (default "") +-- global or local to window |global-local| +-- A comma-separated list of these words: +-- block Allow virtual editing in Visual block mode. +-- insert Allow virtual editing in Insert mode. +-- all Allow virtual editing in all modes. +-- onemore Allow the cursor to move just past the end of the line +-- none When used as the local value, do not allow virtual +-- editing even when the global value is set. When used +-- as the global value, "none" is the same as "". +-- NONE Alternative spelling of "none". +-- +-- Virtual editing means that the cursor can be positioned where there is +-- no actual character. This can be halfway into a tab or beyond the end +-- of the line. Useful for selecting a rectangle in Visual mode and +-- editing a table. +-- "onemore" is not the same, it will only allow moving the cursor just +-- after the last character of the line. This makes some commands more +-- consistent. Previously the cursor was always past the end of the line +-- if the line was empty. But it is far from Vi compatible. It may also +-- break some plugins or Vim scripts. For example because |l| can move +-- the cursor after the last character. Use with care! +-- Using the `$` command will move to the last character in the line, not +-- past it. This may actually move the cursor to the left! +-- The `g$` command will move to the end of the screen line. +-- It doesn't make sense to combine "all" with "onemore", but you will +-- not get a warning for it. +-- When combined with other words, "none" is ignored. +vim.wo.virtualedit = "" +vim.wo.ve = vim.wo.virtualedit +-- `'winbar'` `'wbr'` string (default empty) +-- global or local to window |global-local| +-- When non-empty, this option enables the window bar and determines its +-- contents. The window bar is a bar that's shown at the top of every +-- window with it enabled. The value of `'winbar'` is evaluated like with +-- `'statusline'` . +-- +-- When changing something that is used in `'winbar'` that does not trigger +-- it to be updated, use |:redrawstatus|. +-- +-- Floating windows do not use the global value of `'winbar'` . The +-- window-local value of `'winbar'` must be set for a floating window to +-- have a window bar. +-- +-- This option cannot be set in a modeline when `'modelineexpr'` is off. +vim.wo.winbar = "" +vim.wo.wbr = vim.wo.winbar +-- `'winblend'` `'winbl'` number (default 0) +-- local to window +-- Enables pseudo-transparency for a floating window. Valid values are in +-- the range of 0 for fully opaque window (disabled) to 100 for fully +-- transparent background. Values between 0-30 are typically most useful. +-- +-- UI-dependent. Works best with RGB colors. `'termguicolors'` +vim.wo.winblend = 0 +vim.wo.winbl = vim.wo.winblend +-- `'winfixheight'` `'wfh'` boolean (default off) +-- local to window +-- 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|. +-- The height may be changed anyway when running out of room. +vim.wo.winfixheight = false +vim.wo.wfh = vim.wo.winfixheight +-- `'winfixwidth'` `'wfw'` boolean (default off) +-- local to window +-- Keep the window width when windows are opened or closed and +-- `'equalalways'` is set. Also for |CTRL-W_=|. +-- The width may be changed anyway when running out of room. +vim.wo.winfixwidth = false +vim.wo.wfw = vim.wo.winfixwidth +-- `'winhighlight'` `'winhl'` string (default empty) +-- local to window +-- Window-local highlights. Comma-delimited list of highlight +-- |group-name| pairs "{hl-from}:{hl-to},..." where each {hl-from} is +-- a |highlight-groups| item to be overridden by {hl-to} group in +-- the window. +-- +-- Note: highlight namespaces take precedence over `'winhighlight'` . +-- See |nvim_win_set_hl_ns()| and |nvim_set_hl()|. +-- +-- Highlights of vertical separators are determined by the window to the +-- left of the separator. The `'tabline'` highlight of a tabpage is +-- decided by the last-focused window of the tabpage. Highlights of +-- the popupmenu are determined by the current window. Highlights in the +-- message area cannot be overridden. +-- +-- Example: show a different color for non-current windows: > +-- set winhighlight=Normal:MyNormal,NormalNC:MyNormalNC +-- < +vim.wo.winhighlight = "" +vim.wo.winhl = vim.wo.winhighlight +-- `'wrap'` boolean (default on) +-- local to window +-- This option changes how text is displayed. It doesn't change the text +-- in the buffer, see `'textwidth'` for that. +-- When on, lines longer than the width of the window will wrap and +-- displaying continues on the next line. When off lines will not wrap +-- and only part of long lines will be displayed. When the cursor is +-- moved to a part that is not shown, the screen will scroll +-- horizontally. +-- The line will be broken in the middle of a word if necessary. See +-- `'linebreak'` to get the break at a word boundary. +-- To make scrolling horizontally a bit more useful, try this: > +-- :set sidescroll=5 +-- :set listchars+=precedes:<,extends:> +-- < See `'sidescroll'` , `'listchars'` and |wrap-off|. +-- This option can't be set from a |modeline| when the `'diff'` option is +-- on. +vim.wo.wrap = true + + +---@class vim.bo +vim.bo = {} + +-- `'autoindent'` `'ai'` boolean (default on) +-- local to buffer +-- Copy indent from current line when starting a new line (typing +-- in Insert mode or when using the "o" or "O" command). If you do not +-- type anything on the new line except or CTRL-D and then type +-- , CTRL-O or , the indent is deleted again. Moving the cursor +-- to another line has the same effect, unless the `'I'` flag is included +-- in `'cpoptions'` . +-- When autoindent is on, formatting (with the "gq" command or when you +-- reach `'textwidth'` in Insert mode) uses the indentation of the first +-- line. +-- When `'smartindent'` or `'cindent'` is on the indent is changed in +-- a different way. +-- {small difference from Vi: After the indent is deleted when typing +-- or , the cursor position when moving up or down is after the +-- deleted indent; Vi puts the cursor somewhere in the deleted indent}. +vim.bo.autoindent = true +vim.bo.ai = vim.bo.autoindent +-- `'autoread'` `'ar'` boolean (default on) +-- global or local to buffer |global-local| +-- When a file has been detected to have been changed outside of Vim and +-- it has not been changed inside of Vim, automatically read it again. +-- When the file has been deleted this is not done, so you have the text +-- from before it was deleted. When it appears again then it is read. +-- |timestamp| +-- If this option has a local value, use this command to switch back to +-- using the global value: > +-- :set autoread< +-- < +vim.bo.autoread = true +vim.bo.ar = vim.bo.autoread +-- `'backupcopy'` `'bkc'` string (default: "auto") +-- global or local to buffer |global-local| +-- When writing a file and a backup is made, this option tells how it's +-- done. This is a comma-separated list of words. +-- +-- The main values are: +-- "yes" make a copy of the file and overwrite the original one +-- "no" rename the file and write a new one +-- "auto" one of the previous, what works best +-- +-- Extra values that can be combined with the ones above are: +-- "breaksymlink" always break symlinks when writing +-- "breakhardlink" always break hardlinks when writing +-- +-- Making a copy and overwriting the original file: +-- - Takes extra time to copy the file. +-- + When the file has special attributes, is a (hard/symbolic) link or +-- has a resource fork, all this is preserved. +-- - When the file is a link the backup will have the name of the link, +-- not of the real file. +-- +-- Renaming the file and writing a new one: +-- + It's fast. +-- - Sometimes not all attributes of the file can be copied to the new +-- file. +-- - When the file is a link the new file will not be a link. +-- +-- The "auto" value is the middle way: When Vim sees that renaming the +-- file is possible without side effects (the attributes can be passed on +-- and the file is not a link) that is used. When problems are expected, +-- a copy will be made. +-- +-- The "breaksymlink" and "breakhardlink" values can be used in +-- combination with any of "yes", "no" and "auto". When included, they +-- force Vim to always break either symbolic or hard links by doing +-- exactly what the "no" option does, renaming the original file to +-- become the backup and writing a new file in its place. This can be +-- useful for example in source trees where all the files are symbolic or +-- hard links and any changes should stay in the local source tree, not +-- be propagated back to the original source. +-- +-- One situation where "no" and "auto" will cause problems: A program +-- that opens a file, invokes Vim to edit that file, and then tests if +-- the open file was changed (through the file descriptor) will check the +-- backup file instead of the newly created file. "crontab -e" is an +-- example. +-- +-- When a copy is made, the original file is truncated and then filled +-- with the new text. This means that protection bits, owner and +-- symbolic links of the original file are unmodified. The backup file, +-- however, is a new file, owned by the user who edited the file. The +-- group of the backup is set to the group of the original file. If this +-- fails, the protection bits for the group are made the same as for +-- others. +-- +-- When the file is renamed, this is the other way around: The backup has +-- the same attributes of the original file, and the newly written file +-- is owned by the current user. When the file was a (hard/symbolic) +-- link, the new file will not! That's why the "auto" value doesn't +-- rename when the file is a link. The owner and group of the newly +-- written file will be set to the same ones as the original file, but +-- the system may refuse to do this. In that case the "auto" value will +-- again not rename the file. +vim.bo.backupcopy = "auto" +vim.bo.bkc = vim.bo.backupcopy +-- `'binary'` `'bin'` boolean (default off) +-- local to buffer +-- This option should be set before editing a binary file. You can also +-- use the |-b| Vim argument. When this option is switched on a few +-- options will be changed (also when it already was on): +-- `'textwidth'` will be set to 0 +-- `'wrapmargin'` will be set to 0 +-- `'modeline'` will be off +-- `'expandtab'` will be off +-- Also, `'fileformat'` and `'fileformats'` options will not be used, the +-- file is read and written like `'fileformat'` was "unix" (a single +-- separates lines). +-- The `'fileencoding'` and `'fileencodings'` options will not be used, the +-- file is read without conversion. +-- NOTE: When you start editing a(nother) file while the `'bin'` option is +-- on, settings from autocommands may change the settings again (e.g., +-- `'textwidth'` ), causing trouble when editing. You might want to set +-- `'bin'` again when the file has been loaded. +-- The previous values of these options are remembered and restored when +-- `'bin'` is switched from on to off. Each buffer has its own set of +-- saved option values. +-- To edit a file with `'binary'` set you can use the |++bin| argument. +-- This avoids you have to do ":set bin", which would have effect for all +-- files you edit. +-- When writing a file the for the last line is only written if +-- there was one in the original file (normally Vim appends an to +-- the last line if there is none; this would make the file longer). See +-- the `'endofline'` option. +vim.bo.binary = false +vim.bo.bin = vim.bo.binary +-- `'bomb'` boolean (default off) +-- local to buffer +-- When writing a file and the following conditions are met, a BOM (Byte +-- Order Mark) is prepended to the file: +-- - this option is on +-- - the `'binary'` option is off +-- - `'fileencoding'` is "utf-8", "ucs-2", "ucs-4" or one of the little/big +-- endian variants. +-- Some applications use the BOM to recognize the encoding of the file. +-- Often used for UCS-2 files on MS-Windows. For other applications it +-- causes trouble, for example: "cat file1 file2" makes the BOM of file2 +-- appear halfway through the resulting file. Gcc doesn't accept a BOM. +-- When Vim reads a file and `'fileencodings'` starts with "ucs-bom", a +-- check for the presence of the BOM is done and `'bomb'` set accordingly. +-- Unless `'binary'` is set, it is removed from the first line, so that you +-- don't see it when editing. When you don't change the options, the BOM +-- will be restored when writing the file. +vim.bo.bomb = false +-- `'bufhidden'` `'bh'` string (default: "") +-- local to buffer +-- This option specifies what happens when a buffer is no longer +-- displayed in a window: +-- follow the global `'hidden'` option +-- hide hide the buffer (don't unload it), even if `'hidden'` is +-- not set +-- unload unload the buffer, even if `'hidden'` is set; the +-- |:hide| command will also unload the buffer +-- delete delete the buffer from the buffer list, even if +-- `'hidden'` is set; the |:hide| command will also delete +-- the buffer, making it behave like |:bdelete| +-- wipe wipe the buffer from the buffer list, even if +-- `'hidden'` is set; the |:hide| command will also wipe +-- out the buffer, making it behave like |:bwipeout| +-- +-- CAREFUL: when "unload", "delete" or "wipe" is used changes in a buffer +-- are lost without a warning. Also, these values may break autocommands +-- that switch between buffers temporarily. +-- This option is used together with `'buftype'` and `'swapfile'` to specify +-- special kinds of buffers. See |special-buffers|. +vim.bo.bufhidden = "" +vim.bo.bh = vim.bo.bufhidden +-- `'buflisted'` `'bl'` boolean (default: on) +-- local to buffer +-- When this option is set, the buffer shows up in the buffer list. If +-- it is reset it is not used for ":bnext", "ls", the Buffers menu, etc. +-- This option is reset by Vim for buffers that are only used to remember +-- a file name or marks. Vim sets it when starting to edit a buffer. +-- But not when moving to a buffer with ":buffer". +vim.bo.buflisted = true +vim.bo.bl = vim.bo.buflisted +-- `'buftype'` `'bt'` string (default: "") +-- local to buffer +-- The value of this option specifies the type of a buffer: +-- normal buffer +-- acwrite buffer will always be written with |BufWriteCmd|s +-- help help buffer (do not set this manually) +-- nofile buffer is not related to a file, will not be written +-- nowrite buffer will not be written +-- quickfix list of errors |:cwindow| or locations |:lwindow| +-- terminal |terminal-emulator| buffer +-- prompt buffer where only the last line can be edited, meant +-- to be used by a plugin, see |prompt-buffer| +-- +-- This option is used together with `'bufhidden'` and `'swapfile'` to +-- specify special kinds of buffers. See |special-buffers|. +-- Also see |win_gettype()|, which returns the type of the window. +-- +-- Be careful with changing this option, it can have many side effects! +-- One such effect is that Vim will not check the timestamp of the file, +-- if the file is changed by another program this will not be noticed. +-- +-- A "quickfix" buffer is only used for the error list and the location +-- list. This value is set by the |:cwindow| and |:lwindow| commands and +-- you are not supposed to change it. +-- +-- "nofile" and "nowrite" buffers are similar: +-- both: The buffer is not to be written to disk, ":w" doesn't +-- work (":w filename" does work though). +-- both: The buffer is never considered to be |`'modified'` |. +-- There is no warning when the changes will be lost, for +-- example when you quit Vim. +-- both: A swap file is only created when using too much memory +-- (when `'swapfile'` has been reset there is never a swap +-- file). +-- nofile only: The buffer name is fixed, it is not handled like a +-- file name. It is not modified in response to a |:cd| +-- command. +-- both: When using ":e bufname" and already editing "bufname" +-- the buffer is made empty and autocommands are +-- triggered as usual for |:edit|. +-- +-- "acwrite" implies that the buffer name is not related to a file, like +-- "nofile", but it will be written. Thus, in contrast to "nofile" and +-- "nowrite", ":w" does work and a modified buffer can't be abandoned +-- without saving. For writing there must be matching |BufWriteCmd|, +-- |FileWriteCmd| or |FileAppendCmd| autocommands. +vim.bo.buftype = "" +vim.bo.bt = vim.bo.buftype +-- `'channel'` number (default: 0) +-- local to buffer +-- |channel| connected to the buffer, or 0 if no channel is connected. +-- In a |:terminal| buffer this is the terminal channel. +-- Read-only. +vim.bo.channel = 0 +-- `'cindent'` `'cin'` boolean (default off) +-- local to buffer +-- Enables automatic C program indenting. See `'cinkeys'` to set the keys +-- that trigger reindenting in insert mode and `'cinoptions'` to set your +-- preferred indent style. +-- If `'indentexpr'` is not empty, it overrules `'cindent'` . +-- If `'lisp'` is not on and both `'indentexpr'` and `'equalprg'` are empty, +-- the "=" operator indents using this algorithm rather than calling an +-- external program. +-- See |C-indenting|. +-- When you don't like the way `'cindent'` works, try the `'smartindent'` +-- option or `'indentexpr'` . +vim.bo.cindent = false +vim.bo.cin = vim.bo.cindent +-- `'cinkeys'` `'cink'` string (default "0{,0},0),0],:,0#,!^F,o,O,e") +-- local to buffer +-- A list of keys that, when typed in Insert mode, cause reindenting of +-- the current line. Only used if `'cindent'` is on and `'indentexpr'` is +-- empty. +-- For the format of this option see |cinkeys-format|. +-- See |C-indenting|. +vim.bo.cinkeys = "0{,0},0),0],:,0#,!^F,o,O,e" +vim.bo.cink = vim.bo.cinkeys +-- `'cinoptions'` `'cino'` string (default "") +-- local to buffer +-- The `'cinoptions'` affect the way `'cindent'` reindents lines in a C +-- program. See |cinoptions-values| for the values of this option, and +-- |C-indenting| for info on C indenting in general. +vim.bo.cinoptions = "" +vim.bo.cino = vim.bo.cinoptions +-- `'cinscopedecls'` `'cinsd'` string (default "public,protected,private") +-- local to buffer +-- Keywords that are interpreted as a C++ scope declaration by |cino-g|. +-- Useful e.g. for working with the Qt framework that defines additional +-- scope declarations "signals", "public slots" and "private slots": > +-- set cinscopedecls+=signals,public\ slots,private\ slots +-- +-- < +vim.bo.cinscopedecls = "public,protected,private" +vim.bo.cinsd = vim.bo.cinscopedecls +-- `'cinwords'` `'cinw'` string (default "if,else,while,do,for,switch") +-- local to buffer +-- These keywords start an extra indent in the next line when +-- `'smartindent'` or `'cindent'` is set. For `'cindent'` this is only done at +-- an appropriate place (inside {}). +-- Note that `'ignorecase'` isn't used for `'cinwords'` . If case doesn't +-- matter, include the keyword both the uppercase and lowercase: +-- "if,If,IF". +vim.bo.cinwords = "if,else,while,do,for,switch" +vim.bo.cinw = vim.bo.cinwords +-- `'comments'` `'com'` string (default +-- "s1:/,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:-") +-- local to buffer +-- A comma-separated list of strings that can start a comment line. See +-- |format-comments|. See |option-backslash| about using backslashes to +-- insert a space. +vim.bo.comments = "s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:-" +vim.bo.com = vim.bo.comments +-- `'commentstring'` `'cms'` string (default "") +-- local to buffer +-- A template for a comment. The "%s" in the value is replaced with the +-- comment text. For example, C uses "//". Currently only used to +-- add markers for folding, see |fold-marker|. +vim.bo.commentstring = "" +vim.bo.cms = vim.bo.commentstring +-- `'complete'` `'cpt'` string (default: ".,w,b,u,t") +-- local to buffer +-- This option specifies how keyword completion |ins-completion| works +-- when CTRL-P or CTRL-N are used. It is also used for whole-line +-- completion |i_CTRL-X_CTRL-L|. It indicates the type of completion +-- and the places to scan. It is a comma-separated list of flags: +-- . scan the current buffer (`'wrapscan'` is ignored) +-- w scan buffers from other windows +-- b scan other loaded buffers that are in the buffer list +-- u scan the unloaded buffers that are in the buffer list +-- U scan the buffers that are not in the buffer list +-- k scan the files given with the `'dictionary'` option +-- kspell use the currently active spell checking |spell| +-- k{dict} scan the file {dict}. Several "k" flags can be given, +-- patterns are valid too. For example: > +-- :set cpt=k/usr/dict/*,k~/spanish +-- < s scan the files given with the `'thesaurus'` option +-- s{tsr} scan the file {tsr}. Several "s" flags can be given, patterns +-- are valid too. +-- i scan current and included files +-- d scan current and included files for defined name or macro +-- |i_CTRL-X_CTRL-D| +-- ] tag completion +-- t same as "]" +-- +-- Unloaded buffers are not loaded, thus their autocmds |:autocmd| are +-- not executed, this may lead to unexpected completions from some files +-- (gzipped files for example). Unloaded buffers are not scanned for +-- whole-line completion. +-- +-- As you can see, CTRL-N and CTRL-P can be used to do any `'iskeyword'` - +-- based expansion (e.g., dictionary |i_CTRL-X_CTRL-K|, included patterns +-- |i_CTRL-X_CTRL-I|, tags |i_CTRL-X_CTRL-]| and normal expansions). +vim.bo.complete = ".,w,b,u,t" +vim.bo.cpt = vim.bo.complete +-- `'completefunc'` `'cfu'` string (default: empty) +-- local to buffer +-- This option specifies a function to be used for Insert mode completion +-- with CTRL-X CTRL-U. |i_CTRL-X_CTRL-U| +-- See |complete-functions| for an explanation of how the function is +-- invoked and what it should return. The value can be the name of a +-- function, a |lambda| or a |Funcref|. See |option-value-function| for +-- more information. +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +vim.bo.completefunc = "" +vim.bo.cfu = vim.bo.completefunc +-- `'copyindent'` `'ci'` boolean (default off) +-- local to buffer +-- Copy the structure of the existing lines indent when autoindenting a +-- new line. Normally the new indent is reconstructed by a series of +-- tabs followed by spaces as required (unless |`'expandtab'` | is enabled, +-- in which case only spaces are used). Enabling this option makes the +-- new line copy whatever characters were used for indenting on the +-- existing line. `'expandtab'` has no effect on these characters, a Tab +-- remains a Tab. If the new indent is greater than on the existing +-- line, the remaining space is filled in the normal manner. +-- See `'preserveindent'` . +vim.bo.copyindent = false +vim.bo.ci = vim.bo.copyindent +-- `'define'` `'def'` string (default "") +-- global or local to buffer |global-local| +-- Pattern to be used to find a macro definition. It is a search +-- pattern, just like for the "/" command. This option is used for the +-- commands like "[i" and "[d" |include-search|. The `'isident'` option is +-- used to recognize the defined name after the match: +-- {match with `'define'` }{non-ID chars}{defined name}{non-ID char} +-- See |option-backslash| about inserting backslashes to include a space +-- or backslash. +-- For C++ this value would be useful, to include const type declarations: > +-- ^\(#\s\s[a-z]*\) +-- < You can also use "\ze" just before the name and continue the pattern +-- to check what is following. E.g. for Javascript, if a function is +-- defined with `func_name = function(args)`: > +-- ^\s=\s*function( +-- < If the function is defined with `func_name : function() {...`: > +-- ^\s[:]\sfunction\s*( +-- < When using the ":set" command, you need to double the backslashes! +-- To avoid that use `:let` with a single quote string: > +-- let &l:define = `'^\s=\s*function('` +-- < +vim.bo.define = "" +vim.bo.def = vim.bo.define +-- `'dictionary'` `'dict'` string (default "") +-- global or local to buffer |global-local| +-- List of file names, separated by commas, that are used to lookup words +-- for keyword completion commands |i_CTRL-X_CTRL-K|. Each file should +-- contain a list of words. This can be one word per line, or several +-- words per line, separated by non-keyword characters (white space is +-- preferred). Maximum line length is 510 bytes. +-- +-- When this option is empty or an entry "spell" is present, and spell +-- checking is enabled, words in the word lists for the currently active +-- `'spelllang'` are used. See |spell|. +-- +-- To include a comma in a file name precede it with a backslash. Spaces +-- after a comma are ignored, otherwise spaces are included in the file +-- name. See |option-backslash| about using backslashes. +-- This has nothing to do with the |Dictionary| variable type. +-- Where to find a list of words? +-- - BSD/macOS include the "/usr/share/dict/words" file. +-- - Try "apt install spell" to get the "/usr/share/dict/words" file on +-- apt-managed systems (Debian/Ubuntu). +-- The use of |:set+=| and |:set-=| is preferred when adding or removing +-- directories from the list. This avoids problems when a future version +-- uses another default. +-- Backticks cannot be used in this option for security reasons. +vim.bo.dictionary = "" +vim.bo.dict = vim.bo.dictionary +-- `'endoffile'` `'eof'` boolean (default off) +-- local to buffer +-- Indicates that a CTRL-Z character was found at the end of the file +-- when reading it. Normally only happens when `'fileformat'` is "dos". +-- When writing a file and this option is off and the `'binary'` option +-- is on, or `'fixeol'` option is off, no CTRL-Z will be written at the +-- end of the file. +-- See |eol-and-eof| for example settings. +vim.bo.endoffile = false +vim.bo.eof = vim.bo.endoffile +-- `'endofline'` `'eol'` boolean (default on) +-- local to buffer +-- When writing a file and this option is off and the `'binary'` option +-- is on, or `'fixeol'` option is off, no will be written for the +-- last line in the file. This option is automatically set or reset when +-- starting to edit a new file, depending on whether file has an +-- for the last line in the file. Normally you don't have to set or +-- reset this option. +-- When `'binary'` is off and `'fixeol'` is on the value is not used when +-- writing the file. When `'binary'` is on or `'fixeol'` is off it is used +-- to remember the presence of a for the last line in the file, so +-- that when you write the file the situation from the original file can +-- be kept. But you can change it if you want to. +-- See |eol-and-eof| for example settings. +vim.bo.endofline = true +vim.bo.eol = vim.bo.endofline +-- `'equalprg'` `'ep'` string (default "") +-- global or local to buffer |global-local| +-- External program to use for "=" command. When this option is empty +-- the internal formatting functions are used; either `'lisp'` , `'cindent'` +-- or `'indentexpr'` . +-- Environment variables are expanded |:set_env|. See |option-backslash| +-- about including spaces and backslashes. +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +vim.bo.equalprg = "" +vim.bo.ep = vim.bo.equalprg +-- `'errorformat'` `'efm'` string (default is very long) +-- global or local to buffer |global-local| +-- Scanf-like description of the format for the lines in the error file +-- (see |errorformat|). +vim.bo.errorformat = "%*[^\"]\"%f\"%*\\D%l: %m,\"%f\"%*\\D%l: %m,%-Gg%\\?make[%*\\d]: *** [%f:%l:%m,%-Gg%\\?make: *** [%f:%l:%m,%-G%f:%l: (Each undeclared identifier is reported only once,%-G%f:%l: for each function it appears in.),%-GIn file included from %f:%l:%c:,%-GIn file included from %f:%l:%c\\,,%-GIn file included from %f:%l:%c,%-GIn file included from %f:%l,%-G%*[ ]from %f:%l:%c,%-G%*[ ]from %f:%l:,%-G%*[ ]from %f:%l\\,,%-G%*[ ]from %f:%l,%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,\"%f\"\\, line %l%*\\D%c%*[^ ] %m,%D%*\\a[%*\\d]: Entering directory %*[`']%f',%X%*\\a[%*\\d]: Leaving directory %*[`']%f',%D%*\\a: Entering directory %*[`']%f',%X%*\\a: Leaving directory %*[`']%f',%DMaking %*\\a in %f,%f|%l| %m" +vim.bo.efm = vim.bo.errorformat +-- `'expandtab'` `'et'` boolean (default off) +-- local to buffer +-- In Insert mode: Use the appropriate number of spaces to insert a +-- . Spaces are used in indents with the `'>'` and `'<'` commands and +-- when `'autoindent'` is on. To insert a real tab when `'expandtab'` is +-- on, use CTRL-V. See also |:retab| and |ins-expandtab|. +vim.bo.expandtab = false +vim.bo.et = vim.bo.expandtab +-- `'fileencoding'` `'fenc'` string (default: "") +-- local to buffer +-- File-content encoding for the current buffer. Conversion is done with +-- iconv() or as specified with `'charconvert'` . +-- +-- When `'fileencoding'` is not UTF-8, conversion will be done when +-- writing the file. For reading see below. +-- When `'fileencoding'` is empty, the file will be saved with UTF-8 +-- encoding (no conversion when reading or writing a file). +-- +-- WARNING: Conversion to a non-Unicode encoding can cause loss of +-- information! +-- +-- See |encoding-names| for the possible values. Additionally, values may be +-- specified that can be handled by the converter, see +-- |mbyte-conversion|. +-- +-- When reading a file `'fileencoding'` will be set from `'fileencodings'` . +-- To read a file in a certain encoding it won't work by setting +-- `'fileencoding'` , use the |++enc| argument. One exception: when +-- `'fileencodings'` is empty the value of `'fileencoding'` is used. +-- For a new file the global value of `'fileencoding'` is used. +-- +-- Prepending "8bit-" and "2byte-" has no meaning here, they are ignored. +-- When the option is set, the value is converted to lowercase. Thus +-- you can set it with uppercase values too. `'_'` characters are +-- replaced with `'-'` . If a name is recognized from the list at +-- |encoding-names|, it is replaced by the standard name. For example +-- "ISO8859-2" becomes "iso-8859-2". +-- +-- When this option is set, after starting to edit a file, the `'modified'` +-- option is set, because the file would be different when written. +-- +-- Keep in mind that changing `'fenc'` from a modeline happens +-- AFTER the text has been read, thus it applies to when the file will be +-- written. If you do set `'fenc'` in a modeline, you might want to set +-- `'nomodified'` to avoid not being able to ":q". +-- +-- This option cannot be changed when `'modifiable'` is off. +vim.bo.fileencoding = "" +vim.bo.fenc = vim.bo.fileencoding +-- `'fileformat'` `'ff'` string (Windows default: "dos", +-- Unix default: "unix") +-- local to buffer +-- This gives the of the current buffer, which is used for +-- reading/writing the buffer from/to a file: +-- dos +-- unix +-- mac +-- When "dos" is used, CTRL-Z at the end of a file is ignored. +-- See |file-formats| and |file-read|. +-- For the character encoding of the file see `'fileencoding'` . +-- When `'binary'` is set, the value of `'fileformat'` is ignored, file I/O +-- works like it was set to "unix". +-- This option is set automatically when starting to edit a file and +-- `'fileformats'` is not empty and `'binary'` is off. +-- When this option is set, after starting to edit a file, the `'modified'` +-- option is set, because the file would be different when written. +-- This option cannot be changed when `'modifiable'` is off. +vim.bo.fileformat = "unix" +vim.bo.ff = vim.bo.fileformat +-- `'filetype'` `'ft'` string (default: "") +-- local to buffer +-- When this option is set, the FileType autocommand event is triggered. +-- All autocommands that match with the value of this option will be +-- executed. Thus the value of `'filetype'` is used in place of the file +-- name. +-- Otherwise this option does not always reflect the current file type. +-- This option is normally set when the file type is detected. To enable +-- this use the ":filetype on" command. |:filetype| +-- Setting this option to a different value is most useful in a modeline, +-- for a file for which the file type is not automatically recognized. +-- Example, for in an IDL file: > +-- /* vim: set filetype=idl : */ +-- < |FileType| |filetypes| +-- When a dot appears in the value then this separates two filetype +-- names. Example: > +-- /* vim: set filetype=c.doxygen : */ +-- < This will use the "c" filetype first, then the "doxygen" filetype. +-- This works both for filetype plugins and for syntax files. More than +-- one dot may appear. +-- This option is not copied to another buffer, independent of the `'s'` or +-- `'S'` flag in `'cpoptions'` . +-- Only normal file name characters can be used, "/\*?[|<>" are illegal. +vim.bo.filetype = "" +vim.bo.ft = vim.bo.filetype +-- `'fixendofline'` `'fixeol'` boolean (default on) +-- local to buffer +-- When writing a file and this option is on, at the end of file +-- will be restored if missing. Turn this option off if you want to +-- preserve the situation from the original file. +-- When the `'binary'` option is set the value of this option doesn't +-- matter. +-- See the `'endofline'` option. +-- See |eol-and-eof| for example settings. +vim.bo.fixendofline = true +vim.bo.fixeol = vim.bo.fixendofline +-- `'formatexpr'` `'fex'` string (default "") +-- local to buffer +-- Expression which is evaluated to format a range of lines for the |gq| +-- operator or automatic formatting (see `'formatoptions'` ). When this +-- option is empty `'formatprg'` is used. +-- +-- The |v:lnum| variable holds the first line to be formatted. +-- The |v:count| variable holds the number of lines to be formatted. +-- The |v:char| variable holds the character that is going to be +-- inserted if the expression is being evaluated due to +-- automatic formatting. This can be empty. Don't insert +-- it yet! +-- +-- Example: > +-- :set formatexpr=mylang#Format() +-- < This will invoke the mylang#Format() function in the +-- autoload/mylang.vim file in `'runtimepath'` . |autoload| +-- +-- The expression is also evaluated when `'textwidth'` is set and adding +-- text beyond that limit. This happens under the same conditions as +-- when internal formatting is used. Make sure the cursor is kept in the +-- same spot relative to the text then! The |mode()| function will +-- return "i" or "R" in this situation. +-- +-- When the expression evaluates to non-zero Vim will fall back to using +-- the internal format mechanism. +-- +-- If the expression starts with s: or ||, then it is replaced with +-- the script ID (|local-function|). Example: > +-- set formatexpr=s:MyFormatExpr() +-- set formatexpr=SomeFormatExpr() +-- < Otherwise, the expression is evaluated in the context of the script +-- where the option was set, thus script-local items are available. +-- +-- The expression will be evaluated in the |sandbox| when set from a +-- modeline, see |sandbox-option|. That stops the option from working, +-- since changing the buffer text is not allowed. +-- This option cannot be set in a modeline when `'modelineexpr'` is off. +-- NOTE: This option is set to "" when `'compatible'` is set. +vim.bo.formatexpr = "" +vim.bo.fex = vim.bo.formatexpr +-- `'formatlistpat'` `'flp'` string (default: "^\s*\d\+[\]:.)}\t ]\s*") +-- local to buffer +-- A pattern that is used to recognize a list header. This is used for +-- the "n" flag in `'formatoptions'` . +-- The pattern must match exactly the text that will be the indent for +-- the line below it. You can use |/\ze| to mark the end of the match +-- while still checking more characters. There must be a character +-- following the pattern, when it matches the whole line it is handled +-- like there is no match. +-- The default recognizes a number, followed by an optional punctuation +-- character and white space. +vim.bo.formatlistpat = "^\\s*\\d\\+[\\]:.)}\\t ]\\s*" +vim.bo.flp = vim.bo.formatlistpat +-- `'formatoptions'` `'fo'` string (default: "tcqj") +-- local to buffer +-- This is a sequence of letters which describes how automatic +-- formatting is to be done. See |fo-table|. Commas can be inserted for +-- readability. +-- To avoid problems with flags that are added in the future, use the +-- "+=" and "-=" feature of ":set" |add-option-flags|. +vim.bo.formatoptions = "tcqj" +vim.bo.fo = vim.bo.formatoptions +-- `'formatprg'` `'fp'` string (default "") +-- global or local to buffer |global-local| +-- The name of an external program that will be used to format the lines +-- selected with the |gq| operator. The program must take the input on +-- stdin and produce the output on stdout. The Unix program "fmt" is +-- such a program. +-- If the `'formatexpr'` option is not empty it will be used instead. +-- Otherwise, if `'formatprg'` option is an empty string, the internal +-- format function will be used |C-indenting|. +-- Environment variables are expanded |:set_env|. See |option-backslash| +-- about including spaces and backslashes. +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +vim.bo.formatprg = "" +vim.bo.fp = vim.bo.formatprg +-- `'grepprg'` `'gp'` string (default "grep -n ", +-- Unix: "grep -n $* /dev/null") +-- global or local to buffer |global-local| +-- Program to use for the |:grep| command. This option may contain `'%'` +-- and `'#'` characters, which are expanded like when used in a command- +-- 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: > +-- :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|. +-- See also the section |:make_makeprg|, since most of the comments there +-- apply equally to `'grepprg'` . +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +vim.bo.grepprg = "grep -n $* /dev/null" +vim.bo.gp = vim.bo.grepprg +-- `'iminsert'` `'imi'` number (default 0) +-- local to buffer +-- Specifies whether :lmap or an Input Method (IM) is to be used in +-- Insert mode. Valid values: +-- 0 :lmap is off and IM is off +-- 1 :lmap is ON and IM is off +-- 2 :lmap is off and IM is ON +-- To always reset the option to zero when leaving Insert mode with +-- this can be used: > +-- :inoremap :set iminsert=0 +-- < This makes :lmap and IM turn off automatically when leaving Insert +-- mode. +-- Note that this option changes when using CTRL-^ in Insert mode +-- |i_CTRL-^|. +-- The value is set to 1 when setting `'keymap'` to a valid keymap name. +-- It is also used for the argument of commands like "r" and "f". +vim.bo.iminsert = 0 +vim.bo.imi = vim.bo.iminsert +-- `'imsearch'` `'ims'` number (default -1) +-- local to buffer +-- Specifies whether :lmap or an Input Method (IM) is to be used when +-- entering a search pattern. Valid values: +-- -1 the value of `'iminsert'` is used, makes it look like +-- `'iminsert'` is also used when typing a search pattern +-- 0 :lmap is off and IM is off +-- 1 :lmap is ON and IM is off +-- 2 :lmap is off and IM is ON +-- Note that this option changes when using CTRL-^ in Command-line mode +-- |c_CTRL-^|. +-- The value is set to 1 when it is not -1 and setting the `'keymap'` +-- option to a valid keymap name. +vim.bo.imsearch = -1 +vim.bo.ims = vim.bo.imsearch +-- `'include'` `'inc'` string (default "") +-- global or local to buffer |global-local| +-- Pattern to be used to find an include command. It is a search +-- pattern, just like for the "/" command (See |pattern|). This option +-- is used for the commands "[i", "]I", "[d", etc. +-- Normally the `'isfname'` option is used to recognize the file name that +-- comes after the matched pattern. But if "\zs" appears in the pattern +-- then the text matched from "\zs" to the end, or until "\ze" if it +-- appears, is used as the file name. Use this to include characters +-- that are not in `'isfname'` , such as a space. You can then use +-- `'includeexpr'` to process the matched text. +-- See |option-backslash| about including spaces and backslashes. +vim.bo.include = "" +vim.bo.inc = vim.bo.include +-- `'includeexpr'` `'inex'` string (default "") +-- local to buffer +-- Expression to be used to transform the string found with the `'include'` +-- option to a file name. Mostly useful to change "." to "/" for Java: > +-- :setlocal includeexpr=substitute(v:fname,`'\\.'` ,`'/'` ,`'g'` ) +-- < The "v:fname" variable will be set to the file name that was detected. +-- Note the double backslash: the `:set` command first halves them, then +-- one remains in the value, where "\." matches a dot literally. For +-- simple character replacements `tr()` avoids the need for escaping: > +-- :setlocal includeexpr=tr(v:fname,`'.'` ,`'/'` ) +-- < +-- Also used for the |gf| command if an unmodified file name can't be +-- found. Allows doing "gf" on the name after an `'include'` statement. +-- Also used for ||. +-- +-- If the expression starts with s: or ||, then it is replaced with +-- the script ID (|local-function|). Example: > +-- setlocal includeexpr=s:MyIncludeExpr(v:fname) +-- setlocal includeexpr=SomeIncludeExpr(v:fname) +-- < Otherwise, the expression is evaluated in the context of the script +-- where the option was set, thus script-local items are available. +-- +-- The expression will be evaluated in the |sandbox| when set from a +-- modeline, see |sandbox-option|. +-- This option cannot be set in a modeline when `'modelineexpr'` is off. +-- +-- It is not allowed to change text or jump to another window while +-- evaluating `'includeexpr'` |textlock|. +vim.bo.includeexpr = "" +vim.bo.inex = vim.bo.includeexpr +-- `'indentexpr'` `'inde'` string (default "") +-- local to buffer +-- Expression which is evaluated to obtain the proper indent for a line. +-- It is used when a new line is created, for the |=| operator and +-- in Insert mode as specified with the `'indentkeys'` option. +-- When this option is not empty, it overrules the `'cindent'` and +-- `'smartindent'` indenting. When `'lisp'` is set, this option is +-- is only used when `'lispoptions'` contains "expr:1". +-- The expression is evaluated with |v:lnum| set to the line number for +-- which the indent is to be computed. The cursor is also in this line +-- when the expression is evaluated (but it may be moved around). +-- +-- If the expression starts with s: or ||, then it is replaced with +-- the script ID (|local-function|). Example: > +-- set indentexpr=s:MyIndentExpr() +-- set indentexpr=SomeIndentExpr() +-- < Otherwise, the expression is evaluated in the context of the script +-- where the option was set, thus script-local items are available. +-- +-- The expression must return the number of spaces worth of indent. It +-- can return "-1" to keep the current indent (this means `'autoindent'` is +-- used for the indent). +-- Functions useful for computing the indent are |indent()|, |cindent()| +-- and |lispindent()|. +-- The evaluation of the expression must not have side effects! It must +-- not change the text, jump to another window, etc. Afterwards the +-- cursor position is always restored, thus the cursor may be moved. +-- Normally this option would be set to call a function: > +-- :set indentexpr=GetMyIndent() +-- < Error messages will be suppressed, unless the `'debug'` option contains +-- "msg". +-- See |indent-expression|. +-- +-- The expression will be evaluated in the |sandbox| when set from a +-- modeline, see |sandbox-option|. +-- This option cannot be set in a modeline when `'modelineexpr'` is off. +-- +-- It is not allowed to change text or jump to another window while +-- evaluating `'indentexpr'` |textlock|. +vim.bo.indentexpr = "" +vim.bo.inde = vim.bo.indentexpr +-- `'indentkeys'` `'indk'` string (default "0{,0},0),0],:,0#,!^F,o,O,e") +-- local to buffer +-- A list of keys that, when typed in Insert mode, cause reindenting of +-- the current line. Only happens if `'indentexpr'` isn't empty. +-- The format is identical to `'cinkeys'` , see |indentkeys-format|. +-- See |C-indenting| and |indent-expression|. +vim.bo.indentkeys = "0{,0},0),0],:,0#,!^F,o,O,e" +vim.bo.indk = vim.bo.indentkeys +-- `'infercase'` `'inf'` boolean (default off) +-- local to buffer +-- When doing keyword completion in insert mode |ins-completion|, and +-- `'ignorecase'` is also on, the case of the match is adjusted depending +-- on the typed text. If the typed text contains a lowercase letter +-- where the match has an upper case letter, the completed part is made +-- lowercase. If the typed text has no lowercase letters and the match +-- has a lowercase letter where the typed text has an uppercase letter, +-- and there is a letter before it, the completed part is made uppercase. +-- With `'noinfercase'` the match is used as-is. +vim.bo.infercase = false +vim.bo.inf = vim.bo.infercase +-- `'iskeyword'` `'isk'` string (default: @,48-57,_,192-255) +-- local to buffer +-- Keywords are used in searching and recognizing with many commands: +-- "w", "*", "[i", etc. It is also used for "\k" in a |pattern|. See +-- `'isfname'` for a description of the format of this option. For `'@'` +-- characters above 255 check the "word" character class (any character +-- that is not white space or punctuation). +-- For C programs you could use "a-z,A-Z,48-57,_,.,-,>". +-- For a help file it is set to all non-blank printable characters except +-- "*", `'"'` and `'|'` (so that CTRL-] on a command finds the help for that +-- command). +-- When the `'lisp'` option is on the `'-'` character is always included. +-- This option also influences syntax highlighting, unless the syntax +-- uses |:syn-iskeyword|. +vim.bo.iskeyword = "@,48-57,_,192-255" +vim.bo.isk = vim.bo.iskeyword +-- `'keymap'` `'kmp'` string (default "") +-- local to buffer +-- Name of a keyboard mapping. See |mbyte-keymap|. +-- Setting this option to a valid keymap name has the side effect of +-- setting `'iminsert'` to one, so that the keymap becomes effective. +-- `'imsearch'` is also set to one, unless it was -1 +-- Only normal file name characters can be used, "/\*?[|<>" are illegal. +vim.bo.keymap = "" +vim.bo.kmp = vim.bo.keymap +-- `'keywordprg'` `'kp'` string (default ":Man", Windows: ":help") +-- global or local to buffer |global-local| +-- Program to use for the |K| command. Environment variables are +-- expanded |:set_env|. ":help" may be used to access the Vim internal +-- help. (Note that previously setting the global option to the empty +-- value did this, which is now deprecated.) +-- When the first character is ":", the command is invoked as a Vim +-- Ex command prefixed with [count]. +-- When "man" or "man -s" is used, Vim will automatically translate +-- a [count] for the "K" command to a section number. +-- See |option-backslash| about including spaces and backslashes. +-- Example: > +-- :set keywordprg=man\ -s +-- :set keywordprg=:Man +-- < This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +vim.bo.keywordprg = ":Man" +vim.bo.kp = vim.bo.keywordprg +-- `'lisp'` boolean (default off) +-- local to buffer +-- Lisp mode: When is typed in insert mode set the indent for +-- the next line to Lisp standards (well, sort of). Also happens with +-- "cc" or "S". `'autoindent'` must also be on for this to work. The `'p'` +-- flag in `'cpoptions'` changes the method of indenting: Vi compatible or +-- better. Also see `'lispwords'` . +-- The `'-'` character is included in keyword characters. Redefines the +-- "=" operator to use this same indentation algorithm rather than +-- calling an external program if `'equalprg'` is empty. +vim.bo.lisp = false +-- `'lispoptions'` `'lop'` string (default "") +-- local to buffer +-- Comma-separated list of items that influence the Lisp indenting when +-- enabled with the |`'lisp'` | option. Currently only one item is +-- supported: +-- expr:1 use `'indentexpr'` for Lisp indenting when it is set +-- expr:0 do not use `'indentexpr'` for Lisp indenting (default) +-- Note that when using `'indentexpr'` the `=` operator indents all the +-- lines, otherwise the first line is not indented (Vi-compatible). +vim.bo.lispoptions = "" +vim.bo.lop = vim.bo.lispoptions +-- `'lispwords'` `'lw'` string (default is very long) +-- global or local to buffer |global-local| +-- Comma-separated list of words that influence the Lisp indenting when +-- enabled with the |`'lisp'` | option. +vim.bo.lispwords = "defun,define,defmacro,set!,lambda,if,case,let,flet,let*,letrec,do,do*,define-syntax,let-syntax,letrec-syntax,destructuring-bind,defpackage,defparameter,defstruct,deftype,defvar,do-all-symbols,do-external-symbols,do-symbols,dolist,dotimes,ecase,etypecase,eval-when,labels,macrolet,multiple-value-bind,multiple-value-call,multiple-value-prog1,multiple-value-setq,prog1,progv,typecase,unless,unwind-protect,when,with-input-from-string,with-open-file,with-open-stream,with-output-to-string,with-package-iterator,define-condition,handler-bind,handler-case,restart-bind,restart-case,with-simple-restart,store-value,use-value,muffle-warning,abort,continue,with-slots,with-slots*,with-accessors,with-accessors*,defclass,defmethod,print-unreadable-object" +vim.bo.lw = vim.bo.lispwords +-- `'makeencoding'` `'menc'` string (default "") +-- global or local to buffer |global-local| +-- Encoding used for reading the output of external commands. When empty, +-- encoding is not converted. +-- This is used for `:make`, `:lmake`, `:grep`, `:lgrep`, `:grepadd`, +-- `:lgrepadd`, `:cfile`, `:cgetfile`, `:caddfile`, `:lfile`, `:lgetfile`, +-- and `:laddfile`. +-- +-- This would be mostly useful when you use MS-Windows. If iconv is +-- enabled, setting `'makeencoding'` to "char" has the same effect as +-- setting to the system locale encoding. Example: > +-- :set makeencoding=char " system locale is used +-- < +vim.bo.makeencoding = "" +vim.bo.menc = vim.bo.makeencoding +-- `'makeprg'` `'mp'` string (default "make") +-- global or local to buffer |global-local| +-- Program to use for the ":make" command. See |:make_makeprg|. +-- This option may contain `'%'` and `'#'` characters (see |:_%| and |:_#|), +-- which are expanded to the current and alternate file name. Use |::S| +-- to escape file names in case they contain special characters. +-- Environment variables are expanded |:set_env|. See |option-backslash| +-- about including spaces and backslashes. +-- Note that a `'|'` must be escaped twice: once for ":set" and once for +-- the interpretation of a command. When you use a filter called +-- "myfilter" do it like this: > +-- :set makeprg=gmake\ \\\|\ myfilter +-- < The placeholder "$*" can be given (even multiple times) to specify +-- where the arguments will be included, for example: > +-- :set makeprg=latex\ \\\\nonstopmode\ \\\\input\\{$*} +-- < This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +vim.bo.makeprg = "make" +vim.bo.mp = vim.bo.makeprg +-- `'matchpairs'` `'mps'` string (default "(:),{:},[:]") +-- local to buffer +-- Characters that form pairs. The |%| command jumps from one to the +-- other. +-- Only character pairs are allowed that are different, thus you cannot +-- jump between two double quotes. +-- The characters must be separated by a colon. +-- The pairs must be separated by a comma. Example for including `'<'` and +-- `'>'` (for HTML): > +-- :set mps+=<:> +-- +-- < A more exotic example, to jump between the `'='` and `';'` in an +-- assignment, useful for languages like C and Java: > +-- :au FileType c,cpp,java set mps+==:; +-- +-- < For a more advanced way of using "%", see the matchit.vim plugin in +-- the $VIMRUNTIME/plugin directory. |add-local-help| +vim.bo.matchpairs = "(:),{:},[:]" +vim.bo.mps = vim.bo.matchpairs +-- `'modeline'` `'ml'` boolean (default: on (off for root)) +-- local to buffer +-- If `'modeline'` is on `'modelines'` gives the number of lines that is +-- checked for set commands. If `'modeline'` is off or `'modelines'` is zero +-- no lines are checked. See |modeline|. +vim.bo.modeline = true +vim.bo.ml = vim.bo.modeline +-- `'modifiable'` `'ma'` boolean (default on) +-- local to buffer +-- When off the buffer contents cannot be changed. The `'fileformat'` and +-- `'fileencoding'` options also can't be changed. +-- Can be reset on startup with the |-M| command line argument. +vim.bo.modifiable = true +vim.bo.ma = vim.bo.modifiable +-- `'modified'` `'mod'` boolean (default off) +-- local to buffer +-- When on, the buffer is considered to be modified. This option is set +-- when: +-- 1. A change was made to the text since it was last written. Using the +-- |undo| command to go back to the original text will reset the +-- option. But undoing changes that were made before writing the +-- buffer will set the option again, since the text is different from +-- when it was written. +-- 2. `'fileformat'` or `'fileencoding'` is different from its original +-- value. The original value is set when the buffer is read or +-- written. A ":set nomodified" command also resets the original +-- values to the current values and the `'modified'` option will be +-- reset. +-- Similarly for `'eol'` and `'bomb'` . +-- This option is not set when a change is made to the buffer as the +-- result of a BufNewFile, BufRead/BufReadPost, BufWritePost, +-- FileAppendPost or VimLeave autocommand event. See |gzip-example| for +-- an explanation. +-- When `'buftype'` is "nowrite" or "nofile" this option may be set, but +-- will be ignored. +-- Note that the text may actually be the same, e.g. `'modified'` is set +-- when using "rA" on an "A". +vim.bo.modified = false +vim.bo.mod = vim.bo.modified +-- `'nrformats'` `'nf'` string (default "bin,hex") +-- local to buffer +-- This defines what bases Vim will consider for numbers when using the +-- CTRL-A and CTRL-X commands for adding to and subtracting from a number +-- respectively; see |CTRL-A| for more info on these commands. +-- alpha If included, single alphabetical characters will be +-- incremented or decremented. This is useful for a list with a +-- letter index a), b), etc. +-- octal If included, numbers that start with a zero will be considered +-- to be octal. Example: Using CTRL-A on "007" results in "010". +-- hex If included, numbers starting with "0x" or "0X" will be +-- considered to be hexadecimal. Example: Using CTRL-X on +-- "0x100" results in "0x0ff". +-- bin If included, numbers starting with "0b" or "0B" will be +-- considered to be binary. Example: Using CTRL-X on +-- "0b1000" subtracts one, resulting in "0b0111". +-- unsigned If included, numbers are recognized as unsigned. Thus a +-- leading dash or negative sign won't be considered as part of +-- the number. Examples: +-- Using CTRL-X on "2020" in "9-2020" results in "9-2019" +-- (without "unsigned" it would become "9-2021"). +-- Using CTRL-A on "2020" in "9-2020" results in "9-2021" +-- (without "unsigned" it would become "9-2019"). +-- Using CTRL-X on "0" or CTRL-A on "18446744073709551615" +-- (2^64 - 1) has no effect, overflow is prevented. +-- Numbers which simply begin with a digit in the range 1-9 are always +-- considered decimal. This also happens for numbers that are not +-- recognized as octal or hex. +vim.bo.nrformats = "bin,hex" +vim.bo.nf = vim.bo.nrformats +-- `'omnifunc'` `'ofu'` string (default: empty) +-- local to buffer +-- This option specifies a function to be used for Insert mode omni +-- completion with CTRL-X CTRL-O. |i_CTRL-X_CTRL-O| +-- See |complete-functions| for an explanation of how the function is +-- invoked and what it should return. The value can be the name of a +-- function, a |lambda| or a |Funcref|. See |option-value-function| for +-- more information. +-- This option is usually set by a filetype plugin: +-- |:filetype-plugin-on| +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +vim.bo.omnifunc = "" +vim.bo.ofu = vim.bo.omnifunc +-- `'path'` `'pa'` string (default: ".,,") +-- global or local to buffer |global-local| +-- This is a list of directories which will be searched when using the +-- |gf|, [f, ]f, ^Wf, |:find|, |:sfind|, |:tabfind| and other commands, +-- provided that the file being searched for has a relative path (not +-- starting with "/", "./" or "../"). The directories in the `'path'` +-- option may be relative or absolute. +-- - Use commas to separate directory names: > +-- :set path=.,/usr/local/include,/usr/include +-- < - Spaces can also be used to separate directory names (for backwards +-- compatibility with version 3.0). To have a space in a directory +-- name, precede it with an extra backslash, and escape the space: > +-- :set path=.,/dir/with\\\ space +-- < - To include a comma in a directory name precede it with an extra +-- backslash: > +-- :set path=.,/dir/with\\,comma +-- < - To search relative to the directory of the current file, use: > +-- :set path=. +-- < - To search in the current directory use an empty string between two +-- commas: > +-- :set path=,, +-- < - A directory name may end in a `':'` or `'/'` . +-- - Environment variables are expanded |:set_env|. +-- - When using |netrw.vim| URLs can be used. For example, adding +-- "https://www.vim.org" will make ":find index.html" work. +-- - Search upwards and downwards in a directory tree using "*", "" and +-- ";". See |file-searching| for info and syntax. +-- - Careful with `'\'` characters, type two to get one in the option: > +-- :set path=.,c:\\include +-- < Or just use `'/'` instead: > +-- :set path=.,c:/include +-- < Don't forget "." or files won't even be found in the same directory as +-- the file! +-- The maximum length is limited. How much depends on the system, mostly +-- it is something like 256 or 1024 characters. +-- You can check if all the include files are found, using the value of +-- `'path'` , see |:checkpath|. +-- The use of |:set+=| and |:set-=| is preferred when adding or removing +-- directories from the list. This avoids problems when a future version +-- uses another default. To remove the current directory use: > +-- :set path-= +-- < To add the current directory use: > +-- :set path+= +-- < To use an environment variable, you probably need to replace the +-- separator. Here is an example to append $INCL, in which directory +-- names are separated with a semi-colon: > +-- :let &path = &path .. "," .. substitute($INCL, `';'` , `','` , `'g'` ) +-- < Replace the `';'` with a `':'` or whatever separator is used. Note that +-- this doesn't work when $INCL contains a comma or white space. +vim.bo.path = ".,," +vim.bo.pa = vim.bo.path +-- `'preserveindent'` `'pi'` boolean (default off) +-- local to buffer +-- When changing the indent of the current line, preserve as much of the +-- indent structure as possible. Normally the indent is replaced by a +-- series of tabs followed by spaces as required (unless |`'expandtab'` | is +-- enabled, in which case only spaces are used). Enabling this option +-- means the indent will preserve as many existing characters as possible +-- for indenting, and only add additional tabs or spaces as required. +-- `'expandtab'` does not apply to the preserved white space, a Tab remains +-- a Tab. +-- NOTE: When using ">>" multiple times the resulting indent is a mix of +-- tabs and spaces. You might not like this. +-- Also see `'copyindent'` . +-- Use |:retab| to clean up white space. +vim.bo.preserveindent = false +vim.bo.pi = vim.bo.preserveindent +-- `'quoteescape'` `'qe'` string (default "\") +-- local to buffer +-- The characters that are used to escape quotes in a string. Used for +-- objects like a', a" and a` |a'|. +-- When one of the characters in this option is found inside a string, +-- the following character will be skipped. The default value makes the +-- text "foo\"bar\\" considered to be one string. +vim.bo.quoteescape = "\\" +vim.bo.qe = vim.bo.quoteescape +-- `'readonly'` `'ro'` boolean (default off) +-- local to buffer +-- If on, writes fail unless you use a `'!'` . Protects you from +-- accidentally overwriting a file. Default on when Vim is started +-- in read-only mode ("vim -R") or when the executable is called "view". +-- When using ":w!" the `'readonly'` option is reset for the current +-- buffer, unless the `'Z'` flag is in `'cpoptions'` . +-- When using the ":view" command the `'readonly'` option is set for the +-- newly edited buffer. +-- See `'modifiable'` for disallowing changes to the buffer. +vim.bo.readonly = false +vim.bo.ro = vim.bo.readonly +-- `'scrollback'` `'scbk'` number (default: 10000) +-- local to buffer +-- Maximum number of lines kept beyond the visible screen. Lines at the +-- top are deleted if new lines exceed this limit. +-- 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. +vim.bo.scrollback = -1 +vim.bo.scbk = vim.bo.scrollback +-- `'shiftwidth'` `'sw'` number (default 8) +-- local to buffer +-- Number of spaces to use for each step of (auto)indent. Used for +-- |`'cindent'` |, |>>|, |<<|, etc. +-- When zero the `'tabstop'` value will be used. Use the |shiftwidth()| +-- function to get the effective shiftwidth value. +vim.bo.shiftwidth = 8 +vim.bo.sw = vim.bo.shiftwidth +-- `'smartindent'` `'si'` boolean (default off) +-- local to buffer +-- Do smart autoindenting when starting a new line. Works for C-like +-- programs, but can also be used for other languages. `'cindent'` does +-- something like this, works better in most cases, but is more strict, +-- see |C-indenting|. When `'cindent'` is on or `'indentexpr'` is set, +-- setting `'si'` has no effect. `'indentexpr'` is a more advanced +-- alternative. +-- Normally `'autoindent'` should also be on when using `'smartindent'` . +-- An indent is automatically inserted: +-- - After a line ending in "{". +-- - After a line starting with a keyword from `'cinwords'` . +-- - Before a line starting with "}" (only with the "O" command). +-- When typing `'}'` as the first character in a new line, that line is +-- given the same indent as the matching "{". +-- When typing `'#'` as the first character in a new line, the indent for +-- that line is removed, the `'#'` is put in the first column. The indent +-- is restored for the next line. If you don't want this, use this +-- mapping: ":inoremap # X^H#", where ^H is entered with CTRL-V CTRL-H. +-- When using the ">>" command, lines starting with `'#'` are not shifted +-- right. +vim.bo.smartindent = false +vim.bo.si = vim.bo.smartindent +-- `'softtabstop'` `'sts'` number (default 0) +-- local to buffer +-- Number of spaces that a counts for while performing editing +-- operations, like inserting a or using . It "feels" like +-- s are being inserted, while in fact a mix of spaces and s is +-- used. This is useful to keep the `'ts'` setting at its standard value +-- of 8, while being able to edit like it is set to `'sts'` . However, +-- commands like "x" still work on the actual characters. +-- When `'sts'` is zero, this feature is off. +-- When `'sts'` is negative, the value of `'shiftwidth'` is used. +-- See also |ins-expandtab|. When `'expandtab'` is not set, the number of +-- spaces is minimized by using s. +-- The `'L'` flag in `'cpoptions'` changes how tabs are used when `'list'` is +-- set. +-- +-- The value of `'softtabstop'` will be ignored if |`'varsofttabstop'` | is set +-- to anything other than an empty string. +vim.bo.softtabstop = 0 +vim.bo.sts = vim.bo.softtabstop +-- `'spellcapcheck'` `'spc'` string (default "[.?!]\_[\])'" \t]\+") +-- local to buffer +-- Pattern to locate the end of a sentence. The following word will be +-- checked to start with a capital letter. If not then it is highlighted +-- with SpellCap |hl-SpellCap| (unless the word is also badly spelled). +-- When this check is not wanted make this option empty. +-- Only used when `'spell'` is set. +-- Be careful with special characters, see |option-backslash| about +-- including spaces and backslashes. +-- To set this option automatically depending on the language, see +-- |set-spc-auto|. +vim.bo.spellcapcheck = "[.?!]\\_[\\])'\"\t ]\\+" +vim.bo.spc = vim.bo.spellcapcheck +-- `'spellfile'` `'spf'` string (default empty) +-- local to buffer +-- Name of the word list file where words are added for the |zg| and |zw| +-- commands. It must end in ".{encoding}.add". You need to include the +-- path, otherwise the file is placed in the current directory. +-- The path may include characters from `'isfname'` , space, comma and `'@'` . +-- +-- It may also be a comma-separated list of names. A count before the +-- |zg| and |zw| commands can be used to access each. This allows using +-- a personal word list file and a project word list file. +-- When a word is added while this option is empty Vim will set it for +-- you: Using the first directory in `'runtimepath'` that is writable. If +-- there is no "spell" directory yet it will be created. For the file +-- name the first language name that appears in `'spelllang'` is used, +-- ignoring the region. +-- The resulting ".spl" file will be used for spell checking, it does not +-- have to appear in `'spelllang'` . +-- Normally one file is used for all regions, but you can add the region +-- name if you want to. However, it will then only be used when +-- `'spellfile'` is set to it, for entries in `'spelllang'` only files +-- without region name will be found. +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +vim.bo.spellfile = "" +vim.bo.spf = vim.bo.spellfile +-- `'spelllang'` `'spl'` string (default "en") +-- local to buffer +-- A comma-separated list of word list names. When the `'spell'` option is +-- on spellchecking will be done for these languages. Example: > +-- set spelllang=en_us,nl,medical +-- < This means US English, Dutch and medical words are recognized. Words +-- that are not recognized will be highlighted. +-- The word list name must consist of alphanumeric characters, a dash or +-- an underscore. It should not include a comma or dot. Using a dash is +-- recommended to separate the two letter language name from a +-- specification. Thus "en-rare" is used for rare English words. +-- A region name must come last and have the form "_xx", where "xx" is +-- the two-letter, lower case region name. You can use more than one +-- region by listing them: "en_us,en_ca" supports both US and Canadian +-- English, but not words specific for Australia, New Zealand or Great +-- Britain. (Note: currently en_au and en_nz dictionaries are older than +-- en_ca, en_gb and en_us). +-- If the name "cjk" is included East Asian characters are excluded from +-- spell checking. This is useful when editing text that also has Asian +-- words. +-- Note that the "medical" dictionary does not exist, it is just an +-- example of a longer name. +-- +-- As a special case the name of a .spl file can be given as-is. The +-- first "_xx" in the name is removed and used as the region name +-- (_xx is an underscore, two letters and followed by a non-letter). +-- This is mainly for testing purposes. You must make sure the correct +-- encoding is used, Vim doesn't check it. +-- How the related spell files are found is explained here: |spell-load|. +-- +-- If the |spellfile.vim| plugin is active and you use a language name +-- for which Vim cannot find the .spl file in `'runtimepath'` the plugin +-- will ask you if you want to download the file. +-- +-- After this option has been set successfully, Vim will source the files +-- "spell/LANG.vim" in `'runtimepath'` . "LANG" is the value of `'spelllang'` +-- up to the first character that is not an ASCII letter or number and +-- not a dash. Also see |set-spc-auto|. +vim.bo.spelllang = "en" +vim.bo.spl = vim.bo.spelllang +-- `'spelloptions'` `'spo'` string (default "") +-- local to buffer +-- A comma-separated list of options for spell checking: +-- camel When a word is CamelCased, assume "Cased" is a +-- separate word: every upper-case character in a word +-- that comes after a lower case character indicates the +-- start of a new word. +-- noplainbuffer Only spellcheck a buffer when `'syntax'` is enabled, +-- or when extmarks are set within the buffer. Only +-- designated regions of the buffer are spellchecked in +-- this case. +vim.bo.spelloptions = "" +vim.bo.spo = vim.bo.spelloptions +-- `'suffixesadd'` `'sua'` string (default "") +-- local to buffer +-- Comma-separated list of suffixes, which are used when searching for a +-- file for the "gf", "[I", etc. commands. Example: > +-- :set suffixesadd=.java +-- < +vim.bo.suffixesadd = "" +vim.bo.sua = vim.bo.suffixesadd +-- `'swapfile'` `'swf'` boolean (default on) +-- local to buffer +-- Use a swapfile for the buffer. This option can be reset when a +-- swapfile is not wanted for a specific buffer. For example, with +-- confidential information that even root must not be able to access. +-- Careful: All text will be in memory: +-- - Don't use this for big files. +-- - Recovery will be impossible! +-- A swapfile will only be present when |`'updatecount'` | is non-zero and +-- `'swapfile'` is set. +-- When `'swapfile'` is reset, the swap file for the current buffer is +-- immediately deleted. When `'swapfile'` is set, and `'updatecount'` is +-- non-zero, a swap file is immediately created. +-- Also see |swap-file|. +-- If you want to open a new buffer without creating a swap file for it, +-- use the |:noswapfile| modifier. +-- See `'directory'` for where the swap file is created. +-- +-- This option is used together with `'bufhidden'` and `'buftype'` to +-- specify special kinds of buffers. See |special-buffers|. +vim.bo.swapfile = true +vim.bo.swf = vim.bo.swapfile +-- `'synmaxcol'` `'smc'` number (default 3000) +-- local to buffer +-- Maximum column in which to search for syntax items. In long lines the +-- text after this column is not highlighted and following lines may not +-- be highlighted correctly, because the syntax state is cleared. +-- This helps to avoid very slow redrawing for an XML file that is one +-- long line. +-- Set to zero to remove the limit. +vim.bo.synmaxcol = 3000 +vim.bo.smc = vim.bo.synmaxcol +-- `'syntax'` `'syn'` string (default empty) +-- local to buffer +-- When this option is set, the syntax with this name is loaded, unless +-- syntax highlighting has been switched off with ":syntax off". +-- Otherwise this option does not always reflect the current syntax (the +-- b:current_syntax variable does). +-- This option is most useful in a modeline, for a file which syntax is +-- not automatically recognized. Example, in an IDL file: > +-- /* vim: set syntax=idl : */ +-- < When a dot appears in the value then this separates two filetype +-- names. Example: > +-- /* vim: set syntax=c.doxygen : */ +-- < This will use the "c" syntax first, then the "doxygen" syntax. +-- Note that the second one must be prepared to be loaded as an addition, +-- otherwise it will be skipped. More than one dot may appear. +-- To switch off syntax highlighting for the current file, use: > +-- :set syntax=OFF +-- < To switch syntax highlighting on according to the current value of the +-- `'filetype'` option: > +-- :set syntax=ON +-- < What actually happens when setting the `'syntax'` option is that the +-- Syntax autocommand event is triggered with the value as argument. +-- This option is not copied to another buffer, independent of the `'s'` or +-- `'S'` flag in `'cpoptions'` . +-- Only normal file name characters can be used, "/\*?[|<>" are illegal. +vim.bo.syntax = "" +vim.bo.syn = vim.bo.syntax +-- `'tabstop'` `'ts'` number (default 8) +-- local to buffer +-- Number of spaces that a in the file counts for. Also see +-- the |:retab| command, and the `'softtabstop'` option. +-- +-- Note: Setting `'tabstop'` to any other value than 8 can make your file +-- 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: +-- 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 and will +-- behave like a tab appears every 4 (or 3) characters. +-- This is the recommended way, the file will look the same with other +-- tools and when listing it in a terminal. +-- 2. Set `'softtabstop'` and `'shiftwidth'` to whatever you prefer and use +-- `'expandtab'` . This way you will always insert spaces. The +-- formatting will never be messed up when `'tabstop'` is changed (leave +-- it at 8 just in case). The file will be a bit larger. +-- You do need to check if no Tabs exist in the file. You can get rid +-- of them by first setting `'expandtab'` and using `%retab!`, making +-- sure the value of `'tabstop'` is set correctly. +-- 3. Set `'tabstop'` and `'shiftwidth'` to whatever you prefer and use +-- `'expandtab'` . This way you will always insert spaces. The +-- formatting will never be messed up when `'tabstop'` is changed. +-- You do need to check if no Tabs exist in the file, just like in the +-- item just above. +-- 4. Set `'tabstop'` and `'shiftwidth'` to whatever you prefer and use a +-- |modeline| to set these values when editing the file again. Only +-- works when using Vim to edit the file, other tools assume a tabstop +-- is worth 8 spaces. +-- 5. Always set `'tabstop'` and `'shiftwidth'` to the same value, and +-- `'noexpandtab'` . This should then work (for initial indents only) +-- for any tabstop setting that people use. It might be nice to have +-- tabs after the first non-blank inserted as spaces if you do this +-- though. Otherwise aligned comments will be wrong when `'tabstop'` is +-- changed. +-- +-- The value of `'tabstop'` will be ignored if |`'vartabstop'` | is set to +-- anything other than an empty string. +vim.bo.tabstop = 8 +vim.bo.ts = vim.bo.tabstop +-- `'tagcase'` `'tc'` string (default "followic") +-- global or local to buffer |global-local| +-- This option specifies how case is handled when searching the tags +-- file: +-- followic Follow the `'ignorecase'` option +-- followscs Follow the `'smartcase'` and `'ignorecase'` options +-- ignore Ignore case +-- match Match case +-- smart Ignore case unless an upper case letter is used +vim.bo.tagcase = "followic" +vim.bo.tc = vim.bo.tagcase +-- `'tagfunc'` `'tfu'` string (default: empty) +-- local to buffer +-- This option specifies a function to be used to perform tag searches. +-- The function gets the tag pattern and should return a List of matching +-- tags. See |tag-function| for an explanation of how to write the +-- function and an example. The value can be the name of a function, a +-- |lambda| or a |Funcref|. See |option-value-function| for more +-- information. +vim.bo.tagfunc = "" +vim.bo.tfu = vim.bo.tagfunc +-- `'tags'` `'tag'` string (default "./tags;,tags") +-- global or local to buffer |global-local| +-- Filenames for the tag command, separated by spaces or commas. To +-- include a space or comma in a file name, precede it with a backslash +-- (see |option-backslash| about including spaces and backslashes). +-- When a file name starts with "./", the `'.'` is replaced with the path +-- of the current file. But only when the `'d'` flag is not included in +-- `'cpoptions'` . Environment variables are expanded |:set_env|. Also see +-- |tags-option|. +-- "*", "" and other wildcards can be used to search for tags files in +-- a directory tree. See |file-searching|. E.g., "/lib//tags" will +-- find all files named "tags" below "/lib". The filename itself cannot +-- contain wildcards, it is used as-is. E.g., "/lib//tags?" will find +-- files called "tags?". +-- The |tagfiles()| function can be used to get a list of the file names +-- actually used. +-- The use of |:set+=| and |:set-=| is preferred when adding or removing +-- file names from the list. This avoids problems when a future version +-- uses another default. +vim.bo.tags = "./tags;,tags" +vim.bo.tag = vim.bo.tags +-- `'textwidth'` `'tw'` number (default 0) +-- local to buffer +-- Maximum width of text that is being inserted. A longer line will be +-- broken after white space to get this width. A zero value disables +-- this. +-- When `'textwidth'` is zero, `'wrapmargin'` may be used. See also +-- `'formatoptions'` and |ins-textwidth|. +-- When `'formatexpr'` is set it will be used to break the line. +vim.bo.textwidth = 0 +vim.bo.tw = vim.bo.textwidth +-- `'thesaurus'` `'tsr'` string (default "") +-- global or local to buffer |global-local| +-- List of file names, separated by commas, that are used to lookup words +-- for thesaurus completion commands |i_CTRL-X_CTRL-T|. See +-- |compl-thesaurus|. +-- +-- This option is not used if `'thesaurusfunc'` is set, either for the +-- buffer or globally. +-- +-- To include a comma in a file name precede it with a backslash. Spaces +-- after a comma are ignored, otherwise spaces are included in the file +-- name. See |option-backslash| about using backslashes. The use of +-- |:set+=| and |:set-=| is preferred when adding or removing directories +-- from the list. This avoids problems when a future version uses +-- another default. Backticks cannot be used in this option for security +-- reasons. +vim.bo.thesaurus = "" +vim.bo.tsr = vim.bo.thesaurus +-- `'thesaurusfunc'` `'tsrfu'` string (default: empty) +-- global or local to buffer |global-local| +-- This option specifies a function to be used for thesaurus completion +-- with CTRL-X CTRL-T. |i_CTRL-X_CTRL-T| See |compl-thesaurusfunc|. +-- The value can be the name of a function, a |lambda| or a |Funcref|. +-- See |option-value-function| for more information. +-- +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +vim.bo.thesaurusfunc = "" +vim.bo.tsrfu = vim.bo.thesaurusfunc +-- `'undofile'` `'udf'` boolean (default off) +-- local to buffer +-- When on, Vim automatically saves undo history to an undo file when +-- writing a buffer to a file, and restores undo history from the same +-- file on buffer read. +-- The directory where the undo file is stored is specified by `'undodir'` . +-- For more information about this feature see |undo-persistence|. +-- The undo file is not read when `'undoreload'` causes the buffer from +-- before a reload to be saved for undo. +-- When `'undofile'` is turned off the undo file is NOT deleted. +vim.bo.undofile = false +vim.bo.udf = vim.bo.undofile +-- `'undolevels'` `'ul'` number (default 1000) +-- global or local to buffer |global-local| +-- Maximum number of changes that can be undone. Since undo information +-- is kept in memory, higher numbers will cause more memory to be used. +-- Nevertheless, a single change can already use a large amount of memory. +-- Set to 0 for Vi compatibility: One level of undo and "u" undoes +-- itself: > +-- set ul=0 +-- < But you can also get Vi compatibility by including the `'u'` flag in +-- `'cpoptions'` , and still be able to use CTRL-R to repeat undo. +-- Also see |undo-two-ways|. +-- Set to -1 for no undo at all. You might want to do this only for the +-- current buffer: > +-- setlocal ul=-1 +-- < This helps when you run out of memory for a single change. +-- +-- The local value is set to -123456 when the global value is to be used. +-- +-- Also see |clear-undo|. +vim.bo.undolevels = 1000 +vim.bo.ul = vim.bo.undolevels +-- `'varsofttabstop'` `'vsts'` string (default "") +-- local to buffer +-- A list of the number of spaces that a counts for while editing, +-- such as inserting a or using . It "feels" like variable- +-- width s are being inserted, while in fact a mixture of spaces +-- and s is used. Tab widths are separated with commas, with the +-- final value applying to all subsequent tabs. +-- +-- For example, when editing assembly language files where statements +-- start in the 9th column and comments in the 41st, it may be useful +-- to use the following: > +-- :set varsofttabstop=8,32,8 +-- < This will set soft tabstops with 8 and 8 + 32 spaces, and 8 more +-- for every column thereafter. +-- +-- Note that the value of |`'softtabstop'` | will be ignored while +-- `'varsofttabstop'` is set. +vim.bo.varsofttabstop = "" +vim.bo.vsts = vim.bo.varsofttabstop +-- `'vartabstop'` `'vts'` string (default "") +-- local to buffer +-- A list of the number of spaces that a in the file counts for, +-- separated by commas. Each value corresponds to one tab, with the +-- final value applying to all subsequent tabs. For example: > +-- :set vartabstop=4,20,10,8 +-- < This will make the first tab 4 spaces wide, the second 20 spaces, +-- the third 10 spaces, and all following tabs 8 spaces. +-- +-- Note that the value of |`'tabstop'` | will be ignored while `'vartabstop'` +-- is set. +vim.bo.vartabstop = "" +vim.bo.vts = vim.bo.vartabstop +-- `'wrapmargin'` `'wm'` number (default 0) +-- local to buffer +-- Number of characters from the right window border where wrapping +-- starts. When typing text beyond this limit, an will be inserted +-- and inserting continues on the next line. +-- Options that add a margin, such as `'number'` and `'foldcolumn'` , cause +-- the text width to be further reduced. +-- When `'textwidth'` is non-zero, this option is not used. +-- See also `'formatoptions'` and |ins-textwidth|. +vim.bo.wrapmargin = 0 +vim.bo.wm = vim.bo.wrapmargin + + +--- @class vim.opt.aleph: vim.Option,number +--- @operator add: vim.opt.aleph +--- @operator sub: vim.opt.aleph +--- @operator pow: vim.opt.aleph +vim.opt.aleph = 224 +vim.opt.al = vim.opt.aleph +--- @return number +function vim.opt.aleph:get()end + +-- `'allowrevins'` `'ari'` boolean (default off) +-- global +-- 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'` . +--- @class vim.opt.allowrevins: vim.Option,boolean +--- @operator add: vim.opt.allowrevins +--- @operator sub: vim.opt.allowrevins +--- @operator pow: vim.opt.allowrevins +vim.opt.allowrevins = false +vim.opt.ari = vim.opt.allowrevins +--- @return boolean +function vim.opt.allowrevins:get()end + +-- `'ambiwidth'` `'ambw'` string (default: "single") +-- global +-- Tells Vim what to do with characters with East Asian Width Class +-- Ambiguous (such as Euro, Registered Sign, Copyright Sign, Greek +-- letters, Cyrillic letters). +-- +-- There are currently two possible values: +-- "single": Use the same width as characters in US-ASCII. This is +-- expected by most users. +-- "double": Use twice the width of ASCII characters. +-- +-- The value "double" cannot be used if `'listchars'` or `'fillchars'` +-- contains a character that would be double width. These errors may +-- also be given when calling setcellwidths(). +-- +-- The values are overruled for characters specified with +-- |setcellwidths()|. +-- +-- There are a number of CJK fonts for which the width of glyphs for +-- those characters are solely based on how many octets they take in +-- legacy/traditional CJK encodings. In those encodings, Euro, +-- Registered sign, Greek/Cyrillic letters are represented by two octets, +-- therefore those fonts have "wide" glyphs for them. This is also +-- true of some line drawing characters used to make tables in text +-- file. Therefore, when a CJK font is used for GUI Vim or +-- Vim is running inside a terminal (emulators) that uses a CJK font +-- (or Vim is run inside an xterm invoked with "-cjkwidth" option.), +-- this option should be set to "double" to match the width perceived +-- by Vim with the width of glyphs in the font. Perhaps it also has +-- to be set to "double" under CJK MS-Windows when the system locale is +-- set to one of CJK locales. See Unicode Standard Annex #11 +-- (https://www.unicode.org/reports/tr11). +--- @class vim.opt.ambiwidth: vim.Option,string +--- @operator add: vim.opt.ambiwidth +--- @operator sub: vim.opt.ambiwidth +--- @operator pow: vim.opt.ambiwidth +vim.opt.ambiwidth = "single" +vim.opt.ambw = vim.opt.ambiwidth +--- @return string +function vim.opt.ambiwidth:get()end + +-- `'arabic'` `'arab'` boolean (default off) +-- local to window +-- This option can be set to start editing Arabic text. +-- Setting this option will: +-- - Set the `'rightleft'` option, unless `'termbidi'` is set. +-- - Set the `'arabicshape'` option, unless `'termbidi'` is set. +-- - Set the `'keymap'` option to "arabic"; in Insert mode CTRL-^ toggles +-- between typing English and Arabic key mapping. +-- - Set the `'delcombine'` option +-- +-- Resetting this option will: +-- - Reset the `'rightleft'` option. +-- - Disable the use of `'keymap'` (without changing its value). +-- Note that `'arabicshape'` and `'delcombine'` are not reset (it is a global +-- option). +-- Also see |arabic.txt|. +--- @class vim.opt.arabic: vim.Option,boolean +--- @operator add: vim.opt.arabic +--- @operator sub: vim.opt.arabic +--- @operator pow: vim.opt.arabic +vim.opt.arabic = false +vim.opt.arab = vim.opt.arabic +--- @return boolean +function vim.opt.arabic:get()end + +-- `'arabicshape'` `'arshape'` boolean (default on) +-- global +-- When on and `'termbidi'` is off, the required visual character +-- corrections that need to take place for displaying the Arabic language +-- take effect. Shaping, in essence, gets enabled; the term is a broad +-- one which encompasses: +-- a) the changing/morphing of characters based on their location +-- within a word (initial, medial, final and stand-alone). +-- b) the enabling of the ability to compose characters +-- c) the enabling of the required combining of some characters +-- When disabled the display shows each character's true stand-alone +-- form. +-- Arabic is a complex language which requires other settings, for +-- further details see |arabic.txt|. +--- @class vim.opt.arabicshape: vim.Option,boolean +--- @operator add: vim.opt.arabicshape +--- @operator sub: vim.opt.arabicshape +--- @operator pow: vim.opt.arabicshape +vim.opt.arabicshape = true +vim.opt.arshape = vim.opt.arabicshape +--- @return boolean +function vim.opt.arabicshape:get()end + +-- `'autochdir'` `'acd'` boolean (default off) +-- global +-- When on, Vim will change the current working directory whenever you +-- open a file, switch buffers, delete a buffer or open/close a window. +-- It will change to the directory containing the file which was opened +-- or selected. When a buffer has no name it also has no directory, thus +-- the current directory won't change when navigating to it. +-- Note: When this option is on some plugins may not work. +--- @class vim.opt.autochdir: vim.Option,boolean +--- @operator add: vim.opt.autochdir +--- @operator sub: vim.opt.autochdir +--- @operator pow: vim.opt.autochdir +vim.opt.autochdir = false +vim.opt.acd = vim.opt.autochdir +--- @return boolean +function vim.opt.autochdir:get()end + +-- `'autoindent'` `'ai'` boolean (default on) +-- local to buffer +-- Copy indent from current line when starting a new line (typing +-- in Insert mode or when using the "o" or "O" command). If you do not +-- type anything on the new line except or CTRL-D and then type +-- , CTRL-O or , the indent is deleted again. Moving the cursor +-- to another line has the same effect, unless the `'I'` flag is included +-- in `'cpoptions'` . +-- When autoindent is on, formatting (with the "gq" command or when you +-- reach `'textwidth'` in Insert mode) uses the indentation of the first +-- line. +-- When `'smartindent'` or `'cindent'` is on the indent is changed in +-- a different way. +-- {small difference from Vi: After the indent is deleted when typing +-- or , the cursor position when moving up or down is after the +-- deleted indent; Vi puts the cursor somewhere in the deleted indent}. +--- @class vim.opt.autoindent: vim.Option,boolean +--- @operator add: vim.opt.autoindent +--- @operator sub: vim.opt.autoindent +--- @operator pow: vim.opt.autoindent +vim.opt.autoindent = true +vim.opt.ai = vim.opt.autoindent +--- @return boolean +function vim.opt.autoindent:get()end + +-- `'autoread'` `'ar'` boolean (default on) +-- global or local to buffer |global-local| +-- When a file has been detected to have been changed outside of Vim and +-- it has not been changed inside of Vim, automatically read it again. +-- When the file has been deleted this is not done, so you have the text +-- from before it was deleted. When it appears again then it is read. +-- |timestamp| +-- If this option has a local value, use this command to switch back to +-- using the global value: > +-- :set autoread< +-- < +--- @class vim.opt.autoread: vim.Option,boolean +--- @operator add: vim.opt.autoread +--- @operator sub: vim.opt.autoread +--- @operator pow: vim.opt.autoread +vim.opt.autoread = true +vim.opt.ar = vim.opt.autoread +--- @return boolean +function vim.opt.autoread:get()end + +-- `'autowrite'` `'aw'` boolean (default off) +-- global +-- Write the contents of the file, if it has been modified, on each +-- `:next`, `:rewind`, `:last`, `:first`, `:previous`, `:stop`, +-- `:suspend`, `:tag`, `:!`, `:make`, CTRL-] and CTRL-^ command; and when +-- a `:buffer`, CTRL-O, CTRL-I, '{A-Z0-9}, or `{A-Z0-9} command takes one +-- to another file. +-- A buffer is not written if it becomes hidden, e.g. when `'bufhidden'` is +-- set to "hide" and `:next` is used. +-- Note that for some commands the `'autowrite'` option is not used, see +-- `'autowriteall'` for that. +-- Some buffers will not be written, specifically when `'buftype'` is +-- "nowrite", "nofile", "terminal" or "prompt". +-- USE WITH CARE: If you make temporary changes to a buffer that you +-- don't want to be saved this option may cause it to be saved anyway. +-- Renaming the buffer with ":file {name}" may help avoid this. +--- @class vim.opt.autowrite: vim.Option,boolean +--- @operator add: vim.opt.autowrite +--- @operator sub: vim.opt.autowrite +--- @operator pow: vim.opt.autowrite +vim.opt.autowrite = false +vim.opt.aw = vim.opt.autowrite +--- @return boolean +function vim.opt.autowrite:get()end + +-- `'autowriteall'` `'awa'` boolean (default off) +-- global +-- Like `'autowrite'` , but also used for commands ":edit", ":enew", ":quit", +-- ":qall", ":exit", ":xit", ":recover" and closing the Vim window. +-- Setting this option also implies that Vim behaves like `'autowrite'` has +-- been set. +--- @class vim.opt.autowriteall: vim.Option,boolean +--- @operator add: vim.opt.autowriteall +--- @operator sub: vim.opt.autowriteall +--- @operator pow: vim.opt.autowriteall +vim.opt.autowriteall = false +vim.opt.awa = vim.opt.autowriteall +--- @return boolean +function vim.opt.autowriteall:get()end + +-- `'background'` `'bg'` string (default "dark") +-- global +-- When set to "dark" or "light", adjusts the default color groups for +-- that background type. The |TUI| or other UI sets this on startup +-- (triggering |OptionSet|) if it can detect the background color. +-- +-- 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. +-- +-- 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. +-- +-- Normally this option would be set in the vimrc file. Possibly +-- depending on the terminal name. Example: > +-- :if $TERM ==# "xterm" +-- : set background=dark +-- :endif +-- < When this option is set, the default settings for the highlight groups +-- will change. To use other settings, place ":highlight" commands AFTER +-- the setting of the `'background'` option. +-- This option is also used in the "$VIMRUNTIME/syntax/syntax.vim" file +-- to select the colors for syntax highlighting. After changing this +-- option, you must load syntax.vim again to see the result. This can be +-- done with ":syntax on". +--- @class vim.opt.background: vim.Option,string +--- @operator add: vim.opt.background +--- @operator sub: vim.opt.background +--- @operator pow: vim.opt.background +vim.opt.background = "dark" +vim.opt.bg = vim.opt.background +--- @return string +function vim.opt.background:get()end + +-- `'backspace'` `'bs'` string (default "indent,eol,start") +-- global +-- Influences the working of , , CTRL-W and CTRL-U in Insert +-- mode. This is a list of items, separated by commas. Each item allows +-- a way to backspace over something: +-- value effect ~ +-- indent allow backspacing over autoindent +-- eol allow backspacing over line breaks (join lines) +-- start allow backspacing over the start of insert; CTRL-W and CTRL-U +-- stop once at the start of insert. +-- nostop like start, except CTRL-W and CTRL-U do not stop at the start of +-- insert. +-- +-- When the value is empty, Vi compatible backspacing is used, none of +-- the ways mentioned for the items above are possible. +-- +-- For backwards compatibility with version 5.4 and earlier: +-- value effect ~ +-- 0 same as ":set backspace=" (Vi compatible) +-- 1 same as ":set backspace=indent,eol" +-- 2 same as ":set backspace=indent,eol,start" +-- 3 same as ":set backspace=indent,eol,nostop" +--- @class vim.opt.backspace: vim.Option,string[] +--- @operator add: vim.opt.backspace +--- @operator sub: vim.opt.backspace +--- @operator pow: vim.opt.backspace +vim.opt.backspace = "indent,eol,start" +vim.opt.bs = vim.opt.backspace +--- @return string[] +function vim.opt.backspace:get()end + +-- `'backup'` `'bk'` boolean (default off) +-- global +-- Make a backup before overwriting a file. Leave it around after the +-- file has been successfully written. If you do not want to keep the +-- backup file, but you do want a backup while the file is being +-- written, reset this option and set the `'writebackup'` option (this is +-- the default). If you do not want a backup file at all reset both +-- options (use this if your file system is almost full). See the +-- |backup-table| for more explanations. +-- When the `'backupskip'` pattern matches, a backup is not made anyway. +-- When `'patchmode'` is set, the backup may be renamed to become the +-- oldest version of a file. +--- @class vim.opt.backup: vim.Option,boolean +--- @operator add: vim.opt.backup +--- @operator sub: vim.opt.backup +--- @operator pow: vim.opt.backup +vim.opt.backup = false +vim.opt.bk = vim.opt.backup +--- @return boolean +function vim.opt.backup:get()end + +-- `'backupcopy'` `'bkc'` string (default: "auto") +-- global or local to buffer |global-local| +-- When writing a file and a backup is made, this option tells how it's +-- done. This is a comma-separated list of words. +-- +-- The main values are: +-- "yes" make a copy of the file and overwrite the original one +-- "no" rename the file and write a new one +-- "auto" one of the previous, what works best +-- +-- Extra values that can be combined with the ones above are: +-- "breaksymlink" always break symlinks when writing +-- "breakhardlink" always break hardlinks when writing +-- +-- Making a copy and overwriting the original file: +-- - Takes extra time to copy the file. +-- + When the file has special attributes, is a (hard/symbolic) link or +-- has a resource fork, all this is preserved. +-- - When the file is a link the backup will have the name of the link, +-- not of the real file. +-- +-- Renaming the file and writing a new one: +-- + It's fast. +-- - Sometimes not all attributes of the file can be copied to the new +-- file. +-- - When the file is a link the new file will not be a link. +-- +-- The "auto" value is the middle way: When Vim sees that renaming the +-- file is possible without side effects (the attributes can be passed on +-- and the file is not a link) that is used. When problems are expected, +-- a copy will be made. +-- +-- The "breaksymlink" and "breakhardlink" values can be used in +-- combination with any of "yes", "no" and "auto". When included, they +-- force Vim to always break either symbolic or hard links by doing +-- exactly what the "no" option does, renaming the original file to +-- become the backup and writing a new file in its place. This can be +-- useful for example in source trees where all the files are symbolic or +-- hard links and any changes should stay in the local source tree, not +-- be propagated back to the original source. +-- +-- One situation where "no" and "auto" will cause problems: A program +-- that opens a file, invokes Vim to edit that file, and then tests if +-- the open file was changed (through the file descriptor) will check the +-- backup file instead of the newly created file. "crontab -e" is an +-- example. +-- +-- When a copy is made, the original file is truncated and then filled +-- with the new text. This means that protection bits, owner and +-- symbolic links of the original file are unmodified. The backup file, +-- however, is a new file, owned by the user who edited the file. The +-- group of the backup is set to the group of the original file. If this +-- fails, the protection bits for the group are made the same as for +-- others. +-- +-- When the file is renamed, this is the other way around: The backup has +-- the same attributes of the original file, and the newly written file +-- is owned by the current user. When the file was a (hard/symbolic) +-- link, the new file will not! That's why the "auto" value doesn't +-- rename when the file is a link. The owner and group of the newly +-- written file will be set to the same ones as the original file, but +-- the system may refuse to do this. In that case the "auto" value will +-- again not rename the file. +--- @class vim.opt.backupcopy: vim.Option,string[] +--- @operator add: vim.opt.backupcopy +--- @operator sub: vim.opt.backupcopy +--- @operator pow: vim.opt.backupcopy +vim.opt.backupcopy = "auto" +vim.opt.bkc = vim.opt.backupcopy +--- @return string[] +function vim.opt.backupcopy:get()end + +-- `'backupdir'` `'bdir'` string (default ".,$XDG_STATE_HOME/nvim/backup//") +-- global +-- List of directories for the backup file, separated with commas. +-- - The backup file will be created in the first directory in the list +-- where this is possible. If none of the directories exist Nvim will +-- attempt to create the last directory in the list. +-- - Empty means that no backup file will be created (`'patchmode'` is +-- impossible!). Writing may fail because of this. +-- - A directory "." means to put the backup file in the same directory +-- as the edited file. +-- - A directory starting with "./" (or ".\" for MS-Windows) means to put +-- the backup file relative to where the edited file is. The leading +-- "." is replaced with the path name of the edited file. +-- ("." inside a directory name has no special meaning). +-- - Spaces after the comma are ignored, other spaces are considered part +-- of the directory name. To have a space at the start of a directory +-- name, precede it with a backslash. +-- - To include a comma in a directory name precede it with a backslash. +-- - A directory name may end in an `'/'` . +-- - For Unix and Win32, if a directory ends in two path separators "//", +-- the swap file name will be built from the complete path to the file +-- with all path separators changed to percent `'%'` signs. This will +-- ensure file name uniqueness in the backup directory. +-- On Win32, it is also possible to end with "\\". However, When a +-- separating comma is following, you must use "//", since "\\" will +-- include the comma in the file name. Therefore it is recommended to +-- use `'//'` , instead of `'\\'` . +-- - Environment variables are expanded |:set_env|. +-- - Careful with `'\'` characters, type one before a space, type two to +-- get one in the option (see |option-backslash|), for example: > +-- :set bdir=c:\\tmp,\ dir\\,with\\,commas,\\\ dir\ with\ spaces +-- < - For backwards compatibility with Vim version 3.0 a `'>'` at the start +-- of the option is removed. +-- See also `'backup'` and `'writebackup'` options. +-- If you want to hide your backup files on Unix, consider this value: > +-- :set backupdir=./.backup,~/.backup,.,/tmp +-- < You must create a ".backup" directory in each directory and in your +-- home directory for this to work properly. +-- The use of |:set+=| and |:set-=| is preferred when adding or removing +-- directories from the list. This avoids problems when a future version +-- uses another default. +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +--- @class vim.opt.backupdir: vim.Option,string[] +--- @operator add: vim.opt.backupdir +--- @operator sub: vim.opt.backupdir +--- @operator pow: vim.opt.backupdir +vim.opt.backupdir = ".,/home/runner/.local/state/nvim/backup//" +vim.opt.bdir = vim.opt.backupdir +--- @return string[] +function vim.opt.backupdir:get()end + +-- `'backupext'` `'bex'` string (default "~") +-- global +-- String which is appended to a file name to make the name of the +-- backup file. The default is quite unusual, because this avoids +-- accidentally overwriting existing files with a backup file. You might +-- prefer using ".bak", but make sure that you don't have files with +-- ".bak" that you want to keep. +-- Only normal file name characters can be used; "/\*?[|<>" are illegal. +-- +-- If you like to keep a lot of backups, you could use a BufWritePre +-- autocommand to change `'backupext'` just before writing the file to +-- include a timestamp. > +-- :au BufWritePre * let &bex = `'-'` .. strftime("%Y%b%d%X") .. `'~'` +-- < Use `'backupdir'` to put the backup in a different directory. +--- @class vim.opt.backupext: vim.Option,string +--- @operator add: vim.opt.backupext +--- @operator sub: vim.opt.backupext +--- @operator pow: vim.opt.backupext +vim.opt.backupext = "~" +vim.opt.bex = vim.opt.backupext +--- @return string +function vim.opt.backupext:get()end + +-- `'backupskip'` `'bsk'` string (default: "$TMPDIR/,$TEMP/*" +-- Unix: "/tmp/,$TMP/" +-- Mac: "/private/tmp/,$TMP/") +-- global +-- A list of file patterns. When one of the patterns matches with the +-- name of the file which is written, no backup file is created. Both +-- the specified file name and the full path name of the file are used. +-- The pattern is used like with |:autocmd|, see |autocmd-pattern|. +-- Watch out for special characters, see |option-backslash|. +-- When $TMPDIR, $TMP or $TEMP is not defined, it is not used for the +-- default value. "/tmp/*" is only used for Unix. +-- +-- WARNING: Not having a backup file means that when Vim fails to write +-- your buffer correctly and then, for whatever reason, Vim exits, you +-- lose both the original file and what you were writing. Only disable +-- backups if you don't care about losing the file. +-- +-- Note that environment variables are not expanded. If you want to use +-- $HOME you must expand it explicitly, e.g.: > +-- :let &backupskip = escape(expand(`'$HOME'` ), `'\'` ) .. `'/tmp/*'` +-- +-- < Note that the default also makes sure that "crontab -e" works (when a +-- backup would be made by renaming the original file crontab won't see +-- the newly created file). Also see `'backupcopy'` and |crontab|. +--- @class vim.opt.backupskip: vim.Option,string[] +--- @operator add: vim.opt.backupskip +--- @operator sub: vim.opt.backupskip +--- @operator pow: vim.opt.backupskip +vim.opt.backupskip = "/tmp/*" +vim.opt.bsk = vim.opt.backupskip +--- @return string[] +function vim.opt.backupskip:get()end + +-- `'belloff'` `'bo'` string (default "all") +-- global +-- Specifies for which events the bell will not be rung. It is a comma- +-- separated list of items. For each item that is present, the bell +-- will be silenced. This is most useful to specify specific events in +-- insert mode to be silenced. +-- +-- item meaning when present ~ +-- all All events. +-- backspace When hitting or and deleting results in an +-- error. +-- cursor Fail to move around using the cursor keys or +-- / in |Insert-mode|. +-- complete Error occurred when using |i_CTRL-X_CTRL-K| or +-- |i_CTRL-X_CTRL-T|. +-- copy Cannot copy char from insert mode using |i_CTRL-Y| or +-- |i_CTRL-E|. +-- ctrlg Unknown Char after in Insert mode. +-- error Other Error occurred (e.g. try to join last line) +-- (mostly used in |Normal-mode| or |Cmdline-mode|). +-- esc hitting in |Normal-mode|. +-- hangul Ignored. +-- lang Calling the beep module for Lua/Mzscheme/TCL. +-- mess No output available for |g<|. +-- showmatch Error occurred for `'showmatch'` function. +-- operator Empty region error |cpo-E|. +-- register Unknown register after in |Insert-mode|. +-- shell Bell from shell output |:!|. +-- spell Error happened on spell suggest. +-- wildmode More matches in |cmdline-completion| available +-- (depends on the `'wildmode'` setting). +-- +-- This is most useful to fine tune when in Insert mode the bell should +-- be rung. For Normal mode and Ex commands, the bell is often rung to +-- indicate that an error occurred. It can be silenced by adding the +-- "error" keyword. +--- @class vim.opt.belloff: vim.Option,string[] +--- @operator add: vim.opt.belloff +--- @operator sub: vim.opt.belloff +--- @operator pow: vim.opt.belloff +vim.opt.belloff = "all" +vim.opt.bo = vim.opt.belloff +--- @return string[] +function vim.opt.belloff:get()end + +-- `'binary'` `'bin'` boolean (default off) +-- local to buffer +-- This option should be set before editing a binary file. You can also +-- use the |-b| Vim argument. When this option is switched on a few +-- options will be changed (also when it already was on): +-- `'textwidth'` will be set to 0 +-- `'wrapmargin'` will be set to 0 +-- `'modeline'` will be off +-- `'expandtab'` will be off +-- Also, `'fileformat'` and `'fileformats'` options will not be used, the +-- file is read and written like `'fileformat'` was "unix" (a single +-- separates lines). +-- The `'fileencoding'` and `'fileencodings'` options will not be used, the +-- file is read without conversion. +-- NOTE: When you start editing a(nother) file while the `'bin'` option is +-- on, settings from autocommands may change the settings again (e.g., +-- `'textwidth'` ), causing trouble when editing. You might want to set +-- `'bin'` again when the file has been loaded. +-- The previous values of these options are remembered and restored when +-- `'bin'` is switched from on to off. Each buffer has its own set of +-- saved option values. +-- To edit a file with `'binary'` set you can use the |++bin| argument. +-- This avoids you have to do ":set bin", which would have effect for all +-- files you edit. +-- When writing a file the for the last line is only written if +-- there was one in the original file (normally Vim appends an to +-- the last line if there is none; this would make the file longer). See +-- the `'endofline'` option. +--- @class vim.opt.binary: vim.Option,boolean +--- @operator add: vim.opt.binary +--- @operator sub: vim.opt.binary +--- @operator pow: vim.opt.binary +vim.opt.binary = false +vim.opt.bin = vim.opt.binary +--- @return boolean +function vim.opt.binary:get()end + +-- `'bomb'` boolean (default off) +-- local to buffer +-- When writing a file and the following conditions are met, a BOM (Byte +-- Order Mark) is prepended to the file: +-- - this option is on +-- - the `'binary'` option is off +-- - `'fileencoding'` is "utf-8", "ucs-2", "ucs-4" or one of the little/big +-- endian variants. +-- Some applications use the BOM to recognize the encoding of the file. +-- Often used for UCS-2 files on MS-Windows. For other applications it +-- causes trouble, for example: "cat file1 file2" makes the BOM of file2 +-- appear halfway through the resulting file. Gcc doesn't accept a BOM. +-- When Vim reads a file and `'fileencodings'` starts with "ucs-bom", a +-- check for the presence of the BOM is done and `'bomb'` set accordingly. +-- Unless `'binary'` is set, it is removed from the first line, so that you +-- don't see it when editing. When you don't change the options, the BOM +-- will be restored when writing the file. +--- @class vim.opt.bomb: vim.Option,boolean +--- @operator add: vim.opt.bomb +--- @operator sub: vim.opt.bomb +--- @operator pow: vim.opt.bomb +vim.opt.bomb = false +--- @return boolean +function vim.opt.bomb:get()end + +-- `'breakat'` `'brk'` string (default " ^I!@*-+;:,./?") +-- global +-- This option lets you choose which characters might cause a line +-- break if `'linebreak'` is on. Only works for ASCII characters. +--- @class vim.opt.breakat: vim.Option,string[] +--- @operator add: vim.opt.breakat +--- @operator sub: vim.opt.breakat +--- @operator pow: vim.opt.breakat +vim.opt.breakat = " \t!@*-+;:,./?" +vim.opt.brk = vim.opt.breakat +--- @return string[] +function vim.opt.breakat:get()end + +-- `'breakindent'` `'bri'` boolean (default off) +-- local to window +-- Every wrapped line will continue visually indented (same amount of +-- space as the beginning of that line), thus preserving horizontal blocks +-- of text. +--- @class vim.opt.breakindent: vim.Option,boolean +--- @operator add: vim.opt.breakindent +--- @operator sub: vim.opt.breakindent +--- @operator pow: vim.opt.breakindent +vim.opt.breakindent = false +vim.opt.bri = vim.opt.breakindent +--- @return boolean +function vim.opt.breakindent:get()end + +-- `'breakindentopt'` `'briopt'` string (default empty) +-- local to window +-- Settings for `'breakindent'` . It can consist of the following optional +-- items and must be separated by a comma: +-- min:{n} Minimum text width that will be kept after +-- applying `'breakindent'` , even if the resulting +-- text should normally be narrower. This prevents +-- text indented almost to the right window border +-- occupying lot of vertical space when broken. +-- (default: 20) +-- shift:{n} After applying `'breakindent'` , the wrapped line's +-- beginning will be shifted by the given number of +-- characters. It permits dynamic French paragraph +-- indentation (negative) or emphasizing the line +-- continuation (positive). +-- (default: 0) +-- sbr Display the `'showbreak'` value before applying the +-- additional indent. +-- (default: off) +-- list:{n} Adds an additional indent for lines that match a +-- numbered or bulleted list (using the +-- `'formatlistpat'` setting). +-- list:-1 Uses the length of a match with `'formatlistpat'` +-- for indentation. +-- (default: 0) +-- column:{n} Indent at column {n}. Will overrule the other +-- sub-options. Note: an additional indent may be +-- added for the `'showbreak'` setting. +-- (default: off) +--- @class vim.opt.breakindentopt: vim.Option,string[] +--- @operator add: vim.opt.breakindentopt +--- @operator sub: vim.opt.breakindentopt +--- @operator pow: vim.opt.breakindentopt +vim.opt.breakindentopt = "" +vim.opt.briopt = vim.opt.breakindentopt +--- @return string[] +function vim.opt.breakindentopt:get()end + +-- `'browsedir'` `'bsdir'` string (default: "last") +-- global +-- Which directory to use for the file browser: +-- last Use same directory as with last file browser, where a +-- file was opened or saved. +-- buffer Use the directory of the related buffer. +-- current Use the current directory. +-- {path} Use the specified directory +--- @class vim.opt.browsedir: vim.Option,string +--- @operator add: vim.opt.browsedir +--- @operator sub: vim.opt.browsedir +--- @operator pow: vim.opt.browsedir +vim.opt.browsedir = "" +vim.opt.bsdir = vim.opt.browsedir +--- @return string +function vim.opt.browsedir:get()end + +-- `'bufhidden'` `'bh'` string (default: "") +-- local to buffer +-- This option specifies what happens when a buffer is no longer +-- displayed in a window: +-- follow the global `'hidden'` option +-- hide hide the buffer (don't unload it), even if `'hidden'` is +-- not set +-- unload unload the buffer, even if `'hidden'` is set; the +-- |:hide| command will also unload the buffer +-- delete delete the buffer from the buffer list, even if +-- `'hidden'` is set; the |:hide| command will also delete +-- the buffer, making it behave like |:bdelete| +-- wipe wipe the buffer from the buffer list, even if +-- `'hidden'` is set; the |:hide| command will also wipe +-- out the buffer, making it behave like |:bwipeout| +-- +-- CAREFUL: when "unload", "delete" or "wipe" is used changes in a buffer +-- are lost without a warning. Also, these values may break autocommands +-- that switch between buffers temporarily. +-- This option is used together with `'buftype'` and `'swapfile'` to specify +-- special kinds of buffers. See |special-buffers|. +--- @class vim.opt.bufhidden: vim.Option,string +--- @operator add: vim.opt.bufhidden +--- @operator sub: vim.opt.bufhidden +--- @operator pow: vim.opt.bufhidden +vim.opt.bufhidden = "" +vim.opt.bh = vim.opt.bufhidden +--- @return string +function vim.opt.bufhidden:get()end + +-- `'buflisted'` `'bl'` boolean (default: on) +-- local to buffer +-- When this option is set, the buffer shows up in the buffer list. If +-- it is reset it is not used for ":bnext", "ls", the Buffers menu, etc. +-- This option is reset by Vim for buffers that are only used to remember +-- a file name or marks. Vim sets it when starting to edit a buffer. +-- But not when moving to a buffer with ":buffer". +--- @class vim.opt.buflisted: vim.Option,boolean +--- @operator add: vim.opt.buflisted +--- @operator sub: vim.opt.buflisted +--- @operator pow: vim.opt.buflisted +vim.opt.buflisted = true +vim.opt.bl = vim.opt.buflisted +--- @return boolean +function vim.opt.buflisted:get()end + +-- `'buftype'` `'bt'` string (default: "") +-- local to buffer +-- The value of this option specifies the type of a buffer: +-- normal buffer +-- acwrite buffer will always be written with |BufWriteCmd|s +-- help help buffer (do not set this manually) +-- nofile buffer is not related to a file, will not be written +-- nowrite buffer will not be written +-- quickfix list of errors |:cwindow| or locations |:lwindow| +-- terminal |terminal-emulator| buffer +-- prompt buffer where only the last line can be edited, meant +-- to be used by a plugin, see |prompt-buffer| +-- +-- This option is used together with `'bufhidden'` and `'swapfile'` to +-- specify special kinds of buffers. See |special-buffers|. +-- Also see |win_gettype()|, which returns the type of the window. +-- +-- Be careful with changing this option, it can have many side effects! +-- One such effect is that Vim will not check the timestamp of the file, +-- if the file is changed by another program this will not be noticed. +-- +-- A "quickfix" buffer is only used for the error list and the location +-- list. This value is set by the |:cwindow| and |:lwindow| commands and +-- you are not supposed to change it. +-- +-- "nofile" and "nowrite" buffers are similar: +-- both: The buffer is not to be written to disk, ":w" doesn't +-- work (":w filename" does work though). +-- both: The buffer is never considered to be |`'modified'` |. +-- There is no warning when the changes will be lost, for +-- example when you quit Vim. +-- both: A swap file is only created when using too much memory +-- (when `'swapfile'` has been reset there is never a swap +-- file). +-- nofile only: The buffer name is fixed, it is not handled like a +-- file name. It is not modified in response to a |:cd| +-- command. +-- both: When using ":e bufname" and already editing "bufname" +-- the buffer is made empty and autocommands are +-- triggered as usual for |:edit|. +-- +-- "acwrite" implies that the buffer name is not related to a file, like +-- "nofile", but it will be written. Thus, in contrast to "nofile" and +-- "nowrite", ":w" does work and a modified buffer can't be abandoned +-- without saving. For writing there must be matching |BufWriteCmd|, +-- |FileWriteCmd| or |FileAppendCmd| autocommands. +--- @class vim.opt.buftype: vim.Option,string +--- @operator add: vim.opt.buftype +--- @operator sub: vim.opt.buftype +--- @operator pow: vim.opt.buftype +vim.opt.buftype = "" +vim.opt.bt = vim.opt.buftype +--- @return string +function vim.opt.buftype:get()end + +-- `'casemap'` `'cmp'` string (default: "internal,keepascii") +-- global +-- Specifies details about changing the case of letters. It may contain +-- these words, separated by a comma: +-- internal Use internal case mapping functions, the current +-- locale does not change the case mapping. When +-- "internal" is omitted, the towupper() and towlower() +-- system library functions are used when available. +-- keepascii For the ASCII characters (0x00 to 0x7f) use the US +-- case mapping, the current locale is not effective. +-- This probably only matters for Turkish. +--- @class vim.opt.casemap: vim.Option,string[] +--- @operator add: vim.opt.casemap +--- @operator sub: vim.opt.casemap +--- @operator pow: vim.opt.casemap +vim.opt.casemap = "internal,keepascii" +vim.opt.cmp = vim.opt.casemap +--- @return string[] +function vim.opt.casemap:get()end + +-- `'cdhome'` `'cdh'` boolean (default: off) +-- global +-- When on, |:cd|, |:tcd| and |:lcd| without an argument changes the +-- current working directory to the |$HOME| directory like in Unix. +-- When off, those commands just print the current directory name. +-- On Unix this option has no effect. +--- @class vim.opt.cdhome: vim.Option,boolean +--- @operator add: vim.opt.cdhome +--- @operator sub: vim.opt.cdhome +--- @operator pow: vim.opt.cdhome +vim.opt.cdhome = false +vim.opt.cdh = vim.opt.cdhome +--- @return boolean +function vim.opt.cdhome:get()end + +-- `'cdpath'` `'cd'` string (default: equivalent to $CDPATH or ",,") +-- global +-- This is a list of directories which will be searched when using the +-- |:cd|, |:tcd| and |:lcd| commands, provided that the directory being +-- searched for has a relative path, not an absolute part starting with +-- "/", "./" or "../", the `'cdpath'` option is not used then. +-- The `'cdpath'` option's value has the same form and semantics as +-- |`'path'` |. Also see |file-searching|. +-- The default value is taken from $CDPATH, with a "," prepended to look +-- in the current directory first. +-- If the default value taken from $CDPATH is not what you want, include +-- a modified version of the following command in your vimrc file to +-- override it: > +-- :let &cdpath = `','` .. substitute(substitute($CDPATH, '[, ]', `'\\\0'` , `'g'` ), `':'` , `','` , `'g'` ) +-- < This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +-- (parts of `'cdpath'` can be passed to the shell to expand file names). +--- @class vim.opt.cdpath: vim.Option,string[] +--- @operator add: vim.opt.cdpath +--- @operator sub: vim.opt.cdpath +--- @operator pow: vim.opt.cdpath +vim.opt.cdpath = ",," +vim.opt.cd = vim.opt.cdpath +--- @return string[] +function vim.opt.cdpath:get()end + +-- `'cedit'` string (default: CTRL-F) +-- global +-- The key used in Command-line Mode to open the command-line window. +-- Only non-printable keys are allowed. +-- The key can be specified as a single character, but it is difficult to +-- type. The preferred way is to use the <> notation. Examples: > +-- :exe "set cedit=\" +-- :exe "set cedit=\" +-- < |Nvi| also has this option, but it only uses the first character. +-- See |cmdwin|. +--- @class vim.opt.cedit: vim.Option,string +--- @operator add: vim.opt.cedit +--- @operator sub: vim.opt.cedit +--- @operator pow: vim.opt.cedit +vim.opt.cedit = "\6" +--- @return string +function vim.opt.cedit:get()end + +-- `'channel'` number (default: 0) +-- local to buffer +-- |channel| connected to the buffer, or 0 if no channel is connected. +-- In a |:terminal| buffer this is the terminal channel. +-- Read-only. +--- @class vim.opt.channel: vim.Option,number +--- @operator add: vim.opt.channel +--- @operator sub: vim.opt.channel +--- @operator pow: vim.opt.channel +vim.opt.channel = 0 +--- @return number +function vim.opt.channel:get()end + +-- `'charconvert'` `'ccv'` string (default "") +-- global +-- An expression that is used for character encoding conversion. It is +-- evaluated when a file that is to be read or has been written has a +-- different encoding from what is desired. +-- `'charconvert'` is not used when the internal iconv() function is +-- supported and is able to do the conversion. Using iconv() is +-- preferred, because it is much faster. +-- `'charconvert'` is not used when reading stdin |--|, because there is no +-- file to convert from. You will have to save the text in a file first. +-- The expression must return zero, false or an empty string for success, +-- non-zero or true for failure. +-- See |encoding-names| for possible encoding names. +-- Additionally, names given in `'fileencodings'` and `'fileencoding'` are +-- used. +-- Conversion between "latin1", "unicode", "ucs-2", "ucs-4" and "utf-8" +-- is done internally by Vim, `'charconvert'` is not used for this. +-- Also used for Unicode conversion. +-- Example: > +-- set charconvert=CharConvert() +-- fun CharConvert() +-- system("recode " +-- \ .. v:charconvert_from .. ".." .. v:charconvert_to +-- \ .. " <" .. v:fname_in .. " >" .. v:fname_out) +-- return v:shell_error +-- endfun +-- < The related Vim variables are: +-- v:charconvert_from name of the current encoding +-- v:charconvert_to name of the desired encoding +-- v:fname_in name of the input file +-- v:fname_out name of the output file +-- Note that v:fname_in and v:fname_out will never be the same. +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +--- @class vim.opt.charconvert: vim.Option,string +--- @operator add: vim.opt.charconvert +--- @operator sub: vim.opt.charconvert +--- @operator pow: vim.opt.charconvert +vim.opt.charconvert = "" +vim.opt.ccv = vim.opt.charconvert +--- @return string +function vim.opt.charconvert:get()end + +-- `'cindent'` `'cin'` boolean (default off) +-- local to buffer +-- Enables automatic C program indenting. See `'cinkeys'` to set the keys +-- that trigger reindenting in insert mode and `'cinoptions'` to set your +-- preferred indent style. +-- If `'indentexpr'` is not empty, it overrules `'cindent'` . +-- If `'lisp'` is not on and both `'indentexpr'` and `'equalprg'` are empty, +-- the "=" operator indents using this algorithm rather than calling an +-- external program. +-- See |C-indenting|. +-- When you don't like the way `'cindent'` works, try the `'smartindent'` +-- option or `'indentexpr'` . +--- @class vim.opt.cindent: vim.Option,boolean +--- @operator add: vim.opt.cindent +--- @operator sub: vim.opt.cindent +--- @operator pow: vim.opt.cindent +vim.opt.cindent = false +vim.opt.cin = vim.opt.cindent +--- @return boolean +function vim.opt.cindent:get()end + +-- `'cinkeys'` `'cink'` string (default "0{,0},0),0],:,0#,!^F,o,O,e") +-- local to buffer +-- A list of keys that, when typed in Insert mode, cause reindenting of +-- the current line. Only used if `'cindent'` is on and `'indentexpr'` is +-- empty. +-- For the format of this option see |cinkeys-format|. +-- See |C-indenting|. +--- @class vim.opt.cinkeys: vim.Option,string[] +--- @operator add: vim.opt.cinkeys +--- @operator sub: vim.opt.cinkeys +--- @operator pow: vim.opt.cinkeys +vim.opt.cinkeys = "0{,0},0),0],:,0#,!^F,o,O,e" +vim.opt.cink = vim.opt.cinkeys +--- @return string[] +function vim.opt.cinkeys:get()end + +-- `'cinoptions'` `'cino'` string (default "") +-- local to buffer +-- The `'cinoptions'` affect the way `'cindent'` reindents lines in a C +-- program. See |cinoptions-values| for the values of this option, and +-- |C-indenting| for info on C indenting in general. +--- @class vim.opt.cinoptions: vim.Option,string[] +--- @operator add: vim.opt.cinoptions +--- @operator sub: vim.opt.cinoptions +--- @operator pow: vim.opt.cinoptions +vim.opt.cinoptions = "" +vim.opt.cino = vim.opt.cinoptions +--- @return string[] +function vim.opt.cinoptions:get()end + +-- `'cinscopedecls'` `'cinsd'` string (default "public,protected,private") +-- local to buffer +-- Keywords that are interpreted as a C++ scope declaration by |cino-g|. +-- Useful e.g. for working with the Qt framework that defines additional +-- scope declarations "signals", "public slots" and "private slots": > +-- set cinscopedecls+=signals,public\ slots,private\ slots +-- +-- < +--- @class vim.opt.cinscopedecls: vim.Option,string[] +--- @operator add: vim.opt.cinscopedecls +--- @operator sub: vim.opt.cinscopedecls +--- @operator pow: vim.opt.cinscopedecls +vim.opt.cinscopedecls = "public,protected,private" +vim.opt.cinsd = vim.opt.cinscopedecls +--- @return string[] +function vim.opt.cinscopedecls:get()end + +-- `'cinwords'` `'cinw'` string (default "if,else,while,do,for,switch") +-- local to buffer +-- These keywords start an extra indent in the next line when +-- `'smartindent'` or `'cindent'` is set. For `'cindent'` this is only done at +-- an appropriate place (inside {}). +-- Note that `'ignorecase'` isn't used for `'cinwords'` . If case doesn't +-- matter, include the keyword both the uppercase and lowercase: +-- "if,If,IF". +--- @class vim.opt.cinwords: vim.Option,string[] +--- @operator add: vim.opt.cinwords +--- @operator sub: vim.opt.cinwords +--- @operator pow: vim.opt.cinwords +vim.opt.cinwords = "if,else,while,do,for,switch" +vim.opt.cinw = vim.opt.cinwords +--- @return string[] +function vim.opt.cinwords:get()end + +-- `'clipboard'` `'cb'` string (default "") +-- global +-- This option is a list of comma-separated names. +-- These names are recognized: +-- +-- +-- unnamed When included, Vim will use the clipboard register "*" +-- for all yank, delete, change and put operations which +-- would normally go to the unnamed register. When a +-- register is explicitly specified, it will always be +-- used regardless of whether "unnamed" is in `'clipboard'` +-- or not. The clipboard register can always be +-- explicitly accessed using the "* notation. Also see +-- |clipboard|. +-- +-- +-- unnamedplus A variant of the "unnamed" flag which uses the +-- clipboard register "+" (|quoteplus|) instead of +-- register "*" for all yank, delete, change and put +-- operations which would normally go to the unnamed +-- register. When "unnamed" is also included to the +-- option, yank and delete operations (but not put) +-- will additionally copy the text into register +-- "*". See |clipboard|. +--- @class vim.opt.clipboard: vim.Option,string[] +--- @operator add: vim.opt.clipboard +--- @operator sub: vim.opt.clipboard +--- @operator pow: vim.opt.clipboard +vim.opt.clipboard = "" +vim.opt.cb = vim.opt.clipboard +--- @return string[] +function vim.opt.clipboard:get()end + +-- `'cmdheight'` `'ch'` number (default 1) +-- global or local to tab page +-- Number of screen lines to use for the command-line. Helps avoiding +-- |hit-enter| prompts. +-- The value of this option is stored with the tab page, so that each tab +-- page can have a different value. +-- +-- When `'cmdheight'` is zero, there is no command-line unless it is being +-- used. The command-line will cover the last line of the screen when +-- shown. +-- +-- WARNING: `cmdheight=0` is considered experimental. Expect some +-- unwanted behaviour. Some `'shortmess'` flags and similar +-- mechanism might fail to take effect, causing unwanted hit-enter +-- prompts. Some informative messages, both from Nvim itself and +-- plugins, will not be displayed. +--- @class vim.opt.cmdheight: vim.Option,number +--- @operator add: vim.opt.cmdheight +--- @operator sub: vim.opt.cmdheight +--- @operator pow: vim.opt.cmdheight +vim.opt.cmdheight = 1 +vim.opt.ch = vim.opt.cmdheight +--- @return number +function vim.opt.cmdheight:get()end + +-- `'cmdwinheight'` `'cwh'` number (default 7) +-- global +-- Number of screen lines to use for the command-line window. |cmdwin| +--- @class vim.opt.cmdwinheight: vim.Option,number +--- @operator add: vim.opt.cmdwinheight +--- @operator sub: vim.opt.cmdwinheight +--- @operator pow: vim.opt.cmdwinheight +vim.opt.cmdwinheight = 7 +vim.opt.cwh = vim.opt.cmdwinheight +--- @return number +function vim.opt.cmdwinheight:get()end + +-- `'colorcolumn'` `'cc'` string (default "") +-- local to window +-- `'colorcolumn'` is a comma-separated list of screen columns that are +-- highlighted with ColorColumn |hl-ColorColumn|. Useful to align +-- text. Will make screen redrawing slower. +-- The screen column can be an absolute number, or a number preceded with +-- `'+'` or `'-'` , which is added to or subtracted from `'textwidth'` . > +-- +-- :set cc=+1 " highlight column after `'textwidth'` +-- :set cc=+1,+2,+3 " highlight three columns after `'textwidth'` +-- :hi ColorColumn ctermbg=lightgrey guibg=lightgrey +-- < +-- When `'textwidth'` is zero then the items with `'-'` and `'+'` are not used. +-- A maximum of 256 columns are highlighted. +--- @class vim.opt.colorcolumn: vim.Option,string[] +--- @operator add: vim.opt.colorcolumn +--- @operator sub: vim.opt.colorcolumn +--- @operator pow: vim.opt.colorcolumn +vim.opt.colorcolumn = "" +vim.opt.cc = vim.opt.colorcolumn +--- @return string[] +function vim.opt.colorcolumn:get()end + +-- `'columns'` `'co'` number (default 80 or terminal width) +-- global +-- Number of columns of the screen. Normally this is set by the terminal +-- initialization and does not have to be set by hand. +-- When Vim is running in the GUI or in a resizable window, setting this +-- option will cause the window size to be changed. When you only want +-- to use the size for the GUI, put the command in your |ginit.vim| file. +-- When you set this option and Vim is unable to change the physical +-- number of columns of the display, the display may be messed up. For +-- the GUI it is always possible and Vim limits the number of columns to +-- what fits on the screen. You can use this command to get the widest +-- window possible: > +-- :set columns=9999 +-- < Minimum value is 12, maximum value is 10000. +--- @class vim.opt.columns: vim.Option,number +--- @operator add: vim.opt.columns +--- @operator sub: vim.opt.columns +--- @operator pow: vim.opt.columns +vim.opt.columns = 80 +vim.opt.co = vim.opt.columns +--- @return number +function vim.opt.columns:get()end + +-- `'comments'` `'com'` string (default +-- "s1:/,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:-") +-- local to buffer +-- A comma-separated list of strings that can start a comment line. See +-- |format-comments|. See |option-backslash| about using backslashes to +-- insert a space. +--- @class vim.opt.comments: vim.Option,string[] +--- @operator add: vim.opt.comments +--- @operator sub: vim.opt.comments +--- @operator pow: vim.opt.comments +vim.opt.comments = "s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:-" +vim.opt.com = vim.opt.comments +--- @return string[] +function vim.opt.comments:get()end + +-- `'commentstring'` `'cms'` string (default "") +-- local to buffer +-- A template for a comment. The "%s" in the value is replaced with the +-- comment text. For example, C uses "//". Currently only used to +-- add markers for folding, see |fold-marker|. +--- @class vim.opt.commentstring: vim.Option,string +--- @operator add: vim.opt.commentstring +--- @operator sub: vim.opt.commentstring +--- @operator pow: vim.opt.commentstring +vim.opt.commentstring = "" +vim.opt.cms = vim.opt.commentstring +--- @return string +function vim.opt.commentstring:get()end + +--- @class vim.opt.compatible: vim.Option,boolean +--- @operator add: vim.opt.compatible +--- @operator sub: vim.opt.compatible +--- @operator pow: vim.opt.compatible +vim.opt.compatible = false +vim.opt.cp = vim.opt.compatible +--- @return boolean +function vim.opt.compatible:get()end + +-- `'complete'` `'cpt'` string (default: ".,w,b,u,t") +-- local to buffer +-- This option specifies how keyword completion |ins-completion| works +-- when CTRL-P or CTRL-N are used. It is also used for whole-line +-- completion |i_CTRL-X_CTRL-L|. It indicates the type of completion +-- and the places to scan. It is a comma-separated list of flags: +-- . scan the current buffer (`'wrapscan'` is ignored) +-- w scan buffers from other windows +-- b scan other loaded buffers that are in the buffer list +-- u scan the unloaded buffers that are in the buffer list +-- U scan the buffers that are not in the buffer list +-- k scan the files given with the `'dictionary'` option +-- kspell use the currently active spell checking |spell| +-- k{dict} scan the file {dict}. Several "k" flags can be given, +-- patterns are valid too. For example: > +-- :set cpt=k/usr/dict/*,k~/spanish +-- < s scan the files given with the `'thesaurus'` option +-- s{tsr} scan the file {tsr}. Several "s" flags can be given, patterns +-- are valid too. +-- i scan current and included files +-- d scan current and included files for defined name or macro +-- |i_CTRL-X_CTRL-D| +-- ] tag completion +-- t same as "]" +-- +-- Unloaded buffers are not loaded, thus their autocmds |:autocmd| are +-- not executed, this may lead to unexpected completions from some files +-- (gzipped files for example). Unloaded buffers are not scanned for +-- whole-line completion. +-- +-- As you can see, CTRL-N and CTRL-P can be used to do any `'iskeyword'` - +-- based expansion (e.g., dictionary |i_CTRL-X_CTRL-K|, included patterns +-- |i_CTRL-X_CTRL-I|, tags |i_CTRL-X_CTRL-]| and normal expansions). +--- @class vim.opt.complete: vim.Option,string[] +--- @operator add: vim.opt.complete +--- @operator sub: vim.opt.complete +--- @operator pow: vim.opt.complete +vim.opt.complete = ".,w,b,u,t" +vim.opt.cpt = vim.opt.complete +--- @return string[] +function vim.opt.complete:get()end + +-- `'completefunc'` `'cfu'` string (default: empty) +-- local to buffer +-- This option specifies a function to be used for Insert mode completion +-- with CTRL-X CTRL-U. |i_CTRL-X_CTRL-U| +-- See |complete-functions| for an explanation of how the function is +-- invoked and what it should return. The value can be the name of a +-- function, a |lambda| or a |Funcref|. See |option-value-function| for +-- more information. +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +--- @class vim.opt.completefunc: vim.Option,string +--- @operator add: vim.opt.completefunc +--- @operator sub: vim.opt.completefunc +--- @operator pow: vim.opt.completefunc +vim.opt.completefunc = "" +vim.opt.cfu = vim.opt.completefunc +--- @return string +function vim.opt.completefunc:get()end + +-- `'completeopt'` `'cot'` string (default: "menu,preview") +-- global +-- A comma-separated list of options for Insert mode completion +-- |ins-completion|. The supported values are: +-- +-- menu Use a popup menu to show the possible completions. The +-- menu is only shown when there is more than one match and +-- sufficient colors are available. |ins-completion-menu| +-- +-- menuone Use the popup menu also when there is only one match. +-- Useful when there is additional information about the +-- match, e.g., what file it comes from. +-- +-- longest Only insert the longest common text of the matches. If +-- the menu is displayed you can use CTRL-L to add more +-- characters. Whether case is ignored depends on the kind +-- of completion. For buffer text the `'ignorecase'` option is +-- used. +-- +-- preview Show extra information about the currently selected +-- completion in the preview window. Only works in +-- combination with "menu" or "menuone". +-- +-- noinsert Do not insert any text for a match until the user selects +-- a match from the menu. Only works in combination with +-- "menu" or "menuone". No effect if "longest" is present. +-- +-- noselect Do not select a match in the menu, force the user to +-- select one from the menu. Only works in combination with +-- "menu" or "menuone". +--- @class vim.opt.completeopt: vim.Option,string[] +--- @operator add: vim.opt.completeopt +--- @operator sub: vim.opt.completeopt +--- @operator pow: vim.opt.completeopt +vim.opt.completeopt = "menu,preview" +vim.opt.cot = vim.opt.completeopt +--- @return string[] +function vim.opt.completeopt:get()end + +-- `'completeslash'` `'csl'` string (default: "") +-- local to buffer +-- {only for MS-Windows} +-- When this option is set it overrules `'shellslash'` for completion: +-- - When this option is set to "slash", a forward slash is used for path +-- completion in insert mode. This is useful when editing HTML tag, or +-- Makefile with `'noshellslash'` on MS-Windows. +-- - When this option is set to "backslash", backslash is used. This is +-- useful when editing a batch file with `'shellslash'` set on MS-Windows. +-- - When this option is empty, same character is used as for +-- `'shellslash'` . +-- For Insert mode completion the buffer-local value is used. For +-- command line completion the global value is used. +--- @class vim.opt.completeslash: vim.Option,string +--- @operator add: vim.opt.completeslash +--- @operator sub: vim.opt.completeslash +--- @operator pow: vim.opt.completeslash +vim.opt.completeslash = "" +vim.opt.csl = vim.opt.completeslash +--- @return string +function vim.opt.completeslash:get()end + +-- `'concealcursor'` `'cocu'` string (default: "") +-- local to window +-- Sets the modes in which text in the cursor line can also be concealed. +-- When the current mode is listed then concealing happens just like in +-- other lines. +-- n Normal mode +-- v Visual mode +-- i Insert mode +-- c Command line editing, for `'incsearch'` +-- +-- `'v'` applies to all lines in the Visual area, not only the cursor. +-- A useful value is "nc". This is used in help files. So long as you +-- are moving around text is concealed, but when starting to insert text +-- or selecting a Visual area the concealed text is displayed, so that +-- you can see what you are doing. +-- Keep in mind that the cursor position is not always where it's +-- displayed. E.g., when moving vertically it may change column. +--- @class vim.opt.concealcursor: vim.Option,string +--- @operator add: vim.opt.concealcursor +--- @operator sub: vim.opt.concealcursor +--- @operator pow: vim.opt.concealcursor +vim.opt.concealcursor = "" +vim.opt.cocu = vim.opt.concealcursor +--- @return string +function vim.opt.concealcursor:get()end + +-- `'conceallevel'` `'cole'` number (default 0) +-- local to window +-- Determine how text with the "conceal" syntax attribute |:syn-conceal| +-- is shown: +-- +-- Value Effect ~ +-- 0 Text is shown normally +-- 1 Each block of concealed text is replaced with one +-- character. If the syntax item does not have a custom +-- replacement character defined (see |:syn-cchar|) the +-- character defined in `'listchars'` is used. +-- It is highlighted with the "Conceal" highlight group. +-- 2 Concealed text is completely hidden unless it has a +-- custom replacement character defined (see +-- |:syn-cchar|). +-- 3 Concealed text is completely hidden. +-- +-- Note: in the cursor line concealed text is not hidden, so that you can +-- edit and copy the text. This can be changed with the `'concealcursor'` +-- option. +--- @class vim.opt.conceallevel: vim.Option,number +--- @operator add: vim.opt.conceallevel +--- @operator sub: vim.opt.conceallevel +--- @operator pow: vim.opt.conceallevel +vim.opt.conceallevel = 0 +vim.opt.cole = vim.opt.conceallevel +--- @return number +function vim.opt.conceallevel:get()end + +-- `'confirm'` `'cf'` boolean (default off) +-- 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 +-- 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| +-- command. +-- Also see the |confirm()| function and the `'v'` flag in `'guioptions'` . +--- @class vim.opt.confirm: vim.Option,boolean +--- @operator add: vim.opt.confirm +--- @operator sub: vim.opt.confirm +--- @operator pow: vim.opt.confirm +vim.opt.confirm = false +vim.opt.cf = vim.opt.confirm +--- @return boolean +function vim.opt.confirm:get()end + +-- `'copyindent'` `'ci'` boolean (default off) +-- local to buffer +-- Copy the structure of the existing lines indent when autoindenting a +-- new line. Normally the new indent is reconstructed by a series of +-- tabs followed by spaces as required (unless |`'expandtab'` | is enabled, +-- in which case only spaces are used). Enabling this option makes the +-- new line copy whatever characters were used for indenting on the +-- existing line. `'expandtab'` has no effect on these characters, a Tab +-- remains a Tab. If the new indent is greater than on the existing +-- line, the remaining space is filled in the normal manner. +-- See `'preserveindent'` . +--- @class vim.opt.copyindent: vim.Option,boolean +--- @operator add: vim.opt.copyindent +--- @operator sub: vim.opt.copyindent +--- @operator pow: vim.opt.copyindent +vim.opt.copyindent = false +vim.opt.ci = vim.opt.copyindent +--- @return boolean +function vim.opt.copyindent:get()end + +-- `'cpoptions'` `'cpo'` string (default: "aABceFs_") +-- global +-- A sequence of single character flags. When a character is present +-- this indicates Vi-compatible behavior. This is used for things where +-- not being Vi-compatible is mostly or sometimes preferred. +-- `'cpoptions'` stands for "compatible-options". +-- Commas can be added for readability. +-- To avoid problems with flags that are added in the future, use the +-- "+=" and "-=" feature of ":set" |add-option-flags|. +-- +-- contains behavior ~ +-- +-- a When included, a ":read" command with a file name +-- argument will set the alternate file name for the +-- current window. +-- +-- A When included, a ":write" command with a file name +-- argument will set the alternate file name for the +-- current window. +-- +-- b "\|" in a ":map" command is recognized as the end of +-- the map command. The `'\'` is included in the mapping, +-- the text after the `'|'` is interpreted as the next +-- command. Use a CTRL-V instead of a backslash to +-- include the `'|'` in the mapping. Applies to all +-- mapping, abbreviation, menu and autocmd commands. +-- See also |map_bar|. +-- +-- B A backslash has no special meaning in mappings, +-- abbreviations, user commands and the "to" part of the +-- menu commands. Remove this flag to be able to use a +-- backslash like a CTRL-V. For example, the command +-- ":map X \" results in X being mapped to: +-- `'B'` included: "\^[" (^[ is a real ) +-- `'B'` excluded: "" (5 characters) +-- +-- c Searching continues at the end of any match at the +-- cursor position, but not further than the start of the +-- next line. When not present searching continues +-- one character from the cursor position. With `'c'` +-- "abababababab" only gets three matches when repeating +-- "/abab", without `'c'` there are five matches. +-- +-- C Do not concatenate sourced lines that start with a +-- backslash. See |line-continuation|. +-- +-- d Using "./" in the `'tags'` option doesn't mean to use +-- the tags file relative to the current file, but the +-- tags file in the current directory. +-- +-- D Can't use CTRL-K to enter a digraph after Normal mode +-- commands with a character argument, like |r|, |f| and +-- |t|. +-- +-- e When executing a register with ":@r", always add a +-- to the last line, also when the register is not +-- linewise. If this flag is not present, the register +-- is not linewise and the last line does not end in a +-- , then the last line is put on the command-line +-- and can be edited before hitting . +-- +-- E It is an error when using "y", "d", "c", "g~", "gu" or +-- "gU" on an Empty region. The operators only work when +-- at least one character is to be operated on. Example: +-- This makes "y0" fail in the first column. +-- +-- f When included, a ":read" command with a file name +-- argument will set the file name for the current buffer, +-- if the current buffer doesn't have a file name yet. +-- +-- F When included, a ":write" command with a file name +-- argument will set the file name for the current +-- buffer, if the current buffer doesn't have a file name +-- yet. Also see |cpo-P|. +-- +-- i When included, interrupting the reading of a file will +-- leave it modified. +-- +-- I When moving the cursor up or down just after inserting +-- indent for `'autoindent'` , do not delete the indent. +-- +-- J A |sentence| has to be followed by two spaces after +-- the `'.'` , `'!'` or `'?'` . A is not recognized as +-- white space. +-- +-- K Don't wait for a key code to complete when it is +-- halfway through a mapping. This breaks mapping +-- when only part of the second has been +-- read. It enables cancelling the mapping by typing +-- . +-- +-- l Backslash in a [] range in a search pattern is taken +-- literally, only "\]", "\^", "\-" and "\\" are special. +-- See |/[]| +-- `'l'` included: "/[ \t]" finds , `'\'` and `'t'` +-- `'l'` excluded: "/[ \t]" finds and +-- +-- L When the `'list'` option is set, `'wrapmargin'` , +-- `'textwidth'` , `'softtabstop'` and Virtual Replace mode +-- (see |gR|) count a as two characters, instead of +-- the normal behavior of a . +-- +-- m When included, a showmatch will always wait half a +-- second. When not included, a showmatch will wait half +-- a second or until a character is typed. |`'showmatch'` | +-- +-- M When excluded, "%" matching will take backslashes into +-- account. Thus in "( \( )" and "\( ( \)" the outer +-- parenthesis match. When included "%" ignores +-- backslashes, which is Vi compatible. +-- +-- n When included, the column used for `'number'` and +-- `'relativenumber'` will also be used for text of wrapped +-- lines. +-- +-- o Line offset to search command is not remembered for +-- next search. +-- +-- O Don't complain if a file is being overwritten, even +-- when it didn't exist when editing it. This is a +-- protection against a file unexpectedly created by +-- someone else. Vi didn't complain about this. +-- +-- p Vi compatible Lisp indenting. When not present, a +-- slightly better algorithm is used. +-- +-- P When included, a ":write" command that appends to a +-- file will set the file name for the current buffer, if +-- the current buffer doesn't have a file name yet and +-- the `'F'` flag is also included |cpo-F|. +-- +-- q When joining multiple lines leave the cursor at the +-- position where it would be when joining two lines. +-- +-- r Redo ("." command) uses "/" to repeat a search +-- command, instead of the actually used search string. +-- +-- R Remove marks from filtered lines. Without this flag +-- marks are kept like |:keepmarks| was used. +-- +-- s Set buffer options when entering the buffer for the +-- first time. This is like it is in Vim version 3.0. +-- And it is the default. If not present the options are +-- set when the buffer is created. +-- +-- S Set buffer options always when entering a buffer +-- (except `'readonly'` , `'fileformat'` , `'filetype'` and +-- `'syntax'` ). This is the (most) Vi compatible setting. +-- The options are set to the values in the current +-- buffer. When you change an option and go to another +-- buffer, the value is copied. Effectively makes the +-- buffer options global to all buffers. +-- +-- `'s'` `'S'` copy buffer options +-- no no when buffer created +-- yes no when buffer first entered (default) +-- X yes each time when buffer entered (vi comp.) +-- +-- t Search pattern for the tag command is remembered for +-- "n" command. Otherwise Vim only puts the pattern in +-- the history for search pattern, but doesn't change the +-- last used search pattern. +-- +-- u Undo is Vi compatible. See |undo-two-ways|. +-- +-- v Backspaced characters remain visible on the screen in +-- Insert mode. Without this flag the characters are +-- erased from the screen right away. With this flag the +-- screen newly typed text overwrites backspaced +-- characters. +-- +-- W Don't overwrite a readonly file. When omitted, ":w!" +-- overwrites a readonly file, if possible. +-- +-- x on the command-line executes the command-line. +-- The default in Vim is to abandon the command-line, +-- because normally aborts a command. |c_| +-- +-- X When using a count with "R" the replaced text is +-- deleted only once. Also when repeating "R" with "." +-- and a count. +-- +-- y A yank command can be redone with ".". Think twice if +-- you really want to use this, it may break some +-- plugins, since most people expect "." to only repeat a +-- change. +-- +-- Z When using "w!" while the `'readonly'` option is set, +-- don't reset `'readonly'` . +-- +-- ! When redoing a filter command, use the last used +-- external command, whatever it was. Otherwise the last +-- used -filter- command is used. +-- +-- $ When making a change to one line, don't redisplay the +-- line, but put a `'$'` at the end of the changed text. +-- The changed text will be overwritten when you type the +-- new text. The line is redisplayed if you type any +-- command that moves the cursor from the insertion +-- point. +-- +-- % Vi-compatible matching is done for the "%" command. +-- Does not recognize "#if", "#endif", etc. +-- Does not recognize "/*" and "*/". +-- Parens inside single and double quotes are also +-- counted, causing a string that contains a paren to +-- disturb the matching. For example, in a line like +-- "if (strcmp("foo(", s))" the first paren does not +-- match the last one. When this flag is not included, +-- parens inside single and double quotes are treated +-- specially. When matching a paren outside of quotes, +-- everything inside quotes is ignored. When matching a +-- paren inside quotes, it will find the matching one (if +-- there is one). This works very well for C programs. +-- This flag is also used for other features, such as +-- C-indenting. +-- +-- + When included, a ":write file" command will reset the +-- `'modified'` flag of the buffer, even though the buffer +-- itself may still be different from its file. +-- +-- > When appending to a register, put a line break before +-- the appended text. +-- +-- ; When using |,| or |;| to repeat the last |t| search +-- and the cursor is right in front of the searched +-- character, the cursor won't move. When not included, +-- the cursor would skip over it and jump to the +-- following occurrence. +-- +-- _ When using |cw| on a word, do not include the +-- whitespace following the word in the motion. +--- @class vim.opt.cpoptions: vim.Option,string[] +--- @operator add: vim.opt.cpoptions +--- @operator sub: vim.opt.cpoptions +--- @operator pow: vim.opt.cpoptions +vim.opt.cpoptions = "aABceFs_" +vim.opt.cpo = vim.opt.cpoptions +--- @return string[] +function vim.opt.cpoptions:get()end + +-- `'cursorbind'` `'crb'` boolean (default off) +-- local to window +-- When this option is set, as the cursor in the current +-- window moves other cursorbound windows (windows that also have +-- this option set) move their cursors to the corresponding line and +-- column. This option is useful for viewing the +-- differences between two versions of a file (see `'diff'` ); in diff mode, +-- inserted and deleted lines (though not characters within a line) are +-- taken into account. +--- @class vim.opt.cursorbind: vim.Option,boolean +--- @operator add: vim.opt.cursorbind +--- @operator sub: vim.opt.cursorbind +--- @operator pow: vim.opt.cursorbind +vim.opt.cursorbind = false +vim.opt.crb = vim.opt.cursorbind +--- @return boolean +function vim.opt.cursorbind:get()end + +-- `'cursorcolumn'` `'cuc'` boolean (default off) +-- local to window +-- Highlight the screen column of the cursor with CursorColumn +-- |hl-CursorColumn|. Useful to align text. Will make screen redrawing +-- slower. +-- If you only want the highlighting in the current window you can use +-- these autocommands: > +-- au WinLeave * set nocursorline nocursorcolumn +-- au WinEnter * set cursorline cursorcolumn +-- < +--- @class vim.opt.cursorcolumn: vim.Option,boolean +--- @operator add: vim.opt.cursorcolumn +--- @operator sub: vim.opt.cursorcolumn +--- @operator pow: vim.opt.cursorcolumn +vim.opt.cursorcolumn = false +vim.opt.cuc = vim.opt.cursorcolumn +--- @return boolean +function vim.opt.cursorcolumn:get()end + +-- `'cursorline'` `'cul'` boolean (default off) +-- local to window +-- Highlight the text line of the cursor with CursorLine |hl-CursorLine|. +-- Useful to easily spot the cursor. Will make screen redrawing slower. +-- When Visual mode is active the highlighting isn't used to make it +-- easier to see the selected text. +--- @class vim.opt.cursorline: vim.Option,boolean +--- @operator add: vim.opt.cursorline +--- @operator sub: vim.opt.cursorline +--- @operator pow: vim.opt.cursorline +vim.opt.cursorline = false +vim.opt.cul = vim.opt.cursorline +--- @return boolean +function vim.opt.cursorline:get()end + +-- `'cursorlineopt'` `'culopt'` string (default: "number,line") +-- local to window +-- Comma-separated list of settings for how `'cursorline'` is displayed. +-- Valid values: +-- "line" Highlight the text line of the cursor with +-- CursorLine |hl-CursorLine|. +-- "screenline" Highlight only the screen line of the cursor with +-- CursorLine |hl-CursorLine|. +-- "number" Highlight the line number of the cursor with +-- CursorLineNr |hl-CursorLineNr|. +-- +-- Special value: +-- "both" Alias for the values "line,number". +-- +-- "line" and "screenline" cannot be used together. +--- @class vim.opt.cursorlineopt: vim.Option,string[] +--- @operator add: vim.opt.cursorlineopt +--- @operator sub: vim.opt.cursorlineopt +--- @operator pow: vim.opt.cursorlineopt +vim.opt.cursorlineopt = "both" +vim.opt.culopt = vim.opt.cursorlineopt +--- @return string[] +function vim.opt.cursorlineopt:get()end + +-- `'debug'` string (default "") +-- global +-- These values can be used: +-- msg Error messages that would otherwise be omitted will be given +-- anyway. +-- throw Error messages that would otherwise be omitted will be given +-- anyway and also throw an exception and set |v:errmsg|. +-- beep A message will be given when otherwise only a beep would be +-- produced. +-- The values can be combined, separated by a comma. +-- "msg" and "throw" are useful for debugging `'foldexpr'` , `'formatexpr'` or +-- `'indentexpr'` . +--- @class vim.opt.debug: vim.Option,string +--- @operator add: vim.opt.debug +--- @operator sub: vim.opt.debug +--- @operator pow: vim.opt.debug +vim.opt.debug = "" +--- @return string +function vim.opt.debug:get()end + +-- `'define'` `'def'` string (default "") +-- global or local to buffer |global-local| +-- Pattern to be used to find a macro definition. It is a search +-- pattern, just like for the "/" command. This option is used for the +-- commands like "[i" and "[d" |include-search|. The `'isident'` option is +-- used to recognize the defined name after the match: +-- {match with `'define'` }{non-ID chars}{defined name}{non-ID char} +-- See |option-backslash| about inserting backslashes to include a space +-- or backslash. +-- For C++ this value would be useful, to include const type declarations: > +-- ^\(#\s\s[a-z]*\) +-- < You can also use "\ze" just before the name and continue the pattern +-- to check what is following. E.g. for Javascript, if a function is +-- defined with `func_name = function(args)`: > +-- ^\s=\s*function( +-- < If the function is defined with `func_name : function() {...`: > +-- ^\s[:]\sfunction\s*( +-- < When using the ":set" command, you need to double the backslashes! +-- To avoid that use `:let` with a single quote string: > +-- let &l:define = `'^\s=\s*function('` +-- < +--- @class vim.opt.define: vim.Option,string +--- @operator add: vim.opt.define +--- @operator sub: vim.opt.define +--- @operator pow: vim.opt.define +vim.opt.define = "" +vim.opt.def = vim.opt.define +--- @return string +function vim.opt.define:get()end + +-- `'delcombine'` `'deco'` boolean (default off) +-- global +-- If editing Unicode and this option is set, backspace and Normal mode +-- "x" delete each combining character on its own. When it is off (the +-- default) the character along with its combining characters are +-- deleted. +-- Note: When `'delcombine'` is set "xx" may work differently from "2x"! +-- +-- This is useful for Arabic, Hebrew and many other languages where one +-- may have combining characters overtop of base characters, and want +-- to remove only the combining ones. +--- @class vim.opt.delcombine: vim.Option,boolean +--- @operator add: vim.opt.delcombine +--- @operator sub: vim.opt.delcombine +--- @operator pow: vim.opt.delcombine +vim.opt.delcombine = false +vim.opt.deco = vim.opt.delcombine +--- @return boolean +function vim.opt.delcombine:get()end + +-- `'dictionary'` `'dict'` string (default "") +-- global or local to buffer |global-local| +-- List of file names, separated by commas, that are used to lookup words +-- for keyword completion commands |i_CTRL-X_CTRL-K|. Each file should +-- contain a list of words. This can be one word per line, or several +-- words per line, separated by non-keyword characters (white space is +-- preferred). Maximum line length is 510 bytes. +-- +-- When this option is empty or an entry "spell" is present, and spell +-- checking is enabled, words in the word lists for the currently active +-- `'spelllang'` are used. See |spell|. +-- +-- To include a comma in a file name precede it with a backslash. Spaces +-- after a comma are ignored, otherwise spaces are included in the file +-- name. See |option-backslash| about using backslashes. +-- This has nothing to do with the |Dictionary| variable type. +-- Where to find a list of words? +-- - BSD/macOS include the "/usr/share/dict/words" file. +-- - Try "apt install spell" to get the "/usr/share/dict/words" file on +-- apt-managed systems (Debian/Ubuntu). +-- The use of |:set+=| and |:set-=| is preferred when adding or removing +-- directories from the list. This avoids problems when a future version +-- uses another default. +-- Backticks cannot be used in this option for security reasons. +--- @class vim.opt.dictionary: vim.Option,string[] +--- @operator add: vim.opt.dictionary +--- @operator sub: vim.opt.dictionary +--- @operator pow: vim.opt.dictionary +vim.opt.dictionary = "" +vim.opt.dict = vim.opt.dictionary +--- @return string[] +function vim.opt.dictionary:get()end + +-- `'diff'` boolean (default off) +-- local to window +-- Join the current window in the group of windows that shows differences +-- between files. See |diff-mode|. +--- @class vim.opt.diff: vim.Option,boolean +--- @operator add: vim.opt.diff +--- @operator sub: vim.opt.diff +--- @operator pow: vim.opt.diff +vim.opt.diff = false +--- @return boolean +function vim.opt.diff:get()end + +-- `'diffexpr'` `'dex'` string (default "") +-- global +-- 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. +--- @class vim.opt.diffexpr: vim.Option,string +--- @operator add: vim.opt.diffexpr +--- @operator sub: vim.opt.diffexpr +--- @operator pow: vim.opt.diffexpr +vim.opt.diffexpr = "" +vim.opt.dex = vim.opt.diffexpr +--- @return string +function vim.opt.diffexpr:get()end + +-- `'diffopt'` `'dip'` string (default "internal,filler,closeoff") +-- global +-- Option settings for diff mode. It can consist of the following items. +-- All are optional. Items must be separated by a comma. +-- +-- filler Show filler lines, to keep the text +-- synchronized with a window that has inserted +-- lines at the same position. Mostly useful +-- when windows are side-by-side and `'scrollbind'` +-- is set. +-- +-- context:{n} Use a context of {n} lines between a change +-- and a fold that contains unchanged lines. +-- When omitted a context of six lines is used. +-- When using zero the context is actually one, +-- since folds require a line in between, also +-- for a deleted line. +-- See |fold-diff|. +-- +-- iblank Ignore changes where lines are all blank. Adds +-- the "-B" flag to the "diff" command if +-- `'diffexpr'` is empty. Check the documentation +-- of the "diff" command for what this does +-- exactly. +-- NOTE: the diff windows will get out of sync, +-- because no differences between blank lines are +-- taken into account. +-- +-- icase Ignore changes in case of text. "a" and "A" +-- are considered the same. Adds the "-i" flag +-- to the "diff" command if `'diffexpr'` is empty. +-- +-- iwhite Ignore changes in amount of white space. Adds +-- the "-b" flag to the "diff" command if +-- `'diffexpr'` is empty. Check the documentation +-- of the "diff" command for what this does +-- exactly. It should ignore adding trailing +-- white space, but not leading white space. +-- +-- iwhiteall Ignore all white space changes. Adds +-- the "-w" flag to the "diff" command if +-- `'diffexpr'` is empty. Check the documentation +-- of the "diff" command for what this does +-- exactly. +-- +-- iwhiteeol Ignore white space changes at end of line. +-- Adds the "-Z" flag to the "diff" command if +-- `'diffexpr'` is empty. Check the documentation +-- of the "diff" command for what this does +-- exactly. +-- +-- horizontal Start diff mode with horizontal splits (unless +-- explicitly specified otherwise). +-- +-- vertical Start diff mode with vertical splits (unless +-- explicitly specified otherwise). +-- +-- closeoff When a window is closed where `'diff'` is set +-- and there is only one window remaining in the +-- same tab page with `'diff'` set, execute +-- `:diffoff` in that window. This undoes a +-- `:diffsplit` command. +-- +-- hiddenoff Do not use diff mode for a buffer when it +-- becomes hidden. +-- +-- foldcolumn:{n} Set the `'foldcolumn'` option to {n} when +-- starting diff mode. Without this 2 is used. +-- +-- followwrap Follow the `'wrap'` option and leave as it is. +-- +-- internal Use the internal diff library. This is +-- ignored when `'diffexpr'` is set. +-- 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. +-- +-- linematch:{n} Enable a second stage diff on each generated +-- hunk in order to align lines. When the total +-- number of lines in a hunk exceeds {n}, the +-- second stage diff will not be performed as +-- very large hunks can cause noticeable lag. A +-- recommended setting is "linematch:60", as this +-- will enable alignment for a 2 buffer diff with +-- hunks of up to 30 lines each, or a 3 buffer +-- diff with hunks of up to 20 lines each. +-- +-- 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 +-- +-- Examples: > +-- :set diffopt=internal,filler,context:4 +-- :set diffopt= +-- :set diffopt=internal,filler,foldcolumn:3 +-- :set diffopt-=internal " do NOT use the internal diff parser +-- < +--- @class vim.opt.diffopt: vim.Option,string[] +--- @operator add: vim.opt.diffopt +--- @operator sub: vim.opt.diffopt +--- @operator pow: vim.opt.diffopt +vim.opt.diffopt = "internal,filler,closeoff" +vim.opt.dip = vim.opt.diffopt +--- @return string[] +function vim.opt.diffopt:get()end + +-- `'digraph'` `'dg'` boolean (default off) +-- global +-- Enable the entering of digraphs in Insert mode with {char1} +-- {char2}. See |digraphs|. +--- @class vim.opt.digraph: vim.Option,boolean +--- @operator add: vim.opt.digraph +--- @operator sub: vim.opt.digraph +--- @operator pow: vim.opt.digraph +vim.opt.digraph = false +vim.opt.dg = vim.opt.digraph +--- @return boolean +function vim.opt.digraph:get()end + diff --git a/bundle/neodev.nvim/types/nightly/options.2.lua b/bundle/neodev.nvim/types/nightly/options.2.lua new file mode 100644 index 000000000..488f38de0 --- /dev/null +++ b/bundle/neodev.nvim/types/nightly/options.2.lua @@ -0,0 +1,4642 @@ +---@meta + +-- `'directory'` `'dir'` string (default "$XDG_STATE_HOME/nvim/swap//") +-- global +-- List of directory names for the swap file, separated with commas. +-- +-- Possible items: +-- - The swap file will be created in the first directory where this is +-- possible. If it is not possible in any directory, but last +-- directory listed in the option does not exist, it is created. +-- - Empty means that no swap file will be used (recovery is +-- impossible!) and no |E303| error will be given. +-- - A directory "." means to put the swap file in the same directory as +-- the edited file. On Unix, a dot is prepended to the file name, so +-- it doesn't show in a directory listing. On MS-Windows the "hidden" +-- attribute is set and a dot prepended if possible. +-- - A directory starting with "./" (or ".\" for MS-Windows) means to put +-- the swap file relative to where the edited file is. The leading "." +-- is replaced with the path name of the edited file. +-- - For Unix and Win32, if a directory ends in two path separators "//", +-- the swap file name will be built from the complete path to the file +-- with all path separators replaced by percent `'%'` signs (including +-- the colon following the drive letter on Win32). This will ensure +-- file name uniqueness in the preserve directory. +-- On Win32, it is also possible to end with "\\". However, When a +-- separating comma is following, you must use "//", since "\\" will +-- include the comma in the file name. Therefore it is recommended to +-- use `'//'` , instead of `'\\'` . +-- - Spaces after the comma are ignored, other spaces are considered part +-- of the directory name. To have a space at the start of a directory +-- name, precede it with a backslash. +-- - To include a comma in a directory name precede it with a backslash. +-- - A directory name may end in an `':'` or `'/'` . +-- - Environment variables are expanded |:set_env|. +-- - Careful with `'\'` characters, type one before a space, type two to +-- get one in the option (see |option-backslash|), for example: > +-- :set dir=c:\\tmp,\ dir\\,with\\,commas,\\\ dir\ with\ spaces +-- < - For backwards compatibility with Vim version 3.0 a `'>'` at the start +-- of the option is removed. +-- +-- Editing the same file twice will result in a warning. Using "/tmp" on +-- is discouraged: if the system crashes you lose the swap file. And +-- others on the computer may be able to see the files. +-- Use |:set+=| and |:set-=| when adding or removing directories from the +-- list, this avoids problems if the Nvim default is changed. +-- +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +--- @class vim.opt.directory: vim.Option,string[] +--- @operator add: vim.opt.directory +--- @operator sub: vim.opt.directory +--- @operator pow: vim.opt.directory +vim.opt.directory = "/home/runner/.local/state/nvim/swap//" +vim.opt.dir = vim.opt.directory +--- @return string[] +function vim.opt.directory:get()end + +-- `'display'` `'dy'` string (default "lastline") +-- global +-- Change the way text is displayed. This is a comma-separated list of +-- flags: +-- lastline When included, as much as possible of the last line +-- in a window will be displayed. "@@@" is put in the +-- last columns of the last screen line to indicate the +-- rest of the line is not displayed. +-- truncate Like "lastline", but "@@@" is displayed in the first +-- column of the last screen line. Overrules "lastline". +-- uhex Show unprintable characters hexadecimal as +-- instead of using ^C and ~C. +-- msgsep Obsolete flag. Allowed but takes no effect. |msgsep| +-- +-- When neither "lastline" nor "truncate" is included, a last line that +-- doesn't fit is replaced with "@" lines. +-- +-- The "@" character can be changed by setting the "lastline" item in +-- `'fillchars'` . The character is highlighted with |hl-NonText|. +--- @class vim.opt.display: vim.Option,string[] +--- @operator add: vim.opt.display +--- @operator sub: vim.opt.display +--- @operator pow: vim.opt.display +vim.opt.display = "lastline" +vim.opt.dy = vim.opt.display +--- @return string[] +function vim.opt.display:get()end + +-- `'eadirection'` `'ead'` string (default "both") +-- global +-- Tells when the `'equalalways'` option applies: +-- ver vertically, width of windows is not affected +-- hor horizontally, height of windows is not affected +-- both width and height of windows is affected +--- @class vim.opt.eadirection: vim.Option,string +--- @operator add: vim.opt.eadirection +--- @operator sub: vim.opt.eadirection +--- @operator pow: vim.opt.eadirection +vim.opt.eadirection = "both" +vim.opt.ead = vim.opt.eadirection +--- @return string +function vim.opt.eadirection:get()end + +--- @class vim.opt.edcompatible: vim.Option,boolean +--- @operator add: vim.opt.edcompatible +--- @operator sub: vim.opt.edcompatible +--- @operator pow: vim.opt.edcompatible +vim.opt.edcompatible = false +vim.opt.ed = vim.opt.edcompatible +--- @return boolean +function vim.opt.edcompatible:get()end + +-- `'emoji'` `'emo'` boolean (default: on) +-- global +-- When on all Unicode emoji characters are considered to be full width. +-- This excludes "text emoji" characters, which are normally displayed as +-- single width. Unfortunately there is no good specification for this +-- and it has been determined on trial-and-error basis. Use the +-- |setcellwidths()| function to change the behavior. +--- @class vim.opt.emoji: vim.Option,boolean +--- @operator add: vim.opt.emoji +--- @operator sub: vim.opt.emoji +--- @operator pow: vim.opt.emoji +vim.opt.emoji = true +vim.opt.emo = vim.opt.emoji +--- @return boolean +function vim.opt.emoji:get()end + +-- `'encoding'` `'enc'` +-- String-encoding used internally and for |RPC| communication. +-- Always UTF-8. +-- +-- See `'fileencoding'` to control file-content encoding. +--- @class vim.opt.encoding: vim.Option,string +--- @operator add: vim.opt.encoding +--- @operator sub: vim.opt.encoding +--- @operator pow: vim.opt.encoding +vim.opt.encoding = "utf-8" +vim.opt.enc = vim.opt.encoding +--- @return string +function vim.opt.encoding:get()end + +-- `'endoffile'` `'eof'` boolean (default off) +-- local to buffer +-- Indicates that a CTRL-Z character was found at the end of the file +-- when reading it. Normally only happens when `'fileformat'` is "dos". +-- When writing a file and this option is off and the `'binary'` option +-- is on, or `'fixeol'` option is off, no CTRL-Z will be written at the +-- end of the file. +-- See |eol-and-eof| for example settings. +--- @class vim.opt.endoffile: vim.Option,boolean +--- @operator add: vim.opt.endoffile +--- @operator sub: vim.opt.endoffile +--- @operator pow: vim.opt.endoffile +vim.opt.endoffile = false +vim.opt.eof = vim.opt.endoffile +--- @return boolean +function vim.opt.endoffile:get()end + +-- `'endofline'` `'eol'` boolean (default on) +-- local to buffer +-- When writing a file and this option is off and the `'binary'` option +-- is on, or `'fixeol'` option is off, no will be written for the +-- last line in the file. This option is automatically set or reset when +-- starting to edit a new file, depending on whether file has an +-- for the last line in the file. Normally you don't have to set or +-- reset this option. +-- When `'binary'` is off and `'fixeol'` is on the value is not used when +-- writing the file. When `'binary'` is on or `'fixeol'` is off it is used +-- to remember the presence of a for the last line in the file, so +-- that when you write the file the situation from the original file can +-- be kept. But you can change it if you want to. +-- See |eol-and-eof| for example settings. +--- @class vim.opt.endofline: vim.Option,boolean +--- @operator add: vim.opt.endofline +--- @operator sub: vim.opt.endofline +--- @operator pow: vim.opt.endofline +vim.opt.endofline = true +vim.opt.eol = vim.opt.endofline +--- @return boolean +function vim.opt.endofline:get()end + +-- `'equalalways'` `'ea'` boolean (default on) +-- global +-- When on, all the windows are automatically made the same size after +-- splitting or closing a window. This also happens the moment the +-- option is switched on. When off, splitting a window will reduce the +-- size of the current window and leave the other windows the same. When +-- closing a window the extra lines are given to the window next to it +-- (depending on `'splitbelow'` and `'splitright'` ). +-- When mixing vertically and horizontally split windows, a minimal size +-- is computed and some windows may be larger if there is room. The +-- `'eadirection'` option tells in which direction the size is affected. +-- Changing the height and width of a window can be avoided by setting +-- `'winfixheight'` and `'winfixwidth'` , respectively. +-- If a window size is specified when creating a new window sizes are +-- currently not equalized (it's complicated, but may be implemented in +-- the future). +--- @class vim.opt.equalalways: vim.Option,boolean +--- @operator add: vim.opt.equalalways +--- @operator sub: vim.opt.equalalways +--- @operator pow: vim.opt.equalalways +vim.opt.equalalways = true +vim.opt.ea = vim.opt.equalalways +--- @return boolean +function vim.opt.equalalways:get()end + +-- `'equalprg'` `'ep'` string (default "") +-- global or local to buffer |global-local| +-- External program to use for "=" command. When this option is empty +-- the internal formatting functions are used; either `'lisp'` , `'cindent'` +-- or `'indentexpr'` . +-- Environment variables are expanded |:set_env|. See |option-backslash| +-- about including spaces and backslashes. +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +--- @class vim.opt.equalprg: vim.Option,string +--- @operator add: vim.opt.equalprg +--- @operator sub: vim.opt.equalprg +--- @operator pow: vim.opt.equalprg +vim.opt.equalprg = "" +vim.opt.ep = vim.opt.equalprg +--- @return string +function vim.opt.equalprg:get()end + +-- `'errorbells'` `'eb'` boolean (default off) +-- global +-- Ring the bell (beep or screen flash) for error messages. This only +-- makes a difference for error messages, the bell will be used always +-- for a lot of errors without a message (e.g., hitting in Normal +-- mode). See `'visualbell'` to make the bell behave like a screen flash +-- or do nothing. See `'belloff'` to finetune when to ring the bell. +--- @class vim.opt.errorbells: vim.Option,boolean +--- @operator add: vim.opt.errorbells +--- @operator sub: vim.opt.errorbells +--- @operator pow: vim.opt.errorbells +vim.opt.errorbells = false +vim.opt.eb = vim.opt.errorbells +--- @return boolean +function vim.opt.errorbells:get()end + +-- `'errorfile'` `'ef'` string (default: "errors.err") +-- global +-- Name of the errorfile for the QuickFix mode (see |:cf|). +-- When the "-q" command-line argument is used, `'errorfile'` is set to the +-- following argument. See |-q|. +-- NOT used for the ":make" command. See `'makeef'` for that. +-- Environment variables are expanded |:set_env|. +-- See |option-backslash| about including spaces and backslashes. +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +--- @class vim.opt.errorfile: vim.Option,string +--- @operator add: vim.opt.errorfile +--- @operator sub: vim.opt.errorfile +--- @operator pow: vim.opt.errorfile +vim.opt.errorfile = "errors.err" +vim.opt.ef = vim.opt.errorfile +--- @return string +function vim.opt.errorfile:get()end + +-- `'errorformat'` `'efm'` string (default is very long) +-- global or local to buffer |global-local| +-- Scanf-like description of the format for the lines in the error file +-- (see |errorformat|). +--- @class vim.opt.errorformat: vim.Option,string[] +--- @operator add: vim.opt.errorformat +--- @operator sub: vim.opt.errorformat +--- @operator pow: vim.opt.errorformat +vim.opt.errorformat = "%*[^\"]\"%f\"%*\\D%l: %m,\"%f\"%*\\D%l: %m,%-Gg%\\?make[%*\\d]: *** [%f:%l:%m,%-Gg%\\?make: *** [%f:%l:%m,%-G%f:%l: (Each undeclared identifier is reported only once,%-G%f:%l: for each function it appears in.),%-GIn file included from %f:%l:%c:,%-GIn file included from %f:%l:%c\\,,%-GIn file included from %f:%l:%c,%-GIn file included from %f:%l,%-G%*[ ]from %f:%l:%c,%-G%*[ ]from %f:%l:,%-G%*[ ]from %f:%l\\,,%-G%*[ ]from %f:%l,%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,\"%f\"\\, line %l%*\\D%c%*[^ ] %m,%D%*\\a[%*\\d]: Entering directory %*[`']%f',%X%*\\a[%*\\d]: Leaving directory %*[`']%f',%D%*\\a: Entering directory %*[`']%f',%X%*\\a: Leaving directory %*[`']%f',%DMaking %*\\a in %f,%f|%l| %m" +vim.opt.efm = vim.opt.errorformat +--- @return string[] +function vim.opt.errorformat:get()end + +-- `'eventignore'` `'ei'` string (default "") +-- global +-- A list of autocommand event names, which are to be ignored. +-- When set to "all" or when "all" is one of the items, all autocommand +-- events are ignored, autocommands will not be executed. +-- Otherwise this is a comma-separated list of event names. Example: > +-- :set ei=WinEnter,WinLeave +-- < +--- @class vim.opt.eventignore: vim.Option,string[] +--- @operator add: vim.opt.eventignore +--- @operator sub: vim.opt.eventignore +--- @operator pow: vim.opt.eventignore +vim.opt.eventignore = "" +vim.opt.ei = vim.opt.eventignore +--- @return string[] +function vim.opt.eventignore:get()end + +-- `'expandtab'` `'et'` boolean (default off) +-- local to buffer +-- In Insert mode: Use the appropriate number of spaces to insert a +-- . Spaces are used in indents with the `'>'` and `'<'` commands and +-- when `'autoindent'` is on. To insert a real tab when `'expandtab'` is +-- on, use CTRL-V. See also |:retab| and |ins-expandtab|. +--- @class vim.opt.expandtab: vim.Option,boolean +--- @operator add: vim.opt.expandtab +--- @operator sub: vim.opt.expandtab +--- @operator pow: vim.opt.expandtab +vim.opt.expandtab = false +vim.opt.et = vim.opt.expandtab +--- @return boolean +function vim.opt.expandtab:get()end + +-- `'exrc'` `'ex'` boolean (default off) +-- global +-- Automatically execute .nvim.lua, .nvimrc, and .exrc files in the +-- current directory, if the file is in the |trust| list. Use |:trust| to +-- manage trusted files. See also |vim.secure.read()|. +-- +-- Compare `'exrc'` to |editorconfig|: +-- - `'exrc'` can execute any code; editorconfig only specifies settings. +-- - `'exrc'` is Nvim-specific; editorconfig works in other editors. +-- +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +--- @class vim.opt.exrc: vim.Option,boolean +--- @operator add: vim.opt.exrc +--- @operator sub: vim.opt.exrc +--- @operator pow: vim.opt.exrc +vim.opt.exrc = false +vim.opt.ex = vim.opt.exrc +--- @return boolean +function vim.opt.exrc:get()end + +-- `'fileencoding'` `'fenc'` string (default: "") +-- local to buffer +-- File-content encoding for the current buffer. Conversion is done with +-- iconv() or as specified with `'charconvert'` . +-- +-- When `'fileencoding'` is not UTF-8, conversion will be done when +-- writing the file. For reading see below. +-- When `'fileencoding'` is empty, the file will be saved with UTF-8 +-- encoding (no conversion when reading or writing a file). +-- +-- WARNING: Conversion to a non-Unicode encoding can cause loss of +-- information! +-- +-- See |encoding-names| for the possible values. Additionally, values may be +-- specified that can be handled by the converter, see +-- |mbyte-conversion|. +-- +-- When reading a file `'fileencoding'` will be set from `'fileencodings'` . +-- To read a file in a certain encoding it won't work by setting +-- `'fileencoding'` , use the |++enc| argument. One exception: when +-- `'fileencodings'` is empty the value of `'fileencoding'` is used. +-- For a new file the global value of `'fileencoding'` is used. +-- +-- Prepending "8bit-" and "2byte-" has no meaning here, they are ignored. +-- When the option is set, the value is converted to lowercase. Thus +-- you can set it with uppercase values too. `'_'` characters are +-- replaced with `'-'` . If a name is recognized from the list at +-- |encoding-names|, it is replaced by the standard name. For example +-- "ISO8859-2" becomes "iso-8859-2". +-- +-- When this option is set, after starting to edit a file, the `'modified'` +-- option is set, because the file would be different when written. +-- +-- Keep in mind that changing `'fenc'` from a modeline happens +-- AFTER the text has been read, thus it applies to when the file will be +-- written. If you do set `'fenc'` in a modeline, you might want to set +-- `'nomodified'` to avoid not being able to ":q". +-- +-- This option cannot be changed when `'modifiable'` is off. +--- @class vim.opt.fileencoding: vim.Option,string +--- @operator add: vim.opt.fileencoding +--- @operator sub: vim.opt.fileencoding +--- @operator pow: vim.opt.fileencoding +vim.opt.fileencoding = "" +vim.opt.fenc = vim.opt.fileencoding +--- @return string +function vim.opt.fileencoding:get()end + +-- `'fileencodings'` `'fencs'` string (default: "ucs-bom,utf-8,default,latin1") +-- global +-- This is a list of character encodings considered when starting to edit +-- an existing file. When a file is read, Vim tries to use the first +-- mentioned character encoding. If an error is detected, the next one +-- in the list is tried. When an encoding is found that works, +-- `'fileencoding'` is set to it. If all fail, `'fileencoding'` is set to +-- an empty string, which means that UTF-8 is used. +-- WARNING: Conversion can cause loss of information! You can use +-- the |++bad| argument to specify what is done with characters +-- that can't be converted. +-- For an empty file or a file with only ASCII characters most encodings +-- will work and the first entry of `'fileencodings'` will be used (except +-- "ucs-bom", which requires the BOM to be present). If you prefer +-- another encoding use an BufReadPost autocommand event to test if your +-- preferred encoding is to be used. Example: > +-- au BufReadPost * if search(`'\S'` , `'w'` ) == 0 | +-- \ set fenc=iso-2022-jp | endif +-- < This sets `'fileencoding'` to "iso-2022-jp" if the file does not contain +-- non-blank characters. +-- When the |++enc| argument is used then the value of `'fileencodings'` is +-- not used. +-- Note that `'fileencodings'` is not used for a new file, the global value +-- of `'fileencoding'` is used instead. You can set it with: > +-- :setglobal fenc=iso-8859-2 +-- < This means that a non-existing file may get a different encoding than +-- an empty file. +-- The special value "ucs-bom" can be used to check for a Unicode BOM +-- (Byte Order Mark) at the start of the file. It must not be preceded +-- by "utf-8" or another Unicode encoding for this to work properly. +-- An entry for an 8-bit encoding (e.g., "latin1") should be the last, +-- because Vim cannot detect an error, thus the encoding is always +-- accepted. +-- The special value "default" can be used for the encoding from the +-- environment. It is useful when your environment uses a non-latin1 +-- encoding, such as Russian. +-- When a file contains an illegal UTF-8 byte sequence it won't be +-- recognized as "utf-8". You can use the |8g8| command to find the +-- illegal byte sequence. +-- WRONG VALUES: WHAT'S WRONG: +-- latin1,utf-8 "latin1" will always be used +-- utf-8,ucs-bom,latin1 BOM won't be recognized in an utf-8 +-- file +-- cp1250,latin1 "cp1250" will always be used +-- If `'fileencodings'` is empty, `'fileencoding'` is not modified. +-- See `'fileencoding'` for the possible values. +-- Setting this option does not have an effect until the next time a file +-- is read. +--- @class vim.opt.fileencodings: vim.Option,string[] +--- @operator add: vim.opt.fileencodings +--- @operator sub: vim.opt.fileencodings +--- @operator pow: vim.opt.fileencodings +vim.opt.fileencodings = "ucs-bom,utf-8,default,latin1" +vim.opt.fencs = vim.opt.fileencodings +--- @return string[] +function vim.opt.fileencodings:get()end + +-- `'fileformat'` `'ff'` string (Windows default: "dos", +-- Unix default: "unix") +-- local to buffer +-- This gives the of the current buffer, which is used for +-- reading/writing the buffer from/to a file: +-- dos +-- unix +-- mac +-- When "dos" is used, CTRL-Z at the end of a file is ignored. +-- See |file-formats| and |file-read|. +-- For the character encoding of the file see `'fileencoding'` . +-- When `'binary'` is set, the value of `'fileformat'` is ignored, file I/O +-- works like it was set to "unix". +-- This option is set automatically when starting to edit a file and +-- `'fileformats'` is not empty and `'binary'` is off. +-- When this option is set, after starting to edit a file, the `'modified'` +-- option is set, because the file would be different when written. +-- This option cannot be changed when `'modifiable'` is off. +--- @class vim.opt.fileformat: vim.Option,string +--- @operator add: vim.opt.fileformat +--- @operator sub: vim.opt.fileformat +--- @operator pow: vim.opt.fileformat +vim.opt.fileformat = "unix" +vim.opt.ff = vim.opt.fileformat +--- @return string +function vim.opt.fileformat:get()end + +-- `'fileformats'` `'ffs'` string (default: +-- Win32: "dos,unix", +-- Unix: "unix,dos") +-- global +-- This gives the end-of-line () formats that will be tried when +-- starting to edit a new buffer and when reading a file into an existing +-- buffer: +-- - When empty, the format defined with `'fileformat'` will be used +-- always. It is not set automatically. +-- - When set to one name, that format will be used whenever a new buffer +-- is opened. `'fileformat'` is set accordingly for that buffer. The +-- `'fileformats'` name will be used when a file is read into an existing +-- buffer, no matter what `'fileformat'` for that buffer is set to. +-- - When more than one name is present, separated by commas, automatic +-- detection will be done when reading a file. When starting to +-- edit a file, a check is done for the : +-- 1. If all lines end in , and `'fileformats'` includes "dos", +-- `'fileformat'` is set to "dos". +-- 2. If a is found and `'fileformats'` includes "unix", `'fileformat'` +-- is set to "unix". Note that when a is found without a +-- preceding , "unix" is preferred over "dos". +-- 3. If `'fileformat'` has not yet been set, and if a is found, and +-- if `'fileformats'` includes "mac", `'fileformat'` is set to "mac". +-- This means that "mac" is only chosen when: +-- "unix" is not present or no is found in the file, and +-- "dos" is not present or no is found in the file. +-- Except: if "unix" was chosen, but there is a before +-- the first , and there appear to be more s than s in +-- the first few lines, "mac" is used. +-- 4. If `'fileformat'` is still not set, the first name from +-- `'fileformats'` is used. +-- When reading a file into an existing buffer, the same is done, but +-- this happens like `'fileformat'` has been set appropriately for that +-- file only, the option is not changed. +-- When `'binary'` is set, the value of `'fileformats'` is not used. +-- +-- When Vim starts up with an empty buffer the first item is used. You +-- can overrule this by setting `'fileformat'` in your .vimrc. +-- +-- For systems with a Dos-like (), when reading files that +-- are ":source"ed and for vimrc files, automatic detection may be +-- done: +-- - When `'fileformats'` is empty, there is no automatic detection. Dos +-- format will be used. +-- - When `'fileformats'` is set to one or more names, automatic detection +-- is done. This is based on the first in the file: If there is a +-- in front of it, Dos format is used, otherwise Unix format is +-- used. +-- Also see |file-formats|. +--- @class vim.opt.fileformats: vim.Option,string[] +--- @operator add: vim.opt.fileformats +--- @operator sub: vim.opt.fileformats +--- @operator pow: vim.opt.fileformats +vim.opt.fileformats = "unix,dos" +vim.opt.ffs = vim.opt.fileformats +--- @return string[] +function vim.opt.fileformats:get()end + +-- `'fileignorecase'` `'fic'` boolean (default on for systems where case in file +-- names is normally ignored) +-- global +-- When set case is ignored when using file names and directories. +-- See `'wildignorecase'` for only ignoring case when doing completion. +--- @class vim.opt.fileignorecase: vim.Option,boolean +--- @operator add: vim.opt.fileignorecase +--- @operator sub: vim.opt.fileignorecase +--- @operator pow: vim.opt.fileignorecase +vim.opt.fileignorecase = false +vim.opt.fic = vim.opt.fileignorecase +--- @return boolean +function vim.opt.fileignorecase:get()end + +-- `'filetype'` `'ft'` string (default: "") +-- local to buffer +-- When this option is set, the FileType autocommand event is triggered. +-- All autocommands that match with the value of this option will be +-- executed. Thus the value of `'filetype'` is used in place of the file +-- name. +-- Otherwise this option does not always reflect the current file type. +-- This option is normally set when the file type is detected. To enable +-- this use the ":filetype on" command. |:filetype| +-- Setting this option to a different value is most useful in a modeline, +-- for a file for which the file type is not automatically recognized. +-- Example, for in an IDL file: > +-- /* vim: set filetype=idl : */ +-- < |FileType| |filetypes| +-- When a dot appears in the value then this separates two filetype +-- names. Example: > +-- /* vim: set filetype=c.doxygen : */ +-- < This will use the "c" filetype first, then the "doxygen" filetype. +-- This works both for filetype plugins and for syntax files. More than +-- one dot may appear. +-- This option is not copied to another buffer, independent of the `'s'` or +-- `'S'` flag in `'cpoptions'` . +-- Only normal file name characters can be used, "/\*?[|<>" are illegal. +--- @class vim.opt.filetype: vim.Option,string +--- @operator add: vim.opt.filetype +--- @operator sub: vim.opt.filetype +--- @operator pow: vim.opt.filetype +vim.opt.filetype = "" +vim.opt.ft = vim.opt.filetype +--- @return string +function vim.opt.filetype:get()end + +-- `'fillchars'` `'fcs'` string (default "") +-- global or local to window |global-local| +-- Characters to fill the statuslines, vertical separators and special +-- lines in the window. +-- It is a comma-separated list of items. Each item has a name, a colon +-- and the value of that item: +-- +-- item default Used for ~ +-- stl ' ' or `'^'` statusline of the current window +-- stlnc ' ' or `'='` statusline of the non-current windows +-- wbr ' ' window bar +-- horiz `'─'` or `'-'` horizontal separators |:split| +-- horizup `'┴'` or `'-'` upwards facing horizontal separator +-- horizdown `'┬'` or `'-'` downwards facing horizontal separator +-- vert `'│'` or `'|'` vertical separators |:vsplit| +-- vertleft `'┤'` or `'|'` left facing vertical separator +-- vertright `'├'` or `'|'` right facing vertical separator +-- verthoriz `'┼'` or `'+'` overlapping vertical and horizontal +-- separator +-- fold `'·'` or `'-'` filling `'foldtext'` +-- foldopen `'-'` mark the beginning of a fold +-- foldclose `'+'` show a closed fold +-- foldsep `'│'` or `'|'` open fold middle marker +-- diff `'-'` deleted lines of the `'diff'` option +-- msgsep ' ' message separator `'display'` +-- eob `'~'` empty lines at the end of a buffer +-- lastline `'@'` `'display'` contains lastline/truncate +-- +-- Any one that is omitted will fall back to the default. For "stl" and +-- "stlnc" the space will be used when there is highlighting, `'^'` or `'='` +-- otherwise. +-- +-- Note that "horiz", "horizup", "horizdown", "vertleft", "vertright" and +-- "verthoriz" are only used when `'laststatus'` is 3, since only vertical +-- window separators are used otherwise. +-- +-- If `'ambiwidth'` is "double" then "horiz", "horizup", "horizdown", +-- "vert", "vertleft", "vertright", "verthoriz", "foldsep" and "fold" +-- default to single-byte alternatives. +-- +-- Example: > +-- :set fillchars=stl:^,stlnc:=,vert:│,fold:·,diff:- +-- < This is similar to the default, except that these characters will also +-- be used when there is highlighting. +-- +-- For the "stl", "stlnc", "foldopen", "foldclose" and "foldsep" items +-- single-byte and multibyte characters are supported. But double-width +-- characters are not supported. +-- +-- The highlighting used for these items: +-- item highlight group ~ +-- stl StatusLine |hl-StatusLine| +-- stlnc StatusLineNC |hl-StatusLineNC| +-- wbr WinBar |hl-WinBar| or |hl-WinBarNC| +-- horiz WinSeparator |hl-WinSeparator| +-- horizup WinSeparator |hl-WinSeparator| +-- horizdown WinSeparator |hl-WinSeparator| +-- vert WinSeparator |hl-WinSeparator| +-- vertleft WinSeparator |hl-WinSeparator| +-- vertright WinSeparator |hl-WinSeparator| +-- verthoriz WinSeparator |hl-WinSeparator| +-- fold Folded |hl-Folded| +-- diff DiffDelete |hl-DiffDelete| +-- eob EndOfBuffer |hl-EndOfBuffer| +-- lastline NonText |hl-NonText| +--- @class vim.opt.fillchars: vim.Option,table +--- @operator add: vim.opt.fillchars +--- @operator sub: vim.opt.fillchars +--- @operator pow: vim.opt.fillchars +vim.opt.fillchars = "" +vim.opt.fcs = vim.opt.fillchars +--- @return table +function vim.opt.fillchars:get()end + +-- `'fixendofline'` `'fixeol'` boolean (default on) +-- local to buffer +-- When writing a file and this option is on, at the end of file +-- will be restored if missing. Turn this option off if you want to +-- preserve the situation from the original file. +-- When the `'binary'` option is set the value of this option doesn't +-- matter. +-- See the `'endofline'` option. +-- See |eol-and-eof| for example settings. +--- @class vim.opt.fixendofline: vim.Option,boolean +--- @operator add: vim.opt.fixendofline +--- @operator sub: vim.opt.fixendofline +--- @operator pow: vim.opt.fixendofline +vim.opt.fixendofline = true +vim.opt.fixeol = vim.opt.fixendofline +--- @return boolean +function vim.opt.fixendofline:get()end + +-- `'foldclose'` `'fcl'` string (default "") +-- global +-- When set to "all", a fold is closed when the cursor isn't in it and +-- its level is higher than `'foldlevel'` . Useful if you want folds to +-- automatically close when moving out of them. +--- @class vim.opt.foldclose: vim.Option,string[] +--- @operator add: vim.opt.foldclose +--- @operator sub: vim.opt.foldclose +--- @operator pow: vim.opt.foldclose +vim.opt.foldclose = "" +vim.opt.fcl = vim.opt.foldclose +--- @return string[] +function vim.opt.foldclose:get()end + +-- `'foldcolumn'` `'fdc'` string (default "0") +-- local to window +-- When and how to draw the foldcolumn. Valid values are: +-- "auto": resize to the minimum amount of folds to display. +-- "auto:[1-9]": resize to accommodate multiple folds up to the +-- selected level +-- 0: to disable foldcolumn +-- "[1-9]": to display a fixed number of columns +-- See |folding|. +--- @class vim.opt.foldcolumn: vim.Option,string +--- @operator add: vim.opt.foldcolumn +--- @operator sub: vim.opt.foldcolumn +--- @operator pow: vim.opt.foldcolumn +vim.opt.foldcolumn = "0" +vim.opt.fdc = vim.opt.foldcolumn +--- @return string +function vim.opt.foldcolumn:get()end + +-- `'foldenable'` `'fen'` boolean (default on) +-- local to window +-- When off, all folds are open. This option can be used to quickly +-- switch between showing all text unfolded and viewing the text with +-- folds (including manually opened or closed folds). It can be toggled +-- with the |zi| command. The `'foldcolumn'` will remain blank when +-- `'foldenable'` is off. +-- This option is set by commands that create a new fold or close a fold. +-- See |folding|. +--- @class vim.opt.foldenable: vim.Option,boolean +--- @operator add: vim.opt.foldenable +--- @operator sub: vim.opt.foldenable +--- @operator pow: vim.opt.foldenable +vim.opt.foldenable = true +vim.opt.fen = vim.opt.foldenable +--- @return boolean +function vim.opt.foldenable:get()end + +-- `'foldexpr'` `'fde'` string (default: "0") +-- local to window +-- The expression used for when `'foldmethod'` is "expr". It is evaluated +-- for each line to obtain its fold level. The context is set to the +-- script where `'foldexpr'` was set, script-local items can be accessed. +-- See |fold-expr| for the usage. +-- +-- The expression will be evaluated in the |sandbox| if set from a +-- modeline, see |sandbox-option|. +-- This option can't be set from a |modeline| when the `'diff'` option is +-- on or the `'modelineexpr'` option is off. +-- +-- It is not allowed to change text or jump to another window while +-- evaluating `'foldexpr'` |textlock|. +--- @class vim.opt.foldexpr: vim.Option,string +--- @operator add: vim.opt.foldexpr +--- @operator sub: vim.opt.foldexpr +--- @operator pow: vim.opt.foldexpr +vim.opt.foldexpr = "0" +vim.opt.fde = vim.opt.foldexpr +--- @return string +function vim.opt.foldexpr:get()end + +-- `'foldignore'` `'fdi'` string (default: "#") +-- local to window +-- Used only when `'foldmethod'` is "indent". Lines starting with +-- characters in `'foldignore'` will get their fold level from surrounding +-- lines. White space is skipped before checking for this character. +-- The default "#" works well for C programs. See |fold-indent|. +--- @class vim.opt.foldignore: vim.Option,string +--- @operator add: vim.opt.foldignore +--- @operator sub: vim.opt.foldignore +--- @operator pow: vim.opt.foldignore +vim.opt.foldignore = "#" +vim.opt.fdi = vim.opt.foldignore +--- @return string +function vim.opt.foldignore:get()end + +-- `'foldlevel'` `'fdl'` number (default: 0) +-- local to window +-- Sets the fold level: Folds with a higher level will be closed. +-- Setting this option to zero will close all folds. Higher numbers will +-- close fewer folds. +-- This option is set by commands like |zm|, |zM| and |zR|. +-- See |fold-foldlevel|. +--- @class vim.opt.foldlevel: vim.Option,number +--- @operator add: vim.opt.foldlevel +--- @operator sub: vim.opt.foldlevel +--- @operator pow: vim.opt.foldlevel +vim.opt.foldlevel = 0 +vim.opt.fdl = vim.opt.foldlevel +--- @return number +function vim.opt.foldlevel:get()end + +-- `'foldlevelstart'` `'fdls'` number (default: -1) +-- global +-- Sets `'foldlevel'` when starting to edit another buffer in a window. +-- Useful to always start editing with all folds closed (value zero), +-- some folds closed (one) or no folds closed (99). +-- This is done before reading any modeline, thus a setting in a modeline +-- overrules this option. Starting to edit a file for |diff-mode| also +-- ignores this option and closes all folds. +-- It is also done before BufReadPre autocommands, to allow an autocmd to +-- overrule the `'foldlevel'` value for specific files. +-- When the value is negative, it is not used. +--- @class vim.opt.foldlevelstart: vim.Option,number +--- @operator add: vim.opt.foldlevelstart +--- @operator sub: vim.opt.foldlevelstart +--- @operator pow: vim.opt.foldlevelstart +vim.opt.foldlevelstart = -1 +vim.opt.fdls = vim.opt.foldlevelstart +--- @return number +function vim.opt.foldlevelstart:get()end + +-- `'foldmarker'` `'fmr'` string (default: "{{{,}}}") +-- local to window +-- The start and end marker used when `'foldmethod'` is "marker". There +-- must be one comma, which separates the start and end marker. The +-- marker is a literal string (a regular expression would be too slow). +-- See |fold-marker|. +--- @class vim.opt.foldmarker: vim.Option,string[] +--- @operator add: vim.opt.foldmarker +--- @operator sub: vim.opt.foldmarker +--- @operator pow: vim.opt.foldmarker +vim.opt.foldmarker = "{{{,}}}" +vim.opt.fmr = vim.opt.foldmarker +--- @return string[] +function vim.opt.foldmarker:get()end + +-- `'foldmethod'` `'fdm'` string (default: "manual") +-- local to window +-- The kind of folding used for the current window. Possible values: +-- |fold-manual| manual Folds are created manually. +-- |fold-indent| indent Lines with equal indent form a fold. +-- |fold-expr| expr `'foldexpr'` gives the fold level of a line. +-- |fold-marker| marker Markers are used to specify folds. +-- |fold-syntax| syntax Syntax highlighting items specify folds. +-- |fold-diff| diff Fold text that is not changed. +--- @class vim.opt.foldmethod: vim.Option,string +--- @operator add: vim.opt.foldmethod +--- @operator sub: vim.opt.foldmethod +--- @operator pow: vim.opt.foldmethod +vim.opt.foldmethod = "manual" +vim.opt.fdm = vim.opt.foldmethod +--- @return string +function vim.opt.foldmethod:get()end + +-- `'foldminlines'` `'fml'` number (default: 1) +-- local to window +-- Sets the number of screen lines above which a fold can be displayed +-- closed. Also for manually closed folds. With the default value of +-- one a fold can only be closed if it takes up two or more screen lines. +-- Set to zero to be able to close folds of just one screen line. +-- Note that this only has an effect on what is displayed. After using +-- "zc" to close a fold, which is displayed open because it's smaller +-- than `'foldminlines'` , a following "zc" may close a containing fold. +--- @class vim.opt.foldminlines: vim.Option,number +--- @operator add: vim.opt.foldminlines +--- @operator sub: vim.opt.foldminlines +--- @operator pow: vim.opt.foldminlines +vim.opt.foldminlines = 1 +vim.opt.fml = vim.opt.foldminlines +--- @return number +function vim.opt.foldminlines:get()end + +-- `'foldnestmax'` `'fdn'` number (default: 20) +-- local to window +-- Sets the maximum nesting of folds for the "indent" and "syntax" +-- methods. This avoids that too many folds will be created. Using more +-- than 20 doesn't work, because the internal limit is 20. +--- @class vim.opt.foldnestmax: vim.Option,number +--- @operator add: vim.opt.foldnestmax +--- @operator sub: vim.opt.foldnestmax +--- @operator pow: vim.opt.foldnestmax +vim.opt.foldnestmax = 20 +vim.opt.fdn = vim.opt.foldnestmax +--- @return number +function vim.opt.foldnestmax:get()end + +-- `'foldopen'` `'fdo'` string (default: "block,hor,mark,percent,quickfix, +-- search,tag,undo") +-- global +-- Specifies for which type of commands folds will be opened, if the +-- command moves the cursor into a closed fold. It is a comma-separated +-- list of items. +-- NOTE: When the command is part of a mapping this option is not used. +-- Add the |zv| command to the mapping to get the same effect. +-- (rationale: the mapping may want to control opening folds itself) +-- +-- item commands ~ +-- all any +-- block "(", "{", "[[", "[{", etc. +-- hor horizontal movements: "l", "w", "fx", etc. +-- insert any command in Insert mode +-- jump far jumps: "G", "gg", etc. +-- mark jumping to a mark: "'m", CTRL-O, etc. +-- percent "%" +-- quickfix ":cn", ":crew", ":make", etc. +-- search search for a pattern: "/", "n", "*", "gd", etc. +-- (not for a search pattern in a ":" command) +-- Also for |[s| and |]s|. +-- tag jumping to a tag: ":ta", CTRL-T, etc. +-- undo undo or redo: "u" and CTRL-R +-- When a movement command is used for an operator (e.g., "dl" or "y%") +-- this option is not used. This means the operator will include the +-- whole closed fold. +-- Note that vertical movements are not here, because it would make it +-- very difficult to move onto a closed fold. +-- In insert mode the folds containing the cursor will always be open +-- when text is inserted. +-- To close folds you can re-apply `'foldlevel'` with the |zx| command or +-- set the `'foldclose'` option to "all". +--- @class vim.opt.foldopen: vim.Option,string[] +--- @operator add: vim.opt.foldopen +--- @operator sub: vim.opt.foldopen +--- @operator pow: vim.opt.foldopen +vim.opt.foldopen = "block,hor,mark,percent,quickfix,search,tag,undo" +vim.opt.fdo = vim.opt.foldopen +--- @return string[] +function vim.opt.foldopen:get()end + +-- `'foldtext'` `'fdt'` string (default: "foldtext()") +-- local to window +-- An expression which is used to specify the text displayed for a closed +-- fold. The context is set to the script where `'foldexpr'` was set, +-- script-local items can be accessed. See |fold-foldtext| for the +-- usage. +-- +-- The expression will be evaluated in the |sandbox| if set from a +-- modeline, see |sandbox-option|. +-- This option cannot be set in a modeline when `'modelineexpr'` is off. +-- +-- It is not allowed to change text or jump to another window while +-- evaluating `'foldtext'` |textlock|. +--- @class vim.opt.foldtext: vim.Option,string +--- @operator add: vim.opt.foldtext +--- @operator sub: vim.opt.foldtext +--- @operator pow: vim.opt.foldtext +vim.opt.foldtext = "foldtext()" +vim.opt.fdt = vim.opt.foldtext +--- @return string +function vim.opt.foldtext:get()end + +-- `'formatexpr'` `'fex'` string (default "") +-- local to buffer +-- Expression which is evaluated to format a range of lines for the |gq| +-- operator or automatic formatting (see `'formatoptions'` ). When this +-- option is empty `'formatprg'` is used. +-- +-- The |v:lnum| variable holds the first line to be formatted. +-- The |v:count| variable holds the number of lines to be formatted. +-- The |v:char| variable holds the character that is going to be +-- inserted if the expression is being evaluated due to +-- automatic formatting. This can be empty. Don't insert +-- it yet! +-- +-- Example: > +-- :set formatexpr=mylang#Format() +-- < This will invoke the mylang#Format() function in the +-- autoload/mylang.vim file in `'runtimepath'` . |autoload| +-- +-- The expression is also evaluated when `'textwidth'` is set and adding +-- text beyond that limit. This happens under the same conditions as +-- when internal formatting is used. Make sure the cursor is kept in the +-- same spot relative to the text then! The |mode()| function will +-- return "i" or "R" in this situation. +-- +-- When the expression evaluates to non-zero Vim will fall back to using +-- the internal format mechanism. +-- +-- If the expression starts with s: or ||, then it is replaced with +-- the script ID (|local-function|). Example: > +-- set formatexpr=s:MyFormatExpr() +-- set formatexpr=SomeFormatExpr() +-- < Otherwise, the expression is evaluated in the context of the script +-- where the option was set, thus script-local items are available. +-- +-- The expression will be evaluated in the |sandbox| when set from a +-- modeline, see |sandbox-option|. That stops the option from working, +-- since changing the buffer text is not allowed. +-- This option cannot be set in a modeline when `'modelineexpr'` is off. +-- NOTE: This option is set to "" when `'compatible'` is set. +--- @class vim.opt.formatexpr: vim.Option,string +--- @operator add: vim.opt.formatexpr +--- @operator sub: vim.opt.formatexpr +--- @operator pow: vim.opt.formatexpr +vim.opt.formatexpr = "" +vim.opt.fex = vim.opt.formatexpr +--- @return string +function vim.opt.formatexpr:get()end + +-- `'formatlistpat'` `'flp'` string (default: "^\s*\d\+[\]:.)}\t ]\s*") +-- local to buffer +-- A pattern that is used to recognize a list header. This is used for +-- the "n" flag in `'formatoptions'` . +-- The pattern must match exactly the text that will be the indent for +-- the line below it. You can use |/\ze| to mark the end of the match +-- while still checking more characters. There must be a character +-- following the pattern, when it matches the whole line it is handled +-- like there is no match. +-- The default recognizes a number, followed by an optional punctuation +-- character and white space. +--- @class vim.opt.formatlistpat: vim.Option,string +--- @operator add: vim.opt.formatlistpat +--- @operator sub: vim.opt.formatlistpat +--- @operator pow: vim.opt.formatlistpat +vim.opt.formatlistpat = "^\\s*\\d\\+[\\]:.)}\\t ]\\s*" +vim.opt.flp = vim.opt.formatlistpat +--- @return string +function vim.opt.formatlistpat:get()end + +-- `'formatoptions'` `'fo'` string (default: "tcqj") +-- local to buffer +-- This is a sequence of letters which describes how automatic +-- formatting is to be done. See |fo-table|. Commas can be inserted for +-- readability. +-- To avoid problems with flags that are added in the future, use the +-- "+=" and "-=" feature of ":set" |add-option-flags|. +--- @class vim.opt.formatoptions: vim.Option,string[] +--- @operator add: vim.opt.formatoptions +--- @operator sub: vim.opt.formatoptions +--- @operator pow: vim.opt.formatoptions +vim.opt.formatoptions = "tcqj" +vim.opt.fo = vim.opt.formatoptions +--- @return string[] +function vim.opt.formatoptions:get()end + +-- `'formatprg'` `'fp'` string (default "") +-- global or local to buffer |global-local| +-- The name of an external program that will be used to format the lines +-- selected with the |gq| operator. The program must take the input on +-- stdin and produce the output on stdout. The Unix program "fmt" is +-- such a program. +-- If the `'formatexpr'` option is not empty it will be used instead. +-- Otherwise, if `'formatprg'` option is an empty string, the internal +-- format function will be used |C-indenting|. +-- Environment variables are expanded |:set_env|. See |option-backslash| +-- about including spaces and backslashes. +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +--- @class vim.opt.formatprg: vim.Option,string +--- @operator add: vim.opt.formatprg +--- @operator sub: vim.opt.formatprg +--- @operator pow: vim.opt.formatprg +vim.opt.formatprg = "" +vim.opt.fp = vim.opt.formatprg +--- @return string +function vim.opt.formatprg:get()end + +-- `'fsync'` `'fs'` boolean (default off) +-- global +-- When on, the OS function fsync() will be called after saving a file +-- (|:write|, |writefile()|, …), |swap-file|, |undo-persistence| and |shada-file|. +-- This flushes the file to disk, ensuring that it is safely written. +-- Slow on some systems: writing buffers, quitting Nvim, and other +-- operations may sometimes take a few seconds. +-- +-- Files are ALWAYS flushed (`'fsync'` is ignored) when: +-- - |CursorHold| event is triggered +-- - |:preserve| is called +-- - system signals low battery life +-- - Nvim exits abnormally +-- +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +--- @class vim.opt.fsync: vim.Option,boolean +--- @operator add: vim.opt.fsync +--- @operator sub: vim.opt.fsync +--- @operator pow: vim.opt.fsync +vim.opt.fsync = false +vim.opt.fs = vim.opt.fsync +--- @return boolean +function vim.opt.fsync:get()end + +-- `'gdefault'` `'gd'` boolean (default off) +-- global +-- When on, the ":substitute" flag `'g'` is default on. This means that +-- all matches in a line are substituted instead of one. When a `'g'` flag +-- is given to a ":substitute" command, this will toggle the substitution +-- of all or one match. See |complex-change|. +-- +-- command `'gdefault'` on `'gdefault'` off ~ +-- :s/// subst. all subst. one +-- :s///g subst. one subst. all +-- :s///gg subst. all subst. one +-- +-- DEPRECATED: Setting this option may break plugins that are not aware +-- of this option. Also, many users get confused that adding the /g flag +-- has the opposite effect of that it normally does. +--- @class vim.opt.gdefault: vim.Option,boolean +--- @operator add: vim.opt.gdefault +--- @operator sub: vim.opt.gdefault +--- @operator pow: vim.opt.gdefault +vim.opt.gdefault = false +vim.opt.gd = vim.opt.gdefault +--- @return boolean +function vim.opt.gdefault:get()end + +-- `'grepformat'` `'gfm'` string (default "%f:%l:%m,%f:%l%m,%f %l%m") +-- global +-- Format to recognize for the ":grep" command output. +-- This is a scanf-like string that uses the same format as the +-- `'errorformat'` option: see |errorformat|. +--- @class vim.opt.grepformat: vim.Option,string[] +--- @operator add: vim.opt.grepformat +--- @operator sub: vim.opt.grepformat +--- @operator pow: vim.opt.grepformat +vim.opt.grepformat = "%f:%l:%m,%f:%l%m,%f %l%m" +vim.opt.gfm = vim.opt.grepformat +--- @return string[] +function vim.opt.grepformat:get()end + +-- `'grepprg'` `'gp'` string (default "grep -n ", +-- Unix: "grep -n $* /dev/null") +-- global or local to buffer |global-local| +-- Program to use for the |:grep| command. This option may contain `'%'` +-- and `'#'` characters, which are expanded like when used in a command- +-- 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: > +-- :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|. +-- See also the section |:make_makeprg|, since most of the comments there +-- apply equally to `'grepprg'` . +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +--- @class vim.opt.grepprg: vim.Option,string +--- @operator add: vim.opt.grepprg +--- @operator sub: vim.opt.grepprg +--- @operator pow: vim.opt.grepprg +vim.opt.grepprg = "grep -n $* /dev/null" +vim.opt.gp = vim.opt.grepprg +--- @return string +function vim.opt.grepprg:get()end + +-- `'guicursor'` `'gcr'` string (default "n-v-c-sm:block,i-ci-ve:ver25,r-cr-o:hor20") +-- global +-- Configures the cursor style for each mode. Works in the GUI and many +-- terminals. See |tui-cursor-shape|. +-- +-- To disable cursor-styling, reset the option: > +-- :set guicursor= +-- +-- < To enable mode shapes, "Cursor" highlight, and blinking: > +-- :set guicursor=n-v-c:block,i-ci-ve:ver25,r-cr:hor20,o:hor50 +-- \,a:blinkwait700-blinkoff400-blinkon250-Cursor/lCursor +-- \,sm:block-blinkwait175-blinkoff150-blinkon175 +-- +-- < The option is a comma-separated list of parts. Each part consists of a +-- mode-list and an argument-list: +-- mode-list:argument-list,mode-list:argument-list,.. +-- The mode-list is a dash separated list of these modes: +-- n Normal mode +-- v Visual mode +-- ve Visual mode with `'selection'` "exclusive" (same as `'v'` , +-- if not specified) +-- o Operator-pending mode +-- i Insert mode +-- r Replace mode +-- c Command-line Normal (append) mode +-- ci Command-line Insert mode +-- cr Command-line Replace mode +-- sm showmatch in Insert mode +-- a all modes +-- The argument-list is a dash separated list of these arguments: +-- hor{N} horizontal bar, {N} percent of the character height +-- ver{N} vertical bar, {N} percent of the character width +-- block block cursor, fills the whole character +-- - Only one of the above three should be present. +-- - Default is "block" for each mode. +-- blinkwait{N} +-- blinkon{N} +-- blinkoff{N} +-- blink times for cursor: blinkwait is the delay before +-- the cursor starts blinking, blinkon is the time that +-- the cursor is shown and blinkoff is the time that the +-- cursor is not shown. Times are in msec. When one of +-- the numbers is zero, there is no blinking. E.g.: > +-- :set guicursor=n:blinkon0 +-- < - Default is "blinkon0" for each mode. +-- {group-name} +-- Highlight group that decides the color and font of the +-- cursor. +-- In the |TUI|: +-- - |inverse|/reverse and no group-name are interpreted +-- as "host-terminal default cursor colors" which +-- typically means "inverted bg and fg colors". +-- - |ctermfg| and |guifg| are ignored. +-- {group-name}/{group-name} +-- Two highlight group names, the first is used when +-- no language mappings are used, the other when they +-- are. |language-mapping| +-- +-- Examples of parts: +-- n-c-v:block-nCursor In Normal, Command-line and Visual mode, use a +-- block cursor with colors from the "nCursor" +-- highlight group +-- n-v-c-sm:block,i-ci-ve:ver25-Cursor,r-cr-o:hor20 +-- In Normal et al. modes, use a block cursor +-- with the default colors defined by the host +-- terminal. In Insert-likes modes, use +-- a vertical bar cursor with colors from +-- "Cursor" highlight group. In Replace-likes +-- modes, use a underline cursor with +-- default colors. +-- i-ci:ver30-iCursor-blinkwait300-blinkon200-blinkoff150 +-- In Insert and Command-line Insert mode, use a +-- 30% vertical bar cursor with colors from the +-- "iCursor" highlight group. Blink a bit +-- faster. +-- +-- The `'a'` mode is different. It will set the given argument-list for +-- all modes. It does not reset anything to defaults. This can be used +-- to do a common setting for all modes. For example, to switch off +-- blinking: "a:blinkon0" +-- +-- Examples of cursor highlighting: > +-- :highlight Cursor gui=reverse guifg=NONE guibg=NONE +-- :highlight Cursor gui=NONE guifg=bg guibg=fg +-- < +--- @class vim.opt.guicursor: vim.Option,string[] +--- @operator add: vim.opt.guicursor +--- @operator sub: vim.opt.guicursor +--- @operator pow: vim.opt.guicursor +vim.opt.guicursor = "n-v-c-sm:block,i-ci-ve:ver25,r-cr-o:hor20" +vim.opt.gcr = vim.opt.guicursor +--- @return string[] +function vim.opt.guicursor:get()end + +-- `'guifont'` `'gfn'` string (default "") +-- global +-- This is a list of fonts which will be used for the GUI version of Vim. +-- In its simplest form the value is just one font name. When +-- the font cannot be found you will get an error message. To try other +-- font names a list can be specified, font names separated with commas. +-- The first valid font is used. +-- +-- Spaces after a comma are ignored. To include a comma in a font name +-- precede it with a backslash. Setting an option requires an extra +-- backslash before a space and a backslash. See also +-- |option-backslash|. For example: > +-- :set guifont=Screen15,\ 7x13,font\\,with\\,commas +-- < will make Vim try to use the font "Screen15" first, and if it fails it +-- will try to use "7x13" and then "font,with,commas" instead. +-- +-- If none of the fonts can be loaded, Vim will keep the current setting. +-- If an empty font list is given, Vim will try using other resource +-- settings (for X, it will use the Vim.font resource), and finally it +-- will try some builtin default which should always be there ("7x13" in +-- the case of X). The font names given should be "normal" fonts. Vim +-- will try to find the related bold and italic fonts. +-- +-- For Win32 and Mac OS: > +-- :set guifont=* +-- < will bring up a font requester, where you can pick the font you want. +-- +-- The font name depends on the GUI used. +-- +-- For Mac OSX you can use something like this: > +-- :set guifont=Monaco:h10 +-- < +-- Note that the fonts must be mono-spaced (all characters have the same +-- width). +-- +-- To preview a font on X11, you might be able to use the "xfontsel" +-- program. The "xlsfonts" program gives a list of all available fonts. +-- +-- For the Win32 GUI +-- - takes these options in the font name: +-- hXX - height is XX (points, can be floating-point) +-- wXX - width is XX (points, can be floating-point) +-- b - bold +-- i - italic +-- u - underline +-- s - strikeout +-- cXX - character set XX. Valid charsets are: ANSI, ARABIC, +-- BALTIC, CHINESEBIG5, DEFAULT, EASTEUROPE, GB2312, GREEK, +-- HANGEUL, HEBREW, JOHAB, MAC, OEM, RUSSIAN, SHIFTJIS, +-- SYMBOL, THAI, TURKISH, VIETNAMESE ANSI and BALTIC. +-- Normally you would use "cDEFAULT". +-- +-- Use a `':'` to separate the options. +-- - A `'_'` can be used in the place of a space, so you don't need to use +-- backslashes to escape the spaces. +-- - Examples: > +-- :set guifont=courier_new:h12:w5:b:cRUSSIAN +-- :set guifont=Andale_Mono:h7.5:w4.5 +-- < +--- @class vim.opt.guifont: vim.Option,string[] +--- @operator add: vim.opt.guifont +--- @operator sub: vim.opt.guifont +--- @operator pow: vim.opt.guifont +vim.opt.guifont = "" +vim.opt.gfn = vim.opt.guifont +--- @return string[] +function vim.opt.guifont:get()end + +-- `'guifontwide'` `'gfw'` string (default "") +-- global +-- Comma-separated list of fonts to be used for double-width characters. +-- The first font that can be loaded is used. +-- Note: The size of these fonts must be exactly twice as wide as the one +-- specified with `'guifont'` and the same height. +-- +-- When `'guifont'` has a valid font and `'guifontwide'` is empty Vim will +-- attempt to set `'guifontwide'` to a matching double-width font. +--- @class vim.opt.guifontwide: vim.Option,string[] +--- @operator add: vim.opt.guifontwide +--- @operator sub: vim.opt.guifontwide +--- @operator pow: vim.opt.guifontwide +vim.opt.guifontwide = "" +vim.opt.gfw = vim.opt.guifontwide +--- @return string[] +function vim.opt.guifontwide:get()end + +-- `'guioptions'` `'go'` string (default "egmrLT" (MS-Windows)) +-- global +-- This option only has an effect in the GUI version of Vim. It is a +-- sequence of letters which describes what components and options of the +-- GUI should be used. +-- To avoid problems with flags that are added in the future, use the +-- "+=" and "-=" feature of ":set" |add-option-flags|. +-- +-- Valid letters are as follows: +-- +-- `'a'` Autoselect: If present, then whenever VISUAL mode is started, +-- or the Visual area extended, Vim tries to become the owner of +-- the windowing system's global selection. This means that the +-- Visually highlighted text is available for pasting into other +-- applications as well as into Vim itself. When the Visual mode +-- ends, possibly due to an operation on the text, or when an +-- application wants to paste the selection, the highlighted text +-- is automatically yanked into the "* selection register. +-- Thus the selection is still available for pasting into other +-- applications after the VISUAL mode has ended. +-- If not present, then Vim won't become the owner of the +-- windowing system's global selection unless explicitly told to +-- by a yank or delete operation for the "* register. +-- The same applies to the modeless selection. +-- +-- `'P'` Like autoselect but using the "+ register instead of the "* +-- register. +-- +-- `'A'` Autoselect for the modeless selection. Like `'a'` , but only +-- applies to the modeless selection. +-- +-- `'guioptions'` autoselect Visual autoselect modeless ~ +-- "" - - +-- "a" yes yes +-- "A" - yes +-- "aA" yes yes +-- +-- +-- `'c'` Use console dialogs instead of popup dialogs for simple +-- choices. +-- +-- `'d'` Use dark theme variant if available. +-- +-- `'e'` Add tab pages when indicated with `'showtabline'` . +-- `'guitablabel'` can be used to change the text in the labels. +-- When `'e'` is missing a non-GUI tab pages line may be used. +-- The GUI tabs are only supported on some systems, currently +-- Mac OS/X and MS-Windows. +-- +-- `'i'` Use a Vim icon. +-- +-- `'m'` Menu bar is present. +-- +-- `'M'` The system menu "$VIMRUNTIME/menu.vim" is not sourced. Note +-- that this flag must be added in the vimrc file, before +-- switching on syntax or filetype recognition (when the |gvimrc| +-- file is sourced the system menu has already been loaded; the +-- `:syntax on` and `:filetype on` commands load the menu too). +-- +-- `'g'` Grey menu items: Make menu items that are not active grey. If +-- `'g'` is not included inactive menu items are not shown at all. +-- +-- `'T'` Include Toolbar. Currently only in Win32 GUI. +-- +-- `'r'` Right-hand scrollbar is always present. +-- +-- `'R'` Right-hand scrollbar is present when there is a vertically +-- split window. +-- +-- `'l'` Left-hand scrollbar is always present. +-- +-- `'L'` Left-hand scrollbar is present when there is a vertically +-- split window. +-- +-- `'b'` Bottom (horizontal) scrollbar is present. Its size depends on +-- the longest visible line, or on the cursor line if the `'h'` +-- flag is included. |gui-horiz-scroll| +-- +-- `'h'` Limit horizontal scrollbar size to the length of the cursor +-- line. Reduces computations. |gui-horiz-scroll| +-- +-- And yes, you may even have scrollbars on the left AND the right if +-- you really want to :-). See |gui-scrollbars| for more information. +-- +-- +-- `'v'` Use a vertical button layout for dialogs. When not included, +-- a horizontal layout is preferred, but when it doesn't fit a +-- vertical layout is used anyway. Not supported in GTK 3. +-- +-- `'p'` Use Pointer callbacks for X11 GUI. This is required for some +-- window managers. If the cursor is not blinking or hollow at +-- the right moment, try adding this flag. This must be done +-- before starting the GUI. Set it in your |gvimrc|. Adding or +-- removing it after the GUI has started has no effect. +-- +-- `'k'` Keep the GUI window size when adding/removing a scrollbar, or +-- toolbar, tabline, etc. Instead, the behavior is similar to +-- when the window is maximized and will adjust `'lines'` and +-- `'columns'` to fit to the window. Without the `'k'` flag Vim will +-- try to keep `'lines'` and `'columns'` the same when adding and +-- removing GUI components. +--- @class vim.opt.guioptions: vim.Option,string +--- @operator add: vim.opt.guioptions +--- @operator sub: vim.opt.guioptions +--- @operator pow: vim.opt.guioptions +vim.opt.guioptions = "" +vim.opt.go = vim.opt.guioptions +--- @return string +function vim.opt.guioptions:get()end + +-- `'guitablabel'` `'gtl'` string (default empty) +-- global +-- When non-empty describes the text to use in a label of the GUI tab +-- pages line. When empty and when the result is empty Vim will use a +-- default label. See |setting-guitablabel| for more info. +-- +-- The format of this option is like that of `'statusline'` . +-- `'guitabtooltip'` is used for the tooltip, see below. +-- The expression will be evaluated in the |sandbox| when set from a +-- modeline, see |sandbox-option|. +-- This option cannot be set in a modeline when `'modelineexpr'` is off. +-- +-- Only used when the GUI tab pages line is displayed. `'e'` must be +-- present in `'guioptions'` . For the non-GUI tab pages line `'tabline'` is +-- used. +--- @class vim.opt.guitablabel: vim.Option,string +--- @operator add: vim.opt.guitablabel +--- @operator sub: vim.opt.guitablabel +--- @operator pow: vim.opt.guitablabel +vim.opt.guitablabel = "" +vim.opt.gtl = vim.opt.guitablabel +--- @return string +function vim.opt.guitablabel:get()end + +-- `'guitabtooltip'` `'gtt'` string (default empty) +-- global +-- When non-empty describes the text to use in a tooltip for the GUI tab +-- pages line. When empty Vim will use a default tooltip. +-- This option is otherwise just like `'guitablabel'` above. +-- You can include a line break. Simplest method is to use |:let|: > +-- :let &guitabtooltip = "line one\nline two" +-- < +--- @class vim.opt.guitabtooltip: vim.Option,string +--- @operator add: vim.opt.guitabtooltip +--- @operator sub: vim.opt.guitabtooltip +--- @operator pow: vim.opt.guitabtooltip +vim.opt.guitabtooltip = "" +vim.opt.gtt = vim.opt.guitabtooltip +--- @return string +function vim.opt.guitabtooltip:get()end + +-- `'helpfile'` `'hf'` string (default (MS-Windows) "$VIMRUNTIME\doc\help.txt" +-- (others) "$VIMRUNTIME/doc/help.txt") +-- global +-- Name of the main help file. All distributed help files should be +-- placed together in one directory. Additionally, all "doc" directories +-- in `'runtimepath'` will be used. +-- Environment variables are expanded |:set_env|. For example: +-- "$VIMRUNTIME/doc/help.txt". If $VIMRUNTIME is not set, $VIM is also +-- tried. Also see |$VIMRUNTIME| and |option-backslash| about including +-- spaces and backslashes. +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +--- @class vim.opt.helpfile: vim.Option,string +--- @operator add: vim.opt.helpfile +--- @operator sub: vim.opt.helpfile +--- @operator pow: vim.opt.helpfile +vim.opt.helpfile = "/tmp/nvim/squashfs-root/usr/share/nvim/runtime/doc/help.txt" +vim.opt.hf = vim.opt.helpfile +--- @return string +function vim.opt.helpfile:get()end + +-- `'helpheight'` `'hh'` number (default 20) +-- global +-- Minimal initial height of the help window when it is opened with the +-- ":help" command. The initial height of the help window is half of the +-- current window, or (when the `'ea'` option is on) the same as other +-- windows. When the height is less than `'helpheight'` , the height is +-- set to `'helpheight'` . Set to zero to disable. +--- @class vim.opt.helpheight: vim.Option,number +--- @operator add: vim.opt.helpheight +--- @operator sub: vim.opt.helpheight +--- @operator pow: vim.opt.helpheight +vim.opt.helpheight = 20 +vim.opt.hh = vim.opt.helpheight +--- @return number +function vim.opt.helpheight:get()end + +-- `'helplang'` `'hlg'` string (default: messages language or empty) +-- global +-- Comma-separated list of languages. Vim will use the first language +-- for which the desired help can be found. The English help will always +-- be used as a last resort. You can add "en" to prefer English over +-- another language, but that will only find tags that exist in that +-- language and not in the English help. +-- Example: > +-- :set helplang=de,it +-- < This will first search German, then Italian and finally English help +-- files. +-- When using |CTRL-]| and ":help!" in a non-English help file Vim will +-- try to find the tag in the current language before using this option. +-- See |help-translated|. +--- @class vim.opt.helplang: vim.Option,string[] +--- @operator add: vim.opt.helplang +--- @operator sub: vim.opt.helplang +--- @operator pow: vim.opt.helplang +vim.opt.helplang = "" +vim.opt.hlg = vim.opt.helplang +--- @return string[] +function vim.opt.helplang:get()end + +-- `'hidden'` `'hid'` boolean (default on) +-- global +-- When off a buffer is unloaded (including loss of undo information) +-- when it is |abandon|ed. When on a buffer becomes hidden when it is +-- |abandon|ed. A buffer displayed in another window does not become +-- hidden, of course. +-- +-- Commands that move through the buffer list sometimes hide a buffer +-- although the `'hidden'` option is off when these three are true: +-- - the buffer is modified +-- - `'autowrite'` is off or writing is not possible +-- - the `'!'` flag was used +-- Also see |windows|. +-- +-- To hide a specific buffer use the `'bufhidden'` option. +-- `'hidden'` is set for one command with ":hide {command}" |:hide|. +--- @class vim.opt.hidden: vim.Option,boolean +--- @operator add: vim.opt.hidden +--- @operator sub: vim.opt.hidden +--- @operator pow: vim.opt.hidden +vim.opt.hidden = true +vim.opt.hid = vim.opt.hidden +--- @return boolean +function vim.opt.hidden:get()end + +--- @class vim.opt.highlight: vim.Option,string[] +--- @operator add: vim.opt.highlight +--- @operator sub: vim.opt.highlight +--- @operator pow: vim.opt.highlight +vim.opt.highlight = "8:SpecialKey,~:EndOfBuffer,z:TermCursor,Z:TermCursorNC,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,y:CurSearch,m:MoreMsg,M:ModeMsg,n:LineNr,a:LineNrAbove,b:LineNrBelow,N:CursorLineNr,G:CursorLineSign,O:CursorLineFoldr:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn,-:Conceal,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,[:PmenuKind,]:PmenuKindSel,{:PmenuExtra,}:PmenuExtraSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine,o:ColorColumn,q:QuickFixLine,0:Whitespace,I:NormalNC" +vim.opt.hl = vim.opt.highlight +--- @return string[] +function vim.opt.highlight:get()end + +-- `'history'` `'hi'` number (default: 10000) +-- global +-- A history of ":" commands, and a history of previous search patterns +-- is remembered. This option decides how many entries may be stored in +-- each of these histories (see |cmdline-editing|). +-- The maximum value is 10000. +--- @class vim.opt.history: vim.Option,number +--- @operator add: vim.opt.history +--- @operator sub: vim.opt.history +--- @operator pow: vim.opt.history +vim.opt.history = 10000 +vim.opt.hi = vim.opt.history +--- @return number +function vim.opt.history:get()end + +--- @class vim.opt.hkmap: vim.Option,boolean +--- @operator add: vim.opt.hkmap +--- @operator sub: vim.opt.hkmap +--- @operator pow: vim.opt.hkmap +vim.opt.hkmap = false +vim.opt.hk = vim.opt.hkmap +--- @return boolean +function vim.opt.hkmap:get()end + +--- @class vim.opt.hkmapp: vim.Option,boolean +--- @operator add: vim.opt.hkmapp +--- @operator sub: vim.opt.hkmapp +--- @operator pow: vim.opt.hkmapp +vim.opt.hkmapp = false +vim.opt.hkp = vim.opt.hkmapp +--- @return boolean +function vim.opt.hkmapp:get()end + +-- `'hlsearch'` `'hls'` boolean (default on) +-- global +-- When there is a previous search pattern, highlight all its matches. +-- The |hl-Search| highlight group determines the highlighting for all +-- matches not under the cursor while the |hl-CurSearch| highlight group +-- (if defined) determines the highlighting for the match under the +-- cursor. If |hl-CurSearch| is not defined, then |hl-Search| is used for +-- both. Note that only the matching text is highlighted, any offsets +-- are not applied. +-- See also: `'incsearch'` and |:match|. +-- When you get bored looking at the highlighted matches, you can turn it +-- off with |:nohlsearch|. This does not change the option value, as +-- soon as you use a search command, the highlighting comes back. +-- `'redrawtime'` specifies the maximum time spent on finding matches. +-- When the search pattern can match an end-of-line, Vim will try to +-- highlight all of the matched text. However, this depends on where the +-- search starts. This will be the first line in the window or the first +-- line below a closed fold. A match in a previous line which is not +-- drawn may not continue in a newly drawn line. +-- You can specify whether the highlight status is restored on startup +-- with the `'h'` flag in `'shada'` |shada-h|. +--- @class vim.opt.hlsearch: vim.Option,boolean +--- @operator add: vim.opt.hlsearch +--- @operator sub: vim.opt.hlsearch +--- @operator pow: vim.opt.hlsearch +vim.opt.hlsearch = true +vim.opt.hls = vim.opt.hlsearch +--- @return boolean +function vim.opt.hlsearch:get()end + +-- `'icon'` boolean (default off, on when title can be restored) +-- global +-- When on, the icon text of the window will be set to the value of +-- `'iconstring'` (if it is not empty), or to the name of the file +-- currently being edited. Only the last part of the name is used. +-- Overridden by the `'iconstring'` option. +-- Only works if the terminal supports setting window icons. +--- @class vim.opt.icon: vim.Option,boolean +--- @operator add: vim.opt.icon +--- @operator sub: vim.opt.icon +--- @operator pow: vim.opt.icon +vim.opt.icon = false +--- @return boolean +function vim.opt.icon:get()end + +-- `'iconstring'` string (default "") +-- global +-- When this option is not empty, it will be used for the icon text of +-- the window. This happens only when the `'icon'` option is on. +-- Only works if the terminal supports setting window icon text +-- When this option contains printf-style `'%'` items, they will be +-- expanded according to the rules used for `'statusline'` . See +-- `'titlestring'` for example settings. +-- This option cannot be set in a modeline when `'modelineexpr'` is off. +--- @class vim.opt.iconstring: vim.Option,string +--- @operator add: vim.opt.iconstring +--- @operator sub: vim.opt.iconstring +--- @operator pow: vim.opt.iconstring +vim.opt.iconstring = "" +--- @return string +function vim.opt.iconstring:get()end + +-- `'ignorecase'` `'ic'` boolean (default off) +-- global +-- Ignore case in search patterns. Also used when searching in the tags +-- file. +-- Also see `'smartcase'` and `'tagcase'` . +-- Can be overruled by using "\c" or "\C" in the pattern, see +-- |/ignorecase|. +--- @class vim.opt.ignorecase: vim.Option,boolean +--- @operator add: vim.opt.ignorecase +--- @operator sub: vim.opt.ignorecase +--- @operator pow: vim.opt.ignorecase +vim.opt.ignorecase = false +vim.opt.ic = vim.opt.ignorecase +--- @return boolean +function vim.opt.ignorecase:get()end + +-- `'imcmdline'` `'imc'` boolean (default off) +-- global +-- When set the Input Method is always on when starting to edit a command +-- line, unless entering a search pattern (see `'imsearch'` for that). +-- Setting this option is useful when your input method allows entering +-- English characters directly, e.g., when it's used to type accented +-- characters with dead keys. +--- @class vim.opt.imcmdline: vim.Option,boolean +--- @operator add: vim.opt.imcmdline +--- @operator sub: vim.opt.imcmdline +--- @operator pow: vim.opt.imcmdline +vim.opt.imcmdline = false +vim.opt.imc = vim.opt.imcmdline +--- @return boolean +function vim.opt.imcmdline:get()end + +-- `'imdisable'` `'imd'` boolean (default off, on for some systems (SGI)) +-- global +-- When set the Input Method is never used. This is useful to disable +-- the IM when it doesn't work properly. +-- Currently this option is on by default for SGI/IRIX machines. This +-- may change in later releases. +--- @class vim.opt.imdisable: vim.Option,boolean +--- @operator add: vim.opt.imdisable +--- @operator sub: vim.opt.imdisable +--- @operator pow: vim.opt.imdisable +vim.opt.imdisable = false +vim.opt.imd = vim.opt.imdisable +--- @return boolean +function vim.opt.imdisable:get()end + +-- `'iminsert'` `'imi'` number (default 0) +-- local to buffer +-- Specifies whether :lmap or an Input Method (IM) is to be used in +-- Insert mode. Valid values: +-- 0 :lmap is off and IM is off +-- 1 :lmap is ON and IM is off +-- 2 :lmap is off and IM is ON +-- To always reset the option to zero when leaving Insert mode with +-- this can be used: > +-- :inoremap :set iminsert=0 +-- < This makes :lmap and IM turn off automatically when leaving Insert +-- mode. +-- Note that this option changes when using CTRL-^ in Insert mode +-- |i_CTRL-^|. +-- The value is set to 1 when setting `'keymap'` to a valid keymap name. +-- It is also used for the argument of commands like "r" and "f". +--- @class vim.opt.iminsert: vim.Option,number +--- @operator add: vim.opt.iminsert +--- @operator sub: vim.opt.iminsert +--- @operator pow: vim.opt.iminsert +vim.opt.iminsert = 0 +vim.opt.imi = vim.opt.iminsert +--- @return number +function vim.opt.iminsert:get()end + +-- `'imsearch'` `'ims'` number (default -1) +-- local to buffer +-- Specifies whether :lmap or an Input Method (IM) is to be used when +-- entering a search pattern. Valid values: +-- -1 the value of `'iminsert'` is used, makes it look like +-- `'iminsert'` is also used when typing a search pattern +-- 0 :lmap is off and IM is off +-- 1 :lmap is ON and IM is off +-- 2 :lmap is off and IM is ON +-- Note that this option changes when using CTRL-^ in Command-line mode +-- |c_CTRL-^|. +-- The value is set to 1 when it is not -1 and setting the `'keymap'` +-- option to a valid keymap name. +--- @class vim.opt.imsearch: vim.Option,number +--- @operator add: vim.opt.imsearch +--- @operator sub: vim.opt.imsearch +--- @operator pow: vim.opt.imsearch +vim.opt.imsearch = -1 +vim.opt.ims = vim.opt.imsearch +--- @return number +function vim.opt.imsearch:get()end + +-- `'inccommand'` `'icm'` string (default "nosplit") +-- global +-- +-- When nonempty, shows the effects of |:substitute|, |:smagic|, +-- |:snomagic| and user commands with the |:command-preview| flag as you +-- type. +-- +-- Possible values: +-- nosplit Shows the effects of a command incrementally in the +-- buffer. +-- split Like "nosplit", but also shows partial off-screen +-- results in a preview window. +-- +-- If the preview for built-in commands is too slow (exceeds +-- `'redrawtime'` ) then `'inccommand'` is automatically disabled until +-- |Command-line-mode| is done. +--- @class vim.opt.inccommand: vim.Option,string +--- @operator add: vim.opt.inccommand +--- @operator sub: vim.opt.inccommand +--- @operator pow: vim.opt.inccommand +vim.opt.inccommand = "nosplit" +vim.opt.icm = vim.opt.inccommand +--- @return string +function vim.opt.inccommand:get()end + +-- `'include'` `'inc'` string (default "") +-- global or local to buffer |global-local| +-- Pattern to be used to find an include command. It is a search +-- pattern, just like for the "/" command (See |pattern|). This option +-- is used for the commands "[i", "]I", "[d", etc. +-- Normally the `'isfname'` option is used to recognize the file name that +-- comes after the matched pattern. But if "\zs" appears in the pattern +-- then the text matched from "\zs" to the end, or until "\ze" if it +-- appears, is used as the file name. Use this to include characters +-- that are not in `'isfname'` , such as a space. You can then use +-- `'includeexpr'` to process the matched text. +-- See |option-backslash| about including spaces and backslashes. +--- @class vim.opt.include: vim.Option,string +--- @operator add: vim.opt.include +--- @operator sub: vim.opt.include +--- @operator pow: vim.opt.include +vim.opt.include = "" +vim.opt.inc = vim.opt.include +--- @return string +function vim.opt.include:get()end + +-- `'includeexpr'` `'inex'` string (default "") +-- local to buffer +-- Expression to be used to transform the string found with the `'include'` +-- option to a file name. Mostly useful to change "." to "/" for Java: > +-- :setlocal includeexpr=substitute(v:fname,`'\\.'` ,`'/'` ,`'g'` ) +-- < The "v:fname" variable will be set to the file name that was detected. +-- Note the double backslash: the `:set` command first halves them, then +-- one remains in the value, where "\." matches a dot literally. For +-- simple character replacements `tr()` avoids the need for escaping: > +-- :setlocal includeexpr=tr(v:fname,`'.'` ,`'/'` ) +-- < +-- Also used for the |gf| command if an unmodified file name can't be +-- found. Allows doing "gf" on the name after an `'include'` statement. +-- Also used for ||. +-- +-- If the expression starts with s: or ||, then it is replaced with +-- the script ID (|local-function|). Example: > +-- setlocal includeexpr=s:MyIncludeExpr(v:fname) +-- setlocal includeexpr=SomeIncludeExpr(v:fname) +-- < Otherwise, the expression is evaluated in the context of the script +-- where the option was set, thus script-local items are available. +-- +-- The expression will be evaluated in the |sandbox| when set from a +-- modeline, see |sandbox-option|. +-- This option cannot be set in a modeline when `'modelineexpr'` is off. +-- +-- It is not allowed to change text or jump to another window while +-- evaluating `'includeexpr'` |textlock|. +--- @class vim.opt.includeexpr: vim.Option,string +--- @operator add: vim.opt.includeexpr +--- @operator sub: vim.opt.includeexpr +--- @operator pow: vim.opt.includeexpr +vim.opt.includeexpr = "" +vim.opt.inex = vim.opt.includeexpr +--- @return string +function vim.opt.includeexpr:get()end + +-- `'incsearch'` `'is'` boolean (default on) +-- global +-- While typing a search command, show where the pattern, as it was typed +-- so far, matches. The matched string is highlighted. If the pattern +-- is invalid or not found, nothing is shown. The screen will be updated +-- often, this is only useful on fast terminals. +-- Note that the match will be shown, but the cursor will return to its +-- original position when no match is found and when pressing . You +-- still need to finish the search command with to move the +-- cursor to the match. +-- You can use the CTRL-G and CTRL-T keys to move to the next and +-- previous match. |c_CTRL-G| |c_CTRL-T| +-- Vim only searches for about half a second. With a complicated +-- pattern and/or a lot of text the match may not be found. This is to +-- avoid that Vim hangs while you are typing the pattern. +-- The |hl-IncSearch| highlight group determines the highlighting. +-- When `'hlsearch'` is on, all matched strings are highlighted too while +-- typing a search command. See also: `'hlsearch'` . +-- If you don't want to turn `'hlsearch'` on, but want to highlight all +-- matches while searching, you can turn on and off `'hlsearch'` with +-- autocmd. Example: > +-- augroup vimrc-incsearch-highlight +-- autocmd! +-- autocmd CmdlineEnter /,\? :set hlsearch +-- autocmd CmdlineLeave /,\? :set nohlsearch +-- augroup END +-- < +-- CTRL-L can be used to add one character from after the current match +-- to the command line. If `'ignorecase'` and `'smartcase'` are set and the +-- command line has no uppercase characters, the added character is +-- converted to lowercase. +-- CTRL-R CTRL-W can be used to add the word at the end of the current +-- match, excluding the characters that were already typed. +--- @class vim.opt.incsearch: vim.Option,boolean +--- @operator add: vim.opt.incsearch +--- @operator sub: vim.opt.incsearch +--- @operator pow: vim.opt.incsearch +vim.opt.incsearch = true +vim.opt.is = vim.opt.incsearch +--- @return boolean +function vim.opt.incsearch:get()end + +-- `'indentexpr'` `'inde'` string (default "") +-- local to buffer +-- Expression which is evaluated to obtain the proper indent for a line. +-- It is used when a new line is created, for the |=| operator and +-- in Insert mode as specified with the `'indentkeys'` option. +-- When this option is not empty, it overrules the `'cindent'` and +-- `'smartindent'` indenting. When `'lisp'` is set, this option is +-- is only used when `'lispoptions'` contains "expr:1". +-- The expression is evaluated with |v:lnum| set to the line number for +-- which the indent is to be computed. The cursor is also in this line +-- when the expression is evaluated (but it may be moved around). +-- +-- If the expression starts with s: or ||, then it is replaced with +-- the script ID (|local-function|). Example: > +-- set indentexpr=s:MyIndentExpr() +-- set indentexpr=SomeIndentExpr() +-- < Otherwise, the expression is evaluated in the context of the script +-- where the option was set, thus script-local items are available. +-- +-- The expression must return the number of spaces worth of indent. It +-- can return "-1" to keep the current indent (this means `'autoindent'` is +-- used for the indent). +-- Functions useful for computing the indent are |indent()|, |cindent()| +-- and |lispindent()|. +-- The evaluation of the expression must not have side effects! It must +-- not change the text, jump to another window, etc. Afterwards the +-- cursor position is always restored, thus the cursor may be moved. +-- Normally this option would be set to call a function: > +-- :set indentexpr=GetMyIndent() +-- < Error messages will be suppressed, unless the `'debug'` option contains +-- "msg". +-- See |indent-expression|. +-- +-- The expression will be evaluated in the |sandbox| when set from a +-- modeline, see |sandbox-option|. +-- This option cannot be set in a modeline when `'modelineexpr'` is off. +-- +-- It is not allowed to change text or jump to another window while +-- evaluating `'indentexpr'` |textlock|. +--- @class vim.opt.indentexpr: vim.Option,string +--- @operator add: vim.opt.indentexpr +--- @operator sub: vim.opt.indentexpr +--- @operator pow: vim.opt.indentexpr +vim.opt.indentexpr = "" +vim.opt.inde = vim.opt.indentexpr +--- @return string +function vim.opt.indentexpr:get()end + +-- `'indentkeys'` `'indk'` string (default "0{,0},0),0],:,0#,!^F,o,O,e") +-- local to buffer +-- A list of keys that, when typed in Insert mode, cause reindenting of +-- the current line. Only happens if `'indentexpr'` isn't empty. +-- The format is identical to `'cinkeys'` , see |indentkeys-format|. +-- See |C-indenting| and |indent-expression|. +--- @class vim.opt.indentkeys: vim.Option,string[] +--- @operator add: vim.opt.indentkeys +--- @operator sub: vim.opt.indentkeys +--- @operator pow: vim.opt.indentkeys +vim.opt.indentkeys = "0{,0},0),0],:,0#,!^F,o,O,e" +vim.opt.indk = vim.opt.indentkeys +--- @return string[] +function vim.opt.indentkeys:get()end + +-- `'infercase'` `'inf'` boolean (default off) +-- local to buffer +-- When doing keyword completion in insert mode |ins-completion|, and +-- `'ignorecase'` is also on, the case of the match is adjusted depending +-- on the typed text. If the typed text contains a lowercase letter +-- where the match has an upper case letter, the completed part is made +-- lowercase. If the typed text has no lowercase letters and the match +-- has a lowercase letter where the typed text has an uppercase letter, +-- and there is a letter before it, the completed part is made uppercase. +-- With `'noinfercase'` the match is used as-is. +--- @class vim.opt.infercase: vim.Option,boolean +--- @operator add: vim.opt.infercase +--- @operator sub: vim.opt.infercase +--- @operator pow: vim.opt.infercase +vim.opt.infercase = false +vim.opt.inf = vim.opt.infercase +--- @return boolean +function vim.opt.infercase:get()end + +--- @class vim.opt.insertmode: vim.Option,boolean +--- @operator add: vim.opt.insertmode +--- @operator sub: vim.opt.insertmode +--- @operator pow: vim.opt.insertmode +vim.opt.insertmode = false +vim.opt.im = vim.opt.insertmode +--- @return boolean +function vim.opt.insertmode:get()end + +-- `'isfname'` `'isf'` string (default for Windows: +-- "@,48-57,/,\,.,-,_,+,,,#,$,%,{,},[,],:,@-@,!,~,=" +-- otherwise: "@,48-57,/,.,-,_,+,,,#,$,%,~,=") +-- global +-- The characters specified by this option are included in file names and +-- path names. Filenames are used for commands like "gf", "[i" and in +-- the tags file. It is also used for "\f" in a |pattern|. +-- Multi-byte characters 256 and above are always included, only the +-- characters up to 255 are specified with this option. +-- For UTF-8 the characters 0xa0 to 0xff are included as well. +-- Think twice before adding white space to this option. Although a +-- space may appear inside a file name, the effect will be that Vim +-- doesn't know where a file name starts or ends when doing completion. +-- It most likely works better without a space in `'isfname'` . +-- +-- Note that on systems using a backslash as path separator, Vim tries to +-- do its best to make it work as you would expect. That is a bit +-- tricky, since Vi originally used the backslash to escape special +-- characters. Vim will not remove a backslash in front of a normal file +-- name character on these systems, but it will on Unix and alikes. The +-- `'&'` and `'^'` are not included by default, because these are special for +-- cmd.exe. +-- +-- The format of this option is a list of parts, separated with commas. +-- Each part can be a single character number or a range. A range is two +-- character numbers with `'-'` in between. A character number can be a +-- decimal number between 0 and 255 or the ASCII character itself (does +-- not work for digits). Example: +-- "_,-,128-140,#-43" (include `'_'` and `'-'` and the range +-- 128 to 140 and `'#'` to 43) +-- If a part starts with `'^'` , the following character number or range +-- will be excluded from the option. The option is interpreted from left +-- to right. Put the excluded character after the range where it is +-- included. To include `'^'` itself use it as the last character of the +-- option or the end of a range. Example: +-- "^a-z,#,^" (exclude `'a'` to `'z'` , include `'#'` and `'^'` ) +-- If the character is `'@'` , all characters where isalpha() returns TRUE +-- are included. Normally these are the characters a to z and A to Z, +-- plus accented characters. To include `'@'` itself use "@-@". Examples: +-- "@,^a-z" All alphabetic characters, excluding lower +-- case ASCII letters. +-- "a-z,A-Z,@-@" All letters plus the `'@'` character. +-- A comma can be included by using it where a character number is +-- expected. Example: +-- "48-57,,,_" Digits, comma and underscore. +-- A comma can be excluded by prepending a `'^'` . Example: +-- " -~,^,,9" All characters from space to `'~'` , excluding +-- comma, plus . +-- See |option-backslash| about including spaces and backslashes. +--- @class vim.opt.isfname: vim.Option,string[] +--- @operator add: vim.opt.isfname +--- @operator sub: vim.opt.isfname +--- @operator pow: vim.opt.isfname +vim.opt.isfname = "@,48-57,/,.,-,_,+,,,#,$,%,~,=" +vim.opt.isf = vim.opt.isfname +--- @return string[] +function vim.opt.isfname:get()end + +-- `'isident'` `'isi'` string (default for Windows: +-- "@,48-57,_,128-167,224-235" +-- otherwise: "@,48-57,_,192-255") +-- global +-- The characters given by this option are included in identifiers. +-- Identifiers are used in recognizing environment variables and after a +-- match of the `'define'` option. It is also used for "\i" in a +-- |pattern|. See `'isfname'` for a description of the format of this +-- option. For `'@'` only characters up to 255 are used. +-- Careful: If you change this option, it might break expanding +-- environment variables. E.g., when `'/'` is included and Vim tries to +-- expand "$HOME/.local/state/nvim/shada/main.shada". Maybe you should +-- change `'iskeyword'` instead. +--- @class vim.opt.isident: vim.Option,string[] +--- @operator add: vim.opt.isident +--- @operator sub: vim.opt.isident +--- @operator pow: vim.opt.isident +vim.opt.isident = "@,48-57,_,192-255" +vim.opt.isi = vim.opt.isident +--- @return string[] +function vim.opt.isident:get()end + +-- `'iskeyword'` `'isk'` string (default: @,48-57,_,192-255) +-- local to buffer +-- Keywords are used in searching and recognizing with many commands: +-- "w", "*", "[i", etc. It is also used for "\k" in a |pattern|. See +-- `'isfname'` for a description of the format of this option. For `'@'` +-- characters above 255 check the "word" character class (any character +-- that is not white space or punctuation). +-- For C programs you could use "a-z,A-Z,48-57,_,.,-,>". +-- For a help file it is set to all non-blank printable characters except +-- "*", `'"'` and `'|'` (so that CTRL-] on a command finds the help for that +-- command). +-- When the `'lisp'` option is on the `'-'` character is always included. +-- This option also influences syntax highlighting, unless the syntax +-- uses |:syn-iskeyword|. +--- @class vim.opt.iskeyword: vim.Option,string[] +--- @operator add: vim.opt.iskeyword +--- @operator sub: vim.opt.iskeyword +--- @operator pow: vim.opt.iskeyword +vim.opt.iskeyword = "@,48-57,_,192-255" +vim.opt.isk = vim.opt.iskeyword +--- @return string[] +function vim.opt.iskeyword:get()end + +-- `'isprint'` `'isp'` string (default: "@,161-255") +-- global +-- The characters given by this option are displayed directly on the +-- screen. It is also used for "\p" in a |pattern|. The characters from +-- space (ASCII 32) to `'~'` (ASCII 126) are always displayed directly, +-- even when they are not included in `'isprint'` or excluded. See +-- `'isfname'` for a description of the format of this option. +-- +-- Non-printable characters are displayed with two characters: +-- 0 - 31 "^@" - "^_" +-- 32 - 126 always single characters +-- 127 "^?" +-- 128 - 159 "~@" - "~_" +-- 160 - 254 "| " - "|~" +-- 255 "~?" +-- Illegal bytes from 128 to 255 (invalid UTF-8) are +-- displayed as , with the hexadecimal value of the byte. +-- When `'display'` contains "uhex" all unprintable characters are +-- displayed as . +-- The SpecialKey highlighting will be used for unprintable characters. +-- |hl-SpecialKey| +-- +-- Multi-byte characters 256 and above are always included, only the +-- characters up to 255 are specified with this option. When a character +-- is printable but it is not available in the current font, a +-- replacement character will be shown. +-- Unprintable and zero-width Unicode characters are displayed as . +-- There is no option to specify these characters. +--- @class vim.opt.isprint: vim.Option,string[] +--- @operator add: vim.opt.isprint +--- @operator sub: vim.opt.isprint +--- @operator pow: vim.opt.isprint +vim.opt.isprint = "@,161-255" +vim.opt.isp = vim.opt.isprint +--- @return string[] +function vim.opt.isprint:get()end + +-- `'joinspaces'` `'js'` boolean (default off) +-- global +-- Insert two spaces after a `'.'` , `'?'` and `'!'` with a join command. +-- Otherwise only one space is inserted. +--- @class vim.opt.joinspaces: vim.Option,boolean +--- @operator add: vim.opt.joinspaces +--- @operator sub: vim.opt.joinspaces +--- @operator pow: vim.opt.joinspaces +vim.opt.joinspaces = false +vim.opt.js = vim.opt.joinspaces +--- @return boolean +function vim.opt.joinspaces:get()end + +-- `'jumpoptions'` `'jop'` string (default "") +-- global +-- List of words that change the behavior of the |jumplist|. +-- stack Make the jumplist behave like the tagstack or like a +-- web browser. Relative location of entries in the +-- jumplist is preserved at the cost of discarding +-- subsequent entries when navigating backwards in the +-- jumplist and then jumping to a location. +-- |jumplist-stack| +-- +-- view When moving through the jumplist, |changelist|, +-- |alternate-file| or using |mark-motions| try to +-- restore the |mark-view| in which the action occurred. +--- @class vim.opt.jumpoptions: vim.Option,string[] +--- @operator add: vim.opt.jumpoptions +--- @operator sub: vim.opt.jumpoptions +--- @operator pow: vim.opt.jumpoptions +vim.opt.jumpoptions = "" +vim.opt.jop = vim.opt.jumpoptions +--- @return string[] +function vim.opt.jumpoptions:get()end + +-- `'keymap'` `'kmp'` string (default "") +-- local to buffer +-- Name of a keyboard mapping. See |mbyte-keymap|. +-- Setting this option to a valid keymap name has the side effect of +-- setting `'iminsert'` to one, so that the keymap becomes effective. +-- `'imsearch'` is also set to one, unless it was -1 +-- Only normal file name characters can be used, "/\*?[|<>" are illegal. +--- @class vim.opt.keymap: vim.Option,string +--- @operator add: vim.opt.keymap +--- @operator sub: vim.opt.keymap +--- @operator pow: vim.opt.keymap +vim.opt.keymap = "" +vim.opt.kmp = vim.opt.keymap +--- @return string +function vim.opt.keymap:get()end + +-- `'keymodel'` `'km'` string (default "") +-- global +-- List of comma-separated words, which enable special things that keys +-- can do. These values can be used: +-- startsel Using a shifted special key starts selection (either +-- Select mode or Visual mode, depending on "key" being +-- present in `'selectmode'` ). +-- stopsel Using a not-shifted special key stops selection. +-- Special keys in this context are the cursor keys, , , +-- and . +--- @class vim.opt.keymodel: vim.Option,string[] +--- @operator add: vim.opt.keymodel +--- @operator sub: vim.opt.keymodel +--- @operator pow: vim.opt.keymodel +vim.opt.keymodel = "" +vim.opt.km = vim.opt.keymodel +--- @return string[] +function vim.opt.keymodel:get()end + +-- `'keywordprg'` `'kp'` string (default ":Man", Windows: ":help") +-- global or local to buffer |global-local| +-- Program to use for the |K| command. Environment variables are +-- expanded |:set_env|. ":help" may be used to access the Vim internal +-- help. (Note that previously setting the global option to the empty +-- value did this, which is now deprecated.) +-- When the first character is ":", the command is invoked as a Vim +-- Ex command prefixed with [count]. +-- When "man" or "man -s" is used, Vim will automatically translate +-- a [count] for the "K" command to a section number. +-- See |option-backslash| about including spaces and backslashes. +-- Example: > +-- :set keywordprg=man\ -s +-- :set keywordprg=:Man +-- < This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +--- @class vim.opt.keywordprg: vim.Option,string +--- @operator add: vim.opt.keywordprg +--- @operator sub: vim.opt.keywordprg +--- @operator pow: vim.opt.keywordprg +vim.opt.keywordprg = ":Man" +vim.opt.kp = vim.opt.keywordprg +--- @return string +function vim.opt.keywordprg:get()end + +-- `'langmap'` `'lmap'` string (default "") +-- global +-- This option allows switching your keyboard into a special language +-- mode. When you are typing text in Insert mode the characters are +-- inserted directly. When in Normal mode the `'langmap'` option takes +-- care of translating these special characters to the original meaning +-- of the key. This means you don't have to change the keyboard mode to +-- be able to execute Normal mode commands. +-- This is the opposite of the `'keymap'` option, where characters are +-- mapped in Insert mode. +-- Also consider setting `'langremap'` to off, to prevent `'langmap'` from +-- applying to characters resulting from a mapping. +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +-- +-- Example (for Greek, in UTF-8): > +-- :set langmap=ΑA,ΒB,ΨC,ΔD,ΕE,ΦF,ΓG,ΗH,ΙI,ΞJ,ΚK,ΛL,ΜM,ΝN,ΟO,ΠP,QQ,ΡR,ΣS,ΤT,ΘU,ΩV,WW,ΧX,ΥY,ΖZ,αa,βb,ψc,δd,εe,φf,γg,ηh,ιi,ξj,κk,λl,μm,νn,οo,πp,qq,ρr,σs,τt,θu,ωv,ςw,χx,υy,ζz +-- < Example (exchanges meaning of z and y for commands): > +-- :set langmap=zy,yz,ZY,YZ +-- < +-- The `'langmap'` option is a list of parts, separated with commas. Each +-- part can be in one of two forms: +-- 1. A list of pairs. Each pair is a "from" character immediately +-- followed by the "to" character. Examples: "aA", "aAbBcC". +-- 2. A list of "from" characters, a semi-colon and a list of "to" +-- characters. Example: "abc;ABC" +-- Example: "aA,fgh;FGH,cCdDeE" +-- Special characters need to be preceded with a backslash. These are +-- ";", `','` , `'"'` , `'|'` and backslash itself. +-- +-- This will allow you to activate vim actions without having to switch +-- back and forth between the languages. Your language characters will +-- be understood as normal vim English characters (according to the +-- langmap mappings) in the following cases: +-- o Normal/Visual mode (commands, buffer/register names, user mappings) +-- o Insert/Replace Mode: Register names after CTRL-R +-- o Insert/Replace Mode: Mappings +-- Characters entered in Command-line mode will NOT be affected by +-- this option. Note that this option can be changed at any time +-- allowing to switch between mappings for different languages/encodings. +-- Use a mapping to avoid having to type it each time! +--- @class vim.opt.langmap: vim.Option,string[] +--- @operator add: vim.opt.langmap +--- @operator sub: vim.opt.langmap +--- @operator pow: vim.opt.langmap +vim.opt.langmap = "" +vim.opt.lmap = vim.opt.langmap +--- @return string[] +function vim.opt.langmap:get()end + +-- `'langmenu'` `'lm'` string (default "") +-- global +-- Language to use for menu translation. Tells which file is loaded +-- from the "lang" directory in `'runtimepath'` : > +-- "lang/menu_" .. &langmenu .. ".vim" +-- < (without the spaces). For example, to always use the Dutch menus, no +-- matter what $LANG is set to: > +-- :set langmenu=nl_NL.ISO_8859-1 +-- < When `'langmenu'` is empty, |v:lang| is used. +-- Only normal file name characters can be used, "/\*?[|<>" are illegal. +-- If your $LANG is set to a non-English language but you do want to use +-- the English menus: > +-- :set langmenu=none +-- < This option must be set before loading menus, switching on filetype +-- detection or syntax highlighting. Once the menus are defined setting +-- this option has no effect. But you could do this: > +-- :source $VIMRUNTIME/delmenu.vim +-- :set langmenu=de_DE.ISO_8859-1 +-- :source $VIMRUNTIME/menu.vim +-- < Warning: This deletes all menus that you defined yourself! +--- @class vim.opt.langmenu: vim.Option,string +--- @operator add: vim.opt.langmenu +--- @operator sub: vim.opt.langmenu +--- @operator pow: vim.opt.langmenu +vim.opt.langmenu = "" +vim.opt.lm = vim.opt.langmenu +--- @return string +function vim.opt.langmenu:get()end + +--- @class vim.opt.langnoremap: vim.Option,boolean +--- @operator add: vim.opt.langnoremap +--- @operator sub: vim.opt.langnoremap +--- @operator pow: vim.opt.langnoremap +vim.opt.langnoremap = true +vim.opt.lnr = vim.opt.langnoremap +--- @return boolean +function vim.opt.langnoremap:get()end + +-- `'langremap'` `'lrm'` boolean (default off) +-- global +-- When off, setting `'langmap'` does not apply to characters resulting from +-- a mapping. If setting `'langmap'` disables some of your mappings, make +-- sure this option is off. +--- @class vim.opt.langremap: vim.Option,boolean +--- @operator add: vim.opt.langremap +--- @operator sub: vim.opt.langremap +--- @operator pow: vim.opt.langremap +vim.opt.langremap = false +vim.opt.lrm = vim.opt.langremap +--- @return boolean +function vim.opt.langremap:get()end + +-- `'laststatus'` `'ls'` number (default 2) +-- global +-- The value of this option influences when the last window will have a +-- status line: +-- 0: never +-- 1: only if there are at least two windows +-- 2: always +-- 3: always and ONLY the last window +-- The screen looks nicer with a status line if you have several +-- windows, but it takes another screen line. |status-line| +--- @class vim.opt.laststatus: vim.Option,number +--- @operator add: vim.opt.laststatus +--- @operator sub: vim.opt.laststatus +--- @operator pow: vim.opt.laststatus +vim.opt.laststatus = 2 +vim.opt.ls = vim.opt.laststatus +--- @return number +function vim.opt.laststatus:get()end + +-- `'lazyredraw'` `'lz'` boolean (default off) +-- global +-- When this option is set, the screen will not be redrawn while +-- executing macros, registers and other commands that have not been +-- typed. Also, updating the window title is postponed. To force an +-- update use |:redraw|. +-- This may occasionally cause display errors. It is only meant to be set +-- temporarily when performing an operation where redrawing may cause +-- flickering or cause a slow down. +--- @class vim.opt.lazyredraw: vim.Option,boolean +--- @operator add: vim.opt.lazyredraw +--- @operator sub: vim.opt.lazyredraw +--- @operator pow: vim.opt.lazyredraw +vim.opt.lazyredraw = false +vim.opt.lz = vim.opt.lazyredraw +--- @return boolean +function vim.opt.lazyredraw:get()end + +-- `'linebreak'` `'lbr'` boolean (default off) +-- local to window +-- If on, Vim will wrap long lines at a character in `'breakat'` rather +-- than at the last character that fits on the screen. Unlike +-- `'wrapmargin'` and `'textwidth'` , this does not insert s in the file, +-- it only affects the way the file is displayed, not its contents. +-- If `'breakindent'` is set, line is visually indented. Then, the value +-- of `'showbreak'` is used to put in front of wrapped lines. This option +-- is not used when the `'wrap'` option is off. +-- Note that characters after an are mostly not displayed +-- with the right amount of white space. +--- @class vim.opt.linebreak: vim.Option,boolean +--- @operator add: vim.opt.linebreak +--- @operator sub: vim.opt.linebreak +--- @operator pow: vim.opt.linebreak +vim.opt.linebreak = false +vim.opt.lbr = vim.opt.linebreak +--- @return boolean +function vim.opt.linebreak:get()end + +-- `'lines'` number (default 24 or terminal height) +-- global +-- Number of lines of the Vim window. +-- Normally you don't need to set this. It is done automatically by the +-- terminal initialization code. +-- When Vim is running in the GUI or in a resizable window, setting this +-- option will cause the window size to be changed. When you only want +-- to use the size for the GUI, put the command in your |gvimrc| file. +-- Vim limits the number of lines to what fits on the screen. You can +-- use this command to get the tallest window possible: > +-- :set lines=999 +-- < Minimum value is 2, maximum value is 1000. +--- @class vim.opt.lines: vim.Option,number +--- @operator add: vim.opt.lines +--- @operator sub: vim.opt.lines +--- @operator pow: vim.opt.lines +vim.opt.lines = 24 +--- @return number +function vim.opt.lines:get()end + +-- `'linespace'` `'lsp'` number (default 0) +-- global +-- {only in the GUI} +-- Number of pixel lines inserted between characters. Useful if the font +-- uses the full character cell height, making lines touch each other. +-- When non-zero there is room for underlining. +-- With some fonts there can be too much room between lines (to have +-- space for ascents and descents). Then it makes sense to set +-- `'linespace'` to a negative value. This may cause display problems +-- though! +--- @class vim.opt.linespace: vim.Option,number +--- @operator add: vim.opt.linespace +--- @operator sub: vim.opt.linespace +--- @operator pow: vim.opt.linespace +vim.opt.linespace = 0 +vim.opt.lsp = vim.opt.linespace +--- @return number +function vim.opt.linespace:get()end + +-- `'lisp'` boolean (default off) +-- local to buffer +-- Lisp mode: When is typed in insert mode set the indent for +-- the next line to Lisp standards (well, sort of). Also happens with +-- "cc" or "S". `'autoindent'` must also be on for this to work. The `'p'` +-- flag in `'cpoptions'` changes the method of indenting: Vi compatible or +-- better. Also see `'lispwords'` . +-- The `'-'` character is included in keyword characters. Redefines the +-- "=" operator to use this same indentation algorithm rather than +-- calling an external program if `'equalprg'` is empty. +--- @class vim.opt.lisp: vim.Option,boolean +--- @operator add: vim.opt.lisp +--- @operator sub: vim.opt.lisp +--- @operator pow: vim.opt.lisp +vim.opt.lisp = false +--- @return boolean +function vim.opt.lisp:get()end + +-- `'lispoptions'` `'lop'` string (default "") +-- local to buffer +-- Comma-separated list of items that influence the Lisp indenting when +-- enabled with the |`'lisp'` | option. Currently only one item is +-- supported: +-- expr:1 use `'indentexpr'` for Lisp indenting when it is set +-- expr:0 do not use `'indentexpr'` for Lisp indenting (default) +-- Note that when using `'indentexpr'` the `=` operator indents all the +-- lines, otherwise the first line is not indented (Vi-compatible). +--- @class vim.opt.lispoptions: vim.Option,string[] +--- @operator add: vim.opt.lispoptions +--- @operator sub: vim.opt.lispoptions +--- @operator pow: vim.opt.lispoptions +vim.opt.lispoptions = "" +vim.opt.lop = vim.opt.lispoptions +--- @return string[] +function vim.opt.lispoptions:get()end + +-- `'lispwords'` `'lw'` string (default is very long) +-- global or local to buffer |global-local| +-- Comma-separated list of words that influence the Lisp indenting when +-- enabled with the |`'lisp'` | option. +--- @class vim.opt.lispwords: vim.Option,string[] +--- @operator add: vim.opt.lispwords +--- @operator sub: vim.opt.lispwords +--- @operator pow: vim.opt.lispwords +vim.opt.lispwords = "defun,define,defmacro,set!,lambda,if,case,let,flet,let*,letrec,do,do*,define-syntax,let-syntax,letrec-syntax,destructuring-bind,defpackage,defparameter,defstruct,deftype,defvar,do-all-symbols,do-external-symbols,do-symbols,dolist,dotimes,ecase,etypecase,eval-when,labels,macrolet,multiple-value-bind,multiple-value-call,multiple-value-prog1,multiple-value-setq,prog1,progv,typecase,unless,unwind-protect,when,with-input-from-string,with-open-file,with-open-stream,with-output-to-string,with-package-iterator,define-condition,handler-bind,handler-case,restart-bind,restart-case,with-simple-restart,store-value,use-value,muffle-warning,abort,continue,with-slots,with-slots*,with-accessors,with-accessors*,defclass,defmethod,print-unreadable-object" +vim.opt.lw = vim.opt.lispwords +--- @return string[] +function vim.opt.lispwords:get()end + +-- `'list'` boolean (default off) +-- local to window +-- List mode: By default, show tabs as ">", trailing spaces as "-", and +-- non-breakable space characters as "+". Useful to see the difference +-- between tabs and spaces and for trailing blanks. Further changed by +-- the `'listchars'` option. +-- +-- The cursor is displayed at the start of the space a Tab character +-- occupies, not at the end as usual in Normal mode. To get this cursor +-- position while displaying Tabs with spaces, use: > +-- :set list lcs=tab:\ \ +-- < +-- Note that list mode will also affect formatting (set with `'textwidth'` +-- or `'wrapmargin'` ) when `'cpoptions'` includes `'L'` . See `'listchars'` for +-- changing the way tabs are displayed. +--- @class vim.opt.list: vim.Option,boolean +--- @operator add: vim.opt.list +--- @operator sub: vim.opt.list +--- @operator pow: vim.opt.list +vim.opt.list = false +--- @return boolean +function vim.opt.list:get()end + +-- `'listchars'` `'lcs'` string (default: "tab:> ,trail:-,nbsp:+") +-- global or local to window |global-local| +-- Strings to use in `'list'` mode and for the |:list| command. It is a +-- comma-separated list of string settings. +-- +-- +-- eol:c Character to show at the end of each line. When +-- omitted, there is no extra character at the end of the +-- line. +-- +-- tab:xy[z] Two or three characters to be used to show a tab. +-- The third character is optional. +-- +-- tab:xy The `'x'` is always used, then `'y'` as many times as will +-- fit. Thus "tab:>-" displays: > +-- > +-- >- +-- >-- +-- etc. +-- < +-- tab:xyz The `'z'` is always used, then `'x'` is prepended, and +-- then `'y'` is used as many times as will fit. Thus +-- "tab:<->" displays: > +-- > +-- <> +-- <-> +-- <--> +-- etc. +-- < +-- When "tab:" is omitted, a tab is shown as ^I. +-- +-- space:c Character to show for a space. When omitted, spaces +-- are left blank. +-- +-- multispace:c... +-- One or more characters to use cyclically to show for +-- multiple consecutive spaces. Overrides the "space" +-- setting, except for single spaces. When omitted, the +-- "space" setting is used. For example, +-- `:set listchars=multispace:---+` shows ten consecutive +-- spaces as: > +-- ---+---+-- +-- < +-- +-- lead:c Character to show for leading spaces. When omitted, +-- leading spaces are blank. Overrides the "space" and +-- "multispace" settings for leading spaces. You can +-- combine it with "tab:", for example: > +-- :set listchars+=tab:>-,lead:. +-- < +-- +-- leadmultispace:c... +-- Like the |lcs-multispace| value, but for leading +-- spaces only. Also overrides |lcs-lead| for leading +-- multiple spaces. +-- `:set listchars=leadmultispace:---+` shows ten +-- consecutive leading spaces as: > +-- ---+---+--XXX +-- < +-- Where "XXX" denotes the first non-blank characters in +-- the line. +-- +-- trail:c Character to show for trailing spaces. When omitted, +-- trailing spaces are blank. Overrides the "space" and +-- "multispace" settings for trailing spaces. +-- +-- extends:c Character to show in the last column, when `'wrap'` is +-- off and the line continues beyond the right of the +-- screen. +-- +-- precedes:c Character to show in the first visible column of the +-- physical line, when there is text preceding the +-- character visible in the first column. +-- +-- conceal:c Character to show in place of concealed text, when +-- `'conceallevel'` is set to 1. A space when omitted. +-- +-- nbsp:c Character to show for a non-breakable space character +-- (0xA0 (160 decimal) and U+202F). Left blank when +-- omitted. +-- +-- The characters `':'` and `','` should not be used. UTF-8 characters can +-- be used. All characters must be single width. +-- +-- Each character can be specified as hex: > +-- set listchars=eol:\\x24 +-- set listchars=eol:\\u21b5 +-- set listchars=eol:\\U000021b5 +-- < Note that a double backslash is used. The number of hex characters +-- must be exactly 2 for \\x, 4 for \\u and 8 for \\U. +-- +-- Examples: > +-- :set lcs=tab:>-,trail:- +-- :set lcs=tab:>-,eol:<,nbsp:% +-- :set lcs=extends:>,precedes:< +-- < |hl-NonText| highlighting will be used for "eol", "extends" and +-- "precedes". |hl-Whitespace| for "nbsp", "space", "tab", "multispace", +-- "lead" and "trail". +--- @class vim.opt.listchars: vim.Option,table +--- @operator add: vim.opt.listchars +--- @operator sub: vim.opt.listchars +--- @operator pow: vim.opt.listchars +vim.opt.listchars = "tab:> ,trail:-,nbsp:+" +vim.opt.lcs = vim.opt.listchars +--- @return table +function vim.opt.listchars:get()end + +-- `'loadplugins'` `'lpl'` boolean (default on) +-- global +-- When on the plugin scripts are loaded when starting up |load-plugins|. +-- This option can be reset in your |vimrc| file to disable the loading +-- of plugins. +-- Note that using the "-u NONE" and "--noplugin" command line arguments +-- reset this option. |-u| |--noplugin| +--- @class vim.opt.loadplugins: vim.Option,boolean +--- @operator add: vim.opt.loadplugins +--- @operator sub: vim.opt.loadplugins +--- @operator pow: vim.opt.loadplugins +vim.opt.loadplugins = true +vim.opt.lpl = vim.opt.loadplugins +--- @return boolean +function vim.opt.loadplugins:get()end + +-- `'magic'` boolean (default on) +-- global +-- Changes the special characters that can be used in search patterns. +-- See |pattern|. +-- WARNING: Switching this option off most likely breaks plugins! That +-- is because many patterns assume it's on and will fail when it's off. +-- Only switch it off when working with old Vi scripts. In any other +-- situation write patterns that work when `'magic'` is on. Include "\M" +-- when you want to |/\M|. +--- @class vim.opt.magic: vim.Option,boolean +--- @operator add: vim.opt.magic +--- @operator sub: vim.opt.magic +--- @operator pow: vim.opt.magic +vim.opt.magic = true +--- @return boolean +function vim.opt.magic:get()end + +-- `'makeef'` `'mef'` string (default: "") +-- global +-- Name of the errorfile for the |:make| command (see |:make_makeprg|) +-- and the |:grep| command. +-- When it is empty, an internally generated temp file will be used. +-- When "##" is included, it is replaced by a number to make the name +-- unique. This makes sure that the ":make" command doesn't overwrite an +-- existing file. +-- NOT used for the ":cf" command. See `'errorfile'` for that. +-- Environment variables are expanded |:set_env|. +-- See |option-backslash| about including spaces and backslashes. +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +--- @class vim.opt.makeef: vim.Option,string +--- @operator add: vim.opt.makeef +--- @operator sub: vim.opt.makeef +--- @operator pow: vim.opt.makeef +vim.opt.makeef = "" +vim.opt.mef = vim.opt.makeef +--- @return string +function vim.opt.makeef:get()end + +-- `'makeencoding'` `'menc'` string (default "") +-- global or local to buffer |global-local| +-- Encoding used for reading the output of external commands. When empty, +-- encoding is not converted. +-- This is used for `:make`, `:lmake`, `:grep`, `:lgrep`, `:grepadd`, +-- `:lgrepadd`, `:cfile`, `:cgetfile`, `:caddfile`, `:lfile`, `:lgetfile`, +-- and `:laddfile`. +-- +-- This would be mostly useful when you use MS-Windows. If iconv is +-- enabled, setting `'makeencoding'` to "char" has the same effect as +-- setting to the system locale encoding. Example: > +-- :set makeencoding=char " system locale is used +-- < +--- @class vim.opt.makeencoding: vim.Option,string +--- @operator add: vim.opt.makeencoding +--- @operator sub: vim.opt.makeencoding +--- @operator pow: vim.opt.makeencoding +vim.opt.makeencoding = "" +vim.opt.menc = vim.opt.makeencoding +--- @return string +function vim.opt.makeencoding:get()end + +-- `'makeprg'` `'mp'` string (default "make") +-- global or local to buffer |global-local| +-- Program to use for the ":make" command. See |:make_makeprg|. +-- This option may contain `'%'` and `'#'` characters (see |:_%| and |:_#|), +-- which are expanded to the current and alternate file name. Use |::S| +-- to escape file names in case they contain special characters. +-- Environment variables are expanded |:set_env|. See |option-backslash| +-- about including spaces and backslashes. +-- Note that a `'|'` must be escaped twice: once for ":set" and once for +-- the interpretation of a command. When you use a filter called +-- "myfilter" do it like this: > +-- :set makeprg=gmake\ \\\|\ myfilter +-- < The placeholder "$*" can be given (even multiple times) to specify +-- where the arguments will be included, for example: > +-- :set makeprg=latex\ \\\\nonstopmode\ \\\\input\\{$*} +-- < This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +--- @class vim.opt.makeprg: vim.Option,string +--- @operator add: vim.opt.makeprg +--- @operator sub: vim.opt.makeprg +--- @operator pow: vim.opt.makeprg +vim.opt.makeprg = "make" +vim.opt.mp = vim.opt.makeprg +--- @return string +function vim.opt.makeprg:get()end + +-- `'matchpairs'` `'mps'` string (default "(:),{:},[:]") +-- local to buffer +-- Characters that form pairs. The |%| command jumps from one to the +-- other. +-- Only character pairs are allowed that are different, thus you cannot +-- jump between two double quotes. +-- The characters must be separated by a colon. +-- The pairs must be separated by a comma. Example for including `'<'` and +-- `'>'` (for HTML): > +-- :set mps+=<:> +-- +-- < A more exotic example, to jump between the `'='` and `';'` in an +-- assignment, useful for languages like C and Java: > +-- :au FileType c,cpp,java set mps+==:; +-- +-- < For a more advanced way of using "%", see the matchit.vim plugin in +-- the $VIMRUNTIME/plugin directory. |add-local-help| +--- @class vim.opt.matchpairs: vim.Option,string[] +--- @operator add: vim.opt.matchpairs +--- @operator sub: vim.opt.matchpairs +--- @operator pow: vim.opt.matchpairs +vim.opt.matchpairs = "(:),{:},[:]" +vim.opt.mps = vim.opt.matchpairs +--- @return string[] +function vim.opt.matchpairs:get()end + +-- `'matchtime'` `'mat'` number (default 5) +-- global +-- Tenths of a second to show the matching paren, when `'showmatch'` is +-- set. Note that this is not in milliseconds, like other options that +-- set a time. This is to be compatible with Nvi. +--- @class vim.opt.matchtime: vim.Option,number +--- @operator add: vim.opt.matchtime +--- @operator sub: vim.opt.matchtime +--- @operator pow: vim.opt.matchtime +vim.opt.matchtime = 5 +vim.opt.mat = vim.opt.matchtime +--- @return number +function vim.opt.matchtime:get()end + +--- @class vim.opt.maxcombine: vim.Option,number +--- @operator add: vim.opt.maxcombine +--- @operator sub: vim.opt.maxcombine +--- @operator pow: vim.opt.maxcombine +vim.opt.maxcombine = 6 +vim.opt.mco = vim.opt.maxcombine +--- @return number +function vim.opt.maxcombine:get()end + +-- `'maxfuncdepth'` `'mfd'` number (default 100) +-- global +-- Maximum depth of function calls for user functions. This normally +-- catches endless recursion. When using a recursive function with +-- more depth, set `'maxfuncdepth'` to a bigger number. But this will use +-- more memory, there is the danger of failing when memory is exhausted. +-- Increasing this limit above 200 also changes the maximum for Ex +-- command recursion, see |E169|. +-- See also |:function|. +--- @class vim.opt.maxfuncdepth: vim.Option,number +--- @operator add: vim.opt.maxfuncdepth +--- @operator sub: vim.opt.maxfuncdepth +--- @operator pow: vim.opt.maxfuncdepth +vim.opt.maxfuncdepth = 100 +vim.opt.mfd = vim.opt.maxfuncdepth +--- @return number +function vim.opt.maxfuncdepth:get()end + +-- `'maxmapdepth'` `'mmd'` number (default 1000) +-- global +-- Maximum number of times a mapping is done without resulting in a +-- character to be used. This normally catches endless mappings, like +-- ":map x y" with ":map y x". It still does not catch ":map g wg", +-- because the `'w'` is used before the next mapping is done. See also +-- |key-mapping|. +--- @class vim.opt.maxmapdepth: vim.Option,number +--- @operator add: vim.opt.maxmapdepth +--- @operator sub: vim.opt.maxmapdepth +--- @operator pow: vim.opt.maxmapdepth +vim.opt.maxmapdepth = 1000 +vim.opt.mmd = vim.opt.maxmapdepth +--- @return number +function vim.opt.maxmapdepth:get()end + +-- `'maxmempattern'` `'mmp'` number (default 1000) +-- global +-- Maximum amount of memory (in Kbyte) to use for pattern matching. +-- The maximum value is about 2000000. Use this to work without a limit. +-- +-- When Vim runs into the limit it gives an error message and mostly +-- behaves like CTRL-C was typed. +-- Running into the limit often means that the pattern is very +-- inefficient or too complex. This may already happen with the pattern +-- "\(.\)*" on a very long line. ".*" works much better. +-- Might also happen on redraw, when syntax rules try to match a complex +-- text structure. +-- Vim may run out of memory before hitting the `'maxmempattern'` limit, in +-- which case you get an "Out of memory" error instead. +--- @class vim.opt.maxmempattern: vim.Option,number +--- @operator add: vim.opt.maxmempattern +--- @operator sub: vim.opt.maxmempattern +--- @operator pow: vim.opt.maxmempattern +vim.opt.maxmempattern = 1000 +vim.opt.mmp = vim.opt.maxmempattern +--- @return number +function vim.opt.maxmempattern:get()end + +-- `'menuitems'` `'mis'` number (default 25) +-- global +-- Maximum number of items to use in a menu. Used for menus that are +-- generated from a list of items, e.g., the Buffers menu. Changing this +-- option has no direct effect, the menu must be refreshed first. +--- @class vim.opt.menuitems: vim.Option,number +--- @operator add: vim.opt.menuitems +--- @operator sub: vim.opt.menuitems +--- @operator pow: vim.opt.menuitems +vim.opt.menuitems = 25 +vim.opt.mis = vim.opt.menuitems +--- @return number +function vim.opt.menuitems:get()end + +-- `'mkspellmem'` `'msm'` string (default "460000,2000,500") +-- global +-- Parameters for |:mkspell|. This tunes when to start compressing the +-- word tree. Compression can be slow when there are many words, but +-- it's needed to avoid running out of memory. The amount of memory used +-- per word depends very much on how similar the words are, that's why +-- this tuning is complicated. +-- +-- There are three numbers, separated by commas: +-- {start},{inc},{added} +-- +-- For most languages the uncompressed word tree fits in memory. {start} +-- gives the amount of memory in Kbyte that can be used before any +-- compression is done. It should be a bit smaller than the amount of +-- memory that is available to Vim. +-- +-- When going over the {start} limit the {inc} number specifies the +-- amount of memory in Kbyte that can be allocated before another +-- compression is done. A low number means compression is done after +-- less words are added, which is slow. A high number means more memory +-- will be allocated. +-- +-- After doing compression, {added} times 1024 words can be added before +-- the {inc} limit is ignored and compression is done when any extra +-- amount of memory is needed. A low number means there is a smaller +-- chance of hitting the {inc} limit, less memory is used but it's +-- slower. +-- +-- The languages for which these numbers are important are Italian and +-- Hungarian. The default works for when you have about 512 Mbyte. If +-- you have 1 Gbyte you could use: > +-- :set mkspellmem=900000,3000,800 +-- < If you have less than 512 Mbyte |:mkspell| may fail for some +-- languages, no matter what you set `'mkspellmem'` to. +-- +-- This option cannot be set from a |modeline| or in the |sandbox|. +--- @class vim.opt.mkspellmem: vim.Option,string +--- @operator add: vim.opt.mkspellmem +--- @operator sub: vim.opt.mkspellmem +--- @operator pow: vim.opt.mkspellmem +vim.opt.mkspellmem = "460000,2000,500" +vim.opt.msm = vim.opt.mkspellmem +--- @return string +function vim.opt.mkspellmem:get()end + +-- `'modeline'` `'ml'` boolean (default: on (off for root)) +-- local to buffer +-- If `'modeline'` is on `'modelines'` gives the number of lines that is +-- checked for set commands. If `'modeline'` is off or `'modelines'` is zero +-- no lines are checked. See |modeline|. +--- @class vim.opt.modeline: vim.Option,boolean +--- @operator add: vim.opt.modeline +--- @operator sub: vim.opt.modeline +--- @operator pow: vim.opt.modeline +vim.opt.modeline = true +vim.opt.ml = vim.opt.modeline +--- @return boolean +function vim.opt.modeline:get()end + +-- `'modelineexpr'` `'mle'` boolean (default: off) +-- global +-- When on allow some options that are an expression to be set in the +-- modeline. Check the option for whether it is affected by +-- `'modelineexpr'` . Also see |modeline|. +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +--- @class vim.opt.modelineexpr: vim.Option,boolean +--- @operator add: vim.opt.modelineexpr +--- @operator sub: vim.opt.modelineexpr +--- @operator pow: vim.opt.modelineexpr +vim.opt.modelineexpr = false +vim.opt.mle = vim.opt.modelineexpr +--- @return boolean +function vim.opt.modelineexpr:get()end + +-- `'modelines'` `'mls'` number (default 5) +-- global +-- If `'modeline'` is on `'modelines'` gives the number of lines that is +-- checked for set commands. If `'modeline'` is off or `'modelines'` is zero +-- no lines are checked. See |modeline|. +--- @class vim.opt.modelines: vim.Option,number +--- @operator add: vim.opt.modelines +--- @operator sub: vim.opt.modelines +--- @operator pow: vim.opt.modelines +vim.opt.modelines = 5 +vim.opt.mls = vim.opt.modelines +--- @return number +function vim.opt.modelines:get()end + +-- `'modifiable'` `'ma'` boolean (default on) +-- local to buffer +-- When off the buffer contents cannot be changed. The `'fileformat'` and +-- `'fileencoding'` options also can't be changed. +-- Can be reset on startup with the |-M| command line argument. +--- @class vim.opt.modifiable: vim.Option,boolean +--- @operator add: vim.opt.modifiable +--- @operator sub: vim.opt.modifiable +--- @operator pow: vim.opt.modifiable +vim.opt.modifiable = true +vim.opt.ma = vim.opt.modifiable +--- @return boolean +function vim.opt.modifiable:get()end + +-- `'modified'` `'mod'` boolean (default off) +-- local to buffer +-- When on, the buffer is considered to be modified. This option is set +-- when: +-- 1. A change was made to the text since it was last written. Using the +-- |undo| command to go back to the original text will reset the +-- option. But undoing changes that were made before writing the +-- buffer will set the option again, since the text is different from +-- when it was written. +-- 2. `'fileformat'` or `'fileencoding'` is different from its original +-- value. The original value is set when the buffer is read or +-- written. A ":set nomodified" command also resets the original +-- values to the current values and the `'modified'` option will be +-- reset. +-- Similarly for `'eol'` and `'bomb'` . +-- This option is not set when a change is made to the buffer as the +-- result of a BufNewFile, BufRead/BufReadPost, BufWritePost, +-- FileAppendPost or VimLeave autocommand event. See |gzip-example| for +-- an explanation. +-- When `'buftype'` is "nowrite" or "nofile" this option may be set, but +-- will be ignored. +-- Note that the text may actually be the same, e.g. `'modified'` is set +-- when using "rA" on an "A". +--- @class vim.opt.modified: vim.Option,boolean +--- @operator add: vim.opt.modified +--- @operator sub: vim.opt.modified +--- @operator pow: vim.opt.modified +vim.opt.modified = false +vim.opt.mod = vim.opt.modified +--- @return boolean +function vim.opt.modified:get()end + +-- `'more'` boolean (default: on) +-- global +-- When on, listings pause when the whole screen is filled. You will get +-- the |more-prompt|. When this option is off there are no pauses, the +-- listing continues until finished. +--- @class vim.opt.more: vim.Option,boolean +--- @operator add: vim.opt.more +--- @operator sub: vim.opt.more +--- @operator pow: vim.opt.more +vim.opt.more = true +--- @return boolean +function vim.opt.more:get()end + +-- `'mouse'` string (default "nvi") +-- global +-- +-- Enables mouse support. For example, to enable the mouse in Normal mode +-- and Visual mode: > +-- :set mouse=nv +-- < +-- To temporarily disable mouse support, hold the shift key while using +-- the mouse. +-- +-- Mouse support can be enabled for different modes: +-- n Normal mode +-- v Visual mode +-- i Insert mode +-- c Command-line mode +-- h all previous modes when editing a help file +-- a all previous modes +-- r for |hit-enter| and |more-prompt| prompt +-- +-- Left-click anywhere in a text buffer to place the cursor there. This +-- works with operators too, e.g. type |d| then left-click to delete text +-- from the current cursor position to the position where you clicked. +-- +-- Drag the |status-line| or vertical separator of a window to resize it. +-- +-- If enabled for "v" (Visual mode) then double-click selects word-wise, +-- triple-click makes it line-wise, and quadruple-click makes it +-- rectangular block-wise. +-- +-- For scrolling with a mouse wheel see |scroll-mouse-wheel|. +-- +-- Note: When enabling the mouse in a terminal, copy/paste will use the +-- "* register if possible. See also `'clipboard'` . +-- +-- Related options: +-- `'mousefocus'` window focus follows mouse pointer +-- `'mousemodel'` what mouse button does which action +-- `'mousehide'` hide mouse pointer while typing text +-- `'selectmode'` whether to start Select mode or Visual mode +--- @class vim.opt.mouse: vim.Option,string[] +--- @operator add: vim.opt.mouse +--- @operator sub: vim.opt.mouse +--- @operator pow: vim.opt.mouse +vim.opt.mouse = "nvi" +--- @return string[] +function vim.opt.mouse:get()end + +-- `'mousefocus'` `'mousef'` boolean (default off) +-- global +-- The window that the mouse pointer is on is automatically activated. +-- When changing the window layout or window focus in another way, the +-- mouse pointer is moved to the window with keyboard focus. Off is the +-- default because it makes using the pull down menus a little goofy, as +-- a pointer transit may activate a window unintentionally. +--- @class vim.opt.mousefocus: vim.Option,boolean +--- @operator add: vim.opt.mousefocus +--- @operator sub: vim.opt.mousefocus +--- @operator pow: vim.opt.mousefocus +vim.opt.mousefocus = false +vim.opt.mousef = vim.opt.mousefocus +--- @return boolean +function vim.opt.mousefocus:get()end + +-- `'mousehide'` `'mh'` boolean (default on) +-- global +-- {only works in the GUI} +-- When on, the mouse pointer is hidden when characters are typed. +-- The mouse pointer is restored when the mouse is moved. +--- @class vim.opt.mousehide: vim.Option,boolean +--- @operator add: vim.opt.mousehide +--- @operator sub: vim.opt.mousehide +--- @operator pow: vim.opt.mousehide +vim.opt.mousehide = true +vim.opt.mh = vim.opt.mousehide +--- @return boolean +function vim.opt.mousehide:get()end + +-- `'mousemodel'` `'mousem'` string (default "popup_setpos") +-- global +-- Sets the model to use for the mouse. The name mostly specifies what +-- the right mouse button is used for: +-- extend Right mouse button extends a selection. This works +-- like in an xterm. +-- popup Right mouse button pops up a menu. The shifted left +-- mouse button extends a selection. This works like +-- with Microsoft Windows. +-- popup_setpos Like "popup", but the cursor will be moved to the +-- position where the mouse was clicked, and thus the +-- selected operation will act upon the clicked object. +-- If clicking inside a selection, that selection will +-- be acted upon, i.e. no cursor move. This implies of +-- course, that right clicking outside a selection will +-- end Visual mode. +-- Overview of what button does what for each model: +-- mouse extend popup(_setpos) ~ +-- left click place cursor place cursor +-- left drag start selection start selection +-- shift-left search word extend selection +-- right click extend selection popup menu (place cursor) +-- right drag extend selection - +-- middle click paste paste +-- +-- In the "popup" model the right mouse button produces a pop-up menu. +-- Nvim creates a default |popup-menu| but you can redefine it. +-- +-- Note that you can further refine the meaning of buttons with mappings. +-- See |mouse-overview|. But mappings are NOT used for modeless selection. +-- +-- Example: > +-- :map +-- :map +-- :map +-- :map <2-S-LeftMouse> <2-RightMouse> +-- :map <2-S-LeftDrag> <2-RightDrag> +-- :map <2-S-LeftRelease> <2-RightRelease> +-- :map <3-S-LeftMouse> <3-RightMouse> +-- :map <3-S-LeftDrag> <3-RightDrag> +-- :map <3-S-LeftRelease> <3-RightRelease> +-- :map <4-S-LeftMouse> <4-RightMouse> +-- :map <4-S-LeftDrag> <4-RightDrag> +-- :map <4-S-LeftRelease> <4-RightRelease> +-- < +-- Mouse commands requiring the CTRL modifier can be simulated by typing +-- the "g" key before using the mouse: +-- "g" is " (jump to tag under mouse click) +-- "g" is " ("CTRL-T") +--- @class vim.opt.mousemodel: vim.Option,string +--- @operator add: vim.opt.mousemodel +--- @operator sub: vim.opt.mousemodel +--- @operator pow: vim.opt.mousemodel +vim.opt.mousemodel = "popup_setpos" +vim.opt.mousem = vim.opt.mousemodel +--- @return string +function vim.opt.mousemodel:get()end + +-- `'mousemoveevent'` `'mousemev'` boolean (default off) +-- global +-- When on, mouse move events are delivered to the input queue and are +-- available for mapping. The default, off, avoids the mouse movement +-- overhead except when needed. +-- Warning: Setting this option can make pending mappings to be aborted +-- when the mouse is moved. +--- @class vim.opt.mousemoveevent: vim.Option,boolean +--- @operator add: vim.opt.mousemoveevent +--- @operator sub: vim.opt.mousemoveevent +--- @operator pow: vim.opt.mousemoveevent +vim.opt.mousemoveevent = false +vim.opt.mousemev = vim.opt.mousemoveevent +--- @return boolean +function vim.opt.mousemoveevent:get()end + +-- `'mousescroll'` string (default "ver:3,hor:6") +-- global +-- This option controls the number of lines / columns to scroll by when +-- scrolling with a mouse. The option is a comma separated list of parts. +-- Each part consists of a direction and a count as follows: +-- direction:count,direction:count +-- Direction is one of either "hor" or "ver". "hor" controls horizontal +-- scrolling and "ver" controls vertical scrolling. Count sets the amount +-- to scroll by for the given direction, it should be a non negative +-- integer. Each direction should be set at most once. If a direction +-- is omitted, a default value is used (6 for horizontal scrolling and 3 +-- for vertical scrolling). You can disable mouse scrolling by using +-- a count of 0. +-- +-- Example: > +-- :set mousescroll=ver:5,hor:2 +-- < Will make Nvim scroll 5 lines at a time when scrolling vertically, and +-- scroll 2 columns at a time when scrolling horizontally. +--- @class vim.opt.mousescroll: vim.Option,string[] +--- @operator add: vim.opt.mousescroll +--- @operator sub: vim.opt.mousescroll +--- @operator pow: vim.opt.mousescroll +vim.opt.mousescroll = "ver:3,hor:6" +--- @return string[] +function vim.opt.mousescroll:get()end + +-- `'mouseshape'` `'mouses'` string (default "i:beam,r:beam,s:updown,sd:cross, +-- m:no,ml:up-arrow,v:rightup-arrow") +-- global +-- This option tells Vim what the mouse pointer should look like in +-- different modes. The option is a comma-separated list of parts, much +-- like used for `'guicursor'` . Each part consist of a mode/location-list +-- and an argument-list: +-- mode-list:shape,mode-list:shape,.. +-- The mode-list is a dash separated list of these modes/locations: +-- In a normal window: ~ +-- n Normal mode +-- v Visual mode +-- ve Visual mode with `'selection'` "exclusive" (same as `'v'` , +-- if not specified) +-- o Operator-pending mode +-- i Insert mode +-- r Replace mode +-- +-- Others: ~ +-- c appending to the command-line +-- ci inserting in the command-line +-- cr replacing in the command-line +-- m at the 'Hit ENTER' or `'More'` prompts +-- ml idem, but cursor in the last line +-- e any mode, pointer below last window +-- s any mode, pointer on a status line +-- sd any mode, while dragging a status line +-- vs any mode, pointer on a vertical separator line +-- vd any mode, while dragging a vertical separator line +-- a everywhere +-- +-- The shape is one of the following: +-- avail name looks like ~ +-- w x arrow Normal mouse pointer +-- w x blank no pointer at all (use with care!) +-- w x beam I-beam +-- w x updown up-down sizing arrows +-- w x leftright left-right sizing arrows +-- w x busy The system's usual busy pointer +-- w x no The system's usual "no input" pointer +-- x udsizing indicates up-down resizing +-- x lrsizing indicates left-right resizing +-- x crosshair like a big thin + +-- x hand1 black hand +-- x hand2 white hand +-- x pencil what you write with +-- x question big ? +-- x rightup-arrow arrow pointing right-up +-- w x up-arrow arrow pointing up +-- x any X11 pointer number (see X11/cursorfont.h) +-- +-- The "avail" column contains a `'w'` if the shape is available for Win32, +-- x for X11. +-- Any modes not specified or shapes not available use the normal mouse +-- pointer. +-- +-- Example: > +-- :set mouseshape=s:udsizing,m:no +-- < will make the mouse turn to a sizing arrow over the status lines and +-- indicate no input when the hit-enter prompt is displayed (since +-- clicking the mouse has no effect in this state.) +--- @class vim.opt.mouseshape: vim.Option,string +--- @operator add: vim.opt.mouseshape +--- @operator sub: vim.opt.mouseshape +--- @operator pow: vim.opt.mouseshape +vim.opt.mouseshape = "" +vim.opt.mouses = vim.opt.mouseshape +--- @return string +function vim.opt.mouseshape:get()end + +-- `'mousetime'` `'mouset'` number (default 500) +-- global +-- Defines the maximum time in msec between two mouse clicks for the +-- second click to be recognized as a multi click. +--- @class vim.opt.mousetime: vim.Option,number +--- @operator add: vim.opt.mousetime +--- @operator sub: vim.opt.mousetime +--- @operator pow: vim.opt.mousetime +vim.opt.mousetime = 500 +vim.opt.mouset = vim.opt.mousetime +--- @return number +function vim.opt.mousetime:get()end + +-- `'nrformats'` `'nf'` string (default "bin,hex") +-- local to buffer +-- This defines what bases Vim will consider for numbers when using the +-- CTRL-A and CTRL-X commands for adding to and subtracting from a number +-- respectively; see |CTRL-A| for more info on these commands. +-- alpha If included, single alphabetical characters will be +-- incremented or decremented. This is useful for a list with a +-- letter index a), b), etc. +-- octal If included, numbers that start with a zero will be considered +-- to be octal. Example: Using CTRL-A on "007" results in "010". +-- hex If included, numbers starting with "0x" or "0X" will be +-- considered to be hexadecimal. Example: Using CTRL-X on +-- "0x100" results in "0x0ff". +-- bin If included, numbers starting with "0b" or "0B" will be +-- considered to be binary. Example: Using CTRL-X on +-- "0b1000" subtracts one, resulting in "0b0111". +-- unsigned If included, numbers are recognized as unsigned. Thus a +-- leading dash or negative sign won't be considered as part of +-- the number. Examples: +-- Using CTRL-X on "2020" in "9-2020" results in "9-2019" +-- (without "unsigned" it would become "9-2021"). +-- Using CTRL-A on "2020" in "9-2020" results in "9-2021" +-- (without "unsigned" it would become "9-2019"). +-- Using CTRL-X on "0" or CTRL-A on "18446744073709551615" +-- (2^64 - 1) has no effect, overflow is prevented. +-- Numbers which simply begin with a digit in the range 1-9 are always +-- considered decimal. This also happens for numbers that are not +-- recognized as octal or hex. +--- @class vim.opt.nrformats: vim.Option,string[] +--- @operator add: vim.opt.nrformats +--- @operator sub: vim.opt.nrformats +--- @operator pow: vim.opt.nrformats +vim.opt.nrformats = "bin,hex" +vim.opt.nf = vim.opt.nrformats +--- @return string[] +function vim.opt.nrformats:get()end + +-- `'number'` `'nu'` boolean (default off) +-- local to window +-- Print the line number in front of each line. When the `'n'` option is +-- excluded from `'cpoptions'` a wrapped line will not use the column of +-- line numbers. +-- Use the `'numberwidth'` option to adjust the room for the line number. +-- When a long, wrapped line doesn't start with the first character, `'-'` +-- characters are put before the number. +-- For highlighting see |hl-LineNr|, |hl-CursorLineNr|, and the +-- |:sign-define| "numhl" argument. +-- +-- The `'relativenumber'` option changes the displayed number to be +-- relative to the cursor. Together with `'number'` there are these +-- four combinations (cursor in line 3): +-- +-- `'nonu'` `'nu'` `'nonu'` `'nu'` +-- `'nornu'` `'nornu'` `'rnu'` `'rnu'` +-- > +-- |apple | 1 apple | 2 apple | 2 apple +-- |pear | 2 pear | 1 pear | 1 pear +-- |nobody | 3 nobody | 0 nobody |3 nobody +-- |there | 4 there | 1 there | 1 there +-- < +--- @class vim.opt.number: vim.Option,boolean +--- @operator add: vim.opt.number +--- @operator sub: vim.opt.number +--- @operator pow: vim.opt.number +vim.opt.number = false +vim.opt.nu = vim.opt.number +--- @return boolean +function vim.opt.number:get()end + +-- `'numberwidth'` `'nuw'` number (default: 4) +-- local to window +-- Minimal number of columns to use for the line number. Only relevant +-- when the `'number'` or `'relativenumber'` option is set or printing lines +-- with a line number. Since one space is always between the number and +-- the text, there is one less character for the number itself. +-- The value is the minimum width. A bigger width is used when needed to +-- fit the highest line number in the buffer respectively the number of +-- rows in the window, depending on whether `'number'` or `'relativenumber'` +-- is set. Thus with the Vim default of 4 there is room for a line number +-- up to 999. When the buffer has 1000 lines five columns will be used. +-- The minimum value is 1, the maximum value is 20. +--- @class vim.opt.numberwidth: vim.Option,number +--- @operator add: vim.opt.numberwidth +--- @operator sub: vim.opt.numberwidth +--- @operator pow: vim.opt.numberwidth +vim.opt.numberwidth = 4 +vim.opt.nuw = vim.opt.numberwidth +--- @return number +function vim.opt.numberwidth:get()end + +-- `'omnifunc'` `'ofu'` string (default: empty) +-- local to buffer +-- This option specifies a function to be used for Insert mode omni +-- completion with CTRL-X CTRL-O. |i_CTRL-X_CTRL-O| +-- See |complete-functions| for an explanation of how the function is +-- invoked and what it should return. The value can be the name of a +-- function, a |lambda| or a |Funcref|. See |option-value-function| for +-- more information. +-- This option is usually set by a filetype plugin: +-- |:filetype-plugin-on| +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +--- @class vim.opt.omnifunc: vim.Option,string +--- @operator add: vim.opt.omnifunc +--- @operator sub: vim.opt.omnifunc +--- @operator pow: vim.opt.omnifunc +vim.opt.omnifunc = "" +vim.opt.ofu = vim.opt.omnifunc +--- @return string +function vim.opt.omnifunc:get()end + +-- `'opendevice'` `'odev'` boolean (default off) +-- global +-- {only for Windows} +-- Enable reading and writing from devices. This may get Vim stuck on a +-- device that can be opened but doesn't actually do the I/O. Therefore +-- it is off by default. +-- Note that on Windows editing "aux.h", "lpt1.txt" and the like also +-- result in editing a device. +--- @class vim.opt.opendevice: vim.Option,boolean +--- @operator add: vim.opt.opendevice +--- @operator sub: vim.opt.opendevice +--- @operator pow: vim.opt.opendevice +vim.opt.opendevice = false +vim.opt.odev = vim.opt.opendevice +--- @return boolean +function vim.opt.opendevice:get()end + +-- `'operatorfunc'` `'opfunc'` string (default: empty) +-- global +-- This option specifies a function to be called by the |g@| operator. +-- See |:map-operator| for more info and an example. The value can be +-- the name of a function, a |lambda| or a |Funcref|. See +-- |option-value-function| for more information. +-- +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +--- @class vim.opt.operatorfunc: vim.Option,string +--- @operator add: vim.opt.operatorfunc +--- @operator sub: vim.opt.operatorfunc +--- @operator pow: vim.opt.operatorfunc +vim.opt.operatorfunc = "" +vim.opt.opfunc = vim.opt.operatorfunc +--- @return string +function vim.opt.operatorfunc:get()end + +-- `'packpath'` `'pp'` string (default: see `'runtimepath'` ) +-- Directories used to find packages. See |packages| and |rtp-packages|. +--- @class vim.opt.packpath: vim.Option,string[] +--- @operator add: vim.opt.packpath +--- @operator sub: vim.opt.packpath +--- @operator pow: vim.opt.packpath +vim.opt.packpath = "/home/runner/.config/nvim,/etc/xdg/nvim,/home/runner/.local/share/nvim/site,/usr/local/share/nvim/site,/usr/share/nvim/site,/tmp/nvim/squashfs-root/usr/share/nvim/runtime,/tmp/nvim/squashfs-root/usr/lib/nvim,/usr/share/nvim/site/after,/usr/local/share/nvim/site/after,/home/runner/.local/share/nvim/site/after,/etc/xdg/nvim/after,/home/runner/.config/nvim/after" +vim.opt.pp = vim.opt.packpath +--- @return string[] +function vim.opt.packpath:get()end + +-- `'paragraphs'` `'para'` string (default "IPLPPPQPP TPHPLIPpLpItpplpipbp") +-- global +-- Specifies the nroff macros that separate paragraphs. These are pairs +-- of two letters (see |object-motions|). +--- @class vim.opt.paragraphs: vim.Option,string +--- @operator add: vim.opt.paragraphs +--- @operator sub: vim.opt.paragraphs +--- @operator pow: vim.opt.paragraphs +vim.opt.paragraphs = "IPLPPPQPP TPHPLIPpLpItpplpipbp" +vim.opt.para = vim.opt.paragraphs +--- @return string +function vim.opt.paragraphs:get()end + +--- @class vim.opt.paste: vim.Option,boolean +--- @operator add: vim.opt.paste +--- @operator sub: vim.opt.paste +--- @operator pow: vim.opt.paste +vim.opt.paste = false +--- @return boolean +function vim.opt.paste:get()end + +--- @class vim.opt.pastetoggle: vim.Option,string +--- @operator add: vim.opt.pastetoggle +--- @operator sub: vim.opt.pastetoggle +--- @operator pow: vim.opt.pastetoggle +vim.opt.pastetoggle = "" +vim.opt.pt = vim.opt.pastetoggle +--- @return string +function vim.opt.pastetoggle:get()end + +-- `'patchexpr'` `'pex'` string (default "") +-- global +-- Expression which is evaluated to apply a patch to a file and generate +-- the resulting new version of the file. See |diff-patchexpr|. +--- @class vim.opt.patchexpr: vim.Option,string +--- @operator add: vim.opt.patchexpr +--- @operator sub: vim.opt.patchexpr +--- @operator pow: vim.opt.patchexpr +vim.opt.patchexpr = "" +vim.opt.pex = vim.opt.patchexpr +--- @return string +function vim.opt.patchexpr:get()end + +-- `'patchmode'` `'pm'` string (default "") +-- global +-- When non-empty the oldest version of a file is kept. This can be used +-- to keep the original version of a file if you are changing files in a +-- source distribution. Only the first time that a file is written a +-- copy of the original file will be kept. The name of the copy is the +-- name of the original file with the string in the `'patchmode'` option +-- appended. This option should start with a dot. Use a string like +-- ".orig" or ".org". `'backupdir'` must not be empty for this to work +-- (Detail: The backup file is renamed to the patchmode file after the +-- new file has been successfully written, that's why it must be possible +-- to write a backup file). If there was no file to be backed up, an +-- empty file is created. +-- When the `'backupskip'` pattern matches, a patchmode file is not made. +-- Using `'patchmode'` for compressed files appends the extension at the +-- end (e.g., "file.gz.orig"), thus the resulting name isn't always +-- recognized as a compressed file. +-- Only normal file name characters can be used, "/\*?[|<>" are illegal. +--- @class vim.opt.patchmode: vim.Option,string +--- @operator add: vim.opt.patchmode +--- @operator sub: vim.opt.patchmode +--- @operator pow: vim.opt.patchmode +vim.opt.patchmode = "" +vim.opt.pm = vim.opt.patchmode +--- @return string +function vim.opt.patchmode:get()end + +-- `'path'` `'pa'` string (default: ".,,") +-- global or local to buffer |global-local| +-- This is a list of directories which will be searched when using the +-- |gf|, [f, ]f, ^Wf, |:find|, |:sfind|, |:tabfind| and other commands, +-- provided that the file being searched for has a relative path (not +-- starting with "/", "./" or "../"). The directories in the `'path'` +-- option may be relative or absolute. +-- - Use commas to separate directory names: > +-- :set path=.,/usr/local/include,/usr/include +-- < - Spaces can also be used to separate directory names (for backwards +-- compatibility with version 3.0). To have a space in a directory +-- name, precede it with an extra backslash, and escape the space: > +-- :set path=.,/dir/with\\\ space +-- < - To include a comma in a directory name precede it with an extra +-- backslash: > +-- :set path=.,/dir/with\\,comma +-- < - To search relative to the directory of the current file, use: > +-- :set path=. +-- < - To search in the current directory use an empty string between two +-- commas: > +-- :set path=,, +-- < - A directory name may end in a `':'` or `'/'` . +-- - Environment variables are expanded |:set_env|. +-- - When using |netrw.vim| URLs can be used. For example, adding +-- "https://www.vim.org" will make ":find index.html" work. +-- - Search upwards and downwards in a directory tree using "*", "" and +-- ";". See |file-searching| for info and syntax. +-- - Careful with `'\'` characters, type two to get one in the option: > +-- :set path=.,c:\\include +-- < Or just use `'/'` instead: > +-- :set path=.,c:/include +-- < Don't forget "." or files won't even be found in the same directory as +-- the file! +-- The maximum length is limited. How much depends on the system, mostly +-- it is something like 256 or 1024 characters. +-- You can check if all the include files are found, using the value of +-- `'path'` , see |:checkpath|. +-- The use of |:set+=| and |:set-=| is preferred when adding or removing +-- directories from the list. This avoids problems when a future version +-- uses another default. To remove the current directory use: > +-- :set path-= +-- < To add the current directory use: > +-- :set path+= +-- < To use an environment variable, you probably need to replace the +-- separator. Here is an example to append $INCL, in which directory +-- names are separated with a semi-colon: > +-- :let &path = &path .. "," .. substitute($INCL, `';'` , `','` , `'g'` ) +-- < Replace the `';'` with a `':'` or whatever separator is used. Note that +-- this doesn't work when $INCL contains a comma or white space. +--- @class vim.opt.path: vim.Option,string[] +--- @operator add: vim.opt.path +--- @operator sub: vim.opt.path +--- @operator pow: vim.opt.path +vim.opt.path = ".,," +vim.opt.pa = vim.opt.path +--- @return string[] +function vim.opt.path:get()end + +-- `'preserveindent'` `'pi'` boolean (default off) +-- local to buffer +-- When changing the indent of the current line, preserve as much of the +-- indent structure as possible. Normally the indent is replaced by a +-- series of tabs followed by spaces as required (unless |`'expandtab'` | is +-- enabled, in which case only spaces are used). Enabling this option +-- means the indent will preserve as many existing characters as possible +-- for indenting, and only add additional tabs or spaces as required. +-- `'expandtab'` does not apply to the preserved white space, a Tab remains +-- a Tab. +-- NOTE: When using ">>" multiple times the resulting indent is a mix of +-- tabs and spaces. You might not like this. +-- Also see `'copyindent'` . +-- Use |:retab| to clean up white space. +--- @class vim.opt.preserveindent: vim.Option,boolean +--- @operator add: vim.opt.preserveindent +--- @operator sub: vim.opt.preserveindent +--- @operator pow: vim.opt.preserveindent +vim.opt.preserveindent = false +vim.opt.pi = vim.opt.preserveindent +--- @return boolean +function vim.opt.preserveindent:get()end + +-- `'previewheight'` `'pvh'` number (default 12) +-- global +-- Default height for a preview window. Used for |:ptag| and associated +-- commands. Used for |CTRL-W_}| when no count is given. +--- @class vim.opt.previewheight: vim.Option,number +--- @operator add: vim.opt.previewheight +--- @operator sub: vim.opt.previewheight +--- @operator pow: vim.opt.previewheight +vim.opt.previewheight = 12 +vim.opt.pvh = vim.opt.previewheight +--- @return number +function vim.opt.previewheight:get()end + +-- `'previewwindow'` `'pvw'` boolean (default off) +-- local to window +-- Identifies the preview window. Only one window can have this option +-- set. It's normally not set directly, but by using one of the commands +-- |:ptag|, |:pedit|, etc. +--- @class vim.opt.previewwindow: vim.Option,boolean +--- @operator add: vim.opt.previewwindow +--- @operator sub: vim.opt.previewwindow +--- @operator pow: vim.opt.previewwindow +vim.opt.previewwindow = false +vim.opt.pvw = vim.opt.previewwindow +--- @return boolean +function vim.opt.previewwindow:get()end + +--- @class vim.opt.prompt: vim.Option,boolean +--- @operator add: vim.opt.prompt +--- @operator sub: vim.opt.prompt +--- @operator pow: vim.opt.prompt +vim.opt.prompt = true +--- @return boolean +function vim.opt.prompt:get()end + +-- `'pumblend'` `'pb'` number (default 0) +-- global +-- Enables pseudo-transparency for the |popup-menu|. Valid values are in +-- the range of 0 for fully opaque popupmenu (disabled) to 100 for fully +-- transparent background. Values between 0-30 are typically most useful. +-- +-- It is possible to override the level for individual highlights within +-- the popupmenu using |highlight-blend|. For instance, to enable +-- transparency but force the current selected element to be fully opaque: > +-- +-- :set pumblend=15 +-- :hi PmenuSel blend=0 +-- < +-- UI-dependent. Works best with RGB colors. `'termguicolors'` +--- @class vim.opt.pumblend: vim.Option,number +--- @operator add: vim.opt.pumblend +--- @operator sub: vim.opt.pumblend +--- @operator pow: vim.opt.pumblend +vim.opt.pumblend = 0 +vim.opt.pb = vim.opt.pumblend +--- @return number +function vim.opt.pumblend:get()end + +-- `'pumheight'` `'ph'` number (default 0) +-- global +-- Maximum number of items to show in the popup menu +-- (|ins-completion-menu|). Zero means "use available screen space". +--- @class vim.opt.pumheight: vim.Option,number +--- @operator add: vim.opt.pumheight +--- @operator sub: vim.opt.pumheight +--- @operator pow: vim.opt.pumheight +vim.opt.pumheight = 0 +vim.opt.ph = vim.opt.pumheight +--- @return number +function vim.opt.pumheight:get()end + +-- `'pumwidth'` `'pw'` number (default 15) +-- global +-- Minimum width for the popup menu (|ins-completion-menu|). If the +-- cursor column + `'pumwidth'` exceeds screen width, the popup menu is +-- nudged to fit on the screen. +--- @class vim.opt.pumwidth: vim.Option,number +--- @operator add: vim.opt.pumwidth +--- @operator sub: vim.opt.pumwidth +--- @operator pow: vim.opt.pumwidth +vim.opt.pumwidth = 15 +vim.opt.pw = vim.opt.pumwidth +--- @return number +function vim.opt.pumwidth:get()end + +-- `'pyxversion'` `'pyx'` number (default 3) +-- global +-- Specifies the python version used for pyx* functions and commands +-- |python_x|. As only Python 3 is supported, this always has the value +-- `3`. Setting any other value is an error. +-- +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +--- @class vim.opt.pyxversion: vim.Option,number +--- @operator add: vim.opt.pyxversion +--- @operator sub: vim.opt.pyxversion +--- @operator pow: vim.opt.pyxversion +vim.opt.pyxversion = 3 +vim.opt.pyx = vim.opt.pyxversion +--- @return number +function vim.opt.pyxversion:get()end + +-- `'quickfixtextfunc'` `'qftf'` string (default "") +-- global +-- This option specifies a function to be used to get the text to display +-- in the quickfix and location list windows. This can be used to +-- customize the information displayed in the quickfix or location window +-- for each entry in the corresponding quickfix or location list. See +-- |quickfix-window-function| for an explanation of how to write the +-- function and an example. The value can be the name of a function, a +-- |lambda| or a |Funcref|. See |option-value-function| for more +-- information. +-- +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +--- @class vim.opt.quickfixtextfunc: vim.Option,string +--- @operator add: vim.opt.quickfixtextfunc +--- @operator sub: vim.opt.quickfixtextfunc +--- @operator pow: vim.opt.quickfixtextfunc +vim.opt.quickfixtextfunc = "" +vim.opt.qftf = vim.opt.quickfixtextfunc +--- @return string +function vim.opt.quickfixtextfunc:get()end + +-- `'quoteescape'` `'qe'` string (default "\") +-- local to buffer +-- The characters that are used to escape quotes in a string. Used for +-- objects like a', a" and a` |a'|. +-- When one of the characters in this option is found inside a string, +-- the following character will be skipped. The default value makes the +-- text "foo\"bar\\" considered to be one string. +--- @class vim.opt.quoteescape: vim.Option,string +--- @operator add: vim.opt.quoteescape +--- @operator sub: vim.opt.quoteescape +--- @operator pow: vim.opt.quoteescape +vim.opt.quoteescape = "\\" +vim.opt.qe = vim.opt.quoteescape +--- @return string +function vim.opt.quoteescape:get()end + +-- `'readonly'` `'ro'` boolean (default off) +-- local to buffer +-- If on, writes fail unless you use a `'!'` . Protects you from +-- accidentally overwriting a file. Default on when Vim is started +-- in read-only mode ("vim -R") or when the executable is called "view". +-- When using ":w!" the `'readonly'` option is reset for the current +-- buffer, unless the `'Z'` flag is in `'cpoptions'` . +-- When using the ":view" command the `'readonly'` option is set for the +-- newly edited buffer. +-- See `'modifiable'` for disallowing changes to the buffer. +--- @class vim.opt.readonly: vim.Option,boolean +--- @operator add: vim.opt.readonly +--- @operator sub: vim.opt.readonly +--- @operator pow: vim.opt.readonly +vim.opt.readonly = false +vim.opt.ro = vim.opt.readonly +--- @return boolean +function vim.opt.readonly:get()end + +-- `'redrawdebug'` `'rdb'` string (default `''` ) +-- global +-- Flags to change the way redrawing works, for debugging purposes. +-- Most useful with `'writedelay'` set to some reasonable value. +-- Supports the following flags: +-- compositor Indicate each redraw event handled by the compositor +-- by briefly flashing the redrawn regions in colors +-- indicating the redraw type. These are the highlight +-- groups used (and their default colors): +-- RedrawDebugNormal gui=reverse normal redraw passed through +-- RedrawDebugClear guibg=Yellow clear event passed through +-- RedrawDebugComposed guibg=Green redraw event modified by the +-- compositor (due to +-- overlapping grids, etc) +-- RedrawDebugRecompose guibg=Red redraw generated by the +-- compositor itself, due to a +-- grid being moved or deleted. +-- line introduce a delay after each line drawn on the screen. +-- When using the TUI or another single-grid UI, "compositor" +-- gives more information and should be preferred (every +-- line is processed as a separate event by the compositor) +-- flush introduce a delay after each "flush" event. +-- nothrottle Turn off throttling of the message grid. This is an +-- optimization that joins many small scrolls to one +-- larger scroll when drawing the message area (with +-- `'display'` msgsep flag active). +-- invalid Enable stricter checking (abort) of inconsistencies +-- of the internal screen state. This is mostly +-- useful when running nvim inside a debugger (and +-- the test suite). +-- nodelta Send all internally redrawn cells to the UI, even if +-- they are unchanged from the already displayed state. +--- @class vim.opt.redrawdebug: vim.Option,string[] +--- @operator add: vim.opt.redrawdebug +--- @operator sub: vim.opt.redrawdebug +--- @operator pow: vim.opt.redrawdebug +vim.opt.redrawdebug = "" +vim.opt.rdb = vim.opt.redrawdebug +--- @return string[] +function vim.opt.redrawdebug:get()end + +-- `'redrawtime'` `'rdt'` number (default 2000) +-- global +-- Time in milliseconds for redrawing the display. Applies to +-- `'hlsearch'` , `'inccommand'` , |:match| highlighting and syntax +-- highlighting. +-- When redrawing takes more than this many milliseconds no further +-- matches will be highlighted. +-- For syntax highlighting the time applies per window. When over the +-- limit syntax highlighting is disabled until |CTRL-L| is used. +-- This is used to avoid that Vim hangs when using a very complicated +-- pattern. +--- @class vim.opt.redrawtime: vim.Option,number +--- @operator add: vim.opt.redrawtime +--- @operator sub: vim.opt.redrawtime +--- @operator pow: vim.opt.redrawtime +vim.opt.redrawtime = 2000 +vim.opt.rdt = vim.opt.redrawtime +--- @return number +function vim.opt.redrawtime:get()end + +-- `'regexpengine'` `'re'` number (default 0) +-- global +-- This selects the default regexp engine. |two-engines| +-- The possible values are: +-- 0 automatic selection +-- 1 old engine +-- 2 NFA engine +-- Note that when using the NFA engine and the pattern contains something +-- that is not supported the pattern will not match. This is only useful +-- for debugging the regexp engine. +-- Using automatic selection enables Vim to switch the engine, if the +-- default engine becomes too costly. E.g., when the NFA engine uses too +-- many states. This should prevent Vim from hanging on a combination of +-- a complex pattern with long text. +--- @class vim.opt.regexpengine: vim.Option,number +--- @operator add: vim.opt.regexpengine +--- @operator sub: vim.opt.regexpengine +--- @operator pow: vim.opt.regexpengine +vim.opt.regexpengine = 0 +vim.opt.re = vim.opt.regexpengine +--- @return number +function vim.opt.regexpengine:get()end + +-- `'relativenumber'` `'rnu'` boolean (default off) +-- local to window +-- Show the line number relative to the line with the cursor in front of +-- each line. Relative line numbers help you use the |count| you can +-- precede some vertical motion commands (e.g. j k + -) with, without +-- having to calculate it yourself. Especially useful in combination with +-- other commands (e.g. y d c < > gq gw =). +-- When the `'n'` option is excluded from `'cpoptions'` a wrapped +-- line will not use the column of line numbers. +-- The `'numberwidth'` option can be used to set the room used for the line +-- number. +-- When a long, wrapped line doesn't start with the first character, `'-'` +-- characters are put before the number. +-- See |hl-LineNr| and |hl-CursorLineNr| for the highlighting used for +-- the number. +-- +-- The number in front of the cursor line also depends on the value of +-- `'number'` , see |number_relativenumber| for all combinations of the two +-- options. +--- @class vim.opt.relativenumber: vim.Option,boolean +--- @operator add: vim.opt.relativenumber +--- @operator sub: vim.opt.relativenumber +--- @operator pow: vim.opt.relativenumber +vim.opt.relativenumber = false +vim.opt.rnu = vim.opt.relativenumber +--- @return boolean +function vim.opt.relativenumber:get()end + +--- @class vim.opt.remap: vim.Option,boolean +--- @operator add: vim.opt.remap +--- @operator sub: vim.opt.remap +--- @operator pow: vim.opt.remap +vim.opt.remap = true +--- @return boolean +function vim.opt.remap:get()end + +-- `'report'` number (default 2) +-- global +-- Threshold for reporting number of lines changed. When the number of +-- changed lines is more than `'report'` a message will be given for most +-- ":" commands. If you want it always, set `'report'` to 0. +-- For the ":substitute" command the number of substitutions is used +-- instead of the number of lines. +--- @class vim.opt.report: vim.Option,number +--- @operator add: vim.opt.report +--- @operator sub: vim.opt.report +--- @operator pow: vim.opt.report +vim.opt.report = 2 +--- @return number +function vim.opt.report:get()end + +-- `'revins'` `'ri'` boolean (default off) +-- global +-- Inserting characters in Insert mode will work backwards. See "typing +-- backwards" |ins-reverse|. This option can be toggled with the CTRL-_ +-- command in Insert mode, when `'allowrevins'` is set. +--- @class vim.opt.revins: vim.Option,boolean +--- @operator add: vim.opt.revins +--- @operator sub: vim.opt.revins +--- @operator pow: vim.opt.revins +vim.opt.revins = false +vim.opt.ri = vim.opt.revins +--- @return boolean +function vim.opt.revins:get()end + +-- `'rightleft'` `'rl'` boolean (default off) +-- local to window +-- When on, display orientation becomes right-to-left, i.e., characters +-- that are stored in the file appear from the right to the left. +-- Using this option, it is possible to edit files for languages that +-- are written from the right to the left such as Hebrew and Arabic. +-- This option is per window, so it is possible to edit mixed files +-- simultaneously, or to view the same file in both ways (this is +-- useful whenever you have a mixed text file with both right-to-left +-- and left-to-right strings so that both sets are displayed properly +-- in different windows). Also see |rileft.txt|. +--- @class vim.opt.rightleft: vim.Option,boolean +--- @operator add: vim.opt.rightleft +--- @operator sub: vim.opt.rightleft +--- @operator pow: vim.opt.rightleft +vim.opt.rightleft = false +vim.opt.rl = vim.opt.rightleft +--- @return boolean +function vim.opt.rightleft:get()end + +-- `'rightleftcmd'` `'rlc'` string (default "search") +-- local to window +-- Each word in this option enables the command line editing to work in +-- right-to-left mode for a group of commands: +-- +-- search "/" and "?" commands +-- +-- This is useful for languages such as Hebrew, Arabic and Farsi. +-- The `'rightleft'` option must be set for `'rightleftcmd'` to take effect. +--- @class vim.opt.rightleftcmd: vim.Option,string +--- @operator add: vim.opt.rightleftcmd +--- @operator sub: vim.opt.rightleftcmd +--- @operator pow: vim.opt.rightleftcmd +vim.opt.rightleftcmd = "search" +vim.opt.rlc = vim.opt.rightleftcmd +--- @return string +function vim.opt.rightleftcmd:get()end + +-- `'ruler'` `'ru'` boolean (default on) +-- global +-- Show the line and column number of the cursor position, separated by a +-- comma. When there is room, the relative position of the displayed +-- text in the file is shown on the far right: +-- Top first line is visible +-- Bot last line is visible +-- All first and last line are visible +-- 45% relative position in the file +-- If `'rulerformat'` is set, it will determine the contents of the ruler. +-- Each window has its own ruler. If a window has a status line, the +-- ruler is shown there. If a window doesn't have a status line and +-- `'cmdheight'` is zero, the ruler is not shown. Otherwise it is shown in +-- the last line of the screen. If the statusline is given by +-- `'statusline'` (i.e. not empty), this option takes precedence over +-- `'ruler'` and `'rulerformat'` . +-- If the number of characters displayed is different from the number of +-- bytes in the text (e.g., for a TAB or a multibyte character), both +-- the text column (byte number) and the screen column are shown, +-- separated with a dash. +-- For an empty line "0-1" is shown. +-- For an empty buffer the line number will also be zero: "0,0-1". +-- If you don't want to see the ruler all the time but want to know where +-- you are, use "g CTRL-G" |g_CTRL-G|. +--- @class vim.opt.ruler: vim.Option,boolean +--- @operator add: vim.opt.ruler +--- @operator sub: vim.opt.ruler +--- @operator pow: vim.opt.ruler +vim.opt.ruler = true +vim.opt.ru = vim.opt.ruler +--- @return boolean +function vim.opt.ruler:get()end + +-- `'rulerformat'` `'ruf'` string (default empty) +-- global +-- When this option is not empty, it determines the content of the ruler +-- string, as displayed for the `'ruler'` option. +-- The format of this option is like that of `'statusline'` . +-- This option cannot be set in a modeline when `'modelineexpr'` is off. +-- +-- The default ruler width is 17 characters. To make the ruler 15 +-- characters wide, put "%15(" at the start and "%)" at the end. +-- Example: > +-- :set rulerformat=%15(%c%V\ %p%%%) +-- < +--- @class vim.opt.rulerformat: vim.Option,string +--- @operator add: vim.opt.rulerformat +--- @operator sub: vim.opt.rulerformat +--- @operator pow: vim.opt.rulerformat +vim.opt.rulerformat = "" +vim.opt.ruf = vim.opt.rulerformat +--- @return string +function vim.opt.rulerformat:get()end + +-- `'runtimepath'` `'rtp'` string (default: "$XDG_CONFIG_HOME/nvim, +-- $XDG_CONFIG_DIRS[1]/nvim, +-- $XDG_CONFIG_DIRS[2]/nvim, +-- … +-- $XDG_DATA_HOME/nvim[-data]/site, +-- $XDG_DATA_DIRS[1]/nvim/site, +-- $XDG_DATA_DIRS[2]/nvim/site, +-- … +-- $VIMRUNTIME, +-- … +-- $XDG_DATA_DIRS[2]/nvim/site/after, +-- $XDG_DATA_DIRS[1]/nvim/site/after, +-- $XDG_DATA_HOME/nvim[-data]/site/after, +-- … +-- $XDG_CONFIG_DIRS[2]/nvim/after, +-- $XDG_CONFIG_DIRS[1]/nvim/after, +-- $XDG_CONFIG_HOME/nvim/after") +-- global +-- List of directories to be searched for these runtime files: +-- filetype.lua filetypes |new-filetype| +-- autoload/ automatically loaded scripts |autoload-functions| +-- colors/ color scheme files |:colorscheme| +-- compiler/ compiler files |:compiler| +-- doc/ documentation |write-local-help| +-- ftplugin/ filetype plugins |write-filetype-plugin| +-- indent/ indent scripts |indent-expression| +-- keymap/ key mapping files |mbyte-keymap| +-- lang/ menu translations |:menutrans| +-- lua/ |Lua| plugins +-- menu.vim GUI menus |menu.vim| +-- pack/ packages |:packadd| +-- parser/ |treesitter| syntax parsers +-- plugin/ plugin scripts |write-plugin| +-- queries/ |treesitter| queries +-- rplugin/ |remote-plugin| scripts +-- spell/ spell checking files |spell| +-- syntax/ syntax files |mysyntaxfile| +-- tutor/ tutorial files |:Tutor| +-- +-- And any other file searched for with the |:runtime| command. +-- +-- Defaults are setup to search these locations: +-- 1. Your home directory, for personal preferences. +-- Given by `stdpath("config")`. |$XDG_CONFIG_HOME| +-- 2. Directories which must contain configuration files according to +-- |xdg| ($XDG_CONFIG_DIRS, defaults to /etc/xdg). This also contains +-- preferences from system administrator. +-- 3. Data home directory, for plugins installed by user. +-- Given by `stdpath("data")/site`. |$XDG_DATA_HOME| +-- 4. nvim/site subdirectories for each directory in $XDG_DATA_DIRS. +-- This is for plugins which were installed by system administrator, +-- but are not part of the Nvim distribution. XDG_DATA_DIRS defaults +-- to /usr/local/share/:/usr/share/, so system administrators are +-- expected to install site plugins to /usr/share/nvim/site. +-- 5. Session state directory, for state data such as swap, backupdir, +-- viewdir, undodir, etc. +-- Given by `stdpath("state")`. |$XDG_STATE_HOME| +-- 6. $VIMRUNTIME, for files distributed with Nvim. +-- +-- 7, 8, 9, 10. In after/ subdirectories of 1, 2, 3 and 4, with reverse +-- ordering. This is for preferences to overrule or add to the +-- distributed defaults or system-wide settings (rarely needed). +-- +-- +-- "start" packages will also be searched (|runtime-search-path|) for +-- runtime files after these, though such packages are not explicitly +-- reported in &runtimepath. But "opt" packages are explicitly added to +-- &runtimepath by |:packadd|. +-- +-- Note that, unlike `'path'` , no wildcards like "" are allowed. Normal +-- wildcards are allowed, but can significantly slow down searching for +-- runtime files. For speed, use as few items as possible and avoid +-- wildcards. +-- See |:runtime|. +-- Example: > +-- :set runtimepath=~/vimruntime,/mygroup/vim,$VIMRUNTIME +-- < This will use the directory "~/vimruntime" first (containing your +-- personal Nvim runtime files), then "/mygroup/vim", and finally +-- "$VIMRUNTIME" (the default runtime files). +-- You can put a directory before $VIMRUNTIME to find files which replace +-- distributed runtime files. You can put a directory after $VIMRUNTIME +-- to find files which add to distributed runtime files. +-- +-- With |--clean| the home directory entries are not included. +--- @class vim.opt.runtimepath: vim.Option,string[] +--- @operator add: vim.opt.runtimepath +--- @operator sub: vim.opt.runtimepath +--- @operator pow: vim.opt.runtimepath +vim.opt.runtimepath = "/home/runner/.config/nvim,/etc/xdg/nvim,/home/runner/.local/share/nvim/site,/usr/local/share/nvim/site,/usr/share/nvim/site,/tmp/nvim/squashfs-root/usr/share/nvim/runtime,/tmp/nvim/squashfs-root/usr/lib/nvim,/usr/share/nvim/site/after,/usr/local/share/nvim/site/after,/home/runner/.local/share/nvim/site/after,/etc/xdg/nvim/after,/home/runner/.config/nvim/after" +vim.opt.rtp = vim.opt.runtimepath +--- @return string[] +function vim.opt.runtimepath:get()end + +-- `'scroll'` `'scr'` number (default: half the window height) +-- local to window +-- Number of lines to scroll with CTRL-U and CTRL-D commands. Will be +-- set to half the number of lines in the window when the window size +-- changes. This may happen when enabling the |status-line| or +-- `'tabline'` option after setting the `'scroll'` option. +-- If you give a count to the CTRL-U or CTRL-D command it will +-- be used as the new value for `'scroll'` . Reset to half the window +-- height with ":set scroll=0". +--- @class vim.opt.scroll: vim.Option,number +--- @operator add: vim.opt.scroll +--- @operator sub: vim.opt.scroll +--- @operator pow: vim.opt.scroll +vim.opt.scroll = 0 +vim.opt.scr = vim.opt.scroll +--- @return number +function vim.opt.scroll:get()end + +-- `'scrollback'` `'scbk'` number (default: 10000) +-- local to buffer +-- Maximum number of lines kept beyond the visible screen. Lines at the +-- top are deleted if new lines exceed this limit. +-- 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. +--- @class vim.opt.scrollback: vim.Option,number +--- @operator add: vim.opt.scrollback +--- @operator sub: vim.opt.scrollback +--- @operator pow: vim.opt.scrollback +vim.opt.scrollback = -1 +vim.opt.scbk = vim.opt.scrollback +--- @return number +function vim.opt.scrollback:get()end + +-- `'scrollbind'` `'scb'` boolean (default off) +-- local to window +-- See also |scroll-binding|. When this option is set, the current +-- window scrolls as other scrollbind windows (windows that also have +-- this option set) scroll. This option is useful for viewing the +-- differences between two versions of a file, see `'diff'` . +-- See |`'scrollopt'` | for options that determine how this option should be +-- interpreted. +-- This option is mostly reset when splitting a window to edit another +-- file. This means that ":split | edit file" results in two windows +-- with scroll-binding, but ":split file" does not. +--- @class vim.opt.scrollbind: vim.Option,boolean +--- @operator add: vim.opt.scrollbind +--- @operator sub: vim.opt.scrollbind +--- @operator pow: vim.opt.scrollbind +vim.opt.scrollbind = false +vim.opt.scb = vim.opt.scrollbind +--- @return boolean +function vim.opt.scrollbind:get()end + +-- `'scrolljump'` `'sj'` number (default 1) +-- global +-- Minimal number of lines to scroll when the cursor gets off the +-- screen (e.g., with "j"). Not used for scroll commands (e.g., CTRL-E, +-- CTRL-D). Useful if your terminal scrolls very slowly. +-- When set to a negative number from -1 to -100 this is used as the +-- percentage of the window height. Thus -50 scrolls half the window +-- height. +--- @class vim.opt.scrolljump: vim.Option,number +--- @operator add: vim.opt.scrolljump +--- @operator sub: vim.opt.scrolljump +--- @operator pow: vim.opt.scrolljump +vim.opt.scrolljump = 1 +vim.opt.sj = vim.opt.scrolljump +--- @return number +function vim.opt.scrolljump:get()end + +-- `'scrolloff'` `'so'` number (default 0) +-- global or local to window |global-local| +-- Minimal number of screen lines to keep above and below the cursor. +-- This will make some context visible around where you are working. If +-- you set it to a very large value (999) the cursor line will always be +-- in the middle of the window (except at the start or end of the file or +-- when long lines wrap). +-- After using the local value, go back the global value with one of +-- these two: > +-- setlocal scrolloff< +-- setlocal scrolloff=-1 +-- < For scrolling horizontally see `'sidescrolloff'` . +--- @class vim.opt.scrolloff: vim.Option,number +--- @operator add: vim.opt.scrolloff +--- @operator sub: vim.opt.scrolloff +--- @operator pow: vim.opt.scrolloff +vim.opt.scrolloff = 0 +vim.opt.so = vim.opt.scrolloff +--- @return number +function vim.opt.scrolloff:get()end + +-- `'scrollopt'` `'sbo'` string (default "ver,jump") +-- global +-- This is a comma-separated list of words that specifies how +-- `'scrollbind'` windows should behave. `'sbo'` stands for ScrollBind +-- Options. +-- The following words are available: +-- ver Bind vertical scrolling for `'scrollbind'` windows +-- hor Bind horizontal scrolling for `'scrollbind'` windows +-- jump Applies to the offset between two windows for vertical +-- scrolling. This offset is the difference in the first +-- displayed line of the bound windows. When moving +-- around in a window, another `'scrollbind'` window may +-- reach a position before the start or after the end of +-- the buffer. The offset is not changed though, when +-- moving back the `'scrollbind'` window will try to scroll +-- to the desired position when possible. +-- When now making that window the current one, two +-- things can be done with the relative offset: +-- 1. When "jump" is not included, the relative offset is +-- adjusted for the scroll position in the new current +-- window. When going back to the other window, the +-- new relative offset will be used. +-- 2. When "jump" is included, the other windows are +-- scrolled to keep the same relative offset. When +-- going back to the other window, it still uses the +-- same relative offset. +-- Also see |scroll-binding|. +-- When `'diff'` mode is active there always is vertical scroll binding, +-- even when "ver" isn't there. +--- @class vim.opt.scrollopt: vim.Option,string[] +--- @operator add: vim.opt.scrollopt +--- @operator sub: vim.opt.scrollopt +--- @operator pow: vim.opt.scrollopt +vim.opt.scrollopt = "ver,jump" +vim.opt.sbo = vim.opt.scrollopt +--- @return string[] +function vim.opt.scrollopt:get()end + +-- `'sections'` `'sect'` string (default "SHNHH HUnhsh") +-- global +-- Specifies the nroff macros that separate sections. These are pairs of +-- two letters (See |object-motions|). The default makes a section start +-- at the nroff macros ".SH", ".NH", ".H", ".HU", ".nh" and ".sh". +--- @class vim.opt.sections: vim.Option,string +--- @operator add: vim.opt.sections +--- @operator sub: vim.opt.sections +--- @operator pow: vim.opt.sections +vim.opt.sections = "SHNHH HUnhsh" +vim.opt.sect = vim.opt.sections +--- @return string +function vim.opt.sections:get()end + +--- @class vim.opt.secure: vim.Option,boolean +--- @operator add: vim.opt.secure +--- @operator sub: vim.opt.secure +--- @operator pow: vim.opt.secure +vim.opt.secure = false +--- @return boolean +function vim.opt.secure:get()end + +-- `'selection'` `'sel'` string (default "inclusive") +-- global +-- This option defines the behavior of the selection. It is only used +-- in Visual and Select mode. +-- Possible values: +-- value past line inclusive ~ +-- old no yes +-- inclusive yes yes +-- exclusive yes no +-- "past line" means that the cursor is allowed to be positioned one +-- character past the line. +-- "inclusive" means that the last character of the selection is included +-- in an operation. For example, when "x" is used to delete the +-- selection. +-- When "old" is used and `'virtualedit'` allows the cursor to move past +-- the end of line the line break still isn't included. +-- Note that when "exclusive" is used and selecting from the end +-- backwards, you cannot include the last character of a line, when +-- starting in Normal mode and `'virtualedit'` empty. +--- @class vim.opt.selection: vim.Option,string +--- @operator add: vim.opt.selection +--- @operator sub: vim.opt.selection +--- @operator pow: vim.opt.selection +vim.opt.selection = "inclusive" +vim.opt.sel = vim.opt.selection +--- @return string +function vim.opt.selection:get()end + +-- `'selectmode'` `'slm'` string (default "") +-- global +-- This is a comma-separated list of words, which specifies when to start +-- Select mode instead of Visual mode, when a selection is started. +-- Possible values: +-- mouse when using the mouse +-- key when using shifted special keys +-- cmd when using "v", "V" or CTRL-V +-- See |Select-mode|. +--- @class vim.opt.selectmode: vim.Option,string[] +--- @operator add: vim.opt.selectmode +--- @operator sub: vim.opt.selectmode +--- @operator pow: vim.opt.selectmode +vim.opt.selectmode = "" +vim.opt.slm = vim.opt.selectmode +--- @return string[] +function vim.opt.selectmode:get()end + +-- `'sessionoptions'` `'ssop'` string (default: "blank,buffers,curdir,folds, +-- help,tabpages,winsize,terminal") +-- global +-- Changes the effect of the |:mksession| command. It is a comma- +-- separated list of words. Each word enables saving and restoring +-- something: +-- word save and restore ~ +-- blank empty windows +-- buffers hidden and unloaded buffers, not just those in windows +-- curdir the current directory +-- folds manually created folds, opened/closed folds and local +-- fold options +-- globals global variables that start with an uppercase letter +-- and contain at least one lowercase letter. Only +-- String and Number types are stored. +-- help the help window +-- localoptions options and mappings local to a window or buffer (not +-- global values for local options) +-- options all options and mappings (also global values for local +-- options) +-- skiprtp exclude `'runtimepath'` and `'packpath'` from the options +-- resize size of the Vim window: `'lines'` and `'columns'` +-- sesdir the directory in which the session file is located +-- will become the current directory (useful with +-- projects accessed over a network from different +-- systems) +-- tabpages all tab pages; without this only the current tab page +-- is restored, so that you can make a session for each +-- tab page separately +-- terminal include terminal windows where the command can be +-- restored +-- winpos position of the whole Vim window +-- winsize window sizes +-- slash |deprecated| Always enabled. Uses "/" in filenames. +-- unix |deprecated| Always enabled. Uses "\n" line endings. +-- +-- Don't include both "curdir" and "sesdir". When neither is included +-- filenames are stored as absolute paths. +-- If you leave out "options" many things won't work well after restoring +-- the session. +--- @class vim.opt.sessionoptions: vim.Option,string[] +--- @operator add: vim.opt.sessionoptions +--- @operator sub: vim.opt.sessionoptions +--- @operator pow: vim.opt.sessionoptions +vim.opt.sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,terminal" +vim.opt.ssop = vim.opt.sessionoptions +--- @return string[] +function vim.opt.sessionoptions:get()end + +-- `'shada'` `'sd'` string (default for +-- Win32: !,'100,<50,s10,h,rA:,rB: +-- others: !,'100,<50,s10,h) +-- global +-- When non-empty, the shada file is read upon startup and written +-- when exiting Vim (see |shada-file|). The string should be a comma- +-- separated list of parameters, each consisting of a single character +-- identifying the particular parameter, followed by a number or string +-- which specifies the value of that parameter. If a particular +-- character is left out, then the default value is used for that +-- parameter. The following is a list of the identifying characters and +-- the effect of their value. +-- CHAR VALUE ~ +-- +-- ! When included, save and restore global variables that start +-- with an uppercase letter, and don't contain a lowercase +-- letter. Thus "KEEPTHIS and "K_L_M" are stored, but "KeepThis" +-- and "_K_L_M" are not. Nested List and Dict items may not be +-- read back correctly, you end up with an empty item. +-- +-- " Maximum number of lines saved for each register. Old name of +-- the `'<'` item, with the disadvantage that you need to put a +-- backslash before the ", otherwise it will be recognized as the +-- start of a comment! +-- +-- % When included, save and restore the buffer list. If Vim is +-- started with a file name argument, the buffer list is not +-- restored. If Vim is started without a file name argument, the +-- buffer list is restored from the shada file. Quickfix +-- (`'buftype'` ), unlisted (`'buflisted'` ), unnamed and buffers on +-- removable media (|shada-r|) are not saved. +-- When followed by a number, the number specifies the maximum +-- number of buffers that are stored. Without a number all +-- buffers are stored. +-- +-- ' Maximum number of previously edited files for which the marks +-- are remembered. This parameter must always be included when +-- `'shada'` is non-empty. +-- Including this item also means that the |jumplist| and the +-- |changelist| are stored in the shada file. +-- +-- / Maximum number of items in the search pattern history to be +-- saved. If non-zero, then the previous search and substitute +-- patterns are also saved. When not included, the value of +-- `'history'` is used. +-- +-- : Maximum number of items in the command-line history to be +-- saved. When not included, the value of `'history'` is used. +-- +-- < Maximum number of lines saved for each register. If zero then +-- registers are not saved. When not included, all lines are +-- saved. `'"'` is the old name for this item. +-- Also see the `'s'` item below: limit specified in KiB. +-- +-- @ Maximum number of items in the input-line history to be +-- saved. When not included, the value of `'history'` is used. +-- +-- c Dummy option, kept for compatibility reasons. Has no actual +-- effect: ShaDa always uses UTF-8 and `'encoding'` value is fixed +-- to UTF-8 as well. +-- +-- f Whether file marks need to be stored. If zero, file marks ('0 +-- to '9, 'A to 'Z) are not stored. When not present or when +-- non-zero, they are all stored. '0 is used for the current +-- cursor position (when exiting or when doing |:wshada|). +-- +-- h Disable the effect of `'hlsearch'` when loading the shada +-- file. When not included, it depends on whether ":nohlsearch" +-- has been used since the last search command. +-- +-- n Name of the shada file. The name must immediately follow +-- the `'n'` . Must be at the end of the option! If the +-- `'shadafile'` option is set, that file name overrides the one +-- given here with `'shada'` . Environment variables are +-- expanded when opening the file, not when setting the option. +-- +-- r Removable media. The argument is a string (up to the next +-- `','` ). This parameter can be given several times. Each +-- specifies the start of a path for which no marks will be +-- stored. This is to avoid removable media. For Windows you +-- could use "ra:,rb:". You can also use it for temp files, +-- e.g., for Unix: "r/tmp". Case is ignored. +-- +-- s Maximum size of an item contents in KiB. If zero then nothing +-- is saved. Unlike Vim this applies to all items, except for +-- the buffer list and header. Full item size is off by three +-- unsigned integers: with `s10` maximum item size may be 1 byte +-- (type: 7-bit integer) + 9 bytes (timestamp: up to 64-bit +-- integer) + 3 bytes (item size: up to 16-bit integer because +-- 2^8 < 10240 < 2^16) + 10240 bytes (requested maximum item +-- contents size) = 10253 bytes. +-- +-- Example: > +-- :set shada='50,<1000,s100,:0,n~/nvim/shada +-- < +-- '50 Marks will be remembered for the last 50 files you +-- edited. +-- <1000 Contents of registers (up to 1000 lines each) will be +-- remembered. +-- s100 Items with contents occupying more then 100 KiB are +-- skipped. +-- :0 Command-line history will not be saved. +-- n~/nvim/shada The name of the file to use is "~/nvim/shada". +-- no / Since `'/'` is not specified, the default will be used, +-- that is, save all of the search history, and also the +-- previous search and substitute patterns. +-- no % The buffer list will not be saved nor read back. +-- no h `'hlsearch'` highlighting will be restored. +-- +-- When setting `'shada'` from an empty value you can use |:rshada| to +-- load the contents of the file, this is not done automatically. +-- +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +--- @class vim.opt.shada: vim.Option,string[] +--- @operator add: vim.opt.shada +--- @operator sub: vim.opt.shada +--- @operator pow: vim.opt.shada +vim.opt.shada = "!,'100,<50,s10,h" +vim.opt.sd = vim.opt.shada +--- @return string[] +function vim.opt.shada:get()end + +-- `'shadafile'` `'sdf'` string (default: "") +-- global +-- When non-empty, overrides the file name used for |shada| (viminfo). +-- When equal to "NONE" no shada file will be read or written. +-- This option can be set with the |-i| command line flag. The |--clean| +-- command line flag sets it to "NONE". +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +--- @class vim.opt.shadafile: vim.Option,string[] +--- @operator add: vim.opt.shadafile +--- @operator sub: vim.opt.shadafile +--- @operator pow: vim.opt.shadafile +vim.opt.shadafile = "" +vim.opt.sdf = vim.opt.shadafile +--- @return string[] +function vim.opt.shadafile:get()end + +-- `'shell'` `'sh'` string (default $SHELL or "sh", Win32: "cmd.exe") +-- global +-- Name of the shell to use for ! and :! commands. When changing the +-- value also check these options: `'shellpipe'` , `'shellslash'` +-- `'shellredir'` , `'shellquote'` , `'shellxquote'` and `'shellcmdflag'` . +-- It is allowed to give an argument to the command, e.g. "csh -f". +-- See |option-backslash| about including spaces and backslashes. +-- Environment variables are expanded |:set_env|. +-- +-- If the name of the shell contains a space, you need to enclose it in +-- quotes. Example with quotes: > +-- :set shell=\"c:\program\ files\unix\sh.exe\"\ -f +-- < Note the backslash before each quote (to avoid starting a comment) and +-- each space (to avoid ending the option value), so better use |:let-&| +-- like this: > +-- :let &shell='"C:\Program Files\unix\sh.exe" -f' +-- < Also note that the "-f" is not inside the quotes, because it is not +-- part of the command name. +-- +-- Rules regarding quotes: +-- 1. Option is split on space and tab characters that are not inside +-- quotes: "abc def" runs shell named "abc" with additional argument +-- "def", '"abc def"' runs shell named "abc def" with no additional +-- arguments (here and below: additional means “additional to +-- `'shellcmdflag'` ”). +-- 2. Quotes in option may be present in any position and any number: +-- `'"abc"'` , `'"a"bc'` , `'a"b"c'` , `'ab"c"'` and `'"a"b"c"'` are all equivalent +-- to just "abc". +-- 3. Inside quotes backslash preceding backslash means one backslash. +-- Backslash preceding quote means one quote. Backslash preceding +-- anything else means backslash and next character literally: +-- `'"a\\b"'` is the same as "a\b", `'"a\\"b"'` runs shell named literally +-- `'a"b'` , `'"a\b"'` is the same as "a\b" again. +-- 4. Outside of quotes backslash always means itself, it cannot be used +-- to escape quote: `'a\"b"'` is the same as "a\b". +-- Note that such processing is done after |:set| did its own round of +-- unescaping, so to keep yourself sane use |:let-&| like shown above. +-- +-- To use PowerShell: > +-- let &shell = executable(`'pwsh'` ) ? `'pwsh'` : `'powershell'` +-- let &shellcmdflag = '-NoLogo -ExecutionPolicy RemoteSigned -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.UTF8Encoding]::new();$PSDefaultParameterValues[`''` Out-File:Encoding`''` ]=`''` utf8`''` ;Remove-Alias -Force -ErrorAction SilentlyContinue tee;' +-- let &shellredir = '2>&1 | %%{ "$_" } | Out-File %s; exit $LastExitCode' +-- let &shellpipe = '2>&1 | %%{ "$_" } | tee %s; exit $LastExitCode' +-- set shellquote= shellxquote= +-- +-- < This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +--- @class vim.opt.shell: vim.Option,string +--- @operator add: vim.opt.shell +--- @operator sub: vim.opt.shell +--- @operator pow: vim.opt.shell +vim.opt.shell = "sh" +vim.opt.sh = vim.opt.shell +--- @return string +function vim.opt.shell:get()end + +-- `'shellcmdflag'` `'shcf'` string (default: "-c"; Windows: "/s /c") +-- global +-- Flag passed to the shell to execute "!" and ":!" commands; e.g., +-- `bash.exe -c ls` or `cmd.exe /s /c "dir"`. For MS-Windows, the +-- default is set according to the value of `'shell'` , to reduce the need +-- to set this option by the user. +-- On Unix it can have more than one flag. Each white space separated +-- part is passed as an argument to the shell command. +-- See |option-backslash| about including spaces and backslashes. +-- See |shell-unquoting| which talks about separating this option into +-- multiple arguments. +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +--- @class vim.opt.shellcmdflag: vim.Option,string +--- @operator add: vim.opt.shellcmdflag +--- @operator sub: vim.opt.shellcmdflag +--- @operator pow: vim.opt.shellcmdflag +vim.opt.shellcmdflag = "-c" +vim.opt.shcf = vim.opt.shellcmdflag +--- @return string +function vim.opt.shellcmdflag:get()end + +-- `'shellpipe'` `'sp'` string (default ">", "| tee", "|& tee" or "2>&1| tee") +-- global +-- String to be used to put the output of the ":make" command in the +-- error file. See also |:make_makeprg|. See |option-backslash| about +-- including spaces and backslashes. +-- The name of the temporary file can be represented by "%s" if necessary +-- (the file name is appended automatically if no %s appears in the value +-- of this option). +-- For MS-Windows the default is "2>&1| tee". The stdout and stderr are +-- saved in a file and echoed to the screen. +-- For Unix the default is "| tee". The stdout of the compiler is saved +-- in a file and echoed to the screen. If the `'shell'` option is "csh" or +-- "tcsh" after initializations, the default becomes "|& tee". If the +-- `'shell'` option is "sh", "ksh", "mksh", "pdksh", "zsh", "zsh-beta", +-- "bash", "fish", "ash" or "dash" the default becomes "2>&1| tee". This +-- means that stderr is also included. Before using the `'shell'` option a +-- path is removed, thus "/bin/sh" uses "sh". +-- The initialization of this option is done after reading the vimrc +-- and the other initializations, so that when the `'shell'` option is set +-- there, the `'shellpipe'` option changes automatically, unless it was +-- explicitly set before. +-- When `'shellpipe'` is set to an empty string, no redirection of the +-- ":make" output will be done. This is useful if you use a `'makeprg'` +-- that writes to `'makeef'` by itself. If you want no piping, but do +-- want to include the `'makeef'` , set `'shellpipe'` to a single space. +-- Don't forget to precede the space with a backslash: ":set sp=\ ". +-- In the future pipes may be used for filtering and this option will +-- become obsolete (at least for Unix). +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +--- @class vim.opt.shellpipe: vim.Option,string +--- @operator add: vim.opt.shellpipe +--- @operator sub: vim.opt.shellpipe +--- @operator pow: vim.opt.shellpipe +vim.opt.shellpipe = "| tee" +vim.opt.sp = vim.opt.shellpipe +--- @return string +function vim.opt.shellpipe:get()end + +-- `'shellquote'` `'shq'` string (default: ""; Windows, when `'shell'` +-- contains "sh" somewhere: "\"") +-- global +-- Quoting character(s), put around the command passed to the shell, for +-- the "!" and ":!" commands. The redirection is kept outside of the +-- quoting. See `'shellxquote'` to include the redirection. It's +-- probably not useful to set both options. +-- This is an empty string by default. Only known to be useful for +-- third-party shells on Windows systems, such as the MKS Korn Shell +-- or bash, where it should be "\"". The default is adjusted according +-- the value of `'shell'` , to reduce the need to set this option by the +-- user. +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +--- @class vim.opt.shellquote: vim.Option,string +--- @operator add: vim.opt.shellquote +--- @operator sub: vim.opt.shellquote +--- @operator pow: vim.opt.shellquote +vim.opt.shellquote = "" +vim.opt.shq = vim.opt.shellquote +--- @return string +function vim.opt.shellquote:get()end + +-- `'shellredir'` `'srr'` string (default ">", ">&" or ">%s 2>&1") +-- global +-- String to be used to put the output of a filter command in a temporary +-- file. See also |:!|. See |option-backslash| about including spaces +-- and backslashes. +-- The name of the temporary file can be represented by "%s" if necessary +-- (the file name is appended automatically if no %s appears in the value +-- of this option). +-- The default is ">". For Unix, if the `'shell'` option is "csh" or +-- "tcsh" during initializations, the default becomes ">&". If the +-- `'shell'` option is "sh", "ksh", "mksh", "pdksh", "zsh", "zsh-beta", +-- "bash" or "fish", the default becomes ">%s 2>&1". This means that +-- stderr is also included. For Win32, the Unix checks are done and +-- additionally "cmd" is checked for, which makes the default ">%s 2>&1". +-- Also, the same names with ".exe" appended are checked for. +-- The initialization of this option is done after reading the vimrc +-- and the other initializations, so that when the `'shell'` option is set +-- there, the `'shellredir'` option changes automatically unless it was +-- explicitly set before. +-- In the future pipes may be used for filtering and this option will +-- become obsolete (at least for Unix). +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +--- @class vim.opt.shellredir: vim.Option,string +--- @operator add: vim.opt.shellredir +--- @operator sub: vim.opt.shellredir +--- @operator pow: vim.opt.shellredir +vim.opt.shellredir = ">" +vim.opt.srr = vim.opt.shellredir +--- @return string +function vim.opt.shellredir:get()end + +-- `'shellslash'` `'ssl'` boolean (default off) +-- global +-- {only for MS-Windows} +-- When set, a forward slash is used when expanding file names. This is +-- useful when a Unix-like shell is used instead of cmd.exe. Backward +-- slashes can still be typed, but they are changed to forward slashes by +-- Vim. +-- Note that setting or resetting this option has no effect for some +-- existing file names, thus this option needs to be set before opening +-- any file for best results. This might change in the future. +-- `'shellslash'` only works when a backslash can be used as a path +-- separator. To test if this is so use: > +-- if exists(`'+shellslash'` ) +-- < Also see `'completeslash'` . +--- @class vim.opt.shellslash: vim.Option,boolean +--- @operator add: vim.opt.shellslash +--- @operator sub: vim.opt.shellslash +--- @operator pow: vim.opt.shellslash +vim.opt.shellslash = false +vim.opt.ssl = vim.opt.shellslash +--- @return boolean +function vim.opt.shellslash:get()end + +-- `'shelltemp'` `'stmp'` boolean (default on) +-- global +-- When on, use temp files for shell commands. When off use a pipe. +-- When using a pipe is not possible temp files are used anyway. +-- The advantage of using a pipe is that nobody can read the temp file +-- and the `'shell'` command does not need to support redirection. +-- The advantage of using a temp file is that the file type and encoding +-- can be detected. +-- The |FilterReadPre|, |FilterReadPost| and |FilterWritePre|, +-- |FilterWritePost| autocommands event are not triggered when +-- `'shelltemp'` is off. +-- |system()| does not respect this option, it always uses pipes. +--- @class vim.opt.shelltemp: vim.Option,boolean +--- @operator add: vim.opt.shelltemp +--- @operator sub: vim.opt.shelltemp +--- @operator pow: vim.opt.shelltemp +vim.opt.shelltemp = true +vim.opt.stmp = vim.opt.shelltemp +--- @return boolean +function vim.opt.shelltemp:get()end + +-- `'shellxescape'` `'sxe'` string (default: "") +-- global +-- When `'shellxquote'` is set to "(" then the characters listed in this +-- option will be escaped with a `'^'` character. This makes it possible +-- to execute most external commands with cmd.exe. +--- @class vim.opt.shellxescape: vim.Option,string +--- @operator add: vim.opt.shellxescape +--- @operator sub: vim.opt.shellxescape +--- @operator pow: vim.opt.shellxescape +vim.opt.shellxescape = "" +vim.opt.sxe = vim.opt.shellxescape +--- @return string +function vim.opt.shellxescape:get()end + +-- `'shellxquote'` `'sxq'` string (default: "", Windows: "\"") +-- global +-- Quoting character(s), put around the command passed to the shell, for +-- the "!" and ":!" commands. Includes the redirection. See +-- `'shellquote'` to exclude the redirection. It's probably not useful +-- to set both options. +-- When the value is `'('` then `')'` is appended. When the value is `'"('` +-- then `')"'` is appended. +-- When the value is `'('` then also see `'shellxescape'` . +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +--- @class vim.opt.shellxquote: vim.Option,string +--- @operator add: vim.opt.shellxquote +--- @operator sub: vim.opt.shellxquote +--- @operator pow: vim.opt.shellxquote +vim.opt.shellxquote = "" +vim.opt.sxq = vim.opt.shellxquote +--- @return string +function vim.opt.shellxquote:get()end + +-- `'shiftround'` `'sr'` boolean (default off) +-- global +-- Round indent to multiple of `'shiftwidth'` . Applies to > and < +-- commands. CTRL-T and CTRL-D in Insert mode always round the indent to +-- a multiple of `'shiftwidth'` (this is Vi compatible). +--- @class vim.opt.shiftround: vim.Option,boolean +--- @operator add: vim.opt.shiftround +--- @operator sub: vim.opt.shiftround +--- @operator pow: vim.opt.shiftround +vim.opt.shiftround = false +vim.opt.sr = vim.opt.shiftround +--- @return boolean +function vim.opt.shiftround:get()end + +-- `'shiftwidth'` `'sw'` number (default 8) +-- local to buffer +-- Number of spaces to use for each step of (auto)indent. Used for +-- |`'cindent'` |, |>>|, |<<|, etc. +-- When zero the `'tabstop'` value will be used. Use the |shiftwidth()| +-- function to get the effective shiftwidth value. +--- @class vim.opt.shiftwidth: vim.Option,number +--- @operator add: vim.opt.shiftwidth +--- @operator sub: vim.opt.shiftwidth +--- @operator pow: vim.opt.shiftwidth +vim.opt.shiftwidth = 8 +vim.opt.sw = vim.opt.shiftwidth +--- @return number +function vim.opt.shiftwidth:get()end + diff --git a/bundle/neodev.nvim/types/nightly/options.3.lua b/bundle/neodev.nvim/types/nightly/options.3.lua new file mode 100644 index 000000000..33b0cdd20 --- /dev/null +++ b/bundle/neodev.nvim/types/nightly/options.3.lua @@ -0,0 +1,2650 @@ +---@meta + +-- `'shortmess'` `'shm'` string (default "filnxtToOCF") +-- global +-- This option helps to avoid all the |hit-enter| prompts caused by file +-- messages, for example with CTRL-G, and to avoid some other messages. +-- It is a list of flags: +-- flag meaning when present ~ +-- f use "(3 of 5)" instead of "(file 3 of 5)" +-- i use "[noeol]" instead of "[Incomplete last line]" +-- l use "999L, 888B" instead of "999 lines, 888 bytes" +-- m use "[+]" instead of "[Modified]" +-- n use "[New]" instead of "[New File]" +-- r use "[RO]" instead of "[readonly]" +-- w use "[w]" instead of "written" for file write message +-- and "[a]" instead of "appended" for ':w >> file' command +-- x use "[dos]" instead of "[dos format]", "[unix]" +-- instead of "[unix format]" and "[mac]" instead of "[mac +-- format]" +-- a all of the above abbreviations +-- +-- o overwrite message for writing a file with subsequent +-- message for reading a file (useful for ":wn" or when +-- `'autowrite'` on) +-- O message for reading a file overwrites any previous +-- message; also for quickfix message (e.g., ":cn") +-- s don't give "search hit BOTTOM, continuing at TOP" or +-- "search hit TOP, continuing at BOTTOM" messages; when using +-- the search count do not show "W" after the count message (see +-- S below) +-- t truncate file message at the start if it is too long +-- to fit on the command-line, "<" will appear in the left most +-- column; ignored in Ex mode +-- T truncate other messages in the middle if they are too +-- long to fit on the command line; "..." will appear in the +-- middle; ignored in Ex mode +-- W don't give "written" or "[w]" when writing a file +-- A don't give the "ATTENTION" message when an existing +-- swap file is found +-- I don't give the intro message when starting Vim, +-- see |:intro| +-- c don't give |ins-completion-menu| messages; for +-- example, "-- XXX completion (YYY)", "match 1 of 2", "The only +-- match", "Pattern not found", "Back at original", etc. +-- C don't give messages while scanning for ins-completion +-- items, for instance "scanning tags" +-- q use "recording" instead of "recording @a" +-- F don't give the file info when editing a file, like +-- `:silent` was used for the command +-- S do not show search count message when searching, e.g. +-- "[1/5]" +-- +-- This gives you the opportunity to avoid that a change between buffers +-- requires you to hit , but still gives as useful a message as +-- possible for the space available. To get the whole message that you +-- would have got with `'shm'` empty, use ":file!" +-- Useful values: +-- shm= No abbreviation of message. +-- shm=a Abbreviation, but no loss of information. +-- shm=at Abbreviation, and truncate message when necessary. +--- @class vim.opt.shortmess: vim.Option,string[] +--- @operator add: vim.opt.shortmess +--- @operator sub: vim.opt.shortmess +--- @operator pow: vim.opt.shortmess +vim.opt.shortmess = "filnxtToOCF" +vim.opt.shm = vim.opt.shortmess +--- @return string[] +function vim.opt.shortmess:get()end + +-- `'showbreak'` `'sbr'` string (default "") +-- global or local to window |global-local| +-- String to put at the start of lines that have been wrapped. Useful +-- values are "> " or "+++ ": > +-- :set showbreak=>\ +-- < Note the backslash to escape the trailing space. It's easier like +-- this: > +-- :let &showbreak = '+++ ' +-- < Only printable single-cell characters are allowed, excluding and +-- comma (in a future version the comma might be used to separate the +-- part that is shown at the end and at the start of a line). +-- The |hl-NonText| highlight group determines the highlighting. +-- Note that tabs after the showbreak will be displayed differently. +-- If you want the `'showbreak'` to appear in between line numbers, add the +-- "n" flag to `'cpoptions'` . +-- A window-local value overrules a global value. If the global value is +-- set and you want no value in the current window use NONE: > +-- :setlocal showbreak=NONE +-- < +--- @class vim.opt.showbreak: vim.Option,string +--- @operator add: vim.opt.showbreak +--- @operator sub: vim.opt.showbreak +--- @operator pow: vim.opt.showbreak +vim.opt.showbreak = "" +vim.opt.sbr = vim.opt.showbreak +--- @return string +function vim.opt.showbreak:get()end + +-- `'showcmd'` `'sc'` boolean (default: on) +-- global +-- Show (partial) command in the last line of the screen. Set this +-- option off if your terminal is slow. +-- In Visual mode the size of the selected area is shown: +-- - When selecting characters within a line, the number of characters. +-- If the number of bytes is different it is also displayed: "2-6" +-- means two characters and six bytes. +-- - When selecting more than one line, the number of lines. +-- - When selecting a block, the size in screen characters: +-- {lines}x{columns}. +-- This information can be displayed in an alternative location using the +-- `'showcmdloc'` option, useful when `'cmdheight'` is 0. +--- @class vim.opt.showcmd: vim.Option,boolean +--- @operator add: vim.opt.showcmd +--- @operator sub: vim.opt.showcmd +--- @operator pow: vim.opt.showcmd +vim.opt.showcmd = true +vim.opt.sc = vim.opt.showcmd +--- @return boolean +function vim.opt.showcmd:get()end + +-- `'showcmdloc'` `'sloc'` string (default "last") +-- global +-- This option can be used to display the (partially) entered command in +-- another location. Possible values are: +-- last Last line of the screen (default). +-- statusline Status line of the current window. +-- tabline First line of the screen if `'showtabline'` is enabled. +-- Setting this option to "statusline" or "tabline" means that these will +-- be redrawn whenever the command changes, which can be on every key +-- pressed. +-- The %S `'statusline'` item can be used in `'statusline'` or `'tabline'` to +-- place the text. Without a custom `'statusline'` or `'tabline'` it will be +-- displayed in a convenient location. +--- @class vim.opt.showcmdloc: vim.Option,string +--- @operator add: vim.opt.showcmdloc +--- @operator sub: vim.opt.showcmdloc +--- @operator pow: vim.opt.showcmdloc +vim.opt.showcmdloc = "last" +vim.opt.sloc = vim.opt.showcmdloc +--- @return string +function vim.opt.showcmdloc:get()end + +-- `'showfulltag'` `'sft'` boolean (default off) +-- global +-- When completing a word in insert mode (see |ins-completion|) from the +-- tags file, show both the tag name and a tidied-up form of the search +-- pattern (if there is one) as possible matches. Thus, if you have +-- matched a C function, you can see a template for what arguments are +-- required (coding style permitting). +-- Note that this doesn't work well together with having "longest" in +-- `'completeopt'` , because the completion from the search pattern may not +-- match the typed text. +--- @class vim.opt.showfulltag: vim.Option,boolean +--- @operator add: vim.opt.showfulltag +--- @operator sub: vim.opt.showfulltag +--- @operator pow: vim.opt.showfulltag +vim.opt.showfulltag = false +vim.opt.sft = vim.opt.showfulltag +--- @return boolean +function vim.opt.showfulltag:get()end + +-- `'showmatch'` `'sm'` boolean (default off) +-- global +-- When a bracket is inserted, briefly jump to the matching one. The +-- jump is only done if the match can be seen on the screen. The time to +-- show the match can be set with `'matchtime'` . +-- A Beep is given if there is no match (no matter if the match can be +-- seen or not). +-- When the `'m'` flag is not included in `'cpoptions'` , typing a character +-- will immediately move the cursor back to where it belongs. +-- See the "sm" field in `'guicursor'` for setting the cursor shape and +-- blinking when showing the match. +-- The `'matchpairs'` option can be used to specify the characters to show +-- matches for. `'rightleft'` and `'revins'` are used to look for opposite +-- matches. +-- Also see the matchparen plugin for highlighting the match when moving +-- around |pi_paren.txt|. +-- Note: Use of the short form is rated PG. +--- @class vim.opt.showmatch: vim.Option,boolean +--- @operator add: vim.opt.showmatch +--- @operator sub: vim.opt.showmatch +--- @operator pow: vim.opt.showmatch +vim.opt.showmatch = false +vim.opt.sm = vim.opt.showmatch +--- @return boolean +function vim.opt.showmatch:get()end + +-- `'showmode'` `'smd'` boolean (default: on) +-- global +-- If in Insert, Replace or Visual mode put a message on the last line. +-- The |hl-ModeMsg| highlight group determines the highlighting. +-- The option has no effect when `'cmdheight'` is zero. +--- @class vim.opt.showmode: vim.Option,boolean +--- @operator add: vim.opt.showmode +--- @operator sub: vim.opt.showmode +--- @operator pow: vim.opt.showmode +vim.opt.showmode = true +vim.opt.smd = vim.opt.showmode +--- @return boolean +function vim.opt.showmode:get()end + +-- `'showtabline'` `'stal'` number (default 1) +-- global +-- The value of this option specifies when the line with tab page labels +-- will be displayed: +-- 0: never +-- 1: only if there are at least two tab pages +-- 2: always +-- This is both for the GUI and non-GUI implementation of the tab pages +-- line. +-- See |tab-page| for more information about tab pages. +--- @class vim.opt.showtabline: vim.Option,number +--- @operator add: vim.opt.showtabline +--- @operator sub: vim.opt.showtabline +--- @operator pow: vim.opt.showtabline +vim.opt.showtabline = 1 +vim.opt.stal = vim.opt.showtabline +--- @return number +function vim.opt.showtabline:get()end + +-- `'sidescroll'` `'ss'` number (default 1) +-- global +-- The minimal number of columns to scroll horizontally. Used only when +-- the `'wrap'` option is off and the cursor is moved off of the screen. +-- When it is zero the cursor will be put in the middle of the screen. +-- When using a slow terminal set it to a large number or 0. Not used +-- for "zh" and "zl" commands. +--- @class vim.opt.sidescroll: vim.Option,number +--- @operator add: vim.opt.sidescroll +--- @operator sub: vim.opt.sidescroll +--- @operator pow: vim.opt.sidescroll +vim.opt.sidescroll = 1 +vim.opt.ss = vim.opt.sidescroll +--- @return number +function vim.opt.sidescroll:get()end + +-- `'sidescrolloff'` `'siso'` number (default 0) +-- global or local to window |global-local| +-- The minimal number of screen columns to keep to the left and to the +-- right of the cursor if `'nowrap'` is set. Setting this option to a +-- value greater than 0 while having |`'sidescroll'` | also at a non-zero +-- value makes some context visible in the line you are scrolling in +-- horizontally (except at beginning of the line). Setting this option +-- to a large value (like 999) has the effect of keeping the cursor +-- horizontally centered in the window, as long as one does not come too +-- close to the beginning of the line. +-- After using the local value, go back the global value with one of +-- these two: > +-- setlocal sidescrolloff< +-- setlocal sidescrolloff=-1 +-- < +-- Example: Try this together with `'sidescroll'` and `'listchars'` as +-- in the following example to never allow the cursor to move +-- onto the "extends" character: > +-- +-- :set nowrap sidescroll=1 listchars=extends:>,precedes:< +-- :set sidescrolloff=1 +-- < +--- @class vim.opt.sidescrolloff: vim.Option,number +--- @operator add: vim.opt.sidescrolloff +--- @operator sub: vim.opt.sidescrolloff +--- @operator pow: vim.opt.sidescrolloff +vim.opt.sidescrolloff = 0 +vim.opt.siso = vim.opt.sidescrolloff +--- @return number +function vim.opt.sidescrolloff:get()end + +-- `'signcolumn'` `'scl'` string (default "auto") +-- local to window +-- When and how to draw the signcolumn. Valid values are: +-- "auto" only when there is a sign to display +-- "auto:[1-9]" resize to accommodate multiple signs up to the +-- given number (maximum 9), e.g. "auto:4" +-- "auto:[1-8]-[2-9]" +-- resize to accommodate multiple signs up to the +-- given maximum number (maximum 9) while keeping +-- at least the given minimum (maximum 8) fixed +-- space. The minimum number should always be less +-- than the maximum number, e.g. "auto:2-5" +-- "no" never +-- "yes" always +-- "yes:[1-9]" always, with fixed space for signs up to the given +-- number (maximum 9), e.g. "yes:3" +-- "number" display signs in the `'number'` column. If the number +-- column is not present, then behaves like "auto". +-- +-- Note regarding "orphaned signs": with signcolumn numbers higher than +-- 1, deleting lines will also remove the associated signs automatically, +-- in contrast to the default Vim behavior of keeping and grouping them. +-- This is done in order for the signcolumn appearance not appear weird +-- during line deletion. +--- @class vim.opt.signcolumn: vim.Option,string +--- @operator add: vim.opt.signcolumn +--- @operator sub: vim.opt.signcolumn +--- @operator pow: vim.opt.signcolumn +vim.opt.signcolumn = "auto" +vim.opt.scl = vim.opt.signcolumn +--- @return string +function vim.opt.signcolumn:get()end + +-- `'smartcase'` `'scs'` boolean (default off) +-- global +-- Override the `'ignorecase'` option if the search pattern contains upper +-- case characters. Only used when the search pattern is typed and +-- `'ignorecase'` option is on. Used for the commands "/", "?", "n", "N", +-- ":g" and ":s". Not used for "*", "#", "gd", tag search, etc. After +-- "*" and "#" you can make `'smartcase'` used by doing a "/" command, +-- recalling the search pattern from history and hitting . +--- @class vim.opt.smartcase: vim.Option,boolean +--- @operator add: vim.opt.smartcase +--- @operator sub: vim.opt.smartcase +--- @operator pow: vim.opt.smartcase +vim.opt.smartcase = false +vim.opt.scs = vim.opt.smartcase +--- @return boolean +function vim.opt.smartcase:get()end + +-- `'smartindent'` `'si'` boolean (default off) +-- local to buffer +-- Do smart autoindenting when starting a new line. Works for C-like +-- programs, but can also be used for other languages. `'cindent'` does +-- something like this, works better in most cases, but is more strict, +-- see |C-indenting|. When `'cindent'` is on or `'indentexpr'` is set, +-- setting `'si'` has no effect. `'indentexpr'` is a more advanced +-- alternative. +-- Normally `'autoindent'` should also be on when using `'smartindent'` . +-- An indent is automatically inserted: +-- - After a line ending in "{". +-- - After a line starting with a keyword from `'cinwords'` . +-- - Before a line starting with "}" (only with the "O" command). +-- When typing `'}'` as the first character in a new line, that line is +-- given the same indent as the matching "{". +-- When typing `'#'` as the first character in a new line, the indent for +-- that line is removed, the `'#'` is put in the first column. The indent +-- is restored for the next line. If you don't want this, use this +-- mapping: ":inoremap # X^H#", where ^H is entered with CTRL-V CTRL-H. +-- When using the ">>" command, lines starting with `'#'` are not shifted +-- right. +--- @class vim.opt.smartindent: vim.Option,boolean +--- @operator add: vim.opt.smartindent +--- @operator sub: vim.opt.smartindent +--- @operator pow: vim.opt.smartindent +vim.opt.smartindent = false +vim.opt.si = vim.opt.smartindent +--- @return boolean +function vim.opt.smartindent:get()end + +-- `'smarttab'` `'sta'` boolean (default on) +-- global +-- When on, a in front of a line inserts blanks according to +-- `'shiftwidth'` . `'tabstop'` or `'softtabstop'` is used in other places. A +-- will delete a `'shiftwidth'` worth of space at the start of the +-- line. +-- When off, a always inserts blanks according to `'tabstop'` or +-- `'softtabstop'` . `'shiftwidth'` is only used for shifting text left or +-- right |shift-left-right|. +-- What gets inserted (a or spaces) depends on the `'expandtab'` +-- option. Also see |ins-expandtab|. When `'expandtab'` is not set, the +-- number of spaces is minimized by using s. +--- @class vim.opt.smarttab: vim.Option,boolean +--- @operator add: vim.opt.smarttab +--- @operator sub: vim.opt.smarttab +--- @operator pow: vim.opt.smarttab +vim.opt.smarttab = true +vim.opt.sta = vim.opt.smarttab +--- @return boolean +function vim.opt.smarttab:get()end + +-- `'smoothscroll'` `'sms'` boolean (default off) +-- local to window +-- Scrolling works with screen lines. When `'wrap'` is set and the first +-- line in the window wraps part of it may not be visible, as if it is +-- above the window. "<<<" is displayed at the start of the first line, +-- 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. +--- @class vim.opt.smoothscroll: vim.Option,boolean +--- @operator add: vim.opt.smoothscroll +--- @operator sub: vim.opt.smoothscroll +--- @operator pow: vim.opt.smoothscroll +vim.opt.smoothscroll = false +vim.opt.sms = vim.opt.smoothscroll +--- @return boolean +function vim.opt.smoothscroll:get()end + +-- `'softtabstop'` `'sts'` number (default 0) +-- local to buffer +-- Number of spaces that a counts for while performing editing +-- operations, like inserting a or using . It "feels" like +-- s are being inserted, while in fact a mix of spaces and s is +-- used. This is useful to keep the `'ts'` setting at its standard value +-- of 8, while being able to edit like it is set to `'sts'` . However, +-- commands like "x" still work on the actual characters. +-- When `'sts'` is zero, this feature is off. +-- When `'sts'` is negative, the value of `'shiftwidth'` is used. +-- See also |ins-expandtab|. When `'expandtab'` is not set, the number of +-- spaces is minimized by using s. +-- The `'L'` flag in `'cpoptions'` changes how tabs are used when `'list'` is +-- set. +-- +-- The value of `'softtabstop'` will be ignored if |`'varsofttabstop'` | is set +-- to anything other than an empty string. +--- @class vim.opt.softtabstop: vim.Option,number +--- @operator add: vim.opt.softtabstop +--- @operator sub: vim.opt.softtabstop +--- @operator pow: vim.opt.softtabstop +vim.opt.softtabstop = 0 +vim.opt.sts = vim.opt.softtabstop +--- @return number +function vim.opt.softtabstop:get()end + +-- `'spell'` boolean (default off) +-- local to window +-- When on spell checking will be done. See |spell|. +-- The languages are specified with `'spelllang'` . +--- @class vim.opt.spell: vim.Option,boolean +--- @operator add: vim.opt.spell +--- @operator sub: vim.opt.spell +--- @operator pow: vim.opt.spell +vim.opt.spell = false +--- @return boolean +function vim.opt.spell:get()end + +-- `'spellcapcheck'` `'spc'` string (default "[.?!]\_[\])'" \t]\+") +-- local to buffer +-- Pattern to locate the end of a sentence. The following word will be +-- checked to start with a capital letter. If not then it is highlighted +-- with SpellCap |hl-SpellCap| (unless the word is also badly spelled). +-- When this check is not wanted make this option empty. +-- Only used when `'spell'` is set. +-- Be careful with special characters, see |option-backslash| about +-- including spaces and backslashes. +-- To set this option automatically depending on the language, see +-- |set-spc-auto|. +--- @class vim.opt.spellcapcheck: vim.Option,string +--- @operator add: vim.opt.spellcapcheck +--- @operator sub: vim.opt.spellcapcheck +--- @operator pow: vim.opt.spellcapcheck +vim.opt.spellcapcheck = "[.?!]\\_[\\])'\"\t ]\\+" +vim.opt.spc = vim.opt.spellcapcheck +--- @return string +function vim.opt.spellcapcheck:get()end + +-- `'spellfile'` `'spf'` string (default empty) +-- local to buffer +-- Name of the word list file where words are added for the |zg| and |zw| +-- commands. It must end in ".{encoding}.add". You need to include the +-- path, otherwise the file is placed in the current directory. +-- The path may include characters from `'isfname'` , space, comma and `'@'` . +-- +-- It may also be a comma-separated list of names. A count before the +-- |zg| and |zw| commands can be used to access each. This allows using +-- a personal word list file and a project word list file. +-- When a word is added while this option is empty Vim will set it for +-- you: Using the first directory in `'runtimepath'` that is writable. If +-- there is no "spell" directory yet it will be created. For the file +-- name the first language name that appears in `'spelllang'` is used, +-- ignoring the region. +-- The resulting ".spl" file will be used for spell checking, it does not +-- have to appear in `'spelllang'` . +-- Normally one file is used for all regions, but you can add the region +-- name if you want to. However, it will then only be used when +-- `'spellfile'` is set to it, for entries in `'spelllang'` only files +-- without region name will be found. +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +--- @class vim.opt.spellfile: vim.Option,string[] +--- @operator add: vim.opt.spellfile +--- @operator sub: vim.opt.spellfile +--- @operator pow: vim.opt.spellfile +vim.opt.spellfile = "" +vim.opt.spf = vim.opt.spellfile +--- @return string[] +function vim.opt.spellfile:get()end + +-- `'spelllang'` `'spl'` string (default "en") +-- local to buffer +-- A comma-separated list of word list names. When the `'spell'` option is +-- on spellchecking will be done for these languages. Example: > +-- set spelllang=en_us,nl,medical +-- < This means US English, Dutch and medical words are recognized. Words +-- that are not recognized will be highlighted. +-- The word list name must consist of alphanumeric characters, a dash or +-- an underscore. It should not include a comma or dot. Using a dash is +-- recommended to separate the two letter language name from a +-- specification. Thus "en-rare" is used for rare English words. +-- A region name must come last and have the form "_xx", where "xx" is +-- the two-letter, lower case region name. You can use more than one +-- region by listing them: "en_us,en_ca" supports both US and Canadian +-- English, but not words specific for Australia, New Zealand or Great +-- Britain. (Note: currently en_au and en_nz dictionaries are older than +-- en_ca, en_gb and en_us). +-- If the name "cjk" is included East Asian characters are excluded from +-- spell checking. This is useful when editing text that also has Asian +-- words. +-- Note that the "medical" dictionary does not exist, it is just an +-- example of a longer name. +-- +-- As a special case the name of a .spl file can be given as-is. The +-- first "_xx" in the name is removed and used as the region name +-- (_xx is an underscore, two letters and followed by a non-letter). +-- This is mainly for testing purposes. You must make sure the correct +-- encoding is used, Vim doesn't check it. +-- How the related spell files are found is explained here: |spell-load|. +-- +-- If the |spellfile.vim| plugin is active and you use a language name +-- for which Vim cannot find the .spl file in `'runtimepath'` the plugin +-- will ask you if you want to download the file. +-- +-- After this option has been set successfully, Vim will source the files +-- "spell/LANG.vim" in `'runtimepath'` . "LANG" is the value of `'spelllang'` +-- up to the first character that is not an ASCII letter or number and +-- not a dash. Also see |set-spc-auto|. +--- @class vim.opt.spelllang: vim.Option,string[] +--- @operator add: vim.opt.spelllang +--- @operator sub: vim.opt.spelllang +--- @operator pow: vim.opt.spelllang +vim.opt.spelllang = "en" +vim.opt.spl = vim.opt.spelllang +--- @return string[] +function vim.opt.spelllang:get()end + +-- `'spelloptions'` `'spo'` string (default "") +-- local to buffer +-- A comma-separated list of options for spell checking: +-- camel When a word is CamelCased, assume "Cased" is a +-- separate word: every upper-case character in a word +-- that comes after a lower case character indicates the +-- start of a new word. +-- noplainbuffer Only spellcheck a buffer when `'syntax'` is enabled, +-- or when extmarks are set within the buffer. Only +-- designated regions of the buffer are spellchecked in +-- this case. +--- @class vim.opt.spelloptions: vim.Option,string[] +--- @operator add: vim.opt.spelloptions +--- @operator sub: vim.opt.spelloptions +--- @operator pow: vim.opt.spelloptions +vim.opt.spelloptions = "" +vim.opt.spo = vim.opt.spelloptions +--- @return string[] +function vim.opt.spelloptions:get()end + +-- `'spellsuggest'` `'sps'` string (default "best") +-- global +-- Methods used for spelling suggestions. Both for the |z=| command and +-- the |spellsuggest()| function. This is a comma-separated list of +-- items: +-- +-- best Internal method that works best for English. Finds +-- changes like "fast" and uses a bit of sound-a-like +-- scoring to improve the ordering. +-- +-- double Internal method that uses two methods and mixes the +-- results. The first method is "fast", the other method +-- computes how much the suggestion sounds like the bad +-- word. That only works when the language specifies +-- sound folding. Can be slow and doesn't always give +-- better results. +-- +-- fast Internal method that only checks for simple changes: +-- character inserts/deletes/swaps. Works well for +-- simple typing mistakes. +-- +-- {number} The maximum number of suggestions listed for |z=|. +-- Not used for |spellsuggest()|. The number of +-- suggestions is never more than the value of `'lines'` +-- minus two. +-- +-- timeout:{millisec} Limit the time searching for suggestions to +-- {millisec} milli seconds. Applies to the following +-- methods. When omitted the limit is 5000. When +-- negative there is no limit. +-- +-- file:{filename} Read file {filename}, which must have two columns, +-- separated by a slash. The first column contains the +-- bad word, the second column the suggested good word. +-- Example: +-- theribal/terrible ~ +-- Use this for common mistakes that do not appear at the +-- top of the suggestion list with the internal methods. +-- Lines without a slash are ignored, use this for +-- comments. +-- The word in the second column must be correct, +-- otherwise it will not be used. Add the word to an +-- ".add" file if it is currently flagged as a spelling +-- mistake. +-- The file is used for all languages. +-- +-- expr:{expr} Evaluate expression {expr}. Use a function to avoid +-- trouble with spaces. |v:val| holds the badly spelled +-- word. The expression must evaluate to a List of +-- Lists, each with a suggestion and a score. +-- Example: +-- [[`'the'` , 33], [`'that'` , 44]] ~ +-- Set `'verbose'` and use |z=| to see the scores that the +-- internal methods use. A lower score is better. +-- This may invoke |spellsuggest()| if you temporarily +-- set `'spellsuggest'` to exclude the "expr:" part. +-- Errors are silently ignored, unless you set the +-- `'verbose'` option to a non-zero value. +-- +-- Only one of "best", "double" or "fast" may be used. The others may +-- appear several times in any order. Example: > +-- :set sps=file:~/.config/nvim/sugg,best,expr:MySuggest() +-- < +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +--- @class vim.opt.spellsuggest: vim.Option,string[] +--- @operator add: vim.opt.spellsuggest +--- @operator sub: vim.opt.spellsuggest +--- @operator pow: vim.opt.spellsuggest +vim.opt.spellsuggest = "best" +vim.opt.sps = vim.opt.spellsuggest +--- @return string[] +function vim.opt.spellsuggest:get()end + +-- `'splitbelow'` `'sb'` boolean (default off) +-- global +-- When on, splitting a window will put the new window below the current +-- one. |:split| +--- @class vim.opt.splitbelow: vim.Option,boolean +--- @operator add: vim.opt.splitbelow +--- @operator sub: vim.opt.splitbelow +--- @operator pow: vim.opt.splitbelow +vim.opt.splitbelow = false +vim.opt.sb = vim.opt.splitbelow +--- @return boolean +function vim.opt.splitbelow:get()end + +-- `'splitkeep'` `'spk'` string (default "cursor") +-- global +-- The value of this option determines the scroll behavior when opening, +-- closing or resizing horizontal splits. +-- +-- Possible values are: +-- cursor Keep the same relative cursor position. +-- screen Keep the text on the same screen line. +-- topline Keep the topline the same. +-- +-- For the "screen" and "topline" values, the cursor position will be +-- changed when necessary. In this case, the jumplist will be populated +-- with the previous cursor position. For "screen", the text cannot always +-- be kept on the same screen line when `'wrap'` is enabled. +--- @class vim.opt.splitkeep: vim.Option,string +--- @operator add: vim.opt.splitkeep +--- @operator sub: vim.opt.splitkeep +--- @operator pow: vim.opt.splitkeep +vim.opt.splitkeep = "cursor" +vim.opt.spk = vim.opt.splitkeep +--- @return string +function vim.opt.splitkeep:get()end + +-- `'splitright'` `'spr'` boolean (default off) +-- global +-- When on, splitting a window will put the new window right of the +-- current one. |:vsplit| +--- @class vim.opt.splitright: vim.Option,boolean +--- @operator add: vim.opt.splitright +--- @operator sub: vim.opt.splitright +--- @operator pow: vim.opt.splitright +vim.opt.splitright = false +vim.opt.spr = vim.opt.splitright +--- @return boolean +function vim.opt.splitright:get()end + +-- `'startofline'` `'sol'` boolean (default off) +-- global +-- When "on" the commands listed below move the cursor to the first +-- non-blank of the line. When off the cursor is kept in the same column +-- (if possible). This applies to the commands: +-- - CTRL-D, CTRL-U, CTRL-B, CTRL-F, "G", "H", "M", "L", "gg" +-- - "d", "<<" and ">>" with a linewise operator +-- - "%" with a count +-- - buffer changing commands (CTRL-^, :bnext, :bNext, etc.) +-- - Ex commands that only have a line number, e.g., ":25" or ":+". +-- In case of buffer changing commands the cursor is placed at the column +-- where it was the last time the buffer was edited. +--- @class vim.opt.startofline: vim.Option,boolean +--- @operator add: vim.opt.startofline +--- @operator sub: vim.opt.startofline +--- @operator pow: vim.opt.startofline +vim.opt.startofline = false +vim.opt.sol = vim.opt.startofline +--- @return boolean +function vim.opt.startofline:get()end + +-- `'statuscolumn'` `'stc'` string (default: empty) +-- local to window +-- EXPERIMENTAL +-- When non-empty, this option determines the content of the area to the +-- side of a window, normally containing the fold, sign and number columns. +-- The format of this option is like that of `'statusline'` . +-- +-- Some of the items from the `'statusline'` format are different for +-- `'statuscolumn'` : +-- +-- %l line number of currently drawn line +-- %r relative line number of currently drawn line +-- %s sign column for currently drawn line +-- %C fold column for currently drawn line +-- +-- NOTE: To draw the sign and fold columns, their items must be included in +-- `'statuscolumn'` . Even when they are not included, the status column width +-- will adapt to the `'signcolumn'` and `'foldcolumn'` width. +-- +-- The |v:lnum| variable holds the line number to be drawn. +-- The |v:relnum| variable holds the relative line number to be drawn. +-- The |v:virtnum| variable is negative when drawing virtual lines, zero +-- when drawing the actual buffer line, and positive when +-- drawing the wrapped part of a buffer line. +-- +-- NOTE: The %@ click execute function item is supported as well but the +-- specified function will be the same for each row in the same column. +-- It cannot be switched out through a dynamic `'statuscolumn'` format, the +-- handler should be written with this in mind. +-- +-- Examples: >vim +-- " Relative number with bar separator and click handlers: +-- :set statuscolumn=%@SignCb@%s%=%T%@NumCb@%r│%T +-- +-- " Right aligned relative cursor line number: +-- :let &stc='%=%{v:relnum?v:relnum:v:lnum} ' +-- +-- " Line numbers in hexadecimal for non wrapped part of lines: +-- :let &stc='%=%{v:virtnum>0?"":printf("%x",v:lnum)} ' +-- +-- " Human readable line numbers with thousands separator: +-- :let &stc=`'%{substitute(v:lnum,"\\d\\zs\\ze\\'` +-- . `'%(\\d\\d\\d\\)\\+$",",","g")}'` +-- +-- " Both relative and absolute line numbers with different +-- " highlighting for odd and even relative numbers: +-- :let &stc=`'%#NonText#%{&nu?v:lnum:""}'` . +-- '%=%{&rnu&&(v:lnum%2)?"\ ".v:relnum:""}' . +-- '%#LineNr#%{&rnu&&!(v:lnum%2)?"\ ".v:relnum:""}' +-- +-- < WARNING: this expression is evaluated for each screen line so defining +-- an expensive expression can negatively affect render performance. +--- @class vim.opt.statuscolumn: vim.Option,string +--- @operator add: vim.opt.statuscolumn +--- @operator sub: vim.opt.statuscolumn +--- @operator pow: vim.opt.statuscolumn +vim.opt.statuscolumn = "" +vim.opt.stc = vim.opt.statuscolumn +--- @return string +function vim.opt.statuscolumn:get()end + +-- `'statusline'` `'stl'` string (default empty) +-- global or local to window |global-local| +-- When non-empty, this option determines the content of the status line. +-- Also see |status-line|. +-- +-- The option consists of printf style `'%'` items interspersed with +-- normal text. Each status line item is of the form: +-- %-0{minwid}.{maxwid}{item} +-- All fields except the {item} are optional. A single percent sign can +-- be given as "%%". +-- +-- When the option starts with "%!" then it is used as an expression, +-- evaluated and the result is used as the option value. Example: > +-- :set statusline=%!MyStatusLine() +-- < The variable will be set to the |window-ID| of the +-- window that the status line belongs to. +-- The result can contain %{} items that will be evaluated too. +-- Note that the "%!" expression is evaluated in the context of the +-- current window and buffer, while %{} items are evaluated in the +-- context of the window that the statusline belongs to. +-- +-- When there is error while evaluating the option then it will be made +-- empty to avoid further errors. Otherwise screen updating would loop. +-- When the result contains unprintable characters the result is +-- unpredictable. +-- +-- Note that the only effect of `'ruler'` when this option is set (and +-- `'laststatus'` is 2 or 3) is controlling the output of |CTRL-G|. +-- +-- field meaning ~ +-- - Left justify the item. The default is right justified +-- when minwid is larger than the length of the item. +-- 0 Leading zeroes in numeric items. Overridden by "-". +-- minwid Minimum width of the item, padding as set by "-" & "0". +-- Value must be 50 or less. +-- maxwid Maximum width of the item. Truncation occurs with a "<" +-- on the left for text items. Numeric items will be +-- shifted down to maxwid-2 digits followed by ">"number +-- where number is the amount of missing digits, much like +-- an exponential notation. +-- item A one letter code as described below. +-- +-- Following is a description of the possible statusline items. The +-- second character in "item" is the type: +-- N for number +-- S for string +-- F for flags as described below +-- - not applicable +-- +-- item meaning ~ +-- f S Path to the file in the buffer, as typed or relative to current +-- directory. +-- F S Full path to the file in the buffer. +-- t S File name (tail) of file in the buffer. +-- m F Modified flag, text is "[+]"; "[-]" if `'modifiable'` is off. +-- M F Modified flag, text is ",+" or ",-". +-- r F Readonly flag, text is "[RO]". +-- R F Readonly flag, text is ",RO". +-- h F Help buffer flag, text is "[help]". +-- H F Help buffer flag, text is ",HLP". +-- w F Preview window flag, text is "[Preview]". +-- W F Preview window flag, text is ",PRV". +-- y F Type of file in the buffer, e.g., "[vim]". See `'filetype'` . +-- Y F Type of file in the buffer, e.g., ",VIM". See `'filetype'` . +-- q S "[Quickfix List]", "[Location List]" or empty. +-- k S Value of "b:keymap_name" or `'keymap'` when |:lmap| mappings are +-- being used: "" +-- n N Buffer number. +-- b N Value of character under cursor. +-- B N As above, in hexadecimal. +-- o N Byte number in file of byte under cursor, first byte is 1. +-- Mnemonic: Offset from start of file (with one added) +-- O N As above, in hexadecimal. +-- l N Line number. +-- L N Number of lines in buffer. +-- c N Column number (byte index). +-- v N Virtual column number (screen column). +-- V N Virtual column number as -{num}. Not displayed if equal to `'c'` . +-- p N Percentage through file in lines as in |CTRL-G|. +-- P S Percentage through file of displayed window. This is like the +-- percentage described for `'ruler'` . Always 3 in length, unless +-- translated. +-- S S `'showcmd'` content, see `'showcmdloc'` . +-- a S Argument list status as in default title. ({current} of {max}) +-- Empty if the argument file count is zero or one. +-- { NF Evaluate expression between "%{" and "}" and substitute result. +-- Note that there is no "%" before the closing "}". The +-- expression cannot contain a "}" character, call a function to +-- work around that. See |stl-%{| below. +-- `{%` - This is almost same as "{" except the result of the expression is +-- re-evaluated as a statusline format string. Thus if the +-- return value of expr contains "%" items they will get expanded. +-- The expression can contain the "}" character, the end of +-- expression is denoted by "%}". +-- For example: > +-- func! Stl_filename() abort +-- return "%t" +-- endfunc +-- < `stl=%{Stl_filename()}` results in `"%t"` +-- `stl=%{%Stl_filename()%}` results in `"Name of current file"` +-- %} - End of "{%" expression +-- ( - Start of item group. Can be used for setting the width and +-- alignment of a section. Must be followed by %) somewhere. +-- ) - End of item group. No width fields allowed. +-- T N For `'tabline'` : start of tab page N label. Use %T or %X to end +-- the label. Clicking this label with left mouse button switches +-- to the specified tab page. +-- X N For `'tabline'` : start of close tab N label. Use %X or %T to end +-- the label, e.g.: %3Xclose%X. Use %999X for a "close current +-- tab" label. Clicking this label with left mouse button closes +-- specified tab page. +-- @ N Start of execute function label. Use %X or %T to +-- end the label, e.g.: %10@SwitchBuffer@foo.c%X. Clicking this +-- label runs specified function: in the example when clicking once +-- using left mouse button on "foo.c" "SwitchBuffer(10, 1, `'l'` , +-- ' ')" expression will be run. Function receives the +-- following arguments in order: +-- 1. minwid field value or zero if no N was specified +-- 2. number of mouse clicks to detect multiple clicks +-- 3. mouse button used: "l", "r" or "m" for left, right or middle +-- button respectively; one should not rely on third argument +-- being only "l", "r" or "m": any other non-empty string value +-- that contains only ASCII lower case letters may be expected +-- for other mouse buttons +-- 4. modifiers pressed: string which contains "s" if shift +-- modifier was pressed, "c" for control, "a" for alt and "m" +-- for meta; currently if modifier is not pressed string +-- contains space instead, but one should not rely on presence +-- of spaces or specific order of modifiers: use |stridx()| to +-- test whether some modifier is present; string is guaranteed +-- to contain only ASCII letters and spaces, one letter per +-- modifier; "?" modifier may also be present, but its presence +-- is a bug that denotes that new mouse button recognition was +-- added without modifying code that reacts on mouse clicks on +-- this label. +-- Use |getmousepos()|.winid in the specified function to get the +-- corresponding window id of the clicked item. +-- < - Where to truncate line if too long. Default is at the start. +-- No width fields allowed. +-- = - Separation point between alignment sections. Each section will +-- be separated by an equal number of spaces. With one %= what +-- comes after it will be right-aligned. With two %= there is a +-- middle part, with white space left and right of it. +-- No width fields allowed. +-- # - Set highlight group. The name must follow and then a # again. +-- Thus use %#HLname# for highlight group HLname. The same +-- highlighting is used, also for the statusline of non-current +-- windows. +-- * - Set highlight group to User{N}, where {N} is taken from the +-- minwid field, e.g. %1*. Restore normal highlight with %* or %0*. +-- The difference between User{N} and StatusLine will be applied to +-- StatusLineNC for the statusline of non-current windows. +-- The number N must be between 1 and 9. See |hl-User1..9| +-- +-- When displaying a flag, Vim removes the leading comma, if any, when +-- that flag comes right after plaintext. This will make a nice display +-- when flags are used like in the examples below. +-- +-- When all items in a group becomes an empty string (i.e. flags that are +-- not set) and a minwid is not set for the group, the whole group will +-- become empty. This will make a group like the following disappear +-- completely from the statusline when none of the flags are set. > +-- :set statusline=...%(\ [%M%R%H]%)... +-- < Beware that an expression is evaluated each and every time the status +-- line is displayed. +-- +-- While evaluating %{} the current buffer and current window will be set +-- temporarily to that of the window (and buffer) whose statusline is +-- currently being drawn. The expression will evaluate in this context. +-- The variable "g:actual_curbuf" is set to the `bufnr()` number of the +-- real current buffer and "g:actual_curwin" to the |window-ID| of the +-- real current window. These values are strings. +-- +-- The `'statusline'` option will be evaluated in the |sandbox| if set from +-- a modeline, see |sandbox-option|. +-- This option cannot be set in a modeline when `'modelineexpr'` is off. +-- +-- It is not allowed to change text or jump to another window while +-- evaluating `'statusline'` |textlock|. +-- +-- If the statusline is not updated when you want it (e.g., after setting +-- a variable that's used in an expression), you can force an update by +-- using `:redrawstatus`. +-- +-- A result of all digits is regarded a number for display purposes. +-- Otherwise the result is taken as flag text and applied to the rules +-- described above. +-- +-- Watch out for errors in expressions. They may render Vim unusable! +-- If you are stuck, hold down `':'` or `'Q'` to get a prompt, then quit and +-- edit your vimrc or whatever with "vim --clean" to get it right. +-- +-- Examples: +-- Emulate standard status line with `'ruler'` set > +-- :set statusline=%<%f\ %h%m%r%=%-14.(%l,%c%V%)\ %P +-- < Similar, but add ASCII value of char under the cursor (like "ga") > +-- :set statusline=%<%f%h%m%r%=%b\ 0x%B\ \ %l,%c%V\ %P +-- < Display byte count and byte value, modified flag in red. > +-- :set statusline=%<%f%=\ [%1%n%R%H]\ %-19(%3l,%02c%03V%)%O`'%02b'` +-- :hi User1 term=inverse,bold cterm=inverse,bold ctermfg=red +-- < Display a ,GZ flag if a compressed file is loaded > +-- :set statusline=...%r%{VarExists(`'b:gzflag'` ,'\ [GZ]')}%h... +-- < In the |:autocmd|'s: > +-- :let b:gzflag = 1 +-- < And: > +-- :unlet b:gzflag +-- < And define this function: > +-- :function VarExists(var, val) +-- : if exists(a:var) | return a:val | else | return `''` | endif +-- :endfunction +-- < +--- @class vim.opt.statusline: vim.Option,string +--- @operator add: vim.opt.statusline +--- @operator sub: vim.opt.statusline +--- @operator pow: vim.opt.statusline +vim.opt.statusline = "" +vim.opt.stl = vim.opt.statusline +--- @return string +function vim.opt.statusline:get()end + +-- `'suffixes'` `'su'` string (default ".bak,~,.o,.h,.info,.swp,.obj") +-- global +-- Files with these suffixes get a lower priority when multiple files +-- match a wildcard. See |suffixes|. Commas can be used to separate the +-- suffixes. Spaces after the comma are ignored. A dot is also seen as +-- the start of a suffix. To avoid a dot or comma being recognized as a +-- separator, precede it with a backslash (see |option-backslash| about +-- including spaces and backslashes). +-- See `'wildignore'` for completely ignoring files. +-- The use of |:set+=| and |:set-=| is preferred when adding or removing +-- suffixes from the list. This avoids problems when a future version +-- uses another default. +--- @class vim.opt.suffixes: vim.Option,string[] +--- @operator add: vim.opt.suffixes +--- @operator sub: vim.opt.suffixes +--- @operator pow: vim.opt.suffixes +vim.opt.suffixes = ".bak,~,.o,.h,.info,.swp,.obj" +vim.opt.su = vim.opt.suffixes +--- @return string[] +function vim.opt.suffixes:get()end + +-- `'suffixesadd'` `'sua'` string (default "") +-- local to buffer +-- Comma-separated list of suffixes, which are used when searching for a +-- file for the "gf", "[I", etc. commands. Example: > +-- :set suffixesadd=.java +-- < +--- @class vim.opt.suffixesadd: vim.Option,string[] +--- @operator add: vim.opt.suffixesadd +--- @operator sub: vim.opt.suffixesadd +--- @operator pow: vim.opt.suffixesadd +vim.opt.suffixesadd = "" +vim.opt.sua = vim.opt.suffixesadd +--- @return string[] +function vim.opt.suffixesadd:get()end + +-- `'swapfile'` `'swf'` boolean (default on) +-- local to buffer +-- Use a swapfile for the buffer. This option can be reset when a +-- swapfile is not wanted for a specific buffer. For example, with +-- confidential information that even root must not be able to access. +-- Careful: All text will be in memory: +-- - Don't use this for big files. +-- - Recovery will be impossible! +-- A swapfile will only be present when |`'updatecount'` | is non-zero and +-- `'swapfile'` is set. +-- When `'swapfile'` is reset, the swap file for the current buffer is +-- immediately deleted. When `'swapfile'` is set, and `'updatecount'` is +-- non-zero, a swap file is immediately created. +-- Also see |swap-file|. +-- If you want to open a new buffer without creating a swap file for it, +-- use the |:noswapfile| modifier. +-- See `'directory'` for where the swap file is created. +-- +-- This option is used together with `'bufhidden'` and `'buftype'` to +-- specify special kinds of buffers. See |special-buffers|. +--- @class vim.opt.swapfile: vim.Option,boolean +--- @operator add: vim.opt.swapfile +--- @operator sub: vim.opt.swapfile +--- @operator pow: vim.opt.swapfile +vim.opt.swapfile = true +vim.opt.swf = vim.opt.swapfile +--- @return boolean +function vim.opt.swapfile:get()end + +-- `'switchbuf'` `'swb'` string (default "uselast") +-- global +-- This option controls the behavior when switching between buffers. +-- This option is checked, when +-- - jumping to errors with the |quickfix| commands (|:cc|, |:cn|, |:cp|, +-- etc.) +-- - jumping to a tag using the |:stag| command. +-- - opening a file using the |CTRL-W_f| or |CTRL-W_F| command. +-- - jumping to a buffer using a buffer split command (e.g. |:sbuffer|, +-- |:sbnext|, or |:sbrewind|). +-- Possible values (comma-separated list): +-- useopen If included, jump to the first open window in the +-- current tab page that contains the specified buffer +-- (if there is one). Otherwise: Do not examine other +-- windows. +-- usetab Like "useopen", but also consider windows in other tab +-- pages. +-- split If included, split the current window before loading +-- a buffer for a |quickfix| command that display errors. +-- Otherwise: do not split, use current window (when used +-- in the quickfix window: the previously used window or +-- split if there is no other window). +-- vsplit Just like "split" but split vertically. +-- newtab Like "split", but open a new tab page. Overrules +-- "split" when both are present. +-- uselast If included, jump to the previously used window when +-- jumping to errors with |quickfix| commands. +--- @class vim.opt.switchbuf: vim.Option,string[] +--- @operator add: vim.opt.switchbuf +--- @operator sub: vim.opt.switchbuf +--- @operator pow: vim.opt.switchbuf +vim.opt.switchbuf = "uselast" +vim.opt.swb = vim.opt.switchbuf +--- @return string[] +function vim.opt.switchbuf:get()end + +-- `'synmaxcol'` `'smc'` number (default 3000) +-- local to buffer +-- Maximum column in which to search for syntax items. In long lines the +-- text after this column is not highlighted and following lines may not +-- be highlighted correctly, because the syntax state is cleared. +-- This helps to avoid very slow redrawing for an XML file that is one +-- long line. +-- Set to zero to remove the limit. +--- @class vim.opt.synmaxcol: vim.Option,number +--- @operator add: vim.opt.synmaxcol +--- @operator sub: vim.opt.synmaxcol +--- @operator pow: vim.opt.synmaxcol +vim.opt.synmaxcol = 3000 +vim.opt.smc = vim.opt.synmaxcol +--- @return number +function vim.opt.synmaxcol:get()end + +-- `'syntax'` `'syn'` string (default empty) +-- local to buffer +-- When this option is set, the syntax with this name is loaded, unless +-- syntax highlighting has been switched off with ":syntax off". +-- Otherwise this option does not always reflect the current syntax (the +-- b:current_syntax variable does). +-- This option is most useful in a modeline, for a file which syntax is +-- not automatically recognized. Example, in an IDL file: > +-- /* vim: set syntax=idl : */ +-- < When a dot appears in the value then this separates two filetype +-- names. Example: > +-- /* vim: set syntax=c.doxygen : */ +-- < This will use the "c" syntax first, then the "doxygen" syntax. +-- Note that the second one must be prepared to be loaded as an addition, +-- otherwise it will be skipped. More than one dot may appear. +-- To switch off syntax highlighting for the current file, use: > +-- :set syntax=OFF +-- < To switch syntax highlighting on according to the current value of the +-- `'filetype'` option: > +-- :set syntax=ON +-- < What actually happens when setting the `'syntax'` option is that the +-- Syntax autocommand event is triggered with the value as argument. +-- This option is not copied to another buffer, independent of the `'s'` or +-- `'S'` flag in `'cpoptions'` . +-- Only normal file name characters can be used, "/\*?[|<>" are illegal. +--- @class vim.opt.syntax: vim.Option,string +--- @operator add: vim.opt.syntax +--- @operator sub: vim.opt.syntax +--- @operator pow: vim.opt.syntax +vim.opt.syntax = "" +vim.opt.syn = vim.opt.syntax +--- @return string +function vim.opt.syntax:get()end + +-- `'tabline'` `'tal'` string (default empty) +-- global +-- When non-empty, this option determines the content of the tab pages +-- line at the top of the Vim window. When empty Vim will use a default +-- tab pages line. See |setting-tabline| for more info. +-- +-- The tab pages line only appears as specified with the `'showtabline'` +-- option and only when there is no GUI tab line. When `'e'` is in +-- `'guioptions'` and the GUI supports a tab line `'guitablabel'` is used +-- instead. Note that the two tab pages lines are very different. +-- +-- The value is evaluated like with `'statusline'` . You can use +-- |tabpagenr()|, |tabpagewinnr()| and |tabpagebuflist()| to figure out +-- the text to be displayed. Use "%1T" for the first label, "%2T" for +-- the second one, etc. Use "%X" items for closing labels. +-- +-- When changing something that is used in `'tabline'` that does not +-- trigger it to be updated, use |:redrawtabline|. +-- This option cannot be set in a modeline when `'modelineexpr'` is off. +-- +-- Keep in mind that only one of the tab pages is the current one, others +-- are invisible and you can't jump to their windows. +--- @class vim.opt.tabline: vim.Option,string +--- @operator add: vim.opt.tabline +--- @operator sub: vim.opt.tabline +--- @operator pow: vim.opt.tabline +vim.opt.tabline = "" +vim.opt.tal = vim.opt.tabline +--- @return string +function vim.opt.tabline:get()end + +-- `'tabpagemax'` `'tpm'` number (default 50) +-- global +-- Maximum number of tab pages to be opened by the |-p| command line +-- argument or the ":tab all" command. |tabpage| +--- @class vim.opt.tabpagemax: vim.Option,number +--- @operator add: vim.opt.tabpagemax +--- @operator sub: vim.opt.tabpagemax +--- @operator pow: vim.opt.tabpagemax +vim.opt.tabpagemax = 50 +vim.opt.tpm = vim.opt.tabpagemax +--- @return number +function vim.opt.tabpagemax:get()end + +-- `'tabstop'` `'ts'` number (default 8) +-- local to buffer +-- Number of spaces that a in the file counts for. Also see +-- the |:retab| command, and the `'softtabstop'` option. +-- +-- Note: Setting `'tabstop'` to any other value than 8 can make your file +-- 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: +-- 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 and will +-- behave like a tab appears every 4 (or 3) characters. +-- This is the recommended way, the file will look the same with other +-- tools and when listing it in a terminal. +-- 2. Set `'softtabstop'` and `'shiftwidth'` to whatever you prefer and use +-- `'expandtab'` . This way you will always insert spaces. The +-- formatting will never be messed up when `'tabstop'` is changed (leave +-- it at 8 just in case). The file will be a bit larger. +-- You do need to check if no Tabs exist in the file. You can get rid +-- of them by first setting `'expandtab'` and using `%retab!`, making +-- sure the value of `'tabstop'` is set correctly. +-- 3. Set `'tabstop'` and `'shiftwidth'` to whatever you prefer and use +-- `'expandtab'` . This way you will always insert spaces. The +-- formatting will never be messed up when `'tabstop'` is changed. +-- You do need to check if no Tabs exist in the file, just like in the +-- item just above. +-- 4. Set `'tabstop'` and `'shiftwidth'` to whatever you prefer and use a +-- |modeline| to set these values when editing the file again. Only +-- works when using Vim to edit the file, other tools assume a tabstop +-- is worth 8 spaces. +-- 5. Always set `'tabstop'` and `'shiftwidth'` to the same value, and +-- `'noexpandtab'` . This should then work (for initial indents only) +-- for any tabstop setting that people use. It might be nice to have +-- tabs after the first non-blank inserted as spaces if you do this +-- though. Otherwise aligned comments will be wrong when `'tabstop'` is +-- changed. +-- +-- The value of `'tabstop'` will be ignored if |`'vartabstop'` | is set to +-- anything other than an empty string. +--- @class vim.opt.tabstop: vim.Option,number +--- @operator add: vim.opt.tabstop +--- @operator sub: vim.opt.tabstop +--- @operator pow: vim.opt.tabstop +vim.opt.tabstop = 8 +vim.opt.ts = vim.opt.tabstop +--- @return number +function vim.opt.tabstop:get()end + +-- `'tagbsearch'` `'tbs'` boolean (default on) +-- global +-- When searching for a tag (e.g., for the |:ta| command), Vim can either +-- use a binary search or a linear search in a tags file. Binary +-- searching makes searching for a tag a LOT faster, but a linear search +-- will find more tags if the tags file wasn't properly sorted. +-- Vim normally assumes that your tags files are sorted, or indicate that +-- they are not sorted. Only when this is not the case does the +-- `'tagbsearch'` option need to be switched off. +-- +-- When `'tagbsearch'` is on, binary searching is first used in the tags +-- files. In certain situations, Vim will do a linear search instead for +-- certain files, or retry all files with a linear search. When +-- `'tagbsearch'` is off, only a linear search is done. +-- +-- Linear searching is done anyway, for one file, when Vim finds a line +-- at the start of the file indicating that it's not sorted: > +-- !_TAG_FILE_SORTED 0 /some comment/ +-- < [The whitespace before and after the `'0'` must be a single ] +-- +-- When a binary search was done and no match was found in any of the +-- files listed in `'tags'` , and case is ignored or a pattern is used +-- instead of a normal tag name, a retry is done with a linear search. +-- Tags in unsorted tags files, and matches with different case will only +-- be found in the retry. +-- +-- If a tag file indicates that it is case-fold sorted, the second, +-- linear search can be avoided when case is ignored. Use a value of `'2'` +-- in the "!_TAG_FILE_SORTED" line for this. A tag file can be case-fold +-- sorted with the -f switch to "sort" in most unices, as in the command: +-- "sort -f -o tags tags". For Universal ctags and Exuberant ctags +-- version 5.x or higher (at least 5.5) the --sort=foldcase switch can be +-- used for this as well. Note that case must be folded to uppercase for +-- this to work. +-- +-- By default, tag searches are case-sensitive. Case is ignored when +-- `'ignorecase'` is set and `'tagcase'` is "followic", or when `'tagcase'` is +-- "ignore". +-- Also when `'tagcase'` is "followscs" and `'smartcase'` is set, or +-- `'tagcase'` is "smart", and the pattern contains only lowercase +-- characters. +-- +-- When `'tagbsearch'` is off, tags searching is slower when a full match +-- exists, but faster when no full match exists. Tags in unsorted tags +-- files may only be found with `'tagbsearch'` off. +-- When the tags file is not sorted, or sorted in a wrong way (not on +-- ASCII byte value), `'tagbsearch'` should be off, or the line given above +-- must be included in the tags file. +-- This option doesn't affect commands that find all matching tags (e.g., +-- command-line completion and ":help"). +--- @class vim.opt.tagbsearch: vim.Option,boolean +--- @operator add: vim.opt.tagbsearch +--- @operator sub: vim.opt.tagbsearch +--- @operator pow: vim.opt.tagbsearch +vim.opt.tagbsearch = true +vim.opt.tbs = vim.opt.tagbsearch +--- @return boolean +function vim.opt.tagbsearch:get()end + +-- `'tagcase'` `'tc'` string (default "followic") +-- global or local to buffer |global-local| +-- This option specifies how case is handled when searching the tags +-- file: +-- followic Follow the `'ignorecase'` option +-- followscs Follow the `'smartcase'` and `'ignorecase'` options +-- ignore Ignore case +-- match Match case +-- smart Ignore case unless an upper case letter is used +--- @class vim.opt.tagcase: vim.Option,string +--- @operator add: vim.opt.tagcase +--- @operator sub: vim.opt.tagcase +--- @operator pow: vim.opt.tagcase +vim.opt.tagcase = "followic" +vim.opt.tc = vim.opt.tagcase +--- @return string +function vim.opt.tagcase:get()end + +-- `'tagfunc'` `'tfu'` string (default: empty) +-- local to buffer +-- This option specifies a function to be used to perform tag searches. +-- The function gets the tag pattern and should return a List of matching +-- tags. See |tag-function| for an explanation of how to write the +-- function and an example. The value can be the name of a function, a +-- |lambda| or a |Funcref|. See |option-value-function| for more +-- information. +--- @class vim.opt.tagfunc: vim.Option,string +--- @operator add: vim.opt.tagfunc +--- @operator sub: vim.opt.tagfunc +--- @operator pow: vim.opt.tagfunc +vim.opt.tagfunc = "" +vim.opt.tfu = vim.opt.tagfunc +--- @return string +function vim.opt.tagfunc:get()end + +-- `'taglength'` `'tl'` number (default 0) +-- global +-- If non-zero, tags are significant up to this number of characters. +--- @class vim.opt.taglength: vim.Option,number +--- @operator add: vim.opt.taglength +--- @operator sub: vim.opt.taglength +--- @operator pow: vim.opt.taglength +vim.opt.taglength = 0 +vim.opt.tl = vim.opt.taglength +--- @return number +function vim.opt.taglength:get()end + +-- `'tagrelative'` `'tr'` boolean (default: on) +-- global +-- If on and using a tags file in another directory, file names in that +-- tags file are relative to the directory where the tags file is. +--- @class vim.opt.tagrelative: vim.Option,boolean +--- @operator add: vim.opt.tagrelative +--- @operator sub: vim.opt.tagrelative +--- @operator pow: vim.opt.tagrelative +vim.opt.tagrelative = true +vim.opt.tr = vim.opt.tagrelative +--- @return boolean +function vim.opt.tagrelative:get()end + +-- `'tags'` `'tag'` string (default "./tags;,tags") +-- global or local to buffer |global-local| +-- Filenames for the tag command, separated by spaces or commas. To +-- include a space or comma in a file name, precede it with a backslash +-- (see |option-backslash| about including spaces and backslashes). +-- When a file name starts with "./", the `'.'` is replaced with the path +-- of the current file. But only when the `'d'` flag is not included in +-- `'cpoptions'` . Environment variables are expanded |:set_env|. Also see +-- |tags-option|. +-- "*", "" and other wildcards can be used to search for tags files in +-- a directory tree. See |file-searching|. E.g., "/lib//tags" will +-- find all files named "tags" below "/lib". The filename itself cannot +-- contain wildcards, it is used as-is. E.g., "/lib//tags?" will find +-- files called "tags?". +-- The |tagfiles()| function can be used to get a list of the file names +-- actually used. +-- The use of |:set+=| and |:set-=| is preferred when adding or removing +-- file names from the list. This avoids problems when a future version +-- uses another default. +--- @class vim.opt.tags: vim.Option,string[] +--- @operator add: vim.opt.tags +--- @operator sub: vim.opt.tags +--- @operator pow: vim.opt.tags +vim.opt.tags = "./tags;,tags" +vim.opt.tag = vim.opt.tags +--- @return string[] +function vim.opt.tags:get()end + +-- `'tagstack'` `'tgst'` boolean (default on) +-- global +-- When on, the |tagstack| is used normally. When off, a ":tag" or +-- ":tselect" command with an argument will not push the tag onto the +-- tagstack. A following ":tag" without an argument, a ":pop" command or +-- any other command that uses the tagstack will use the unmodified +-- tagstack, but does change the pointer to the active entry. +-- Resetting this option is useful when using a ":tag" command in a +-- mapping which should not change the tagstack. +--- @class vim.opt.tagstack: vim.Option,boolean +--- @operator add: vim.opt.tagstack +--- @operator sub: vim.opt.tagstack +--- @operator pow: vim.opt.tagstack +vim.opt.tagstack = true +vim.opt.tgst = vim.opt.tagstack +--- @return boolean +function vim.opt.tagstack:get()end + +-- `'termbidi'` `'tbidi'` boolean (default off) +-- global +-- The terminal is in charge of Bi-directionality of text (as specified +-- by Unicode). The terminal is also expected to do the required shaping +-- that some languages (such as Arabic) require. +-- Setting this option implies that `'rightleft'` will not be set when +-- `'arabic'` is set and the value of `'arabicshape'` will be ignored. +-- Note that setting `'termbidi'` has the immediate effect that +-- `'arabicshape'` is ignored, but `'rightleft'` isn't changed automatically. +-- For further details see |arabic.txt|. +--- @class vim.opt.termbidi: vim.Option,boolean +--- @operator add: vim.opt.termbidi +--- @operator sub: vim.opt.termbidi +--- @operator pow: vim.opt.termbidi +vim.opt.termbidi = false +vim.opt.tbidi = vim.opt.termbidi +--- @return boolean +function vim.opt.termbidi:get()end + +--- @class vim.opt.termencoding: vim.Option,string +--- @operator add: vim.opt.termencoding +--- @operator sub: vim.opt.termencoding +--- @operator pow: vim.opt.termencoding +vim.opt.termencoding = "" +vim.opt.tenc = vim.opt.termencoding +--- @return string +function vim.opt.termencoding:get()end + +-- `'termguicolors'` `'tgc'` boolean (default off) +-- global +-- Enables 24-bit RGB color in the |TUI|. Uses "gui" |:highlight| +-- attributes instead of "cterm" attributes. |guifg| +-- Requires an ISO-8613-3 compatible terminal. +--- @class vim.opt.termguicolors: vim.Option,boolean +--- @operator add: vim.opt.termguicolors +--- @operator sub: vim.opt.termguicolors +--- @operator pow: vim.opt.termguicolors +vim.opt.termguicolors = false +vim.opt.tgc = vim.opt.termguicolors +--- @return boolean +function vim.opt.termguicolors:get()end + +-- `'termpastefilter'` `'tpf'` string (default: "BS,HT,ESC,DEL") +-- global +-- A comma-separated list of options for specifying control characters +-- to be removed from the text pasted into the terminal window. The +-- supported values are: +-- +-- BS Backspace +-- +-- HT TAB +-- +-- FF Form feed +-- +-- ESC Escape +-- +-- DEL DEL +-- +-- C0 Other control characters, excluding Line feed and +-- Carriage return < ' ' +-- +-- C1 Control characters 0x80...0x9F +--- @class vim.opt.termpastefilter: vim.Option,string[] +--- @operator add: vim.opt.termpastefilter +--- @operator sub: vim.opt.termpastefilter +--- @operator pow: vim.opt.termpastefilter +vim.opt.termpastefilter = "BS,HT,ESC,DEL" +vim.opt.tpf = vim.opt.termpastefilter +--- @return string[] +function vim.opt.termpastefilter:get()end + +--- @class vim.opt.terse: vim.Option,boolean +--- @operator add: vim.opt.terse +--- @operator sub: vim.opt.terse +--- @operator pow: vim.opt.terse +vim.opt.terse = false +--- @return boolean +function vim.opt.terse:get()end + +-- `'textwidth'` `'tw'` number (default 0) +-- local to buffer +-- Maximum width of text that is being inserted. A longer line will be +-- broken after white space to get this width. A zero value disables +-- this. +-- When `'textwidth'` is zero, `'wrapmargin'` may be used. See also +-- `'formatoptions'` and |ins-textwidth|. +-- When `'formatexpr'` is set it will be used to break the line. +--- @class vim.opt.textwidth: vim.Option,number +--- @operator add: vim.opt.textwidth +--- @operator sub: vim.opt.textwidth +--- @operator pow: vim.opt.textwidth +vim.opt.textwidth = 0 +vim.opt.tw = vim.opt.textwidth +--- @return number +function vim.opt.textwidth:get()end + +-- `'thesaurus'` `'tsr'` string (default "") +-- global or local to buffer |global-local| +-- List of file names, separated by commas, that are used to lookup words +-- for thesaurus completion commands |i_CTRL-X_CTRL-T|. See +-- |compl-thesaurus|. +-- +-- This option is not used if `'thesaurusfunc'` is set, either for the +-- buffer or globally. +-- +-- To include a comma in a file name precede it with a backslash. Spaces +-- after a comma are ignored, otherwise spaces are included in the file +-- name. See |option-backslash| about using backslashes. The use of +-- |:set+=| and |:set-=| is preferred when adding or removing directories +-- from the list. This avoids problems when a future version uses +-- another default. Backticks cannot be used in this option for security +-- reasons. +--- @class vim.opt.thesaurus: vim.Option,string[] +--- @operator add: vim.opt.thesaurus +--- @operator sub: vim.opt.thesaurus +--- @operator pow: vim.opt.thesaurus +vim.opt.thesaurus = "" +vim.opt.tsr = vim.opt.thesaurus +--- @return string[] +function vim.opt.thesaurus:get()end + +-- `'thesaurusfunc'` `'tsrfu'` string (default: empty) +-- global or local to buffer |global-local| +-- This option specifies a function to be used for thesaurus completion +-- with CTRL-X CTRL-T. |i_CTRL-X_CTRL-T| See |compl-thesaurusfunc|. +-- The value can be the name of a function, a |lambda| or a |Funcref|. +-- See |option-value-function| for more information. +-- +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +--- @class vim.opt.thesaurusfunc: vim.Option,string +--- @operator add: vim.opt.thesaurusfunc +--- @operator sub: vim.opt.thesaurusfunc +--- @operator pow: vim.opt.thesaurusfunc +vim.opt.thesaurusfunc = "" +vim.opt.tsrfu = vim.opt.thesaurusfunc +--- @return string +function vim.opt.thesaurusfunc:get()end + +-- `'tildeop'` `'top'` boolean (default off) +-- global +-- When on: The tilde command "~" behaves like an operator. +--- @class vim.opt.tildeop: vim.Option,boolean +--- @operator add: vim.opt.tildeop +--- @operator sub: vim.opt.tildeop +--- @operator pow: vim.opt.tildeop +vim.opt.tildeop = false +vim.opt.top = vim.opt.tildeop +--- @return boolean +function vim.opt.tildeop:get()end + +-- `'timeout'` `'to'` boolean (default on) +-- global +-- This option and `'timeoutlen'` determine the behavior when part of a +-- mapped key sequence has been received. For example, if is +-- pressed and `'timeout'` is set, Nvim will wait `'timeoutlen'` milliseconds +-- for any key that can follow in a mapping. +--- @class vim.opt.timeout: vim.Option,boolean +--- @operator add: vim.opt.timeout +--- @operator sub: vim.opt.timeout +--- @operator pow: vim.opt.timeout +vim.opt.timeout = true +vim.opt.to = vim.opt.timeout +--- @return boolean +function vim.opt.timeout:get()end + +-- `'timeoutlen'` `'tm'` number (default 1000) +-- global +-- Time in milliseconds to wait for a mapped sequence to complete. +--- @class vim.opt.timeoutlen: vim.Option,number +--- @operator add: vim.opt.timeoutlen +--- @operator sub: vim.opt.timeoutlen +--- @operator pow: vim.opt.timeoutlen +vim.opt.timeoutlen = 1000 +vim.opt.tm = vim.opt.timeoutlen +--- @return number +function vim.opt.timeoutlen:get()end + +-- `'title'` boolean (default off) +-- global +-- When on, the title of the window will be set to the value of +-- `'titlestring'` (if it is not empty), or to: +-- filename [+=-] (path) - NVIM +-- Where: +-- filename the name of the file being edited +-- - indicates the file cannot be modified, `'ma'` off +-- + indicates the file was modified +-- = indicates the file is read-only +-- =+ indicates the file is read-only and modified +-- (path) is the path of the file being edited +-- - NVIM the server name |v:servername| or "NVIM" +--- @class vim.opt.title: vim.Option,boolean +--- @operator add: vim.opt.title +--- @operator sub: vim.opt.title +--- @operator pow: vim.opt.title +vim.opt.title = false +--- @return boolean +function vim.opt.title:get()end + +-- `'titlelen'` number (default 85) +-- global +-- Gives the percentage of `'columns'` to use for the length of the window +-- title. When the title is longer, only the end of the path name is +-- shown. A `'<'` character before the path name is used to indicate this. +-- Using a percentage makes this adapt to the width of the window. But +-- it won't work perfectly, because the actual number of characters +-- available also depends on the font used and other things in the title +-- bar. When `'titlelen'` is zero the full path is used. Otherwise, +-- values from 1 to 30000 percent can be used. +-- `'titlelen'` is also used for the `'titlestring'` option. +--- @class vim.opt.titlelen: vim.Option,number +--- @operator add: vim.opt.titlelen +--- @operator sub: vim.opt.titlelen +--- @operator pow: vim.opt.titlelen +vim.opt.titlelen = 85 +--- @return number +function vim.opt.titlelen:get()end + +-- `'titleold'` string (default "") +-- global +-- If not empty, this option will be used to set the window title when +-- exiting. Only if `'title'` is enabled. +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +--- @class vim.opt.titleold: vim.Option,string +--- @operator add: vim.opt.titleold +--- @operator sub: vim.opt.titleold +--- @operator pow: vim.opt.titleold +vim.opt.titleold = "" +--- @return string +function vim.opt.titleold:get()end + +-- `'titlestring'` string (default "") +-- global +-- When this option is not empty, it will be used for the title of the +-- window. This happens only when the `'title'` option is on. +-- +-- When this option contains printf-style `'%'` items, they will be +-- expanded according to the rules used for `'statusline'` . +-- This option cannot be set in a modeline when `'modelineexpr'` is off. +-- +-- Example: > +-- :auto BufEnter * let &titlestring = hostname() .. "/" .. expand("%:p") +-- :set title titlestring=%<%F%=%l/%L-%P titlelen=70 +-- < The value of `'titlelen'` is used to align items in the middle or right +-- of the available space. +-- Some people prefer to have the file name first: > +-- :set titlestring=%t%(\ %M%)%(\ (%{expand(\"%:~:.:h\")})%)%(\ %a%) +-- < Note the use of "%{ }" and an expression to get the path of the file, +-- without the file name. The "%( %)" constructs are used to add a +-- separating space only when needed. +-- NOTE: Use of special characters in `'titlestring'` may cause the display +-- to be garbled (e.g., when it contains a CR or NL character). +--- @class vim.opt.titlestring: vim.Option,string +--- @operator add: vim.opt.titlestring +--- @operator sub: vim.opt.titlestring +--- @operator pow: vim.opt.titlestring +vim.opt.titlestring = "" +--- @return string +function vim.opt.titlestring:get()end + +-- `'ttimeout'` boolean (default on) +-- global +-- This option and `'ttimeoutlen'` determine the behavior when part of a +-- key code sequence has been received by the |TUI|. +-- +-- For example if (the \x1b byte) is received and `'ttimeout'` is +-- set, Nvim waits `'ttimeoutlen'` milliseconds for the terminal to +-- complete a key code sequence. If no input arrives before the timeout, +-- a single is assumed. Many TUI cursor key codes start with . +-- +-- On very slow systems this may fail, causing cursor keys not to work +-- sometimes. If you discover this problem you can ":set ttimeoutlen=9999". +-- Nvim will wait for the next character to arrive after an . +--- @class vim.opt.ttimeout: vim.Option,boolean +--- @operator add: vim.opt.ttimeout +--- @operator sub: vim.opt.ttimeout +--- @operator pow: vim.opt.ttimeout +vim.opt.ttimeout = true +--- @return boolean +function vim.opt.ttimeout:get()end + +-- `'ttimeoutlen'` `'ttm'` number (default 50) +-- global +-- Time in milliseconds to wait for a key code sequence to complete. Also +-- used for CTRL-\ CTRL-N and CTRL-\ CTRL-G when part of a command has +-- been typed. +--- @class vim.opt.ttimeoutlen: vim.Option,number +--- @operator add: vim.opt.ttimeoutlen +--- @operator sub: vim.opt.ttimeoutlen +--- @operator pow: vim.opt.ttimeoutlen +vim.opt.ttimeoutlen = 50 +vim.opt.ttm = vim.opt.ttimeoutlen +--- @return number +function vim.opt.ttimeoutlen:get()end + +--- @class vim.opt.ttyfast: vim.Option,boolean +--- @operator add: vim.opt.ttyfast +--- @operator sub: vim.opt.ttyfast +--- @operator pow: vim.opt.ttyfast +vim.opt.ttyfast = true +vim.opt.tf = vim.opt.ttyfast +--- @return boolean +function vim.opt.ttyfast:get()end + +-- `'undodir'` `'udir'` string (default "$XDG_STATE_HOME/nvim/undo//") +-- global +-- List of directory names for undo files, separated with commas. +-- See `'backupdir'` for details of the format. +-- "." means using the directory of the file. The undo file name for +-- "file.txt" is ".file.txt.un~". +-- For other directories the file name is the full path of the edited +-- file, with path separators replaced with "%". +-- When writing: The first directory that exists is used. "." always +-- works, no directories after "." will be used for writing. If none of +-- the directories exist Nvim will attempt to create the last directory in +-- the list. +-- When reading all entries are tried to find an undo file. The first +-- undo file that exists is used. When it cannot be read an error is +-- given, no further entry is used. +-- See |undo-persistence|. +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +-- +-- Note that unlike `'directory'` and `'backupdir'` , `'undodir'` always acts as +-- though the trailing slashes are present (see `'backupdir'` for what this +-- means). +--- @class vim.opt.undodir: vim.Option,string[] +--- @operator add: vim.opt.undodir +--- @operator sub: vim.opt.undodir +--- @operator pow: vim.opt.undodir +vim.opt.undodir = "/home/runner/.local/state/nvim/undo//" +vim.opt.udir = vim.opt.undodir +--- @return string[] +function vim.opt.undodir:get()end + +-- `'undofile'` `'udf'` boolean (default off) +-- local to buffer +-- When on, Vim automatically saves undo history to an undo file when +-- writing a buffer to a file, and restores undo history from the same +-- file on buffer read. +-- The directory where the undo file is stored is specified by `'undodir'` . +-- For more information about this feature see |undo-persistence|. +-- The undo file is not read when `'undoreload'` causes the buffer from +-- before a reload to be saved for undo. +-- When `'undofile'` is turned off the undo file is NOT deleted. +--- @class vim.opt.undofile: vim.Option,boolean +--- @operator add: vim.opt.undofile +--- @operator sub: vim.opt.undofile +--- @operator pow: vim.opt.undofile +vim.opt.undofile = false +vim.opt.udf = vim.opt.undofile +--- @return boolean +function vim.opt.undofile:get()end + +-- `'undolevels'` `'ul'` number (default 1000) +-- global or local to buffer |global-local| +-- Maximum number of changes that can be undone. Since undo information +-- is kept in memory, higher numbers will cause more memory to be used. +-- Nevertheless, a single change can already use a large amount of memory. +-- Set to 0 for Vi compatibility: One level of undo and "u" undoes +-- itself: > +-- set ul=0 +-- < But you can also get Vi compatibility by including the `'u'` flag in +-- `'cpoptions'` , and still be able to use CTRL-R to repeat undo. +-- Also see |undo-two-ways|. +-- Set to -1 for no undo at all. You might want to do this only for the +-- current buffer: > +-- setlocal ul=-1 +-- < This helps when you run out of memory for a single change. +-- +-- The local value is set to -123456 when the global value is to be used. +-- +-- Also see |clear-undo|. +--- @class vim.opt.undolevels: vim.Option,number +--- @operator add: vim.opt.undolevels +--- @operator sub: vim.opt.undolevels +--- @operator pow: vim.opt.undolevels +vim.opt.undolevels = 1000 +vim.opt.ul = vim.opt.undolevels +--- @return number +function vim.opt.undolevels:get()end + +-- `'undoreload'` `'ur'` number (default 10000) +-- global +-- Save the whole buffer for undo when reloading it. This applies to the +-- ":e!" command and reloading for when the buffer changed outside of +-- Vim. |FileChangedShell| +-- The save only happens when this option is negative or when the number +-- of lines is smaller than the value of this option. +-- Set this option to zero to disable undo for a reload. +-- +-- When saving undo for a reload, any undo file is not read. +-- +-- Note that this causes the whole buffer to be stored in memory. Set +-- this option to a lower value if you run out of memory. +--- @class vim.opt.undoreload: vim.Option,number +--- @operator add: vim.opt.undoreload +--- @operator sub: vim.opt.undoreload +--- @operator pow: vim.opt.undoreload +vim.opt.undoreload = 10000 +vim.opt.ur = vim.opt.undoreload +--- @return number +function vim.opt.undoreload:get()end + +-- `'updatecount'` `'uc'` number (default: 200) +-- global +-- After typing this many characters the swap file will be written to +-- disk. When zero, no swap file will be created at all (see chapter on +-- recovery |crash-recovery|). `'updatecount'` is set to zero by starting +-- Vim with the "-n" option, see |startup|. When editing in readonly +-- mode this option will be initialized to 10000. +-- The swapfile can be disabled per buffer with |`'swapfile'` |. +-- When `'updatecount'` is set from zero to non-zero, swap files are +-- created for all buffers that have `'swapfile'` set. When `'updatecount'` +-- is set to zero, existing swap files are not deleted. +-- This option has no meaning in buffers where |`'buftype'` | is "nofile" +-- or "nowrite". +--- @class vim.opt.updatecount: vim.Option,number +--- @operator add: vim.opt.updatecount +--- @operator sub: vim.opt.updatecount +--- @operator pow: vim.opt.updatecount +vim.opt.updatecount = 200 +vim.opt.uc = vim.opt.updatecount +--- @return number +function vim.opt.updatecount:get()end + +-- `'updatetime'` `'ut'` number (default 4000) +-- global +-- If this many milliseconds nothing is typed the swap file will be +-- written to disk (see |crash-recovery|). Also used for the +-- |CursorHold| autocommand event. +--- @class vim.opt.updatetime: vim.Option,number +--- @operator add: vim.opt.updatetime +--- @operator sub: vim.opt.updatetime +--- @operator pow: vim.opt.updatetime +vim.opt.updatetime = 4000 +vim.opt.ut = vim.opt.updatetime +--- @return number +function vim.opt.updatetime:get()end + +-- `'varsofttabstop'` `'vsts'` string (default "") +-- local to buffer +-- A list of the number of spaces that a counts for while editing, +-- such as inserting a or using . It "feels" like variable- +-- width s are being inserted, while in fact a mixture of spaces +-- and s is used. Tab widths are separated with commas, with the +-- final value applying to all subsequent tabs. +-- +-- For example, when editing assembly language files where statements +-- start in the 9th column and comments in the 41st, it may be useful +-- to use the following: > +-- :set varsofttabstop=8,32,8 +-- < This will set soft tabstops with 8 and 8 + 32 spaces, and 8 more +-- for every column thereafter. +-- +-- Note that the value of |`'softtabstop'` | will be ignored while +-- `'varsofttabstop'` is set. +--- @class vim.opt.varsofttabstop: vim.Option,string[] +--- @operator add: vim.opt.varsofttabstop +--- @operator sub: vim.opt.varsofttabstop +--- @operator pow: vim.opt.varsofttabstop +vim.opt.varsofttabstop = "" +vim.opt.vsts = vim.opt.varsofttabstop +--- @return string[] +function vim.opt.varsofttabstop:get()end + +-- `'vartabstop'` `'vts'` string (default "") +-- local to buffer +-- A list of the number of spaces that a in the file counts for, +-- separated by commas. Each value corresponds to one tab, with the +-- final value applying to all subsequent tabs. For example: > +-- :set vartabstop=4,20,10,8 +-- < This will make the first tab 4 spaces wide, the second 20 spaces, +-- the third 10 spaces, and all following tabs 8 spaces. +-- +-- Note that the value of |`'tabstop'` | will be ignored while `'vartabstop'` +-- is set. +--- @class vim.opt.vartabstop: vim.Option,string[] +--- @operator add: vim.opt.vartabstop +--- @operator sub: vim.opt.vartabstop +--- @operator pow: vim.opt.vartabstop +vim.opt.vartabstop = "" +vim.opt.vts = vim.opt.vartabstop +--- @return string[] +function vim.opt.vartabstop:get()end + +-- `'verbose'` `'vbs'` number (default 0) +-- global +-- Sets the verbosity level. Also set by |-V| and |:verbose|. +-- +-- Tracing of options in Lua scripts is activated at level 1; Lua scripts +-- are not traced with verbose=0, for performance. +-- +-- If greater than or equal to a given level, Nvim produces the following +-- messages: +-- +-- Level Messages ~ +-- ---------------------------------------------------------------------- +-- 1 Lua assignments to options, mappings, etc. +-- 2 When a file is ":source"'ed, or |shada| file is read or written. +-- 3 UI info, terminal capabilities. +-- 4 Shell commands. +-- 5 Every searched tags file and include file. +-- 8 Files for which a group of autocommands is executed. +-- 9 Executed autocommands. +-- 11 Finding items in a path. +-- 12 Vimscript function calls. +-- 13 When an exception is thrown, caught, finished, or discarded. +-- 14 Anything pending in a ":finally" clause. +-- 15 Ex commands from a script (truncated at 200 characters). +-- 16 Ex commands. +-- +-- If `'verbosefile'` is set then the verbose messages are not displayed. +--- @class vim.opt.verbose: vim.Option,number +--- @operator add: vim.opt.verbose +--- @operator sub: vim.opt.verbose +--- @operator pow: vim.opt.verbose +vim.opt.verbose = 0 +vim.opt.vbs = vim.opt.verbose +--- @return number +function vim.opt.verbose:get()end + +-- `'verbosefile'` `'vfile'` string (default empty) +-- global +-- When not empty all messages are written in a file with this name. +-- When the file exists messages are appended. +-- Writing to the file ends when Vim exits or when `'verbosefile'` is made +-- empty. Writes are buffered, thus may not show up for some time. +-- Setting `'verbosefile'` to a new value is like making it empty first. +-- The difference with |:redir| is that verbose messages are not +-- displayed when `'verbosefile'` is set. +--- @class vim.opt.verbosefile: vim.Option,string +--- @operator add: vim.opt.verbosefile +--- @operator sub: vim.opt.verbosefile +--- @operator pow: vim.opt.verbosefile +vim.opt.verbosefile = "" +vim.opt.vfile = vim.opt.verbosefile +--- @return string +function vim.opt.verbosefile:get()end + +-- `'viewdir'` `'vdir'` string (default: "$XDG_STATE_HOME/nvim/view//") +-- global +-- Name of the directory where to store files for |:mkview|. +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +--- @class vim.opt.viewdir: vim.Option,string +--- @operator add: vim.opt.viewdir +--- @operator sub: vim.opt.viewdir +--- @operator pow: vim.opt.viewdir +vim.opt.viewdir = "/home/runner/.local/state/nvim/view//" +vim.opt.vdir = vim.opt.viewdir +--- @return string +function vim.opt.viewdir:get()end + +-- `'viewoptions'` `'vop'` string (default: "folds,cursor,curdir") +-- global +-- Changes the effect of the |:mkview| command. It is a comma-separated +-- list of words. Each word enables saving and restoring something: +-- word save and restore ~ +-- cursor cursor position in file and in window +-- curdir local current directory, if set with |:lcd| +-- folds manually created folds, opened/closed folds and local +-- fold options +-- options options and mappings local to a window or buffer (not +-- global values for local options) +-- localoptions same as "options" +-- slash |deprecated| Always enabled. Uses "/" in filenames. +-- unix |deprecated| Always enabled. Uses "\n" line endings. +--- @class vim.opt.viewoptions: vim.Option,string[] +--- @operator add: vim.opt.viewoptions +--- @operator sub: vim.opt.viewoptions +--- @operator pow: vim.opt.viewoptions +vim.opt.viewoptions = "folds,cursor,curdir" +vim.opt.vop = vim.opt.viewoptions +--- @return string[] +function vim.opt.viewoptions:get()end + +--- @class vim.opt.viminfo: vim.Option,string[] +--- @operator add: vim.opt.viminfo +--- @operator sub: vim.opt.viminfo +--- @operator pow: vim.opt.viminfo +vim.opt.viminfo = "" +vim.opt.vi = vim.opt.viminfo +--- @return string[] +function vim.opt.viminfo:get()end + +--- @class vim.opt.viminfofile: vim.Option,string[] +--- @operator add: vim.opt.viminfofile +--- @operator sub: vim.opt.viminfofile +--- @operator pow: vim.opt.viminfofile +vim.opt.viminfofile = "" +vim.opt.vif = vim.opt.viminfofile +--- @return string[] +function vim.opt.viminfofile:get()end + +-- `'virtualedit'` `'ve'` string (default "") +-- global or local to window |global-local| +-- A comma-separated list of these words: +-- block Allow virtual editing in Visual block mode. +-- insert Allow virtual editing in Insert mode. +-- all Allow virtual editing in all modes. +-- onemore Allow the cursor to move just past the end of the line +-- none When used as the local value, do not allow virtual +-- editing even when the global value is set. When used +-- as the global value, "none" is the same as "". +-- NONE Alternative spelling of "none". +-- +-- Virtual editing means that the cursor can be positioned where there is +-- no actual character. This can be halfway into a tab or beyond the end +-- of the line. Useful for selecting a rectangle in Visual mode and +-- editing a table. +-- "onemore" is not the same, it will only allow moving the cursor just +-- after the last character of the line. This makes some commands more +-- consistent. Previously the cursor was always past the end of the line +-- if the line was empty. But it is far from Vi compatible. It may also +-- break some plugins or Vim scripts. For example because |l| can move +-- the cursor after the last character. Use with care! +-- Using the `$` command will move to the last character in the line, not +-- past it. This may actually move the cursor to the left! +-- The `g$` command will move to the end of the screen line. +-- It doesn't make sense to combine "all" with "onemore", but you will +-- not get a warning for it. +-- When combined with other words, "none" is ignored. +--- @class vim.opt.virtualedit: vim.Option,string[] +--- @operator add: vim.opt.virtualedit +--- @operator sub: vim.opt.virtualedit +--- @operator pow: vim.opt.virtualedit +vim.opt.virtualedit = "" +vim.opt.ve = vim.opt.virtualedit +--- @return string[] +function vim.opt.virtualedit:get()end + +-- `'visualbell'` `'vb'` boolean (default off) +-- global +-- Use visual bell instead of beeping. Also see `'errorbells'` . +--- @class vim.opt.visualbell: vim.Option,boolean +--- @operator add: vim.opt.visualbell +--- @operator sub: vim.opt.visualbell +--- @operator pow: vim.opt.visualbell +vim.opt.visualbell = false +vim.opt.vb = vim.opt.visualbell +--- @return boolean +function vim.opt.visualbell:get()end + +-- `'warn'` boolean (default on) +-- global +-- Give a warning message when a shell command is used while the buffer +-- has been changed. +--- @class vim.opt.warn: vim.Option,boolean +--- @operator add: vim.opt.warn +--- @operator sub: vim.opt.warn +--- @operator pow: vim.opt.warn +vim.opt.warn = true +--- @return boolean +function vim.opt.warn:get()end + +-- `'whichwrap'` `'ww'` string (default: "b,s") +-- global +-- Allow specified keys that move the cursor left/right to move to the +-- previous/next line when the cursor is on the first/last character in +-- the line. Concatenate characters to allow this for these keys: +-- char key mode ~ +-- b Normal and Visual +-- s Normal and Visual +-- h "h" Normal and Visual (not recommended) +-- l "l" Normal and Visual (not recommended) +-- < Normal and Visual +-- > Normal and Visual +-- ~ "~" Normal +-- [ Insert and Replace +-- ] Insert and Replace +-- For example: > +-- :set ww=<,>,[,] +-- < allows wrap only when cursor keys are used. +-- When the movement keys are used in combination with a delete or change +-- operator, the also counts for a character. This makes "3h" +-- different from "3dh" when the cursor crosses the end of a line. This +-- is also true for "x" and "X", because they do the same as "dl" and +-- "dh". If you use this, you may also want to use the mapping +-- ":map X" to make backspace delete the character in front of the +-- cursor. +-- When `'l'` is included and it is used after an operator at the end of a +-- line (not an empty line) then it will not move to the next line. This +-- makes "dl", "cl", "yl" etc. work normally. +--- @class vim.opt.whichwrap: vim.Option,string[] +--- @operator add: vim.opt.whichwrap +--- @operator sub: vim.opt.whichwrap +--- @operator pow: vim.opt.whichwrap +vim.opt.whichwrap = "b,s" +vim.opt.ww = vim.opt.whichwrap +--- @return string[] +function vim.opt.whichwrap:get()end + +-- `'wildchar'` `'wc'` number (default: ) +-- global +-- Character you have to type to start wildcard expansion in the +-- command-line, as specified with `'wildmode'` . +-- More info here: |cmdline-completion|. +-- The character is not recognized when used inside a macro. See +-- `'wildcharm'` for that. +-- Some keys will not work, such as CTRL-C, and Enter. +-- Although `'wc'` is a number option, you can set it to a special key: > +-- :set wc= +-- < +--- @class vim.opt.wildchar: vim.Option,number +--- @operator add: vim.opt.wildchar +--- @operator sub: vim.opt.wildchar +--- @operator pow: vim.opt.wildchar +vim.opt.wildchar = 9 +vim.opt.wc = vim.opt.wildchar +--- @return number +function vim.opt.wildchar:get()end + +-- `'wildcharm'` `'wcm'` number (default: none (0)) +-- global +-- `'wildcharm'` works exactly like `'wildchar'` , except that it is +-- recognized when used inside a macro. You can find "spare" command-line +-- keys suitable for this option by looking at |ex-edit-index|. Normally +-- you'll never actually type `'wildcharm'` , just use it in mappings that +-- automatically invoke completion mode, e.g.: > +-- :set wcm= +-- :cnoremap ss so $vim/sessions/*.vim +-- < Then after typing :ss you can use CTRL-P & CTRL-N. +--- @class vim.opt.wildcharm: vim.Option,number +--- @operator add: vim.opt.wildcharm +--- @operator sub: vim.opt.wildcharm +--- @operator pow: vim.opt.wildcharm +vim.opt.wildcharm = 0 +vim.opt.wcm = vim.opt.wildcharm +--- @return number +function vim.opt.wildcharm:get()end + +-- `'wildignore'` `'wig'` string (default "") +-- global +-- A list of file patterns. A file that matches with one of these +-- patterns is ignored when expanding |wildcards|, completing file or +-- directory names, and influences the result of |expand()|, |glob()| and +-- |globpath()| unless a flag is passed to disable this. +-- The pattern is used like with |:autocmd|, see |autocmd-pattern|. +-- Also see `'suffixes'` . +-- Example: > +-- :set wildignore=.obj +-- < The use of |:set+=| and |:set-=| is preferred when adding or removing +-- a pattern from the list. This avoids problems when a future version +-- uses another default. +--- @class vim.opt.wildignore: vim.Option,string[] +--- @operator add: vim.opt.wildignore +--- @operator sub: vim.opt.wildignore +--- @operator pow: vim.opt.wildignore +vim.opt.wildignore = "" +vim.opt.wig = vim.opt.wildignore +--- @return string[] +function vim.opt.wildignore:get()end + +-- `'wildignorecase'` `'wic'` boolean (default off) +-- global +-- When set case is ignored when completing file names and directories. +-- Has no effect when `'fileignorecase'` is set. +-- Does not apply when the shell is used to expand wildcards, which +-- happens when there are special characters. +--- @class vim.opt.wildignorecase: vim.Option,boolean +--- @operator add: vim.opt.wildignorecase +--- @operator sub: vim.opt.wildignorecase +--- @operator pow: vim.opt.wildignorecase +vim.opt.wildignorecase = false +vim.opt.wic = vim.opt.wildignorecase +--- @return boolean +function vim.opt.wildignorecase:get()end + +-- `'wildmenu'` `'wmnu'` boolean (default on) +-- global +-- When `'wildmenu'` is on, command-line completion operates in an enhanced +-- mode. On pressing `'wildchar'` (usually ) to invoke completion, +-- the possible matches are shown. +-- When `'wildoptions'` contains "pum", then the completion matches are +-- shown in a popup menu. Otherwise they are displayed just above the +-- command line, with the first match highlighted (overwriting the status +-- line, if there is one). +-- Keys that show the previous/next match, such as or +-- CTRL-P/CTRL-N, cause the highlight to move to the appropriate match. +-- `'wildmode'` must specify "full": "longest" and "list" do not start +-- `'wildmenu'` mode. You can check the current mode with |wildmenumode()|. +-- The menu is cancelled when a key is hit that is not used for selecting +-- a completion. +-- +-- While the menu is active these keys have special meanings: +-- +-- CTRL-Y - accept the currently selected match and stop +-- completion. +-- CTRL-E - end completion, go back to what was there before +-- selecting a match. +-- - select previous/next match (like CTRL-P/CTRL-N) +-- - in filename/menu name completion: move into a +-- subdirectory or submenu. +-- - in menu completion, when the cursor is just after a +-- dot: move into a submenu. +-- - in filename/menu name completion: move up into +-- parent directory or parent menu. +-- +-- If you want and to move the cursor instead of selecting +-- a different match, use this: > +-- :cnoremap +-- :cnoremap +-- < +-- |hl-WildMenu| highlights the current match. +--- @class vim.opt.wildmenu: vim.Option,boolean +--- @operator add: vim.opt.wildmenu +--- @operator sub: vim.opt.wildmenu +--- @operator pow: vim.opt.wildmenu +vim.opt.wildmenu = true +vim.opt.wmnu = vim.opt.wildmenu +--- @return boolean +function vim.opt.wildmenu:get()end + +-- `'wildmode'` `'wim'` string (default: "full") +-- global +-- Completion mode that is used for the character specified with +-- `'wildchar'` . It is a comma-separated list of up to four parts. Each +-- part specifies what to do for each consecutive use of `'wildchar'` . The +-- first part specifies the behavior for the first use of `'wildchar'` , +-- The second part for the second use, etc. +-- +-- Each part consists of a colon separated list consisting of the +-- following possible values: +-- "" Complete only the first match. +-- "full" Complete the next full match. After the last match, +-- the original string is used and then the first match +-- again. Will also start `'wildmenu'` if it is enabled. +-- "longest" Complete till longest common string. If this doesn't +-- result in a longer string, use the next part. +-- "list" When more than one match, list all matches. +-- "lastused" When completing buffer names and more than one buffer +-- matches, sort buffers by time last used (other than +-- the current buffer). +-- When there is only a single match, it is fully completed in all cases. +-- +-- Examples of useful colon-separated values: +-- "longest:full" Like "longest", but also start `'wildmenu'` if it is +-- enabled. Will not complete to the next full match. +-- "list:full" When more than one match, list all matches and +-- complete first match. +-- "list:longest" When more than one match, list all matches and +-- complete till longest common string. +-- "list:lastused" When more than one buffer matches, list all matches +-- and sort buffers by time last used (other than the +-- current buffer). +-- +-- Examples: > +-- :set wildmode=full +-- < Complete first full match, next match, etc. (the default) > +-- :set wildmode=longest,full +-- < Complete longest common string, then each full match > +-- :set wildmode=list:full +-- < List all matches and complete each full match > +-- :set wildmode=list,full +-- < List all matches without completing, then each full match > +-- :set wildmode=longest,list +-- < Complete longest common string, then list alternatives. +-- More info here: |cmdline-completion|. +--- @class vim.opt.wildmode: vim.Option,string[] +--- @operator add: vim.opt.wildmode +--- @operator sub: vim.opt.wildmode +--- @operator pow: vim.opt.wildmode +vim.opt.wildmode = "full" +vim.opt.wim = vim.opt.wildmode +--- @return string[] +function vim.opt.wildmode:get()end + +-- `'wildoptions'` `'wop'` string (default "pum,tagfile") +-- global +-- A list of words that change how |cmdline-completion| is done. +-- The following values are supported: +-- fuzzy Use |fuzzy-matching| to find completion matches. When +-- this value is specified, wildcard expansion will not +-- be used for completion. The matches will be sorted by +-- the "best match" rather than alphabetically sorted. +-- This will find more matches than the wildcard +-- expansion. Currently fuzzy matching based completion +-- is not supported for file and directory names and +-- instead wildcard expansion is used. +-- pum Display the completion matches using the popup menu +-- in the same style as the |ins-completion-menu|. +-- tagfile When using CTRL-D to list matching tags, the kind of +-- tag and the file of the tag is listed. Only one match +-- is displayed per line. Often used tag kinds are: +-- d #define +-- f function +--- @class vim.opt.wildoptions: vim.Option,string[] +--- @operator add: vim.opt.wildoptions +--- @operator sub: vim.opt.wildoptions +--- @operator pow: vim.opt.wildoptions +vim.opt.wildoptions = "pum,tagfile" +vim.opt.wop = vim.opt.wildoptions +--- @return string[] +function vim.opt.wildoptions:get()end + +-- `'winaltkeys'` `'wak'` string (default "menu") +-- global +-- {only used in Win32} +-- Some GUI versions allow the access to menu entries by using the ALT +-- key in combination with a character that appears underlined in the +-- 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. +-- 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 +-- shortcut key, will be handled by the windowing system. Other +-- keys can be mapped. +-- If the menu is disabled by excluding `'m'` from `'guioptions'` , the ALT +-- key is never used for the menu. +-- This option is not used for ; on Win32. +--- @class vim.opt.winaltkeys: vim.Option,string +--- @operator add: vim.opt.winaltkeys +--- @operator sub: vim.opt.winaltkeys +--- @operator pow: vim.opt.winaltkeys +vim.opt.winaltkeys = "menu" +vim.opt.wak = vim.opt.winaltkeys +--- @return string +function vim.opt.winaltkeys:get()end + +-- `'winbar'` `'wbr'` string (default empty) +-- global or local to window |global-local| +-- When non-empty, this option enables the window bar and determines its +-- contents. The window bar is a bar that's shown at the top of every +-- window with it enabled. The value of `'winbar'` is evaluated like with +-- `'statusline'` . +-- +-- When changing something that is used in `'winbar'` that does not trigger +-- it to be updated, use |:redrawstatus|. +-- +-- Floating windows do not use the global value of `'winbar'` . The +-- window-local value of `'winbar'` must be set for a floating window to +-- have a window bar. +-- +-- This option cannot be set in a modeline when `'modelineexpr'` is off. +--- @class vim.opt.winbar: vim.Option,string +--- @operator add: vim.opt.winbar +--- @operator sub: vim.opt.winbar +--- @operator pow: vim.opt.winbar +vim.opt.winbar = "" +vim.opt.wbr = vim.opt.winbar +--- @return string +function vim.opt.winbar:get()end + +-- `'winblend'` `'winbl'` number (default 0) +-- local to window +-- Enables pseudo-transparency for a floating window. Valid values are in +-- the range of 0 for fully opaque window (disabled) to 100 for fully +-- transparent background. Values between 0-30 are typically most useful. +-- +-- UI-dependent. Works best with RGB colors. `'termguicolors'` +--- @class vim.opt.winblend: vim.Option,number +--- @operator add: vim.opt.winblend +--- @operator sub: vim.opt.winblend +--- @operator pow: vim.opt.winblend +vim.opt.winblend = 0 +vim.opt.winbl = vim.opt.winblend +--- @return number +function vim.opt.winblend:get()end + +-- `'window'` `'wi'` number (default screen height - 1) +-- global +-- Window height used for |CTRL-F| and |CTRL-B| when there is only one +-- window and the value is smaller than `'lines'` minus one. The screen +-- 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. +-- Note: Do not confuse this with the height of the Vim window, use +-- `'lines'` for that. +--- @class vim.opt.window: vim.Option,number +--- @operator add: vim.opt.window +--- @operator sub: vim.opt.window +--- @operator pow: vim.opt.window +vim.opt.window = 23 +vim.opt.wi = vim.opt.window +--- @return number +function vim.opt.window:get()end + +-- `'winfixheight'` `'wfh'` boolean (default off) +-- local to window +-- 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|. +-- The height may be changed anyway when running out of room. +--- @class vim.opt.winfixheight: vim.Option,boolean +--- @operator add: vim.opt.winfixheight +--- @operator sub: vim.opt.winfixheight +--- @operator pow: vim.opt.winfixheight +vim.opt.winfixheight = false +vim.opt.wfh = vim.opt.winfixheight +--- @return boolean +function vim.opt.winfixheight:get()end + +-- `'winfixwidth'` `'wfw'` boolean (default off) +-- local to window +-- Keep the window width when windows are opened or closed and +-- `'equalalways'` is set. Also for |CTRL-W_=|. +-- The width may be changed anyway when running out of room. +--- @class vim.opt.winfixwidth: vim.Option,boolean +--- @operator add: vim.opt.winfixwidth +--- @operator sub: vim.opt.winfixwidth +--- @operator pow: vim.opt.winfixwidth +vim.opt.winfixwidth = false +vim.opt.wfw = vim.opt.winfixwidth +--- @return boolean +function vim.opt.winfixwidth:get()end + +-- `'winheight'` `'wh'` number (default 1) +-- global +-- Minimal number of lines for the current window. This is not a hard +-- minimum, Vim will use fewer lines if there is not enough room. If the +-- focus goes to a window that is smaller, its size is increased, at the +-- cost of the height of other windows. +-- Set `'winheight'` to a small number for normal editing. +-- Set it to 999 to make the current window fill most of the screen. +-- Other windows will be only `'winminheight'` high. This has the drawback +-- that ":all" will create only two windows. To avoid "vim -o 1 2 3 4" +-- to create only two windows, set the option after startup is done, +-- using the |VimEnter| event: > +-- au VimEnter * set winheight=999 +-- < Minimum value is 1. +-- The height is not adjusted after one of the commands that change the +-- height of the current window. +-- `'winheight'` applies to the current window. Use `'winminheight'` to set +-- the minimal height for other windows. +--- @class vim.opt.winheight: vim.Option,number +--- @operator add: vim.opt.winheight +--- @operator sub: vim.opt.winheight +--- @operator pow: vim.opt.winheight +vim.opt.winheight = 1 +vim.opt.wh = vim.opt.winheight +--- @return number +function vim.opt.winheight:get()end + +-- `'winhighlight'` `'winhl'` string (default empty) +-- local to window +-- Window-local highlights. Comma-delimited list of highlight +-- |group-name| pairs "{hl-from}:{hl-to},..." where each {hl-from} is +-- a |highlight-groups| item to be overridden by {hl-to} group in +-- the window. +-- +-- Note: highlight namespaces take precedence over `'winhighlight'` . +-- See |nvim_win_set_hl_ns()| and |nvim_set_hl()|. +-- +-- Highlights of vertical separators are determined by the window to the +-- left of the separator. The `'tabline'` highlight of a tabpage is +-- decided by the last-focused window of the tabpage. Highlights of +-- the popupmenu are determined by the current window. Highlights in the +-- message area cannot be overridden. +-- +-- Example: show a different color for non-current windows: > +-- set winhighlight=Normal:MyNormal,NormalNC:MyNormalNC +-- < +--- @class vim.opt.winhighlight: vim.Option,table +--- @operator add: vim.opt.winhighlight +--- @operator sub: vim.opt.winhighlight +--- @operator pow: vim.opt.winhighlight +vim.opt.winhighlight = "" +vim.opt.winhl = vim.opt.winhighlight +--- @return table +function vim.opt.winhighlight:get()end + +-- `'winminheight'` `'wmh'` number (default 1) +-- global +-- The minimal height of a window, when it's not the current window. +-- This is a hard minimum, windows will never become smaller. +-- When set to zero, windows may be "squashed" to zero lines (i.e. just a +-- status bar) if necessary. They will return to at least one line when +-- they become active (since the cursor has to have somewhere to go.) +-- Use `'winheight'` to set the minimal height of the current window. +-- This option is only checked when making a window smaller. Don't use a +-- large number, it will cause errors when opening more than a few +-- windows. A value of 0 to 3 is reasonable. +--- @class vim.opt.winminheight: vim.Option,number +--- @operator add: vim.opt.winminheight +--- @operator sub: vim.opt.winminheight +--- @operator pow: vim.opt.winminheight +vim.opt.winminheight = 1 +vim.opt.wmh = vim.opt.winminheight +--- @return number +function vim.opt.winminheight:get()end + +-- `'winminwidth'` `'wmw'` number (default 1) +-- global +-- The minimal width of a window, when it's not the current window. +-- This is a hard minimum, windows will never become smaller. +-- When set to zero, windows may be "squashed" to zero columns (i.e. just +-- a vertical separator) if necessary. They will return to at least one +-- line when they become active (since the cursor has to have somewhere +-- to go.) +-- Use `'winwidth'` to set the minimal width of the current window. +-- This option is only checked when making a window smaller. Don't use a +-- large number, it will cause errors when opening more than a few +-- windows. A value of 0 to 12 is reasonable. +--- @class vim.opt.winminwidth: vim.Option,number +--- @operator add: vim.opt.winminwidth +--- @operator sub: vim.opt.winminwidth +--- @operator pow: vim.opt.winminwidth +vim.opt.winminwidth = 1 +vim.opt.wmw = vim.opt.winminwidth +--- @return number +function vim.opt.winminwidth:get()end + +-- `'winwidth'` `'wiw'` number (default 20) +-- global +-- Minimal number of columns for the current window. This is not a hard +-- minimum, Vim will use fewer columns if there is not enough room. If +-- the current window is smaller, its size is increased, at the cost of +-- the width of other windows. Set it to 999 to make the current window +-- always fill the screen. Set it to a small number for normal editing. +-- The width is not adjusted after one of the commands to change the +-- width of the current window. +-- `'winwidth'` applies to the current window. Use `'winminwidth'` to set +-- the minimal width for other windows. +--- @class vim.opt.winwidth: vim.Option,number +--- @operator add: vim.opt.winwidth +--- @operator sub: vim.opt.winwidth +--- @operator pow: vim.opt.winwidth +vim.opt.winwidth = 20 +vim.opt.wiw = vim.opt.winwidth +--- @return number +function vim.opt.winwidth:get()end + +-- `'wrap'` boolean (default on) +-- local to window +-- This option changes how text is displayed. It doesn't change the text +-- in the buffer, see `'textwidth'` for that. +-- When on, lines longer than the width of the window will wrap and +-- displaying continues on the next line. When off lines will not wrap +-- and only part of long lines will be displayed. When the cursor is +-- moved to a part that is not shown, the screen will scroll +-- horizontally. +-- The line will be broken in the middle of a word if necessary. See +-- `'linebreak'` to get the break at a word boundary. +-- To make scrolling horizontally a bit more useful, try this: > +-- :set sidescroll=5 +-- :set listchars+=precedes:<,extends:> +-- < See `'sidescroll'` , `'listchars'` and |wrap-off|. +-- This option can't be set from a |modeline| when the `'diff'` option is +-- on. +--- @class vim.opt.wrap: vim.Option,boolean +--- @operator add: vim.opt.wrap +--- @operator sub: vim.opt.wrap +--- @operator pow: vim.opt.wrap +vim.opt.wrap = true +--- @return boolean +function vim.opt.wrap:get()end + +-- `'wrapmargin'` `'wm'` number (default 0) +-- local to buffer +-- Number of characters from the right window border where wrapping +-- starts. When typing text beyond this limit, an will be inserted +-- and inserting continues on the next line. +-- Options that add a margin, such as `'number'` and `'foldcolumn'` , cause +-- the text width to be further reduced. +-- When `'textwidth'` is non-zero, this option is not used. +-- See also `'formatoptions'` and |ins-textwidth|. +--- @class vim.opt.wrapmargin: vim.Option,number +--- @operator add: vim.opt.wrapmargin +--- @operator sub: vim.opt.wrapmargin +--- @operator pow: vim.opt.wrapmargin +vim.opt.wrapmargin = 0 +vim.opt.wm = vim.opt.wrapmargin +--- @return number +function vim.opt.wrapmargin:get()end + +-- `'wrapscan'` `'ws'` boolean (default on) +-- global +-- Searches wrap around the end of the file. Also applies to |]s| and +-- |[s|, searching for spelling mistakes. +--- @class vim.opt.wrapscan: vim.Option,boolean +--- @operator add: vim.opt.wrapscan +--- @operator sub: vim.opt.wrapscan +--- @operator pow: vim.opt.wrapscan +vim.opt.wrapscan = true +vim.opt.ws = vim.opt.wrapscan +--- @return boolean +function vim.opt.wrapscan:get()end + +-- `'write'` boolean (default on) +-- global +-- Allows writing files. When not set, writing a file is not allowed. +-- Can be used for a view-only mode, where modifications to the text are +-- still allowed. Can be reset with the |-m| or |-M| command line +-- argument. Filtering text is still possible, even though this requires +-- writing a temporary file. +--- @class vim.opt.write: vim.Option,boolean +--- @operator add: vim.opt.write +--- @operator sub: vim.opt.write +--- @operator pow: vim.opt.write +vim.opt.write = true +--- @return boolean +function vim.opt.write:get()end + +-- `'writeany'` `'wa'` boolean (default off) +-- global +-- Allows writing to any file with no need for "!" override. +--- @class vim.opt.writeany: vim.Option,boolean +--- @operator add: vim.opt.writeany +--- @operator sub: vim.opt.writeany +--- @operator pow: vim.opt.writeany +vim.opt.writeany = false +vim.opt.wa = vim.opt.writeany +--- @return boolean +function vim.opt.writeany:get()end + +-- `'writebackup'` `'wb'` boolean (default on) +-- global +-- Make a backup before overwriting a file. The backup is removed after +-- the file was successfully written, unless the `'backup'` option is +-- also on. +-- WARNING: Switching this option off means that when Vim fails to write +-- your buffer correctly and then, for whatever reason, Vim exits, you +-- lose both the original file and what you were writing. Only reset +-- this option if your file system is almost full and it makes the write +-- fail (and make sure not to exit Vim until the write was successful). +-- See |backup-table| for another explanation. +-- When the `'backupskip'` pattern matches, a backup is not made anyway. +-- Depending on `'backupcopy'` the backup is a new file or the original +-- file renamed (and a new file is written). +--- @class vim.opt.writebackup: vim.Option,boolean +--- @operator add: vim.opt.writebackup +--- @operator sub: vim.opt.writebackup +--- @operator pow: vim.opt.writebackup +vim.opt.writebackup = true +vim.opt.wb = vim.opt.writebackup +--- @return boolean +function vim.opt.writebackup:get()end + +--- @class vim.opt.writedelay: vim.Option,number +--- @operator add: vim.opt.writedelay +--- @operator sub: vim.opt.writedelay +--- @operator pow: vim.opt.writedelay +vim.opt.writedelay = 0 +vim.opt.wd = vim.opt.writedelay +--- @return number +function vim.opt.writedelay:get()end + +---@type table +vim.go = {} + +---@type table +vim.bo = {} + +---@type table +vim.wo = {} + +---@type vim.go | vim.wo | vim.bo +vim.o = {} + +---@class vim.opt +vim.opt = {} + +---@type vim.opt +vim.opt_global = {} + +---@type vim.opt +vim.opt_local = {} + +---@class vim.Option +local Option = {} + +function Option:append(right) end +function Option:prepend(right) end +function Option:remove(right) end + diff --git a/bundle/neodev.nvim/types/nightly/options.lua b/bundle/neodev.nvim/types/nightly/options.lua new file mode 100644 index 000000000..9fdd2fb1d --- /dev/null +++ b/bundle/neodev.nvim/types/nightly/options.lua @@ -0,0 +1,4307 @@ +---@meta + +---@class vim.go +vim.go = {} + +vim.go.aleph = 224 +vim.go.al = vim.go.aleph +-- `'allowrevins'` `'ari'` boolean (default off) +-- global +-- 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'` . +vim.go.allowrevins = false +vim.go.ari = vim.go.allowrevins +-- `'ambiwidth'` `'ambw'` string (default: "single") +-- global +-- Tells Vim what to do with characters with East Asian Width Class +-- Ambiguous (such as Euro, Registered Sign, Copyright Sign, Greek +-- letters, Cyrillic letters). +-- +-- There are currently two possible values: +-- "single": Use the same width as characters in US-ASCII. This is +-- expected by most users. +-- "double": Use twice the width of ASCII characters. +-- +-- The value "double" cannot be used if `'listchars'` or `'fillchars'` +-- contains a character that would be double width. These errors may +-- also be given when calling setcellwidths(). +-- +-- The values are overruled for characters specified with +-- |setcellwidths()|. +-- +-- There are a number of CJK fonts for which the width of glyphs for +-- those characters are solely based on how many octets they take in +-- legacy/traditional CJK encodings. In those encodings, Euro, +-- Registered sign, Greek/Cyrillic letters are represented by two octets, +-- therefore those fonts have "wide" glyphs for them. This is also +-- true of some line drawing characters used to make tables in text +-- file. Therefore, when a CJK font is used for GUI Vim or +-- Vim is running inside a terminal (emulators) that uses a CJK font +-- (or Vim is run inside an xterm invoked with "-cjkwidth" option.), +-- this option should be set to "double" to match the width perceived +-- by Vim with the width of glyphs in the font. Perhaps it also has +-- to be set to "double" under CJK MS-Windows when the system locale is +-- set to one of CJK locales. See Unicode Standard Annex #11 +-- (https://www.unicode.org/reports/tr11). +vim.go.ambiwidth = "single" +vim.go.ambw = vim.go.ambiwidth +-- `'arabicshape'` `'arshape'` boolean (default on) +-- global +-- When on and `'termbidi'` is off, the required visual character +-- corrections that need to take place for displaying the Arabic language +-- take effect. Shaping, in essence, gets enabled; the term is a broad +-- one which encompasses: +-- a) the changing/morphing of characters based on their location +-- within a word (initial, medial, final and stand-alone). +-- b) the enabling of the ability to compose characters +-- c) the enabling of the required combining of some characters +-- When disabled the display shows each character's true stand-alone +-- form. +-- Arabic is a complex language which requires other settings, for +-- further details see |arabic.txt|. +vim.go.arabicshape = true +vim.go.arshape = vim.go.arabicshape +-- `'autochdir'` `'acd'` boolean (default off) +-- global +-- When on, Vim will change the current working directory whenever you +-- open a file, switch buffers, delete a buffer or open/close a window. +-- It will change to the directory containing the file which was opened +-- or selected. When a buffer has no name it also has no directory, thus +-- the current directory won't change when navigating to it. +-- Note: When this option is on some plugins may not work. +vim.go.autochdir = false +vim.go.acd = vim.go.autochdir +-- `'autowrite'` `'aw'` boolean (default off) +-- global +-- Write the contents of the file, if it has been modified, on each +-- `:next`, `:rewind`, `:last`, `:first`, `:previous`, `:stop`, +-- `:suspend`, `:tag`, `:!`, `:make`, CTRL-] and CTRL-^ command; and when +-- a `:buffer`, CTRL-O, CTRL-I, '{A-Z0-9}, or `{A-Z0-9} command takes one +-- to another file. +-- A buffer is not written if it becomes hidden, e.g. when `'bufhidden'` is +-- set to "hide" and `:next` is used. +-- Note that for some commands the `'autowrite'` option is not used, see +-- `'autowriteall'` for that. +-- Some buffers will not be written, specifically when `'buftype'` is +-- "nowrite", "nofile", "terminal" or "prompt". +-- USE WITH CARE: If you make temporary changes to a buffer that you +-- don't want to be saved this option may cause it to be saved anyway. +-- Renaming the buffer with ":file {name}" may help avoid this. +vim.go.autowrite = false +vim.go.aw = vim.go.autowrite +-- `'autowriteall'` `'awa'` boolean (default off) +-- global +-- Like `'autowrite'` , but also used for commands ":edit", ":enew", ":quit", +-- ":qall", ":exit", ":xit", ":recover" and closing the Vim window. +-- Setting this option also implies that Vim behaves like `'autowrite'` has +-- been set. +vim.go.autowriteall = false +vim.go.awa = vim.go.autowriteall +-- `'background'` `'bg'` string (default "dark") +-- global +-- When set to "dark" or "light", adjusts the default color groups for +-- that background type. The |TUI| or other UI sets this on startup +-- (triggering |OptionSet|) if it can detect the background color. +-- +-- 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. +-- +-- 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. +-- +-- Normally this option would be set in the vimrc file. Possibly +-- depending on the terminal name. Example: > +-- :if $TERM ==# "xterm" +-- : set background=dark +-- :endif +-- < When this option is set, the default settings for the highlight groups +-- will change. To use other settings, place ":highlight" commands AFTER +-- the setting of the `'background'` option. +-- This option is also used in the "$VIMRUNTIME/syntax/syntax.vim" file +-- to select the colors for syntax highlighting. After changing this +-- option, you must load syntax.vim again to see the result. This can be +-- done with ":syntax on". +vim.go.background = "dark" +vim.go.bg = vim.go.background +-- `'backspace'` `'bs'` string (default "indent,eol,start") +-- global +-- Influences the working of , , CTRL-W and CTRL-U in Insert +-- mode. This is a list of items, separated by commas. Each item allows +-- a way to backspace over something: +-- value effect ~ +-- indent allow backspacing over autoindent +-- eol allow backspacing over line breaks (join lines) +-- start allow backspacing over the start of insert; CTRL-W and CTRL-U +-- stop once at the start of insert. +-- nostop like start, except CTRL-W and CTRL-U do not stop at the start of +-- insert. +-- +-- When the value is empty, Vi compatible backspacing is used, none of +-- the ways mentioned for the items above are possible. +-- +-- For backwards compatibility with version 5.4 and earlier: +-- value effect ~ +-- 0 same as ":set backspace=" (Vi compatible) +-- 1 same as ":set backspace=indent,eol" +-- 2 same as ":set backspace=indent,eol,start" +-- 3 same as ":set backspace=indent,eol,nostop" +vim.go.backspace = "indent,eol,start" +vim.go.bs = vim.go.backspace +-- `'backup'` `'bk'` boolean (default off) +-- global +-- Make a backup before overwriting a file. Leave it around after the +-- file has been successfully written. If you do not want to keep the +-- backup file, but you do want a backup while the file is being +-- written, reset this option and set the `'writebackup'` option (this is +-- the default). If you do not want a backup file at all reset both +-- options (use this if your file system is almost full). See the +-- |backup-table| for more explanations. +-- When the `'backupskip'` pattern matches, a backup is not made anyway. +-- When `'patchmode'` is set, the backup may be renamed to become the +-- oldest version of a file. +vim.go.backup = false +vim.go.bk = vim.go.backup +-- `'backupdir'` `'bdir'` string (default ".,$XDG_STATE_HOME/nvim/backup//") +-- global +-- List of directories for the backup file, separated with commas. +-- - The backup file will be created in the first directory in the list +-- where this is possible. If none of the directories exist Nvim will +-- attempt to create the last directory in the list. +-- - Empty means that no backup file will be created (`'patchmode'` is +-- impossible!). Writing may fail because of this. +-- - A directory "." means to put the backup file in the same directory +-- as the edited file. +-- - A directory starting with "./" (or ".\" for MS-Windows) means to put +-- the backup file relative to where the edited file is. The leading +-- "." is replaced with the path name of the edited file. +-- ("." inside a directory name has no special meaning). +-- - Spaces after the comma are ignored, other spaces are considered part +-- of the directory name. To have a space at the start of a directory +-- name, precede it with a backslash. +-- - To include a comma in a directory name precede it with a backslash. +-- - A directory name may end in an `'/'` . +-- - For Unix and Win32, if a directory ends in two path separators "//", +-- the swap file name will be built from the complete path to the file +-- with all path separators changed to percent `'%'` signs. This will +-- ensure file name uniqueness in the backup directory. +-- On Win32, it is also possible to end with "\\". However, When a +-- separating comma is following, you must use "//", since "\\" will +-- include the comma in the file name. Therefore it is recommended to +-- use `'//'` , instead of `'\\'` . +-- - Environment variables are expanded |:set_env|. +-- - Careful with `'\'` characters, type one before a space, type two to +-- get one in the option (see |option-backslash|), for example: > +-- :set bdir=c:\\tmp,\ dir\\,with\\,commas,\\\ dir\ with\ spaces +-- < - For backwards compatibility with Vim version 3.0 a `'>'` at the start +-- of the option is removed. +-- See also `'backup'` and `'writebackup'` options. +-- If you want to hide your backup files on Unix, consider this value: > +-- :set backupdir=./.backup,~/.backup,.,/tmp +-- < You must create a ".backup" directory in each directory and in your +-- home directory for this to work properly. +-- The use of |:set+=| and |:set-=| is preferred when adding or removing +-- directories from the list. This avoids problems when a future version +-- uses another default. +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +vim.go.backupdir = ".,/home/runner/.local/state/nvim/backup//" +vim.go.bdir = vim.go.backupdir +-- `'backupext'` `'bex'` string (default "~") +-- global +-- String which is appended to a file name to make the name of the +-- backup file. The default is quite unusual, because this avoids +-- accidentally overwriting existing files with a backup file. You might +-- prefer using ".bak", but make sure that you don't have files with +-- ".bak" that you want to keep. +-- Only normal file name characters can be used; "/\*?[|<>" are illegal. +-- +-- If you like to keep a lot of backups, you could use a BufWritePre +-- autocommand to change `'backupext'` just before writing the file to +-- include a timestamp. > +-- :au BufWritePre * let &bex = `'-'` .. strftime("%Y%b%d%X") .. `'~'` +-- < Use `'backupdir'` to put the backup in a different directory. +vim.go.backupext = "~" +vim.go.bex = vim.go.backupext +-- `'backupskip'` `'bsk'` string (default: "$TMPDIR/,$TEMP/*" +-- Unix: "/tmp/,$TMP/" +-- Mac: "/private/tmp/,$TMP/") +-- global +-- A list of file patterns. When one of the patterns matches with the +-- name of the file which is written, no backup file is created. Both +-- the specified file name and the full path name of the file are used. +-- The pattern is used like with |:autocmd|, see |autocmd-pattern|. +-- Watch out for special characters, see |option-backslash|. +-- When $TMPDIR, $TMP or $TEMP is not defined, it is not used for the +-- default value. "/tmp/*" is only used for Unix. +-- +-- WARNING: Not having a backup file means that when Vim fails to write +-- your buffer correctly and then, for whatever reason, Vim exits, you +-- lose both the original file and what you were writing. Only disable +-- backups if you don't care about losing the file. +-- +-- Note that environment variables are not expanded. If you want to use +-- $HOME you must expand it explicitly, e.g.: > +-- :let &backupskip = escape(expand(`'$HOME'` ), `'\'` ) .. `'/tmp/*'` +-- +-- < Note that the default also makes sure that "crontab -e" works (when a +-- backup would be made by renaming the original file crontab won't see +-- the newly created file). Also see `'backupcopy'` and |crontab|. +vim.go.backupskip = "/tmp/*" +vim.go.bsk = vim.go.backupskip +-- `'belloff'` `'bo'` string (default "all") +-- global +-- Specifies for which events the bell will not be rung. It is a comma- +-- separated list of items. For each item that is present, the bell +-- will be silenced. This is most useful to specify specific events in +-- insert mode to be silenced. +-- +-- item meaning when present ~ +-- all All events. +-- backspace When hitting or and deleting results in an +-- error. +-- cursor Fail to move around using the cursor keys or +-- / in |Insert-mode|. +-- complete Error occurred when using |i_CTRL-X_CTRL-K| or +-- |i_CTRL-X_CTRL-T|. +-- copy Cannot copy char from insert mode using |i_CTRL-Y| or +-- |i_CTRL-E|. +-- ctrlg Unknown Char after in Insert mode. +-- error Other Error occurred (e.g. try to join last line) +-- (mostly used in |Normal-mode| or |Cmdline-mode|). +-- esc hitting in |Normal-mode|. +-- hangul Ignored. +-- lang Calling the beep module for Lua/Mzscheme/TCL. +-- mess No output available for |g<|. +-- showmatch Error occurred for `'showmatch'` function. +-- operator Empty region error |cpo-E|. +-- register Unknown register after in |Insert-mode|. +-- shell Bell from shell output |:!|. +-- spell Error happened on spell suggest. +-- wildmode More matches in |cmdline-completion| available +-- (depends on the `'wildmode'` setting). +-- +-- This is most useful to fine tune when in Insert mode the bell should +-- be rung. For Normal mode and Ex commands, the bell is often rung to +-- indicate that an error occurred. It can be silenced by adding the +-- "error" keyword. +vim.go.belloff = "all" +vim.go.bo = vim.go.belloff +-- `'breakat'` `'brk'` string (default " ^I!@*-+;:,./?") +-- global +-- This option lets you choose which characters might cause a line +-- break if `'linebreak'` is on. Only works for ASCII characters. +vim.go.breakat = " \t!@*-+;:,./?" +vim.go.brk = vim.go.breakat +-- `'browsedir'` `'bsdir'` string (default: "last") +-- global +-- Which directory to use for the file browser: +-- last Use same directory as with last file browser, where a +-- file was opened or saved. +-- buffer Use the directory of the related buffer. +-- current Use the current directory. +-- {path} Use the specified directory +vim.go.browsedir = "" +vim.go.bsdir = vim.go.browsedir +-- `'casemap'` `'cmp'` string (default: "internal,keepascii") +-- global +-- Specifies details about changing the case of letters. It may contain +-- these words, separated by a comma: +-- internal Use internal case mapping functions, the current +-- locale does not change the case mapping. When +-- "internal" is omitted, the towupper() and towlower() +-- system library functions are used when available. +-- keepascii For the ASCII characters (0x00 to 0x7f) use the US +-- case mapping, the current locale is not effective. +-- This probably only matters for Turkish. +vim.go.casemap = "internal,keepascii" +vim.go.cmp = vim.go.casemap +-- `'cdhome'` `'cdh'` boolean (default: off) +-- global +-- When on, |:cd|, |:tcd| and |:lcd| without an argument changes the +-- current working directory to the |$HOME| directory like in Unix. +-- When off, those commands just print the current directory name. +-- On Unix this option has no effect. +vim.go.cdhome = false +vim.go.cdh = vim.go.cdhome +-- `'cdpath'` `'cd'` string (default: equivalent to $CDPATH or ",,") +-- global +-- This is a list of directories which will be searched when using the +-- |:cd|, |:tcd| and |:lcd| commands, provided that the directory being +-- searched for has a relative path, not an absolute part starting with +-- "/", "./" or "../", the `'cdpath'` option is not used then. +-- The `'cdpath'` option's value has the same form and semantics as +-- |`'path'` |. Also see |file-searching|. +-- The default value is taken from $CDPATH, with a "," prepended to look +-- in the current directory first. +-- If the default value taken from $CDPATH is not what you want, include +-- a modified version of the following command in your vimrc file to +-- override it: > +-- :let &cdpath = `','` .. substitute(substitute($CDPATH, '[, ]', `'\\\0'` , `'g'` ), `':'` , `','` , `'g'` ) +-- < This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +-- (parts of `'cdpath'` can be passed to the shell to expand file names). +vim.go.cdpath = ",," +vim.go.cd = vim.go.cdpath +-- `'cedit'` string (default: CTRL-F) +-- global +-- The key used in Command-line Mode to open the command-line window. +-- Only non-printable keys are allowed. +-- The key can be specified as a single character, but it is difficult to +-- type. The preferred way is to use the <> notation. Examples: > +-- :exe "set cedit=\" +-- :exe "set cedit=\" +-- < |Nvi| also has this option, but it only uses the first character. +-- See |cmdwin|. +vim.go.cedit = "\6" +-- `'charconvert'` `'ccv'` string (default "") +-- global +-- An expression that is used for character encoding conversion. It is +-- evaluated when a file that is to be read or has been written has a +-- different encoding from what is desired. +-- `'charconvert'` is not used when the internal iconv() function is +-- supported and is able to do the conversion. Using iconv() is +-- preferred, because it is much faster. +-- `'charconvert'` is not used when reading stdin |--|, because there is no +-- file to convert from. You will have to save the text in a file first. +-- The expression must return zero, false or an empty string for success, +-- non-zero or true for failure. +-- See |encoding-names| for possible encoding names. +-- Additionally, names given in `'fileencodings'` and `'fileencoding'` are +-- used. +-- Conversion between "latin1", "unicode", "ucs-2", "ucs-4" and "utf-8" +-- is done internally by Vim, `'charconvert'` is not used for this. +-- Also used for Unicode conversion. +-- Example: > +-- set charconvert=CharConvert() +-- fun CharConvert() +-- system("recode " +-- \ .. v:charconvert_from .. ".." .. v:charconvert_to +-- \ .. " <" .. v:fname_in .. " >" .. v:fname_out) +-- return v:shell_error +-- endfun +-- < The related Vim variables are: +-- v:charconvert_from name of the current encoding +-- v:charconvert_to name of the desired encoding +-- v:fname_in name of the input file +-- v:fname_out name of the output file +-- Note that v:fname_in and v:fname_out will never be the same. +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +vim.go.charconvert = "" +vim.go.ccv = vim.go.charconvert +-- `'clipboard'` `'cb'` string (default "") +-- global +-- This option is a list of comma-separated names. +-- These names are recognized: +-- +-- +-- unnamed When included, Vim will use the clipboard register "*" +-- for all yank, delete, change and put operations which +-- would normally go to the unnamed register. When a +-- register is explicitly specified, it will always be +-- used regardless of whether "unnamed" is in `'clipboard'` +-- or not. The clipboard register can always be +-- explicitly accessed using the "* notation. Also see +-- |clipboard|. +-- +-- +-- unnamedplus A variant of the "unnamed" flag which uses the +-- clipboard register "+" (|quoteplus|) instead of +-- register "*" for all yank, delete, change and put +-- operations which would normally go to the unnamed +-- register. When "unnamed" is also included to the +-- option, yank and delete operations (but not put) +-- will additionally copy the text into register +-- "*". See |clipboard|. +vim.go.clipboard = "" +vim.go.cb = vim.go.clipboard +-- `'cmdheight'` `'ch'` number (default 1) +-- global or local to tab page +-- Number of screen lines to use for the command-line. Helps avoiding +-- |hit-enter| prompts. +-- The value of this option is stored with the tab page, so that each tab +-- page can have a different value. +-- +-- When `'cmdheight'` is zero, there is no command-line unless it is being +-- used. The command-line will cover the last line of the screen when +-- shown. +-- +-- WARNING: `cmdheight=0` is considered experimental. Expect some +-- unwanted behaviour. Some `'shortmess'` flags and similar +-- mechanism might fail to take effect, causing unwanted hit-enter +-- prompts. Some informative messages, both from Nvim itself and +-- plugins, will not be displayed. +vim.go.cmdheight = 1 +vim.go.ch = vim.go.cmdheight +-- `'cmdwinheight'` `'cwh'` number (default 7) +-- global +-- Number of screen lines to use for the command-line window. |cmdwin| +vim.go.cmdwinheight = 7 +vim.go.cwh = vim.go.cmdwinheight +-- `'columns'` `'co'` number (default 80 or terminal width) +-- global +-- Number of columns of the screen. Normally this is set by the terminal +-- initialization and does not have to be set by hand. +-- When Vim is running in the GUI or in a resizable window, setting this +-- option will cause the window size to be changed. When you only want +-- to use the size for the GUI, put the command in your |ginit.vim| file. +-- When you set this option and Vim is unable to change the physical +-- number of columns of the display, the display may be messed up. For +-- the GUI it is always possible and Vim limits the number of columns to +-- what fits on the screen. You can use this command to get the widest +-- window possible: > +-- :set columns=9999 +-- < Minimum value is 12, maximum value is 10000. +vim.go.columns = 80 +vim.go.co = vim.go.columns +vim.go.compatible = false +vim.go.cp = vim.go.compatible +-- `'completeopt'` `'cot'` string (default: "menu,preview") +-- global +-- A comma-separated list of options for Insert mode completion +-- |ins-completion|. The supported values are: +-- +-- menu Use a popup menu to show the possible completions. The +-- menu is only shown when there is more than one match and +-- sufficient colors are available. |ins-completion-menu| +-- +-- menuone Use the popup menu also when there is only one match. +-- Useful when there is additional information about the +-- match, e.g., what file it comes from. +-- +-- longest Only insert the longest common text of the matches. If +-- the menu is displayed you can use CTRL-L to add more +-- characters. Whether case is ignored depends on the kind +-- of completion. For buffer text the `'ignorecase'` option is +-- used. +-- +-- preview Show extra information about the currently selected +-- completion in the preview window. Only works in +-- combination with "menu" or "menuone". +-- +-- noinsert Do not insert any text for a match until the user selects +-- a match from the menu. Only works in combination with +-- "menu" or "menuone". No effect if "longest" is present. +-- +-- noselect Do not select a match in the menu, force the user to +-- select one from the menu. Only works in combination with +-- "menu" or "menuone". +vim.go.completeopt = "menu,preview" +vim.go.cot = vim.go.completeopt +-- `'completeslash'` `'csl'` string (default: "") +-- local to buffer +-- {only for MS-Windows} +-- When this option is set it overrules `'shellslash'` for completion: +-- - When this option is set to "slash", a forward slash is used for path +-- completion in insert mode. This is useful when editing HTML tag, or +-- Makefile with `'noshellslash'` on MS-Windows. +-- - When this option is set to "backslash", backslash is used. This is +-- useful when editing a batch file with `'shellslash'` set on MS-Windows. +-- - When this option is empty, same character is used as for +-- `'shellslash'` . +-- For Insert mode completion the buffer-local value is used. For +-- command line completion the global value is used. +vim.go.completeslash = "" +vim.go.csl = vim.go.completeslash +-- `'confirm'` `'cf'` boolean (default off) +-- 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 +-- 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| +-- command. +-- Also see the |confirm()| function and the `'v'` flag in `'guioptions'` . +vim.go.confirm = false +vim.go.cf = vim.go.confirm +-- `'cpoptions'` `'cpo'` string (default: "aABceFs_") +-- global +-- A sequence of single character flags. When a character is present +-- this indicates Vi-compatible behavior. This is used for things where +-- not being Vi-compatible is mostly or sometimes preferred. +-- `'cpoptions'` stands for "compatible-options". +-- Commas can be added for readability. +-- To avoid problems with flags that are added in the future, use the +-- "+=" and "-=" feature of ":set" |add-option-flags|. +-- +-- contains behavior ~ +-- +-- a When included, a ":read" command with a file name +-- argument will set the alternate file name for the +-- current window. +-- +-- A When included, a ":write" command with a file name +-- argument will set the alternate file name for the +-- current window. +-- +-- b "\|" in a ":map" command is recognized as the end of +-- the map command. The `'\'` is included in the mapping, +-- the text after the `'|'` is interpreted as the next +-- command. Use a CTRL-V instead of a backslash to +-- include the `'|'` in the mapping. Applies to all +-- mapping, abbreviation, menu and autocmd commands. +-- See also |map_bar|. +-- +-- B A backslash has no special meaning in mappings, +-- abbreviations, user commands and the "to" part of the +-- menu commands. Remove this flag to be able to use a +-- backslash like a CTRL-V. For example, the command +-- ":map X \" results in X being mapped to: +-- `'B'` included: "\^[" (^[ is a real ) +-- `'B'` excluded: "" (5 characters) +-- +-- c Searching continues at the end of any match at the +-- cursor position, but not further than the start of the +-- next line. When not present searching continues +-- one character from the cursor position. With `'c'` +-- "abababababab" only gets three matches when repeating +-- "/abab", without `'c'` there are five matches. +-- +-- C Do not concatenate sourced lines that start with a +-- backslash. See |line-continuation|. +-- +-- d Using "./" in the `'tags'` option doesn't mean to use +-- the tags file relative to the current file, but the +-- tags file in the current directory. +-- +-- D Can't use CTRL-K to enter a digraph after Normal mode +-- commands with a character argument, like |r|, |f| and +-- |t|. +-- +-- e When executing a register with ":@r", always add a +-- to the last line, also when the register is not +-- linewise. If this flag is not present, the register +-- is not linewise and the last line does not end in a +-- , then the last line is put on the command-line +-- and can be edited before hitting . +-- +-- E It is an error when using "y", "d", "c", "g~", "gu" or +-- "gU" on an Empty region. The operators only work when +-- at least one character is to be operated on. Example: +-- This makes "y0" fail in the first column. +-- +-- f When included, a ":read" command with a file name +-- argument will set the file name for the current buffer, +-- if the current buffer doesn't have a file name yet. +-- +-- F When included, a ":write" command with a file name +-- argument will set the file name for the current +-- buffer, if the current buffer doesn't have a file name +-- yet. Also see |cpo-P|. +-- +-- i When included, interrupting the reading of a file will +-- leave it modified. +-- +-- I When moving the cursor up or down just after inserting +-- indent for `'autoindent'` , do not delete the indent. +-- +-- J A |sentence| has to be followed by two spaces after +-- the `'.'` , `'!'` or `'?'` . A is not recognized as +-- white space. +-- +-- K Don't wait for a key code to complete when it is +-- halfway through a mapping. This breaks mapping +-- when only part of the second has been +-- read. It enables cancelling the mapping by typing +-- . +-- +-- l Backslash in a [] range in a search pattern is taken +-- literally, only "\]", "\^", "\-" and "\\" are special. +-- See |/[]| +-- `'l'` included: "/[ \t]" finds , `'\'` and `'t'` +-- `'l'` excluded: "/[ \t]" finds and +-- +-- L When the `'list'` option is set, `'wrapmargin'` , +-- `'textwidth'` , `'softtabstop'` and Virtual Replace mode +-- (see |gR|) count a as two characters, instead of +-- the normal behavior of a . +-- +-- m When included, a showmatch will always wait half a +-- second. When not included, a showmatch will wait half +-- a second or until a character is typed. |`'showmatch'` | +-- +-- M When excluded, "%" matching will take backslashes into +-- account. Thus in "( \( )" and "\( ( \)" the outer +-- parenthesis match. When included "%" ignores +-- backslashes, which is Vi compatible. +-- +-- n When included, the column used for `'number'` and +-- `'relativenumber'` will also be used for text of wrapped +-- lines. +-- +-- o Line offset to search command is not remembered for +-- next search. +-- +-- O Don't complain if a file is being overwritten, even +-- when it didn't exist when editing it. This is a +-- protection against a file unexpectedly created by +-- someone else. Vi didn't complain about this. +-- +-- p Vi compatible Lisp indenting. When not present, a +-- slightly better algorithm is used. +-- +-- P When included, a ":write" command that appends to a +-- file will set the file name for the current buffer, if +-- the current buffer doesn't have a file name yet and +-- the `'F'` flag is also included |cpo-F|. +-- +-- q When joining multiple lines leave the cursor at the +-- position where it would be when joining two lines. +-- +-- r Redo ("." command) uses "/" to repeat a search +-- command, instead of the actually used search string. +-- +-- R Remove marks from filtered lines. Without this flag +-- marks are kept like |:keepmarks| was used. +-- +-- s Set buffer options when entering the buffer for the +-- first time. This is like it is in Vim version 3.0. +-- And it is the default. If not present the options are +-- set when the buffer is created. +-- +-- S Set buffer options always when entering a buffer +-- (except `'readonly'` , `'fileformat'` , `'filetype'` and +-- `'syntax'` ). This is the (most) Vi compatible setting. +-- The options are set to the values in the current +-- buffer. When you change an option and go to another +-- buffer, the value is copied. Effectively makes the +-- buffer options global to all buffers. +-- +-- `'s'` `'S'` copy buffer options +-- no no when buffer created +-- yes no when buffer first entered (default) +-- X yes each time when buffer entered (vi comp.) +-- +-- t Search pattern for the tag command is remembered for +-- "n" command. Otherwise Vim only puts the pattern in +-- the history for search pattern, but doesn't change the +-- last used search pattern. +-- +-- u Undo is Vi compatible. See |undo-two-ways|. +-- +-- v Backspaced characters remain visible on the screen in +-- Insert mode. Without this flag the characters are +-- erased from the screen right away. With this flag the +-- screen newly typed text overwrites backspaced +-- characters. +-- +-- W Don't overwrite a readonly file. When omitted, ":w!" +-- overwrites a readonly file, if possible. +-- +-- x on the command-line executes the command-line. +-- The default in Vim is to abandon the command-line, +-- because normally aborts a command. |c_| +-- +-- X When using a count with "R" the replaced text is +-- deleted only once. Also when repeating "R" with "." +-- and a count. +-- +-- y A yank command can be redone with ".". Think twice if +-- you really want to use this, it may break some +-- plugins, since most people expect "." to only repeat a +-- change. +-- +-- Z When using "w!" while the `'readonly'` option is set, +-- don't reset `'readonly'` . +-- +-- ! When redoing a filter command, use the last used +-- external command, whatever it was. Otherwise the last +-- used -filter- command is used. +-- +-- $ When making a change to one line, don't redisplay the +-- line, but put a `'$'` at the end of the changed text. +-- The changed text will be overwritten when you type the +-- new text. The line is redisplayed if you type any +-- command that moves the cursor from the insertion +-- point. +-- +-- % Vi-compatible matching is done for the "%" command. +-- Does not recognize "#if", "#endif", etc. +-- Does not recognize "/*" and "*/". +-- Parens inside single and double quotes are also +-- counted, causing a string that contains a paren to +-- disturb the matching. For example, in a line like +-- "if (strcmp("foo(", s))" the first paren does not +-- match the last one. When this flag is not included, +-- parens inside single and double quotes are treated +-- specially. When matching a paren outside of quotes, +-- everything inside quotes is ignored. When matching a +-- paren inside quotes, it will find the matching one (if +-- there is one). This works very well for C programs. +-- This flag is also used for other features, such as +-- C-indenting. +-- +-- + When included, a ":write file" command will reset the +-- `'modified'` flag of the buffer, even though the buffer +-- itself may still be different from its file. +-- +-- > When appending to a register, put a line break before +-- the appended text. +-- +-- ; When using |,| or |;| to repeat the last |t| search +-- and the cursor is right in front of the searched +-- character, the cursor won't move. When not included, +-- the cursor would skip over it and jump to the +-- following occurrence. +-- +-- _ When using |cw| on a word, do not include the +-- whitespace following the word in the motion. +vim.go.cpoptions = "aABceFs_" +vim.go.cpo = vim.go.cpoptions +-- `'debug'` string (default "") +-- global +-- These values can be used: +-- msg Error messages that would otherwise be omitted will be given +-- anyway. +-- throw Error messages that would otherwise be omitted will be given +-- anyway and also throw an exception and set |v:errmsg|. +-- beep A message will be given when otherwise only a beep would be +-- produced. +-- The values can be combined, separated by a comma. +-- "msg" and "throw" are useful for debugging `'foldexpr'` , `'formatexpr'` or +-- `'indentexpr'` . +vim.go.debug = "" +-- `'delcombine'` `'deco'` boolean (default off) +-- global +-- If editing Unicode and this option is set, backspace and Normal mode +-- "x" delete each combining character on its own. When it is off (the +-- default) the character along with its combining characters are +-- deleted. +-- Note: When `'delcombine'` is set "xx" may work differently from "2x"! +-- +-- This is useful for Arabic, Hebrew and many other languages where one +-- may have combining characters overtop of base characters, and want +-- to remove only the combining ones. +vim.go.delcombine = false +vim.go.deco = vim.go.delcombine +-- `'diffexpr'` `'dex'` string (default "") +-- global +-- 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. +vim.go.diffexpr = "" +vim.go.dex = vim.go.diffexpr +-- `'diffopt'` `'dip'` string (default "internal,filler,closeoff") +-- global +-- Option settings for diff mode. It can consist of the following items. +-- All are optional. Items must be separated by a comma. +-- +-- filler Show filler lines, to keep the text +-- synchronized with a window that has inserted +-- lines at the same position. Mostly useful +-- when windows are side-by-side and `'scrollbind'` +-- is set. +-- +-- context:{n} Use a context of {n} lines between a change +-- and a fold that contains unchanged lines. +-- When omitted a context of six lines is used. +-- When using zero the context is actually one, +-- since folds require a line in between, also +-- for a deleted line. +-- See |fold-diff|. +-- +-- iblank Ignore changes where lines are all blank. Adds +-- the "-B" flag to the "diff" command if +-- `'diffexpr'` is empty. Check the documentation +-- of the "diff" command for what this does +-- exactly. +-- NOTE: the diff windows will get out of sync, +-- because no differences between blank lines are +-- taken into account. +-- +-- icase Ignore changes in case of text. "a" and "A" +-- are considered the same. Adds the "-i" flag +-- to the "diff" command if `'diffexpr'` is empty. +-- +-- iwhite Ignore changes in amount of white space. Adds +-- the "-b" flag to the "diff" command if +-- `'diffexpr'` is empty. Check the documentation +-- of the "diff" command for what this does +-- exactly. It should ignore adding trailing +-- white space, but not leading white space. +-- +-- iwhiteall Ignore all white space changes. Adds +-- the "-w" flag to the "diff" command if +-- `'diffexpr'` is empty. Check the documentation +-- of the "diff" command for what this does +-- exactly. +-- +-- iwhiteeol Ignore white space changes at end of line. +-- Adds the "-Z" flag to the "diff" command if +-- `'diffexpr'` is empty. Check the documentation +-- of the "diff" command for what this does +-- exactly. +-- +-- horizontal Start diff mode with horizontal splits (unless +-- explicitly specified otherwise). +-- +-- vertical Start diff mode with vertical splits (unless +-- explicitly specified otherwise). +-- +-- closeoff When a window is closed where `'diff'` is set +-- and there is only one window remaining in the +-- same tab page with `'diff'` set, execute +-- `:diffoff` in that window. This undoes a +-- `:diffsplit` command. +-- +-- hiddenoff Do not use diff mode for a buffer when it +-- becomes hidden. +-- +-- foldcolumn:{n} Set the `'foldcolumn'` option to {n} when +-- starting diff mode. Without this 2 is used. +-- +-- followwrap Follow the `'wrap'` option and leave as it is. +-- +-- internal Use the internal diff library. This is +-- ignored when `'diffexpr'` is set. +-- 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. +-- +-- linematch:{n} Enable a second stage diff on each generated +-- hunk in order to align lines. When the total +-- number of lines in a hunk exceeds {n}, the +-- second stage diff will not be performed as +-- very large hunks can cause noticeable lag. A +-- recommended setting is "linematch:60", as this +-- will enable alignment for a 2 buffer diff with +-- hunks of up to 30 lines each, or a 3 buffer +-- diff with hunks of up to 20 lines each. +-- +-- 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 +-- +-- Examples: > +-- :set diffopt=internal,filler,context:4 +-- :set diffopt= +-- :set diffopt=internal,filler,foldcolumn:3 +-- :set diffopt-=internal " do NOT use the internal diff parser +-- < +vim.go.diffopt = "internal,filler,closeoff" +vim.go.dip = vim.go.diffopt +-- `'digraph'` `'dg'` boolean (default off) +-- global +-- Enable the entering of digraphs in Insert mode with {char1} +-- {char2}. See |digraphs|. +vim.go.digraph = false +vim.go.dg = vim.go.digraph +-- `'directory'` `'dir'` string (default "$XDG_STATE_HOME/nvim/swap//") +-- global +-- List of directory names for the swap file, separated with commas. +-- +-- Possible items: +-- - The swap file will be created in the first directory where this is +-- possible. If it is not possible in any directory, but last +-- directory listed in the option does not exist, it is created. +-- - Empty means that no swap file will be used (recovery is +-- impossible!) and no |E303| error will be given. +-- - A directory "." means to put the swap file in the same directory as +-- the edited file. On Unix, a dot is prepended to the file name, so +-- it doesn't show in a directory listing. On MS-Windows the "hidden" +-- attribute is set and a dot prepended if possible. +-- - A directory starting with "./" (or ".\" for MS-Windows) means to put +-- the swap file relative to where the edited file is. The leading "." +-- is replaced with the path name of the edited file. +-- - For Unix and Win32, if a directory ends in two path separators "//", +-- the swap file name will be built from the complete path to the file +-- with all path separators replaced by percent `'%'` signs (including +-- the colon following the drive letter on Win32). This will ensure +-- file name uniqueness in the preserve directory. +-- On Win32, it is also possible to end with "\\". However, When a +-- separating comma is following, you must use "//", since "\\" will +-- include the comma in the file name. Therefore it is recommended to +-- use `'//'` , instead of `'\\'` . +-- - Spaces after the comma are ignored, other spaces are considered part +-- of the directory name. To have a space at the start of a directory +-- name, precede it with a backslash. +-- - To include a comma in a directory name precede it with a backslash. +-- - A directory name may end in an `':'` or `'/'` . +-- - Environment variables are expanded |:set_env|. +-- - Careful with `'\'` characters, type one before a space, type two to +-- get one in the option (see |option-backslash|), for example: > +-- :set dir=c:\\tmp,\ dir\\,with\\,commas,\\\ dir\ with\ spaces +-- < - For backwards compatibility with Vim version 3.0 a `'>'` at the start +-- of the option is removed. +-- +-- Editing the same file twice will result in a warning. Using "/tmp" on +-- is discouraged: if the system crashes you lose the swap file. And +-- others on the computer may be able to see the files. +-- Use |:set+=| and |:set-=| when adding or removing directories from the +-- list, this avoids problems if the Nvim default is changed. +-- +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +vim.go.directory = "/home/runner/.local/state/nvim/swap//" +vim.go.dir = vim.go.directory +-- `'display'` `'dy'` string (default "lastline") +-- global +-- Change the way text is displayed. This is a comma-separated list of +-- flags: +-- lastline When included, as much as possible of the last line +-- in a window will be displayed. "@@@" is put in the +-- last columns of the last screen line to indicate the +-- rest of the line is not displayed. +-- truncate Like "lastline", but "@@@" is displayed in the first +-- column of the last screen line. Overrules "lastline". +-- uhex Show unprintable characters hexadecimal as +-- instead of using ^C and ~C. +-- msgsep Obsolete flag. Allowed but takes no effect. |msgsep| +-- +-- When neither "lastline" nor "truncate" is included, a last line that +-- doesn't fit is replaced with "@" lines. +-- +-- The "@" character can be changed by setting the "lastline" item in +-- `'fillchars'` . The character is highlighted with |hl-NonText|. +vim.go.display = "lastline" +vim.go.dy = vim.go.display +-- `'eadirection'` `'ead'` string (default "both") +-- global +-- Tells when the `'equalalways'` option applies: +-- ver vertically, width of windows is not affected +-- hor horizontally, height of windows is not affected +-- both width and height of windows is affected +vim.go.eadirection = "both" +vim.go.ead = vim.go.eadirection +vim.go.edcompatible = false +vim.go.ed = vim.go.edcompatible +-- `'emoji'` `'emo'` boolean (default: on) +-- global +-- When on all Unicode emoji characters are considered to be full width. +-- This excludes "text emoji" characters, which are normally displayed as +-- single width. Unfortunately there is no good specification for this +-- and it has been determined on trial-and-error basis. Use the +-- |setcellwidths()| function to change the behavior. +vim.go.emoji = true +vim.go.emo = vim.go.emoji +-- `'encoding'` `'enc'` +-- String-encoding used internally and for |RPC| communication. +-- Always UTF-8. +-- +-- See `'fileencoding'` to control file-content encoding. +vim.go.encoding = "utf-8" +vim.go.enc = vim.go.encoding +-- `'equalalways'` `'ea'` boolean (default on) +-- global +-- When on, all the windows are automatically made the same size after +-- splitting or closing a window. This also happens the moment the +-- option is switched on. When off, splitting a window will reduce the +-- size of the current window and leave the other windows the same. When +-- closing a window the extra lines are given to the window next to it +-- (depending on `'splitbelow'` and `'splitright'` ). +-- When mixing vertically and horizontally split windows, a minimal size +-- is computed and some windows may be larger if there is room. The +-- `'eadirection'` option tells in which direction the size is affected. +-- Changing the height and width of a window can be avoided by setting +-- `'winfixheight'` and `'winfixwidth'` , respectively. +-- If a window size is specified when creating a new window sizes are +-- currently not equalized (it's complicated, but may be implemented in +-- the future). +vim.go.equalalways = true +vim.go.ea = vim.go.equalalways +-- `'errorbells'` `'eb'` boolean (default off) +-- global +-- Ring the bell (beep or screen flash) for error messages. This only +-- makes a difference for error messages, the bell will be used always +-- for a lot of errors without a message (e.g., hitting in Normal +-- mode). See `'visualbell'` to make the bell behave like a screen flash +-- or do nothing. See `'belloff'` to finetune when to ring the bell. +vim.go.errorbells = false +vim.go.eb = vim.go.errorbells +-- `'errorfile'` `'ef'` string (default: "errors.err") +-- global +-- Name of the errorfile for the QuickFix mode (see |:cf|). +-- When the "-q" command-line argument is used, `'errorfile'` is set to the +-- following argument. See |-q|. +-- NOT used for the ":make" command. See `'makeef'` for that. +-- Environment variables are expanded |:set_env|. +-- See |option-backslash| about including spaces and backslashes. +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +vim.go.errorfile = "errors.err" +vim.go.ef = vim.go.errorfile +-- `'eventignore'` `'ei'` string (default "") +-- global +-- A list of autocommand event names, which are to be ignored. +-- When set to "all" or when "all" is one of the items, all autocommand +-- events are ignored, autocommands will not be executed. +-- Otherwise this is a comma-separated list of event names. Example: > +-- :set ei=WinEnter,WinLeave +-- < +vim.go.eventignore = "" +vim.go.ei = vim.go.eventignore +-- `'exrc'` `'ex'` boolean (default off) +-- global +-- Automatically execute .nvim.lua, .nvimrc, and .exrc files in the +-- current directory, if the file is in the |trust| list. Use |:trust| to +-- manage trusted files. See also |vim.secure.read()|. +-- +-- Compare `'exrc'` to |editorconfig|: +-- - `'exrc'` can execute any code; editorconfig only specifies settings. +-- - `'exrc'` is Nvim-specific; editorconfig works in other editors. +-- +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +vim.go.exrc = false +vim.go.ex = vim.go.exrc +-- `'fileencodings'` `'fencs'` string (default: "ucs-bom,utf-8,default,latin1") +-- global +-- This is a list of character encodings considered when starting to edit +-- an existing file. When a file is read, Vim tries to use the first +-- mentioned character encoding. If an error is detected, the next one +-- in the list is tried. When an encoding is found that works, +-- `'fileencoding'` is set to it. If all fail, `'fileencoding'` is set to +-- an empty string, which means that UTF-8 is used. +-- WARNING: Conversion can cause loss of information! You can use +-- the |++bad| argument to specify what is done with characters +-- that can't be converted. +-- For an empty file or a file with only ASCII characters most encodings +-- will work and the first entry of `'fileencodings'` will be used (except +-- "ucs-bom", which requires the BOM to be present). If you prefer +-- another encoding use an BufReadPost autocommand event to test if your +-- preferred encoding is to be used. Example: > +-- au BufReadPost * if search(`'\S'` , `'w'` ) == 0 | +-- \ set fenc=iso-2022-jp | endif +-- < This sets `'fileencoding'` to "iso-2022-jp" if the file does not contain +-- non-blank characters. +-- When the |++enc| argument is used then the value of `'fileencodings'` is +-- not used. +-- Note that `'fileencodings'` is not used for a new file, the global value +-- of `'fileencoding'` is used instead. You can set it with: > +-- :setglobal fenc=iso-8859-2 +-- < This means that a non-existing file may get a different encoding than +-- an empty file. +-- The special value "ucs-bom" can be used to check for a Unicode BOM +-- (Byte Order Mark) at the start of the file. It must not be preceded +-- by "utf-8" or another Unicode encoding for this to work properly. +-- An entry for an 8-bit encoding (e.g., "latin1") should be the last, +-- because Vim cannot detect an error, thus the encoding is always +-- accepted. +-- The special value "default" can be used for the encoding from the +-- environment. It is useful when your environment uses a non-latin1 +-- encoding, such as Russian. +-- When a file contains an illegal UTF-8 byte sequence it won't be +-- recognized as "utf-8". You can use the |8g8| command to find the +-- illegal byte sequence. +-- WRONG VALUES: WHAT'S WRONG: +-- latin1,utf-8 "latin1" will always be used +-- utf-8,ucs-bom,latin1 BOM won't be recognized in an utf-8 +-- file +-- cp1250,latin1 "cp1250" will always be used +-- If `'fileencodings'` is empty, `'fileencoding'` is not modified. +-- See `'fileencoding'` for the possible values. +-- Setting this option does not have an effect until the next time a file +-- is read. +vim.go.fileencodings = "ucs-bom,utf-8,default,latin1" +vim.go.fencs = vim.go.fileencodings +-- `'fileformats'` `'ffs'` string (default: +-- Win32: "dos,unix", +-- Unix: "unix,dos") +-- global +-- This gives the end-of-line () formats that will be tried when +-- starting to edit a new buffer and when reading a file into an existing +-- buffer: +-- - When empty, the format defined with `'fileformat'` will be used +-- always. It is not set automatically. +-- - When set to one name, that format will be used whenever a new buffer +-- is opened. `'fileformat'` is set accordingly for that buffer. The +-- `'fileformats'` name will be used when a file is read into an existing +-- buffer, no matter what `'fileformat'` for that buffer is set to. +-- - When more than one name is present, separated by commas, automatic +-- detection will be done when reading a file. When starting to +-- edit a file, a check is done for the : +-- 1. If all lines end in , and `'fileformats'` includes "dos", +-- `'fileformat'` is set to "dos". +-- 2. If a is found and `'fileformats'` includes "unix", `'fileformat'` +-- is set to "unix". Note that when a is found without a +-- preceding , "unix" is preferred over "dos". +-- 3. If `'fileformat'` has not yet been set, and if a is found, and +-- if `'fileformats'` includes "mac", `'fileformat'` is set to "mac". +-- This means that "mac" is only chosen when: +-- "unix" is not present or no is found in the file, and +-- "dos" is not present or no is found in the file. +-- Except: if "unix" was chosen, but there is a before +-- the first , and there appear to be more s than s in +-- the first few lines, "mac" is used. +-- 4. If `'fileformat'` is still not set, the first name from +-- `'fileformats'` is used. +-- When reading a file into an existing buffer, the same is done, but +-- this happens like `'fileformat'` has been set appropriately for that +-- file only, the option is not changed. +-- When `'binary'` is set, the value of `'fileformats'` is not used. +-- +-- When Vim starts up with an empty buffer the first item is used. You +-- can overrule this by setting `'fileformat'` in your .vimrc. +-- +-- For systems with a Dos-like (), when reading files that +-- are ":source"ed and for vimrc files, automatic detection may be +-- done: +-- - When `'fileformats'` is empty, there is no automatic detection. Dos +-- format will be used. +-- - When `'fileformats'` is set to one or more names, automatic detection +-- is done. This is based on the first in the file: If there is a +-- in front of it, Dos format is used, otherwise Unix format is +-- used. +-- Also see |file-formats|. +vim.go.fileformats = "unix,dos" +vim.go.ffs = vim.go.fileformats +-- `'fileignorecase'` `'fic'` boolean (default on for systems where case in file +-- names is normally ignored) +-- global +-- When set case is ignored when using file names and directories. +-- See `'wildignorecase'` for only ignoring case when doing completion. +vim.go.fileignorecase = false +vim.go.fic = vim.go.fileignorecase +-- `'foldclose'` `'fcl'` string (default "") +-- global +-- When set to "all", a fold is closed when the cursor isn't in it and +-- its level is higher than `'foldlevel'` . Useful if you want folds to +-- automatically close when moving out of them. +vim.go.foldclose = "" +vim.go.fcl = vim.go.foldclose +-- `'foldlevelstart'` `'fdls'` number (default: -1) +-- global +-- Sets `'foldlevel'` when starting to edit another buffer in a window. +-- Useful to always start editing with all folds closed (value zero), +-- some folds closed (one) or no folds closed (99). +-- This is done before reading any modeline, thus a setting in a modeline +-- overrules this option. Starting to edit a file for |diff-mode| also +-- ignores this option and closes all folds. +-- It is also done before BufReadPre autocommands, to allow an autocmd to +-- overrule the `'foldlevel'` value for specific files. +-- When the value is negative, it is not used. +vim.go.foldlevelstart = -1 +vim.go.fdls = vim.go.foldlevelstart +-- `'foldopen'` `'fdo'` string (default: "block,hor,mark,percent,quickfix, +-- search,tag,undo") +-- global +-- Specifies for which type of commands folds will be opened, if the +-- command moves the cursor into a closed fold. It is a comma-separated +-- list of items. +-- NOTE: When the command is part of a mapping this option is not used. +-- Add the |zv| command to the mapping to get the same effect. +-- (rationale: the mapping may want to control opening folds itself) +-- +-- item commands ~ +-- all any +-- block "(", "{", "[[", "[{", etc. +-- hor horizontal movements: "l", "w", "fx", etc. +-- insert any command in Insert mode +-- jump far jumps: "G", "gg", etc. +-- mark jumping to a mark: "'m", CTRL-O, etc. +-- percent "%" +-- quickfix ":cn", ":crew", ":make", etc. +-- search search for a pattern: "/", "n", "*", "gd", etc. +-- (not for a search pattern in a ":" command) +-- Also for |[s| and |]s|. +-- tag jumping to a tag: ":ta", CTRL-T, etc. +-- undo undo or redo: "u" and CTRL-R +-- When a movement command is used for an operator (e.g., "dl" or "y%") +-- this option is not used. This means the operator will include the +-- whole closed fold. +-- Note that vertical movements are not here, because it would make it +-- very difficult to move onto a closed fold. +-- In insert mode the folds containing the cursor will always be open +-- when text is inserted. +-- To close folds you can re-apply `'foldlevel'` with the |zx| command or +-- set the `'foldclose'` option to "all". +vim.go.foldopen = "block,hor,mark,percent,quickfix,search,tag,undo" +vim.go.fdo = vim.go.foldopen +-- `'fsync'` `'fs'` boolean (default off) +-- global +-- When on, the OS function fsync() will be called after saving a file +-- (|:write|, |writefile()|, …), |swap-file|, |undo-persistence| and |shada-file|. +-- This flushes the file to disk, ensuring that it is safely written. +-- Slow on some systems: writing buffers, quitting Nvim, and other +-- operations may sometimes take a few seconds. +-- +-- Files are ALWAYS flushed (`'fsync'` is ignored) when: +-- - |CursorHold| event is triggered +-- - |:preserve| is called +-- - system signals low battery life +-- - Nvim exits abnormally +-- +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +vim.go.fsync = false +vim.go.fs = vim.go.fsync +-- `'gdefault'` `'gd'` boolean (default off) +-- global +-- When on, the ":substitute" flag `'g'` is default on. This means that +-- all matches in a line are substituted instead of one. When a `'g'` flag +-- is given to a ":substitute" command, this will toggle the substitution +-- of all or one match. See |complex-change|. +-- +-- command `'gdefault'` on `'gdefault'` off ~ +-- :s/// subst. all subst. one +-- :s///g subst. one subst. all +-- :s///gg subst. all subst. one +-- +-- DEPRECATED: Setting this option may break plugins that are not aware +-- of this option. Also, many users get confused that adding the /g flag +-- has the opposite effect of that it normally does. +vim.go.gdefault = false +vim.go.gd = vim.go.gdefault +-- `'grepformat'` `'gfm'` string (default "%f:%l:%m,%f:%l%m,%f %l%m") +-- global +-- Format to recognize for the ":grep" command output. +-- This is a scanf-like string that uses the same format as the +-- `'errorformat'` option: see |errorformat|. +vim.go.grepformat = "%f:%l:%m,%f:%l%m,%f %l%m" +vim.go.gfm = vim.go.grepformat +-- `'guicursor'` `'gcr'` string (default "n-v-c-sm:block,i-ci-ve:ver25,r-cr-o:hor20") +-- global +-- Configures the cursor style for each mode. Works in the GUI and many +-- terminals. See |tui-cursor-shape|. +-- +-- To disable cursor-styling, reset the option: > +-- :set guicursor= +-- +-- < To enable mode shapes, "Cursor" highlight, and blinking: > +-- :set guicursor=n-v-c:block,i-ci-ve:ver25,r-cr:hor20,o:hor50 +-- \,a:blinkwait700-blinkoff400-blinkon250-Cursor/lCursor +-- \,sm:block-blinkwait175-blinkoff150-blinkon175 +-- +-- < The option is a comma-separated list of parts. Each part consists of a +-- mode-list and an argument-list: +-- mode-list:argument-list,mode-list:argument-list,.. +-- The mode-list is a dash separated list of these modes: +-- n Normal mode +-- v Visual mode +-- ve Visual mode with `'selection'` "exclusive" (same as `'v'` , +-- if not specified) +-- o Operator-pending mode +-- i Insert mode +-- r Replace mode +-- c Command-line Normal (append) mode +-- ci Command-line Insert mode +-- cr Command-line Replace mode +-- sm showmatch in Insert mode +-- a all modes +-- The argument-list is a dash separated list of these arguments: +-- hor{N} horizontal bar, {N} percent of the character height +-- ver{N} vertical bar, {N} percent of the character width +-- block block cursor, fills the whole character +-- - Only one of the above three should be present. +-- - Default is "block" for each mode. +-- blinkwait{N} +-- blinkon{N} +-- blinkoff{N} +-- blink times for cursor: blinkwait is the delay before +-- the cursor starts blinking, blinkon is the time that +-- the cursor is shown and blinkoff is the time that the +-- cursor is not shown. Times are in msec. When one of +-- the numbers is zero, there is no blinking. E.g.: > +-- :set guicursor=n:blinkon0 +-- < - Default is "blinkon0" for each mode. +-- {group-name} +-- Highlight group that decides the color and font of the +-- cursor. +-- In the |TUI|: +-- - |inverse|/reverse and no group-name are interpreted +-- as "host-terminal default cursor colors" which +-- typically means "inverted bg and fg colors". +-- - |ctermfg| and |guifg| are ignored. +-- {group-name}/{group-name} +-- Two highlight group names, the first is used when +-- no language mappings are used, the other when they +-- are. |language-mapping| +-- +-- Examples of parts: +-- n-c-v:block-nCursor In Normal, Command-line and Visual mode, use a +-- block cursor with colors from the "nCursor" +-- highlight group +-- n-v-c-sm:block,i-ci-ve:ver25-Cursor,r-cr-o:hor20 +-- In Normal et al. modes, use a block cursor +-- with the default colors defined by the host +-- terminal. In Insert-likes modes, use +-- a vertical bar cursor with colors from +-- "Cursor" highlight group. In Replace-likes +-- modes, use a underline cursor with +-- default colors. +-- i-ci:ver30-iCursor-blinkwait300-blinkon200-blinkoff150 +-- In Insert and Command-line Insert mode, use a +-- 30% vertical bar cursor with colors from the +-- "iCursor" highlight group. Blink a bit +-- faster. +-- +-- The `'a'` mode is different. It will set the given argument-list for +-- all modes. It does not reset anything to defaults. This can be used +-- to do a common setting for all modes. For example, to switch off +-- blinking: "a:blinkon0" +-- +-- Examples of cursor highlighting: > +-- :highlight Cursor gui=reverse guifg=NONE guibg=NONE +-- :highlight Cursor gui=NONE guifg=bg guibg=fg +-- < +vim.go.guicursor = "n-v-c-sm:block,i-ci-ve:ver25,r-cr-o:hor20" +vim.go.gcr = vim.go.guicursor +-- `'guifont'` `'gfn'` string (default "") +-- global +-- This is a list of fonts which will be used for the GUI version of Vim. +-- In its simplest form the value is just one font name. When +-- the font cannot be found you will get an error message. To try other +-- font names a list can be specified, font names separated with commas. +-- The first valid font is used. +-- +-- Spaces after a comma are ignored. To include a comma in a font name +-- precede it with a backslash. Setting an option requires an extra +-- backslash before a space and a backslash. See also +-- |option-backslash|. For example: > +-- :set guifont=Screen15,\ 7x13,font\\,with\\,commas +-- < will make Vim try to use the font "Screen15" first, and if it fails it +-- will try to use "7x13" and then "font,with,commas" instead. +-- +-- If none of the fonts can be loaded, Vim will keep the current setting. +-- If an empty font list is given, Vim will try using other resource +-- settings (for X, it will use the Vim.font resource), and finally it +-- will try some builtin default which should always be there ("7x13" in +-- the case of X). The font names given should be "normal" fonts. Vim +-- will try to find the related bold and italic fonts. +-- +-- For Win32 and Mac OS: > +-- :set guifont=* +-- < will bring up a font requester, where you can pick the font you want. +-- +-- The font name depends on the GUI used. +-- +-- For Mac OSX you can use something like this: > +-- :set guifont=Monaco:h10 +-- < +-- Note that the fonts must be mono-spaced (all characters have the same +-- width). +-- +-- To preview a font on X11, you might be able to use the "xfontsel" +-- program. The "xlsfonts" program gives a list of all available fonts. +-- +-- For the Win32 GUI +-- - takes these options in the font name: +-- hXX - height is XX (points, can be floating-point) +-- wXX - width is XX (points, can be floating-point) +-- b - bold +-- i - italic +-- u - underline +-- s - strikeout +-- cXX - character set XX. Valid charsets are: ANSI, ARABIC, +-- BALTIC, CHINESEBIG5, DEFAULT, EASTEUROPE, GB2312, GREEK, +-- HANGEUL, HEBREW, JOHAB, MAC, OEM, RUSSIAN, SHIFTJIS, +-- SYMBOL, THAI, TURKISH, VIETNAMESE ANSI and BALTIC. +-- Normally you would use "cDEFAULT". +-- +-- Use a `':'` to separate the options. +-- - A `'_'` can be used in the place of a space, so you don't need to use +-- backslashes to escape the spaces. +-- - Examples: > +-- :set guifont=courier_new:h12:w5:b:cRUSSIAN +-- :set guifont=Andale_Mono:h7.5:w4.5 +-- < +vim.go.guifont = "" +vim.go.gfn = vim.go.guifont +-- `'guifontwide'` `'gfw'` string (default "") +-- global +-- Comma-separated list of fonts to be used for double-width characters. +-- The first font that can be loaded is used. +-- Note: The size of these fonts must be exactly twice as wide as the one +-- specified with `'guifont'` and the same height. +-- +-- When `'guifont'` has a valid font and `'guifontwide'` is empty Vim will +-- attempt to set `'guifontwide'` to a matching double-width font. +vim.go.guifontwide = "" +vim.go.gfw = vim.go.guifontwide +-- `'guioptions'` `'go'` string (default "egmrLT" (MS-Windows)) +-- global +-- This option only has an effect in the GUI version of Vim. It is a +-- sequence of letters which describes what components and options of the +-- GUI should be used. +-- To avoid problems with flags that are added in the future, use the +-- "+=" and "-=" feature of ":set" |add-option-flags|. +-- +-- Valid letters are as follows: +-- +-- `'a'` Autoselect: If present, then whenever VISUAL mode is started, +-- or the Visual area extended, Vim tries to become the owner of +-- the windowing system's global selection. This means that the +-- Visually highlighted text is available for pasting into other +-- applications as well as into Vim itself. When the Visual mode +-- ends, possibly due to an operation on the text, or when an +-- application wants to paste the selection, the highlighted text +-- is automatically yanked into the "* selection register. +-- Thus the selection is still available for pasting into other +-- applications after the VISUAL mode has ended. +-- If not present, then Vim won't become the owner of the +-- windowing system's global selection unless explicitly told to +-- by a yank or delete operation for the "* register. +-- The same applies to the modeless selection. +-- +-- `'P'` Like autoselect but using the "+ register instead of the "* +-- register. +-- +-- `'A'` Autoselect for the modeless selection. Like `'a'` , but only +-- applies to the modeless selection. +-- +-- `'guioptions'` autoselect Visual autoselect modeless ~ +-- "" - - +-- "a" yes yes +-- "A" - yes +-- "aA" yes yes +-- +-- +-- `'c'` Use console dialogs instead of popup dialogs for simple +-- choices. +-- +-- `'d'` Use dark theme variant if available. +-- +-- `'e'` Add tab pages when indicated with `'showtabline'` . +-- `'guitablabel'` can be used to change the text in the labels. +-- When `'e'` is missing a non-GUI tab pages line may be used. +-- The GUI tabs are only supported on some systems, currently +-- Mac OS/X and MS-Windows. +-- +-- `'i'` Use a Vim icon. +-- +-- `'m'` Menu bar is present. +-- +-- `'M'` The system menu "$VIMRUNTIME/menu.vim" is not sourced. Note +-- that this flag must be added in the vimrc file, before +-- switching on syntax or filetype recognition (when the |gvimrc| +-- file is sourced the system menu has already been loaded; the +-- `:syntax on` and `:filetype on` commands load the menu too). +-- +-- `'g'` Grey menu items: Make menu items that are not active grey. If +-- `'g'` is not included inactive menu items are not shown at all. +-- +-- `'T'` Include Toolbar. Currently only in Win32 GUI. +-- +-- `'r'` Right-hand scrollbar is always present. +-- +-- `'R'` Right-hand scrollbar is present when there is a vertically +-- split window. +-- +-- `'l'` Left-hand scrollbar is always present. +-- +-- `'L'` Left-hand scrollbar is present when there is a vertically +-- split window. +-- +-- `'b'` Bottom (horizontal) scrollbar is present. Its size depends on +-- the longest visible line, or on the cursor line if the `'h'` +-- flag is included. |gui-horiz-scroll| +-- +-- `'h'` Limit horizontal scrollbar size to the length of the cursor +-- line. Reduces computations. |gui-horiz-scroll| +-- +-- And yes, you may even have scrollbars on the left AND the right if +-- you really want to :-). See |gui-scrollbars| for more information. +-- +-- +-- `'v'` Use a vertical button layout for dialogs. When not included, +-- a horizontal layout is preferred, but when it doesn't fit a +-- vertical layout is used anyway. Not supported in GTK 3. +-- +-- `'p'` Use Pointer callbacks for X11 GUI. This is required for some +-- window managers. If the cursor is not blinking or hollow at +-- the right moment, try adding this flag. This must be done +-- before starting the GUI. Set it in your |gvimrc|. Adding or +-- removing it after the GUI has started has no effect. +-- +-- `'k'` Keep the GUI window size when adding/removing a scrollbar, or +-- toolbar, tabline, etc. Instead, the behavior is similar to +-- when the window is maximized and will adjust `'lines'` and +-- `'columns'` to fit to the window. Without the `'k'` flag Vim will +-- try to keep `'lines'` and `'columns'` the same when adding and +-- removing GUI components. +vim.go.guioptions = "" +vim.go.go = vim.go.guioptions +-- `'guitablabel'` `'gtl'` string (default empty) +-- global +-- When non-empty describes the text to use in a label of the GUI tab +-- pages line. When empty and when the result is empty Vim will use a +-- default label. See |setting-guitablabel| for more info. +-- +-- The format of this option is like that of `'statusline'` . +-- `'guitabtooltip'` is used for the tooltip, see below. +-- The expression will be evaluated in the |sandbox| when set from a +-- modeline, see |sandbox-option|. +-- This option cannot be set in a modeline when `'modelineexpr'` is off. +-- +-- Only used when the GUI tab pages line is displayed. `'e'` must be +-- present in `'guioptions'` . For the non-GUI tab pages line `'tabline'` is +-- used. +vim.go.guitablabel = "" +vim.go.gtl = vim.go.guitablabel +-- `'guitabtooltip'` `'gtt'` string (default empty) +-- global +-- When non-empty describes the text to use in a tooltip for the GUI tab +-- pages line. When empty Vim will use a default tooltip. +-- This option is otherwise just like `'guitablabel'` above. +-- You can include a line break. Simplest method is to use |:let|: > +-- :let &guitabtooltip = "line one\nline two" +-- < +vim.go.guitabtooltip = "" +vim.go.gtt = vim.go.guitabtooltip +-- `'helpfile'` `'hf'` string (default (MS-Windows) "$VIMRUNTIME\doc\help.txt" +-- (others) "$VIMRUNTIME/doc/help.txt") +-- global +-- Name of the main help file. All distributed help files should be +-- placed together in one directory. Additionally, all "doc" directories +-- in `'runtimepath'` will be used. +-- Environment variables are expanded |:set_env|. For example: +-- "$VIMRUNTIME/doc/help.txt". If $VIMRUNTIME is not set, $VIM is also +-- tried. Also see |$VIMRUNTIME| and |option-backslash| about including +-- spaces and backslashes. +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +vim.go.helpfile = "/tmp/nvim/squashfs-root/usr/share/nvim/runtime/doc/help.txt" +vim.go.hf = vim.go.helpfile +-- `'helpheight'` `'hh'` number (default 20) +-- global +-- Minimal initial height of the help window when it is opened with the +-- ":help" command. The initial height of the help window is half of the +-- current window, or (when the `'ea'` option is on) the same as other +-- windows. When the height is less than `'helpheight'` , the height is +-- set to `'helpheight'` . Set to zero to disable. +vim.go.helpheight = 20 +vim.go.hh = vim.go.helpheight +-- `'helplang'` `'hlg'` string (default: messages language or empty) +-- global +-- Comma-separated list of languages. Vim will use the first language +-- for which the desired help can be found. The English help will always +-- be used as a last resort. You can add "en" to prefer English over +-- another language, but that will only find tags that exist in that +-- language and not in the English help. +-- Example: > +-- :set helplang=de,it +-- < This will first search German, then Italian and finally English help +-- files. +-- When using |CTRL-]| and ":help!" in a non-English help file Vim will +-- try to find the tag in the current language before using this option. +-- See |help-translated|. +vim.go.helplang = "" +vim.go.hlg = vim.go.helplang +-- `'hidden'` `'hid'` boolean (default on) +-- global +-- When off a buffer is unloaded (including loss of undo information) +-- when it is |abandon|ed. When on a buffer becomes hidden when it is +-- |abandon|ed. A buffer displayed in another window does not become +-- hidden, of course. +-- +-- Commands that move through the buffer list sometimes hide a buffer +-- although the `'hidden'` option is off when these three are true: +-- - the buffer is modified +-- - `'autowrite'` is off or writing is not possible +-- - the `'!'` flag was used +-- Also see |windows|. +-- +-- To hide a specific buffer use the `'bufhidden'` option. +-- `'hidden'` is set for one command with ":hide {command}" |:hide|. +vim.go.hidden = true +vim.go.hid = vim.go.hidden +vim.go.highlight = "8:SpecialKey,~:EndOfBuffer,z:TermCursor,Z:TermCursorNC,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,y:CurSearch,m:MoreMsg,M:ModeMsg,n:LineNr,a:LineNrAbove,b:LineNrBelow,N:CursorLineNr,G:CursorLineSign,O:CursorLineFoldr:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn,-:Conceal,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,[:PmenuKind,]:PmenuKindSel,{:PmenuExtra,}:PmenuExtraSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine,o:ColorColumn,q:QuickFixLine,0:Whitespace,I:NormalNC" +vim.go.hl = vim.go.highlight +-- `'history'` `'hi'` number (default: 10000) +-- global +-- A history of ":" commands, and a history of previous search patterns +-- is remembered. This option decides how many entries may be stored in +-- each of these histories (see |cmdline-editing|). +-- The maximum value is 10000. +vim.go.history = 10000 +vim.go.hi = vim.go.history +vim.go.hkmap = false +vim.go.hk = vim.go.hkmap +vim.go.hkmapp = false +vim.go.hkp = vim.go.hkmapp +-- `'hlsearch'` `'hls'` boolean (default on) +-- global +-- When there is a previous search pattern, highlight all its matches. +-- The |hl-Search| highlight group determines the highlighting for all +-- matches not under the cursor while the |hl-CurSearch| highlight group +-- (if defined) determines the highlighting for the match under the +-- cursor. If |hl-CurSearch| is not defined, then |hl-Search| is used for +-- both. Note that only the matching text is highlighted, any offsets +-- are not applied. +-- See also: `'incsearch'` and |:match|. +-- When you get bored looking at the highlighted matches, you can turn it +-- off with |:nohlsearch|. This does not change the option value, as +-- soon as you use a search command, the highlighting comes back. +-- `'redrawtime'` specifies the maximum time spent on finding matches. +-- When the search pattern can match an end-of-line, Vim will try to +-- highlight all of the matched text. However, this depends on where the +-- search starts. This will be the first line in the window or the first +-- line below a closed fold. A match in a previous line which is not +-- drawn may not continue in a newly drawn line. +-- You can specify whether the highlight status is restored on startup +-- with the `'h'` flag in `'shada'` |shada-h|. +vim.go.hlsearch = true +vim.go.hls = vim.go.hlsearch +-- `'icon'` boolean (default off, on when title can be restored) +-- global +-- When on, the icon text of the window will be set to the value of +-- `'iconstring'` (if it is not empty), or to the name of the file +-- currently being edited. Only the last part of the name is used. +-- Overridden by the `'iconstring'` option. +-- Only works if the terminal supports setting window icons. +vim.go.icon = false +-- `'iconstring'` string (default "") +-- global +-- When this option is not empty, it will be used for the icon text of +-- the window. This happens only when the `'icon'` option is on. +-- Only works if the terminal supports setting window icon text +-- When this option contains printf-style `'%'` items, they will be +-- expanded according to the rules used for `'statusline'` . See +-- `'titlestring'` for example settings. +-- This option cannot be set in a modeline when `'modelineexpr'` is off. +vim.go.iconstring = "" +-- `'ignorecase'` `'ic'` boolean (default off) +-- global +-- Ignore case in search patterns. Also used when searching in the tags +-- file. +-- Also see `'smartcase'` and `'tagcase'` . +-- Can be overruled by using "\c" or "\C" in the pattern, see +-- |/ignorecase|. +vim.go.ignorecase = false +vim.go.ic = vim.go.ignorecase +-- `'imcmdline'` `'imc'` boolean (default off) +-- global +-- When set the Input Method is always on when starting to edit a command +-- line, unless entering a search pattern (see `'imsearch'` for that). +-- Setting this option is useful when your input method allows entering +-- English characters directly, e.g., when it's used to type accented +-- characters with dead keys. +vim.go.imcmdline = false +vim.go.imc = vim.go.imcmdline +-- `'imdisable'` `'imd'` boolean (default off, on for some systems (SGI)) +-- global +-- When set the Input Method is never used. This is useful to disable +-- the IM when it doesn't work properly. +-- Currently this option is on by default for SGI/IRIX machines. This +-- may change in later releases. +vim.go.imdisable = false +vim.go.imd = vim.go.imdisable +-- `'inccommand'` `'icm'` string (default "nosplit") +-- global +-- +-- When nonempty, shows the effects of |:substitute|, |:smagic|, +-- |:snomagic| and user commands with the |:command-preview| flag as you +-- type. +-- +-- Possible values: +-- nosplit Shows the effects of a command incrementally in the +-- buffer. +-- split Like "nosplit", but also shows partial off-screen +-- results in a preview window. +-- +-- If the preview for built-in commands is too slow (exceeds +-- `'redrawtime'` ) then `'inccommand'` is automatically disabled until +-- |Command-line-mode| is done. +vim.go.inccommand = "nosplit" +vim.go.icm = vim.go.inccommand +-- `'incsearch'` `'is'` boolean (default on) +-- global +-- While typing a search command, show where the pattern, as it was typed +-- so far, matches. The matched string is highlighted. If the pattern +-- is invalid or not found, nothing is shown. The screen will be updated +-- often, this is only useful on fast terminals. +-- Note that the match will be shown, but the cursor will return to its +-- original position when no match is found and when pressing . You +-- still need to finish the search command with to move the +-- cursor to the match. +-- You can use the CTRL-G and CTRL-T keys to move to the next and +-- previous match. |c_CTRL-G| |c_CTRL-T| +-- Vim only searches for about half a second. With a complicated +-- pattern and/or a lot of text the match may not be found. This is to +-- avoid that Vim hangs while you are typing the pattern. +-- The |hl-IncSearch| highlight group determines the highlighting. +-- When `'hlsearch'` is on, all matched strings are highlighted too while +-- typing a search command. See also: `'hlsearch'` . +-- If you don't want to turn `'hlsearch'` on, but want to highlight all +-- matches while searching, you can turn on and off `'hlsearch'` with +-- autocmd. Example: > +-- augroup vimrc-incsearch-highlight +-- autocmd! +-- autocmd CmdlineEnter /,\? :set hlsearch +-- autocmd CmdlineLeave /,\? :set nohlsearch +-- augroup END +-- < +-- CTRL-L can be used to add one character from after the current match +-- to the command line. If `'ignorecase'` and `'smartcase'` are set and the +-- command line has no uppercase characters, the added character is +-- converted to lowercase. +-- CTRL-R CTRL-W can be used to add the word at the end of the current +-- match, excluding the characters that were already typed. +vim.go.incsearch = true +vim.go.is = vim.go.incsearch +vim.go.insertmode = false +vim.go.im = vim.go.insertmode +-- `'isfname'` `'isf'` string (default for Windows: +-- "@,48-57,/,\,.,-,_,+,,,#,$,%,{,},[,],:,@-@,!,~,=" +-- otherwise: "@,48-57,/,.,-,_,+,,,#,$,%,~,=") +-- global +-- The characters specified by this option are included in file names and +-- path names. Filenames are used for commands like "gf", "[i" and in +-- the tags file. It is also used for "\f" in a |pattern|. +-- Multi-byte characters 256 and above are always included, only the +-- characters up to 255 are specified with this option. +-- For UTF-8 the characters 0xa0 to 0xff are included as well. +-- Think twice before adding white space to this option. Although a +-- space may appear inside a file name, the effect will be that Vim +-- doesn't know where a file name starts or ends when doing completion. +-- It most likely works better without a space in `'isfname'` . +-- +-- Note that on systems using a backslash as path separator, Vim tries to +-- do its best to make it work as you would expect. That is a bit +-- tricky, since Vi originally used the backslash to escape special +-- characters. Vim will not remove a backslash in front of a normal file +-- name character on these systems, but it will on Unix and alikes. The +-- `'&'` and `'^'` are not included by default, because these are special for +-- cmd.exe. +-- +-- The format of this option is a list of parts, separated with commas. +-- Each part can be a single character number or a range. A range is two +-- character numbers with `'-'` in between. A character number can be a +-- decimal number between 0 and 255 or the ASCII character itself (does +-- not work for digits). Example: +-- "_,-,128-140,#-43" (include `'_'` and `'-'` and the range +-- 128 to 140 and `'#'` to 43) +-- If a part starts with `'^'` , the following character number or range +-- will be excluded from the option. The option is interpreted from left +-- to right. Put the excluded character after the range where it is +-- included. To include `'^'` itself use it as the last character of the +-- option or the end of a range. Example: +-- "^a-z,#,^" (exclude `'a'` to `'z'` , include `'#'` and `'^'` ) +-- If the character is `'@'` , all characters where isalpha() returns TRUE +-- are included. Normally these are the characters a to z and A to Z, +-- plus accented characters. To include `'@'` itself use "@-@". Examples: +-- "@,^a-z" All alphabetic characters, excluding lower +-- case ASCII letters. +-- "a-z,A-Z,@-@" All letters plus the `'@'` character. +-- A comma can be included by using it where a character number is +-- expected. Example: +-- "48-57,,,_" Digits, comma and underscore. +-- A comma can be excluded by prepending a `'^'` . Example: +-- " -~,^,,9" All characters from space to `'~'` , excluding +-- comma, plus . +-- See |option-backslash| about including spaces and backslashes. +vim.go.isfname = "@,48-57,/,.,-,_,+,,,#,$,%,~,=" +vim.go.isf = vim.go.isfname +-- `'isident'` `'isi'` string (default for Windows: +-- "@,48-57,_,128-167,224-235" +-- otherwise: "@,48-57,_,192-255") +-- global +-- The characters given by this option are included in identifiers. +-- Identifiers are used in recognizing environment variables and after a +-- match of the `'define'` option. It is also used for "\i" in a +-- |pattern|. See `'isfname'` for a description of the format of this +-- option. For `'@'` only characters up to 255 are used. +-- Careful: If you change this option, it might break expanding +-- environment variables. E.g., when `'/'` is included and Vim tries to +-- expand "$HOME/.local/state/nvim/shada/main.shada". Maybe you should +-- change `'iskeyword'` instead. +vim.go.isident = "@,48-57,_,192-255" +vim.go.isi = vim.go.isident +-- `'isprint'` `'isp'` string (default: "@,161-255") +-- global +-- The characters given by this option are displayed directly on the +-- screen. It is also used for "\p" in a |pattern|. The characters from +-- space (ASCII 32) to `'~'` (ASCII 126) are always displayed directly, +-- even when they are not included in `'isprint'` or excluded. See +-- `'isfname'` for a description of the format of this option. +-- +-- Non-printable characters are displayed with two characters: +-- 0 - 31 "^@" - "^_" +-- 32 - 126 always single characters +-- 127 "^?" +-- 128 - 159 "~@" - "~_" +-- 160 - 254 "| " - "|~" +-- 255 "~?" +-- Illegal bytes from 128 to 255 (invalid UTF-8) are +-- displayed as , with the hexadecimal value of the byte. +-- When `'display'` contains "uhex" all unprintable characters are +-- displayed as . +-- The SpecialKey highlighting will be used for unprintable characters. +-- |hl-SpecialKey| +-- +-- Multi-byte characters 256 and above are always included, only the +-- characters up to 255 are specified with this option. When a character +-- is printable but it is not available in the current font, a +-- replacement character will be shown. +-- Unprintable and zero-width Unicode characters are displayed as . +-- There is no option to specify these characters. +vim.go.isprint = "@,161-255" +vim.go.isp = vim.go.isprint +-- `'joinspaces'` `'js'` boolean (default off) +-- global +-- Insert two spaces after a `'.'` , `'?'` and `'!'` with a join command. +-- Otherwise only one space is inserted. +vim.go.joinspaces = false +vim.go.js = vim.go.joinspaces +-- `'jumpoptions'` `'jop'` string (default "") +-- global +-- List of words that change the behavior of the |jumplist|. +-- stack Make the jumplist behave like the tagstack or like a +-- web browser. Relative location of entries in the +-- jumplist is preserved at the cost of discarding +-- subsequent entries when navigating backwards in the +-- jumplist and then jumping to a location. +-- |jumplist-stack| +-- +-- view When moving through the jumplist, |changelist|, +-- |alternate-file| or using |mark-motions| try to +-- restore the |mark-view| in which the action occurred. +vim.go.jumpoptions = "" +vim.go.jop = vim.go.jumpoptions +-- `'keymodel'` `'km'` string (default "") +-- global +-- List of comma-separated words, which enable special things that keys +-- can do. These values can be used: +-- startsel Using a shifted special key starts selection (either +-- Select mode or Visual mode, depending on "key" being +-- present in `'selectmode'` ). +-- stopsel Using a not-shifted special key stops selection. +-- Special keys in this context are the cursor keys, , , +-- and . +vim.go.keymodel = "" +vim.go.km = vim.go.keymodel +-- `'langmap'` `'lmap'` string (default "") +-- global +-- This option allows switching your keyboard into a special language +-- mode. When you are typing text in Insert mode the characters are +-- inserted directly. When in Normal mode the `'langmap'` option takes +-- care of translating these special characters to the original meaning +-- of the key. This means you don't have to change the keyboard mode to +-- be able to execute Normal mode commands. +-- This is the opposite of the `'keymap'` option, where characters are +-- mapped in Insert mode. +-- Also consider setting `'langremap'` to off, to prevent `'langmap'` from +-- applying to characters resulting from a mapping. +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +-- +-- Example (for Greek, in UTF-8): > +-- :set langmap=ΑA,ΒB,ΨC,ΔD,ΕE,ΦF,ΓG,ΗH,ΙI,ΞJ,ΚK,ΛL,ΜM,ΝN,ΟO,ΠP,QQ,ΡR,ΣS,ΤT,ΘU,ΩV,WW,ΧX,ΥY,ΖZ,αa,βb,ψc,δd,εe,φf,γg,ηh,ιi,ξj,κk,λl,μm,νn,οo,πp,qq,ρr,σs,τt,θu,ωv,ςw,χx,υy,ζz +-- < Example (exchanges meaning of z and y for commands): > +-- :set langmap=zy,yz,ZY,YZ +-- < +-- The `'langmap'` option is a list of parts, separated with commas. Each +-- part can be in one of two forms: +-- 1. A list of pairs. Each pair is a "from" character immediately +-- followed by the "to" character. Examples: "aA", "aAbBcC". +-- 2. A list of "from" characters, a semi-colon and a list of "to" +-- characters. Example: "abc;ABC" +-- Example: "aA,fgh;FGH,cCdDeE" +-- Special characters need to be preceded with a backslash. These are +-- ";", `','` , `'"'` , `'|'` and backslash itself. +-- +-- This will allow you to activate vim actions without having to switch +-- back and forth between the languages. Your language characters will +-- be understood as normal vim English characters (according to the +-- langmap mappings) in the following cases: +-- o Normal/Visual mode (commands, buffer/register names, user mappings) +-- o Insert/Replace Mode: Register names after CTRL-R +-- o Insert/Replace Mode: Mappings +-- Characters entered in Command-line mode will NOT be affected by +-- this option. Note that this option can be changed at any time +-- allowing to switch between mappings for different languages/encodings. +-- Use a mapping to avoid having to type it each time! +vim.go.langmap = "" +vim.go.lmap = vim.go.langmap +-- `'langmenu'` `'lm'` string (default "") +-- global +-- Language to use for menu translation. Tells which file is loaded +-- from the "lang" directory in `'runtimepath'` : > +-- "lang/menu_" .. &langmenu .. ".vim" +-- < (without the spaces). For example, to always use the Dutch menus, no +-- matter what $LANG is set to: > +-- :set langmenu=nl_NL.ISO_8859-1 +-- < When `'langmenu'` is empty, |v:lang| is used. +-- Only normal file name characters can be used, "/\*?[|<>" are illegal. +-- If your $LANG is set to a non-English language but you do want to use +-- the English menus: > +-- :set langmenu=none +-- < This option must be set before loading menus, switching on filetype +-- detection or syntax highlighting. Once the menus are defined setting +-- this option has no effect. But you could do this: > +-- :source $VIMRUNTIME/delmenu.vim +-- :set langmenu=de_DE.ISO_8859-1 +-- :source $VIMRUNTIME/menu.vim +-- < Warning: This deletes all menus that you defined yourself! +vim.go.langmenu = "" +vim.go.lm = vim.go.langmenu +vim.go.langnoremap = true +vim.go.lnr = vim.go.langnoremap +-- `'langremap'` `'lrm'` boolean (default off) +-- global +-- When off, setting `'langmap'` does not apply to characters resulting from +-- a mapping. If setting `'langmap'` disables some of your mappings, make +-- sure this option is off. +vim.go.langremap = false +vim.go.lrm = vim.go.langremap +-- `'laststatus'` `'ls'` number (default 2) +-- global +-- The value of this option influences when the last window will have a +-- status line: +-- 0: never +-- 1: only if there are at least two windows +-- 2: always +-- 3: always and ONLY the last window +-- The screen looks nicer with a status line if you have several +-- windows, but it takes another screen line. |status-line| +vim.go.laststatus = 2 +vim.go.ls = vim.go.laststatus +-- `'lazyredraw'` `'lz'` boolean (default off) +-- global +-- When this option is set, the screen will not be redrawn while +-- executing macros, registers and other commands that have not been +-- typed. Also, updating the window title is postponed. To force an +-- update use |:redraw|. +-- This may occasionally cause display errors. It is only meant to be set +-- temporarily when performing an operation where redrawing may cause +-- flickering or cause a slow down. +vim.go.lazyredraw = false +vim.go.lz = vim.go.lazyredraw +-- `'lines'` number (default 24 or terminal height) +-- global +-- Number of lines of the Vim window. +-- Normally you don't need to set this. It is done automatically by the +-- terminal initialization code. +-- When Vim is running in the GUI or in a resizable window, setting this +-- option will cause the window size to be changed. When you only want +-- to use the size for the GUI, put the command in your |gvimrc| file. +-- Vim limits the number of lines to what fits on the screen. You can +-- use this command to get the tallest window possible: > +-- :set lines=999 +-- < Minimum value is 2, maximum value is 1000. +vim.go.lines = 24 +-- `'linespace'` `'lsp'` number (default 0) +-- global +-- {only in the GUI} +-- Number of pixel lines inserted between characters. Useful if the font +-- uses the full character cell height, making lines touch each other. +-- When non-zero there is room for underlining. +-- With some fonts there can be too much room between lines (to have +-- space for ascents and descents). Then it makes sense to set +-- `'linespace'` to a negative value. This may cause display problems +-- though! +vim.go.linespace = 0 +vim.go.lsp = vim.go.linespace +-- `'loadplugins'` `'lpl'` boolean (default on) +-- global +-- When on the plugin scripts are loaded when starting up |load-plugins|. +-- This option can be reset in your |vimrc| file to disable the loading +-- of plugins. +-- Note that using the "-u NONE" and "--noplugin" command line arguments +-- reset this option. |-u| |--noplugin| +vim.go.loadplugins = true +vim.go.lpl = vim.go.loadplugins +-- `'magic'` boolean (default on) +-- global +-- Changes the special characters that can be used in search patterns. +-- See |pattern|. +-- WARNING: Switching this option off most likely breaks plugins! That +-- is because many patterns assume it's on and will fail when it's off. +-- Only switch it off when working with old Vi scripts. In any other +-- situation write patterns that work when `'magic'` is on. Include "\M" +-- when you want to |/\M|. +vim.go.magic = true +-- `'makeef'` `'mef'` string (default: "") +-- global +-- Name of the errorfile for the |:make| command (see |:make_makeprg|) +-- and the |:grep| command. +-- When it is empty, an internally generated temp file will be used. +-- When "##" is included, it is replaced by a number to make the name +-- unique. This makes sure that the ":make" command doesn't overwrite an +-- existing file. +-- NOT used for the ":cf" command. See `'errorfile'` for that. +-- Environment variables are expanded |:set_env|. +-- See |option-backslash| about including spaces and backslashes. +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +vim.go.makeef = "" +vim.go.mef = vim.go.makeef +-- `'matchtime'` `'mat'` number (default 5) +-- global +-- Tenths of a second to show the matching paren, when `'showmatch'` is +-- set. Note that this is not in milliseconds, like other options that +-- set a time. This is to be compatible with Nvi. +vim.go.matchtime = 5 +vim.go.mat = vim.go.matchtime +vim.go.maxcombine = 6 +vim.go.mco = vim.go.maxcombine +-- `'maxfuncdepth'` `'mfd'` number (default 100) +-- global +-- Maximum depth of function calls for user functions. This normally +-- catches endless recursion. When using a recursive function with +-- more depth, set `'maxfuncdepth'` to a bigger number. But this will use +-- more memory, there is the danger of failing when memory is exhausted. +-- Increasing this limit above 200 also changes the maximum for Ex +-- command recursion, see |E169|. +-- See also |:function|. +vim.go.maxfuncdepth = 100 +vim.go.mfd = vim.go.maxfuncdepth +-- `'maxmapdepth'` `'mmd'` number (default 1000) +-- global +-- Maximum number of times a mapping is done without resulting in a +-- character to be used. This normally catches endless mappings, like +-- ":map x y" with ":map y x". It still does not catch ":map g wg", +-- because the `'w'` is used before the next mapping is done. See also +-- |key-mapping|. +vim.go.maxmapdepth = 1000 +vim.go.mmd = vim.go.maxmapdepth +-- `'maxmempattern'` `'mmp'` number (default 1000) +-- global +-- Maximum amount of memory (in Kbyte) to use for pattern matching. +-- The maximum value is about 2000000. Use this to work without a limit. +-- +-- When Vim runs into the limit it gives an error message and mostly +-- behaves like CTRL-C was typed. +-- Running into the limit often means that the pattern is very +-- inefficient or too complex. This may already happen with the pattern +-- "\(.\)*" on a very long line. ".*" works much better. +-- Might also happen on redraw, when syntax rules try to match a complex +-- text structure. +-- Vim may run out of memory before hitting the `'maxmempattern'` limit, in +-- which case you get an "Out of memory" error instead. +vim.go.maxmempattern = 1000 +vim.go.mmp = vim.go.maxmempattern +-- `'menuitems'` `'mis'` number (default 25) +-- global +-- Maximum number of items to use in a menu. Used for menus that are +-- generated from a list of items, e.g., the Buffers menu. Changing this +-- option has no direct effect, the menu must be refreshed first. +vim.go.menuitems = 25 +vim.go.mis = vim.go.menuitems +-- `'mkspellmem'` `'msm'` string (default "460000,2000,500") +-- global +-- Parameters for |:mkspell|. This tunes when to start compressing the +-- word tree. Compression can be slow when there are many words, but +-- it's needed to avoid running out of memory. The amount of memory used +-- per word depends very much on how similar the words are, that's why +-- this tuning is complicated. +-- +-- There are three numbers, separated by commas: +-- {start},{inc},{added} +-- +-- For most languages the uncompressed word tree fits in memory. {start} +-- gives the amount of memory in Kbyte that can be used before any +-- compression is done. It should be a bit smaller than the amount of +-- memory that is available to Vim. +-- +-- When going over the {start} limit the {inc} number specifies the +-- amount of memory in Kbyte that can be allocated before another +-- compression is done. A low number means compression is done after +-- less words are added, which is slow. A high number means more memory +-- will be allocated. +-- +-- After doing compression, {added} times 1024 words can be added before +-- the {inc} limit is ignored and compression is done when any extra +-- amount of memory is needed. A low number means there is a smaller +-- chance of hitting the {inc} limit, less memory is used but it's +-- slower. +-- +-- The languages for which these numbers are important are Italian and +-- Hungarian. The default works for when you have about 512 Mbyte. If +-- you have 1 Gbyte you could use: > +-- :set mkspellmem=900000,3000,800 +-- < If you have less than 512 Mbyte |:mkspell| may fail for some +-- languages, no matter what you set `'mkspellmem'` to. +-- +-- This option cannot be set from a |modeline| or in the |sandbox|. +vim.go.mkspellmem = "460000,2000,500" +vim.go.msm = vim.go.mkspellmem +-- `'modelineexpr'` `'mle'` boolean (default: off) +-- global +-- When on allow some options that are an expression to be set in the +-- modeline. Check the option for whether it is affected by +-- `'modelineexpr'` . Also see |modeline|. +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +vim.go.modelineexpr = false +vim.go.mle = vim.go.modelineexpr +-- `'modelines'` `'mls'` number (default 5) +-- global +-- If `'modeline'` is on `'modelines'` gives the number of lines that is +-- checked for set commands. If `'modeline'` is off or `'modelines'` is zero +-- no lines are checked. See |modeline|. +vim.go.modelines = 5 +vim.go.mls = vim.go.modelines +-- `'more'` boolean (default: on) +-- global +-- When on, listings pause when the whole screen is filled. You will get +-- the |more-prompt|. When this option is off there are no pauses, the +-- listing continues until finished. +vim.go.more = true +-- `'mouse'` string (default "nvi") +-- global +-- +-- Enables mouse support. For example, to enable the mouse in Normal mode +-- and Visual mode: > +-- :set mouse=nv +-- < +-- To temporarily disable mouse support, hold the shift key while using +-- the mouse. +-- +-- Mouse support can be enabled for different modes: +-- n Normal mode +-- v Visual mode +-- i Insert mode +-- c Command-line mode +-- h all previous modes when editing a help file +-- a all previous modes +-- r for |hit-enter| and |more-prompt| prompt +-- +-- Left-click anywhere in a text buffer to place the cursor there. This +-- works with operators too, e.g. type |d| then left-click to delete text +-- from the current cursor position to the position where you clicked. +-- +-- Drag the |status-line| or vertical separator of a window to resize it. +-- +-- If enabled for "v" (Visual mode) then double-click selects word-wise, +-- triple-click makes it line-wise, and quadruple-click makes it +-- rectangular block-wise. +-- +-- For scrolling with a mouse wheel see |scroll-mouse-wheel|. +-- +-- Note: When enabling the mouse in a terminal, copy/paste will use the +-- "* register if possible. See also `'clipboard'` . +-- +-- Related options: +-- `'mousefocus'` window focus follows mouse pointer +-- `'mousemodel'` what mouse button does which action +-- `'mousehide'` hide mouse pointer while typing text +-- `'selectmode'` whether to start Select mode or Visual mode +vim.go.mouse = "nvi" +-- `'mousefocus'` `'mousef'` boolean (default off) +-- global +-- The window that the mouse pointer is on is automatically activated. +-- When changing the window layout or window focus in another way, the +-- mouse pointer is moved to the window with keyboard focus. Off is the +-- default because it makes using the pull down menus a little goofy, as +-- a pointer transit may activate a window unintentionally. +vim.go.mousefocus = false +vim.go.mousef = vim.go.mousefocus +-- `'mousehide'` `'mh'` boolean (default on) +-- global +-- {only works in the GUI} +-- When on, the mouse pointer is hidden when characters are typed. +-- The mouse pointer is restored when the mouse is moved. +vim.go.mousehide = true +vim.go.mh = vim.go.mousehide +-- `'mousemodel'` `'mousem'` string (default "popup_setpos") +-- global +-- Sets the model to use for the mouse. The name mostly specifies what +-- the right mouse button is used for: +-- extend Right mouse button extends a selection. This works +-- like in an xterm. +-- popup Right mouse button pops up a menu. The shifted left +-- mouse button extends a selection. This works like +-- with Microsoft Windows. +-- popup_setpos Like "popup", but the cursor will be moved to the +-- position where the mouse was clicked, and thus the +-- selected operation will act upon the clicked object. +-- If clicking inside a selection, that selection will +-- be acted upon, i.e. no cursor move. This implies of +-- course, that right clicking outside a selection will +-- end Visual mode. +-- Overview of what button does what for each model: +-- mouse extend popup(_setpos) ~ +-- left click place cursor place cursor +-- left drag start selection start selection +-- shift-left search word extend selection +-- right click extend selection popup menu (place cursor) +-- right drag extend selection - +-- middle click paste paste +-- +-- In the "popup" model the right mouse button produces a pop-up menu. +-- Nvim creates a default |popup-menu| but you can redefine it. +-- +-- Note that you can further refine the meaning of buttons with mappings. +-- See |mouse-overview|. But mappings are NOT used for modeless selection. +-- +-- Example: > +-- :map +-- :map +-- :map +-- :map <2-S-LeftMouse> <2-RightMouse> +-- :map <2-S-LeftDrag> <2-RightDrag> +-- :map <2-S-LeftRelease> <2-RightRelease> +-- :map <3-S-LeftMouse> <3-RightMouse> +-- :map <3-S-LeftDrag> <3-RightDrag> +-- :map <3-S-LeftRelease> <3-RightRelease> +-- :map <4-S-LeftMouse> <4-RightMouse> +-- :map <4-S-LeftDrag> <4-RightDrag> +-- :map <4-S-LeftRelease> <4-RightRelease> +-- < +-- Mouse commands requiring the CTRL modifier can be simulated by typing +-- the "g" key before using the mouse: +-- "g" is " (jump to tag under mouse click) +-- "g" is " ("CTRL-T") +vim.go.mousemodel = "popup_setpos" +vim.go.mousem = vim.go.mousemodel +-- `'mousemoveevent'` `'mousemev'` boolean (default off) +-- global +-- When on, mouse move events are delivered to the input queue and are +-- available for mapping. The default, off, avoids the mouse movement +-- overhead except when needed. +-- Warning: Setting this option can make pending mappings to be aborted +-- when the mouse is moved. +vim.go.mousemoveevent = false +vim.go.mousemev = vim.go.mousemoveevent +-- `'mousescroll'` string (default "ver:3,hor:6") +-- global +-- This option controls the number of lines / columns to scroll by when +-- scrolling with a mouse. The option is a comma separated list of parts. +-- Each part consists of a direction and a count as follows: +-- direction:count,direction:count +-- Direction is one of either "hor" or "ver". "hor" controls horizontal +-- scrolling and "ver" controls vertical scrolling. Count sets the amount +-- to scroll by for the given direction, it should be a non negative +-- integer. Each direction should be set at most once. If a direction +-- is omitted, a default value is used (6 for horizontal scrolling and 3 +-- for vertical scrolling). You can disable mouse scrolling by using +-- a count of 0. +-- +-- Example: > +-- :set mousescroll=ver:5,hor:2 +-- < Will make Nvim scroll 5 lines at a time when scrolling vertically, and +-- scroll 2 columns at a time when scrolling horizontally. +vim.go.mousescroll = "ver:3,hor:6" +-- `'mouseshape'` `'mouses'` string (default "i:beam,r:beam,s:updown,sd:cross, +-- m:no,ml:up-arrow,v:rightup-arrow") +-- global +-- This option tells Vim what the mouse pointer should look like in +-- different modes. The option is a comma-separated list of parts, much +-- like used for `'guicursor'` . Each part consist of a mode/location-list +-- and an argument-list: +-- mode-list:shape,mode-list:shape,.. +-- The mode-list is a dash separated list of these modes/locations: +-- In a normal window: ~ +-- n Normal mode +-- v Visual mode +-- ve Visual mode with `'selection'` "exclusive" (same as `'v'` , +-- if not specified) +-- o Operator-pending mode +-- i Insert mode +-- r Replace mode +-- +-- Others: ~ +-- c appending to the command-line +-- ci inserting in the command-line +-- cr replacing in the command-line +-- m at the 'Hit ENTER' or `'More'` prompts +-- ml idem, but cursor in the last line +-- e any mode, pointer below last window +-- s any mode, pointer on a status line +-- sd any mode, while dragging a status line +-- vs any mode, pointer on a vertical separator line +-- vd any mode, while dragging a vertical separator line +-- a everywhere +-- +-- The shape is one of the following: +-- avail name looks like ~ +-- w x arrow Normal mouse pointer +-- w x blank no pointer at all (use with care!) +-- w x beam I-beam +-- w x updown up-down sizing arrows +-- w x leftright left-right sizing arrows +-- w x busy The system's usual busy pointer +-- w x no The system's usual "no input" pointer +-- x udsizing indicates up-down resizing +-- x lrsizing indicates left-right resizing +-- x crosshair like a big thin + +-- x hand1 black hand +-- x hand2 white hand +-- x pencil what you write with +-- x question big ? +-- x rightup-arrow arrow pointing right-up +-- w x up-arrow arrow pointing up +-- x any X11 pointer number (see X11/cursorfont.h) +-- +-- The "avail" column contains a `'w'` if the shape is available for Win32, +-- x for X11. +-- Any modes not specified or shapes not available use the normal mouse +-- pointer. +-- +-- Example: > +-- :set mouseshape=s:udsizing,m:no +-- < will make the mouse turn to a sizing arrow over the status lines and +-- indicate no input when the hit-enter prompt is displayed (since +-- clicking the mouse has no effect in this state.) +vim.go.mouseshape = "" +vim.go.mouses = vim.go.mouseshape +-- `'mousetime'` `'mouset'` number (default 500) +-- global +-- Defines the maximum time in msec between two mouse clicks for the +-- second click to be recognized as a multi click. +vim.go.mousetime = 500 +vim.go.mouset = vim.go.mousetime +-- `'opendevice'` `'odev'` boolean (default off) +-- global +-- {only for Windows} +-- Enable reading and writing from devices. This may get Vim stuck on a +-- device that can be opened but doesn't actually do the I/O. Therefore +-- it is off by default. +-- Note that on Windows editing "aux.h", "lpt1.txt" and the like also +-- result in editing a device. +vim.go.opendevice = false +vim.go.odev = vim.go.opendevice +-- `'operatorfunc'` `'opfunc'` string (default: empty) +-- global +-- This option specifies a function to be called by the |g@| operator. +-- See |:map-operator| for more info and an example. The value can be +-- the name of a function, a |lambda| or a |Funcref|. See +-- |option-value-function| for more information. +-- +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +vim.go.operatorfunc = "" +vim.go.opfunc = vim.go.operatorfunc +-- `'packpath'` `'pp'` string (default: see `'runtimepath'` ) +-- Directories used to find packages. See |packages| and |rtp-packages|. +vim.go.packpath = "/home/runner/.config/nvim,/etc/xdg/nvim,/home/runner/.local/share/nvim/site,/usr/local/share/nvim/site,/usr/share/nvim/site,/tmp/nvim/squashfs-root/usr/share/nvim/runtime,/tmp/nvim/squashfs-root/usr/lib/nvim,/usr/share/nvim/site/after,/usr/local/share/nvim/site/after,/home/runner/.local/share/nvim/site/after,/etc/xdg/nvim/after,/home/runner/.config/nvim/after" +vim.go.pp = vim.go.packpath +-- `'paragraphs'` `'para'` string (default "IPLPPPQPP TPHPLIPpLpItpplpipbp") +-- global +-- Specifies the nroff macros that separate paragraphs. These are pairs +-- of two letters (see |object-motions|). +vim.go.paragraphs = "IPLPPPQPP TPHPLIPpLpItpplpipbp" +vim.go.para = vim.go.paragraphs +vim.go.paste = false +vim.go.pastetoggle = "" +vim.go.pt = vim.go.pastetoggle +-- `'patchexpr'` `'pex'` string (default "") +-- global +-- Expression which is evaluated to apply a patch to a file and generate +-- the resulting new version of the file. See |diff-patchexpr|. +vim.go.patchexpr = "" +vim.go.pex = vim.go.patchexpr +-- `'patchmode'` `'pm'` string (default "") +-- global +-- When non-empty the oldest version of a file is kept. This can be used +-- to keep the original version of a file if you are changing files in a +-- source distribution. Only the first time that a file is written a +-- copy of the original file will be kept. The name of the copy is the +-- name of the original file with the string in the `'patchmode'` option +-- appended. This option should start with a dot. Use a string like +-- ".orig" or ".org". `'backupdir'` must not be empty for this to work +-- (Detail: The backup file is renamed to the patchmode file after the +-- new file has been successfully written, that's why it must be possible +-- to write a backup file). If there was no file to be backed up, an +-- empty file is created. +-- When the `'backupskip'` pattern matches, a patchmode file is not made. +-- Using `'patchmode'` for compressed files appends the extension at the +-- end (e.g., "file.gz.orig"), thus the resulting name isn't always +-- recognized as a compressed file. +-- Only normal file name characters can be used, "/\*?[|<>" are illegal. +vim.go.patchmode = "" +vim.go.pm = vim.go.patchmode +-- `'previewheight'` `'pvh'` number (default 12) +-- global +-- Default height for a preview window. Used for |:ptag| and associated +-- commands. Used for |CTRL-W_}| when no count is given. +vim.go.previewheight = 12 +vim.go.pvh = vim.go.previewheight +vim.go.prompt = true +-- `'pumblend'` `'pb'` number (default 0) +-- global +-- Enables pseudo-transparency for the |popup-menu|. Valid values are in +-- the range of 0 for fully opaque popupmenu (disabled) to 100 for fully +-- transparent background. Values between 0-30 are typically most useful. +-- +-- It is possible to override the level for individual highlights within +-- the popupmenu using |highlight-blend|. For instance, to enable +-- transparency but force the current selected element to be fully opaque: > +-- +-- :set pumblend=15 +-- :hi PmenuSel blend=0 +-- < +-- UI-dependent. Works best with RGB colors. `'termguicolors'` +vim.go.pumblend = 0 +vim.go.pb = vim.go.pumblend +-- `'pumheight'` `'ph'` number (default 0) +-- global +-- Maximum number of items to show in the popup menu +-- (|ins-completion-menu|). Zero means "use available screen space". +vim.go.pumheight = 0 +vim.go.ph = vim.go.pumheight +-- `'pumwidth'` `'pw'` number (default 15) +-- global +-- Minimum width for the popup menu (|ins-completion-menu|). If the +-- cursor column + `'pumwidth'` exceeds screen width, the popup menu is +-- nudged to fit on the screen. +vim.go.pumwidth = 15 +vim.go.pw = vim.go.pumwidth +-- `'pyxversion'` `'pyx'` number (default 3) +-- global +-- Specifies the python version used for pyx* functions and commands +-- |python_x|. As only Python 3 is supported, this always has the value +-- `3`. Setting any other value is an error. +-- +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +vim.go.pyxversion = 3 +vim.go.pyx = vim.go.pyxversion +-- `'quickfixtextfunc'` `'qftf'` string (default "") +-- global +-- This option specifies a function to be used to get the text to display +-- in the quickfix and location list windows. This can be used to +-- customize the information displayed in the quickfix or location window +-- for each entry in the corresponding quickfix or location list. See +-- |quickfix-window-function| for an explanation of how to write the +-- function and an example. The value can be the name of a function, a +-- |lambda| or a |Funcref|. See |option-value-function| for more +-- information. +-- +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +vim.go.quickfixtextfunc = "" +vim.go.qftf = vim.go.quickfixtextfunc +-- `'redrawdebug'` `'rdb'` string (default `''` ) +-- global +-- Flags to change the way redrawing works, for debugging purposes. +-- Most useful with `'writedelay'` set to some reasonable value. +-- Supports the following flags: +-- compositor Indicate each redraw event handled by the compositor +-- by briefly flashing the redrawn regions in colors +-- indicating the redraw type. These are the highlight +-- groups used (and their default colors): +-- RedrawDebugNormal gui=reverse normal redraw passed through +-- RedrawDebugClear guibg=Yellow clear event passed through +-- RedrawDebugComposed guibg=Green redraw event modified by the +-- compositor (due to +-- overlapping grids, etc) +-- RedrawDebugRecompose guibg=Red redraw generated by the +-- compositor itself, due to a +-- grid being moved or deleted. +-- line introduce a delay after each line drawn on the screen. +-- When using the TUI or another single-grid UI, "compositor" +-- gives more information and should be preferred (every +-- line is processed as a separate event by the compositor) +-- flush introduce a delay after each "flush" event. +-- nothrottle Turn off throttling of the message grid. This is an +-- optimization that joins many small scrolls to one +-- larger scroll when drawing the message area (with +-- `'display'` msgsep flag active). +-- invalid Enable stricter checking (abort) of inconsistencies +-- of the internal screen state. This is mostly +-- useful when running nvim inside a debugger (and +-- the test suite). +-- nodelta Send all internally redrawn cells to the UI, even if +-- they are unchanged from the already displayed state. +vim.go.redrawdebug = "" +vim.go.rdb = vim.go.redrawdebug +-- `'redrawtime'` `'rdt'` number (default 2000) +-- global +-- Time in milliseconds for redrawing the display. Applies to +-- `'hlsearch'` , `'inccommand'` , |:match| highlighting and syntax +-- highlighting. +-- When redrawing takes more than this many milliseconds no further +-- matches will be highlighted. +-- For syntax highlighting the time applies per window. When over the +-- limit syntax highlighting is disabled until |CTRL-L| is used. +-- This is used to avoid that Vim hangs when using a very complicated +-- pattern. +vim.go.redrawtime = 2000 +vim.go.rdt = vim.go.redrawtime +-- `'regexpengine'` `'re'` number (default 0) +-- global +-- This selects the default regexp engine. |two-engines| +-- The possible values are: +-- 0 automatic selection +-- 1 old engine +-- 2 NFA engine +-- Note that when using the NFA engine and the pattern contains something +-- that is not supported the pattern will not match. This is only useful +-- for debugging the regexp engine. +-- Using automatic selection enables Vim to switch the engine, if the +-- default engine becomes too costly. E.g., when the NFA engine uses too +-- many states. This should prevent Vim from hanging on a combination of +-- a complex pattern with long text. +vim.go.regexpengine = 0 +vim.go.re = vim.go.regexpengine +vim.go.remap = true +-- `'report'` number (default 2) +-- global +-- Threshold for reporting number of lines changed. When the number of +-- changed lines is more than `'report'` a message will be given for most +-- ":" commands. If you want it always, set `'report'` to 0. +-- For the ":substitute" command the number of substitutions is used +-- instead of the number of lines. +vim.go.report = 2 +-- `'revins'` `'ri'` boolean (default off) +-- global +-- Inserting characters in Insert mode will work backwards. See "typing +-- backwards" |ins-reverse|. This option can be toggled with the CTRL-_ +-- command in Insert mode, when `'allowrevins'` is set. +vim.go.revins = false +vim.go.ri = vim.go.revins +-- `'ruler'` `'ru'` boolean (default on) +-- global +-- Show the line and column number of the cursor position, separated by a +-- comma. When there is room, the relative position of the displayed +-- text in the file is shown on the far right: +-- Top first line is visible +-- Bot last line is visible +-- All first and last line are visible +-- 45% relative position in the file +-- If `'rulerformat'` is set, it will determine the contents of the ruler. +-- Each window has its own ruler. If a window has a status line, the +-- ruler is shown there. If a window doesn't have a status line and +-- `'cmdheight'` is zero, the ruler is not shown. Otherwise it is shown in +-- the last line of the screen. If the statusline is given by +-- `'statusline'` (i.e. not empty), this option takes precedence over +-- `'ruler'` and `'rulerformat'` . +-- If the number of characters displayed is different from the number of +-- bytes in the text (e.g., for a TAB or a multibyte character), both +-- the text column (byte number) and the screen column are shown, +-- separated with a dash. +-- For an empty line "0-1" is shown. +-- For an empty buffer the line number will also be zero: "0,0-1". +-- If you don't want to see the ruler all the time but want to know where +-- you are, use "g CTRL-G" |g_CTRL-G|. +vim.go.ruler = true +vim.go.ru = vim.go.ruler +-- `'rulerformat'` `'ruf'` string (default empty) +-- global +-- When this option is not empty, it determines the content of the ruler +-- string, as displayed for the `'ruler'` option. +-- The format of this option is like that of `'statusline'` . +-- This option cannot be set in a modeline when `'modelineexpr'` is off. +-- +-- The default ruler width is 17 characters. To make the ruler 15 +-- characters wide, put "%15(" at the start and "%)" at the end. +-- Example: > +-- :set rulerformat=%15(%c%V\ %p%%%) +-- < +vim.go.rulerformat = "" +vim.go.ruf = vim.go.rulerformat +-- `'runtimepath'` `'rtp'` string (default: "$XDG_CONFIG_HOME/nvim, +-- $XDG_CONFIG_DIRS[1]/nvim, +-- $XDG_CONFIG_DIRS[2]/nvim, +-- … +-- $XDG_DATA_HOME/nvim[-data]/site, +-- $XDG_DATA_DIRS[1]/nvim/site, +-- $XDG_DATA_DIRS[2]/nvim/site, +-- … +-- $VIMRUNTIME, +-- … +-- $XDG_DATA_DIRS[2]/nvim/site/after, +-- $XDG_DATA_DIRS[1]/nvim/site/after, +-- $XDG_DATA_HOME/nvim[-data]/site/after, +-- … +-- $XDG_CONFIG_DIRS[2]/nvim/after, +-- $XDG_CONFIG_DIRS[1]/nvim/after, +-- $XDG_CONFIG_HOME/nvim/after") +-- global +-- List of directories to be searched for these runtime files: +-- filetype.lua filetypes |new-filetype| +-- autoload/ automatically loaded scripts |autoload-functions| +-- colors/ color scheme files |:colorscheme| +-- compiler/ compiler files |:compiler| +-- doc/ documentation |write-local-help| +-- ftplugin/ filetype plugins |write-filetype-plugin| +-- indent/ indent scripts |indent-expression| +-- keymap/ key mapping files |mbyte-keymap| +-- lang/ menu translations |:menutrans| +-- lua/ |Lua| plugins +-- menu.vim GUI menus |menu.vim| +-- pack/ packages |:packadd| +-- parser/ |treesitter| syntax parsers +-- plugin/ plugin scripts |write-plugin| +-- queries/ |treesitter| queries +-- rplugin/ |remote-plugin| scripts +-- spell/ spell checking files |spell| +-- syntax/ syntax files |mysyntaxfile| +-- tutor/ tutorial files |:Tutor| +-- +-- And any other file searched for with the |:runtime| command. +-- +-- Defaults are setup to search these locations: +-- 1. Your home directory, for personal preferences. +-- Given by `stdpath("config")`. |$XDG_CONFIG_HOME| +-- 2. Directories which must contain configuration files according to +-- |xdg| ($XDG_CONFIG_DIRS, defaults to /etc/xdg). This also contains +-- preferences from system administrator. +-- 3. Data home directory, for plugins installed by user. +-- Given by `stdpath("data")/site`. |$XDG_DATA_HOME| +-- 4. nvim/site subdirectories for each directory in $XDG_DATA_DIRS. +-- This is for plugins which were installed by system administrator, +-- but are not part of the Nvim distribution. XDG_DATA_DIRS defaults +-- to /usr/local/share/:/usr/share/, so system administrators are +-- expected to install site plugins to /usr/share/nvim/site. +-- 5. Session state directory, for state data such as swap, backupdir, +-- viewdir, undodir, etc. +-- Given by `stdpath("state")`. |$XDG_STATE_HOME| +-- 6. $VIMRUNTIME, for files distributed with Nvim. +-- +-- 7, 8, 9, 10. In after/ subdirectories of 1, 2, 3 and 4, with reverse +-- ordering. This is for preferences to overrule or add to the +-- distributed defaults or system-wide settings (rarely needed). +-- +-- +-- "start" packages will also be searched (|runtime-search-path|) for +-- runtime files after these, though such packages are not explicitly +-- reported in &runtimepath. But "opt" packages are explicitly added to +-- &runtimepath by |:packadd|. +-- +-- Note that, unlike `'path'` , no wildcards like "" are allowed. Normal +-- wildcards are allowed, but can significantly slow down searching for +-- runtime files. For speed, use as few items as possible and avoid +-- wildcards. +-- See |:runtime|. +-- Example: > +-- :set runtimepath=~/vimruntime,/mygroup/vim,$VIMRUNTIME +-- < This will use the directory "~/vimruntime" first (containing your +-- personal Nvim runtime files), then "/mygroup/vim", and finally +-- "$VIMRUNTIME" (the default runtime files). +-- You can put a directory before $VIMRUNTIME to find files which replace +-- distributed runtime files. You can put a directory after $VIMRUNTIME +-- to find files which add to distributed runtime files. +-- +-- With |--clean| the home directory entries are not included. +vim.go.runtimepath = "/home/runner/.config/nvim,/etc/xdg/nvim,/home/runner/.local/share/nvim/site,/usr/local/share/nvim/site,/usr/share/nvim/site,/tmp/nvim/squashfs-root/usr/share/nvim/runtime,/tmp/nvim/squashfs-root/usr/lib/nvim,/usr/share/nvim/site/after,/usr/local/share/nvim/site/after,/home/runner/.local/share/nvim/site/after,/etc/xdg/nvim/after,/home/runner/.config/nvim/after" +vim.go.rtp = vim.go.runtimepath +-- `'scrolljump'` `'sj'` number (default 1) +-- global +-- Minimal number of lines to scroll when the cursor gets off the +-- screen (e.g., with "j"). Not used for scroll commands (e.g., CTRL-E, +-- CTRL-D). Useful if your terminal scrolls very slowly. +-- When set to a negative number from -1 to -100 this is used as the +-- percentage of the window height. Thus -50 scrolls half the window +-- height. +vim.go.scrolljump = 1 +vim.go.sj = vim.go.scrolljump +-- `'scrollopt'` `'sbo'` string (default "ver,jump") +-- global +-- This is a comma-separated list of words that specifies how +-- `'scrollbind'` windows should behave. `'sbo'` stands for ScrollBind +-- Options. +-- The following words are available: +-- ver Bind vertical scrolling for `'scrollbind'` windows +-- hor Bind horizontal scrolling for `'scrollbind'` windows +-- jump Applies to the offset between two windows for vertical +-- scrolling. This offset is the difference in the first +-- displayed line of the bound windows. When moving +-- around in a window, another `'scrollbind'` window may +-- reach a position before the start or after the end of +-- the buffer. The offset is not changed though, when +-- moving back the `'scrollbind'` window will try to scroll +-- to the desired position when possible. +-- When now making that window the current one, two +-- things can be done with the relative offset: +-- 1. When "jump" is not included, the relative offset is +-- adjusted for the scroll position in the new current +-- window. When going back to the other window, the +-- new relative offset will be used. +-- 2. When "jump" is included, the other windows are +-- scrolled to keep the same relative offset. When +-- going back to the other window, it still uses the +-- same relative offset. +-- Also see |scroll-binding|. +-- When `'diff'` mode is active there always is vertical scroll binding, +-- even when "ver" isn't there. +vim.go.scrollopt = "ver,jump" +vim.go.sbo = vim.go.scrollopt +-- `'sections'` `'sect'` string (default "SHNHH HUnhsh") +-- global +-- Specifies the nroff macros that separate sections. These are pairs of +-- two letters (See |object-motions|). The default makes a section start +-- at the nroff macros ".SH", ".NH", ".H", ".HU", ".nh" and ".sh". +vim.go.sections = "SHNHH HUnhsh" +vim.go.sect = vim.go.sections +vim.go.secure = false +-- `'selection'` `'sel'` string (default "inclusive") +-- global +-- This option defines the behavior of the selection. It is only used +-- in Visual and Select mode. +-- Possible values: +-- value past line inclusive ~ +-- old no yes +-- inclusive yes yes +-- exclusive yes no +-- "past line" means that the cursor is allowed to be positioned one +-- character past the line. +-- "inclusive" means that the last character of the selection is included +-- in an operation. For example, when "x" is used to delete the +-- selection. +-- When "old" is used and `'virtualedit'` allows the cursor to move past +-- the end of line the line break still isn't included. +-- Note that when "exclusive" is used and selecting from the end +-- backwards, you cannot include the last character of a line, when +-- starting in Normal mode and `'virtualedit'` empty. +vim.go.selection = "inclusive" +vim.go.sel = vim.go.selection +-- `'selectmode'` `'slm'` string (default "") +-- global +-- This is a comma-separated list of words, which specifies when to start +-- Select mode instead of Visual mode, when a selection is started. +-- Possible values: +-- mouse when using the mouse +-- key when using shifted special keys +-- cmd when using "v", "V" or CTRL-V +-- See |Select-mode|. +vim.go.selectmode = "" +vim.go.slm = vim.go.selectmode +-- `'sessionoptions'` `'ssop'` string (default: "blank,buffers,curdir,folds, +-- help,tabpages,winsize,terminal") +-- global +-- Changes the effect of the |:mksession| command. It is a comma- +-- separated list of words. Each word enables saving and restoring +-- something: +-- word save and restore ~ +-- blank empty windows +-- buffers hidden and unloaded buffers, not just those in windows +-- curdir the current directory +-- folds manually created folds, opened/closed folds and local +-- fold options +-- globals global variables that start with an uppercase letter +-- and contain at least one lowercase letter. Only +-- String and Number types are stored. +-- help the help window +-- localoptions options and mappings local to a window or buffer (not +-- global values for local options) +-- options all options and mappings (also global values for local +-- options) +-- skiprtp exclude `'runtimepath'` and `'packpath'` from the options +-- resize size of the Vim window: `'lines'` and `'columns'` +-- sesdir the directory in which the session file is located +-- will become the current directory (useful with +-- projects accessed over a network from different +-- systems) +-- tabpages all tab pages; without this only the current tab page +-- is restored, so that you can make a session for each +-- tab page separately +-- terminal include terminal windows where the command can be +-- restored +-- winpos position of the whole Vim window +-- winsize window sizes +-- slash |deprecated| Always enabled. Uses "/" in filenames. +-- unix |deprecated| Always enabled. Uses "\n" line endings. +-- +-- Don't include both "curdir" and "sesdir". When neither is included +-- filenames are stored as absolute paths. +-- If you leave out "options" many things won't work well after restoring +-- the session. +vim.go.sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,terminal" +vim.go.ssop = vim.go.sessionoptions +-- `'shada'` `'sd'` string (default for +-- Win32: !,'100,<50,s10,h,rA:,rB: +-- others: !,'100,<50,s10,h) +-- global +-- When non-empty, the shada file is read upon startup and written +-- when exiting Vim (see |shada-file|). The string should be a comma- +-- separated list of parameters, each consisting of a single character +-- identifying the particular parameter, followed by a number or string +-- which specifies the value of that parameter. If a particular +-- character is left out, then the default value is used for that +-- parameter. The following is a list of the identifying characters and +-- the effect of their value. +-- CHAR VALUE ~ +-- +-- ! When included, save and restore global variables that start +-- with an uppercase letter, and don't contain a lowercase +-- letter. Thus "KEEPTHIS and "K_L_M" are stored, but "KeepThis" +-- and "_K_L_M" are not. Nested List and Dict items may not be +-- read back correctly, you end up with an empty item. +-- +-- " Maximum number of lines saved for each register. Old name of +-- the `'<'` item, with the disadvantage that you need to put a +-- backslash before the ", otherwise it will be recognized as the +-- start of a comment! +-- +-- % When included, save and restore the buffer list. If Vim is +-- started with a file name argument, the buffer list is not +-- restored. If Vim is started without a file name argument, the +-- buffer list is restored from the shada file. Quickfix +-- (`'buftype'` ), unlisted (`'buflisted'` ), unnamed and buffers on +-- removable media (|shada-r|) are not saved. +-- When followed by a number, the number specifies the maximum +-- number of buffers that are stored. Without a number all +-- buffers are stored. +-- +-- ' Maximum number of previously edited files for which the marks +-- are remembered. This parameter must always be included when +-- `'shada'` is non-empty. +-- Including this item also means that the |jumplist| and the +-- |changelist| are stored in the shada file. +-- +-- / Maximum number of items in the search pattern history to be +-- saved. If non-zero, then the previous search and substitute +-- patterns are also saved. When not included, the value of +-- `'history'` is used. +-- +-- : Maximum number of items in the command-line history to be +-- saved. When not included, the value of `'history'` is used. +-- +-- < Maximum number of lines saved for each register. If zero then +-- registers are not saved. When not included, all lines are +-- saved. `'"'` is the old name for this item. +-- Also see the `'s'` item below: limit specified in KiB. +-- +-- @ Maximum number of items in the input-line history to be +-- saved. When not included, the value of `'history'` is used. +-- +-- c Dummy option, kept for compatibility reasons. Has no actual +-- effect: ShaDa always uses UTF-8 and `'encoding'` value is fixed +-- to UTF-8 as well. +-- +-- f Whether file marks need to be stored. If zero, file marks ('0 +-- to '9, 'A to 'Z) are not stored. When not present or when +-- non-zero, they are all stored. '0 is used for the current +-- cursor position (when exiting or when doing |:wshada|). +-- +-- h Disable the effect of `'hlsearch'` when loading the shada +-- file. When not included, it depends on whether ":nohlsearch" +-- has been used since the last search command. +-- +-- n Name of the shada file. The name must immediately follow +-- the `'n'` . Must be at the end of the option! If the +-- `'shadafile'` option is set, that file name overrides the one +-- given here with `'shada'` . Environment variables are +-- expanded when opening the file, not when setting the option. +-- +-- r Removable media. The argument is a string (up to the next +-- `','` ). This parameter can be given several times. Each +-- specifies the start of a path for which no marks will be +-- stored. This is to avoid removable media. For Windows you +-- could use "ra:,rb:". You can also use it for temp files, +-- e.g., for Unix: "r/tmp". Case is ignored. +-- +-- s Maximum size of an item contents in KiB. If zero then nothing +-- is saved. Unlike Vim this applies to all items, except for +-- the buffer list and header. Full item size is off by three +-- unsigned integers: with `s10` maximum item size may be 1 byte +-- (type: 7-bit integer) + 9 bytes (timestamp: up to 64-bit +-- integer) + 3 bytes (item size: up to 16-bit integer because +-- 2^8 < 10240 < 2^16) + 10240 bytes (requested maximum item +-- contents size) = 10253 bytes. +-- +-- Example: > +-- :set shada='50,<1000,s100,:0,n~/nvim/shada +-- < +-- '50 Marks will be remembered for the last 50 files you +-- edited. +-- <1000 Contents of registers (up to 1000 lines each) will be +-- remembered. +-- s100 Items with contents occupying more then 100 KiB are +-- skipped. +-- :0 Command-line history will not be saved. +-- n~/nvim/shada The name of the file to use is "~/nvim/shada". +-- no / Since `'/'` is not specified, the default will be used, +-- that is, save all of the search history, and also the +-- previous search and substitute patterns. +-- no % The buffer list will not be saved nor read back. +-- no h `'hlsearch'` highlighting will be restored. +-- +-- When setting `'shada'` from an empty value you can use |:rshada| to +-- load the contents of the file, this is not done automatically. +-- +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +vim.go.shada = "!,'100,<50,s10,h" +vim.go.sd = vim.go.shada +-- `'shadafile'` `'sdf'` string (default: "") +-- global +-- When non-empty, overrides the file name used for |shada| (viminfo). +-- When equal to "NONE" no shada file will be read or written. +-- This option can be set with the |-i| command line flag. The |--clean| +-- command line flag sets it to "NONE". +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +vim.go.shadafile = "" +vim.go.sdf = vim.go.shadafile +-- `'shell'` `'sh'` string (default $SHELL or "sh", Win32: "cmd.exe") +-- global +-- Name of the shell to use for ! and :! commands. When changing the +-- value also check these options: `'shellpipe'` , `'shellslash'` +-- `'shellredir'` , `'shellquote'` , `'shellxquote'` and `'shellcmdflag'` . +-- It is allowed to give an argument to the command, e.g. "csh -f". +-- See |option-backslash| about including spaces and backslashes. +-- Environment variables are expanded |:set_env|. +-- +-- If the name of the shell contains a space, you need to enclose it in +-- quotes. Example with quotes: > +-- :set shell=\"c:\program\ files\unix\sh.exe\"\ -f +-- < Note the backslash before each quote (to avoid starting a comment) and +-- each space (to avoid ending the option value), so better use |:let-&| +-- like this: > +-- :let &shell='"C:\Program Files\unix\sh.exe" -f' +-- < Also note that the "-f" is not inside the quotes, because it is not +-- part of the command name. +-- +-- Rules regarding quotes: +-- 1. Option is split on space and tab characters that are not inside +-- quotes: "abc def" runs shell named "abc" with additional argument +-- "def", '"abc def"' runs shell named "abc def" with no additional +-- arguments (here and below: additional means “additional to +-- `'shellcmdflag'` ”). +-- 2. Quotes in option may be present in any position and any number: +-- `'"abc"'` , `'"a"bc'` , `'a"b"c'` , `'ab"c"'` and `'"a"b"c"'` are all equivalent +-- to just "abc". +-- 3. Inside quotes backslash preceding backslash means one backslash. +-- Backslash preceding quote means one quote. Backslash preceding +-- anything else means backslash and next character literally: +-- `'"a\\b"'` is the same as "a\b", `'"a\\"b"'` runs shell named literally +-- `'a"b'` , `'"a\b"'` is the same as "a\b" again. +-- 4. Outside of quotes backslash always means itself, it cannot be used +-- to escape quote: `'a\"b"'` is the same as "a\b". +-- Note that such processing is done after |:set| did its own round of +-- unescaping, so to keep yourself sane use |:let-&| like shown above. +-- +-- To use PowerShell: > +-- let &shell = executable(`'pwsh'` ) ? `'pwsh'` : `'powershell'` +-- let &shellcmdflag = '-NoLogo -ExecutionPolicy RemoteSigned -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.UTF8Encoding]::new();$PSDefaultParameterValues[`''` Out-File:Encoding`''` ]=`''` utf8`''` ;Remove-Alias -Force -ErrorAction SilentlyContinue tee;' +-- let &shellredir = '2>&1 | %%{ "$_" } | Out-File %s; exit $LastExitCode' +-- let &shellpipe = '2>&1 | %%{ "$_" } | tee %s; exit $LastExitCode' +-- set shellquote= shellxquote= +-- +-- < This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +vim.go.shell = "sh" +vim.go.sh = vim.go.shell +-- `'shellcmdflag'` `'shcf'` string (default: "-c"; Windows: "/s /c") +-- global +-- Flag passed to the shell to execute "!" and ":!" commands; e.g., +-- `bash.exe -c ls` or `cmd.exe /s /c "dir"`. For MS-Windows, the +-- default is set according to the value of `'shell'` , to reduce the need +-- to set this option by the user. +-- On Unix it can have more than one flag. Each white space separated +-- part is passed as an argument to the shell command. +-- See |option-backslash| about including spaces and backslashes. +-- See |shell-unquoting| which talks about separating this option into +-- multiple arguments. +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +vim.go.shellcmdflag = "-c" +vim.go.shcf = vim.go.shellcmdflag +-- `'shellpipe'` `'sp'` string (default ">", "| tee", "|& tee" or "2>&1| tee") +-- global +-- String to be used to put the output of the ":make" command in the +-- error file. See also |:make_makeprg|. See |option-backslash| about +-- including spaces and backslashes. +-- The name of the temporary file can be represented by "%s" if necessary +-- (the file name is appended automatically if no %s appears in the value +-- of this option). +-- For MS-Windows the default is "2>&1| tee". The stdout and stderr are +-- saved in a file and echoed to the screen. +-- For Unix the default is "| tee". The stdout of the compiler is saved +-- in a file and echoed to the screen. If the `'shell'` option is "csh" or +-- "tcsh" after initializations, the default becomes "|& tee". If the +-- `'shell'` option is "sh", "ksh", "mksh", "pdksh", "zsh", "zsh-beta", +-- "bash", "fish", "ash" or "dash" the default becomes "2>&1| tee". This +-- means that stderr is also included. Before using the `'shell'` option a +-- path is removed, thus "/bin/sh" uses "sh". +-- The initialization of this option is done after reading the vimrc +-- and the other initializations, so that when the `'shell'` option is set +-- there, the `'shellpipe'` option changes automatically, unless it was +-- explicitly set before. +-- When `'shellpipe'` is set to an empty string, no redirection of the +-- ":make" output will be done. This is useful if you use a `'makeprg'` +-- that writes to `'makeef'` by itself. If you want no piping, but do +-- want to include the `'makeef'` , set `'shellpipe'` to a single space. +-- Don't forget to precede the space with a backslash: ":set sp=\ ". +-- In the future pipes may be used for filtering and this option will +-- become obsolete (at least for Unix). +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +vim.go.shellpipe = "| tee" +vim.go.sp = vim.go.shellpipe +-- `'shellquote'` `'shq'` string (default: ""; Windows, when `'shell'` +-- contains "sh" somewhere: "\"") +-- global +-- Quoting character(s), put around the command passed to the shell, for +-- the "!" and ":!" commands. The redirection is kept outside of the +-- quoting. See `'shellxquote'` to include the redirection. It's +-- probably not useful to set both options. +-- This is an empty string by default. Only known to be useful for +-- third-party shells on Windows systems, such as the MKS Korn Shell +-- or bash, where it should be "\"". The default is adjusted according +-- the value of `'shell'` , to reduce the need to set this option by the +-- user. +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +vim.go.shellquote = "" +vim.go.shq = vim.go.shellquote +-- `'shellredir'` `'srr'` string (default ">", ">&" or ">%s 2>&1") +-- global +-- String to be used to put the output of a filter command in a temporary +-- file. See also |:!|. See |option-backslash| about including spaces +-- and backslashes. +-- The name of the temporary file can be represented by "%s" if necessary +-- (the file name is appended automatically if no %s appears in the value +-- of this option). +-- The default is ">". For Unix, if the `'shell'` option is "csh" or +-- "tcsh" during initializations, the default becomes ">&". If the +-- `'shell'` option is "sh", "ksh", "mksh", "pdksh", "zsh", "zsh-beta", +-- "bash" or "fish", the default becomes ">%s 2>&1". This means that +-- stderr is also included. For Win32, the Unix checks are done and +-- additionally "cmd" is checked for, which makes the default ">%s 2>&1". +-- Also, the same names with ".exe" appended are checked for. +-- The initialization of this option is done after reading the vimrc +-- and the other initializations, so that when the `'shell'` option is set +-- there, the `'shellredir'` option changes automatically unless it was +-- explicitly set before. +-- In the future pipes may be used for filtering and this option will +-- become obsolete (at least for Unix). +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +vim.go.shellredir = ">" +vim.go.srr = vim.go.shellredir +-- `'shellslash'` `'ssl'` boolean (default off) +-- global +-- {only for MS-Windows} +-- When set, a forward slash is used when expanding file names. This is +-- useful when a Unix-like shell is used instead of cmd.exe. Backward +-- slashes can still be typed, but they are changed to forward slashes by +-- Vim. +-- Note that setting or resetting this option has no effect for some +-- existing file names, thus this option needs to be set before opening +-- any file for best results. This might change in the future. +-- `'shellslash'` only works when a backslash can be used as a path +-- separator. To test if this is so use: > +-- if exists(`'+shellslash'` ) +-- < Also see `'completeslash'` . +vim.go.shellslash = false +vim.go.ssl = vim.go.shellslash +-- `'shelltemp'` `'stmp'` boolean (default on) +-- global +-- When on, use temp files for shell commands. When off use a pipe. +-- When using a pipe is not possible temp files are used anyway. +-- The advantage of using a pipe is that nobody can read the temp file +-- and the `'shell'` command does not need to support redirection. +-- The advantage of using a temp file is that the file type and encoding +-- can be detected. +-- The |FilterReadPre|, |FilterReadPost| and |FilterWritePre|, +-- |FilterWritePost| autocommands event are not triggered when +-- `'shelltemp'` is off. +-- |system()| does not respect this option, it always uses pipes. +vim.go.shelltemp = true +vim.go.stmp = vim.go.shelltemp +-- `'shellxescape'` `'sxe'` string (default: "") +-- global +-- When `'shellxquote'` is set to "(" then the characters listed in this +-- option will be escaped with a `'^'` character. This makes it possible +-- to execute most external commands with cmd.exe. +vim.go.shellxescape = "" +vim.go.sxe = vim.go.shellxescape +-- `'shellxquote'` `'sxq'` string (default: "", Windows: "\"") +-- global +-- Quoting character(s), put around the command passed to the shell, for +-- the "!" and ":!" commands. Includes the redirection. See +-- `'shellquote'` to exclude the redirection. It's probably not useful +-- to set both options. +-- When the value is `'('` then `')'` is appended. When the value is `'"('` +-- then `')"'` is appended. +-- When the value is `'('` then also see `'shellxescape'` . +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +vim.go.shellxquote = "" +vim.go.sxq = vim.go.shellxquote +-- `'shiftround'` `'sr'` boolean (default off) +-- global +-- Round indent to multiple of `'shiftwidth'` . Applies to > and < +-- commands. CTRL-T and CTRL-D in Insert mode always round the indent to +-- a multiple of `'shiftwidth'` (this is Vi compatible). +vim.go.shiftround = false +vim.go.sr = vim.go.shiftround +-- `'shortmess'` `'shm'` string (default "filnxtToOCF") +-- global +-- This option helps to avoid all the |hit-enter| prompts caused by file +-- messages, for example with CTRL-G, and to avoid some other messages. +-- It is a list of flags: +-- flag meaning when present ~ +-- f use "(3 of 5)" instead of "(file 3 of 5)" +-- i use "[noeol]" instead of "[Incomplete last line]" +-- l use "999L, 888B" instead of "999 lines, 888 bytes" +-- m use "[+]" instead of "[Modified]" +-- n use "[New]" instead of "[New File]" +-- r use "[RO]" instead of "[readonly]" +-- w use "[w]" instead of "written" for file write message +-- and "[a]" instead of "appended" for ':w >> file' command +-- x use "[dos]" instead of "[dos format]", "[unix]" +-- instead of "[unix format]" and "[mac]" instead of "[mac +-- format]" +-- a all of the above abbreviations +-- +-- o overwrite message for writing a file with subsequent +-- message for reading a file (useful for ":wn" or when +-- `'autowrite'` on) +-- O message for reading a file overwrites any previous +-- message; also for quickfix message (e.g., ":cn") +-- s don't give "search hit BOTTOM, continuing at TOP" or +-- "search hit TOP, continuing at BOTTOM" messages; when using +-- the search count do not show "W" after the count message (see +-- S below) +-- t truncate file message at the start if it is too long +-- to fit on the command-line, "<" will appear in the left most +-- column; ignored in Ex mode +-- T truncate other messages in the middle if they are too +-- long to fit on the command line; "..." will appear in the +-- middle; ignored in Ex mode +-- W don't give "written" or "[w]" when writing a file +-- A don't give the "ATTENTION" message when an existing +-- swap file is found +-- I don't give the intro message when starting Vim, +-- see |:intro| +-- c don't give |ins-completion-menu| messages; for +-- example, "-- XXX completion (YYY)", "match 1 of 2", "The only +-- match", "Pattern not found", "Back at original", etc. +-- C don't give messages while scanning for ins-completion +-- items, for instance "scanning tags" +-- q use "recording" instead of "recording @a" +-- F don't give the file info when editing a file, like +-- `:silent` was used for the command +-- S do not show search count message when searching, e.g. +-- "[1/5]" +-- +-- This gives you the opportunity to avoid that a change between buffers +-- requires you to hit , but still gives as useful a message as +-- possible for the space available. To get the whole message that you +-- would have got with `'shm'` empty, use ":file!" +-- Useful values: +-- shm= No abbreviation of message. +-- shm=a Abbreviation, but no loss of information. +-- shm=at Abbreviation, and truncate message when necessary. +vim.go.shortmess = "filnxtToOCF" +vim.go.shm = vim.go.shortmess +-- `'showcmd'` `'sc'` boolean (default: on) +-- global +-- Show (partial) command in the last line of the screen. Set this +-- option off if your terminal is slow. +-- In Visual mode the size of the selected area is shown: +-- - When selecting characters within a line, the number of characters. +-- If the number of bytes is different it is also displayed: "2-6" +-- means two characters and six bytes. +-- - When selecting more than one line, the number of lines. +-- - When selecting a block, the size in screen characters: +-- {lines}x{columns}. +-- This information can be displayed in an alternative location using the +-- `'showcmdloc'` option, useful when `'cmdheight'` is 0. +vim.go.showcmd = true +vim.go.sc = vim.go.showcmd +-- `'showcmdloc'` `'sloc'` string (default "last") +-- global +-- This option can be used to display the (partially) entered command in +-- another location. Possible values are: +-- last Last line of the screen (default). +-- statusline Status line of the current window. +-- tabline First line of the screen if `'showtabline'` is enabled. +-- Setting this option to "statusline" or "tabline" means that these will +-- be redrawn whenever the command changes, which can be on every key +-- pressed. +-- The %S `'statusline'` item can be used in `'statusline'` or `'tabline'` to +-- place the text. Without a custom `'statusline'` or `'tabline'` it will be +-- displayed in a convenient location. +vim.go.showcmdloc = "last" +vim.go.sloc = vim.go.showcmdloc +-- `'showfulltag'` `'sft'` boolean (default off) +-- global +-- When completing a word in insert mode (see |ins-completion|) from the +-- tags file, show both the tag name and a tidied-up form of the search +-- pattern (if there is one) as possible matches. Thus, if you have +-- matched a C function, you can see a template for what arguments are +-- required (coding style permitting). +-- Note that this doesn't work well together with having "longest" in +-- `'completeopt'` , because the completion from the search pattern may not +-- match the typed text. +vim.go.showfulltag = false +vim.go.sft = vim.go.showfulltag +-- `'showmatch'` `'sm'` boolean (default off) +-- global +-- When a bracket is inserted, briefly jump to the matching one. The +-- jump is only done if the match can be seen on the screen. The time to +-- show the match can be set with `'matchtime'` . +-- A Beep is given if there is no match (no matter if the match can be +-- seen or not). +-- When the `'m'` flag is not included in `'cpoptions'` , typing a character +-- will immediately move the cursor back to where it belongs. +-- See the "sm" field in `'guicursor'` for setting the cursor shape and +-- blinking when showing the match. +-- The `'matchpairs'` option can be used to specify the characters to show +-- matches for. `'rightleft'` and `'revins'` are used to look for opposite +-- matches. +-- Also see the matchparen plugin for highlighting the match when moving +-- around |pi_paren.txt|. +-- Note: Use of the short form is rated PG. +vim.go.showmatch = false +vim.go.sm = vim.go.showmatch +-- `'showmode'` `'smd'` boolean (default: on) +-- global +-- If in Insert, Replace or Visual mode put a message on the last line. +-- The |hl-ModeMsg| highlight group determines the highlighting. +-- The option has no effect when `'cmdheight'` is zero. +vim.go.showmode = true +vim.go.smd = vim.go.showmode +-- `'showtabline'` `'stal'` number (default 1) +-- global +-- The value of this option specifies when the line with tab page labels +-- will be displayed: +-- 0: never +-- 1: only if there are at least two tab pages +-- 2: always +-- This is both for the GUI and non-GUI implementation of the tab pages +-- line. +-- See |tab-page| for more information about tab pages. +vim.go.showtabline = 1 +vim.go.stal = vim.go.showtabline +-- `'sidescroll'` `'ss'` number (default 1) +-- global +-- The minimal number of columns to scroll horizontally. Used only when +-- the `'wrap'` option is off and the cursor is moved off of the screen. +-- When it is zero the cursor will be put in the middle of the screen. +-- When using a slow terminal set it to a large number or 0. Not used +-- for "zh" and "zl" commands. +vim.go.sidescroll = 1 +vim.go.ss = vim.go.sidescroll +-- `'smartcase'` `'scs'` boolean (default off) +-- global +-- Override the `'ignorecase'` option if the search pattern contains upper +-- case characters. Only used when the search pattern is typed and +-- `'ignorecase'` option is on. Used for the commands "/", "?", "n", "N", +-- ":g" and ":s". Not used for "*", "#", "gd", tag search, etc. After +-- "*" and "#" you can make `'smartcase'` used by doing a "/" command, +-- recalling the search pattern from history and hitting . +vim.go.smartcase = false +vim.go.scs = vim.go.smartcase +-- `'smarttab'` `'sta'` boolean (default on) +-- global +-- When on, a in front of a line inserts blanks according to +-- `'shiftwidth'` . `'tabstop'` or `'softtabstop'` is used in other places. A +-- will delete a `'shiftwidth'` worth of space at the start of the +-- line. +-- When off, a always inserts blanks according to `'tabstop'` or +-- `'softtabstop'` . `'shiftwidth'` is only used for shifting text left or +-- right |shift-left-right|. +-- What gets inserted (a or spaces) depends on the `'expandtab'` +-- option. Also see |ins-expandtab|. When `'expandtab'` is not set, the +-- number of spaces is minimized by using s. +vim.go.smarttab = true +vim.go.sta = vim.go.smarttab +-- `'spellsuggest'` `'sps'` string (default "best") +-- global +-- Methods used for spelling suggestions. Both for the |z=| command and +-- the |spellsuggest()| function. This is a comma-separated list of +-- items: +-- +-- best Internal method that works best for English. Finds +-- changes like "fast" and uses a bit of sound-a-like +-- scoring to improve the ordering. +-- +-- double Internal method that uses two methods and mixes the +-- results. The first method is "fast", the other method +-- computes how much the suggestion sounds like the bad +-- word. That only works when the language specifies +-- sound folding. Can be slow and doesn't always give +-- better results. +-- +-- fast Internal method that only checks for simple changes: +-- character inserts/deletes/swaps. Works well for +-- simple typing mistakes. +-- +-- {number} The maximum number of suggestions listed for |z=|. +-- Not used for |spellsuggest()|. The number of +-- suggestions is never more than the value of `'lines'` +-- minus two. +-- +-- timeout:{millisec} Limit the time searching for suggestions to +-- {millisec} milli seconds. Applies to the following +-- methods. When omitted the limit is 5000. When +-- negative there is no limit. +-- +-- file:{filename} Read file {filename}, which must have two columns, +-- separated by a slash. The first column contains the +-- bad word, the second column the suggested good word. +-- Example: +-- theribal/terrible ~ +-- Use this for common mistakes that do not appear at the +-- top of the suggestion list with the internal methods. +-- Lines without a slash are ignored, use this for +-- comments. +-- The word in the second column must be correct, +-- otherwise it will not be used. Add the word to an +-- ".add" file if it is currently flagged as a spelling +-- mistake. +-- The file is used for all languages. +-- +-- expr:{expr} Evaluate expression {expr}. Use a function to avoid +-- trouble with spaces. |v:val| holds the badly spelled +-- word. The expression must evaluate to a List of +-- Lists, each with a suggestion and a score. +-- Example: +-- [[`'the'` , 33], [`'that'` , 44]] ~ +-- Set `'verbose'` and use |z=| to see the scores that the +-- internal methods use. A lower score is better. +-- This may invoke |spellsuggest()| if you temporarily +-- set `'spellsuggest'` to exclude the "expr:" part. +-- Errors are silently ignored, unless you set the +-- `'verbose'` option to a non-zero value. +-- +-- Only one of "best", "double" or "fast" may be used. The others may +-- appear several times in any order. Example: > +-- :set sps=file:~/.config/nvim/sugg,best,expr:MySuggest() +-- < +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +vim.go.spellsuggest = "best" +vim.go.sps = vim.go.spellsuggest +-- `'splitbelow'` `'sb'` boolean (default off) +-- global +-- When on, splitting a window will put the new window below the current +-- one. |:split| +vim.go.splitbelow = false +vim.go.sb = vim.go.splitbelow +-- `'splitkeep'` `'spk'` string (default "cursor") +-- global +-- The value of this option determines the scroll behavior when opening, +-- closing or resizing horizontal splits. +-- +-- Possible values are: +-- cursor Keep the same relative cursor position. +-- screen Keep the text on the same screen line. +-- topline Keep the topline the same. +-- +-- For the "screen" and "topline" values, the cursor position will be +-- changed when necessary. In this case, the jumplist will be populated +-- with the previous cursor position. For "screen", the text cannot always +-- be kept on the same screen line when `'wrap'` is enabled. +vim.go.splitkeep = "cursor" +vim.go.spk = vim.go.splitkeep +-- `'splitright'` `'spr'` boolean (default off) +-- global +-- When on, splitting a window will put the new window right of the +-- current one. |:vsplit| +vim.go.splitright = false +vim.go.spr = vim.go.splitright +-- `'startofline'` `'sol'` boolean (default off) +-- global +-- When "on" the commands listed below move the cursor to the first +-- non-blank of the line. When off the cursor is kept in the same column +-- (if possible). This applies to the commands: +-- - CTRL-D, CTRL-U, CTRL-B, CTRL-F, "G", "H", "M", "L", "gg" +-- - "d", "<<" and ">>" with a linewise operator +-- - "%" with a count +-- - buffer changing commands (CTRL-^, :bnext, :bNext, etc.) +-- - Ex commands that only have a line number, e.g., ":25" or ":+". +-- In case of buffer changing commands the cursor is placed at the column +-- where it was the last time the buffer was edited. +vim.go.startofline = false +vim.go.sol = vim.go.startofline +-- `'suffixes'` `'su'` string (default ".bak,~,.o,.h,.info,.swp,.obj") +-- global +-- Files with these suffixes get a lower priority when multiple files +-- match a wildcard. See |suffixes|. Commas can be used to separate the +-- suffixes. Spaces after the comma are ignored. A dot is also seen as +-- the start of a suffix. To avoid a dot or comma being recognized as a +-- separator, precede it with a backslash (see |option-backslash| about +-- including spaces and backslashes). +-- See `'wildignore'` for completely ignoring files. +-- The use of |:set+=| and |:set-=| is preferred when adding or removing +-- suffixes from the list. This avoids problems when a future version +-- uses another default. +vim.go.suffixes = ".bak,~,.o,.h,.info,.swp,.obj" +vim.go.su = vim.go.suffixes +-- `'switchbuf'` `'swb'` string (default "uselast") +-- global +-- This option controls the behavior when switching between buffers. +-- This option is checked, when +-- - jumping to errors with the |quickfix| commands (|:cc|, |:cn|, |:cp|, +-- etc.) +-- - jumping to a tag using the |:stag| command. +-- - opening a file using the |CTRL-W_f| or |CTRL-W_F| command. +-- - jumping to a buffer using a buffer split command (e.g. |:sbuffer|, +-- |:sbnext|, or |:sbrewind|). +-- Possible values (comma-separated list): +-- useopen If included, jump to the first open window in the +-- current tab page that contains the specified buffer +-- (if there is one). Otherwise: Do not examine other +-- windows. +-- usetab Like "useopen", but also consider windows in other tab +-- pages. +-- split If included, split the current window before loading +-- a buffer for a |quickfix| command that display errors. +-- Otherwise: do not split, use current window (when used +-- in the quickfix window: the previously used window or +-- split if there is no other window). +-- vsplit Just like "split" but split vertically. +-- newtab Like "split", but open a new tab page. Overrules +-- "split" when both are present. +-- uselast If included, jump to the previously used window when +-- jumping to errors with |quickfix| commands. +vim.go.switchbuf = "uselast" +vim.go.swb = vim.go.switchbuf +-- `'tabline'` `'tal'` string (default empty) +-- global +-- When non-empty, this option determines the content of the tab pages +-- line at the top of the Vim window. When empty Vim will use a default +-- tab pages line. See |setting-tabline| for more info. +-- +-- The tab pages line only appears as specified with the `'showtabline'` +-- option and only when there is no GUI tab line. When `'e'` is in +-- `'guioptions'` and the GUI supports a tab line `'guitablabel'` is used +-- instead. Note that the two tab pages lines are very different. +-- +-- The value is evaluated like with `'statusline'` . You can use +-- |tabpagenr()|, |tabpagewinnr()| and |tabpagebuflist()| to figure out +-- the text to be displayed. Use "%1T" for the first label, "%2T" for +-- the second one, etc. Use "%X" items for closing labels. +-- +-- When changing something that is used in `'tabline'` that does not +-- trigger it to be updated, use |:redrawtabline|. +-- This option cannot be set in a modeline when `'modelineexpr'` is off. +-- +-- Keep in mind that only one of the tab pages is the current one, others +-- are invisible and you can't jump to their windows. +vim.go.tabline = "" +vim.go.tal = vim.go.tabline +-- `'tabpagemax'` `'tpm'` number (default 50) +-- global +-- Maximum number of tab pages to be opened by the |-p| command line +-- argument or the ":tab all" command. |tabpage| +vim.go.tabpagemax = 50 +vim.go.tpm = vim.go.tabpagemax +-- `'tagbsearch'` `'tbs'` boolean (default on) +-- global +-- When searching for a tag (e.g., for the |:ta| command), Vim can either +-- use a binary search or a linear search in a tags file. Binary +-- searching makes searching for a tag a LOT faster, but a linear search +-- will find more tags if the tags file wasn't properly sorted. +-- Vim normally assumes that your tags files are sorted, or indicate that +-- they are not sorted. Only when this is not the case does the +-- `'tagbsearch'` option need to be switched off. +-- +-- When `'tagbsearch'` is on, binary searching is first used in the tags +-- files. In certain situations, Vim will do a linear search instead for +-- certain files, or retry all files with a linear search. When +-- `'tagbsearch'` is off, only a linear search is done. +-- +-- Linear searching is done anyway, for one file, when Vim finds a line +-- at the start of the file indicating that it's not sorted: > +-- !_TAG_FILE_SORTED 0 /some comment/ +-- < [The whitespace before and after the `'0'` must be a single ] +-- +-- When a binary search was done and no match was found in any of the +-- files listed in `'tags'` , and case is ignored or a pattern is used +-- instead of a normal tag name, a retry is done with a linear search. +-- Tags in unsorted tags files, and matches with different case will only +-- be found in the retry. +-- +-- If a tag file indicates that it is case-fold sorted, the second, +-- linear search can be avoided when case is ignored. Use a value of `'2'` +-- in the "!_TAG_FILE_SORTED" line for this. A tag file can be case-fold +-- sorted with the -f switch to "sort" in most unices, as in the command: +-- "sort -f -o tags tags". For Universal ctags and Exuberant ctags +-- version 5.x or higher (at least 5.5) the --sort=foldcase switch can be +-- used for this as well. Note that case must be folded to uppercase for +-- this to work. +-- +-- By default, tag searches are case-sensitive. Case is ignored when +-- `'ignorecase'` is set and `'tagcase'` is "followic", or when `'tagcase'` is +-- "ignore". +-- Also when `'tagcase'` is "followscs" and `'smartcase'` is set, or +-- `'tagcase'` is "smart", and the pattern contains only lowercase +-- characters. +-- +-- When `'tagbsearch'` is off, tags searching is slower when a full match +-- exists, but faster when no full match exists. Tags in unsorted tags +-- files may only be found with `'tagbsearch'` off. +-- When the tags file is not sorted, or sorted in a wrong way (not on +-- ASCII byte value), `'tagbsearch'` should be off, or the line given above +-- must be included in the tags file. +-- This option doesn't affect commands that find all matching tags (e.g., +-- command-line completion and ":help"). +vim.go.tagbsearch = true +vim.go.tbs = vim.go.tagbsearch +-- `'taglength'` `'tl'` number (default 0) +-- global +-- If non-zero, tags are significant up to this number of characters. +vim.go.taglength = 0 +vim.go.tl = vim.go.taglength +-- `'tagrelative'` `'tr'` boolean (default: on) +-- global +-- If on and using a tags file in another directory, file names in that +-- tags file are relative to the directory where the tags file is. +vim.go.tagrelative = true +vim.go.tr = vim.go.tagrelative +-- `'tagstack'` `'tgst'` boolean (default on) +-- global +-- When on, the |tagstack| is used normally. When off, a ":tag" or +-- ":tselect" command with an argument will not push the tag onto the +-- tagstack. A following ":tag" without an argument, a ":pop" command or +-- any other command that uses the tagstack will use the unmodified +-- tagstack, but does change the pointer to the active entry. +-- Resetting this option is useful when using a ":tag" command in a +-- mapping which should not change the tagstack. +vim.go.tagstack = true +vim.go.tgst = vim.go.tagstack +-- `'termbidi'` `'tbidi'` boolean (default off) +-- global +-- The terminal is in charge of Bi-directionality of text (as specified +-- by Unicode). The terminal is also expected to do the required shaping +-- that some languages (such as Arabic) require. +-- Setting this option implies that `'rightleft'` will not be set when +-- `'arabic'` is set and the value of `'arabicshape'` will be ignored. +-- Note that setting `'termbidi'` has the immediate effect that +-- `'arabicshape'` is ignored, but `'rightleft'` isn't changed automatically. +-- For further details see |arabic.txt|. +vim.go.termbidi = false +vim.go.tbidi = vim.go.termbidi +vim.go.termencoding = "" +vim.go.tenc = vim.go.termencoding +-- `'termguicolors'` `'tgc'` boolean (default off) +-- global +-- Enables 24-bit RGB color in the |TUI|. Uses "gui" |:highlight| +-- attributes instead of "cterm" attributes. |guifg| +-- Requires an ISO-8613-3 compatible terminal. +vim.go.termguicolors = false +vim.go.tgc = vim.go.termguicolors +-- `'termpastefilter'` `'tpf'` string (default: "BS,HT,ESC,DEL") +-- global +-- A comma-separated list of options for specifying control characters +-- to be removed from the text pasted into the terminal window. The +-- supported values are: +-- +-- BS Backspace +-- +-- HT TAB +-- +-- FF Form feed +-- +-- ESC Escape +-- +-- DEL DEL +-- +-- C0 Other control characters, excluding Line feed and +-- Carriage return < ' ' +-- +-- C1 Control characters 0x80...0x9F +vim.go.termpastefilter = "BS,HT,ESC,DEL" +vim.go.tpf = vim.go.termpastefilter +vim.go.terse = false +-- `'tildeop'` `'top'` boolean (default off) +-- global +-- When on: The tilde command "~" behaves like an operator. +vim.go.tildeop = false +vim.go.top = vim.go.tildeop +-- `'timeout'` `'to'` boolean (default on) +-- global +-- This option and `'timeoutlen'` determine the behavior when part of a +-- mapped key sequence has been received. For example, if is +-- pressed and `'timeout'` is set, Nvim will wait `'timeoutlen'` milliseconds +-- for any key that can follow in a mapping. +vim.go.timeout = true +vim.go.to = vim.go.timeout +-- `'timeoutlen'` `'tm'` number (default 1000) +-- global +-- Time in milliseconds to wait for a mapped sequence to complete. +vim.go.timeoutlen = 1000 +vim.go.tm = vim.go.timeoutlen +-- `'title'` boolean (default off) +-- global +-- When on, the title of the window will be set to the value of +-- `'titlestring'` (if it is not empty), or to: +-- filename [+=-] (path) - NVIM +-- Where: +-- filename the name of the file being edited +-- - indicates the file cannot be modified, `'ma'` off +-- + indicates the file was modified +-- = indicates the file is read-only +-- =+ indicates the file is read-only and modified +-- (path) is the path of the file being edited +-- - NVIM the server name |v:servername| or "NVIM" +vim.go.title = false +-- `'titlelen'` number (default 85) +-- global +-- Gives the percentage of `'columns'` to use for the length of the window +-- title. When the title is longer, only the end of the path name is +-- shown. A `'<'` character before the path name is used to indicate this. +-- Using a percentage makes this adapt to the width of the window. But +-- it won't work perfectly, because the actual number of characters +-- available also depends on the font used and other things in the title +-- bar. When `'titlelen'` is zero the full path is used. Otherwise, +-- values from 1 to 30000 percent can be used. +-- `'titlelen'` is also used for the `'titlestring'` option. +vim.go.titlelen = 85 +-- `'titleold'` string (default "") +-- global +-- If not empty, this option will be used to set the window title when +-- exiting. Only if `'title'` is enabled. +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +vim.go.titleold = "" +-- `'titlestring'` string (default "") +-- global +-- When this option is not empty, it will be used for the title of the +-- window. This happens only when the `'title'` option is on. +-- +-- When this option contains printf-style `'%'` items, they will be +-- expanded according to the rules used for `'statusline'` . +-- This option cannot be set in a modeline when `'modelineexpr'` is off. +-- +-- Example: > +-- :auto BufEnter * let &titlestring = hostname() .. "/" .. expand("%:p") +-- :set title titlestring=%<%F%=%l/%L-%P titlelen=70 +-- < The value of `'titlelen'` is used to align items in the middle or right +-- of the available space. +-- Some people prefer to have the file name first: > +-- :set titlestring=%t%(\ %M%)%(\ (%{expand(\"%:~:.:h\")})%)%(\ %a%) +-- < Note the use of "%{ }" and an expression to get the path of the file, +-- without the file name. The "%( %)" constructs are used to add a +-- separating space only when needed. +-- NOTE: Use of special characters in `'titlestring'` may cause the display +-- to be garbled (e.g., when it contains a CR or NL character). +vim.go.titlestring = "" +-- `'ttimeout'` boolean (default on) +-- global +-- This option and `'ttimeoutlen'` determine the behavior when part of a +-- key code sequence has been received by the |TUI|. +-- +-- For example if (the \x1b byte) is received and `'ttimeout'` is +-- set, Nvim waits `'ttimeoutlen'` milliseconds for the terminal to +-- complete a key code sequence. If no input arrives before the timeout, +-- a single is assumed. Many TUI cursor key codes start with . +-- +-- On very slow systems this may fail, causing cursor keys not to work +-- sometimes. If you discover this problem you can ":set ttimeoutlen=9999". +-- Nvim will wait for the next character to arrive after an . +vim.go.ttimeout = true +-- `'ttimeoutlen'` `'ttm'` number (default 50) +-- global +-- Time in milliseconds to wait for a key code sequence to complete. Also +-- used for CTRL-\ CTRL-N and CTRL-\ CTRL-G when part of a command has +-- been typed. +vim.go.ttimeoutlen = 50 +vim.go.ttm = vim.go.ttimeoutlen +vim.go.ttyfast = true +vim.go.tf = vim.go.ttyfast +-- `'undodir'` `'udir'` string (default "$XDG_STATE_HOME/nvim/undo//") +-- global +-- List of directory names for undo files, separated with commas. +-- See `'backupdir'` for details of the format. +-- "." means using the directory of the file. The undo file name for +-- "file.txt" is ".file.txt.un~". +-- For other directories the file name is the full path of the edited +-- file, with path separators replaced with "%". +-- When writing: The first directory that exists is used. "." always +-- works, no directories after "." will be used for writing. If none of +-- the directories exist Nvim will attempt to create the last directory in +-- the list. +-- When reading all entries are tried to find an undo file. The first +-- undo file that exists is used. When it cannot be read an error is +-- given, no further entry is used. +-- See |undo-persistence|. +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +-- +-- Note that unlike `'directory'` and `'backupdir'` , `'undodir'` always acts as +-- though the trailing slashes are present (see `'backupdir'` for what this +-- means). +vim.go.undodir = "/home/runner/.local/state/nvim/undo//" +vim.go.udir = vim.go.undodir +-- `'undoreload'` `'ur'` number (default 10000) +-- global +-- Save the whole buffer for undo when reloading it. This applies to the +-- ":e!" command and reloading for when the buffer changed outside of +-- Vim. |FileChangedShell| +-- The save only happens when this option is negative or when the number +-- of lines is smaller than the value of this option. +-- Set this option to zero to disable undo for a reload. +-- +-- When saving undo for a reload, any undo file is not read. +-- +-- Note that this causes the whole buffer to be stored in memory. Set +-- this option to a lower value if you run out of memory. +vim.go.undoreload = 10000 +vim.go.ur = vim.go.undoreload +-- `'updatecount'` `'uc'` number (default: 200) +-- global +-- After typing this many characters the swap file will be written to +-- disk. When zero, no swap file will be created at all (see chapter on +-- recovery |crash-recovery|). `'updatecount'` is set to zero by starting +-- Vim with the "-n" option, see |startup|. When editing in readonly +-- mode this option will be initialized to 10000. +-- The swapfile can be disabled per buffer with |`'swapfile'` |. +-- When `'updatecount'` is set from zero to non-zero, swap files are +-- created for all buffers that have `'swapfile'` set. When `'updatecount'` +-- is set to zero, existing swap files are not deleted. +-- This option has no meaning in buffers where |`'buftype'` | is "nofile" +-- or "nowrite". +vim.go.updatecount = 200 +vim.go.uc = vim.go.updatecount +-- `'updatetime'` `'ut'` number (default 4000) +-- global +-- If this many milliseconds nothing is typed the swap file will be +-- written to disk (see |crash-recovery|). Also used for the +-- |CursorHold| autocommand event. +vim.go.updatetime = 4000 +vim.go.ut = vim.go.updatetime +-- `'verbose'` `'vbs'` number (default 0) +-- global +-- Sets the verbosity level. Also set by |-V| and |:verbose|. +-- +-- Tracing of options in Lua scripts is activated at level 1; Lua scripts +-- are not traced with verbose=0, for performance. +-- +-- If greater than or equal to a given level, Nvim produces the following +-- messages: +-- +-- Level Messages ~ +-- ---------------------------------------------------------------------- +-- 1 Lua assignments to options, mappings, etc. +-- 2 When a file is ":source"'ed, or |shada| file is read or written. +-- 3 UI info, terminal capabilities. +-- 4 Shell commands. +-- 5 Every searched tags file and include file. +-- 8 Files for which a group of autocommands is executed. +-- 9 Executed autocommands. +-- 11 Finding items in a path. +-- 12 Vimscript function calls. +-- 13 When an exception is thrown, caught, finished, or discarded. +-- 14 Anything pending in a ":finally" clause. +-- 15 Ex commands from a script (truncated at 200 characters). +-- 16 Ex commands. +-- +-- If `'verbosefile'` is set then the verbose messages are not displayed. +vim.go.verbose = 0 +vim.go.vbs = vim.go.verbose +-- `'verbosefile'` `'vfile'` string (default empty) +-- global +-- When not empty all messages are written in a file with this name. +-- When the file exists messages are appended. +-- Writing to the file ends when Vim exits or when `'verbosefile'` is made +-- empty. Writes are buffered, thus may not show up for some time. +-- Setting `'verbosefile'` to a new value is like making it empty first. +-- The difference with |:redir| is that verbose messages are not +-- displayed when `'verbosefile'` is set. +vim.go.verbosefile = "" +vim.go.vfile = vim.go.verbosefile +-- `'viewdir'` `'vdir'` string (default: "$XDG_STATE_HOME/nvim/view//") +-- global +-- Name of the directory where to store files for |:mkview|. +-- This option cannot be set from a |modeline| or in the |sandbox|, for +-- security reasons. +vim.go.viewdir = "/home/runner/.local/state/nvim/view//" +vim.go.vdir = vim.go.viewdir +-- `'viewoptions'` `'vop'` string (default: "folds,cursor,curdir") +-- global +-- Changes the effect of the |:mkview| command. It is a comma-separated +-- list of words. Each word enables saving and restoring something: +-- word save and restore ~ +-- cursor cursor position in file and in window +-- curdir local current directory, if set with |:lcd| +-- folds manually created folds, opened/closed folds and local +-- fold options +-- options options and mappings local to a window or buffer (not +-- global values for local options) +-- localoptions same as "options" +-- slash |deprecated| Always enabled. Uses "/" in filenames. +-- unix |deprecated| Always enabled. Uses "\n" line endings. +vim.go.viewoptions = "folds,cursor,curdir" +vim.go.vop = vim.go.viewoptions +vim.go.viminfo = "" +vim.go.vi = vim.go.viminfo +vim.go.viminfofile = "" +vim.go.vif = vim.go.viminfofile +-- `'visualbell'` `'vb'` boolean (default off) +-- global +-- Use visual bell instead of beeping. Also see `'errorbells'` . +vim.go.visualbell = false +vim.go.vb = vim.go.visualbell +-- `'warn'` boolean (default on) +-- global +-- Give a warning message when a shell command is used while the buffer +-- has been changed. +vim.go.warn = true +-- `'whichwrap'` `'ww'` string (default: "b,s") +-- global +-- Allow specified keys that move the cursor left/right to move to the +-- previous/next line when the cursor is on the first/last character in +-- the line. Concatenate characters to allow this for these keys: +-- char key mode ~ +-- b Normal and Visual +-- s Normal and Visual +-- h "h" Normal and Visual (not recommended) +-- l "l" Normal and Visual (not recommended) +-- < Normal and Visual +-- > Normal and Visual +-- ~ "~" Normal +-- [ Insert and Replace +-- ] Insert and Replace +-- For example: > +-- :set ww=<,>,[,] +-- < allows wrap only when cursor keys are used. +-- When the movement keys are used in combination with a delete or change +-- operator, the also counts for a character. This makes "3h" +-- different from "3dh" when the cursor crosses the end of a line. This +-- is also true for "x" and "X", because they do the same as "dl" and +-- "dh". If you use this, you may also want to use the mapping +-- ":map X" to make backspace delete the character in front of the +-- cursor. +-- When `'l'` is included and it is used after an operator at the end of a +-- line (not an empty line) then it will not move to the next line. This +-- makes "dl", "cl", "yl" etc. work normally. +vim.go.whichwrap = "b,s" +vim.go.ww = vim.go.whichwrap +-- `'wildchar'` `'wc'` number (default: ) +-- global +-- Character you have to type to start wildcard expansion in the +-- command-line, as specified with `'wildmode'` . +-- More info here: |cmdline-completion|. +-- The character is not recognized when used inside a macro. See +-- `'wildcharm'` for that. +-- Some keys will not work, such as CTRL-C, and Enter. +-- Although `'wc'` is a number option, you can set it to a special key: > +-- :set wc= +-- < +vim.go.wildchar = 9 +vim.go.wc = vim.go.wildchar +-- `'wildcharm'` `'wcm'` number (default: none (0)) +-- global +-- `'wildcharm'` works exactly like `'wildchar'` , except that it is +-- recognized when used inside a macro. You can find "spare" command-line +-- keys suitable for this option by looking at |ex-edit-index|. Normally +-- you'll never actually type `'wildcharm'` , just use it in mappings that +-- automatically invoke completion mode, e.g.: > +-- :set wcm= +-- :cnoremap ss so $vim/sessions/*.vim +-- < Then after typing :ss you can use CTRL-P & CTRL-N. +vim.go.wildcharm = 0 +vim.go.wcm = vim.go.wildcharm +-- `'wildignore'` `'wig'` string (default "") +-- global +-- A list of file patterns. A file that matches with one of these +-- patterns is ignored when expanding |wildcards|, completing file or +-- directory names, and influences the result of |expand()|, |glob()| and +-- |globpath()| unless a flag is passed to disable this. +-- The pattern is used like with |:autocmd|, see |autocmd-pattern|. +-- Also see `'suffixes'` . +-- Example: > +-- :set wildignore=.obj +-- < The use of |:set+=| and |:set-=| is preferred when adding or removing +-- a pattern from the list. This avoids problems when a future version +-- uses another default. +vim.go.wildignore = "" +vim.go.wig = vim.go.wildignore +-- `'wildignorecase'` `'wic'` boolean (default off) +-- global +-- When set case is ignored when completing file names and directories. +-- Has no effect when `'fileignorecase'` is set. +-- Does not apply when the shell is used to expand wildcards, which +-- happens when there are special characters. +vim.go.wildignorecase = false +vim.go.wic = vim.go.wildignorecase +-- `'wildmenu'` `'wmnu'` boolean (default on) +-- global +-- When `'wildmenu'` is on, command-line completion operates in an enhanced +-- mode. On pressing `'wildchar'` (usually ) to invoke completion, +-- the possible matches are shown. +-- When `'wildoptions'` contains "pum", then the completion matches are +-- shown in a popup menu. Otherwise they are displayed just above the +-- command line, with the first match highlighted (overwriting the status +-- line, if there is one). +-- Keys that show the previous/next match, such as or +-- CTRL-P/CTRL-N, cause the highlight to move to the appropriate match. +-- `'wildmode'` must specify "full": "longest" and "list" do not start +-- `'wildmenu'` mode. You can check the current mode with |wildmenumode()|. +-- The menu is cancelled when a key is hit that is not used for selecting +-- a completion. +-- +-- While the menu is active these keys have special meanings: +-- +-- CTRL-Y - accept the currently selected match and stop +-- completion. +-- CTRL-E - end completion, go back to what was there before +-- selecting a match. +-- - select previous/next match (like CTRL-P/CTRL-N) +-- - in filename/menu name completion: move into a +-- subdirectory or submenu. +-- - in menu completion, when the cursor is just after a +-- dot: move into a submenu. +-- - in filename/menu name completion: move up into +-- parent directory or parent menu. +-- +-- If you want and to move the cursor instead of selecting +-- a different match, use this: > +-- :cnoremap +-- :cnoremap +-- < +-- |hl-WildMenu| highlights the current match. +vim.go.wildmenu = true +vim.go.wmnu = vim.go.wildmenu +-- `'wildmode'` `'wim'` string (default: "full") +-- global +-- Completion mode that is used for the character specified with +-- `'wildchar'` . It is a comma-separated list of up to four parts. Each +-- part specifies what to do for each consecutive use of `'wildchar'` . The +-- first part specifies the behavior for the first use of `'wildchar'` , +-- The second part for the second use, etc. +-- +-- Each part consists of a colon separated list consisting of the +-- following possible values: +-- "" Complete only the first match. +-- "full" Complete the next full match. After the last match, +-- the original string is used and then the first match +-- again. Will also start `'wildmenu'` if it is enabled. +-- "longest" Complete till longest common string. If this doesn't +-- result in a longer string, use the next part. +-- "list" When more than one match, list all matches. +-- "lastused" When completing buffer names and more than one buffer +-- matches, sort buffers by time last used (other than +-- the current buffer). +-- When there is only a single match, it is fully completed in all cases. +-- +-- Examples of useful colon-separated values: +-- "longest:full" Like "longest", but also start `'wildmenu'` if it is +-- enabled. Will not complete to the next full match. +-- "list:full" When more than one match, list all matches and +-- complete first match. +-- "list:longest" When more than one match, list all matches and +-- complete till longest common string. +-- "list:lastused" When more than one buffer matches, list all matches +-- and sort buffers by time last used (other than the +-- current buffer). +-- +-- Examples: > +-- :set wildmode=full +-- < Complete first full match, next match, etc. (the default) > +-- :set wildmode=longest,full +-- < Complete longest common string, then each full match > +-- :set wildmode=list:full +-- < List all matches and complete each full match > +-- :set wildmode=list,full +-- < List all matches without completing, then each full match > +-- :set wildmode=longest,list +-- < Complete longest common string, then list alternatives. +-- More info here: |cmdline-completion|. +vim.go.wildmode = "full" +vim.go.wim = vim.go.wildmode +-- `'wildoptions'` `'wop'` string (default "pum,tagfile") +-- global +-- A list of words that change how |cmdline-completion| is done. +-- The following values are supported: +-- fuzzy Use |fuzzy-matching| to find completion matches. When +-- this value is specified, wildcard expansion will not +-- be used for completion. The matches will be sorted by +-- the "best match" rather than alphabetically sorted. +-- This will find more matches than the wildcard +-- expansion. Currently fuzzy matching based completion +-- is not supported for file and directory names and +-- instead wildcard expansion is used. +-- pum Display the completion matches using the popup menu +-- in the same style as the |ins-completion-menu|. +-- tagfile When using CTRL-D to list matching tags, the kind of +-- tag and the file of the tag is listed. Only one match +-- is displayed per line. Often used tag kinds are: +-- d #define +-- f function +vim.go.wildoptions = "pum,tagfile" +vim.go.wop = vim.go.wildoptions +-- `'winaltkeys'` `'wak'` string (default "menu") +-- global +-- {only used in Win32} +-- Some GUI versions allow the access to menu entries by using the ALT +-- key in combination with a character that appears underlined in the +-- 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. +-- 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 +-- shortcut key, will be handled by the windowing system. Other +-- keys can be mapped. +-- If the menu is disabled by excluding `'m'` from `'guioptions'` , the ALT +-- key is never used for the menu. +-- This option is not used for ; on Win32. +vim.go.winaltkeys = "menu" +vim.go.wak = vim.go.winaltkeys +-- `'window'` `'wi'` number (default screen height - 1) +-- global +-- Window height used for |CTRL-F| and |CTRL-B| when there is only one +-- window and the value is smaller than `'lines'` minus one. The screen +-- 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. +-- Note: Do not confuse this with the height of the Vim window, use +-- `'lines'` for that. +vim.go.window = 23 +vim.go.wi = vim.go.window +-- `'winheight'` `'wh'` number (default 1) +-- global +-- Minimal number of lines for the current window. This is not a hard +-- minimum, Vim will use fewer lines if there is not enough room. If the +-- focus goes to a window that is smaller, its size is increased, at the +-- cost of the height of other windows. +-- Set `'winheight'` to a small number for normal editing. +-- Set it to 999 to make the current window fill most of the screen. +-- Other windows will be only `'winminheight'` high. This has the drawback +-- that ":all" will create only two windows. To avoid "vim -o 1 2 3 4" +-- to create only two windows, set the option after startup is done, +-- using the |VimEnter| event: > +-- au VimEnter * set winheight=999 +-- < Minimum value is 1. +-- The height is not adjusted after one of the commands that change the +-- height of the current window. +-- `'winheight'` applies to the current window. Use `'winminheight'` to set +-- the minimal height for other windows. +vim.go.winheight = 1 +vim.go.wh = vim.go.winheight +-- `'winminheight'` `'wmh'` number (default 1) +-- global +-- The minimal height of a window, when it's not the current window. +-- This is a hard minimum, windows will never become smaller. +-- When set to zero, windows may be "squashed" to zero lines (i.e. just a +-- status bar) if necessary. They will return to at least one line when +-- they become active (since the cursor has to have somewhere to go.) +-- Use `'winheight'` to set the minimal height of the current window. +-- This option is only checked when making a window smaller. Don't use a +-- large number, it will cause errors when opening more than a few +-- windows. A value of 0 to 3 is reasonable. +vim.go.winminheight = 1 +vim.go.wmh = vim.go.winminheight +-- `'winminwidth'` `'wmw'` number (default 1) +-- global +-- The minimal width of a window, when it's not the current window. +-- This is a hard minimum, windows will never become smaller. +-- When set to zero, windows may be "squashed" to zero columns (i.e. just +-- a vertical separator) if necessary. They will return to at least one +-- line when they become active (since the cursor has to have somewhere +-- to go.) +-- Use `'winwidth'` to set the minimal width of the current window. +-- This option is only checked when making a window smaller. Don't use a +-- large number, it will cause errors when opening more than a few +-- windows. A value of 0 to 12 is reasonable. +vim.go.winminwidth = 1 +vim.go.wmw = vim.go.winminwidth +-- `'winwidth'` `'wiw'` number (default 20) +-- global +-- Minimal number of columns for the current window. This is not a hard +-- minimum, Vim will use fewer columns if there is not enough room. If +-- the current window is smaller, its size is increased, at the cost of +-- the width of other windows. Set it to 999 to make the current window +-- always fill the screen. Set it to a small number for normal editing. +-- The width is not adjusted after one of the commands to change the +-- width of the current window. +-- `'winwidth'` applies to the current window. Use `'winminwidth'` to set +-- the minimal width for other windows. +vim.go.winwidth = 20 +vim.go.wiw = vim.go.winwidth +-- `'wrapscan'` `'ws'` boolean (default on) +-- global +-- Searches wrap around the end of the file. Also applies to |]s| and +-- |[s|, searching for spelling mistakes. +vim.go.wrapscan = true +vim.go.ws = vim.go.wrapscan +-- `'write'` boolean (default on) +-- global +-- Allows writing files. When not set, writing a file is not allowed. +-- Can be used for a view-only mode, where modifications to the text are +-- still allowed. Can be reset with the |-m| or |-M| command line +-- argument. Filtering text is still possible, even though this requires +-- writing a temporary file. +vim.go.write = true +-- `'writeany'` `'wa'` boolean (default off) +-- global +-- Allows writing to any file with no need for "!" override. +vim.go.writeany = false +vim.go.wa = vim.go.writeany +-- `'writebackup'` `'wb'` boolean (default on) +-- global +-- Make a backup before overwriting a file. The backup is removed after +-- the file was successfully written, unless the `'backup'` option is +-- also on. +-- WARNING: Switching this option off means that when Vim fails to write +-- your buffer correctly and then, for whatever reason, Vim exits, you +-- lose both the original file and what you were writing. Only reset +-- this option if your file system is almost full and it makes the write +-- fail (and make sure not to exit Vim until the write was successful). +-- See |backup-table| for another explanation. +-- When the `'backupskip'` pattern matches, a backup is not made anyway. +-- Depending on `'backupcopy'` the backup is a new file or the original +-- file renamed (and a new file is written). +vim.go.writebackup = true +vim.go.wb = vim.go.writebackup +vim.go.writedelay = 0 +vim.go.wd = vim.go.writedelay + + +---@class vim.wo +vim.wo = {} + +-- `'arabic'` `'arab'` boolean (default off) +-- local to window +-- This option can be set to start editing Arabic text. +-- Setting this option will: +-- - Set the `'rightleft'` option, unless `'termbidi'` is set. +-- - Set the `'arabicshape'` option, unless `'termbidi'` is set. +-- - Set the `'keymap'` option to "arabic"; in Insert mode CTRL-^ toggles +-- between typing English and Arabic key mapping. +-- - Set the `'delcombine'` option +-- +-- Resetting this option will: +-- - Reset the `'rightleft'` option. +-- - Disable the use of `'keymap'` (without changing its value). +-- Note that `'arabicshape'` and `'delcombine'` are not reset (it is a global +-- option). +-- Also see |arabic.txt|. +vim.wo.arabic = false +vim.wo.arab = vim.wo.arabic +-- `'breakindent'` `'bri'` boolean (default off) +-- local to window +-- Every wrapped line will continue visually indented (same amount of +-- space as the beginning of that line), thus preserving horizontal blocks +-- of text. +vim.wo.breakindent = false +vim.wo.bri = vim.wo.breakindent +-- `'breakindentopt'` `'briopt'` string (default empty) +-- local to window +-- Settings for `'breakindent'` . It can consist of the following optional +-- items and must be separated by a comma: +-- min:{n} Minimum text width that will be kept after +-- applying `'breakindent'` , even if the resulting +-- text should normally be narrower. This prevents +-- text indented almost to the right window border +-- occupying lot of vertical space when broken. +-- (default: 20) +-- shift:{n} After applying `'breakindent'` , the wrapped line's +-- beginning will be shifted by the given number of +-- characters. It permits dynamic French paragraph +-- indentation (negative) or emphasizing the line +-- continuation (positive). +-- (default: 0) +-- sbr Display the `'showbreak'` value before applying the +-- additional indent. +-- (default: off) +-- list:{n} Adds an additional indent for lines that match a +-- numbered or bulleted list (using the +-- `'formatlistpat'` setting). +-- list:-1 Uses the length of a match with `'formatlistpat'` +-- for indentation. +-- (default: 0) +-- column:{n} Indent at column {n}. Will overrule the other +-- sub-options. Note: an additional indent may be +-- added for the `'showbreak'` setting. +-- (default: off) +vim.wo.breakindentopt = "" +vim.wo.briopt = vim.wo.breakindentopt +-- `'colorcolumn'` `'cc'` string (default "") +-- local to window +-- `'colorcolumn'` is a comma-separated list of screen columns that are +-- highlighted with ColorColumn |hl-ColorColumn|. Useful to align +-- text. Will make screen redrawing slower. +-- The screen column can be an absolute number, or a number preceded with +-- `'+'` or `'-'` , which is added to or subtracted from `'textwidth'` . > +-- +-- :set cc=+1 " highlight column after `'textwidth'` +-- :set cc=+1,+2,+3 " highlight three columns after `'textwidth'` +-- :hi ColorColumn ctermbg=lightgrey guibg=lightgrey +-- < +-- When `'textwidth'` is zero then the items with `'-'` and `'+'` are not used. +-- A maximum of 256 columns are highlighted. +vim.wo.colorcolumn = "" +vim.wo.cc = vim.wo.colorcolumn +-- `'concealcursor'` `'cocu'` string (default: "") +-- local to window +-- Sets the modes in which text in the cursor line can also be concealed. +-- When the current mode is listed then concealing happens just like in +-- other lines. +-- n Normal mode +-- v Visual mode +-- i Insert mode +-- c Command line editing, for `'incsearch'` +-- +-- `'v'` applies to all lines in the Visual area, not only the cursor. +-- A useful value is "nc". This is used in help files. So long as you +-- are moving around text is concealed, but when starting to insert text +-- or selecting a Visual area the concealed text is displayed, so that +-- you can see what you are doing. +-- Keep in mind that the cursor position is not always where it's +-- displayed. E.g., when moving vertically it may change column. +vim.wo.concealcursor = "" +vim.wo.cocu = vim.wo.concealcursor +-- `'conceallevel'` `'cole'` number (default 0) +-- local to window +-- Determine how text with the "conceal" syntax attribute |:syn-conceal| +-- is shown: +-- +-- Value Effect ~ +-- 0 Text is shown normally +-- 1 Each block of concealed text is replaced with one +-- character. If the syntax item does not have a custom +-- replacement character defined (see |:syn-cchar|) the +-- character defined in `'listchars'` is used. +-- It is highlighted with the "Conceal" highlight group. +-- 2 Concealed text is completely hidden unless it has a +-- custom replacement character defined (see +-- |:syn-cchar|). +-- 3 Concealed text is completely hidden. +-- +-- Note: in the cursor line concealed text is not hidden, so that you can +-- edit and copy the text. This can be changed with the `'concealcursor'` +-- option. +vim.wo.conceallevel = 0 +vim.wo.cole = vim.wo.conceallevel +-- `'cursorbind'` `'crb'` boolean (default off) +-- local to window +-- When this option is set, as the cursor in the current +-- window moves other cursorbound windows (windows that also have +-- this option set) move their cursors to the corresponding line and +-- column. This option is useful for viewing the +-- differences between two versions of a file (see `'diff'` ); in diff mode, +-- inserted and deleted lines (though not characters within a line) are +-- taken into account. +vim.wo.cursorbind = false +vim.wo.crb = vim.wo.cursorbind +-- `'cursorcolumn'` `'cuc'` boolean (default off) +-- local to window +-- Highlight the screen column of the cursor with CursorColumn +-- |hl-CursorColumn|. Useful to align text. Will make screen redrawing +-- slower. +-- If you only want the highlighting in the current window you can use +-- these autocommands: > +-- au WinLeave * set nocursorline nocursorcolumn +-- au WinEnter * set cursorline cursorcolumn +-- < +vim.wo.cursorcolumn = false +vim.wo.cuc = vim.wo.cursorcolumn +-- `'cursorline'` `'cul'` boolean (default off) +-- local to window +-- Highlight the text line of the cursor with CursorLine |hl-CursorLine|. +-- Useful to easily spot the cursor. Will make screen redrawing slower. +-- When Visual mode is active the highlighting isn't used to make it +-- easier to see the selected text. +vim.wo.cursorline = false +vim.wo.cul = vim.wo.cursorline +-- `'cursorlineopt'` `'culopt'` string (default: "number,line") +-- local to window +-- Comma-separated list of settings for how `'cursorline'` is displayed. +-- Valid values: +-- "line" Highlight the text line of the cursor with +-- CursorLine |hl-CursorLine|. +-- "screenline" Highlight only the screen line of the cursor with +-- CursorLine |hl-CursorLine|. +-- "number" Highlight the line number of the cursor with +-- CursorLineNr |hl-CursorLineNr|. +-- +-- Special value: +-- "both" Alias for the values "line,number". +-- +-- "line" and "screenline" cannot be used together. +vim.wo.cursorlineopt = "both" +vim.wo.culopt = vim.wo.cursorlineopt diff --git a/bundle/neodev.nvim/types/nightly/uv.lua b/bundle/neodev.nvim/types/nightly/uv.lua new file mode 100644 index 000000000..0a6a8a230 --- /dev/null +++ b/bundle/neodev.nvim/types/nightly/uv.lua @@ -0,0 +1,3982 @@ +---@meta + +---@meta +---@diagnostic disable: duplicate-set-field + +-- TODO: define @source for all sections and methods + +-- TODO: things like uv.tty_set_mode has in the description- +-- "look below for possible values" and then we rely on lls to list the alias +-- we need a way to list those off when generating the docs + +--- +---The [luv](https://github.com/luvit/luv/) project provides access to the multi-platform support library +---[libuv](http://libuv.org/) in Lua code. It was primarily developed for the [luvit](https://github.com/luvit/luvit/) project as +---the built-in `uv` module, but can be used in other Lua environments. +--- +---More information about the core libuv library can be found at the original +---[libuv documentation page](http://docs.libuv.org/en/v1.x/). +--- +---### TCP Echo Server Example +--- +---Here is a small example showing a TCP echo server: +--- +---```lua +---local uv = require("luv") -- "luv" when stand-alone, "uv" in luvi apps +--- +---local server = uv.new_tcp() +---server:bind("127.0.0.1", 1337) +---server:listen(128, function (err) +--- assert(not err, err) +--- local client = uv.new_tcp() +--- server:accept(client) +--- client:read_start(function (err, chunk) +--- assert(not err, err) +--- if chunk then +--- client:write(chunk) +--- else +--- client:shutdown() +--- client:close() +--- end +--- end) +---end) +---print("TCP server listening at 127.0.0.1 port 1337") +---uv.run() -- an explicit run call is necessary outside of luvit +---``` +--- +---### Module Layout +--- +---The luv library contains a single Lua module referred to hereafter as `uv` for +---simplicity. This module consists mostly of functions with names corresponding to +---their original libuv versions. For example, the libuv function `uv_tcp_bind` has +---a luv version at `uv.tcp_bind`. Currently, only two non-function fields exists: +---`uv.constants` and `uv.errno`, which are tables. +--- +---### Functions vs Methods +--- +---In addition to having simple functions, luv provides an optional method-style +---API. For example, `uv.tcp_bind(server, host, port)` can alternatively be called +---as `server:bind(host, port)`. Note that the first argument `server` becomes the +---object and `tcp_` is removed from the function name. Method forms are +---documented below where they exist. +--- +---### Synchronous vs Asynchronous Functions +--- +---Functions that accept a callback are asynchronous. These functions may +---immediately return results to the caller to indicate their initial status, but +---their final execution is deferred until at least the next libuv loop iteration. +---After completion, their callbacks are executed with any results passed to it. +--- +---Functions that do not accept a callback are synchronous. These functions +---immediately return their results to the caller. +--- +---Some (generally FS and DNS) functions can behave either synchronously or +---asynchronously. If a callback is provided to these functions, they behave +---asynchronously; if no callback is provided, they behave synchronously. +--- +---### Pseudo-Types +--- +---Some unique types are defined. These are not actual types in Lua, but they are +---used here to facilitate documenting consistent behavior: +---- `fail`: an assertable `nil, string, string` tuple (see [Error handling][]) +---- `callable`: a `function`; or a `table` or `userdata` with a `__call` +--- metamethod +---- `buffer`: a `string` or a sequential `table` of `string`s +---- `threadargs`: variable arguments (`...`) of type `nil`, `boolean`, `number`, +--- `string`, or `userdata` +--- +---@namespace +---@class uv +---@section Libuv in Lua +local uv = {} + +---@alias uv.aliases.buffer string|string[] + +---@alias uv.aliases.threadargs userdata|string|number|boolean|nil + + + +--- +---@section Contents +--- +---This documentation is mostly a retelling of the [libuv API documentation][] +---within the context of luv's Lua API. Low-level implementation details and +---unexposed C functions and types are not documented here except for when they +---are relevant to behavior seen in the Lua module. +--- +--- - [Error handling][] +--- - [Version checking][] +--- - [`uv_loop_t`][] — Event loop +--- - [`uv_req_t`][] — Base request +--- - [`uv_handle_t`][] — Base handle +--- - [`uv_timer_t`][] — Timer handle +--- - [`uv_prepare_t`][] — Prepare handle +--- - [`uv_check_t`][] — Check handle +--- - [`uv_idle_t`][] — Idle handle +--- - [`uv_async_t`][] — Async handle +--- - [`uv_poll_t`][] — Poll handle +--- - [`uv_signal_t`][] — Signal handle +--- - [`uv_process_t`][] — Process handle +--- - [`uv_stream_t`][] — Stream handle +--- - [`uv_tcp_t`][] — TCP handle +--- - [`uv_pipe_t`][] — Pipe handle +--- - [`uv_tty_t`][] — TTY handle +--- - [`uv_udp_t`][] — UDP handle +--- - [`uv_fs_event_t`][] — FS Event handle +--- - [`uv_fs_poll_t`][] — FS Poll handle +--- - [File system operations][] +--- - [Thread pool work scheduling][] +--- - [DNS utility functions][] +--- - [Threading and synchronization utilities][] +--- - [Miscellaneous utilities][] +--- - [Metrics operations][] +--- + +-- TODO: above section should probably not be hardcoded + + + +--- +---In libuv, errors are negative numbered constants; however, while those errors are exposed through `uv.errno`, +---the functions used to handle them are not exposed to luv users. Instead, if an +---internal error is encountered, the luv function will return to the caller an +---assertable `nil, err, name` tuple. +--- +---- `nil` idiomatically indicates failure +---- `err` is a string with the format `{name}: {message}` +--- - `{name}` is the error name provided internally by `uv_err_name` +--- - `{message}` is a human-readable message provided internally by `uv_strerror` +---- `name` is the same string used to construct `err` +--- +---This tuple is referred to below as the `fail` pseudo-type. +--- +---When a function is called successfully, it will return either a value that is +---relevant to the operation of the function, or the integer `0` to indicate +---success, or sometimes nothing at all. These cases are documented below. +--- +---@alias uv.errno {E2BIG: integer, EACCES: integer, EADDRINUSE: integer, EADDRNOTAVAIL: integer, EAFNOSUPPORT: integer, EAGAIN: integer, EAI_ADDRFAMILY: integer, EAI_AGAIN: integer, EAI_BADFLAGS: integer, EAI_BADHINTS: integer, EAI_CANCELED: integer, EAI_FAIL: integer, EAI_FAMILY: integer, EAI_MEMORY: integer, EAI_NODATA: integer, EAI_NONAME: integer, EAI_OVERFLOW: integer, EAI_PROTOCOL: integer, EAI_SERVICE: integer, EAI_SOCKTYPE: integer, EALREADY: integer, EBADF: integer, EBUSY: integer, ECANCELED: integer, ECHARSET: integer, ECONNABORTED: integer, ECONNREFUSED: integer, ECONNRESET: integer, EDESTADDRREQ: integer, EEXIST: integer, EFAULT: integer, EFBIG: integer, EFTYPE: integer, EHOSTDOWN: integer, EHOSTUNREACH: integer, EILSEQ: integer, EINTR: integer, EINVAL: integer, EIO: integer, EISCONN: integer, EISDIR: integer, ELOOP: integer, EMFILE: integer, EMLINK: integer, EMSGSIZE: integer, ENAMETOOLONG: integer, ENETDOWN: integer, ENETUNREACH: integer, ENFILE: integer, ENOBUFS: integer, ENODATA: integer, ENODEV: integer, ENOENT: integer, ENOMEM: integer, ENONET: integer, ENOPROTOOPT: integer, ENOSPC: integer, ENOSYS: integer, ENOTCONN: integer, ENOTDIR: integer, ENOTEMPTY: integer, ENOTSOCK: integer, ENOTSUP: integer, ENOTTY: integer, ENXIO: integer, EOF: integer, EOVERFLOW: integer, EPERM: integer, EPIPE: integer, EPROTO: integer, EPROTONOSUPPORT: integer, EPROTOTYPE: integer, ERANGE: integer, EREMOTEIO: integer, EROFS: integer, ESHUTDOWN: integer, ESOCKTNOSUPPORT: integer, ESPIPE: integer, ESRCH: integer, ETIMEDOUT: integer, ETXTBSY: integer, EXDEV: integer, UNKNOWN: integer} +---@section Error Handling + +-- TODO: errno fields should have descriptions! + +--- +---A table value which exposes error constants as a map, where the key is the +---error name (without the `UV_` prefix) and its value is a negative number. +---See Libuv's "Error constants" page for further details. +---(https://docs.libuv.org/en/v1.x/errors.html#error-constants) +--- +---@type uv.errno +uv.errno = {} + + + +--- +---@section Version Checking +--- + +--- +---Returns the libuv version packed into a single integer. 8 bits are used for each +---component, with the patch number stored in the 8 least significant bits. For +---example, this would be 0x010203 in libuv 1.2.3. +--- +---@return integer +---@nodiscard +function uv.version() end + +--- +---Returns the libuv version number as a string. For example, this would be "1.2.3" +---in libuv 1.2.3. For non-release versions, the version suffix is included. +--- +---@return string +---@nodiscard +function uv.version_string() end + + + +--- +---The event loop is the central part of libuv's functionality. It takes care of +-- polling for I/O and scheduling callbacks to be run based on different sources of events. +--- +---In luv, there is an implicit uv loop for every Lua state that loads the library. +---You can use this library in an multi-threaded environment as long as each thread +---has it's own Lua state with its corresponding own uv loop. This loop is not +---directly exposed to users in the Lua module. +--- +---@class uv_loop_t: userdata +---@section Event loop +local uv_loop_t = {} + +---@alias uv.aliases.run_mode +---Runs the event loop until there are no more active and referenced handles or requests. +---Returns `true` if `uv.stop()` was called and there are still active handles or requests. +---Returns `false` in all other cases. +---|>'default' +---Poll for I/O once. Note that this function blocks if there are no +---pending callbacks. Returns `false` when done (no active handles or requests +---left), or `true` if more callbacks are expected (meaning you should run the +---event loop again sometime in the future). +---|'once' +---Poll for I/O once but don't block if there are no pending callbacks. +---Returns `false` if done (no active handles or requests left), +---or `true` if more callbacks are expected (meaning you should run the event loop again sometime in the future). +---|'nowait' + +---@alias uv.aliases.loop_configure_option +---Block a signal when polling for new events. +---The second argument to loop_configure() is the signal name (as a lowercase string) or the signal number. +---This operation is currently only implemented for `"sigprof"` signals, to suppress unnecessary wakeups when using a sampling profiler. +---Requesting other signals will fail with `EINVAL`. +---|'block_signal' +---Accumulate the amount of idle time the event loop spends in the event provider. +---This option is necessary to use `metrics_idle_time()`. +---|'metrics_idle_time' + +--- +---Closes all internal loop resources. In normal execution, the loop will +---automatically be closed when it is garbage collected by Lua, so it is not +---necessary to explicitly call `loop_close()`. Call this function only after the +---loop has finished executing and all open handles and requests have been closed, +---or it will return `EBUSY`. +--- +---@return 0|nil success, string? err_name, string? err_msg +function uv.loop_close() end + +--- +---This function runs the event loop. It will act differently depending on the +---specified mode: +---- `"default"`: Runs the event loop until there are no more active and +---referenced handles or requests. Returns `true` if `uv.stop()` was called and +---there are still active handles or requests. Returns `false` in all other +---cases. +---- `"once"`: Poll for I/O once. Note that this function blocks if there are no +---pending callbacks. Returns `false` when done (no active handles or requests +---left), or `true` if more callbacks are expected (meaning you should run the +---event loop again sometime in the future). +---- `"nowait"`: Poll for I/O once but don't block if there are no pending +---callbacks. Returns `false` if done (no active handles or requests left), +---or `true` if more callbacks are expected (meaning you should run the event +---loop again sometime in the future). +--- +---**Note**: Luvit will implicitly call `uv.run()` after loading user code, but if +---you use the luv bindings directly, you need to call this after registering +---your initial set of event callbacks to start the event loop. +--- +---@param mode uv.aliases.run_mode|nil +---@return boolean|nil, string? err_name, string? err_msg +function uv.run(mode) end + +--- +---Set additional loop options. You should normally call this before the first call +---to uv_run() unless mentioned otherwise. +---Supported options: +---- `"block_signal"`: Block a signal when polling for new events. The second argument +---to loop_configure() is the signal name (as a lowercase string) or the signal number. +---This operation is currently only implemented for `"sigprof"` signals, to suppress +---unnecessary wakeups when using a sampling profiler. Requesting other signals will +---fail with `EINVAL`. +---- `"metrics_idle_time"`: Accumulate the amount of idle time the event loop spends +---in the event provider. This option is necessary to use `metrics_idle_time()`. +---An example of a valid call to this function is: +---```lua +---uv.loop_configure("block_signal", "sigprof") +---``` +--- +---**Note**: Be prepared to handle the `ENOSYS` error; it means the loop option is +---not supported by the platform. +--- +---@param option uv.aliases.loop_configure_option +---@param ... any +---@return 0|nil success, string? err_name, string? err_msg +function uv.loop_configure(option, ...) end + +--- +---If the loop is running, returns a string indicating the mode in use. If the loop +---is not running, `nil` is returned instead. +--- +---@return uv.aliases.run_mode|nil +---@nodiscard +function uv.loop_mode() end + +--- +---Returns `true` if there are referenced active handles, active requests, or +---closing handles in the loop; otherwise, `false`. +--- +---@return boolean|nil, string? err_name, string? err_msg +---@nodiscard +function uv.loop_alive() end + +--- +---Stop the event loop, causing `uv.run()` to end as soon as possible. This +---will happen not sooner than the next loop iteration. If this function was called +---before blocking for I/O, the loop won't block for I/O on this iteration. +--- +function uv.stop() end + +--- +---Get backend file descriptor. Only kqueue, epoll, and event ports are supported. +---This can be used in conjunction with `uv.run("nowait")` to poll in one thread +---and run the event loop's callbacks in another +--- +---**Note**: Embedding a kqueue fd in another kqueue pollset doesn't work on all +---platforms. It's not an error to add the fd but it never generates events. +--- +---@return integer|nil +---@nodiscard +function uv.backend_fd() end + +--- +---Get the poll timeout. The return value is in milliseconds, or -1 for no timeout. +--- +---@return integer +---@nodiscard +function uv.backend_timeout() end + +--- +---Returns the current timestamp in milliseconds. The timestamp is cached at the +---start of the event loop tick, see `uv.update_time()` for details and rationale. +---The timestamp increases monotonically from some arbitrary point in time. Don't +---make assumptions about the starting point, you will only get disappointed. +--- +---**Note**: Use `uv.hrtime()` if you need sub-millisecond granularity. +--- +---@return integer +---@nodiscard +function uv.now() end + +--- +---Update the event loop's concept of "now". Libuv caches the current time at the +---start of the event loop tick in order to reduce the number of time-related +---system calls. +---You won't normally need to call this function unless you have callbacks that +---block the event loop for longer periods of time, where "longer" is somewhat +---subjective but probably on the order of a millisecond or more. +--- +function uv.update_time() end + +--- +---Walk the list of handles: `callback` will be executed with each handle. +--- +---Example usage of uv.walk to close all handles that aren't already closing. +---```lua +---uv.walk(function (handle) +--- if not handle:is_closing() then +--- handle:close() +--- end +---end) +---``` +--- +---@param callback fun(handle: uv.aliases.handle_instances) +function uv.walk(callback) end + + + +--- +---`uv_req_t` is the base type for all libuv request types. +--- +---@class uv_req_t: userdata +---@section Base request +local uv_req_t = {} + +---@alias uv.aliases.req_struct_name +---|'unknown' 0 +---|'req' 1 +---|'connect' 2 +---|'write' 3 +---|'shutdown' 4 +---|'udp_send' 5 +---|'fs' 6 +---|'work' 7 +---|'getaddrinfo' 8 +---|'getnameinfo' 9 +---|'random' 10 + +---@alias uv.aliases.req_struct_type +---|0 unknown +---|1 req +---|2 connect +---|3 write +---|4 shutdown +---|5 udp_send +---|6 fs +---|7 work +---|8 getaddrinfo +---|9 getnameinfo +---|10 random + +--- +---Cancel a pending request. Fails if the request is executing or has finished +---executing. Only cancellation of `uv_fs_t`, `uv_getaddrinfo_t`, +---`uv_getnameinfo_t` and `uv_work_t` requests is currently supported. +--- +---@param req uv_fs_t|uv_getaddrinfo_t|uv_getnameinfo_t +---@return 0|nil success, string? err_name, string? err_msg +function uv.cancel(req) end +uv_req_t.cancel = uv.cancel + +--- +---Returns the name of the struct for a given request (e.g. `"fs"` for `uv_fs_t`) +---and the libuv enum integer for the request's type (`uv_req_type`). +--- +---@param req uv_req_t +---@return uv.aliases.req_struct_name +---@return uv.aliases.req_struct_type +function uv.req_get_type(req) end +uv_req_t.get_type = uv.req_get_type + + + +--- +---`uv_handle_t` is the base type for all libuv handle types. All API functions +---defined here work with any handle type. +--- +---@class uv_handle_t: userdata +---@section Base handle +local uv_handle_t = {} + +---@alias uv.aliases.handle_instances +---|uv_handle_t +---|uv_stream_t +---|uv_tcp_t +---|uv_pipe_t +---|uv_tty_t +---|uv_udp_t +---|uv_fs_event_t +---|uv_fs_poll_t + +---@alias uv.aliases.handle_struct_name +---|'unknown' 0 +---|'"async"' 1 +---|'check' 2 +---|'fs_event' 3 +---|'fs_poll' 4 +---|'handle' 5 +---|'idle' 6 +---|'pipe' 7 +---|'poll' 8 +---|'prepare' 9 +---|'process' 10 +---|'stream' 11 +---|'tcp' 12 +---|'timer' 13 +---|'tty' 14 +---|'udp' 15 +---|'signal' 16 +---|'file' 17 + +---@alias uv.aliases.handle_struct_type +---|0 unknown +---|1 async +---|2 check +---|3 fs_event +---|4 fs_poll +---|5 handle +---|6 idle +---|7 pipe +---|8 poll +---|9 prepare +---|10 process +---|11 stream +---|12 tcp +---|13 timer +---|14 tty +---|15 udp +---|16 signal +---|17 file + +--- +---Returns `true` if the handle is active, `false` if it's inactive. What "active” +---means depends on the type of handle: +--- +--- - A `uv_async_t` handle is always active and cannot be deactivated, except +--- by closing it with `uv.close()`. +--- +--- - A `uv_pipe_t`, `uv_tcp_t`, `uv_udp_t`, etc. handle - basically +--- any handle that deals with I/O - is active when it is doing something that +--- involves I/O, like reading, writing, connecting, accepting new connections, +--- etc. +--- +--- - A `uv_check_t`, `uv_idle_t`, `uv_timer_t`, etc. handle is active +--- when it has been started with a call to `uv.check_start()`, `uv.idle_start()`, +--- `uv.timer_start()` etc. until it has been stopped with a call to its +--- respective stop function. +--- +---@param handle uv_handle_t # `userdata` for sub-type of `uv_handle_t` +---@return boolean|nil, string? err_name, string? err_msg +---@nodiscard +function uv.is_active(handle) end +uv_handle_t.is_active = uv.is_active + +--- +---Returns `true` if the handle is closing or closed, `false` otherwise. +--- +---**Note**: This function should only be used between the initialization of the +---handle and the arrival of the close callback. +--- +---@param handle uv_handle_t # `userdata` for sub-type of `uv_handle_t` +---@return boolean|nil, string? err_name, string? err_msg +---@nodiscard +function uv.is_closing(handle) end +uv_handle_t.is_closing = uv.is_closing + +--- +---Request handle to be closed. `callback` will be called asynchronously after this +---call. This MUST be called on each handle before memory is released. +--- +---Handles that wrap file descriptors are closed immediately but `callback` will +---still be deferred to the next iteration of the event loop. It gives you a chance +---to free up any resources associated with the handle. +--- +---In-progress requests, like `uv_connect_t` or `uv_write_t`, are cancelled and +---have their callbacks called asynchronously with `ECANCELED`. +--- +---@param handle uv_handle_t # `userdata` for sub-type of `uv_handle_t` +---@param callback? function +function uv.close(handle, callback) end +uv_handle_t.close = uv.close + +--- +---Reference the given handle. References are idempotent, that is, if a handle is +---already referenced calling this function again will have no effect. +--- +---@param handle uv_handle_t # `userdata` for sub-type of `uv_handle_t` +function uv.ref(handle) end +uv_handle_t.ref = uv.ref + +--- +---Un-reference the given handle. References are idempotent, that is, if a handle +---is not referenced calling this function again will have no effect. +--- +---@param handle uv_handle_t # `userdata` for sub-type of `uv_handle_t` +function uv.unref(handle) end +uv_handle_t.unref = uv.unref + +--- +---Returns `true` if the handle referenced, `false` if not. +--- +---@param handle uv_handle_t # `userdata` for sub-type of `uv_handle_t` +---@return boolean|nil, string? err_name, string? err_msg +---@nodiscard +function uv.has_ref(handle) end +uv_handle_t.has_ref = uv.has_ref + +--- +---Gets or sets the size of the send buffer that the operating system uses for the socket. +--- +---If `size` is omitted (or `0`), this will return the current send buffer size; otherwise, this will use `size` to set the new send buffer size. +--- +---This function works for TCP, pipe and UDP handles on Unix and for TCP and UDP +---handles on Windows. +--- +---**Note**: Linux will set double the size and return double the size of the +---original set value. +--- +---@param handle uv_handle_t # `userdata` for sub-type of `uv_handle_t` +---@return integer|nil, string? err_name, string? err_msg +---@nodiscard +function uv.send_buffer_size(handle) end +---@param size? integer # (default: `0`) +---@return 0|nil, string? err_name, string? err_msg +function uv.send_buffer_size(handle, size) end +uv_handle_t.send_buffer_size = uv.send_buffer_size + +--- +---Gets or sets the size of the receive buffer that the operating system uses for the socket. +--- +---If `size` is omitted (or `0`), this will return the current send buffer size; otherwise, this will use `size` to set the new send buffer size. +--- +---This function works for TCP, pipe and UDP handles on Unix and for TCP and UDP +---handles on Windows. +--- +---**Note**: Linux will set double the size and return double the size of the +---original set value. +--- +---@param handle uv_handle_t `userdata` for sub-type of `uv_handle_t` +---@return integer|nil, string? err_name, string? err_msg +---@nodiscard +function uv.recv_buffer_size(handle) end +---@param size? integer # (default: `0`) +---@return 0|nil, string? err_name, string? err_msg +function uv.recv_buffer_size(handle, size) end +uv_handle_t.recv_buffer_size = uv.recv_buffer_size + +--- +---Gets the platform dependent file descriptor equivalent. +--- +---The following handles are supported: TCP, pipes, TTY, UDP and poll. Passing any +---other handle type will fail with `EINVAL`. +--- +---If a handle doesn't have an attached file descriptor yet or the handle itself +---has been closed, this function will return `EBADF`. +--- +---**Warning**: Be very careful when using this function. libuv assumes it's in +---control of the file descriptor so any change to it may lead to malfunction. +--- +---@param handle uv_handle_t `userdata` for sub-type of `uv_handle_t` +---@return integer|nil, string? err_name, string? err_msg +---@nodiscard +function uv.fileno(handle) end +uv_handle_t.fileno = uv.fileno + +--- +---Returns the name of the struct for a given handle (e.g. `"pipe"` for `uv_pipe_t`) +---and the libuv enum integer for the handle's type (`uv_handle_type`). +--- +---@param handle uv_handle_t # `userdata` for sub-type of `uv_handle_t` +---@return uv.aliases.handle_struct_name +---@return uv.aliases.handle_struct_type +function uv.handle_get_type(handle) end +uv_handle_t.get_type = uv.handle_get_type + + + +--- +---@section Reference counting +--- +---The libuv event loop (if run in the default mode) will run until there are no +---active and referenced handles left. The user can force the loop to exit early by +---unreferencing handles which are active, for example by calling `uv.unref()` +---after calling `uv.timer_start()`. +--- +---A handle can be referenced or unreferenced, the refcounting scheme doesn't use a +---counter, so both operations are idempotent. +--- +---All handles are referenced when active by default, see `uv.is_active()` for a +---more detailed explanation on what being active involves. +--- + + + +--- +---Timer handles are used to schedule callbacks to be called in the future. +--- +---@class uv_timer_t: uv_handle_t +---@section Timer handle +local uv_timer_t = {} + +--- +---Creates and initializes a new `uv_timer_t`. Returns the Lua userdata wrapping it. +--- +---Some examples: +---```lua +----- Creating a simple setTimeout wrapper +---local function setTimeout(timeout, callback) +--- local timer = uv.new_timer() +--- timer:start(timeout, 0, function () +--- timer:stop() +--- timer:close() +--- callback() +--- end) +--- return timer +---end +--- +----- Creating a simple setInterval wrapper +---local function setInterval(interval, callback) +--- local timer = uv.new_timer() +--- timer:start(interval, interval, function () +--- callback() +--- end) +--- return timer +---end +--- +----- And clearInterval +---local function clearInterval(timer) +--- timer:stop() +--- timer:close() +---end +---``` +--- +---@return uv_timer_t|nil, string? err_name, string? err_msg +---@nodiscard +function uv.new_timer() end + +-- TODO: make sure that the above method can indeed return nil + error. + +--- +---Start the timer. `timeout` and `repeat_n` are in milliseconds. +--- +---If `timeout` is zero, the callback fires on the next event loop iteration. If +---`repeat_n` is non-zero, the callback fires first after `timeout` milliseconds and +---then repeatedly after `repeat_n` milliseconds. +--- +---@param timer uv_timer_t +---@param timeout integer +---@param repeat_n integer +---@param callback fun() +---@return 0|nil success, string? err_name, string? err_msg +function uv.timer_start(timer, timeout, repeat_n, callback) end +uv_timer_t.start = uv.timer_start + +--- +---Stop the timer, the callback will not be called anymore. +--- +---@param timer uv_timer_t +---@return 0|nil success, string? err_name, string? err_msg +function uv.timer_stop(timer) end +uv_timer_t.stop = uv.timer_stop + +--- +---Stop the timer, and if it is repeating restart it using the repeat value as the +---timeout. If the timer has never been started before it raises `EINVAL`. +--- +---@param timer uv_timer_t +---@return 0|nil success, string? err_name, string? err_msg +function uv.timer_again(timer) end +uv_timer_t.again = uv.timer_again + +--- +---Set the repeat interval value in milliseconds. The timer will be scheduled to +---run on the given interval, regardless of the callback execution duration, and +---will follow normal timer semantics in the case of a time-slice overrun. +--- +---For example, if a 50 ms repeating timer first runs for 17 ms, it will be +---scheduled to run again 33 ms later. If other tasks consume more than the 33 ms +---following the first timer callback, then the callback will run as soon as +---possible. +--- +---@param timer uv_timer_t +---@param repeat_n integer +function uv.timer_set_repeat(timer, repeat_n) end +uv_timer_t.set_repeat = uv.timer_set_repeat + +--- +---Get the timer repeat value. +--- +---@param timer uv_timer_t +---@return integer +---@nodiscard +function uv.timer_get_repeat(timer) end +uv_timer_t.get_repeat = uv.timer_get_repeat + +--- +---Get the timer due value or 0 if it has expired. The time is relative to `uv.now()`. +--- +---**Note**: New in libuv version 1.40.0. +--- +---@param timer uv_timer_t +---@return integer +---@nodiscard +function uv.timer_get_due_in(timer) end +uv_timer_t.get_due_in = uv.timer_get_due_in + + + +--- +---Prepare handles will run the given callback once per loop iteration, right +---before polling for I/O. +--- +---```lua +---local prepare = uv.new_prepare() +---prepare:start(function() +--- print("Before I/O polling") +---end) +---``` +--- +---@class uv_prepare_t: uv_handle_t +---@section Prepare handle +local uv_prepare_t = {} + +--- +---Creates and initializes a new `uv_prepare_t`. +---Returns the Lua userdata wrapping it. +--- +---@return uv_prepare_t|nil, string? err_name, string? err_msg +---@nodiscard +function uv.new_prepare() end + +-- TODO: make sure that the above method can indeed return nil + error. + +--- +---Start the handle with the given callback. +--- +---@param prepare uv_prepare_t +---@param callback fun() +---@return 0|nil success, string? err_name, string? err_msg +function uv.prepare_start(prepare, callback) end +uv_prepare_t.start = uv.prepare_start + +--- +---Stop the handle, the callback will no longer be called. +--- +---@param prepare uv_prepare_t +---@return 0|nil success, string? err_name, string? err_msg +function uv.prepare_stop(prepare) end +uv_prepare_t.stop = uv.prepare_stop + + +--- +---Check handles will run the given callback once per loop iteration, right after +---polling for I/O. +--- +---```lua +---local check = uv.new_check() +---check:start(function() +--- print("After I/O polling") +---end) +---``` +--- +---@class uv_check_t: uv_handle_t +---@section Check handle +local uv_check_t = {} + +--- +---Creates and initializes a new `uv_check_t`. Returns the Lua userdata wrapping it. +--- +---@return uv_check_t|nil, string? err_name, string? err_msg +---@nodiscard +function uv.new_check() end + +-- TODO: make sure that the above method can indeed return nil + error. + +--- +---Start the handle with the given callback. +--- +---@param check uv_check_t +---@param callback fun() +---@return 0|nil success, string? err_name, string? err_msg +function uv.check_start(check, callback) end +uv_check_t.start = uv.check_start + +--- +---Stop the handle, the callback will no longer be called. +--- +---@param check uv_check_t +---@return 0|nil success, string? err_name, string? err_msg +function uv.check_stop(check) end +uv_check_t.stop = uv.check_stop + + + +--- +---Idle handles will run the given callback once per loop iteration, right before +---the `uv_prepare_t` handles. +--- +---**Note**: The notable difference with prepare handles is that when there are +---active idle handles, the loop will perform a zero timeout poll instead of +---blocking for I/O. +--- +---**Warning**: Despite the name, idle handles will get their callbacks called on +---every loop iteration, not when the loop is actually "idle". +--- +---```lua +---local idle = uv.new_idle() +---idle:start(function() +--- print("Before I/O polling, no blocking") +---end) +---``` +--- +---@class uv_idle_t: uv_handle_t +---@section Idle handle +local uv_idle_t = {} + +--- +---Creates and initializes a new `uv_idle_t`. Returns the Lua userdata wrapping it. +--- +---@return uv_idle_t|nil, string? err_name, string? err_msg +---@nodiscard +function uv.new_idle() end + +-- TODO: make sure that the above method can indeed return nil + error. + +--- +---Start the handle with the given callback. +--- +---@param idle uv_idle_t +---@param callback fun() +---@return 0|nil success, string? err_name, string? err_msg +function uv.idle_start(idle, callback) end +uv_idle_t.start = uv.idle_start + +--- +---Stop the handle, the callback will no longer be called. +--- +---@param idle uv_idle_t +---@return 0|nil success, string? err_name, string? err_msg +function uv.idle_stop(idle) end +uv_idle_t.stop = uv.idle_stop + + + +--- +---Async handles allow the user to "wakeup" the event loop and get a callback +---called from another thread. +--- +---```lua +---local async +---async = uv.new_async(function() +--- print("async operation ran") +--- async:close() +---end) +--- +---async:send() +---``` +--- +---@class uv_async_t: uv_handle_t +---@section Async handle +local uv_async_t = {} + +--- +---Creates and initializes a new `uv_async_t`. Returns the Lua userdata wrapping +---it. A `nil` callback is allowed. +--- +---**Note**: Unlike other handle initialization functions, this immediately starts +---the handle. +--- +---@param callback fun(...: uv.aliases.threadargs)|nil +---@return uv_async_t|nil handle, string? err_name, string? err_msg +---@nodiscard +function uv.new_async(callback) end + +-- TODO: make sure that the above method can indeed return nil + error. + +--- +---Wakeup the event loop and call the async handle's callback. +--- +---**Note**: It's safe to call this function from any thread. The callback will be +---called on the loop thread. +--- +---**Warning**: libuv will coalesce calls to `uv.async_send(async)`, that is, not +---every call to it will yield an execution of the callback. For example: if +---`uv.async_send()` is called 5 times in a row before the callback is called, the +---callback will only be called once. If `uv.async_send()` is called again after +---the callback was called, it will be called again. +--- +---@param async uv_async_t +---@param ... uv.aliases.threadargs +---@return 0|nil success, string? err_name, string? err_msg +function uv.async_send(async, ...) end +uv_async_t.send = uv.async_send + + + +--- +---Poll handles are used to watch file descriptors for readability and writability, +---similar to the purpose of [poll(2)](http://linux.die.net/man/2/poll). +--- +---The purpose of poll handles is to enable integrating external libraries that +---rely on the event loop to signal it about the socket status changes, like c-ares +---or libssh2. Using `uv_poll_t` for any other purpose is not recommended; +---`uv_tcp_t`, `uv_udp_t`, etc. provide an implementation that is faster and more +---scalable than what can be achieved with `uv_poll_t`, especially on Windows. +--- +---It is possible that poll handles occasionally signal that a file descriptor is +---readable or writable even when it isn't. The user should therefore always be +---prepared to handle EAGAIN or equivalent when it attempts to read from or write +---to the fd. +--- +---It is not okay to have multiple active poll handles for the same socket, this +---can cause libuv to busyloop or otherwise malfunction. +--- +---The user should not close a file descriptor while it is being polled by an +---active poll handle. This can cause the handle to report an error, but it might +---also start polling another socket. However the fd can be safely closed +---immediately after a call to `uv.poll_stop()` or `uv.close()`. +--- +---**Note**: On windows only sockets can be polled with poll handles. On Unix any +---file descriptor that would be accepted by poll(2) can be used. +--- +---@class uv_poll_t: uv_handle_t +---@section Poll handle +local uv_poll_t = {} + +---@alias uv.aliases.poll_events +---|'"r"' +---|'"w"' +---|>'"rw"' +---|'"d"' +---|'"rd"' +---|'"wd"' +---|'"rwd"' +---|'"p"' +---|'"rp"' +---|'"wp"' +---|'"rwp"' +---|'"dp"' +---|'"rdp"' +---|'"wdp"' +---|'"rwdp"' + +--- +---Initialize the handle using a file descriptor. +---The file descriptor is set to non-blocking mode. +--- +---@param fd integer # the file descriptor +---@return uv_poll_t|nil, string? err_name, string? err_msg +---@nodiscard +function uv.new_poll(fd) end + +--- +---Initialize the handle using a socket descriptor. On Unix this is identical to +---`uv.new_poll()`. On windows it takes a SOCKET handle. +---The socket is set to non-blocking mode. +--- +---@param fd integer # the file descriptor +---@return uv_poll_t|nil, string? err_name, string? err_msg +---@nodiscard +function uv.new_socket_poll(fd) end + +--- +---Starts polling the file descriptor. +---See alias below for accepted `events`, where `r` is `READABLE`, `w` is `WRITABLE`, `d` is +---`DISCONNECT`, and `p` is `PRIORITIZED`. +---As soon as an event is detected +---the callback will be called with status set to 0, and the detected events set on +---the events field. +--- +---The user should not close the socket while the handle is active. If the user +---does that anyway, the callback may be called reporting an error status, but this +---is not guaranteed. +--- +---**Note** Calling `uv.poll_start()` on a handle that is already active is fine. +---Doing so will update the events mask that is being watched for. +--- +---@param poll uv_poll_t +---@param events uv.aliases.poll_events|nil # (default: `"rw"`) +---@param callback fun(err?: string, events?: uv.aliases.poll_events) +---@return 0|nil success, string? err_name, string? err_msg +function uv.poll_start(poll, events, callback) end +uv_poll_t.start = uv.poll_start + +--- +---Stop polling the file descriptor, the callback will no longer be called. +--- +---@param poll uv_poll_t +---@return 0|nil success, string? err_name, string? err_msg +function uv.poll_stop(poll) end +uv_poll_t.stop = uv.poll_stop + + + +--- +---Signal handles implement Unix style signal handling on a per-event loop bases. +--- +---**Windows Notes:** +--- +---Reception of some signals is emulated on Windows: +--- - SIGINT is normally delivered when the user presses CTRL+C. However, like on +--- Unix, it is not generated when terminal raw mode is enabled. +--- - SIGBREAK is delivered when the user pressed CTRL + BREAK. +--- - SIGHUP is generated when the user closes the console window. On SIGHUP the +--- program is given approximately 10 seconds to perform cleanup. After that +--- Windows will unconditionally terminate it. +--- - SIGWINCH is raised whenever libuv detects that the console has been resized. +--- SIGWINCH is emulated by libuv when the program uses a uv_tty_t handle to write +--- to the console. SIGWINCH may not always be delivered in a timely manner; libuv +--- will only detect size changes when the cursor is being moved. When a readable +--- [`uv_tty_t`][] handle is used in raw mode, resizing the console buffer will +--- also trigger a SIGWINCH signal. +--- - Watchers for other signals can be successfully created, but these signals +--- are never received. These signals are: SIGILL, SIGABRT, SIGFPE, SIGSEGV, +--- SIGTERM and SIGKILL. +--- - Calls to raise() or abort() to programmatically raise a signal are not +--- detected by libuv; these will not trigger a signal watcher. +--- +---**Unix Notes:** +--- +--- - SIGKILL and SIGSTOP are impossible to catch. +--- - Handling SIGBUS, SIGFPE, SIGILL or SIGSEGV via libuv results into undefined +--- behavior. +--- - SIGABRT will not be caught by libuv if generated by abort(), e.g. through +--- assert(). +--- - On Linux SIGRT0 and SIGRT1 (signals 32 and 33) are used by the NPTL pthreads +--- library to manage threads. Installing watchers for those signals will lead to +--- unpredictable behavior and is strongly discouraged. Future versions of libuv +--- may simply reject them. +--- +---```lua +----- Create a new signal handler +---local signal = uv.new_signal() +----- Define a handler function +---uv.signal_start(signal, "sigint", function(signal) +--- print("got " .. signal .. ", shutting down") +--- os.exit(1) +---end) +---``` +--- +---@class uv_signal_t: uv_handle_t +---@section Signal handle +local uv_signal_t = {} + +---@alias uv.aliases.signals +---| "sigabrt" Abort signal from abort(3) +---| "sigalrm" Timer signal from alarm(2) +---| "sigbus" Bus error (bad memory access) +---| "sigchld" Child stopped or terminated +---| "sigcont" Continue if stopped +---| "sigfpe" Floating-point exception +---| "sighup" Hangup detected on controlling terminal or death of controlling process +---| "sigill" Illegal Instruction +---| "sigint" Interrupt from keyboard +---| "sigio" I/O now possible (4.2BSD) +---| "sigiot" IOT trap. A synonym for sigabrt +---| "sigkill" Kill signal +---| "sigpipe" Broken pipe: write to pipe with no readers; see pipe(7) +---| "sigpoll" Pollable event (Sys V); synonym for sigIO +---| "sigprof" Profiling timer expired +---| "sigpwr" Power failure (System V) +---| "sigquit" Quit from keyboard +---| "sigsegv" Invalid memory reference +---| "sigstkflt" Stack fault on coprocessor +---| "sigstop" Stop process +---| "sigtstp" Stop typed at terminal +---| "sigsys" Bad system call (SVr4); see also seccomp(2) +---| "sigterm" Termination signal +---| "sigtrap" Trace/breakpoint trap +---| "sigttin" Terminal input for background process +---| "sigttou" Terminal output for background process +---| "sigurg" Urgent condition on socket (4.2BSD) +---| "sigusr1" User-defined signal 1 +---| "sigusr2" User-defined signal 2 +---| "sigvtalrm" Virtual alarm clock (4.2BSD) +---| "sigxcpu" CPU time limit exceeded (4.2BSD); see setrlimit(2) +---| "sigxfsz" File size limit exceeded (4.2BSD);see setrlimit(2) +---| "sigwinch" Window resize signal (4.3BSD, Sun) +---| "sigbreak" CTRL + BREAK has been pressed +---| "siglost" File lock lost + +--- +---Creates and initializes a new `uv_signal_t`. +---Returns the Lua userdata wrapping it. +--- +---@return uv_signal_t|nil, string? err_name, string? err_msg +---@nodiscard +function uv.new_signal() end + +-- TODO: make sure that the above method can indeed return nil + error. + +--- +---Start the handle with the given callback, watching for the given signal. +--- +---@param signal uv_signal_t +---@param signum integer|uv.aliases.signals +---@param callback? fun(signum: uv.aliases.signals) +---@return 0|nil success, string? err_name, string? err_msg +function uv.signal_start(signal, signum, callback) end +uv_signal_t.start = uv.signal_start + +--- +---Same functionality as `uv.signal_start()` but the signal handler is reset the moment the signal is received. +--- +---@param signal uv_signal_t +---@param signum integer|uv.aliases.signals +---@param callback? fun(signum: uv.aliases.signals) +---@return 0|nil success, string? err_name, string? err_msg +function uv.signal_start_oneshot(signal, signum, callback) end +uv_signal_t.start_oneshot = uv.signal_start_oneshot + +--- +---Stop the handle, the callback will no longer be called. +--- +---@param signal uv_signal_t +---@return 0|nil success, string? err_name, string? err_msg +function uv.signal_stop(signal) end +uv_signal_t.stop = uv.signal_stop + + + +--- +---Process handles will spawn a new process and allow the user to control it and +---establish communication channels with it using streams. +--- +---@class uv_process_t: uv_handle_t +---@section Process handle +local uv_process_t = {} + +---@alias uv.aliases.spawn_options {args?: string[], stdio?: table, env?: table, cwd?: string, uid?: integer, gid?: integer, verbatim?: boolean, detached?: boolean, hide?: boolean} + +-- TODO: add descriptions to above fields + +--- +---Disables inheritance for file descriptors / handles that this process inherited +---from its parent. The effect is that child processes spawned by this process +---don't accidentally inherit these handles. +---It is recommended to call this function as early in your program as possible, +---before the inherited file descriptors can be closed or duplicated. +--- +---**Note:** This function works on a best-effort basis: there is no guarantee that +---libuv can discover all file descriptors that were inherited. In general it does +---a better job on Windows than it does on Unix. +--- +function uv.disable_stdio_inheritance() end + +--- +---Initializes the process handle and starts the process. If the process is +---successfully spawned, this function will return the handle and pid of the child +---process. +---Possible reasons for failing to spawn would include (but not be limited to) the +---file to execute not existing, not having permissions to use the setuid or setgid +---specified, or not having enough memory to allocate for the new process. +--- +---```lua +---local stdin = uv.new_pipe() +---local stdout = uv.new_pipe() +---local stderr = uv.new_pipe() +--- +---print("stdin", stdin) +---print("stdout", stdout) +---print("stderr", stderr) +--- +---local handle, pid = uv.spawn("cat", { +--- stdio = {stdin, stdout, stderr} +---}, function(code, signal) -- on exit +--- print("exit code", code) +--- print("exit signal", signal) +---end) +--- +---print("process opened", handle, pid) +--- +---uv.read_start(stdout, function(err, data) +--- assert(not err, err) +--- if data then +--- print("stdout chunk", stdout, data) +--- else +--- print("stdout end", stdout) +--- end +---end) +--- +---uv.read_start(stderr, function(err, data) +--- assert(not err, err) +--- if data then +--- print("stderr chunk", stderr, data) +--- else +--- print("stderr end", stderr) +--- end +---end) +--- +---uv.write(stdin, "Hello World") +--- +---uv.shutdown(stdin, function() +--- print("stdin shutdown", stdin) +--- uv.close(handle, function() +--- print("process closed", handle, pid) +--- end) +---end) +---``` +--- +---The `options` table accepts the following fields: +--- +--- - `options.args` - Command line arguments as a list of string. The first +---string should be the path to the program. On Windows, this uses CreateProcess +---which concatenates the arguments into a string. This can cause some strange +---errors. (See `options.verbatim` below for Windows.) +--- +--- - `options.stdio` - Set the file descriptors that will be made available to +--- the child process. The convention is that the first entries are stdin, stdout, +--- and stderr. (**Note**: On Windows, file descriptors after the third are +--- available to the child process only if the child processes uses the MSVCRT +--- runtime.) +--- +--- - `options.env` - Set environment variables for the new process. +--- +--- - `options.cwd` - Set the current working directory for the sub-process. +--- +--- - `options.uid` - Set the child process' user id. +--- +--- - `options.gid` - Set the child process' group id. +--- +--- - `options.verbatim` - If true, do not wrap any arguments in quotes, or +--- perform any other escaping, when converting the argument list into a command +--- line string. This option is only meaningful on Windows systems. On Unix it is +--- silently ignored. +--- +--- - `options.detached` - If true, spawn the child process in a detached state - +--- this will make it a process group leader, and will effectively enable the +--- child to keep running after the parent exits. Note that the child process +--- will still keep the parent's event loop alive unless the parent process calls +--- `uv.unref()` on the child's process handle. +--- +--- - `options.hide` - If true, hide the subprocess console window that would +--- normally be created. This option is only meaningful on Windows systems. On +--- Unix it is silently ignored. +---The `options.stdio` entries can take many shapes. +--- +--- - If they are numbers, then the child process inherits that same zero-indexed +--- fd from the parent process. +--- +--- - If `uv_stream_t` handles are passed in, those are used as a read-write pipe +--- or inherited stream depending if the stream has a valid fd. +--- +--- - Including `nil` placeholders means to ignore that fd in the child process. +--- +---When the child process exits, `on_exit` is called with an exit code and signal. +--- +---@param path string +---@param options uv.aliases.spawn_options +---@param on_exit fun(code: integer, signal: integer)? +---@return uv_process_t|nil, integer|string, string? +function uv.spawn(path, options, on_exit) end + +--- +---Sends the specified signal to the given process handle. +--- +---@param process uv_process_t +---@param signum integer|uv.aliases.signals +---@return 0|nil success, string? err_name, string? err_msg +function uv.process_kill(process, signum) end +uv_process_t.kill = uv.process_kill + +--- +---Sends the specified signal to the given PID. +--- +---@param pid integer +---@param signum integer|uv.aliases.signals +---@return 0|nil success, string? err_name, string? err_msg +function uv.kill(pid, signum) end + +--- +---Returns the handle's pid. +--- +---@param process uv_process_t +---@return integer +---@nodiscard +function uv.process_get_pid(process) end +uv_process_t.get_pid = uv.process_get_pid + + + +--- +---Stream handles provide an abstraction of a duplex communication channel. +---`uv_stream_t` is an abstract type, libuv provides 3 stream implementations +---in the form of `uv_tcp_t`, `uv_pipe_t` and `uv_tty_t`. +--- +---@class uv_stream_t: uv_handle_t +---@section Stream handle +local uv_stream_t = {} + +---@class uv_shutdown_t: uv_req_t + +---@class uv_write_t: uv_req_t + +--- +---Shutdown the outgoing (write) side of a duplex stream. It waits for pending +---write requests to complete. The callback is called after shutdown is complete. +--- +---@param stream uv_stream_t +---@param callback fun(err?: string)|nil +---@return uv_shutdown_t|nil stream, string? err_name, string? err_msg +function uv.shutdown(stream, callback) end +uv_stream_t.shutdown = uv.shutdown + +--- +---Start listening for incoming connections. `backlog` indicates the number of +---connections the kernel might queue, same as `listen(2)`. When a new incoming +---connection is received the callback is called. +--- +---@param stream uv_stream_t +---@param backlog integer +---@param callback fun(err?: string) +---@return 0|nil success, string? err_name, string? err_msg +function uv.listen(stream, backlog, callback) end +uv_stream_t.listen = uv.listen + +--- +---This call is used in conjunction with `uv.listen()` to accept incoming +---connections. Call this function after receiving a callback to accept the +---connection. +--- +---When the connection callback is called it is guaranteed that this function +---will complete successfully the first time. If you attempt to use it more than +---once, it may fail. It is suggested to only call this function once per +---connection call. +--- +---```lua +---server:listen(128, function (err) +--- local client = uv.new_tcp() +--- server:accept(client) +---end) +---``` +--- +---@param stream uv_stream_t +---@param client_stream uv_stream_t +---@return 0|nil success, string? err_name, string? err_msg +function uv.accept(stream, client_stream) end +uv_stream_t.accept = uv.accept + +--- +---Read data from an incoming stream. The callback will be made several times until +---there is no more data to read or `uv.read_stop()` is called. When we've reached +---EOF, `data` will be `nil`. +--- +---```lua +---stream:read_start(function (err, chunk) +--- if err then +--- -- handle read error +--- elseif chunk then +--- -- handle data +--- else +--- -- handle disconnect +--- end +---end) +---``` +--- +---@param stream uv_stream_t +---@param callback fun(err?: string, data?: string) +---@return 0|nil success, string? err_name, string? err_msg +function uv.read_start(stream, callback) end +uv_stream_t.read_start = uv.read_start + +--- +---Stop reading data from the stream. The read callback will no longer be called. +---This function is idempotent and may be safely called on a stopped stream. +--- +---@param stream uv_stream_t +---@return 0|nil success, string? err_name, string? err_msg +function uv.read_stop(stream) end +uv_stream_t.read_stop = uv.read_stop + +--- +---Write data to stream. +---`data` can either be a Lua string or a table of strings. If a table is passed +---in, the C backend will use writev to send all strings in a single system call. +---The optional `callback` is for knowing when the write is complete. +--- +---@param stream uv_stream_t +---@param data uv.aliases.buffer +---@param callback fun(err?: string)|nil +---@return uv_write_t|nil stream, string? err_name, string? err_msg +function uv.write(stream, data, callback) end +uv_stream_t.write = uv.write + +--- +---Extended write function for sending handles over a pipe. The pipe must be +---initialized with `ipc` option `true`. +--- +---**Note:** `send_handle` must be a TCP socket or pipe, which is a server or a +---connection (listening or connected state). Bound sockets or pipes will be +---assumed to be servers. +--- +---@param stream uv_stream_t +---@param data uv.aliases.buffer +---@param send_handle uv_tcp_t|uv_pipe_t +---@param callback fun()|nil +---@return uv_write_t|nil stream, string? err_name, string? err_msg +function uv.write2(stream, data, send_handle, callback) end +uv_stream_t.write2 = uv.write2 + +--- +---Same as `uv.write()`, but won't queue a write request if it can't be completed +---immediately. +---Will return number of bytes written (can be less than the supplied buffer size). +--- +---@param stream uv_stream_t +---@param data uv.aliases.buffer +---@return integer|nil, string? err_name, string? err_msg +function uv.try_write(stream, data) end +uv_stream_t.try_write = uv.try_write + +--- +---Like `uv.write2()`, but with the properties of `uv.try_write()`. Not supported on Windows, where it returns `UV_EAGAIN`. +---Will return number of bytes written (can be less than the supplied buffer size). +--- +---@param stream uv_stream_t +---@param data uv.aliases.buffer +---@param send_handle uv_tcp_t|uv_pipe_t +---@return integer|nil, string? err_name, string? err_msg +function uv.try_write2(stream, data, send_handle) end +uv_stream_t.try_write2 = uv.try_write2 + +--- +---Returns `true` if the stream is readable, `false` otherwise. +--- +---@param stream uv_stream_t +---@return boolean +---@nodiscard +function uv.is_readable(stream) end +uv_stream_t.is_readable = uv.is_readable + +--- +---Returns `true` if the stream is writable, `false` otherwise. +--- +---@param stream uv_stream_t +---@return boolean +---@nodiscard +function uv.is_writable(stream) end +uv_stream_t.is_writable = uv.is_writable + +--- +---Enable or disable blocking mode for a stream. +---When blocking mode is enabled all writes complete synchronously. The interface +---remains unchanged otherwise, e.g. completion or failure of the operation will +---still be reported through a callback which is made asynchronously. +--- +---**Warning**: Relying too much on this API is not recommended. It is likely to +---change significantly in the future. Currently this only works on Windows and +---only for `uv_pipe_t` handles. Also libuv currently makes no ordering guarantee +---when the blocking mode is changed after write requests have already been +---submitted. Therefore it is recommended to set the blocking mode immediately +---after opening or creating the stream. +--- +---@param stream uv_stream_t +---@param blocking boolean +---@return 0|nil success, string? err_name, string? err_msg +function uv.stream_set_blocking(stream, blocking) end +uv_stream_t.set_blocking = uv.stream_set_blocking + +--- +---Returns the stream's write queue size. +--- +---@return integer +---@nodiscard +function uv.stream_get_write_queue_size() end +uv_stream_t.get_write_queue_size = uv.stream_get_write_queue_size + + + +--- +---TCP handles are used to represent both TCP streams and servers. +--- +---@class uv_tcp_t: uv_stream_t +---@section TCP handle +local uv_tcp_t = {} + +---@class uv_connect_t: uv_req_t + +---@alias uv.aliases.network_family +---|'"unix"' +---|'"inet"' +---|'"inet6"' +---|'"ipx"' +---|'"netlink"' +---|'"x25"' +---|'"ax25"' +---|'"atmpvc"' +---|'"appletalk"' +---|'"packet"' + +---@alias uv.aliases.network_protocols +---|'"ip"' # internet protocol, pseudo protocol number +---|'"hopopt"' # hop-by-hop options for ipv6 +---|'"icmp"' # internet control message protocol +---|'"igmp"' # internet group management protocol +---|'"ggp"' # gateway-gateway protocol +---|'"ipv4"' # IPv4 encapsulation +---|'"st"' # ST datagram mode +---|'"tcp"' # transmission control protocol +---|'"cbt"' # CBT, Tony Ballardie +---|'"egp"' # exterior gateway protocol +---|'"igp"' # any private interior gateway (Cisco: for IGRP) +---|'"bbn-rcc"' # BBN RCC Monitoring +---|'"nvp"' # Network Voice Protocol +---|'"pup"' # PARC universal packet protocol +---|'"argus"' # ARGUS (deprecated) +---|'"emcon"' # EMCON +---|'"xnet"' # Cross Net Debugger +---|'"chaos"' # Chaos +---|'"udp"' # user datagram protocol +---|'"mux"' # Multiplexing protocol +---|'"dcn"' # DCN Measurement Subsystems +---|'"hmp"' # host monitoring protocol +---|'"prm"' # packet radio measurement protocol +---|'"xns-idp"' # Xerox NS IDP +---|'"trunk-1"' # Trunk-1 +---|'"trunk-2"' # Trunk-2 +---|'"leaf-1"' # Leaf-1 +---|'"leaf-2"' # Leaf-2 +---|'"rdp"' # "reliable datagram" protocol +---|'"irtp"' # Internet Reliable Transaction Protocol +---|'"iso-tp4"' # ISO Transport Protocol Class 4 +---|'"netblt"' # Bulk Data Transfer Protocol +---|'"mfe-nsp"' # MFE Network Services Protocol +---|'"merit-inp"' # MERIT Internodal Protocol +---|'"dccp"' # Datagram Congestion Control Protocol +---|'"3pc"' # Third Party Connect Protocol +---|'"idpr"' # Inter-Domain Policy Routing Protocol +---|'"xtp"' # Xpress Tranfer Protocol +---|'"ddp"' # Datagram Delivery Protocol +---|'"idpr-cmtp"' # IDPR Control Message Transport Proto +---|'"tp++"' # TP++ Transport Protocol +---|'"il"' # IL Transport Protocol +---|'"ipv6"' # IPv6 encapsulation +---|'"sdrp"' # Source Demand Routing Protocol +---|'"ipv6-route"' # Routing Header for IPv6 +---|'"ipv6-frag"' # Fragment Header for IPv6 +---|'"idrp"' # Inter-Domain Routing Protocol +---|'"rsvp"' # Resource ReSerVation Protocol +---|'"gre"' # Generic Routing Encapsulation +---|'"dsr"' # Dynamic Source Routing Protocol +---|'"bna"' # BNA +---|'"esp"' # Encap Security Payload +---|'"ipv6-crypt"' # Encryption Header for IPv6 (not in official list) +---|'"ah"' # Authentication Header +---|'"ipv6-auth"' # Authentication Header for IPv6 (not in official list) +---|'"i-nlsp"' # Integrated Net Layer Security TUBA +---|'"swipe"' # IP with Encryption +---|'"narp"' # NBMA Address Resolution Protocol +---|'"mobile"' # IP Mobility +---|'"tlsp"' # Transport Layer Security Protocol +---|'"skip"' # SKIP +---|'"ipv6-icmp"' # ICMP for IPv6 +---|'"ipv6-nonxt"' # No Next Header for IPv6 +---|'"ipv6-opts"' # Destination Options for IPv6 +---|'"#"' # any host internal protocol +---|'"cftp"' # CFTP +---|'"#"' # any local network +---|'"sat-expak"' # SATNET and Backroom EXPAK +---|'"kryptolan"' # Kryptolan +---|'"rvd"' # MIT Remote Virtual Disk Protocol +---|'"ippc"' # Internet Pluribus Packet Core +---|'"#"' # any distributed file system +---|'"sat-mon"' # SATNET Monitoring +---|'"visa"' # VISA Protocol +---|'"ipcv"' # Internet Packet Core Utility +---|'"cpnx"' # Computer Protocol Network Executive +---|'"cphb"' # Computer Protocol Heart Beat +---|'"wsn"' # Wang Span Network +---|'"pvp"' # Packet Video Protocol +---|'"br-sat-mon"' # Backroom SATNET Monitoring +---|'"sun-nd"' # SUN ND PROTOCOL-Temporary +---|'"wb-mon"' # WIDEBAND Monitoring +---|'"wb-expak"' # WIDEBAND EXPAK +---|'"iso-ip"' # ISO Internet Protocol +---|'"vmtp"' # Versatile Message Transport +---|'"secure-vmtp"' # SECURE-VMTP +---|'"vines"' # VINES +---|'"ttp"' # TTP +---|'"nsfnet-igp"' # NSFNET-IGP +---|'"dgp"' # Dissimilar Gateway Protocol +---|'"tcf"' # TCF +---|'"eigrp"' # Enhanced Interior Routing Protocol (Cisco) +---|'"ospf"' # Open Shortest Path First IGP +---|'"sprite-rpc"' # Sprite RPC Protocol +---|'"larp"' # Locus Address Resolution Protocol +---|'"mtp"' # Multicast Transport Protocol +---|'"ax.25"' # AX.25 Frames +---|'"ipip"' # Yet Another IP encapsulation +---|'"micp"' # Mobile Internetworking Control Pro. +---|'"scc-sp"' # Semaphore Communications Sec. Pro. +---|'"etherip"' # Ethernet-within-IP Encapsulation +---|'"encap"' # Yet Another IP encapsulation +---|'"#"' # any private encryption scheme +---|'"gmtp"' # GMTP +---|'"ifmp"' # Ipsilon Flow Management Protocol +---|'"pnni"' # PNNI over IP +---|'"pim"' # Protocol Independent Multicast +---|'"aris"' # ARIS +---|'"scps"' # SCPS +---|'"qnx"' # QNX +---|'"a/n"' # Active Networks +---|'"ipcomp"' # IP Payload Compression Protocol +---|'"snp"' # Sitara Networks Protocol +---|'"compaq-peer"' # Compaq Peer Protocol +---|'"ipx-in-ip"' # IPX in IP +---|'"vrrp"' # Virtual Router Redundancy Protocol +---|'"pgm"' # PGM Reliable Transport Protocol +---|'"#"' # any 0-hop protocol +---|'"l2tp"' # Layer Two Tunneling Protocol +---|'"ddx"' # D-II Data Exchange +---|'"iatp"' # Interactive Agent Transfer Protocol +---|'"stp"' # Schedule Transfer +---|'"srp"' # SpectraLink Radio Protocol +---|'"uti"' # UTI +---|'"smp"' # Simple Message Protocol +---|'"sm"' # SM (deprecated) +---|'"ptp"' # Performance Transparency Protocol +---|'"isis"' # ISIS over IPv4 +---|'"crtp"' # Combat Radio Transport Protocol +---|'"crudp"' # Combat Radio User Datagram +---|'"sps"' # Secure Packet Shield +---|'"pipe"' # Private IP Encapsulation within IP +---|'"sctp"' # Stream Control Transmission Protocol +---|'"fc"' # Fibre Channel +---|'"mobility-header"' # Mobility Header +---|'"manet"' # MANET Protocols +---|'"hip"' # Host Identity Protocol +---|'"shim6"' # Shim6 Protocol +---|'"wesp"' # Wrapped Encapsulating Security Payload +---|'"rohc"' # Robust Header Compression + +---@alias uv.aliases.tcp_socket_type +---|>'"stream"' +---|'"dgram"' +---|'"raw"' +---|'"rdm"' +---|'"seqpacket"' + +---@alias uv.aliases.tcp_bind_flags {ipv6only?: boolean} + +---@alias uv.aliases.getpeername_rtn {ip: string, family: uv.aliases.network_family, port: integer} + +---@alias uv.aliases.getsockname_rtn uv.aliases.getpeername_rtn + +---@alias uv.aliases.socketpair_flags {nonblock: boolean} + +--- +---Creates and initializes a new `uv_tcp_t`. +---Returns the Lua userdata wrapping it. +--- +---@param flags uv.aliases.network_family|integer +---@return uv_tcp_t|nil, string? err_name, string? err_msg +---@nodiscard +function uv.new_tcp(flags) end +---@return uv_tcp_t +---@nodiscard +function uv.new_tcp() end + +--- +---Open an existing file descriptor or SOCKET as a TCP handle. +--- +---**Note:** The passed file descriptor or SOCKET is not checked for its type, but it's required that it represents a valid stream socket. +--- +---@param tcp uv_tcp_t +---@param sock integer +---@return 0|nil success, string? err_name, string? err_msg +function uv.tcp_open(tcp, sock) end +uv_tcp_t.open = uv.tcp_open + +--- +---Enable / disable Nagle's algorithm. +--- +---@param tcp uv_tcp_t +---@param enable boolean +---@return 0|nil success, string? err_name, string? err_msg +function uv.tcp_nodelay(tcp, enable) end +uv_tcp_t.nodelay = uv.tcp_nodelay + +--- +---Enable / disable TCP keep-alive. `delay` is the initial delay in seconds, +---ignored when enable is `false`. +--- +---@param tcp uv_tcp_t +---@param enable boolean +---@param delay integer|nil +---@return 0|nil success, string? err_name, string? err_msg +function uv.tcp_keepalive(tcp, enable, delay) end +uv_tcp_t.keepalive = uv.tcp_keepalive + +--- +---Enable / disable simultaneous asynchronous accept requests that are queued by +---the operating system when listening for new TCP connections. +--- +---This setting is used to tune a TCP server for the desired performance. Having +---simultaneous accepts can significantly improve the rate of accepting connections +---(which is why it is enabled by default) but may lead to uneven load distribution +---in multi-process setups. +--- +---@param tcp uv_tcp_t +---@param enable boolean +---@return 0|nil success, string? err_name, string? err_msg +function uv.tcp_simultaneous_accepts(tcp, enable) end +uv_tcp_t.simultaneous_accepts = uv.tcp_simultaneous_accepts + +--- +---Bind the handle to an host and port. `host` should be an IP address and +---not a domain name. Any `flags` are set with a table with field `ipv6only` +---equal to `true` or `false`. +--- +---When the port is already taken, you can expect to see an `EADDRINUSE` error +---from either `uv.tcp_bind()`, `uv.listen()` or `uv.tcp_connect()`. That is, a +---successful call to this function does not guarantee that the call to `uv.listen()` +---or `uv.tcp_connect()` will succeed as well. +--- +---Use a port of `0` to let the OS assign an ephemeral port. You can look it up +---later using `uv.tcp_getsockname()`. +--- +---@param tcp uv_tcp_t +---@param host string +---@param port integer +---@param flags uv.aliases.tcp_bind_flags|nil +---@return 0|nil success, string? err_name, string? err_msg +function uv.tcp_bind(tcp, host, port, flags) end +uv_tcp_t.bind = uv.tcp_bind + +--- +---Get the address of the peer connected to the handle. +--- +---@param tcp uv_tcp_t +---@return uv.aliases.getpeername_rtn|nil, string? err_name, string? err_msg +---@nodiscard +function uv.tcp_getpeername(tcp) end +uv_tcp_t.getpeername = uv.tcp_getpeername + +--- +---Get the current address to which the handle is bound. +--- +---@param tcp uv_tcp_t +---@return uv.aliases.getsockname_rtn|nil, string? err_name, string? err_msg +---@nodiscard +function uv.tcp_getsockname(tcp) end +uv_tcp_t.getsockname = uv.tcp_getsockname + +--- +---Establish an IPv4 or IPv6 TCP connection. +--- +---```lua +---local client = uv.new_tcp() +---client:connect("127.0.0.1", 8080, function (err) +--- -- check error and carry on. +---end) +---``` +--- +---@param tcp uv_tcp_t +---@param host string +---@param port integer +---@param callback fun(err?: string) +---@return uv_connect_t|nil stream, string? err_name, string? err_msg +function uv.tcp_connect(tcp, host, port, callback) end +uv_tcp_t.connect = uv.tcp_connect + +--- +---Please use `uv.stream_get_write_queue_size()` instead. +--- +---@param tcp uv_tcp_t +---@deprecated +function uv.tcp_write_queue_size(tcp) end +uv_tcp_t.write_queue_size = uv.tcp_write_queue_size + +--- +---Resets a TCP connection by sending a RST packet. This is accomplished by setting +---the SO_LINGER socket option with a linger interval of zero and then calling +---`uv.close()`. Due to some platform inconsistencies, mixing of `uv.shutdown()` +---and `uv.tcp_close_reset()` calls is not allowed. +--- +---@param tcp uv_tcp_t +---@param callback fun()|nil +---@return 0|nil success, string? err_name, string? err_msg +function uv.tcp_close_reset(tcp, callback) end +uv_tcp_t.close_reset = uv.tcp_close_reset + +--- +---Create a pair of connected sockets with the specified properties. The resulting handles can be passed to `uv.tcp_open`, used with `uv.spawn`, or for any other purpose. +---When specified as a string, `socktype` must be one of `"stream"`, `"dgram"`, `"raw"`, +---`"rdm"`, or `"seqpacket"`. +--- +---When `protocol` is set to 0 or nil, it will be automatically chosen based on the socket's domain and type. When `protocol` is specified as a string, it will be looked up using the `getprotobyname(3)` function (examples: `"ip"`, `"icmp"`, `"tcp"`, `"udp"`, etc). +--- +---Flags: +---- `nonblock`: Opens the specified socket handle for `OVERLAPPED` or `FIONBIO`/`O_NONBLOCK` I/O usage. This is recommended for handles that will be used by libuv, and not usually recommended otherwise. +--- +---Equivalent to `socketpair(2)` with a domain of `AF_UNIX`. +--- +---```lua +----- Simple read/write with tcp +---local fds = uv.socketpair(nil, nil, {nonblock=true}, {nonblock=true}) +--- +---local sock1 = uv.new_tcp() +---sock1:open(fds[1]) +--- +---local sock2 = uv.new_tcp() +---sock2:open(fds[2]) +--- +---sock1:write("hello") +---sock2:read_start(function(err, chunk) +--- assert(not err, err) +--- print(chunk) +---end) +---``` +--- +---@param socktype uv.aliases.tcp_socket_type|integer|nil # (default: `"stream"`) +---@param protocol uv.aliases.network_protocols|integer|nil # (default: `0`) +---@param flags1 uv.aliases.socketpair_flags|nil # (nonblock default: `false`) +---@param flags2 uv.aliases.socketpair_flags|nil # (nonblock default: `false`) +---@return {[1]: integer, [2]: integer}|nil, string? err_name, string? err_msg # [1, 2] file descriptor +function uv.socketpair(socktype, protocol, flags1, flags2) end + + + +--- +---Pipe handles provide an abstraction over local domain sockets on Unix and named pipes on Windows. +--- +---```lua +---local pipe = uv.new_pipe(false) +--- +---pipe:bind('/tmp/sock.test') +--- +---pipe:listen(128, function() +--- local client = uv.new_pipe(false) +--- pipe:accept(client) +--- client:write("hello!\n") +--- client:close() +---end) +---``` +--- +---@class uv_pipe_t: uv_stream_t +---@section Pipe handle +local uv_pipe_t = {} + +---@alias uv.aliases.pipe_chmod_flags +---|'"r"' +---|'"w"' +---|'"rw"' +---|'"wr"' + +---@alias uv.aliases.pipe_flags {nonblock: boolean} # (nonblock default: `false`) + +---@alias uv.aliases.pipe_rtn {read: integer, write: integer} + +--- +---Creates and initializes a new `uv_pipe_t`. Returns the Lua userdata wrapping +---it. The `ipc` argument is a boolean to indicate if this pipe will be used for +---handle passing between processes. +--- +---@param ipc boolean|nil +---@return uv_pipe_t|nil, string? err_name, string? err_msg +---@nodiscard +function uv.new_pipe(ipc) end + +-- TODO: make sure the above method can indeed return nil + error message. + +--- +---Open an existing file descriptor or `uv_handle_t` as a pipe. +--- +---**Note**: The file descriptor is set to non-blocking mode. +--- +---@param pipe uv_pipe_t +---@param fd integer +---@return 0|nil success, string? err_name, string? err_msg +function uv.pipe_open(pipe, fd) end +uv_pipe_t.open = uv.pipe_open + +--- +---Bind the pipe to a file path (Unix) or a name (Windows). +--- +---**Note**: Paths on Unix get truncated to sizeof(sockaddr_un.sun_path) bytes, +---typically between 92 and 108 bytes. +--- +---@param pipe uv_pipe_t +---@param name string +---@return 0|nil success, string? err_name, string? err_msg +function uv.pipe_bind(pipe, name) end +uv_pipe_t.bind = uv.pipe_bind + +--- +---Connect to the Unix domain socket or the named pipe. +--- +---**Note**: Paths on Unix get truncated to sizeof(sockaddr_un.sun_path) bytes, +---typically between 92 and 108 bytes. +--- +---@param pipe uv_pipe_t +---@param name string +---@param callback fun(err?: string)|nil +---@return uv_connect_t|nil stream, string? err_name, string? err_msg +function uv.pipe_connect(pipe, name, callback) end +uv_pipe_t.connect = uv.pipe_connect + +--- +---Get the name of the Unix domain socket or the named pipe. +--- +---@param pipe uv_pipe_t +---@return string|nil, string? err_name, string? err_msg +---@nodiscard +function uv.pipe_getsockname(pipe) end +uv_pipe_t.getsockname = uv.pipe_getsockname + +--- +---Get the name of the Unix domain socket or the named pipe to which the handle is +---connected. +--- +---@param pipe uv_pipe_t +---@return string|nil, string? err_name, string? err_msg +---@nodiscard +function uv.pipe_getpeername(pipe) end +uv_pipe_t.getpeername = uv.pipe_getpeername + +--- +---Set the number of pending pipe instance handles when the pipe server is waiting +---for connections. +--- +---**Note**: This setting applies to Windows only. +--- +---@param pipe uv_pipe_t +---@param count integer +function uv.pipe_pending_instances(pipe, count) end +uv_pipe_t.pending_instances = uv.pipe_pending_instances + +--- +---Returns the pending pipe count for the named pipe. +--- +---@param pipe uv_pipe_t +---@return integer +---@nodiscard +function uv.pipe_pending_count(pipe) end +uv_pipe_t.pending_count = uv.pipe_pending_count + +--- +---Used to receive handles over IPC pipes. +--- +---First - call `uv.pipe_pending_count()`, if it's > 0 then initialize a handle of +---the given type, returned by `uv.pipe_pending_type()` and call +---`uv.accept(pipe, handle)`. +--- +---@param pipe uv_pipe_t +---@return string +---@nodiscard +function uv.pipe_pending_type(pipe) end +uv_pipe_t.pending_type = uv.pipe_pending_type + +--- +---Alters pipe permissions, allowing it to be accessed from processes run by different users. +---Makes the pipe writable or readable by all users. +---See below for accepted flags, where `r` is `READABLE` and `w` is `WRITABLE`. +---This function is blocking. +--- +---@param pipe uv_pipe_t +---@param flags uv.aliases.pipe_chmod_flags +---@return 0|nil success, string? err_name, string? err_msg +function uv.pipe_chmod(pipe, flags) end +uv_pipe_t.chmod = uv.pipe_chmod + +--- +---Create a pair of connected pipe handles. Data may be written to the `write` fd and read from the `read` fd. +---The resulting handles can be passed to `pipe_open`, used with `spawn`, or for any other purpose. +--- +---Flags: +--- - `nonblock`: Opens the specified socket handle for `OVERLAPPED` or `FIONBIO`/`O_NONBLOCK` I/O usage. +--- This is recommended for handles that will be used by libuv, and not usually recommended otherwise. +--- +---Equivalent to `pipe(2)` with the `O_CLOEXEC` flag set. +--- +---```lua +----- Simple read/write with pipe_open +---local fds = uv.pipe({nonblock=true}, {nonblock=true}) +--- +---local read_pipe = uv.new_pipe() +---read_pipe:open(fds.read) +--- +---local write_pipe = uv.new_pipe() +---write_pipe:open(fds.write) +--- +---write_pipe:write("hello") +---read_pipe:read_start(function(err, chunk) +--- assert(not err, err) +--- print(chunk) +---end) +---``` +--- +---@param read_flags uv.aliases.pipe_flags|nil # (nonblock default: `false`) +---@param write_flags uv.aliases.pipe_flags|nil # (nonblock default: `false`) +---@return uv.aliases.pipe_rtn|nil, string? err_name, string? err_msg +---@nodiscard +function uv.pipe(read_flags, write_flags) end + + + +--- +---TTY handles represent a stream for the console. +--- +---```lua +----- Simple echo program +---local stdin = uv.new_tty(0, true) +---local stdout = uv.new_tty(1, false) +--- +---stdin:read_start(function (err, data) +--- assert(not err, err) +--- if data then +--- stdout:write(data) +--- else +--- stdin:close() +--- stdout:close() +--- end +---end) +---``` +--- +---@class uv_tty_t: uv_stream_t +---@section TTY handle +local uv_tty_t = {} + +---@alias uv.aliases.tty_fd +---|0 # stdin +---|1 # stdout +---|2 # stderr + +---@alias uv.aliases.tty_mode +---|0 # UV_TTY_MODE_NORMAL: Initial/normal terminal mode +---|1 # UV_TTY_MODE_RAW: Raw input mode (On Windows, ENABLE_WINDOW_INPUT is also enabled) +---|2 # UV_TTY_MODE_IO: Binary-safe I/O mode for IPC (Unix-only) + +---@alias uv.aliases.tty_vsterm_state +---|'supported' +---|'unsupported' + +--- +---Initialize a new TTY stream with the given file descriptor. +---See below for possible file descriptors. +--- +---On Unix this function will determine the path of the fd of the terminal using +---ttyname_r(3), open it, and use it if the passed file descriptor refers to a TTY. +--- +---This lets libuv put the tty in non-blocking mode without affecting other +---processes that share the tty. +--- +---This function is not thread safe on systems that don’t support ioctl TIOCGPTN or TIOCPTYGNAME, for instance OpenBSD and Solaris. +--- +---**Note:** If reopening the TTY fails, libuv falls back to blocking writes. +--- +---@param fd uv.aliases.tty_fd|integer +---@param readable boolean +---@return uv_tty_t|nil, string? err_name, string? err_msg +---@nodiscard +function uv.new_tty(fd, readable) end + +--- +---Set the TTY using the specified terminal mode. +--- +---Parameter `mode` is a C enum with the values below. +--- +---@param tty uv_tty_t +---@param mode uv.aliases.tty_mode +---@return 0|nil success, string? err_name, string? err_msg +function uv.tty_set_mode(tty, mode) end +uv_tty_t.set_mode = uv.tty_set_mode + +--- +---To be called when the program exits. Resets TTY settings to default values for +---the next process to take over. +---This function is async signal-safe on Unix platforms but can fail with error +---code `EBUSY` if you call it when execution is inside `uv.tty_set_mode()`. +--- +---@return 0|nil success, string? err_name, string? err_msg +function uv.tty_reset_mode() end + +--- +---Gets the current Window width and height. +--- +---@param tty uv_tty_t +---@return integer|nil width, integer|string height_or_errname, string? err_msg +---@nodiscard +function uv.tty_get_winsize(tty) end +uv_tty_t.get_winsize = uv.tty_get_winsize + +--- +---Controls whether console virtual terminal sequences are processed by libuv or +---console. Useful in particular for enabling ConEmu support of ANSI X3.64 and +---Xterm 256 colors. Otherwise Windows10 consoles are usually detected +---automatically. State should be one of: `"supported"` or `"unsupported"`. +--- +---This function is only meaningful on Windows systems. On Unix it is silently +---ignored. +--- +---@param state uv.aliases.tty_vsterm_state +function uv.tty_set_vterm_state(state) end + +--- +---Get the current state of whether console virtual terminal sequences are handled +---by libuv or the console. The return value is `"supported"` or `"unsupported"`. +---This function is not implemented on Unix, where it returns `ENOTSUP`. +--- +---@return uv.aliases.tty_vsterm_state|nil, string? err_name, string? err_msg +---@nodiscard +function uv.tty_get_vterm_state() end + + + +--- +---UDP handles encapsulate UDP communication for both clients and servers. +--- +---@class uv_udp_t: uv_handle_t +---@section UDP handle +local uv_udp_t = {} + +---@class uv_udp_send_t: userdata + +---@alias uv.aliases.new_udp_flags {family: uv.aliases.network_family, mmsgs: integer} + +---@alias uv.aliases.udp_bind_flags {ipv6only: boolean, reuseaddr: boolean} + +---@alias uv.aliases.udp_getsockname_rtn uv.aliases.getsockname_rtn + +---@alias uv.aliases.udp_getpeername_rtn uv.aliases.getpeername_rtn + +---@alias uv.aliases.udp_membership '"join"'|'"leave"' + +---@alias uv.aliases.udp_recv_start_callback_flags {partial: boolean|nil, mmsg_chunk: boolean|nil} + +--- +---Creates and initializes a new `uv_udp_t`. Returns the Lua userdata wrapping +---it. The actual socket is created lazily. +--- +---See below for accepted `family` values. +--- +---When specified, `mmsgs` determines the number of messages able to be received +---at one time via `recvmmsg(2)` (the allocated buffer will be sized to be able +---to fit the specified number of max size dgrams). Only has an effect on +---platforms that support `recvmmsg(2)`. +--- +---**Note:** For backwards compatibility reasons, `flags` can also be a string or +---integer. When it is a string, it will be treated like the `family` key above. +---When it is an integer, it will be used directly as the `flags` parameter when +---calling `uv_udp_init_ex`. +--- +---@param flags uv.aliases.new_udp_flags|uv.aliases.network_family|integer # (mmsgs default: `1`) +---@return uv_udp_t|nil, string? err_name, string? err_msg +---@nodiscard +function uv.new_udp(flags) end +---@return uv_udp_t +---@nodiscard +function uv.new_udp() end + +--- +---Returns the handle's send queue size. +--- +---@return integer +---@nodiscard +function uv.udp_get_send_queue_size() end +uv_udp_t.get_send_queue_size = uv.udp_get_send_queue_size + +--- +---Returns the handle's send queue count. +--- +---@return integer +---@nodiscard +function uv.udp_get_send_queue_count() end +uv_udp_t.get_send_queue_count = uv.udp_get_send_queue_count + +--- +---Opens an existing file descriptor or Windows SOCKET as a UDP handle. +--- +---Unix only: The only requirement of the sock argument is that it follows the +---datagram contract (works in unconnected mode, supports sendmsg()/recvmsg(), +---etc). In other words, other datagram-type sockets like raw sockets or netlink +---sockets can also be passed to this function. +--- +---The file descriptor is set to non-blocking mode. +--- +---**Note:** The passed file descriptor or SOCKET is not checked for its type, but +---it's required that it represents a valid datagram socket. +--- +---@param udp uv_udp_t +---@param fd integer +---@return 0|nil success, string? err_name, string? err_msg +function uv.udp_open(udp, fd) end +uv_udp_t.open = uv.udp_open + +--- +---Bind the UDP handle to an IP address and port. Any `flags` are set with a table +---with fields `reuseaddr` or `ipv6only` equal to `true` or `false`. +--- +---@param udp uv_udp_t +---@param host string +---@param port integer +---@param flags uv.aliases.udp_bind_flags|nil +---@return 0|nil success, string? err_name, string? err_msg +function uv.udp_bind(udp, host, port, flags) end +uv_udp_t.bind = uv.udp_bind + +--- +---Get the local IP and port of the UDP handle. +--- +---@param udp uv_udp_t +---@return uv.aliases.udp_getsockname_rtn|nil, string? err_name, string? err_msg +---@nodiscard +function uv.udp_getsockname(udp) end +uv_udp_t.getsockname = uv.udp_getsockname + +--- +---Get the remote IP and port of the UDP handle on connected UDP handles. +--- +---@param udp uv_udp_t +---@return uv.aliases.udp_getpeername_rtn|nil, string? err_name, string? err_msg +---@nodiscard +function uv.udp_getpeername(udp) end +uv_udp_t.getpeername = uv.udp_getpeername + +--- +---Set membership for a multicast address. `multicast_addr` is multicast address to +---set membership for. `interface_addr` is interface address. `membership` can be +---the string `"leave"` or `"join"`. +--- +---@param udp uv_udp_t +---@param multicast_addr string +---@param interface_addr string|nil +---@param membership uv.aliases.udp_membership +---@return 0|nil success, string? err_name, string? err_msg +function uv.udp_set_membership(udp, multicast_addr, interface_addr, membership) end +uv_udp_t.set_membership = uv.udp_set_membership + +--- +---Set membership for a source-specific multicast group. `multicast_addr` is multicast +---address to set membership for. `interface_addr` is interface address. `source_addr` +---is source address. `membership` can be the string `"leave"` or `"join"`. +--- +---@param udp uv_udp_t +---@param multicast_addr string +---@param interface_addr string|nil +---@param source_addr string +---@param membership uv.aliases.udp_membership +---@return 0|nil success, string? err_name, string? err_msg +function uv.udp_set_source_membership(udp, multicast_addr, interface_addr, source_addr, membership) end +uv_udp_t.set_source_membership = uv.udp_set_source_membership + +--- +---Set IP multicast loop flag. Makes multicast packets loop back to local +---sockets. +--- +---@param udp uv_udp_t +---@param on boolean +---@return 0|nil success, string? err_name, string? err_msg +function uv.udp_set_multicast_loop(udp, on) end +uv_udp_t.set_multicast_loop = uv.udp_set_multicast_loop + +--- +---Set the multicast ttl. +---`ttl` is an integer 1 through 255. +--- +---@param udp uv_udp_t +---@param ttl integer +---@return 0|nil success, string? err_name, string? err_msg +function uv.udp_set_multicast_ttl(udp, ttl) end +uv_udp_t.set_multicast_ttl = uv.udp_set_multicast_ttl + +--- +---Set the multicast interface to send or receive data on. +--- +---@param udp uv_udp_t +---@param interface_addr string +---@return 0|nil success, string? err_name, string? err_msg +function uv.udp_set_multicast_interface(udp, interface_addr) end +uv_udp_t.set_multicast_interface = uv.udp_set_multicast_interface + +--- +---Set broadcast on or off. +--- +---@param udp uv_udp_t +---@param on boolean +---@return 0|nil success, string? err_name, string? err_msg +function uv.udp_set_broadcast(udp, on) end +uv_udp_t.set_broadcast = uv.udp_set_broadcast + +--- +---Set the time to live. +---`ttl` is an integer 1 through 255. +--- +---@param udp uv_udp_t +---@param ttl integer +---@return 0|nil success, string? err_name, string? err_msg +function uv.udp_set_ttl(udp, ttl) end +uv_udp_t.set_ttl = uv.udp_set_ttl + +--- +---Send data over the UDP socket. If the socket has not previously been bound +---with `uv.udp_bind()` it will be bound to `0.0.0.0` (the "all interfaces" IPv4 +---address) and a random port number. +--- +---@param udp uv_udp_t +---@param data uv.aliases.buffer +---@param host string +---@param port integer +---@param callback fun(err?: string) +---@return uv_udp_send_t|nil stream, string? err_name, string? err_msg +function uv.udp_send(udp, data, host, port, callback) end +uv_udp_t.send = uv.udp_send + +--- +---Same as `uv.udp_send()`, but won't queue a send request if it can't be +---completed immediately. +--- +---@param udp uv_udp_t +---@param data uv.aliases.buffer +---@param host string +---@param port integer +---@return integer|nil, string? err_name, string? err_msg +function uv.udp_try_send(udp, data, host, port) end +uv_udp_t.try_send = uv.udp_try_send + +--- +---Prepare for receiving data. If the socket has not previously been bound with +---`uv.udp_bind()` it is bound to `0.0.0.0` (the "all interfaces" IPv4 address) +---and a random port number. +--- +---@param udp uv_udp_t +---@param callback fun(err?: string, data?: string, add?: uv.aliases.udp_getpeername_rtn, flags: uv.aliases.udp_recv_start_callback_flags) +---@return 0|nil success, string? err_name, string? err_msg +function uv.udp_recv_start(udp, callback) end +uv_udp_t.recv_start = uv.udp_recv_start + +--- +---Stop listening for incoming datagrams. +--- +---@param udp uv_udp_t +---@return 0|nil success, string? err_name, string? err_msg +function uv.udp_recv_stop(udp) end +uv_udp_t.recv_stop = uv.udp_recv_stop + +--- +---Associate the UDP handle to a remote address and port, so every message sent by +---this handle is automatically sent to that destination. Calling this function +---with a NULL addr disconnects the handle. Trying to call `uv.udp_connect()` on an +---already connected handle will result in an `EISCONN` error. Trying to disconnect +---a handle that is not connected will return an `ENOTCONN` error. +--- +---@param udp uv_udp_t +---@param host string +---@param port integer +---@return 0|nil success, string? err_name, string? err_msg +function uv.udp_connect(udp, host, port) end +uv_udp_t.connect = uv.udp_connect + + + +--- +---FS Event handles allow the user to monitor a given path for changes, for +---example, if the file was renamed or there was a generic change in it. This +---handle uses the best backend for the job on each platform. +--- +---@class uv_fs_event_t: uv_handle_t +---@section FS Event handle +local uv_fs_event_t = {} + +---@alias uv.aliases.fs_event_start_flags {watch_entry?: boolean, stat?: boolean, recursive?: boolean} + +---@alias uv.aliases.fs_event_start_callback_events {change?: boolean, rename?: boolean} + +--- +---Creates and initializes a new `uv_fs_event_t`. +---Returns the Lua userdata wrapping it. +--- +---@return uv_fs_event_t|nil, string? err_name, string? err_msg +---@nodiscard +function uv.new_fs_event() end + +-- TODO: make sure that the above method can indeed return nil + error. + +--- +---Start the handle with the given callback, which will watch the specified path +---for changes. +--- +---@param fs_event uv_fs_event_t +---@param path string +---@param flags uv.aliases.fs_event_start_flags # (all flags have default of `false`) +---@param callback fun(err?: string, filename: string, events: uv.aliases.fs_event_start_callback_events) +---@return 0|nil success, string? err_name, string? err_msg +function uv.fs_event_start(fs_event, path, flags, callback) end +uv_fs_event_t.start = uv.fs_event_start + +--- +---Stop the handle, the callback will no longer be called. +--- +---@return 0|nil success, string? err_name, string? err_msg +function uv.fs_event_stop() end +uv_fs_event_t.stop = uv.fs_event_stop + +--- +---Get the path being monitored by the handle. +--- +---@return string|nil, string? err_name, string? err_msg +---@nodiscard +function uv.fs_event_getpath() end +uv_fs_event_t.getpath = uv.fs_event_getpath + + + +--- +---FS Poll handles allow the user to monitor a given path for changes. Unlike +---`uv_fs_event_t`, fs poll handles use `stat` to detect when a file has changed so +---they can work on file systems where fs event handles can't. +--- +---@class uv_fs_poll_t: uv_handle_t +---@section FS Poll handle +local uv_fs_poll_t = {} + +--- +---Creates and initializes a new `uv_fs_poll_t`. +---Returns the Lua userdata wrapping it. +--- +---@return uv_fs_poll_t|nil, string? err_name, string? err_msg +---@nodiscard +function uv.new_fs_poll() end + +-- TODO: make sure that the above methof can indeed return nil + error. + +--- +---Check the file at `path` for changes every `interval` milliseconds. +--- +---**Note:** For maximum portability, use multi-second intervals. Sub-second +---intervals will not detect all changes on many file systems. +--- +---@param fs_poll uv_fs_poll_t +---@param path string +---@param interval integer +---@param callback fun(err?: string, prev: uv.aliases.fs_stat_table, curr: uv.aliases.fs_stat_table) +---@return 0|nil success, string? err_name, string? err_msg +function uv.fs_poll_start(fs_poll, path, interval, callback) end +uv_fs_poll_t.start = uv.fs_poll_start + +--- +---Stop the handle, the callback will no longer be called. +--- +---@return 0|nil success, string? err_name, string? err_msg +function uv.fs_poll_stop() end +uv_fs_poll_t.stop = uv.fs_poll_stop + +--- +---Get the path being monitored by the handle. +--- +---@return string|nil, string? err_name, string? err_msg +---@nodiscard +function uv.fs_poll_getpath() end +uv_fs_poll_t.getpath = uv.fs_poll_getpath + + + +--- +---@section File system operations +--- +---Most file system functions can operate synchronously or asynchronously. When a synchronous version is called (by omitting a callback), the function will +---immediately return the results of the FS call. When an asynchronous version is +---called (by providing a callback), the function will immediately return a +---`uv_fs_t` and asynchronously execute its callback; if an error is encountered, the first and only argument passed to the callback will be the `err` error string; if the operation completes successfully, the first argument will be `nil` and the remaining arguments will be the results of the FS call. +--- +---Synchronous and asynchronous versions of `readFile` (with naive error handling) +---are implemented below as an example: +--- +---```lua +---local function readFileSync(path) +--- local fd = assert(uv.fs_open(path, "r", 438)) +--- local stat = assert(uv.fs_fstat(fd)) +--- local data = assert(uv.fs_read(fd, stat.size, 0)) +--- assert(uv.fs_close(fd)) +--- return data +---end +--- +---local data = readFileSync("main.lua") +---print("synchronous read", data) +---``` +--- +---```lua +---local function readFile(path, callback) +--- uv.fs_open(path, "r", 438, function(err, fd) +--- assert(not err, err) +--- uv.fs_fstat(fd, function(err, stat) +--- assert(not err, err) +--- uv.fs_read(fd, stat.size, 0, function(err, data) +--- assert(not err, err) +--- uv.fs_close(fd, function(err) +--- assert(not err, err) +--- return callback(data) +--- end) +--- end) +--- end) +--- end) +---end +--- +---readFile("main.lua", function(data) +--- print("asynchronous read", data) +---end) +---``` +--- + +---@class uv_fs_t: uv_req_t + +---@class luv_dir_t: userdata +local luv_dir_t = {} + +---@alias uv.aliases.fs_access_flags +---Open file for reading. +--- +---Fails if the file does not exist. +--- +---Mode: O_RDONLY. +---|'"r"' +---Open file for reading in synchronous mode. +---Instructs the operating system to bypass the local file system cache. +--- +---This is primarily useful for opening files on NFS mounts as it allows you to +---skip the potentially stale local cache. It has a very real impact on I/O +---performance so don't use this flag unless you need it. +--- +---Note that this doesn't turn this call into a synchronous blocking call. +--- +---Mode: O_RDONLY + O_SYNC. +---|'"rs"' +---Same as `'rs'`. +---|'"sr"' +---Open file for reading and writing. +--- +---Fails if the file does not exist. +--- +---Mode: O_RDWR. +---|'"r+"' +---Open file for reading and writing, telling the OS to open it synchronously. +--- +---See notes for `'rs'` about using this with caution. +--- +---Mode: O_RDWR + O_SYNC. +---|'"rs+"' +---Same as `'rs+'`. +---|'"sr+"' +---Open file for writing. +--- +---The file is created (if it does not exist) or truncated (if it exists). +--- +---Mode: O_TRUNC + O_CREAT + O_WRONLY. +---|'"w"' +---Open file for writing. +--- +---Fails if the file exists. +--- +---Mode: O_TRUNC + O_CREAT + O_WRONLY + O_EXCL. +---|'"wx"' +---Same as `'wx'`. +---|'"xw"' +---Open file for reading and writing. +--- +---The file is created (if it does not exist) or truncated (if it exists). +--- +---Mode: O_TRUNC + O_CREAT + O_RDWR. +---|'"w+"' +---Open file for reading and writing. +--- +---Fails if file exists. +--- +---Mode: O_TRUNC + O_CREAT + O_RDWR + O_EXCL. +---|'"wx+"' +---Same as `'wx+'`. +---|'"xw+"' +---Open file for appending. +--- +---The file is created if it does not exist. +--- +---Mode: O_APPEND + O_CREAT + O_WRONLY. +---|'"a"' +---Open file for appending. +--- +---Fails if the file exists. +--- +---Mode: O_APPEND + O_CREAT + O_WRONLY + O_EXCL. +---|'"ax"' +---Same as `'ax'`. +---|'"xa"' +---Open file for reading and appending. +--- +---The file is created if it does not exist. +--- +---Mode: O_APPEND + O_CREAT + O_RDWR. +---|'"a+"' +---Like `'a+'` but fails if `path` exists. +--- +---Mode: O_APPEND + O_CREAT + O_RDWR + O_EXCL +---|'"ax+"' +---Same as `'ax+'`. +---|'"xa+"' + +---@alias uv.aliases.fs_stat_types +---|'"file"' +---|'"directory"' +---|'"link"' +---|'"fifo"' +---|'"socket"' +---|'"char"' +---|'"block"' + +---@alias uv.aliases.fs_stat_table {gen: integer, flags: integer, atime: {nsec: integer, sec: integer}, ctime: {nsec: integer, sec: integer}, birthtime: {nsec: integer, sec: integer}, uid: integer, gid: integer, mtime: {nsec: integer, sec: integer}, size: integer, type?: uv.aliases.fs_stat_types, nlink: integer, dev: integer, mode: integer, rdev: integer, ino: integer, blksize: integer, blocks: integer} + +---@alias uv.aliases.fs_types +---|'"file"' +---|'"directory"' +---|'"link"' +---|'"fifo"' +---|'"socket"' +---|'"char"' +---|'"block"' +---|'"unknown"' + +---@alias uv.aliases.fs_access_mode +---Tests for readbility. +---|'R' +---Tests for writiblity. +---|'W' +---Tests for executibility. +---|'X' +---Tests for readbility and writiblity. +---|'RW' +---Tests for readbility and executibility. +---|'RX' +---Tests for writiblity and executibility. +---|'WX' +---Tests for writiblity and readbility and executibility. +---|'WRX' +---A bitwise OR mask. +---|integer + +---@alias uv.aliases.fs_readdir_entries {type: uv.aliases.fs_types, name: string} + +---@alias uv.aliases.fs_symlink_flags {dir: boolean, junction: boolean} + +---@alias uv.aliases.fs_copyfile_flags {excl: boolean, ficlone: boolean, ficlone_force: boolean} + +---@alias uv.aliases.fs_statfs_stats_type +---Always 0 on Windows, sun, MVS, OpenBSD, NetBSD, HAIKU, QNK. +---|0 +---ADFS_SUPER_MAGIC = 0xadf5 +---|44533 +---AFFS_SUPER_MAGIC = 0xadff +---|44543 +---AFS_SUPER_MAGIC = 0x5346414f +---|1397113167 +---ANON_INODE_FS_MAGIC = 0x09041934 | Anonymous inode FS (for pseudofiles that have no name; e.g., epoll, signalfd, bpf) +---|151263540 +---AUTOFS_SUPER_MAGIC = 0x0187 +---|391 +---BDEVFS_MAGIC = 0x62646576 +---|1650746742 +---BEFS_SUPER_MAGIC = 0x42465331 +---|1111905073 +---BFS_MAGIC = 0x1badface +---|464386766 +---BINFMTFS_MAGIC = 0x42494e4d +---|1112100429 +---BPF_FS_MAGIC = 0xcafe4a11 +---|3405662737 +---BTRFS_SUPER_MAGIC = 0x9123683e +---|2435016766 +---BTRFS_TEST_MAGIC = 0x73727279 +---|1936880249 +---CGROUP_SUPER_MAGIC = 0x27e0eb | Cgroup pseudo FS +---|2613483 +---CGROUP2_SUPER_MAGIC = 0x63677270 | Cgroup v2 pseudo FS +---|1667723888 +---CIFS_MAGIC_NUMBER = 0xff534d42 +---|4283649346 +---CODA_SUPER_MAGIC = 0x73757245 +---|1937076805 +---COH_SUPER_MAGIC = 0x012ff7b7 +---|19920823 +---CRAMFS_MAGIC = 0x28cd3d45 +---|684539205 +---DEBUGFS_MAGIC = 0x64626720 +---|1684170528 +---DEVFS_SUPER_MAGIC = 0x1373 | Linux 2.6.17 and earlier +---|4979 +---DEVPTS_SUPER_MAGIC = 0x1cd1 +---|7377 +---ECRYPTFS_SUPER_MAGIC = 0xf15f +---|61791 +---EFIVARFS_MAGIC = 0xde5e81e4 +---|3730735588 +---EFS_SUPER_MAGIC = 0x00414a53 +---|4278867 +---EXT_SUPER_MAGIC = 0x137d | Linux 2.0 and earlier +---|4989 +---EXT2_OLD_SUPER_MAGIC = 0xef51 +---|61265 +---EXT2_SUPER_MAGIC = 0xef53 +---|61267 +---EXT3_SUPER_MAGIC = 0xef53 +---|61267 +---EXT4_SUPER_MAGIC = 0xef53 +---|61267 +---F2FS_SUPER_MAGIC = 0xf2f52010 +---|4076150800 +---FUSE_SUPER_MAGIC = 0x65735546 +---|1702057286 +---FUTEXFS_SUPER_MAGIC = 0xbad1dea | Unused +---|195894762 +---HFS_SUPER_MAGIC = 0x4244 +---|16964 +---HOSTFS_SUPER_MAGIC = 0x00c0ffee +---|12648430 +---HPFS_SUPER_MAGIC = 0xf995e849 +---|4187351113 +---HUGETLBFS_MAGIC = 0x958458f6 +---|2508478710 +---ISOFS_SUPER_MAGIC = 0x9660 +---|38496 +---JFFS2_SUPER_MAGIC = 0x72b6 +---|29366 +---JFS_SUPER_MAGIC = 0x3153464a +---|827541066 +---MINIX_SUPER_MAGIC = 0x137f | original minix FS +---|4991 +---MINIX_SUPER_MAGIC2 = 0x138f | 30 char minix FS +---|5007 +---MINIX2_SUPER_MAGIC = 0x2468 | minix V2 FS +---|9320 +---MINIX2_SUPER_MAGIC2 = 0x2478 | minix V2 FS, 30 char names +---|9336 +---MINIX3_SUPER_MAGIC = 0x4d5a | minix V3 FS, 60 char names +---|19802 +---MQUEUE_MAGIC = 0x19800202 | POSIX message queue FS +---|427819522 +---MSDOS_SUPER_MAGIC = 0x4d44 +---|19780 +---MTD_INODE_FS_MAGIC = 0x11307854 +---|288389204 +---NCP_SUPER_MAGIC = 0x564c +---|22092 +---NFS_SUPER_MAGIC = 0x6969 +---|26985 +---NILFS_SUPER_MAGIC = 0x3434 +---|13364 +---NSFS_MAGIC = 0x6e736673 +---|1853056627 +---NTFS_SB_MAGIC = 0x5346544e +---|1397118030 +---OCFS2_SUPER_MAGIC = 0x7461636f +---|1952539503 +---OPENPROM_SUPER_MAGIC = 0x9fa1 +---|40865 +---OVERLAYFS_SUPER_MAGIC = 0x794c7630 +---|2035054128 +---PIPEFS_MAGIC = 0x50495045 +---|1346981957 +---PROC_SUPER_MAGIC = 0x9fa0 | /proc FS +---|40864 +---PSTOREFS_MAGIC = 0x6165676c +---|1634035564 +---QNX4_SUPER_MAGIC = 0x002f +---|47 +---QNX6_SUPER_MAGIC = 0x68191122 +---|1746473250 +---RAMFS_MAGIC = 0x858458f6 +---|2240043254 +---REISERFS_SUPER_MAGIC = 0x52654973 +---|1382369651 +---ROMFS_MAGIC = 0x7275 +---|29301 +---SECURITYFS_MAGIC = 0x73636673 +---|1935894131 +---SELINUX_MAGIC = 0xf97cff8c +---|4185718668 +---SMACK_MAGIC = 0x43415d53 +---|1128357203 +---SMB_SUPER_MAGIC = 0x517b +---|20859 +---SMB2_MAGIC_NUMBER = 0xfe534d42 +---|4266872130 +---SOCKFS_MAGIC = 0x534f434b +---|1397703499 +---SQUASHFS_MAGIC = 0x73717368 +---|1936814952 +---SYSFS_MAGIC = 0x62656572 +---|1650812274 +---SYSV2_SUPER_MAGIC = 0x012ff7b6 +---|19920822 +---SYSV4_SUPER_MAGIC = 0x012ff7b5 +---|19920821 +---TMPFS_MAGIC = 0x01021994 +---|16914836 +---TRACEFS_MAGIC = 0x74726163 +---|1953653091 +---UDF_SUPER_MAGIC = 0x15013346 +---|352400198 +---UFS_MAGIC = 0x00011954 +---|72020 +---USBDEVICE_SUPER_MAGIC = 0x9fa2 +---|40866 +---V9FS_MAGIC = 0x01021997 +---|16914839 +---VXFS_SUPER_MAGIC = 0xa501fcf5 +---|2768370933 +---XENFS_SUPER_MAGIC = 0xabba1974 +---|2881100148 +---XENIX_SUPER_MAGIC = 0x012ff7b4 +---|19920820 +---XFS_SUPER_MAGIC = 0x58465342 +---|1481003842 +---_XIAFS_SUPER_MAGIC = 0x012fd16d | Linux 2.0 and earlier +---|19911021 + +---@alias uv.aliases.fs_statfs_stats {type: uv.aliases.fs_statfs_stats_type, bzise: integer, blocks: integer, bfree: integer, bavail: integer, files: integer, ffree: integer} + +--- +---Equivalent to `close(2)`. +--- +---@param fd integer +---@param callback fun(err: nil|string, success: boolean|nil) +---@return uv_fs_t +function uv.fs_close(fd, callback) end +---@param fd integer +---@return boolean|nil success, string? err_name, string? err_msg +function uv.fs_close(fd) end + +--- +---Equivalent to `open(2)`. +---See below for available access `flags`. +--- +---**Note:** On Windows, libuv uses `CreateFileW` and thus the file is always +---opened in binary mode. Because of this, the `O_BINARY` and `O_TEXT` flags are +---not supported. +--- +---@param path string +---@param flags uv.aliases.fs_access_flags|integer +---@param mode integer +---@param callback fun(err: nil|string, fd: integer|nil) +---@return uv_fs_t +function uv.fs_open(path, flags, mode, callback) end +---@param path string +---@param flags uv.aliases.fs_access_flags|integer +---@param mode integer +---@return integer|nil fd, string? err_name, string? err_msg +---@nodiscard +function uv.fs_open(path, flags, mode) end + +--- +---Equivalent to `preadv(2)`. Returns any data. An empty string indicates EOF. +--- +---If `offset` is nil or omitted, it will default to `-1`, which indicates 'use and update the current file offset.' +--- +---**Note:** When `offset` is >= 0, the current file offset will not be updated by the read. +--- +---@param fd integer +---@param size integer +---@param offset integer|nil +---@param callback fun(err: nil|string, data: string|nil) +---@return uv_fs_t +function uv.fs_read(fd, size, offset, callback) end +---@param fd integer +---@param size integer +---@param callback fun(err: nil|string, data: string|nil) +---@return uv_fs_t +function uv.fs_read(fd, size, callback) end +---@param fd integer +---@param size integer +---@param offset integer|nil +---@return string|nil data, string? err_name, string? err_msg +---@nodiscard +function uv.fs_read(fd, size, offset) end + +--- +---Equivalent to `unlink(2)`. +--- +---@param path string +---@param callback fun(err: nil|string, success: boolean|nil) +---@return uv_fs_t +function uv.fs_unlink(path, callback) end +---@param path string +---@return boolean|nil success, string? err_name, string? err_msg +function uv.fs_unlink(path) end + +--- +---Equivalent to `pwritev(2)`. Returns the number of bytes written. +--- +---If `offset` is nil or omitted, it will default to `-1`, which indicates 'use and update the current file offset.' +--- +---**Note:** When `offset` is >= 0, the current file offset will not be updated by the write. +--- +---@param fd integer +---@param data uv.aliases.buffer +---@param offset integer|nil +---@param callback fun(err: nil|string, bytes: integer|nil) +---@return uv_fs_t +function uv.fs_write(fd, data, offset, callback) end +---@param fd integer +---@param data uv.aliases.buffer +---@param callback fun(err: nil|string, bytes: integer|nil) +---@return uv_fs_t +function uv.fs_write(fd, data, callback) end +---@param fd integer +---@param data uv.aliases.buffer +---@param offset integer|nil +---@return integer|nil bytes, string? err_name, string? err_msg +function uv.fs_write(fd, data, offset) end + +--- +---Equivalent to `mkdir(2)`. +--- +---@param path string +---@param mode integer +---@param callback fun(err: nil|string, success: boolean|nil) +---@return uv_fs_t +function uv.fs_mkdir(path, mode, callback) end +---@param path string +---@param mode integer +---@return boolean|nil success, string? err_name, string? err_msg +function uv.fs_mkdir(path, mode) end + +--- +---Equivalent to `mkdtemp(3)`. +--- +---@param template string +---@param callback fun(err: nil|string, path: string|nil) +---@return uv_fs_t +function uv.fs_mkdtemp(template, callback) end +---@param template string +---@return string|nil path, string? err_name, string? err_msg +---@nodiscard +function uv.fs_mkdtemp(template) end + +--- +---Equivalent to `mkstemp(3)`. Returns a temporary file handle and filename. +--- +---@param template string +---@param callback fun(err: nil|string, fd: integer|nil, path: string|nil) +---@return uv_fs_t +function uv.fs_mkstemp(template, callback) end +---@param template string +---@return integer|nil fd, string path_or_errname, string? err_msg +---@nodiscard +function uv.fs_mkstemp(template) end + +--- +---Equivalent to `rmdir(2)`. +--- +---@param path string +---@param callback fun(err: nil|string, success: boolean|nil) +---@return uv_fs_t +function uv.fs_rmdir(path, callback) end +---@param path string +---@return boolean|nil success, string? err_name, string? err_msg +function uv.fs_rmdir(path) end + +--- +---Equivalent to `scandir(3)`, with a slightly different API. Returns a handle that +---the user can pass to `uv.fs_scandir_next()`. +--- +---**Note:** This function can be used synchronously or asynchronously. The request +---userdata is always synchronously returned regardless of whether a callback is +---provided and the same userdata is passed to the callback if it is provided. +--- +---@param path string +---@param callback fun(err: nil|string, success: uv_fs_t|nil) +---@return uv_fs_t|nil, string? err_name, string? err_msg +function uv.fs_scandir(path, callback) end +---@param path string +---@return uv_fs_t|nil success, string? err_name, string? err_msg +---@nodiscard +function uv.fs_scandir(path) end + +--- +---Called on a `uv_fs_t` returned by `uv.fs_scandir()` to get the next directory +---entry data as a `name, type` pair. When there are no more entries, `nil` is +---returned. +--- +---**Note:** This function only has a synchronous version. See `uv.fs_opendir` and +---its related functions for an asynchronous version. +--- +---@param fs uv_fs_t +---@return string|nil, string|nil, string? err_name, string? err_msg +---@nodiscard +function uv.fs_scandir_next(fs) end + +--- +---Equivalent to `stat(2)`. +--- +---@param path string +---@param callback fun(err: nil|string, stat: uv.aliases.fs_stat_table|nil) +---@return uv_fs_t +function uv.fs_stat(path, callback) end +---@param path string +---@return uv.aliases.fs_stat_table|nil stat, string? err_name, string? err_msg +---@nodiscard +function uv.fs_stat(path) end + +--- +---Equivalent to `fstat(2)`. +--- +---@param fd integer +---@param callback fun(err: nil|string, stat: uv.aliases.fs_stat_table|nil) +---@return uv_fs_t +function uv.fs_fstat(fd, callback) end +---@param fd integer +---@return uv.aliases.fs_stat_table|nil stat, string? err_name, string? err_msg +---@nodiscard +function uv.fs_fstat(fd) end + +--- +---Equivalent to `lstat(2)`. +--- +---@param fd integer +---@param callback fun(err: nil|string, stat: uv.aliases.fs_stat_table|nil) +---@return uv_fs_t +function uv.fs_lstat(fd, callback) end +---@param fd integer +---@return uv.aliases.fs_stat_table|nil stat, string? err_name, string? err_msg +---@nodiscard +function uv.fs_lstat(fd) end + +--- +---Equivalent to `rename(2)`. +--- +---@param path string +---@param new_path string +---@param callback fun(err: nil|string, success: boolean|nil) +---@return uv_fs_t +function uv.fs_rename(path, new_path, callback) end +---@param path string +---@param new_path string +---@return boolean|nil success, string? err_name, string? err_msg +function uv.fs_rename(path, new_path) end + +--- +---Equivalent to `fsync(2)`. +--- +---@param fd integer +---@param callback fun(err: nil|string, success: boolean|nil) +---@return uv_fs_t +function uv.fs_fsync(fd, callback) end +---@param fd integer +---@return boolean|nil success, string? err_name, string? err_msg +function uv.fs_fsync(fd) end + +--- +---Equivalent to `fdatasync(2)`. +--- +---@param fd integer +---@param callback fun(err: nil|string, success: boolean|nil) +---@return uv_fs_t +function uv.fs_fdatasync(fd, callback) end +---@param fd integer +---@return boolean|nil success, string? err_name, string? err_msg +function uv.fs_fdatasync(fd) end + +--- +---Equivalent to `ftruncate(2)`. +--- +---@param fd integer +---@param offset integer +---@param callback fun(err: nil|string, success: boolean|nil) +---@return uv_fs_t +function uv.fs_ftruncate(fd, offset, callback) end +---@param fd integer +---@param offset integer +---@return boolean|nil success, string? err_name, string? err_msg +function uv.fs_ftruncate(fd, offset) end + +--- +---Limited equivalent to `sendfile(2)`. Returns the number of bytes written. +--- +---@param out_fd integer +---@param in_fd integer +---@param in_offset integer +---@param size integer +---@param callback fun(err: nil|string, bytes: integer|nil) +---@return uv_fs_t +function uv.fs_sendfile(out_fd, in_fd, in_offset, size, callback) end +---@param out_fd integer +---@param in_fd integer +---@param in_offset integer +---@param size integer +---@return integer|nil bytes, string? err_name, string? err_msg +function uv.fs_sendfile(out_fd, in_fd, in_offset, size) end + +--- +---Equivalent to `access(2)` on Unix. Windows uses `GetFileAttributesW()`. Access +---`mode` can be an integer or a string containing `"R"` or `"W"` or `"X"`. +--- +---Returns `true` or `false` indicating access permission. +--- +---@param path string +---@param mode uv.aliases.fs_access_mode|integer +---@param callback fun(err: nil|string, permission: boolean|nil) +---@return uv_fs_t +function uv.fs_access(path, mode, callback) end +---@param path string +---@param mode uv.aliases.fs_access_mode|integer +---@return boolean|nil permission, string? err_name, string? err_msg +---@nodiscard +function uv.fs_access(path, mode) end + +--- +---Equivalent to `chmod(2)`. +--- +---@param path string +---@param mode integer +---@param callback fun(err: nil|string, success: boolean|nil) +---@return uv_fs_t +function uv.fs_chmod(path, mode, callback) end +---@param path string +---@param mode integer +---@return boolean|nil success, string? err_name, string? err_msg +function uv.fs_chmod(path, mode) end + +--- +---Equivalent to `fchmod(2)`. +--- +---@param fd integer +---@param mode integer +---@param callback fun(err: nil|string, success: boolean|nil) +---@return uv_fs_t +function uv.fs_fchmod(fd, mode, callback) end +---@param fd integer +---@param mode integer +---@return boolean|nil success, string? err_name, string? err_msg +function uv.fs_fchmod(fd, mode) end + +--- +---Equivalent to `utime(2)`. +--- +---@param path string +---@param atime number +---@param mtime number +---@param callback fun(err: nil|string, success: boolean|nil) +---@return uv_fs_t +function uv.fs_utime(path, atime, mtime, callback) end +---@param path string +---@param atime number +---@param mtime number +---@return boolean|nil success, string? err_name, string? err_msg +function uv.fs_utime(path, atime, mtime) end + +--- +---Equivalent to `futime(2)`. +--- +---@param fd integer +---@param atime number +---@param mtime number +---@param callback fun(err: nil|string, success: boolean|nil) +---@return uv_fs_t +function uv.fs_futime(fd, atime, mtime, callback) end +---@param fd integer +---@param atime number +---@param mtime number +---@return boolean|nil success, string? err_name, string? err_msg +function uv.fs_futime(fd, atime, mtime) end + +--- +---Equivalent to `lutime(2)`. +--- +---@param path string +---@param atime number +---@param mtime number +---@param callback fun(err: nil|string, success: boolean|nil) +---@return uv_fs_t +function uv.fs_lutime(path, atime, mtime, callback) end +---@param path string +---@param atime number +---@param mtime number +---@return boolean|nil success, string? err_name, string? err_msg +function uv.fs_lutime(path, atime, mtime) end + +--- +---Equivalent to `link(2)`. +--- +---@param path string +---@param new_path string +---@param callback fun(err: nil|string, success: boolean|nil) +---@return uv_fs_t +function uv.fs_link(path, new_path, callback) end +---@param path string +---@param new_path string +---@return boolean|nil success, string? err_name, string? err_msg +function uv.fs_link(path, new_path) end + +--- +---Equivalent to `symlink(2)`. +---If the `flags` parameter is omitted, then the 3rd parameter will be treated as the `callback`. +--- +---@param path string +---@param new_path string +---@param flags uv.aliases.fs_symlink_flags|integer +---@param callback fun(err: nil|string, success: boolean|nil) +---@return uv_fs_t +function uv.fs_symlink(path, new_path, flags, callback) end +---@param path string +---@param new_path string +---@param callback fun(err: nil|string, success: boolean|nil) +---@return uv_fs_t +function uv.fs_symlink(path, new_path, callback) end +---@param path string +---@param new_path string +---@param flags? uv.aliases.fs_symlink_flags|integer +---@return boolean|nil success, string? err_name, string? err_msg +function uv.fs_symlink(path, new_path, flags) end + +--- +---Equivalent to `readlink(2)`. +--- +---@param path string +---@param callback fun(err: nil|string, path: string|nil) +---@return uv_fs_t +function uv.fs_readlink(path, callback) end +---@param path string +---@return string|nil path, string? err_name, string? err_msg +---@nodiscard +function uv.fs_readlink(path) end + +--- +---Equivalent to `realpath(3)`. +--- +---@param path string +---@param callback fun(err: nil|string, path: string|nil) +---@return uv_fs_t +function uv.fs_realpath(path, callback) end +---@param path string +---@return string|nil path, string? err_name, string? err_msg +---@nodiscard +function uv.fs_realpath(path) end + +--- +---Equivalent to `chown(2)`. +--- +---@param path string +---@param uid integer +---@param gid integer +---@param callback fun(err: nil|string, success: boolean|nil) +---@return uv_fs_t +function uv.fs_chown(path, uid, gid, callback) end +---@param path string +---@param uid integer +---@param gid integer +---@return boolean|nil success, string? err_name, string? err_msg +function uv.fs_chown(path, uid, gid) end + +--- +---Equivalent to `fchown(2)`. +--- +---@param fd integer +---@param uid integer +---@param gid integer +---@param callback fun(err: nil|string, success: boolean|nil) +---@return uv_fs_t +function uv.fs_fchown(fd, uid, gid, callback) end +---@param fd integer +---@param uid integer +---@param gid integer +---@return boolean|nil success, string? err_name, string? err_msg +function uv.fs_fchown(fd, uid, gid) end + +--- +---Equivalent to `lchown(2)`. +--- +---@param fd integer +---@param uid integer +---@param gid integer +---@param callback fun(err: nil|string, success: boolean|nil) +---@return uv_fs_t +function uv.fs_lchown(fd, uid, gid, callback) end +---@param fd integer +---@param uid integer +---@param gid integer +---@return boolean|nil success, string? err_name, string? err_msg +function uv.fs_lchown(fd, uid, gid) end + +--- +---Copies a file from `path` to `new_path`. +---If the `flags` parameter is omitted, then the 3rd parameter will be treated as the `callback`. +--- +---@param path string +---@param new_path string +---@param flags uv.aliases.fs_copyfile_flags +---@param callback fun(err: nil|string, success: boolean|nil) +---@return uv_fs_t +function uv.fs_copyfile(path, new_path, flags, callback) end +---@param path string +---@param new_path string +---@param callback fun(err: nil|string, success: boolean|nil) +---@return uv_fs_t +function uv.fs_copyfile(path, new_path, callback) end +---@param path string +---@param new_path string +---@param flags? uv.aliases.fs_copyfile_flags +---@return boolean|nil success, string? err_name, string? err_msg +function uv.fs_copyfile(path, new_path, flags) end + +--- +---Opens path as a directory stream. Returns a handle that the user can pass to +---`uv.fs_readdir()`. The `entries` parameter defines the maximum number of entries +---that should be returned by each call to `uv.fs_readdir()`. +--- +---@param path string +---@param entries integer|nil +---@param callback fun(err: nil|string, dir: luv_dir_t|nil) +---@return uv_fs_t +function uv.fs_opendir(path, entries, callback) end +---@param path string +---@param entries integer|nil +---@return luv_dir_t|nil dir, string? err_name, string? err_msg +---@nodiscard +function uv.fs_opendir(path, entries) end + +--- +---Iterates over the directory stream `uv_dir_t` returned by a successful +---`uv.fs_opendir()` call. A table of data tables is returned where the number +---of entries `n` is equal to or less than the `entries` parameter used in +---the associated `uv.fs_opendir()` call. +--- +---@param dir luv_dir_t +---@param callback fun(err: nil|string, entries: uv.aliases.fs_readdir_entries|nil) +---@return uv_fs_t +function uv.fs_readdir(dir, callback) end +---@param dir luv_dir_t +---@return uv.aliases.fs_readdir_entries|nil entries, string? err_name, string? err_msg +---@nodiscard +function uv.fs_readdir(dir) end +luv_dir_t.readdir = uv.fs_readdir + +--- +---Closes a directory stream returned by a successful `uv.fs_opendir()` call. +--- +---@param dir luv_dir_t +---@param callback fun(err: nil|string, success: boolean|nil) +---@return uv_fs_t +function uv.fs_closedir(dir, callback) end +---@param dir luv_dir_t +---@return boolean|nil success, string? err_name, string? err_msg +function uv.fs_closedir(dir) end +luv_dir_t.closedir = uv.fs_closedir + +--- +---Equivalent to `statfs(2)`. +--- +---@param path string +---@param callback fun(err: nil|string, stats: uv.aliases.fs_statfs_stats|nil) +---@return uv_fs_t +function uv.fs_statfs(path, callback) end +---@param path string +---@return uv.aliases.fs_statfs_stats|nil stats, string? err_name, string? err_msg +---@nodiscard +function uv.fs_statfs(path) end + + + +--- +---Libuv provides a threadpool which can be used to run user code and get notified +---in the loop thread. This threadpool is internally used to run all file system +---operations, as well as `getaddrinfo` and `getnameinfo` requests. +--- +---```lua +---local function work_callback(a, b) +--- return a + b +---end +--- +---local function after_work_callback(c) +--- print("The result is: " .. c) +---end +--- +---local work = uv.new_work(work_callback, after_work_callback) +--- +---work:queue(1, 2) +--- +----- output: "The result is: 3" +---``` +--- +---@class luv_work_ctx_t: userdata +---@section Thread pool work scheduling +local luv_work_ctx_t = {} + +--- +---Creates and initializes a new `luv_work_ctx_t` (not `uv_work_t`). +---`work_callback` is a Lua function or a string containing Lua code or bytecode dumped from a function. +---Returns the Lua userdata wrapping it. +--- +---@generic T: uv.aliases.threadargs +---@param work_callback fun(...: T)|string # passed to/from `uv.queue_work(work_ctx, ...)` +---@param after_work_callback fun(...: uv.aliases.threadargs) # returned from `work_callback` +---@return luv_work_ctx_t +---@nodiscard +function uv.new_work(work_callback, after_work_callback) end + +-- TODO: make sure that the above method can indeed return nil + error. + +--- +---Queues a work request which will run `work_callback` in a new Lua state in a +---thread from the threadpool with any additional arguments from `...`. Values +---returned from `work_callback` are passed to `after_work_callback`, which is +---called in the main loop thread. +--- +---@param work_ctx luv_work_ctx_t +---@param ... uv.aliases.threadargs +---@return boolean|nil success, string? err_name, string? err_msg +function uv.queue_work(work_ctx, ...) end +luv_work_ctx_t.queue = uv.queue_work + + + +--- +---@section DNS utility functions +--- + +---@class uv_getaddrinfo_t: uv_req_t + +---@alias uv.aliases.getaddrinfo_hint {family: uv.aliases.network_family|integer|nil, socktype: uv.aliases.tcp_socket_type|nil, protocol: uv.aliases.network_protocols|nil, addrconfig: boolean|nil, v4mapped: boolean|nil, all: boolean|nil, numberichost: boolean|nil, passive: boolean|nil, numericserv: boolean|nil, canonname: boolean|nil} + +---@alias uv.aliases.getaddrinfo_rtn {addr: string, family: uv.aliases.network_family, port: integer|nil, socktype: uv.aliases.tcp_socket_type, protocol: uv.aliases.network_protocols, canonname: string|nil}[] + +---@class uv_getnameinfo_t: uv_req_t + +---@alias uv_getnameinfo_address {ip: string|nil, port: integer|nil, family: uv.aliases.network_family|integer|nil} + +--- +---Equivalent to `getaddrinfo(3)`. +---Either `host` or `service` may be `nil` but not both. +--- +---@param host string|nil +---@param service string|nil +---@param hints uv.aliases.getaddrinfo_hint? +---@param callback fun(err?: string, addresses?: uv.aliases.getaddrinfo_rtn) +---@return uv_getaddrinfo_t +function uv.getaddrinfo(host, service, hints, callback) end +---@param host string|nil +---@param service string|nil +---@param hints uv.aliases.getaddrinfo_hint? +---@return uv.aliases.getaddrinfo_rtn|nil addresses, string? err_name, string? err_msg +function uv.getaddrinfo(host, service, hints) end + +--- +---Equivalent to `getnameinfo(3)`. +--- +---@param address uv_getnameinfo_address +---@param callback fun(err?: string, host?: string, service?: string) +---@return uv_getnameinfo_t +function uv.getnameinfo(address, callback) end +---@param address uv_getnameinfo_address +---@return string|nil host, string service_or_errname, string? err_msg +function uv.getnameinfo(address) end + + + +--- +---Libuv provides cross-platform implementations for multiple threading an +--- synchronization primitives. The API largely follows the pthreads API. +--- +---@class luv_thread_t: userdata +---@section Threading and synchronization utilities +local luv_thread_t = {} + +--- +---Creates and initializes a `luv_thread_t` (not `uv_thread_t`). Returns the Lua +---userdata wrapping it and asynchronously executes `entry`, which can be +---either a Lua function or a string containing Lua code or bytecode dumped from a function. Additional arguments `...` +---are passed to the `entry` function and an optional `options` table may be +---provided. Currently accepted `option` fields are `stack_size`. +--- +---@generic T: uv.aliases.threadargs +---@param options? {stack_size?: integer} +---@param entry fun(...: T)|string +---@vararg T # varargs passed to `entry` +---@return luv_thread_t?, string? err_name, string? err_msg +function uv.new_thread(options, entry, ...) end +---@generic T: uv.aliases.threadargs +---@param entry fun(...: T)|string +---@vararg T # varargs passed to `entry` +---@return luv_thread_t?, string? err_name, string? err_msg +function uv.new_thread(entry, ...) end + +-- TODO: make sure that the above method can indeed return nil + error. + +--- +---Returns a boolean indicating whether two threads are the same. This function is +---equivalent to the `__eq` metamethod. +--- +---@param thread luv_thread_t +---@param other_thread luv_thread_t +---@return boolean +function uv.thread_equal(thread, other_thread) end +luv_thread_t.equal = uv.thread_equal + +--- +---Returns the handle for the thread in which this is called. +--- +---@return luv_thread_t +function uv.thread_self() end + +--- +---Waits for the `thread` to finish executing its entry function. +--- +---@param thread luv_thread_t +---@return boolean?, string? err_name, string? err_msg +function uv.thread_join(thread) end +luv_thread_t.join = uv.thread_join + +--- +---Pauses the thread in which this is called for a number of milliseconds. +--- +---@param msec integer +function uv.sleep(msec) end + + + +--- +---@section Miscellaneous utilities +---@source misc.c +--- + +---@alias uv.aliases.os_passwd {username: string, uid: integer, gid: integer, shell: string, homedir: string} + +---@alias uv.aliases.os_uname {sysname: string, release: string, version: string, machine: string} + +---@alias uv.aliases.rusage {utime: {sec: integer, usec: integer}, stime: {sec: integer, usec: integer}, maxrss: integer, ixrss: integer, idrss: integer, isrss: integer, minflt: integer, majflt: integer, nswap: integer, inblock: integer, oublock: integer, msgsnd: integer, msgrcv: integer, nsignals: integer, nvcsw: integer, nivcsw: integer} + +---@alias uv.aliases.cpu_info {[integer]: {modal: string, speed: number, times: {user: number, nice: number, sys: number, idle: number, irq: number}}} + +---@alias uv.aliases.interface_addresses {[string]: {ip: string, family: uv.aliases.network_family, netmask: string, internal: boolean, mac: string}} + +--- +---Returns the executable path. +--- +---@return string|nil, string? err_name, string? err_msg +---@nodiscard +function uv.exepath() end + +--- +---Returns the current working directory. +--- +---@return string|nil, string? err_name, string? err_msg +---@nodiscard +function uv.cwd() end + +--- +---Sets the current working directory with the string `cwd`. +--- +---@param cwd string +---@return 0|nil success, string? err_name, string? err_msg +function uv.chdir(cwd) end + +--- +---Returns the title of the current process. +--- +---@return string|nil, string? err_name, string? err_msg +---@nodiscard +function uv.get_process_title() end + +--- +---Sets the title of the current process with the string `title`. +--- +---@param title string +---@return 0|nil success, string? err_name, string? err_msg +function uv.set_process_title(title) end + +--- +---Returns the current total system memory in bytes. +--- +---@return integer +---@nodiscard +function uv.get_total_memory() end + +--- +---Returns the current free system memory in bytes. +--- +---@return integer +---@nodiscard +function uv.get_free_memory() end + +--- +---Gets the amount of memory available to the process in bytes based on limits +---imposed by the OS. If there is no such constraint, or the constraint is unknown, +---0 is returned. Note that it is not unusual for this value to be less than or +---greater than the total system memory. +--- +---@return integer +---@nodiscard +function uv.get_constrained_memory() end + +--- +---Returns the resident set size (RSS) for the current process. +--- +---@return integer|nil, string? err_name, string? err_msg +---@nodiscard +function uv.resident_set_memory() end + +--- +---Returns the resource usage. +--- +---@return uv.aliases.rusage|nil, string? err_name, string? err_msg +---@nodiscard +function uv.getrusage() end + +--- +---Returns an estimate of the default amount of parallelism a program should use. Always returns a non-zero value. +--- +---On Linux, inspects the calling thread’s CPU affinity mask to determine if it has been pinned to specific CPUs. +--- +---On Windows, the available parallelism may be underreported on systems with more than 64 logical CPUs. +--- +---On other platforms, reports the number of CPUs that the operating system considers to be online. +--- +---@return integer +---@nodiscard +function uv.available_parallelism() end + +--- +---Returns information about the CPU(s) on the system as a table of tables for each +---CPU found. +--- +---@return uv.aliases.cpu_info|nil, string? err_name, string? err_msg +---@nodiscard +function uv.cpu_info() end + +--- +---**Deprecated:** Please use `uv.os_getpid()` instead. +--- +---@return integer +---@nodiscard +---@deprecated +function uv.getpid() end + +--- +---Returns the user ID of the process. +--- +---**Note:** This is not a libuv function and is not supported on Windows. +--- +---@return integer +---@nodiscard +function uv.getuid() end + +--- +---Returns the group ID of the process. +--- +---**Note:** This is not a libuv function and is not supported on Windows. +--- +---@return integer +---@nodiscard +function uv.getgid() end + +--- +---Sets the user ID of the process with the integer `id`. +--- +---**Note:** This is not a libuv function and is not supported on Windows. +--- +---@param id integer +function uv.setuid(id) end + +--- +---Sets the group ID of the process with the integer `id`. +--- +---**Note:** This is not a libuv function and is not supported on Windows. +--- +---@param id integer +function uv.setgid(id) end + +--- +---Returns a current high-resolution time in nanoseconds as a number. This is +---relative to an arbitrary time in the past. It is not related to the time of day +---and therefore not subject to clock drift. The primary use is for measuring +---time between intervals. +--- +---@return integer +---@nodiscard +function uv.hrtime() end + +--- +---Returns the current system uptime in seconds. +--- +---@return number|nil, string? err_name, string? err_msg +---@nodiscard +function uv.uptime() end + +--- +---Prints all handles associated with the main loop to stderr. The format is +---`[flags] handle-type handle-address`. Flags are `R` for referenced, `A` for +---active and `I` for internal. +--- +---**Note:** This is not available on Windows. +--- +---**Warning:** This function is meant for ad hoc debugging, there are no API/ABI +---stability guarantees. +--- +function uv.print_all_handles() end + +--- +---The same as `uv.print_all_handles()` except only active handles are printed. +--- +---**Note:** This is not available on Windows. +--- +---**Warning:** This function is meant for ad hoc debugging, there are no API/ABI +---stability guarantees. +--- +function uv.print_active_handles() end + +--- +---Used to detect what type of stream should be used with a given file +---descriptor `fd`. Usually this will be used during initialization to guess the +---type of the stdio streams. +--- +---@param fd integer +---@return uv.aliases.handle_struct_name|nil +---@nodiscard +function uv.guess_handle(fd) end + +--- +---Cross-platform implementation of `gettimeofday(2)`. Returns the seconds and +---microseconds of a unix time as a pair. +--- +---@return integer|nil, integer|string, string? +---@nodiscard +function uv.gettimeofday() end + +--- +---Returns address information about the network interfaces on the system in a +---table. Each table key is the name of the interface while each associated value +---is an array of address information where fields are `ip`, `family`, `netmask`, +---`internal`, and `mac`. +--- +---@return uv.aliases.interface_addresses +---@nodiscard +function uv.interface_addresses() end + +--- +---IPv6-capable implementation of `if_indextoname(3)`. +--- +---@param ifindex integer +---@return string|nil, string? err_name, string? err_msg +---@nodiscard +function uv.if_indextoname(ifindex) end + +--- +---Retrieves a network interface identifier suitable for use in an IPv6 scoped +---address. On Windows, returns the numeric `ifindex` as a string. On all other +---platforms, `uv.if_indextoname()` is used. +--- +---@param ifindex integer +---@return string|nil, string? err_name, string? err_msg +---@nodiscard +function uv.if_indextoiid(ifindex) end + +--- +---Returns the load average as a triad. Not supported on Windows. +--- +---@return number, number, number +---@nodiscard +function uv.loadavg() end + +--- +---Returns system information. +--- +---@return uv.aliases.os_uname +---@nodiscard +function uv.os_uname() end + +--- +---Returns the hostname. +--- +---@return string +---@nodiscard +function uv.os_gethostname() end + +--- +---Returns the environment variable specified by `name` as string. The internal +---buffer size can be set by defining `size`. If omitted, `LUAL_BUFFERSIZE` is +---used. If the environment variable exceeds the storage available in the internal +---buffer, `ENOBUFS` is returned. If no matching environment variable exists, +---`ENOENT` is returned. +--- +---**Warning:** This function is not thread safe. +--- +---@param name string +---@param size integer # (default = `LUAL_BUFFERSIZE`) +---@return string|nil, string? err_name, string? err_msg +---@nodiscard +function uv.os_getenv(name, size) end + +--- +---Sets the environmental variable specified by `name` with the string `value`. +--- +---**Warning:** This function is not thread safe. +--- +---@param name string +---@param value string +---@return boolean|nil success, string? err_name, string? err_msg +function uv.os_setenv(name, value) end + +--- +---**Warning:** This function is not thread safe. +--- +---@return boolean|nil success, string? err_name, string? err_msg +function uv.os_unsetenv() end + +--- +---Returns all environmental variables as a dynamic table of names associated with +---their corresponding values. +--- +---**Warning:** This function is not thread safe. +--- +---@return {[string]: string} +---@nodiscard +function uv.os_environ() end + +--- +---**Warning:** This function is not thread safe. +--- +---@return string|nil, string? err_name, string? err_msg +---@nodiscard +function uv.os_homedir() end + +--- +---**Warning:** This function is not thread safe. +--- +---@return string|nil, string? err_name, string? err_msg +---@nodiscard +function uv.os_tmpdir() end + +--- +---Returns password file information. +--- +---@return uv.aliases.os_passwd +---@nodiscard +function uv.os_get_passwd() end + +--- +---Returns the current process ID. +--- +---@return integer +---@nodiscard +function uv.os_getpid() end + +--- +---Returns the parent process ID. +--- +---@return integer +---@nodiscard +function uv.os_getppid() end + +--- +---Returns the scheduling priority of the process specified by `pid`. +--- +---@param pid integer +---@return integer|nil, string? err_name, string? err_msg +---@nodiscard +function uv.os_getpriority(pid) end + +--- +---Sets the scheduling priority of the process specified by `pid`. The `priority` +---range is between -20 (high priority) and 19 (low priority). +--- +---@param pid integer +---@param priority integer +---@return boolean|nil success, string? err_name, string? err_msg +function uv.os_setpriority(pid, priority) end + +--- +---Fills a string of length `len` with cryptographically strong random bytes +---acquired from the system CSPRNG. `flags` is reserved for future extension +---and must currently be `nil` or `0` or `{}`. +--- +---Short reads are not possible. When less than `len` random bytes are available, +---a non-zero error value is returned or passed to the callback. If the callback +---is omitted, this function is completed synchronously. +---The synchronous version may block indefinitely when not enough entropy is +---available. The asynchronous version may not ever finish when the system is +---low on entropy. +--- +---@param len integer +---@param flags nil|0|{} +---@param callback fun(err?: string, bytes?: string) +---@return 0|nil success, string? err_name, string? err_msg +function uv.random(len, flags, callback) end +---@param len integer +---@param flags nil|0|{} +---@return string|nil, string? err_name, string? err_msg +---@nodiscard +function uv.random(len, flags) end + +--- +---Returns the libuv error message and error name (both in string form, see `err` and `name` in Error Handling) equivalent to the given platform dependent error code: POSIX error codes on Unix (the ones stored in errno), and Win32 error codes on Windows (those returned by GetLastError() or WSAGetLastError()). +--- +---@param errcode integer +---@return string|nil, string|nil +---@source util.c +---@nodiscard +function uv.translate_sys_error(errcode) end + + + +--- +---@section Metrics operations +---@source metrics.c +--- + +--- +---Retrieve the amount of time the event loop has been idle in the kernel’s event +---provider (e.g. `epoll_wait`). The call is thread safe. +--- +---The return value is the accumulated time spent idle in the kernel’s event +---provider starting from when the `uv_loop_t` was configured to collect the idle time. +--- +---**Note:** The event loop will not begin accumulating the event provider’s idle +---time until calling `loop_configure` with `"metrics_idle_time"`. +--- +---@return integer +---@nodiscard +function uv.metrics_idle_time() end + + + +-- [[ constants ]] + +-- TODO: make this its own section +-- TODO: how should this be reflected onto docs? field descriptions? + +---@alias uv.constants {O_RDONLY: integer, O_WRONLY: integer, O_RDWR: integer, O_APPEND: integer, O_CREAT: integer, O_DSYNC: integer, O_EXCL: integer, O_NOCTTY: integer, O_NONBLOCK: integer, O_RSYNC: integer, O_SYNC: integer, O_TRUNC: integer, SOCK_STREAM: integer, SOCK_DGRAM: integer, SOCK_SEQPACKET: integer, SOCK_RAW: integer, SOCK_RDM: integer, AF_UNIX: integer, AF_INET: integer, AF_INET6: integer, AF_IPX: integer, AF_NETLINK: integer, AF_X25: integer, AF_AX25: integer, AF_ATMPVC: integer, AF_APPLETALK: integer, AF_PACKET: integer, AI_ADDRCONFIG: integer, AI_V4MAPPED: integer, AI_ALL: integer, AI_NUMERICHOST: integer, AI_PASSIVE: integer, AI_NUMERICSERV: integer, SIGHUP: integer, SIGINT: integer, SIGQUIT: integer, SIGILL: integer, SIGTRAP: integer, SIGABRT: integer, SIGIOT: integer, SIGBUS: integer, SIGFPE: integer, SIGKILL: integer, SIGUSR1: integer, SIGSEGV: integer, SIGUSR2: integer, SIGPIPE: integer, SIGALRM: integer, SIGTERM: integer, SIGCHLD: integer, SIGSTKFLT: integer, SIGCONT: integer, SIGSTOP: integer, SIGTSTP: integer, SIGTTIN: integer, SIGWINCH: integer, SIGIO: integer, SIGPOLL: integer, SIGXFSZ: integer, SIGVTALRM: integer, SIGPROF: integer, UDP_RECVMMSG: integer, UDP_MMSG_CHUNK: integer, UDP_REUSEADDR: integer, UDP_PARTIAL: integer, UDP_IPV6ONLY: integer, TCP_IPV6ONLY: integer, UDP_MMSG_FREE: integer, SIGSYS: integer, SIGPWR: integer, SIGTTOU: integer, SIGURG: integer, SIGXCPU: integer} + +---@type uv.constants +uv.constants = {} + +return uv diff --git a/bundle/neodev.nvim/types/nightly/vim.fn.1.lua b/bundle/neodev.nvim/types/nightly/vim.fn.1.lua new file mode 100644 index 000000000..5a70f3eda --- /dev/null +++ b/bundle/neodev.nvim/types/nightly/vim.fn.1.lua @@ -0,0 +1,5150 @@ +---@meta + +-- Return the maximum value of all items in {expr}. Example: +-- ```vim +-- echo max([apples, pears, oranges]) +-- +-- ``` +-- {expr} can be a |List| or a |Dictionary|. For a Dictionary, +-- it returns the maximum of all values in the Dictionary. +-- If {expr} is neither a List nor a Dictionary, or one of the +-- items in {expr} cannot be used as a Number this results in +-- an error. An empty |List| or |Dictionary| results in zero. +-- +-- Can also be used as a |method|: +-- ```vim +-- mylist->max() +-- ``` +--- @return number +function vim.fn.max(expr) end + +-- Returns a |List| of |Dictionaries| describing |menus| (defined +-- by |:menu|, |:amenu|, …), including |hidden-menus|. +-- +-- {path} matches a menu by name, or all menus if {path} is an +-- empty string. Example: +-- ```vim +-- :echo menu_get('File','') +-- :echo menu_get('') +-- ``` +-- {modes} is a string of zero or more modes (see |maparg()| or +-- |creating-menus| for the list of modes). "a" means "all". +-- +-- Example: +-- ```vim +-- nnoremenu &Test.Test inormal +-- inoremenu Test.Test insert +-- vnoremenu Test.Test x +-- echo menu_get("") +-- +-- ``` +-- returns something like this: > +-- +-- [ { +-- "hidden": 0, +-- "name": "Test", +-- "priority": 500, +-- "shortcut": 84, +-- "submenus": [ { +-- "hidden": 0, +-- "mappings": { +-- i": { +-- "enabled": 1, +-- "noremap": 1, +-- "rhs": "insert", +-- "sid": 1, +-- "silent": 0 +-- }, +-- n": { ... }, +-- s": { ... }, +-- v": { ... } +-- }, +-- "name": "Test", +-- "priority": 500, +-- "shortcut": 0 +-- } ] +-- } ] +-- < +--- @param modes? any +--- @return any[] +function vim.fn.menu_get(path, modes) end + +-- Return information about the specified menu {name} in +-- mode {mode}. The menu name should be specified without the +-- shortcut character ('&'). If {name} is "", then the top-level +-- menu names are returned. +-- +-- {mode} can be one of these strings: +-- "n" Normal +-- "v" Visual (including Select) +-- "o" Operator-pending +-- "i" Insert +-- "c" Cmd-line +-- "s" Select +-- "x" Visual +-- "t" Terminal-Job +-- "" Normal, Visual and Operator-pending +-- "!" Insert and Cmd-line +-- When {mode} is omitted, the modes for "" are used. +-- +-- Returns a |Dictionary| containing the following items: +-- accel menu item accelerator text |menu-text| +-- display display name (name without '&') +-- enabled v:true if this menu item is enabled +-- Refer to |:menu-enable| +-- icon name of the icon file (for toolbar) +-- |toolbar-icon| +-- iconidx index of a built-in icon +-- modes modes for which the menu is defined. In +-- addition to the modes mentioned above, these +-- characters will be used: +-- " " Normal, Visual and Operator-pending +-- name menu item name. +-- noremenu v:true if the {rhs} of the menu item is not +-- remappable else v:false. +-- priority menu order priority |menu-priority| +-- rhs right-hand-side of the menu item. The returned +-- string has special characters translated like +-- in the output of the ":menu" command listing. +-- When the {rhs} of a menu item is empty, then +-- "" is returned. +-- script v:true if script-local remapping of {rhs} is +-- allowed else v:false. See |:menu-script|. +-- shortcut shortcut key (character after '&' in +-- the menu name) |menu-shortcut| +-- silent v:true if the menu item is created +-- with argument |:menu-silent| +-- submenus |List| containing the names of +-- all the submenus. Present only if the menu +-- item has submenus. +-- +-- Returns an empty dictionary if the menu item is not found. +-- +-- Examples: +-- ```vim +-- :echo menu_info('Edit.Cut') +-- :echo menu_info('File.Save', 'n') +-- +-- " Display the entire menu hierarchy in a buffer +-- func ShowMenu(name, pfx) +-- let m = menu_info(a:name) +-- call append(line('$'), a:pfx .. m.display) +-- for child in m->get('submenus', []) +-- call ShowMenu(a:name .. '.' .. escape(child, '.'), +-- \ a:pfx .. ' ') +-- endfor +-- endfunc +-- new +-- for topmenu in menu_info('').submenus +-- call ShowMenu(topmenu, '') +-- endfor +-- ``` +-- Can also be used as a |method|: +-- ```vim +-- GetMenuName()->menu_info('v') +-- +-- +-- ``` +--- @param mode? any +--- @return table +function vim.fn.menu_info(name, mode) end + +-- Return the minimum value of all items in {expr}. Example: +-- ```vim +-- echo min([apples, pears, oranges]) +-- +-- ``` +-- {expr} can be a |List| or a |Dictionary|. For a Dictionary, +-- it returns the minimum of all values in the Dictionary. +-- If {expr} is neither a List nor a Dictionary, or one of the +-- items in {expr} cannot be used as a Number this results in +-- an error. An empty |List| or |Dictionary| results in zero. +-- +-- Can also be used as a |method|: +-- ```vim +-- mylist->min() +-- +-- ``` +--- @return number +function vim.fn.min(expr) end + +-- Create directory {name}. +-- +-- When {flags} is present it must be a string. An empty string +-- has no effect. +-- +-- If {flags} contains "p" then intermediate directories are +-- created as necessary. +-- +-- If {flags} contains "D" then {name} is deleted at the end of +-- the current function, as with: +-- ```vim +-- defer delete({name}, 'd') +-- ``` +-- If {flags} contains "R" then {name} is deleted recursively at +-- the end of the current function, as with: +-- ```vim +-- defer delete({name}, 'rf') +-- ``` +-- Note that when {name} has more than one part and "p" is used +-- some directories may already exist. Only the first one that +-- is created and what it contains is scheduled to be deleted. +-- E.g. when using: +-- ```vim +-- call mkdir('subdir/tmp/autoload', 'pR') +-- ``` +-- and "subdir" already exists then "subdir/tmp" will be +-- scheduled for deletion, like with: +-- ```vim +-- defer delete('subdir/tmp', 'rf') +-- ``` +-- If {prot} is given it is used to set the protection bits of +-- the new directory. The default is 0o755 (rwxr-xr-x: r/w for +-- the user, readable for others). Use 0o700 to make it +-- unreadable for others. +-- +-- {prot} is applied for all parts of {name}. Thus if you create +-- /tmp/foo/bar then /tmp/foo will be created with 0o700. Example: +-- ```vim +-- :call mkdir($HOME .. "/tmp/foo/bar", "p", 0o700) +-- +-- ``` +-- This function is not available in the |sandbox|. +-- +-- If you try to create an existing directory with {flags} set to +-- "p" mkdir() will silently exit. +-- +-- The function result is a Number, which is TRUE if the call was +-- successful or FALSE if the directory creation failed or partly +-- failed. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetName()->mkdir() +-- ``` +--- @param flags? any +--- @param prot? any +--- @return number +function vim.fn.mkdir(name, flags, prot) end + +-- Return a string that indicates the current mode. +-- If [expr] is supplied and it evaluates to a non-zero Number or +-- a non-empty String (|non-zero-arg|), then the full mode is +-- returned, otherwise only the first letter is returned. +-- +-- n Normal +-- no Operator-pending +-- nov Operator-pending (forced charwise |o_v|) +-- noV Operator-pending (forced linewise |o_V|) +-- noCTRL-V Operator-pending (forced blockwise |o_CTRL-V|) +-- CTRL-V is one character +-- niI Normal using |i_CTRL-O| in |Insert-mode| +-- niR Normal using |i_CTRL-O| in |Replace-mode| +-- niV Normal using |i_CTRL-O| in |Virtual-Replace-mode| +-- nt Normal in |terminal-emulator| (insert goes to +-- Terminal mode) +-- ntT Normal using |t_CTRL-\_CTRL-O| in |Terminal-mode| +-- v Visual by character +-- vs Visual by character using |v_CTRL-O| in Select mode +-- V Visual by line +-- Vs Visual by line using |v_CTRL-O| in Select mode +-- CTRL-V Visual blockwise +-- CTRL-Vs Visual blockwise using |v_CTRL-O| in Select mode +-- s Select by character +-- S Select by line +-- CTRL-S Select blockwise +-- i Insert +-- ic Insert mode completion |compl-generic| +-- ix Insert mode |i_CTRL-X| completion +-- R Replace |R| +-- Rc Replace mode completion |compl-generic| +-- Rx Replace mode |i_CTRL-X| completion +-- Rv Virtual Replace |gR| +-- Rvc Virtual Replace mode completion |compl-generic| +-- Rvx Virtual Replace mode |i_CTRL-X| completion +-- c Command-line editing +-- cv Vim Ex mode |gQ| +-- r Hit-enter prompt +-- rm The -- more -- prompt +-- r? A |:confirm| query of some sort +-- ! Shell or external command is executing +-- t Terminal mode: keys go to the job +-- +-- This is useful in the 'statusline' option or RPC calls. In +-- most other places it always returns "c" or "n". +-- Note that in the future more modes and more specific modes may +-- be added. It's better not to compare the whole string but only +-- the leading character(s). +-- Also see |visualmode()|. +-- +-- Can also be used as a |method|: +-- ```vim +-- DoFull()->mode() +-- ``` +--- @param expr? any +--- @return string +function vim.fn.mode(expr) end + +-- Convert a list of VimL objects to msgpack. Returned value is a +-- |readfile()|-style list. When {type} contains "B", a |Blob| is +-- returned instead. Example: +-- ```vim +-- call writefile(msgpackdump([{}]), 'fname.mpack', 'b') +-- ``` +-- or, using a |Blob|: > +-- call writefile(msgpackdump([{}], 'B'), 'fname.mpack') +-- < +-- This will write the single 0x80 byte to a `fname.mpack` file +-- (dictionary with zero items is represented by 0x80 byte in +-- messagepack). +-- +-- Limitations: +-- 1. |Funcref|s cannot be dumped. +-- 2. Containers that reference themselves cannot be dumped. +-- 3. Dictionary keys are always dumped as STR strings. +-- 4. Other strings and |Blob|s are always dumped as BIN strings. +-- 5. Points 3. and 4. do not apply to |msgpack-special-dict|s. +--- @param list any[] +--- @param type? any +--- @return any[] +function vim.fn.msgpackdump(list, type) end + +-- Convert a |readfile()|-style list or a |Blob| to a list of +-- VimL objects. +-- Example: +-- ```vim +-- let fname = expand('~/.config/nvim/shada/main.shada') +-- let mpack = readfile(fname, 'b') +-- let shada_objects = msgpackparse(mpack) +-- ``` +-- This will read ~/.config/nvim/shada/main.shada file to +-- `shada_objects` list. +-- +-- Limitations: +-- 1. Mapping ordering is not preserved unless messagepack +-- mapping is dumped using generic mapping +-- (|msgpack-special-map|). +-- 2. Since the parser aims to preserve all data untouched +-- (except for 1.) some strings are parsed to +-- |msgpack-special-dict| format which is not convenient to +-- use. +-- +-- Some messagepack strings may be parsed to special +-- dictionaries. Special dictionaries are dictionaries which +-- +-- 1. Contain exactly two keys: `_TYPE` and `_VAL`. +-- 2. `_TYPE` key is one of the types found in |v:msgpack_types| +-- variable. +-- 3. Value for `_VAL` has the following format (Key column +-- contains name of the key from |v:msgpack_types|): +-- +-- Key Value ~ +-- nil Zero, ignored when dumping. Not returned by +-- |msgpackparse()| since |v:null| was introduced. +-- boolean One or zero. When dumping it is only checked that +-- value is a |Number|. Not returned by |msgpackparse()| +-- since |v:true| and |v:false| were introduced. +-- integer |List| with four numbers: sign (-1 or 1), highest two +-- bits, number with bits from 62nd to 31st, lowest 31 +-- bits. I.e. to get actual number one will need to use +-- code like +-- ```vim +-- _VAL[0] * ((_VAL[1] << 62) +-- & (_VAL[2] << 31) +-- & _VAL[3]) +-- ``` +-- Special dictionary with this type will appear in +-- |msgpackparse()| output under one of the following +-- circumstances: +-- 1. |Number| is 32-bit and value is either above +-- INT32_MAX or below INT32_MIN. +-- 2. |Number| is 64-bit and value is above INT64_MAX. It +-- cannot possibly be below INT64_MIN because msgpack +-- C parser does not support such values. +-- float |Float|. This value cannot possibly appear in +-- |msgpackparse()| output. +-- string |readfile()|-style list of strings. This value will +-- appear in |msgpackparse()| output if string contains +-- zero byte or if string is a mapping key and mapping is +-- being represented as special dictionary for other +-- reasons. +-- binary |String|, or |Blob| if binary string contains zero +-- byte. This value cannot appear in |msgpackparse()| +-- output since blobs were introduced. +-- array |List|. This value cannot appear in |msgpackparse()| +-- output. +-- +-- map |List| of |List|s with two items (key and value) each. +-- This value will appear in |msgpackparse()| output if +-- parsed mapping contains one of the following keys: +-- 1. Any key that is not a string (including keys which +-- are binary strings). +-- 2. String with NUL byte inside. +-- 3. Duplicate key. +-- 4. Empty key. +-- ext |List| with two values: first is a signed integer +-- representing extension type. Second is +-- |readfile()|-style list of strings. +--- @return any[] +function vim.fn.msgpackparse(data) end + +-- Return the line number of the first line at or below {lnum} +-- that is not blank. Example: +-- ```vim +-- if getline(nextnonblank(1)) =~ "Java" +-- ``` +-- When {lnum} is invalid or there is no non-blank line at or +-- below it, zero is returned. +-- {lnum} is used like with |getline()|. +-- See also |prevnonblank()|. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetLnum()->nextnonblank() +-- ``` +--- @param lnum number +--- @return number +function vim.fn.nextnonblank(lnum) end + +-- Return a string with a single character, which has the number +-- value {expr}. Examples: +-- ```vim +-- nr2char(64) returns "@" +-- nr2char(32) returns " " +-- ``` +-- Example for "utf-8": > +-- nr2char(300) returns I with bow character +-- < UTF-8 encoding is always used, {utf8} option has no effect, +-- and exists only for backwards-compatibility. +-- Note that a NUL character in the file is specified with +-- nr2char(10), because NULs are represented with newline +-- characters. nr2char(0) is a real NUL and terminates the +-- string, thus results in an empty string. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetNumber()->nr2char() +-- ``` +--- @param utf8? any +--- @return string +function vim.fn.nr2char(expr, utf8) end + +-- Bitwise OR on the two arguments. The arguments are converted +-- to a number. A List, Dict or Float argument causes an error. +-- Also see `and()` and `xor()`. +-- Example: +-- ```vim +-- :let bits = or(bits, 0x80) +-- ``` +-- Can also be used as a |method|: > +-- :let bits = bits->or(0x80) +-- +-- < Rationale: The reason this is a function and not using the "|" +-- character like many languages, is that Vi has always used "|" +-- to separate commands. In many places it would not be clear if +-- "|" is an operator or a command separator. +--- @return number +vim.fn["or"] = function(expr, expr1) end + +-- Shorten directory names in the path {path} and return the +-- result. The tail, the file name, is kept as-is. The other +-- components in the path are reduced to {len} letters in length. +-- If {len} is omitted or smaller than 1 then 1 is used (single +-- letters). Leading '~' and '.' characters are kept. Examples: +-- ```vim +-- :echo pathshorten('~/.config/nvim/autoload/file1.vim') +-- ``` +-- ~/.c/n/a/file1.vim ~ +-- ```vim +-- :echo pathshorten('~/.config/nvim/autoload/file2.vim', 2) +-- ``` +-- ~/.co/nv/au/file2.vim ~ +-- It doesn't matter if the path exists or not. +-- Returns an empty string on error. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetDirectories()->pathshorten() +-- ``` +--- @param len? any +--- @return string +function vim.fn.pathshorten(path, len) end + +-- Evaluate |perl| expression {expr} and return its result +-- converted to Vim data structures. +-- Numbers and strings are returned as they are (strings are +-- copied though). +-- Lists are represented as Vim |List| type. +-- Dictionaries are represented as Vim |Dictionary| type, +-- non-string keys result in error. +-- +-- Note: If you want an array or hash, {expr} must return a +-- reference to it. +-- Example: +-- ```vim +-- :echo perleval('[1 .. 4]') +-- ``` +-- [1, 2, 3, 4] +-- +-- Can also be used as a |method|: +-- ```vim +-- GetExpr()->perleval() +-- ``` +function vim.fn.perleval(expr) end + +-- Return the power of {x} to the exponent {y} as a |Float|. +-- {x} and {y} must evaluate to a |Float| or a |Number|. +-- Returns 0.0 if {x} or {y} is not a |Float| or a |Number|. +-- Examples: +-- ```vim +-- :echo pow(3, 3) +-- ``` +-- 27.0 > +-- :echo pow(2, 16) +-- < 65536.0 +-- ```vim +-- :echo pow(32, 0.20) +-- ``` +-- 2.0 +-- +-- Can also be used as a |method|: +-- ```vim +-- Compute()->pow(3) +-- ``` +--- @return float +function vim.fn.pow(x, y) end + +-- Return the line number of the first line at or above {lnum} +-- that is not blank. Example: +-- ```vim +-- let ind = indent(prevnonblank(v:lnum - 1)) +-- ``` +-- When {lnum} is invalid or there is no non-blank line at or +-- above it, zero is returned. +-- {lnum} is used like with |getline()|. +-- Also see |nextnonblank()|. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetLnum()->prevnonblank() +-- ``` +--- @param lnum number +--- @return number +function vim.fn.prevnonblank(lnum) end + +-- Return a String with {fmt}, where "%" items are replaced by +-- the formatted form of their respective arguments. Example: +-- ```vim +-- printf("%4d: E%d %.30s", lnum, errno, msg) +-- ``` +-- May result in: +-- " 99: E42 asdfasdfasdfasdfasdfasdfasdfas" ~ +-- +-- When used as a |method| the base is passed as the second +-- argument: +-- ```vim +-- Compute()->printf("result: %d") +-- ``` +-- You can use `call()` to pass the items as a list. +-- +-- Often used items are: +-- %s string +-- %6S string right-aligned in 6 display cells +-- %6s string right-aligned in 6 bytes +-- %.9s string truncated to 9 bytes +-- %c single byte +-- %d decimal number +-- %5d decimal number padded with spaces to 5 characters +-- %b binary number +-- %08b binary number padded with zeros to at least 8 characters +-- %B binary number using upper case letters +-- %x hex number +-- %04x hex number padded with zeros to at least 4 characters +-- %X hex number using upper case letters +-- %o octal number +-- %f floating point number as 12.23, inf, -inf or nan +-- %F floating point number as 12.23, INF, -INF or NAN +-- %e floating point number as 1.23e3, inf, -inf or nan +-- %E floating point number as 1.23E3, INF, -INF or NAN +-- %g floating point number, as %f or %e depending on value +-- %G floating point number, as %F or %E depending on value +-- %% the % character itself +-- %p representation of the pointer to the container +-- +-- Conversion specifications start with '%' and end with the +-- conversion type. All other characters are copied unchanged to +-- the result. +-- +-- The "%" starts a conversion specification. The following +-- arguments appear in sequence: +-- +-- % [flags] [field-width] [.precision] type +-- +-- flags +-- Zero or more of the following flags: +-- +-- # The value should be converted to an "alternate +-- form". For c, d, and s conversions, this option +-- has no effect. For o conversions, the precision +-- of the number is increased to force the first +-- character of the output string to a zero (except +-- if a zero value is printed with an explicit +-- precision of zero). +-- For x and X conversions, a non-zero result has +-- the string "0x" (or "0X" for X conversions) +-- prepended to it. +-- +-- 0 (zero) Zero padding. For all conversions the converted +-- value is padded on the left with zeros rather +-- than blanks. If a precision is given with a +-- numeric conversion (d, o, x, and X), the 0 flag +-- is ignored. +-- +-- - A negative field width flag; the converted value +-- is to be left adjusted on the field boundary. +-- The converted value is padded on the right with +-- blanks, rather than on the left with blanks or +-- zeros. A - overrides a 0 if both are given. +-- +-- ' ' (space) A blank should be left before a positive +-- number produced by a signed conversion (d). +-- +-- + A sign must always be placed before a number +-- produced by a signed conversion. A + overrides +-- a space if both are used. +-- +-- field-width +-- An optional decimal digit string specifying a minimum +-- field width. If the converted value has fewer bytes +-- than the field width, it will be padded with spaces on +-- the left (or right, if the left-adjustment flag has +-- been given) to fill out the field width. For the S +-- conversion the count is in cells. +-- +-- .precision +-- An optional precision, in the form of a period '.' +-- followed by an optional digit string. If the digit +-- string is omitted, the precision is taken as zero. +-- This gives the minimum number of digits to appear for +-- d, o, x, and X conversions, the maximum number of +-- bytes to be printed from a string for s conversions, +-- or the maximum number of cells to be printed from a +-- string for S conversions. +-- For floating point it is the number of digits after +-- the decimal point. +-- +-- type +-- A character that specifies the type of conversion to +-- be applied, see below. +-- +-- A field width or precision, or both, may be indicated by an +-- asterisk "*" instead of a digit string. In this case, a +-- Number argument supplies the field width or precision. A +-- negative field width is treated as a left adjustment flag +-- followed by a positive field width; a negative precision is +-- treated as though it were missing. Example: +-- ```vim +-- :echo printf("%d: %.*s", nr, width, line) +-- ``` +-- This limits the length of the text used from "line" to +-- "width" bytes. +-- +-- The conversion specifiers and their meanings are: +-- +-- +-- dbBoxX The Number argument is converted to signed decimal (d), +-- unsigned binary (b and B), unsigned octal (o), or +-- unsigned hexadecimal (x and X) notation. The letters +-- "abcdef" are used for x conversions; the letters +-- "ABCDEF" are used for X conversions. The precision, if +-- any, gives the minimum number of digits that must +-- appear; if the converted value requires fewer digits, it +-- is padded on the left with zeros. In no case does a +-- non-existent or small field width cause truncation of a +-- numeric field; if the result of a conversion is wider +-- than the field width, the field is expanded to contain +-- the conversion result. +-- The 'h' modifier indicates the argument is 16 bits. +-- The 'l' modifier indicates the argument is 32 bits. +-- The 'L' modifier indicates the argument is 64 bits. +-- Generally, these modifiers are not useful. They are +-- ignored when type is known from the argument. +-- +-- i alias for d +-- D alias for ld +-- U alias for lu +-- O alias for lo +-- +-- +-- c The Number argument is converted to a byte, and the +-- resulting character is written. +-- +-- +-- s The text of the String argument is used. If a +-- precision is specified, no more bytes than the number +-- specified are used. +-- If the argument is not a String type, it is +-- automatically converted to text with the same format +-- as ":echo". +-- +-- S The text of the String argument is used. If a +-- precision is specified, no more display cells than the +-- number specified are used. +-- +-- +-- f F The Float argument is converted into a string of the +-- form 123.456. The precision specifies the number of +-- digits after the decimal point. When the precision is +-- zero the decimal point is omitted. When the precision +-- is not specified 6 is used. A really big number +-- (out of range or dividing by zero) results in "inf" +-- or "-inf" with %f (INF or -INF with %F). +-- "0.0 / 0.0" results in "nan" with %f (NAN with %F). +-- Example: +-- ```vim +-- echo printf("%.2f", 12.115) +-- ``` +-- 12.12 +-- Note that roundoff depends on the system libraries. +-- Use |round()| when in doubt. +-- +-- +-- e E The Float argument is converted into a string of the +-- form 1.234e+03 or 1.234E+03 when using 'E'. The +-- precision specifies the number of digits after the +-- decimal point, like with 'f'. +-- +-- +-- g G The Float argument is converted like with 'f' if the +-- value is between 0.001 (inclusive) and 10000000.0 +-- (exclusive). Otherwise 'e' is used for 'g' and 'E' +-- for 'G'. When no precision is specified superfluous +-- zeroes and '+' signs are removed, except for the zero +-- immediately after the decimal point. Thus 10000000.0 +-- results in 1.0e7. +-- +-- +-- % A '%' is written. No argument is converted. The +-- complete conversion specification is "%%". +-- +-- When a Number argument is expected a String argument is also +-- accepted and automatically converted. +-- When a Float or String argument is expected a Number argument +-- is also accepted and automatically converted. +-- Any other argument type results in an error message. +-- +-- +-- The number of {exprN} arguments must exactly match the number +-- of "%" items. If there are not sufficient or too many +-- arguments an error is given. Up to 18 arguments can be used. +--- @return string +function vim.fn.printf(fmt, expr1, ...) end + +-- Returns the effective prompt text for buffer {buf}. {buf} can +-- be a buffer name or number. See |prompt-buffer|. +-- +-- If the buffer doesn't exist or isn't a prompt buffer, an empty +-- string is returned. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetBuffer()->prompt_getprompt() +-- ``` +--- @param buf buffer +--- @return string +function vim.fn.prompt_getprompt(buf) end + +-- Set prompt callback for buffer {buf} to {expr}. When {expr} +-- is an empty string the callback is removed. This has only +-- effect if {buf} has 'buftype' set to "prompt". +-- +-- The callback is invoked when pressing Enter. The current +-- buffer will always be the prompt buffer. A new line for a +-- prompt is added before invoking the callback, thus the prompt +-- for which the callback was invoked will be in the last but one +-- line. +-- If the callback wants to add text to the buffer, it must +-- insert it above the last line, since that is where the current +-- prompt is. This can also be done asynchronously. +-- The callback is invoked with one argument, which is the text +-- that was entered at the prompt. This can be an empty string +-- if the user only typed Enter. +-- Example: +-- ```vim +-- func s:TextEntered(text) +-- if a:text == 'exit' || a:text == 'quit' +-- stopinsert +-- " Reset 'modified' to allow the buffer to be closed. +-- " We assume there is nothing useful to be saved. +-- set nomodified +-- close +-- else +-- " Do something useful with "a:text". In this example +-- " we just repeat it. +-- call append(line('$') - 1, 'Entered: "' .. a:text .. '"') +-- endif +-- endfunc +-- call prompt_setcallback(bufnr(), function('s:TextEntered')) +-- +-- ``` +-- Can also be used as a |method|: > +-- GetBuffer()->prompt_setcallback(callback) +--- @param buf buffer +function vim.fn.prompt_setcallback(buf, expr) end + +-- Set a callback for buffer {buf} to {expr}. When {expr} is an +-- empty string the callback is removed. This has only effect if +-- {buf} has 'buftype' set to "prompt". +-- +-- This callback will be invoked when pressing CTRL-C in Insert +-- mode. Without setting a callback Vim will exit Insert mode, +-- as in any buffer. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetBuffer()->prompt_setinterrupt(callback) +-- ``` +--- @param buf buffer +function vim.fn.prompt_setinterrupt(buf, expr) end + +-- Set prompt for buffer {buf} to {text}. You most likely want +-- {text} to end in a space. +-- The result is only visible if {buf} has 'buftype' set to +-- "prompt". Example: +-- ```vim +-- call prompt_setprompt(bufnr(''), 'command: ') +-- ``` +-- Can also be used as a |method|: +-- ```vim +-- GetBuffer()->prompt_setprompt('command: ') +-- ``` +--- @param buf buffer +--- @param text string +function vim.fn.prompt_setprompt(buf, text) end + +-- If the popup menu (see |ins-completion-menu|) is not visible, +-- returns an empty |Dictionary|, otherwise, returns a +-- |Dictionary| with the following keys: +-- height nr of items visible +-- width screen cells +-- row top screen row (0 first row) +-- col leftmost screen column (0 first col) +-- size total nr of items +-- scrollbar |TRUE| if scrollbar is visible +-- +-- The values are the same as in |v:event| during |CompleteChanged|. +--- @return table +function vim.fn.pum_getpos() end + +-- Returns non-zero when the popup menu is visible, zero +-- otherwise. See |ins-completion-menu|. +-- This can be used to avoid some things that would remove the +-- popup menu. +--- @return number +function vim.fn.pumvisible() end + +-- Evaluate Python expression {expr} and return its result +-- converted to Vim data structures. +-- Numbers and strings are returned as they are (strings are +-- copied though, Unicode strings are additionally converted to +-- UTF-8). +-- Lists are represented as Vim |List| type. +-- Dictionaries are represented as Vim |Dictionary| type with +-- keys converted to strings. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetExpr()->py3eval() +-- ``` +function vim.fn.py3eval(expr) end + +-- Evaluate Python expression {expr} and return its result +-- converted to Vim data structures. +-- Numbers and strings are returned as they are (strings are +-- copied though). +-- Lists are represented as Vim |List| type. +-- Dictionaries are represented as Vim |Dictionary| type, +-- non-string keys result in error. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetExpr()->pyeval() +-- ``` +function vim.fn.pyeval(expr) end + +-- Evaluate Python expression {expr} and return its result +-- converted to Vim data structures. +-- Uses Python 2 or 3, see |python_x| and 'pyxversion'. +-- See also: |pyeval()|, |py3eval()| +-- +-- Can also be used as a |method|: +-- ```vim +-- GetExpr()->pyxeval() +-- ``` +function vim.fn.pyxeval(expr) end + +-- Return a pseudo-random Number generated with an xoshiro128 +-- algorithm using seed {expr}. The returned number is 32 bits, +-- also on 64 bits systems, for consistency. +-- {expr} can be initialized by |srand()| and will be updated by +-- rand(). If {expr} is omitted, an internal seed value is used +-- and updated. +-- Returns -1 if {expr} is invalid. +-- +-- Examples: +-- ```vim +-- :echo rand() +-- :let seed = srand() +-- :echo rand(seed) +-- :echo rand(seed) % 16 " random number 0 - 15 +-- ``` +-- Can also be used as a |method|: +-- ```vim +-- seed->rand() +-- ``` +--- @param expr? any +--- @return number +function vim.fn.rand(expr) end + +-- Returns a |List| with Numbers: +-- - If only {expr} is specified: [0, 1, ..., {expr} - 1] +-- - If {max} is specified: [{expr}, {expr} + 1, ..., {max}] +-- - If {stride} is specified: [{expr}, {expr} + {stride}, ..., +-- {max}] (increasing {expr} with {stride} each time, not +-- producing a value past {max}). +-- When the maximum is one before the start the result is an +-- empty list. When the maximum is more than one before the +-- start this is an error. +-- Examples: +-- ```vim +-- range(4) " [0, 1, 2, 3] +-- range(2, 4) " [2, 3, 4] +-- range(2, 9, 3) " [2, 5, 8] +-- range(2, -2, -1) " [2, 1, 0, -1, -2] +-- range(0) " [] +-- range(2, 0) " error! +-- ``` +-- Can also be used as a |method|: +-- ```vim +-- GetExpr()->range() +-- ``` +--- @param max? any +--- @param stride? any +--- @return any[] +function vim.fn.range(expr, max, stride) end + +-- Read file {fname} in binary mode and return a |Blob|. +-- If {offset} is specified, read the file from the specified +-- offset. If it is a negative value, it is used as an offset +-- from the end of the file. E.g., to read the last 12 bytes: +-- ```vim +-- readblob('file.bin', -12) +-- ``` +-- If {size} is specified, only the specified size will be read. +-- E.g. to read the first 100 bytes of a file: +-- ```vim +-- readblob('file.bin', 0, 100) +-- ``` +-- If {size} is -1 or omitted, the whole data starting from +-- {offset} will be read. +-- This can be also used to read the data from a character device +-- on Unix when {size} is explicitly set. Only if the device +-- supports seeking {offset} can be used. Otherwise it should be +-- zero. E.g. to read 10 bytes from a serial console: +-- ```vim +-- readblob('/dev/ttyS0', 0, 10) +-- ``` +-- When the file can't be opened an error message is given and +-- the result is an empty |Blob|. +-- When the offset is beyond the end of the file the result is an +-- empty blob. +-- When trying to read more bytes than are available the result +-- is truncated. +-- Also see |readfile()| and |writefile()|. +--- @param offset? any +--- @param size? any +function vim.fn.readblob(fname, offset, size) end + +-- Return a list with file and directory names in {directory}. +-- You can also use |glob()| if you don't need to do complicated +-- things, such as limiting the number of matches. +-- +-- When {expr} is omitted all entries are included. +-- When {expr} is given, it is evaluated to check what to do: +-- If {expr} results in -1 then no further entries will +-- be handled. +-- If {expr} results in 0 then this entry will not be +-- added to the list. +-- If {expr} results in 1 then this entry will be added +-- to the list. +-- Each time {expr} is evaluated |v:val| is set to the entry name. +-- When {expr} is a function the name is passed as the argument. +-- For example, to get a list of files ending in ".txt": +-- ```vim +-- readdir(dirname, {n -> n =~ '.txt$'}) +-- ``` +-- To skip hidden and backup files: > +-- readdir(dirname, {n -> n !~ '^\.\|\~$'}) +-- +-- < If you want to get a directory tree: +-- ```vim +-- function! s:tree(dir) +-- return {a:dir : map(readdir(a:dir), +-- \ {_, x -> isdirectory(x) ? +-- \ {x : s:tree(a:dir .. '/' .. x)} : x})} +-- endfunction +-- echo s:tree(".") +-- ``` +-- Returns an empty List on error. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetDirName()->readdir() +-- ``` +--- @param expr? any +--- @return any[] +function vim.fn.readdir(directory, expr) end + +-- Read file {fname} and return a |List|, each line of the file +-- as an item. Lines are broken at NL characters. Macintosh +-- files separated with CR will result in a single long line +-- (unless a NL appears somewhere). +-- All NUL characters are replaced with a NL character. +-- When {type} contains "b" binary mode is used: +-- - When the last line ends in a NL an extra empty list item is +-- added. +-- - No CR characters are removed. +-- Otherwise: +-- - CR characters that appear before a NL are removed. +-- - Whether the last line ends in a NL or not does not matter. +-- - Any UTF-8 byte order mark is removed from the text. +-- When {max} is given this specifies the maximum number of lines +-- to be read. Useful if you only want to check the first ten +-- lines of a file: +-- ```vim +-- :for line in readfile(fname, '', 10) +-- : if line =~ 'Date' | echo line | endif +-- :endfor +-- ``` +-- When {max} is negative -{max} lines from the end of the file +-- are returned, or as many as there are. +-- When {max} is zero the result is an empty list. +-- Note that without {max} the whole file is read into memory. +-- Also note that there is no recognition of encoding. Read a +-- file into a buffer if you need to. +-- Deprecated (use |readblob()| instead): When {type} contains +-- "B" a |Blob| is returned with the binary data of the file +-- unmodified. +-- When the file can't be opened an error message is given and +-- the result is an empty list. +-- Also see |writefile()|. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetFileName()->readfile() +-- ``` +--- @param type? any +--- @param max? any +--- @return any[] +function vim.fn.readfile(fname, type, max) end + +-- {func} is called for every item in {object}, which can be a +-- |List| or a |Blob|. {func} is called with two arguments: the +-- result so far and current item. After processing all items +-- the result is returned. +-- +-- {initial} is the initial result. When omitted, the first item +-- in {object} is used and {func} is first called for the second +-- item. If {initial} is not given and {object} is empty no +-- result can be computed, an E998 error is given. +-- +-- Examples: +-- ```vim +-- echo reduce([1, 3, 5], { acc, val -> acc + val }) +-- echo reduce(['x', 'y'], { acc, val -> acc .. val }, 'a') +-- echo reduce(0z1122, { acc, val -> 2 * acc + val }) +-- ``` +-- Can also be used as a |method|: +-- ```vim +-- echo mylist->reduce({ acc, val -> acc + val }, 0) +-- ``` +--- @param func fun() +--- @param initial? any +function vim.fn.reduce(object, func, initial) end + +-- Returns the single letter name of the register being executed. +-- Returns an empty string when no register is being executed. +-- See |@|. +--- @return string +function vim.fn.reg_executing() end + +-- Returns the single letter name of the last recorded register. +-- Returns an empty string when nothing was recorded yet. +-- See |q| and |Q|. +--- @return string +function vim.fn.reg_recorded() end + +-- Returns the single letter name of the register being recorded. +-- Returns an empty string when not recording. See |q|. +--- @return string +function vim.fn.reg_recording() end + +-- Return an item that represents a time value. The item is a +-- list with items that depend on the system. +-- The item can be passed to |reltimestr()| to convert it to a +-- string or |reltimefloat()| to convert to a Float. +-- +-- Without an argument it returns the current "relative time", an +-- implementation-defined value meaningful only when used as an +-- argument to |reltime()|, |reltimestr()| and |reltimefloat()|. +-- +-- With one argument it returns the time passed since the time +-- specified in the argument. +-- With two arguments it returns the time passed between {start} +-- and {end}. +-- +-- The {start} and {end} arguments must be values returned by +-- reltime(). Returns zero on error. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetStart()->reltime() +-- ``` +-- Note: |localtime()| returns the current (non-relative) time. +--- @param start number +--- @param end_ number +--- @return any[] +function vim.fn.reltime(start, end_) end + +-- Return a Float that represents the time value of {time}. +-- Unit of time is seconds. +-- Example: +-- let start = reltime() +-- call MyFunction() +-- let seconds = reltimefloat(reltime(start)) +-- See the note of reltimestr() about overhead. +-- Also see |profiling|. +-- If there is an error an empty string is returned +-- +-- Can also be used as a |method|: +-- ```vim +-- reltime(start)->reltimefloat() +-- ``` +--- @return float +function vim.fn.reltimefloat(time) end + +-- Return a String that represents the time value of {time}. +-- This is the number of seconds, a dot and the number of +-- microseconds. Example: +-- ```vim +-- let start = reltime() +-- call MyFunction() +-- echo reltimestr(reltime(start)) +-- ``` +-- Note that overhead for the commands will be added to the time. +-- Leading spaces are used to make the string align nicely. You +-- can use split() to remove it. +-- ```vim +-- echo split(reltimestr(reltime(start)))[0] +-- ``` +-- Also see |profiling|. +-- If there is an error an empty string is returned +-- +-- Can also be used as a |method|: +-- ```vim +-- reltime(start)->reltimestr() +-- ``` +--- @return string +function vim.fn.reltimestr(time) end + +-- Remove the entry from {dict} with key {key} and return it. +-- Example: +-- ```vim +-- :echo "removed " .. remove(dict, "one") +-- ``` +-- If there is no {key} in {dict} this is an error. +-- Returns zero on error. +--- @param dict table +function vim.fn.remove(dict, key) end + +-- Rename the file by the name {from} to the name {to}. This +-- should also work to move files across file systems. The +-- result is a Number, which is 0 if the file was renamed +-- successfully, and non-zero when the renaming failed. +-- NOTE: If {to} exists it is overwritten without warning. +-- This function is not available in the |sandbox|. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetOldName()->rename(newname) +-- ``` +--- @param from number +--- @param to number +--- @return number +function vim.fn.rename(from, to) end + +-- Repeat {expr} {count} times and return the concatenated +-- result. Example: +-- ```vim +-- :let separator = repeat('-', 80) +-- ``` +-- When {count} is zero or negative the result is empty. +-- When {expr} is a |List| or a |Blob| the result is {expr} +-- concatenated {count} times. Example: +-- ```vim +-- :let longlist = repeat(['a', 'b'], 3) +-- ``` +-- Results in ['a', 'b', 'a', 'b', 'a', 'b']. +-- +-- Can also be used as a |method|: +-- ```vim +-- mylist->repeat(count) +-- ``` +--- @return any[] +vim.fn["repeat"] = function(expr, count) end + +-- On MS-Windows, when {filename} is a shortcut (a .lnk file), +-- returns the path the shortcut points to in a simplified form. +-- On Unix, repeat resolving symbolic links in all path +-- components of {filename} and return the simplified result. +-- To cope with link cycles, resolving of symbolic links is +-- stopped after 100 iterations. +-- On other systems, return the simplified {filename}. +-- The simplification step is done as by |simplify()|. +-- resolve() keeps a leading path component specifying the +-- current directory (provided the result is still a relative +-- path name) and also keeps a trailing path separator. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetName()->resolve() +-- ``` +--- @return string +function vim.fn.resolve(filename) end + +-- Reverse the order of items in {object} in-place. +-- {object} can be a |List| or a |Blob|. +-- Returns {object}. +-- Returns zero if {object} is not a List or a Blob. +-- If you want an object to remain unmodified make a copy first: +-- ```vim +-- :let revlist = reverse(copy(mylist)) +-- ``` +-- Can also be used as a |method|: > +-- mylist->reverse() +--- @return any[] +function vim.fn.reverse(object) end + +-- Round off {expr} to the nearest integral value and return it +-- as a |Float|. If {expr} lies halfway between two integral +-- values, then use the larger one (away from zero). +-- {expr} must evaluate to a |Float| or a |Number|. +-- Returns 0.0 if {expr} is not a |Float| or a |Number|. +-- Examples: +-- ```vim +-- echo round(0.456) +-- ``` +-- 0.0 > +-- echo round(4.5) +-- < 5.0 +-- ```vim +-- echo round(-4.5) +-- ``` +-- -5.0 +-- +-- Can also be used as a |method|: +-- ```vim +-- Compute()->round() +-- ``` +--- @return float +function vim.fn.round(expr) end + +-- Sends {event} to {channel} via |RPC| and returns immediately. +-- If {channel} is 0, the event is broadcast to all channels. +-- Example: +-- ```vim +-- :au VimLeave call rpcnotify(0, "leaving") +-- ``` +--- @param args? any[] +--- @param ...? any +function vim.fn.rpcnotify(channel, event, args, ...) end + +-- Sends a request to {channel} to invoke {method} via +-- |RPC| and blocks until a response is received. +-- Example: +-- ```vim +-- :let result = rpcrequest(rpc_chan, "func", 1, 2, 3) +-- ``` +--- @param args? any[] +--- @param ...? any +function vim.fn.rpcrequest(channel, method, args, ...) end + +-- Deprecated. Replace +-- ```vim +-- :let id = rpcstart('prog', ['arg1', 'arg2']) +-- ``` +-- with > +-- :let id = jobstart(['prog', 'arg1', 'arg2'], {'rpc': v:true}) +--- @param argv? any +function vim.fn.rpcstart(prog, argv) end + +-- Evaluate Ruby expression {expr} and return its result +-- converted to Vim data structures. +-- Numbers, floats and strings are returned as they are (strings +-- are copied though). +-- Arrays are represented as Vim |List| type. +-- Hashes are represented as Vim |Dictionary| type. +-- Other objects are represented as strings resulted from their +-- "Object#to_s" method. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetRubyExpr()->rubyeval() +-- ``` +function vim.fn.rubyeval(expr) end + +-- Like |screenchar()|, but return the attribute. This is a rather +-- arbitrary number that can only be used to compare to the +-- attribute at other positions. +-- Returns -1 when row or col is out of range. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetRow()->screenattr(col) +-- ``` +--- @param col number +--- @return number +function vim.fn.screenattr(row, col) end + +-- The result is a Number, which is the character at position +-- [row, col] on the screen. This works for every possible +-- screen position, also status lines, window separators and the +-- command line. The top left position is row one, column one +-- The character excludes composing characters. For double-byte +-- encodings it may only be the first byte. +-- This is mainly to be used for testing. +-- Returns -1 when row or col is out of range. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetRow()->screenchar(col) +-- ``` +--- @param col number +--- @return number +function vim.fn.screenchar(row, col) end + +-- The result is a List of Numbers. The first number is the same +-- as what |screenchar()| returns. Further numbers are +-- composing characters on top of the base character. +-- This is mainly to be used for testing. +-- Returns an empty List when row or col is out of range. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetRow()->screenchars(col) +-- ``` +--- @param col number +--- @return any[] +function vim.fn.screenchars(row, col) end + +-- The result is a Number, which is the current screen column of +-- the cursor. The leftmost column has number 1. +-- This function is mainly used for testing. +-- +-- Note: Always returns the current screen column, thus if used +-- in a command (e.g. ":echo screencol()") it will return the +-- column inside the command line, which is 1 when the command is +-- executed. To get the cursor position in the file use one of +-- the following mappings: +-- ```vim +-- nnoremap GG ":echom " .. screencol() .. "\n" +-- nnoremap GG :echom screencol() +-- noremap GG echom screencol() +-- ``` +--- @return number +function vim.fn.screencol() end + +-- The result is a Dict with the screen position of the text +-- character in window {winid} at buffer line {lnum} and column +-- {col}. {col} is a one-based byte index. +-- The Dict has these members: +-- row screen row +-- col first screen column +-- endcol last screen column +-- curscol cursor screen column +-- If the specified position is not visible, all values are zero. +-- The "endcol" value differs from "col" when the character +-- occupies more than one screen cell. E.g. for a Tab "col" can +-- be 1 and "endcol" can be 8. +-- The "curscol" value is where the cursor would be placed. For +-- a Tab it would be the same as "endcol", while for a double +-- width character it would be the same as "col". +-- The |conceal| feature is ignored here, the column numbers are +-- as if 'conceallevel' is zero. You can set the cursor to the +-- right position and use |screencol()| to get the value with +-- |conceal| taken into account. +-- If the position is in a closed fold the screen position of the +-- first character is returned, {col} is not used. +-- Returns an empty Dict if {winid} is invalid. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetWinid()->screenpos(lnum, col) +-- ``` +--- @param winid window +--- @param lnum number +--- @param col number +--- @return table +function vim.fn.screenpos(winid, lnum, col) end + +-- The result is a Number, which is the current screen row of the +-- cursor. The top line has number one. +-- This function is mainly used for testing. +-- Alternatively you can use |winline()|. +-- +-- Note: Same restrictions as with |screencol()|. +--- @return number +function vim.fn.screenrow() end + +-- The result is a String that contains the base character and +-- any composing characters at position [row, col] on the screen. +-- This is like |screenchars()| but returning a String with the +-- characters. +-- This is mainly to be used for testing. +-- Returns an empty String when row or col is out of range. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetRow()->screenstring(col) +-- ``` +--- @param col number +--- @return string +function vim.fn.screenstring(row, col) end + +-- Search for regexp pattern {pattern}. The search starts at the +-- cursor position (you can use |cursor()| to set it). +-- +-- When a match has been found its line number is returned. +-- If there is no match a 0 is returned and the cursor doesn't +-- move. No error message is given. +-- +-- {flags} is a String, which can contain these character flags: +-- 'b' search Backward instead of forward +-- 'c' accept a match at the Cursor position +-- 'e' move to the End of the match +-- 'n' do Not move the cursor +-- 'p' return number of matching sub-Pattern (see below) +-- 's' Set the ' mark at the previous location of the cursor +-- 'w' Wrap around the end of the file +-- 'W' don't Wrap around the end of the file +-- 'z' start searching at the cursor column instead of Zero +-- If neither 'w' or 'W' is given, the 'wrapscan' option applies. +-- +-- If the 's' flag is supplied, the ' mark is set, only if the +-- cursor is moved. The 's' flag cannot be combined with the 'n' +-- flag. +-- +-- 'ignorecase', 'smartcase' and 'magic' are used. +-- +-- When the 'z' flag is not given, forward searching always +-- starts in column zero and then matches before the cursor are +-- skipped. When the 'c' flag is present in 'cpo' the next +-- search starts after the match. Without the 'c' flag the next +-- search starts one column after the start of the match. This +-- matters for overlapping matches. See |cpo-c|. You can also +-- insert "\ze" to change where the match ends, see |/\ze|. +-- +-- When searching backwards and the 'z' flag is given then the +-- search starts in column zero, thus no match in the current +-- line will be found (unless wrapping around the end of the +-- file). +-- +-- When the {stopline} argument is given then the search stops +-- after searching this line. This is useful to restrict the +-- search to a range of lines. Examples: +-- ```vim +-- let match = search('(', 'b', line("w0")) +-- let end = search('END', '', line("w$")) +-- ``` +-- When {stopline} is used and it is not zero this also implies +-- that the search does not wrap around the end of the file. +-- A zero value is equal to not giving the argument. +-- +-- When the {timeout} argument is given the search stops when +-- more than this many milliseconds have passed. Thus when +-- {timeout} is 500 the search stops after half a second. +-- The value must not be negative. A zero value is like not +-- giving the argument. +-- +-- If the {skip} expression is given it is evaluated with the +-- cursor positioned on the start of a match. If it evaluates to +-- non-zero this match is skipped. This can be used, for +-- example, to skip a match in a comment or a string. +-- {skip} can be a string, which is evaluated as an expression, a +-- function reference or a lambda. +-- When {skip} is omitted or empty, every match is accepted. +-- When evaluating {skip} causes an error the search is aborted +-- and -1 returned. +-- +-- With the 'p' flag the returned value is one more than the +-- first sub-match in \(\). One if none of them matched but the +-- whole pattern did match. +-- To get the column number too use |searchpos()|. +-- +-- The cursor will be positioned at the match, unless the 'n' +-- flag is used. +-- +-- Example (goes over all files in the argument list): +-- ```vim +-- :let n = 1 +-- :while n <= argc() " loop over all files in arglist +-- : exe "argument " .. n +-- : " start at the last char in the file and wrap for the +-- : " first search to find match at start of file +-- : normal G$ +-- : let flags = "w" +-- : while search("foo", flags) > 0 +-- : s/foo/bar/g +-- : let flags = "W" +-- : endwhile +-- : update " write the file if modified +-- : let n = n + 1 +-- :endwhile +-- ``` +-- Example for using some flags: +-- ```vim +-- :echo search('\search() +-- ``` +--- @param flags? any +--- @param stopline? any +--- @param timeout? any +--- @param skip? any +--- @return number +function vim.fn.search(pattern, flags, stopline, timeout, skip) end + +-- Get or update the last search count, like what is displayed +-- without the "S" flag in 'shortmess'. This works even if +-- 'shortmess' does contain the "S" flag. +-- +-- This returns a Dictionary. The dictionary is empty if the +-- previous pattern was not set and "pattern" was not specified. +-- +-- key type meaning ~ +-- current |Number| current position of match; +-- 0 if the cursor position is +-- before the first match +-- exact_match |Boolean| 1 if "current" is matched on +-- "pos", otherwise 0 +-- total |Number| total count of matches found +-- incomplete |Number| 0: search was fully completed +-- 1: recomputing was timed out +-- 2: max count exceeded +-- +-- For {options} see further down. +-- +-- To get the last search count when |n| or |N| was pressed, call +-- this function with `recompute: 0` . This sometimes returns +-- wrong information because |n| and |N|'s maximum count is 99. +-- If it exceeded 99 the result must be max count + 1 (100). If +-- you want to get correct information, specify `recompute: 1`: +-- ```vim +-- +-- " result == maxcount + 1 (100) when many matches +-- let result = searchcount(#{recompute: 0}) +-- +-- " Below returns correct result (recompute defaults +-- " to 1) +-- let result = searchcount() +-- ``` +-- The function is useful to add the count to 'statusline': +-- ```vim +-- function! LastSearchCount() abort +-- let result = searchcount(#{recompute: 0}) +-- if empty(result) +-- return '' +-- endif +-- if result.incomplete ==# 1 " timed out +-- return printf(' /%s [?/??]', @/) +-- elseif result.incomplete ==# 2 " max count exceeded +-- if result.total > result.maxcount && +-- \ result.current > result.maxcount +-- return printf(' /%s [>%d/>%d]', @/, +-- \ result.current, result.total) +-- elseif result.total > result.maxcount +-- return printf(' /%s [%d/>%d]', @/, +-- \ result.current, result.total) +-- endif +-- endif +-- return printf(' /%s [%d/%d]', @/, +-- \ result.current, result.total) +-- endfunction +-- let &statusline ..= '%{LastSearchCount()}' +-- +-- " Or if you want to show the count only when +-- " 'hlsearch' was on +-- " let &statusline ..= +-- " \ '%{v:hlsearch ? LastSearchCount() : ""}' +-- ``` +-- You can also update the search count, which can be useful in a +-- |CursorMoved| or |CursorMovedI| autocommand: +-- ```vim +-- +-- autocmd CursorMoved,CursorMovedI * +-- \ let s:searchcount_timer = timer_start( +-- \ 200, function('s:update_searchcount')) +-- function! s:update_searchcount(timer) abort +-- if a:timer ==# s:searchcount_timer +-- call searchcount(#{ +-- \ recompute: 1, maxcount: 0, timeout: 100}) +-- redrawstatus +-- endif +-- endfunction +-- ``` +-- This can also be used to count matched texts with specified +-- pattern in the current buffer using "pattern": +-- ```vim +-- +-- " Count '\' in this buffer +-- " (Note that it also updates search count) +-- let result = searchcount(#{pattern: '\'}) +-- +-- " To restore old search count by old pattern, +-- " search again +-- call searchcount() +-- ``` +-- {options} must be a Dictionary. It can contain: +-- key type meaning ~ +-- recompute |Boolean| if |TRUE|, recompute the count +-- like |n| or |N| was executed. +-- otherwise returns the last +-- computed result (when |n| or +-- |N| was used when "S" is not +-- in 'shortmess', or this +-- function was called). +-- (default: |TRUE|) +-- pattern |String| recompute if this was given +-- and different with |@/|. +-- this works as same as the +-- below command is executed +-- before calling this function +-- ```vim +-- let @/ = pattern +-- ``` +-- (default: |@/|) +-- timeout |Number| 0 or negative number is no +-- timeout. timeout milliseconds +-- for recomputing the result +-- (default: 0) +-- maxcount |Number| 0 or negative number is no +-- limit. max count of matched +-- text while recomputing the +-- result. if search exceeded +-- total count, "total" value +-- becomes `maxcount + 1` +-- (default: 0) +-- pos |List| `[lnum, col, off]` value +-- when recomputing the result. +-- this changes "current" result +-- value. see |cursor()|, |getpos()| +-- (default: cursor's position) +-- +-- Can also be used as a |method|: +-- ```vim +-- GetSearchOpts()->searchcount() +-- ``` +--- @param options? table +--- @return table +function vim.fn.searchcount(options) end + +-- Search for the declaration of {name}. +-- +-- With a non-zero {global} argument it works like |gD|, find +-- first match in the file. Otherwise it works like |gd|, find +-- first match in the function. +-- +-- With a non-zero {thisblock} argument matches in a {} block +-- that ends before the cursor position are ignored. Avoids +-- finding variable declarations only valid in another scope. +-- +-- Moves the cursor to the found match. +-- Returns zero for success, non-zero for failure. +-- Example: +-- ```vim +-- if searchdecl('myvar') == 0 +-- echo getline('.') +-- endif +-- ``` +-- Can also be used as a |method|: +-- ```vim +-- GetName()->searchdecl() +-- ``` +--- @param global? any +--- @param thisblock? any +--- @return number +function vim.fn.searchdecl(name, global, thisblock) end + +-- Search for the match of a nested start-end pair. This can be +-- used to find the "endif" that matches an "if", while other +-- if/endif pairs in between are ignored. +-- The search starts at the cursor. The default is to search +-- forward, include 'b' in {flags} to search backward. +-- If a match is found, the cursor is positioned at it and the +-- line number is returned. If no match is found 0 or -1 is +-- returned and the cursor doesn't move. No error message is +-- given. +-- +-- {start}, {middle} and {end} are patterns, see |pattern|. They +-- must not contain \( \) pairs. Use of \%( \) is allowed. When +-- {middle} is not empty, it is found when searching from either +-- direction, but only when not in a nested start-end pair. A +-- typical use is: +-- ```vim +-- searchpair('\', '\', '\') +-- ``` +-- By leaving {middle} empty the "else" is skipped. +-- +-- {flags} 'b', 'c', 'n', 's', 'w' and 'W' are used like with +-- |search()|. Additionally: +-- 'r' Repeat until no more matches found; will find the +-- outer pair. Implies the 'W' flag. +-- 'm' Return number of matches instead of line number with +-- the match; will be > 1 when 'r' is used. +-- Note: it's nearly always a good idea to use the 'W' flag, to +-- avoid wrapping around the end of the file. +-- +-- When a match for {start}, {middle} or {end} is found, the +-- {skip} expression is evaluated with the cursor positioned on +-- the start of the match. It should return non-zero if this +-- match is to be skipped. E.g., because it is inside a comment +-- or a string. +-- When {skip} is omitted or empty, every match is accepted. +-- When evaluating {skip} causes an error the search is aborted +-- and -1 returned. +-- {skip} can be a string, a lambda, a funcref or a partial. +-- Anything else makes the function fail. +-- +-- For {stopline} and {timeout} see |search()|. +-- +-- The value of 'ignorecase' is used. 'magic' is ignored, the +-- patterns are used like it's on. +-- +-- The search starts exactly at the cursor. A match with +-- {start}, {middle} or {end} at the next character, in the +-- direction of searching, is the first one found. Example: +-- ```vim +-- if 1 +-- if 2 +-- endif 2 +-- endif 1 +-- ``` +-- When starting at the "if 2", with the cursor on the "i", and +-- searching forwards, the "endif 2" is found. When starting on +-- the character just before the "if 2", the "endif 1" will be +-- found. That's because the "if 2" will be found first, and +-- then this is considered to be a nested if/endif from "if 2" to +-- "endif 2". +-- When searching backwards and {end} is more than one character, +-- it may be useful to put "\zs" at the end of the pattern, so +-- that when the cursor is inside a match with the end it finds +-- the matching start. +-- +-- Example, to find the "endif" command in a Vim script: +-- ```vim +-- +-- :echo searchpair('\', '\', '\', 'W', +-- \ 'getline(".") =~ "^\\s*\""') +-- +-- ``` +-- The cursor must be at or after the "if" for which a match is +-- to be found. Note that single-quote strings are used to avoid +-- having to double the backslashes. The skip expression only +-- catches comments at the start of a line, not after a command. +-- Also, a word "en" or "if" halfway through a line is considered +-- a match. +-- Another example, to search for the matching "{" of a "}": +-- ```vim +-- +-- :echo searchpair('{', '', '}', 'bW') +-- +-- ``` +-- This works when the cursor is at or before the "}" for which a +-- match is to be found. To reject matches that syntax +-- highlighting recognized as strings: +-- ```vim +-- +-- :echo searchpair('{', '', '}', 'bW', +-- \ 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string"') +-- ``` +--- @param start string +--- @param middle? string +--- @param end_ string +--- @param flags? string +--- @param skip? string +--- @param stopline? number +--- @param timeout? number +--- @return number +function vim.fn.searchpair(start, middle, end_, flags, skip, stopline, timeout) end + +-- Same as |searchpair()|, but returns a |List| with the line and +-- column position of the match. The first element of the |List| +-- is the line number and the second element is the byte index of +-- the column position of the match. If no match is found, +-- returns [0, 0]. +-- ```vim +-- +-- :let [lnum,col] = searchpairpos('{', '', '}', 'n') +-- ``` +-- See |match-parens| for a bigger and more useful example. +--- @param start string +--- @param middle? string +--- @param end_ string +--- @param flags? string +--- @param skip? string +--- @param stopline? number +--- @param timeout? number +--- @return any[] +function vim.fn.searchpairpos(start, middle, end_, flags, skip, stopline, timeout) end + +-- Same as |search()|, but returns a |List| with the line and +-- column position of the match. The first element of the |List| +-- is the line number and the second element is the byte index of +-- the column position of the match. If no match is found, +-- returns [0, 0]. +-- Example: +-- ```vim +-- :let [lnum, col] = searchpos('mypattern', 'n') +-- +-- ``` +-- When the 'p' flag is given then there is an extra item with +-- the sub-pattern match number |search()-sub-match|. Example: +-- ```vim +-- :let [lnum, col, submatch] = searchpos('\(\l\)\|\(\u\)', 'np') +-- ``` +-- In this example "submatch" is 2 when a lowercase letter is +-- found |/\l|, 3 when an uppercase letter is found |/\u|. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetPattern()->searchpos() +-- ``` +--- @param flags? any +--- @param stopline? any +--- @param timeout? any +--- @param skip? any +--- @return any[] +function vim.fn.searchpos(pattern, flags, stopline, timeout, skip) end + +-- Returns a list of server addresses, or empty if all servers +-- were stopped. |serverstart()| |serverstop()| +-- Example: +-- ```vim +-- :echo serverlist() +-- ``` +--- @return string +function vim.fn.serverlist() end + +-- Opens a socket or named pipe at {address} and listens for +-- |RPC| messages. Clients can send |API| commands to the +-- returned address to control Nvim. +-- +-- Returns the address string (which may differ from the +-- {address} argument, see below). +-- +-- - If {address} has a colon (":") it is a TCP/IPv4/IPv6 address +-- where the last ":" separates host and port (empty or zero +-- assigns a random port). +-- - Else {address} is the path to a named pipe (except on Windows). +-- - If {address} has no slashes ("/") it is treated as the +-- "name" part of a generated path in this format: +-- ```vim +-- stdpath("run").."/{name}.{pid}.{counter}" +-- ``` +-- - If {address} is omitted the name is "nvim". > +-- :echo serverstart() +-- => /tmp/nvim.bram/oknANW/nvim.15430.5 +-- +-- < Example bash command to list all Nvim servers: +-- ```vim +-- ls ${XDG_RUNTIME_DIR:-${TMPDIR}nvim.${USER}}/.0 +-- +-- ``` +-- Example named pipe: > +-- if has('win32') +-- echo serverstart('\\.\pipe\nvim-pipe-1234') +-- else +-- echo serverstart('nvim.sock') +-- endif +-- < +-- Example TCP/IP address: +-- ```vim +-- echo serverstart('::1:12345') +-- ``` +--- @param address? any +function vim.fn.serverstart(address) end + +-- Closes the pipe or socket at {address}. +-- Returns TRUE if {address} is valid, else FALSE. +-- If |v:servername| is stopped it is set to the next available +-- address in |serverlist()|. +function vim.fn.serverstop(address) end + +-- Set line {lnum} to {text} in buffer {buf}. This works like +-- |setline()| for the specified buffer. +-- +-- This function works only for loaded buffers. First call +-- |bufload()| if needed. +-- +-- To insert lines use |appendbufline()|. +-- +-- {text} can be a string to set one line, or a list of strings +-- to set multiple lines. If the list extends below the last +-- line then those lines are added. +-- +-- For the use of {buf}, see |bufname()| above. +-- +-- {lnum} is used like with |setline()|. +-- Use "$" to refer to the last line in buffer {buf}. +-- When {lnum} is just below the last line the {text} will be +-- added below the last line. +-- On success 0 is returned, on failure 1 is returned. +-- +-- If {buf} is not a valid buffer or {lnum} is not valid, an +-- error message is given. +-- +-- Can also be used as a |method|, the base is passed as the +-- third argument: +-- ```vim +-- GetText()->setbufline(buf, lnum) +-- ``` +--- @param buf buffer +--- @param lnum number +--- @param text string +--- @return number +function vim.fn.setbufline(buf, lnum, text) end + +-- Set option or local variable {varname} in buffer {buf} to +-- {val}. +-- This also works for a global or local window option, but it +-- doesn't work for a global or local window variable. +-- For a local window option the global value is unchanged. +-- For the use of {buf}, see |bufname()| above. +-- The {varname} argument is a string. +-- Note that the variable name without "b:" must be used. +-- Examples: +-- ```vim +-- :call setbufvar(1, "&mod", 1) +-- :call setbufvar("todo", "myvar", "foobar") +-- ``` +-- This function is not available in the |sandbox|. +-- +-- Can also be used as a |method|, the base is passed as the +-- third argument: +-- ```vim +-- GetValue()->setbufvar(buf, varname) +-- ``` +--- @param buf buffer +--- @return boolean +function vim.fn.setbufvar(buf, varname, val) end + +-- Specify overrides for cell widths of character ranges. This +-- tells Vim how wide characters are when displayed in the +-- terminal, counted in screen cells. The values override +-- 'ambiwidth'. Example: +-- ```vim +-- call setcellwidths([ +-- \ [0x111, 0x111, 1], +-- \ [0x2194, 0x2199, 2], +-- \ ]) +-- +-- ``` +-- The {list} argument is a List of Lists with each three +-- numbers: [{low}, {high}, {width}]. +-- {low} and {high} can be the same, in which case this refers to +-- one character. Otherwise it is the range of characters from +-- {low} to {high} (inclusive). +-- Only characters with value 0x80 and higher can be used. +-- +-- {width} must be either 1 or 2, indicating the character width +-- in screen cells. +-- An error is given if the argument is invalid, also when a +-- range overlaps with another. +-- +-- If the new value causes 'fillchars' or 'listchars' to become +-- invalid it is rejected and an error is given. +-- +-- To clear the overrides pass an empty {list}: +-- ```vim +-- call setcellwidths([]) +-- +-- ``` +-- You can use the script $VIMRUNTIME/tools/emoji_list.vim to see +-- the effect for known emoji characters. Move the cursor +-- through the text to check if the cell widths of your terminal +-- match with what Vim knows about each emoji. If it doesn't +-- look right you need to adjust the {list} argument. +--- @param list any[] +function vim.fn.setcellwidths(list) end + +-- Same as |setpos()| but uses the specified column number as the +-- character index instead of the byte index in the line. +-- +-- Example: +-- With the text "여보세요" in line 8: +-- ```vim +-- call setcharpos('.', [0, 8, 4, 0]) +-- ``` +-- positions the cursor on the fourth character '요'. > +-- call setpos('.', [0, 8, 4, 0]) +-- < positions the cursor on the second character '보'. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetPosition()->setcharpos('.') +-- ``` +--- @param list any[] +--- @return number +function vim.fn.setcharpos(expr, list) end + +-- Set the current character search information to {dict}, +-- which contains one or more of the following entries: +-- +-- char character which will be used for a subsequent +-- |,| or |;| command; an empty string clears the +-- character search +-- forward direction of character search; 1 for forward, +-- 0 for backward +-- until type of character search; 1 for a |t| or |T| +-- character search, 0 for an |f| or |F| +-- character search +-- +-- This can be useful to save/restore a user's character search +-- from a script: +-- ```vim +-- :let prevsearch = getcharsearch() +-- :" Perform a command which clobbers user's search +-- :call setcharsearch(prevsearch) +-- ``` +-- Also see |getcharsearch()|. +-- +-- Can also be used as a |method|: +-- ```vim +-- SavedSearch()->setcharsearch() +-- ``` +--- @param dict table +--- @return table +function vim.fn.setcharsearch(dict) end + +-- Set the command line to {str} and set the cursor position to +-- {pos}. +-- If {pos} is omitted, the cursor is positioned after the text. +-- Returns 0 when successful, 1 when not editing the command +-- line. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetText()->setcmdline() +-- ``` +--- @param str string +--- @param pos? number +--- @return number +function vim.fn.setcmdline(str, pos) end + +-- Set the cursor position in the command line to byte position +-- {pos}. The first position is 1. +-- Use |getcmdpos()| to obtain the current position. +-- Only works while editing the command line, thus you must use +-- |c_CTRL-\_e|, |c_CTRL-R_=| or |c_CTRL-R_CTRL-R| with '='. For +-- |c_CTRL-\_e| and |c_CTRL-R_CTRL-R| with '=' the position is +-- set after the command line is set to the expression. For +-- |c_CTRL-R_=| it is set after evaluating the expression but +-- before inserting the resulting text. +-- When the number is too big the cursor is put at the end of the +-- line. A number smaller than one has undefined results. +-- Returns 0 when successful, 1 when not editing the command +-- line. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetPos()->setcmdpos() +-- ``` +--- @param pos number +--- @return number +function vim.fn.setcmdpos(pos) end + +-- Same as |cursor()| but uses the specified column number as the +-- character index instead of the byte index in the line. +-- +-- Example: +-- With the text "여보세요" in line 4: +-- ```vim +-- call setcursorcharpos(4, 3) +-- ``` +-- positions the cursor on the third character '세'. > +-- call cursor(4, 3) +-- < positions the cursor on the first character '여'. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetCursorPos()->setcursorcharpos() +-- ``` +--- @param list any[] +--- @return number +function vim.fn.setcursorcharpos(list) end + +-- Set environment variable {name} to {val}. Example: +-- ```vim +-- call setenv('HOME', '/home/myhome') +-- +-- ``` +-- When {val} is |v:null| the environment variable is deleted. +-- See also |expr-env|. +-- +-- Can also be used as a |method|, the base is passed as the +-- second argument: +-- ```vim +-- GetPath()->setenv('PATH') +-- ``` +function vim.fn.setenv(name, val) end + +-- Set the file permissions for {fname} to {mode}. +-- {mode} must be a string with 9 characters. It is of the form +-- "rwxrwxrwx", where each group of "rwx" flags represent, in +-- turn, the permissions of the owner of the file, the group the +-- file belongs to, and other users. A '-' character means the +-- permission is off, any other character means on. Multi-byte +-- characters are not supported. +-- +-- For example "rw-r-----" means read-write for the user, +-- readable by the group, not accessible by others. "xx-x-----" +-- would do the same thing. +-- +-- Returns non-zero for success, zero for failure. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetFilename()->setfperm(mode) +-- ``` +-- To read permissions see |getfperm()|. +function vim.fn.setfperm(fname, mode) end + +-- Set line {lnum} of the current buffer to {text}. To insert +-- lines use |append()|. To set lines in another buffer use +-- |setbufline()|. +-- +-- {lnum} is used like with |getline()|. +-- When {lnum} is just below the last line the {text} will be +-- added below the last line. +-- {text} can be any type or a List of any type, each item is +-- converted to a String. +-- +-- If this succeeds, FALSE is returned. If this fails (most likely +-- because {lnum} is invalid) TRUE is returned. +-- +-- Example: +-- ```vim +-- :call setline(5, strftime("%c")) +-- +-- ``` +-- When {text} is a |List| then line {lnum} and following lines +-- will be set to the items in the list. Example: +-- ```vim +-- :call setline(5, ['aaa', 'bbb', 'ccc']) +-- ``` +-- This is equivalent to: > +-- :for [n, l] in [[5, 'aaa'], [6, 'bbb'], [7, 'ccc']] +-- : call setline(n, l) +-- :endfor +-- +-- < Note: The '[ and '] marks are not set. +-- +-- Can also be used as a |method|, the base is passed as the +-- second argument: +-- ```vim +-- GetText()->setline(lnum) +-- ``` +--- @param lnum number +--- @param text string +--- @return number +function vim.fn.setline(lnum, text) end + +-- Create or replace or add to the location list for window {nr}. +-- {nr} can be the window number or the |window-ID|. +-- When {nr} is zero the current window is used. +-- +-- For a location list window, the displayed location list is +-- modified. For an invalid window number {nr}, -1 is returned. +-- Otherwise, same as |setqflist()|. +-- Also see |location-list|. +-- +-- For {action} see |setqflist-action|. +-- +-- If the optional {what} dictionary argument is supplied, then +-- only the items listed in {what} are set. Refer to |setqflist()| +-- for the list of supported keys in {what}. +-- +-- Can also be used as a |method|, the base is passed as the +-- second argument: +-- ```vim +-- GetLoclist()->setloclist(winnr) +-- ``` +--- @param nr number +--- @param list any[] +--- @param action? any +--- @param what? any +--- @return number +function vim.fn.setloclist(nr, list, action, what) end + +-- Restores a list of matches saved by |getmatches()| for the +-- current window. Returns 0 if successful, otherwise -1. All +-- current matches are cleared before the list is restored. See +-- example for |getmatches()|. +-- If {win} is specified, use the window with this number or +-- window ID instead of the current window. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetMatches()->setmatches() +-- ``` +--- @param list any[] +--- @param win? window +--- @return number +function vim.fn.setmatches(list, win) end + +-- Set the position for String {expr}. Possible values: +-- . the cursor +-- 'x mark x +-- +-- {list} must be a |List| with four or five numbers: +-- [bufnum, lnum, col, off] +-- [bufnum, lnum, col, off, curswant] +-- +-- "bufnum" is the buffer number. Zero can be used for the +-- current buffer. When setting an uppercase mark "bufnum" is +-- used for the mark position. For other marks it specifies the +-- buffer to set the mark in. You can use the |bufnr()| function +-- to turn a file name into a buffer number. +-- For setting the cursor and the ' mark "bufnum" is ignored, +-- since these are associated with a window, not a buffer. +-- Does not change the jumplist. +-- +-- "lnum" and "col" are the position in the buffer. The first +-- column is 1. Use a zero "lnum" to delete a mark. If "col" is +-- smaller than 1 then 1 is used. To use the character count +-- instead of the byte count, use |setcharpos()|. +-- +-- The "off" number is only used when 'virtualedit' is set. Then +-- it is the offset in screen columns from the start of the +-- character. E.g., a position within a or after the last +-- character. +-- +-- The "curswant" number is only used when setting the cursor +-- position. It sets the preferred column for when moving the +-- cursor vertically. When the "curswant" number is missing the +-- preferred column is not set. When it is present and setting a +-- mark position it is not used. +-- +-- Note that for '< and '> changing the line number may result in +-- the marks to be effectively be swapped, so that '< is always +-- before '>. +-- +-- Returns 0 when the position could be set, -1 otherwise. +-- An error message is given if {expr} is invalid. +-- +-- Also see |setcharpos()|, |getpos()| and |getcurpos()|. +-- +-- This does not restore the preferred column for moving +-- vertically; if you set the cursor position with this, |j| and +-- |k| motions will jump to previous columns! Use |cursor()| to +-- also set the preferred column. Also see the "curswant" key in +-- |winrestview()|. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetPosition()->setpos('.') +-- ``` +--- @param list any[] +--- @return number +function vim.fn.setpos(expr, list) end + +-- Create or replace or add to the quickfix list. +-- +-- If the optional {what} dictionary argument is supplied, then +-- only the items listed in {what} are set. The first {list} +-- argument is ignored. See below for the supported items in +-- {what}. +-- +-- When {what} is not present, the items in {list} are used. Each +-- item must be a dictionary. Non-dictionary items in {list} are +-- ignored. Each dictionary item can contain the following +-- entries: +-- +-- bufnr buffer number; must be the number of a valid +-- buffer +-- filename name of a file; only used when "bufnr" is not +-- present or it is invalid. +-- module name of a module; if given it will be used in +-- quickfix error window instead of the filename. +-- lnum line number in the file +-- end_lnum end of lines, if the item spans multiple lines +-- pattern search pattern used to locate the error +-- col column number +-- vcol when non-zero: "col" is visual column +-- when zero: "col" is byte index +-- end_col end column, if the item spans multiple columns +-- nr error number +-- text description of the error +-- type single-character error type, 'E', 'W', etc. +-- valid recognized error message +-- +-- The "col", "vcol", "nr", "type" and "text" entries are +-- optional. Either "lnum" or "pattern" entry can be used to +-- locate a matching error line. +-- If the "filename" and "bufnr" entries are not present or +-- neither the "lnum" or "pattern" entries are present, then the +-- item will not be handled as an error line. +-- If both "pattern" and "lnum" are present then "pattern" will +-- be used. +-- If the "valid" entry is not supplied, then the valid flag is +-- set when "bufnr" is a valid buffer or "filename" exists. +-- If you supply an empty {list}, the quickfix list will be +-- cleared. +-- Note that the list is not exactly the same as what +-- |getqflist()| returns. +-- +-- {action} values: +-- 'a' The items from {list} are added to the existing +-- quickfix list. If there is no existing list, then a +-- new list is created. +-- +-- 'r' The items from the current quickfix list are replaced +-- with the items from {list}. This can also be used to +-- clear the list: +-- ```vim +-- :call setqflist([], 'r') +-- ``` +-- 'f' All the quickfix lists in the quickfix stack are +-- freed. +-- +-- If {action} is not present or is set to ' ', then a new list +-- is created. The new quickfix list is added after the current +-- quickfix list in the stack and all the following lists are +-- freed. To add a new quickfix list at the end of the stack, +-- set "nr" in {what} to "$". +-- +-- The following items can be specified in dictionary {what}: +-- context quickfix list context. See |quickfix-context| +-- efm errorformat to use when parsing text from +-- "lines". If this is not present, then the +-- 'errorformat' option value is used. +-- See |quickfix-parse| +-- id quickfix list identifier |quickfix-ID| +-- idx index of the current entry in the quickfix +-- list specified by "id" or "nr". If set to '$', +-- then the last entry in the list is set as the +-- current entry. See |quickfix-index| +-- items list of quickfix entries. Same as the {list} +-- argument. +-- lines use 'errorformat' to parse a list of lines and +-- add the resulting entries to the quickfix list +-- {nr} or {id}. Only a |List| value is supported. +-- See |quickfix-parse| +-- nr list number in the quickfix stack; zero +-- means the current quickfix list and "$" means +-- the last quickfix list. +-- quickfixtextfunc +-- function to get the text to display in the +-- quickfix window. The value can be the name of +-- a function or a funcref or a lambda. Refer to +-- |quickfix-window-function| for an explanation +-- of how to write the function and an example. +-- title quickfix list title text. See |quickfix-title| +-- Unsupported keys in {what} are ignored. +-- If the "nr" item is not present, then the current quickfix list +-- is modified. When creating a new quickfix list, "nr" can be +-- set to a value one greater than the quickfix stack size. +-- When modifying a quickfix list, to guarantee that the correct +-- list is modified, "id" should be used instead of "nr" to +-- specify the list. +-- +-- Examples (See also |setqflist-examples|): +-- ```vim +-- :call setqflist([], 'r', {'title': 'My search'}) +-- :call setqflist([], 'r', {'nr': 2, 'title': 'Errors'}) +-- :call setqflist([], 'a', {'id':qfid, 'lines':["F1:10:L10"]}) +-- ``` +-- Returns zero for success, -1 for failure. +-- +-- This function can be used to create a quickfix list +-- independent of the 'errorformat' setting. Use a command like +-- `:cc 1` to jump to the first position. +-- +-- Can also be used as a |method|, the base is passed as the +-- second argument: +-- ```vim +-- GetErrorlist()->setqflist() +-- ``` +--- @param list any[] +--- @param action? any +--- @param what? any +--- @return number +function vim.fn.setqflist(list, action, what) end + +-- Set the register {regname} to {value}. +-- If {regname} is "" or "@", the unnamed register '"' is used. +-- The {regname} argument is a string. +-- +-- {value} may be any value returned by |getreg()| or +-- |getreginfo()|, including a |List| or |Dict|. +-- If {options} contains "a" or {regname} is upper case, +-- then the value is appended. +-- +-- {options} can also contain a register type specification: +-- "c" or "v" |charwise| mode +-- "l" or "V" |linewise| mode +-- "b" or "" |blockwise-visual| mode +-- If a number immediately follows "b" or "" then this is +-- used as the width of the selection - if it is not specified +-- then the width of the block is set to the number of characters +-- in the longest line (counting a as 1 character). +-- If {options} contains "u" or '"', then the unnamed register is +-- set to point to register {regname}. +-- +-- If {options} contains no register settings, then the default +-- is to use character mode unless {value} ends in a for +-- string {value} and linewise mode for list {value}. Blockwise +-- mode is never selected automatically. +-- Returns zero for success, non-zero for failure. +-- +-- +-- Note: you may not use |List| containing more than one item to +-- set search and expression registers. Lists containing no +-- items act like empty strings. +-- +-- Examples: +-- ```vim +-- :call setreg(v:register, @*) +-- :call setreg('*', @%, 'ac') +-- :call setreg('a', "1\n2\n3", 'b5') +-- :call setreg('"', { 'points_to': 'a'}) +-- +-- ``` +-- This example shows using the functions to save and restore a +-- register: +-- ```vim +-- :let var_a = getreginfo() +-- :call setreg('a', var_a) +-- ``` +-- or: > +-- :let var_a = getreg('a', 1, 1) +-- :let var_amode = getregtype('a') +-- .... +-- :call setreg('a', var_a, var_amode) +-- < Note: you may not reliably restore register value +-- without using the third argument to |getreg()| as without it +-- newlines are represented as newlines AND Nul bytes are +-- represented as newlines as well, see |NL-used-for-Nul|. +-- +-- You can also change the type of a register by appending +-- nothing: +-- ```vim +-- :call setreg('a', '', 'al') +-- +-- ``` +-- Can also be used as a |method|, the base is passed as the +-- second argument: +-- ```vim +-- GetText()->setreg('a') +-- ``` +--- @param options? table +--- @return number +function vim.fn.setreg(regname, value, options) end + +-- Set tab-local variable {varname} to {val} in tab page {tabnr}. +-- |t:var| +-- The {varname} argument is a string. +-- Note that the variable name without "t:" must be used. +-- Tabs are numbered starting with one. +-- This function is not available in the |sandbox|. +-- +-- Can also be used as a |method|, the base is passed as the +-- third argument: +-- ```vim +-- GetValue()->settabvar(tab, name) +-- ``` +--- @param tabnr number +--- @return boolean +function vim.fn.settabvar(tabnr, varname, val) end + +-- Set option or local variable {varname} in window {winnr} to +-- {val}. +-- Tabs are numbered starting with one. For the current tabpage +-- use |setwinvar()|. +-- {winnr} can be the window number or the |window-ID|. +-- When {winnr} is zero the current window is used. +-- This also works for a global or local buffer option, but it +-- doesn't work for a global or local buffer variable. +-- For a local buffer option the global value is unchanged. +-- Note that the variable name without "w:" must be used. +-- Examples: +-- ```vim +-- :call settabwinvar(1, 1, "&list", 0) +-- :call settabwinvar(3, 2, "myvar", "foobar") +-- ``` +-- This function is not available in the |sandbox|. +-- +-- Can also be used as a |method|, the base is passed as the +-- fourth argument: +-- ```vim +-- GetValue()->settabwinvar(tab, winnr, name) +-- ``` +--- @param tabnr number +--- @param winnr window +--- @return boolean +function vim.fn.settabwinvar(tabnr, winnr, varname, val) end + +-- Modify the tag stack of the window {nr} using {dict}. +-- {nr} can be the window number or the |window-ID|. +-- +-- For a list of supported items in {dict}, refer to +-- |gettagstack()|. "curidx" takes effect before changing the tag +-- stack. +-- +-- How the tag stack is modified depends on the {action} +-- argument: +-- - If {action} is not present or is set to 'r', then the tag +-- stack is replaced. +-- - If {action} is set to 'a', then new entries from {dict} are +-- pushed (added) onto the tag stack. +-- - If {action} is set to 't', then all the entries from the +-- current entry in the tag stack or "curidx" in {dict} are +-- removed and then new entries are pushed to the stack. +-- +-- The current index is set to one after the length of the tag +-- stack after the modification. +-- +-- Returns zero for success, -1 for failure. +-- +-- Examples (for more examples see |tagstack-examples|): +-- Empty the tag stack of window 3: +-- ```vim +-- call settagstack(3, {'items' : []}) +-- +-- ``` +-- Save and restore the tag stack: > +-- let stack = gettagstack(1003) +-- " do something else +-- call settagstack(1003, stack) +-- unlet stack +-- < +-- Can also be used as a |method|, the base is passed as the +-- second argument: +-- ```vim +-- GetStack()->settagstack(winnr) +-- ``` +--- @param nr number +--- @param dict table +--- @param action? any +--- @return number +function vim.fn.settagstack(nr, dict, action) end + +-- Like |settabwinvar()| for the current tab page. +-- Examples: +-- ```vim +-- :call setwinvar(1, "&list", 0) +-- :call setwinvar(2, "myvar", "foobar") +-- +-- ``` +-- Can also be used as a |method|, the base is passed as the +-- third argument: +-- ```vim +-- GetValue()->setwinvar(winnr, name) +-- ``` +--- @param nr number +--- @return boolean +function vim.fn.setwinvar(nr, varname, val) end + +-- Returns a String with 64 hex characters, which is the SHA256 +-- checksum of {string}. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetText()->sha256() +-- ``` +--- @param string string +--- @return string +function vim.fn.sha256(string) end + +-- Escape {string} for use as a shell command argument. +-- +-- On Windows when 'shellslash' is not set, encloses {string} in +-- double-quotes and doubles all double-quotes within {string}. +-- Otherwise encloses {string} in single-quotes and replaces all +-- "'" with "'\''". +-- +-- If {special} is a |non-zero-arg|: +-- - Special items such as "!", "%", "#" and "" will be +-- preceded by a backslash. The backslash will be removed again +-- by the |:!| command. +-- - The character is escaped. +-- +-- If 'shell' contains "csh" in the tail: +-- - The "!" character will be escaped. This is because csh and +-- tcsh use "!" for history replacement even in single-quotes. +-- - The character is escaped (twice if {special} is +-- a |non-zero-arg|). +-- +-- If 'shell' contains "fish" in the tail, the "\" character will +-- be escaped because in fish it is used as an escape character +-- inside single quotes. +-- +-- Example of use with a |:!| command: +-- ```vim +-- :exe '!dir ' .. shellescape(expand(''), 1) +-- ``` +-- This results in a directory listing for the file under the +-- cursor. Example of use with |system()|: +-- ```vim +-- :call system("chmod +w -- " .. shellescape(expand("%"))) +-- ``` +-- See also |::S|. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetCommand()->shellescape() +-- ``` +--- @param string string +--- @param special? any +--- @return string +function vim.fn.shellescape(string, special) end + +-- Returns the effective value of 'shiftwidth'. This is the +-- 'shiftwidth' value unless it is zero, in which case it is the +-- 'tabstop' value. To be backwards compatible in indent +-- plugins, use this: +-- ```vim +-- if exists('*shiftwidth') +-- func s:sw() +-- return shiftwidth() +-- endfunc +-- else +-- func s:sw() +-- return &sw +-- endfunc +-- endif +-- ``` +-- And then use s:sw() instead of &sw. +-- +-- When there is one argument {col} this is used as column number +-- for which to return the 'shiftwidth' value. This matters for the +-- 'vartabstop' feature. If no {col} argument is given, column 1 +-- will be assumed. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetColumn()->shiftwidth() +-- ``` +--- @param col? number +--- @return number +function vim.fn.shiftwidth(col) end + +-- List define or update a list of signs +--- @param list any[] +--- @return any[] +--- @overload fun(name:string, dict?:table) +function vim.fn.sign_define(list) end + +-- List get a list of defined signs +--- @param name? any +--- @return any[] +function vim.fn.sign_getdefined(name) end + +-- List get a list of placed signs +--- @param buf? buffer +--- @param dict? table +--- @return any[] +function vim.fn.sign_getplaced(buf, dict) end + +-- Number jump to a sign +--- @param buf buffer +--- @return number +function vim.fn.sign_jump(id, group, buf) end + +-- Number place a sign +--- @param buf buffer +--- @param dict? table +--- @return number +function vim.fn.sign_place(id, group, name, buf, dict) end + +-- List place a list of signs +--- @param list any[] +--- @return any[] +function vim.fn.sign_placelist(list) end + +-- List undefine a list of signs +--- @param list any[] +--- @return any[] +function vim.fn.sign_undefine(list) end + +-- Number unplace a sign +--- @param dict? table +--- @return number +function vim.fn.sign_unplace(group, dict) end + +-- List unplace a list of signs +--- @param list any[] +--- @return any[] +function vim.fn.sign_unplacelist(list) end + +-- Simplify the file name as much as possible without changing +-- the meaning. Shortcuts (on MS-Windows) or symbolic links (on +-- Unix) are not resolved. If the first path component in +-- {filename} designates the current directory, this will be +-- valid for the result as well. A trailing path separator is +-- not removed either. On Unix "//path" is unchanged, but +-- "///path" is simplified to "/path" (this follows the Posix +-- standard). +-- Example: +-- ```vim +-- simplify("./dir/.././/file/") == "./file/" +-- ``` +-- Note: The combination "dir/.." is only removed if "dir" is +-- a searchable directory or does not exist. On Unix, it is also +-- removed when "dir" is a symbolic link within the same +-- directory. In order to resolve all the involved symbolic +-- links before simplifying the path name, use |resolve()|. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetName()->simplify() +-- ``` +--- @return string +function vim.fn.simplify(filename) end + +-- Return the sine of {expr}, measured in radians, as a |Float|. +-- {expr} must evaluate to a |Float| or a |Number|. +-- Returns 0.0 if {expr} is not a |Float| or a |Number|. +-- Examples: +-- ```vim +-- :echo sin(100) +-- ``` +-- -0.506366 > +-- :echo sin(-4.01) +-- < 0.763301 +-- +-- Can also be used as a |method|: +-- ```vim +-- Compute()->sin() +-- ``` +--- @return float +function vim.fn.sin(expr) end + +-- Return the hyperbolic sine of {expr} as a |Float| in the range +-- [-inf, inf]. +-- {expr} must evaluate to a |Float| or a |Number|. +-- Returns 0.0 if {expr} is not a |Float| or a |Number|. +-- Examples: +-- ```vim +-- :echo sinh(0.5) +-- ``` +-- 0.521095 > +-- :echo sinh(-0.9) +-- < -1.026517 +-- +-- Can also be used as a |method|: +-- ```vim +-- Compute()->sinh() +-- ``` +--- @return float +function vim.fn.sinh(expr) end + +-- Similar to using a |slice| "expr[start : end]", but "end" is +-- used exclusive. And for a string the indexes are used as +-- character indexes instead of byte indexes. +-- Also, composing characters are not counted. +-- When {end} is omitted the slice continues to the last item. +-- When {end} is -1 the last item is omitted. +-- Returns an empty value if {start} or {end} are invalid. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetList()->slice(offset) +-- ``` +--- @param start number +--- @param end_? number +--- @return string +function vim.fn.slice(expr, start, end_) end + +-- Connect a socket to an address. If {mode} is "pipe" then +-- {address} should be the path of a local domain socket (on +-- unix) or named pipe (on Windows). If {mode} is "tcp" then +-- {address} should be of the form "host:port" where the host +-- should be an ip adderess or host name, and port the port +-- number. +-- +-- For "pipe" mode, see |luv-pipe-handle|. For "tcp" mode, see +-- |luv-tcp-handle|. +-- +-- Returns a |channel| ID. Close the socket with |chanclose()|. +-- Use |chansend()| to send data over a bytes socket, and +-- |rpcrequest()| and |rpcnotify()| to communicate with a RPC +-- socket. +-- +-- {opts} is an optional dictionary with these keys: +-- |on_data| : callback invoked when data was read from socket +-- data_buffered : read socket data in |channel-buffered| mode. +-- rpc : If set, |msgpack-rpc| will be used to communicate +-- over the socket. +-- Returns: +-- - The channel ID on success (greater than zero) +-- - 0 on invalid arguments or connection failure. +--- @param opts? table +--- @return number +function vim.fn.sockconnect(mode, address, opts) end + +-- Sort the items in {list} in-place. Returns {list}. +-- +-- If you want a list to remain unmodified make a copy first: +-- ```vim +-- :let sortedlist = sort(copy(mylist)) +-- +-- ``` +-- When {func} is omitted, is empty or zero, then sort() uses the +-- string representation of each item to sort on. Numbers sort +-- after Strings, |Lists| after Numbers. For sorting text in the +-- current buffer use |:sort|. +-- +-- When {func} is given and it is '1' or 'i' then case is +-- ignored. +-- +-- When {func} is given and it is 'l' then the current collation +-- locale is used for ordering. Implementation details: strcoll() +-- is used to compare strings. See |:language| check or set the +-- collation locale. |v:collate| can also be used to check the +-- current locale. Sorting using the locale typically ignores +-- case. Example: +-- ```vim +-- " ö is sorted similarly to o with English locale. +-- :language collate en_US.UTF8 +-- :echo sort(['n', 'o', 'O', 'ö', 'p', 'z'], 'l') +-- ``` +-- ['n', 'o', 'O', 'ö', 'p', 'z'] ~ +-- ```vim +-- " ö is sorted after z with Swedish locale. +-- :language collate sv_SE.UTF8 +-- :echo sort(['n', 'o', 'O', 'ö', 'p', 'z'], 'l') +-- ``` +-- ['n', 'o', 'O', 'p', 'z', 'ö'] ~ +-- This does not work properly on Mac. +-- +-- When {func} is given and it is 'n' then all items will be +-- sorted numerical (Implementation detail: this uses the +-- strtod() function to parse numbers, Strings, Lists, Dicts and +-- Funcrefs will be considered as being 0). +-- +-- When {func} is given and it is 'N' then all items will be +-- sorted numerical. This is like 'n' but a string containing +-- digits will be used as the number they represent. +-- +-- When {func} is given and it is 'f' then all items will be +-- sorted numerical. All values must be a Number or a Float. +-- +-- When {func} is a |Funcref| or a function name, this function +-- is called to compare items. The function is invoked with two +-- items as argument and must return zero if they are equal, 1 or +-- bigger if the first one sorts after the second one, -1 or +-- smaller if the first one sorts before the second one. +-- +-- {dict} is for functions with the "dict" attribute. It will be +-- used to set the local variable "self". |Dictionary-function| +-- +-- The sort is stable, items which compare equal (as number or as +-- string) will keep their relative position. E.g., when sorting +-- on numbers, text strings will sort next to each other, in the +-- same order as they were originally. +-- +-- Can also be used as a |method|: +-- ```vim +-- mylist->sort() +-- +-- ``` +-- Also see |uniq()|. +-- +-- Example: +-- ```vim +-- func MyCompare(i1, i2) +-- return a:i1 == a:i2 ? 0 : a:i1 > a:i2 ? 1 : -1 +-- endfunc +-- eval mylist->sort("MyCompare") +-- ``` +-- A shorter compare version for this specific simple case, which +-- ignores overflow: +-- ```vim +-- func MyCompare(i1, i2) +-- return a:i1 - a:i2 +-- endfunc +-- ``` +-- For a simple expression you can use a lambda: > +-- eval mylist->sort({i1, i2 -> i1 - i2}) +-- < +--- @param list any[] +--- @param func? fun() +--- @param dict? table +--- @return any[] +function vim.fn.sort(list, func, dict) end + +-- Return the sound-folded equivalent of {word}. Uses the first +-- language in 'spelllang' for the current window that supports +-- soundfolding. 'spell' must be set. When no sound folding is +-- possible the {word} is returned unmodified. +-- This can be used for making spelling suggestions. Note that +-- the method can be quite slow. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetWord()->soundfold() +-- ``` +--- @return string +function vim.fn.soundfold(word) end + +-- Without argument: The result is the badly spelled word under +-- or after the cursor. The cursor is moved to the start of the +-- bad word. When no bad word is found in the cursor line the +-- result is an empty string and the cursor doesn't move. +-- +-- With argument: The result is the first word in {sentence} that +-- is badly spelled. If there are no spelling mistakes the +-- result is an empty string. +-- +-- The return value is a list with two items: +-- - The badly spelled word or an empty string. +-- - The type of the spelling error: +-- "bad" spelling mistake +-- "rare" rare word +-- "local" word only valid in another region +-- "caps" word should start with Capital +-- Example: +-- ```vim +-- echo spellbadword("the quik brown fox") +-- ``` +-- ['quik', 'bad'] ~ +-- +-- The spelling information for the current window and the value +-- of 'spelllang' are used. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetText()->spellbadword() +-- ``` +--- @param sentence? any +--- @return string +function vim.fn.spellbadword(sentence) end + +-- Return a |List| with spelling suggestions to replace {word}. +-- When {max} is given up to this number of suggestions are +-- returned. Otherwise up to 25 suggestions are returned. +-- +-- When the {capital} argument is given and it's non-zero only +-- suggestions with a leading capital will be given. Use this +-- after a match with 'spellcapcheck'. +-- +-- {word} can be a badly spelled word followed by other text. +-- This allows for joining two words that were split. The +-- suggestions also include the following text, thus you can +-- replace a line. +-- +-- {word} may also be a good word. Similar words will then be +-- returned. {word} itself is not included in the suggestions, +-- although it may appear capitalized. +-- +-- The spelling information for the current window is used. The +-- values of 'spelllang' and 'spellsuggest' are used. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetWord()->spellsuggest() +-- ``` +--- @param max? any +--- @param capital? any +--- @return any[] +function vim.fn.spellsuggest(word, max, capital) end + +-- Make a |List| out of {string}. When {pattern} is omitted or +-- empty each white-separated sequence of characters becomes an +-- item. +-- Otherwise the string is split where {pattern} matches, +-- removing the matched characters. 'ignorecase' is not used +-- here, add \c to ignore case. |/\c| +-- When the first or last item is empty it is omitted, unless the +-- {keepempty} argument is given and it's non-zero. +-- Other empty items are kept when {pattern} matches at least one +-- character or when {keepempty} is non-zero. +-- Example: +-- ```vim +-- :let words = split(getline('.'), '\W\+') +-- ``` +-- To split a string in individual characters: > +-- :for c in split(mystring, '\zs') +-- < If you want to keep the separator you can also use '\zs' at +-- the end of the pattern: +-- ```vim +-- :echo split('abc:def:ghi', ':\zs') +-- ``` +-- ['abc:', 'def:', 'ghi'] ~ +-- Splitting a table where the first element can be empty: +-- ```vim +-- :let items = split(line, ':', 1) +-- ``` +-- The opposite function is |join()|. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetString()->split() +-- ``` +--- @param string string +--- @param pattern? any +--- @param keepempty? any +--- @return any[] +function vim.fn.split(string, pattern, keepempty) end + +-- Return the non-negative square root of Float {expr} as a +-- |Float|. +-- {expr} must evaluate to a |Float| or a |Number|. When {expr} +-- is negative the result is NaN (Not a Number). Returns 0.0 if +-- {expr} is not a |Float| or a |Number|. +-- Examples: +-- ```vim +-- :echo sqrt(100) +-- ``` +-- 10.0 > +-- :echo sqrt(-4.01) +-- < str2float("nan") +-- NaN may be different, it depends on system libraries. +-- +-- Can also be used as a |method|: +-- ```vim +-- Compute()->sqrt() +-- ``` +--- @return float +function vim.fn.sqrt(expr) end + +-- Initialize seed used by |rand()|: +-- - If {expr} is not given, seed values are initialized by +-- reading from /dev/urandom, if possible, or using time(NULL) +-- a.k.a. epoch time otherwise; this only has second accuracy. +-- - If {expr} is given it must be a Number. It is used to +-- initialize the seed values. This is useful for testing or +-- when a predictable sequence is intended. +-- +-- Examples: +-- ```vim +-- :let seed = srand() +-- :let seed = srand(userinput) +-- :echo rand(seed) +-- ``` +-- Can also be used as a |method|: +-- ```vim +-- userinput->srand() +-- ``` +--- @param expr? any +--- @return any[] +function vim.fn.srand(expr) end + +-- With |--headless| this opens stdin and stdout as a |channel|. +-- May be called only once. See |channel-stdio|. stderr is not +-- handled by this function, see |v:stderr|. +-- +-- Close the stdio handles with |chanclose()|. Use |chansend()| +-- to send data to stdout, and |rpcrequest()| and |rpcnotify()| +-- to communicate over RPC. +-- +-- {opts} is a dictionary with these keys: +-- |on_stdin| : callback invoked when stdin is written to. +-- on_print : callback invoked when Nvim needs to print a +-- message, with the message (whose type is string) +-- as sole argument. +-- stdin_buffered : read stdin in |channel-buffered| mode. +-- rpc : If set, |msgpack-rpc| will be used to communicate +-- over stdio +-- Returns: +-- - |channel-id| on success (value is always 1) +-- - 0 on invalid arguments +--- @param opts table +--- @return number +function vim.fn.stdioopen(opts) end + +-- Returns |standard-path| locations of various default files and +-- directories. +-- +-- {what} Type Description ~ +-- cache String Cache directory: arbitrary temporary +-- storage for plugins, etc. +-- config String User configuration directory. |init.vim| +-- is stored here. +-- config_dirs List Other configuration directories. +-- data String User data directory. +-- data_dirs List Other data directories. +-- log String Logs directory (for use by plugins too). +-- run String Run directory: temporary, local storage +-- for sockets, named pipes, etc. +-- state String Session state directory: storage for file +-- drafts, swap, undo, |shada|. +-- +-- Example: +-- ```vim +-- :echo stdpath("config") +-- ``` +--- @return string +function vim.fn.stdpath(what) end + +-- Convert String {string} to a Float. This mostly works the +-- same as when using a floating point number in an expression, +-- see |floating-point-format|. But it's a bit more permissive. +-- E.g., "1e40" is accepted, while in an expression you need to +-- write "1.0e40". The hexadecimal form "0x123" is also +-- accepted, but not others, like binary or octal. +-- When {quoted} is present and non-zero then embedded single +-- quotes before the dot are ignored, thus "1'000.0" is a +-- thousand. +-- Text after the number is silently ignored. +-- The decimal point is always '.', no matter what the locale is +-- set to. A comma ends the number: "12,345.67" is converted to +-- 12.0. You can strip out thousands separators with +-- |substitute()|: +-- ```vim +-- let f = str2float(substitute(text, ',', '', 'g')) +-- ``` +-- Returns 0.0 if the conversion fails. +-- +-- Can also be used as a |method|: +-- ```vim +-- let f = text->substitute(',', '', 'g')->str2float() +-- ``` +--- @param string string +--- @param quoted? any +--- @return float +function vim.fn.str2float(string, quoted) end + +-- Return a list containing the number values which represent +-- each character in String {string}. Examples: +-- ```vim +-- str2list(" ") returns [32] +-- str2list("ABC") returns [65, 66, 67] +-- ``` +-- |list2str()| does the opposite. +-- +-- UTF-8 encoding is always used, {utf8} option has no effect, +-- and exists only for backwards-compatibility. +-- With UTF-8 composing characters are handled properly: +-- ```vim +-- str2list("á") returns [97, 769] +-- +-- ``` +-- Can also be used as a |method|: > +-- GetString()->str2list() +--- @param string string +--- @param utf8? any +--- @return any[] +function vim.fn.str2list(string, utf8) end + +-- Convert string {string} to a number. +-- {base} is the conversion base, it can be 2, 8, 10 or 16. +-- When {quoted} is present and non-zero then embedded single +-- quotes are ignored, thus "1'000'000" is a million. +-- +-- When {base} is omitted base 10 is used. This also means that +-- a leading zero doesn't cause octal conversion to be used, as +-- with the default String to Number conversion. Example: +-- ```vim +-- let nr = str2nr('0123') +-- ``` +-- When {base} is 16 a leading "0x" or "0X" is ignored. With a +-- different base the result will be zero. Similarly, when +-- {base} is 8 a leading "0", "0o" or "0O" is ignored, and when +-- {base} is 2 a leading "0b" or "0B" is ignored. +-- Text after the number is silently ignored. +-- +-- Returns 0 if {string} is empty or on error. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetText()->str2nr() +-- ``` +--- @param string string +--- @param base? any +--- @return number +function vim.fn.str2nr(string, base) end + +-- The result is a Number, which is the number of characters +-- in String {string}. Composing characters are ignored. +-- |strchars()| can count the number of characters, counting +-- composing characters separately. +-- +-- Returns 0 if {string} is empty or on error. +-- +-- Also see |strlen()|, |strdisplaywidth()| and |strwidth()|. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetText()->strcharlen() +-- ``` +--- @param string string +--- @return number +function vim.fn.strcharlen(string) end + +-- Like |strpart()| but using character index and length instead +-- of byte index and length. +-- When {skipcc} is omitted or zero, composing characters are +-- counted separately. +-- When {skipcc} set to 1, Composing characters are ignored, +-- similar to |slice()|. +-- When a character index is used where a character does not +-- exist it is omitted and counted as one character. For +-- example: +-- ```vim +-- strcharpart('abc', -1, 2) +-- ``` +-- results in 'a'. +-- +-- Returns an empty string on error. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetText()->strcharpart(5) +-- ``` +--- @param start number +--- @param len? any +--- @param skipcc? any +--- @return string +function vim.fn.strcharpart(src, start, len, skipcc) end + +-- The result is a Number, which is the number of characters +-- in String {string}. +-- When {skipcc} is omitted or zero, composing characters are +-- counted separately. +-- When {skipcc} set to 1, Composing characters are ignored. +-- |strcharlen()| always does this. +-- +-- Returns zero on error. +-- +-- Also see |strlen()|, |strdisplaywidth()| and |strwidth()|. +-- +-- {skipcc} is only available after 7.4.755. For backward +-- compatibility, you can define a wrapper function: +-- ```vim +-- if has("patch-7.4.755") +-- function s:strchars(str, skipcc) +-- return strchars(a:str, a:skipcc) +-- endfunction +-- else +-- function s:strchars(str, skipcc) +-- if a:skipcc +-- return strlen(substitute(a:str, ".", "x", "g")) +-- else +-- return strchars(a:str) +-- endif +-- endfunction +-- endif +-- ``` +-- Can also be used as a |method|: +-- ```vim +-- GetText()->strchars() +-- ``` +--- @param string string +--- @param skipcc? any +--- @return number +function vim.fn.strchars(string, skipcc) end + +-- The result is a Number, which is the number of display cells +-- String {string} occupies on the screen when it starts at {col} +-- (first column is zero). When {col} is omitted zero is used. +-- Otherwise it is the screen column where to start. This +-- matters for Tab characters. +-- The option settings of the current window are used. This +-- matters for anything that's displayed differently, such as +-- 'tabstop' and 'display'. +-- When {string} contains characters with East Asian Width Class +-- Ambiguous, this function's return value depends on 'ambiwidth'. +-- Returns zero on error. +-- Also see |strlen()|, |strwidth()| and |strchars()|. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetText()->strdisplaywidth() +-- ``` +--- @param string string +--- @param col? number +--- @return number +function vim.fn.strdisplaywidth(string, col) end + +-- The result is a String, which is a formatted date and time, as +-- specified by the {format} string. The given {time} is used, +-- or the current time if no time is given. The accepted +-- {format} depends on your system, thus this is not portable! +-- See the manual page of the C function strftime() for the +-- format. The maximum length of the result is 80 characters. +-- See also |localtime()|, |getftime()| and |strptime()|. +-- The language can be changed with the |:language| command. +-- Examples: +-- ```vim +-- :echo strftime("%c") Sun Apr 27 11:49:23 1997 +-- :echo strftime("%Y %b %d %X") 1997 Apr 27 11:53:25 +-- :echo strftime("%y%m%d %T") 970427 11:53:55 +-- :echo strftime("%H:%M") 11:55 +-- :echo strftime("%c", getftime("file.c")) +-- Show mod time of file.c. +-- +-- ``` +-- Can also be used as a |method|: > +-- GetFormat()->strftime() +--- @param time? any +--- @return string +function vim.fn.strftime(format, time) end + +-- Get a Number corresponding to the character at {index} in +-- {str}. This uses a zero-based character index, not a byte +-- index. Composing characters are considered separate +-- characters here. Use |nr2char()| to convert the Number to a +-- String. +-- Returns -1 if {index} is invalid. +-- Also see |strcharpart()| and |strchars()|. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetText()->strgetchar(5) +-- ``` +--- @param str string +--- @param index number +--- @return number +function vim.fn.strgetchar(str, index) end + +-- The result is a Number, which gives the byte index in +-- {haystack} of the first occurrence of the String {needle}. +-- If {start} is specified, the search starts at index {start}. +-- This can be used to find a second match: +-- ```vim +-- :let colon1 = stridx(line, ":") +-- :let colon2 = stridx(line, ":", colon1 + 1) +-- ``` +-- The search is done case-sensitive. +-- For pattern searches use |match()|. +-- -1 is returned if the {needle} does not occur in {haystack}. +-- See also |strridx()|. +-- Examples: +-- ```vim +-- :echo stridx("An Example", "Example") 3 +-- :echo stridx("Starting point", "Start") 0 +-- :echo stridx("Starting point", "start") -1 +-- ``` +-- stridx() works similar to the C function strstr(). When used +-- with a single character it works similar to strchr(). +-- +-- Can also be used as a |method|: +-- ```vim +-- GetHaystack()->stridx(needle) +-- ``` +--- @param start? number +--- @return number +function vim.fn.stridx(haystack, needle, start) end + +-- Return {expr} converted to a String. If {expr} is a Number, +-- Float, String, Blob or a composition of them, then the result +-- can be parsed back with |eval()|. +-- {expr} type result ~ +-- String 'string' +-- Number 123 +-- Float 123.123456 or 1.123456e8 or +-- `str2float('inf')` +-- Funcref `function('name')` +-- Blob 0z00112233.44556677.8899 +-- List [item, item] +-- Dictionary {key: value, key: value} +-- Note that in String values the ' character is doubled. +-- Also see |strtrans()|. +-- Note 2: Output format is mostly compatible with YAML, except +-- for infinite and NaN floating-point values representations +-- which use |str2float()|. Strings are also dumped literally, +-- only single quote is escaped, which does not allow using YAML +-- for parsing back binary strings. |eval()| should always work for +-- strings and floats though and this is the only official +-- method, use |msgpackdump()| or |json_encode()| if you need to +-- share data with other application. +-- +-- Can also be used as a |method|: +-- ```vim +-- mylist->string() +-- ``` +--- @return string +function vim.fn.string(expr) end + +-- The result is a Number, which is the length of the String +-- {string} in bytes. +-- If the argument is a Number it is first converted to a String. +-- For other types an error is given and zero is returned. +-- If you want to count the number of multibyte characters use +-- |strchars()|. +-- Also see |len()|, |strdisplaywidth()| and |strwidth()|. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetString()->strlen() +-- ``` +--- @param string string +--- @return number +function vim.fn.strlen(string) end + +-- The result is a String, which is part of {src}, starting from +-- byte {start}, with the byte length {len}. +-- When {chars} is present and TRUE then {len} is the number of +-- characters positions (composing characters are not counted +-- separately, thus "1" means one base character and any +-- following composing characters). +-- To count {start} as characters instead of bytes use +-- |strcharpart()|. +-- +-- When bytes are selected which do not exist, this doesn't +-- result in an error, the bytes are simply omitted. +-- If {len} is missing, the copy continues from {start} till the +-- end of the {src}. +-- ```vim +-- strpart("abcdefg", 3, 2) == "de" +-- strpart("abcdefg", -2, 4) == "ab" +-- strpart("abcdefg", 5, 4) == "fg" +-- strpart("abcdefg", 3) == "defg" +-- +-- ``` +-- Note: To get the first character, {start} must be 0. For +-- example, to get the character under the cursor: +-- ```vim +-- strpart(getline("."), col(".") - 1, 1, v:true) +-- ``` +-- Returns an empty string on error. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetText()->strpart(5) +-- ``` +--- @param start number +--- @param len? any +--- @param chars? any +--- @return string +function vim.fn.strpart(src, start, len, chars) end + +-- The result is a Number, which is a unix timestamp representing +-- the date and time in {timestring}, which is expected to match +-- the format specified in {format}. +-- +-- The accepted {format} depends on your system, thus this is not +-- portable! See the manual page of the C function strptime() +-- for the format. Especially avoid "%c". The value of $TZ also +-- matters. +-- +-- If the {timestring} cannot be parsed with {format} zero is +-- returned. If you do not know the format of {timestring} you +-- can try different {format} values until you get a non-zero +-- result. +-- +-- See also |strftime()|. +-- Examples: +-- ```vim +-- :echo strptime("%Y %b %d %X", "1997 Apr 27 11:49:23") +-- ``` +-- 862156163 > +-- :echo strftime("%c", strptime("%y%m%d %T", "970427 11:53:55")) +-- < Sun Apr 27 11:53:55 1997 +-- ```vim +-- :echo strftime("%c", strptime("%Y%m%d%H%M%S", "19970427115355") + 3600) +-- ``` +-- Sun Apr 27 12:53:55 1997 +-- +-- Can also be used as a |method|: +-- ```vim +-- GetFormat()->strptime(timestring) +-- ``` +--- @return number +function vim.fn.strptime(format, timestring) end + +-- The result is a Number, which gives the byte index in +-- {haystack} of the last occurrence of the String {needle}. +-- When {start} is specified, matches beyond this index are +-- ignored. This can be used to find a match before a previous +-- match: +-- ```vim +-- :let lastcomma = strridx(line, ",") +-- :let comma2 = strridx(line, ",", lastcomma - 1) +-- ``` +-- The search is done case-sensitive. +-- For pattern searches use |match()|. +-- -1 is returned if the {needle} does not occur in {haystack}. +-- If the {needle} is empty the length of {haystack} is returned. +-- See also |stridx()|. Examples: +-- ```vim +-- :echo strridx("an angry armadillo", "an") 3 +-- ``` +-- When used with a single character it works similar to the C +-- function strrchr(). +-- +-- Can also be used as a |method|: +-- ```vim +-- GetHaystack()->strridx(needle) +-- ``` +--- @param start? number +--- @return number +function vim.fn.strridx(haystack, needle, start) end + +-- The result is a String, which is {string} with all unprintable +-- characters translated into printable characters |'isprint'|. +-- Like they are shown in a window. Example: +-- ```vim +-- echo strtrans(@a) +-- ``` +-- This displays a newline in register a as "^@" instead of +-- starting a new line. +-- +-- Returns an empty string on error. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetString()->strtrans() +-- ``` +--- @param string string +--- @return string +function vim.fn.strtrans(string) end + +-- The result is a Number, which is the number of UTF-16 code +-- units in String {string} (after converting it to UTF-16). +-- +-- When {countcc} is TRUE, composing characters are counted +-- separately. +-- When {countcc} is omitted or FALSE, composing characters are +-- ignored. +-- +-- Returns zero on error. +-- +-- Also see |strlen()| and |strcharlen()|. +-- Examples: +-- ```vim +-- echo strutf16len('a') returns 1 +-- echo strutf16len('©') returns 1 +-- echo strutf16len('😊') returns 2 +-- echo strutf16len('ą́') returns 1 +-- echo strutf16len('ą́', v:true) returns 3 +-- +-- Can also be used as a |method|: > +-- GetText()->strutf16len() +-- ``` +--- @param string string +--- @param countcc? any +--- @return number +function vim.fn.strutf16len(string, countcc) end + +-- The result is a Number, which is the number of display cells +-- String {string} occupies. A Tab character is counted as one +-- cell, alternatively use |strdisplaywidth()|. +-- When {string} contains characters with East Asian Width Class +-- Ambiguous, this function's return value depends on 'ambiwidth'. +-- Returns zero on error. +-- Also see |strlen()|, |strdisplaywidth()| and |strchars()|. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetString()->strwidth() +-- ``` +--- @param string string +--- @return number +function vim.fn.strwidth(string) end + +-- Only for an expression in a |:substitute| command or +-- substitute() function. +-- Returns the {nr}th submatch of the matched text. When {nr} +-- is 0 the whole matched text is returned. +-- Note that a NL in the string can stand for a line break of a +-- multi-line match or a NUL character in the text. +-- Also see |sub-replace-expression|. +-- +-- If {list} is present and non-zero then submatch() returns +-- a list of strings, similar to |getline()| with two arguments. +-- NL characters in the text represent NUL characters in the +-- text. +-- Only returns more than one item for |:substitute|, inside +-- |substitute()| this list will always contain one or zero +-- items, since there are no real line breaks. +-- +-- When substitute() is used recursively only the submatches in +-- the current (deepest) call can be obtained. +-- +-- Returns an empty string or list on error. +-- +-- Examples: +-- ```vim +-- :s/\d\+/\=submatch(0) + 1/ +-- :echo substitute(text, '\d\+', '\=submatch(0) + 1', '') +-- ``` +-- This finds the first number in the line and adds one to it. +-- A line break is included as a newline character. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetNr()->submatch() +-- ``` +--- @param nr number +--- @param list? any[] +--- @return string +function vim.fn.submatch(nr, list) end + +-- The result is a String, which is a copy of {string}, in which +-- the first match of {pat} is replaced with {sub}. +-- When {flags} is "g", all matches of {pat} in {string} are +-- replaced. Otherwise {flags} should be "". +-- +-- This works like the ":substitute" command (without any flags). +-- But the matching with {pat} is always done like the 'magic' +-- option is set and 'cpoptions' is empty (to make scripts +-- portable). 'ignorecase' is still relevant, use |/\c| or |/\C| +-- if you want to ignore or match case and ignore 'ignorecase'. +-- 'smartcase' is not used. See |string-match| for how {pat} is +-- used. +-- +-- A "~" in {sub} is not replaced with the previous {sub}. +-- Note that some codes in {sub} have a special meaning +-- |sub-replace-special|. For example, to replace something with +-- "\n" (two characters), use "\\\\n" or '\\n'. +-- +-- When {pat} does not match in {string}, {string} is returned +-- unmodified. +-- +-- Example: +-- ```vim +-- :let &path = substitute(&path, ",\\=[^,]*$", "", "") +-- ``` +-- This removes the last component of the 'path' option. > +-- :echo substitute("testing", ".*", "\\U\\0", "") +-- < results in "TESTING". +-- +-- When {sub} starts with "\=", the remainder is interpreted as +-- an expression. See |sub-replace-expression|. Example: +-- ```vim +-- :echo substitute(s, '%\(\x\x\)', +-- \ '\=nr2char("0x" .. submatch(1))', 'g') +-- +-- ``` +-- When {sub} is a Funcref that function is called, with one +-- optional argument. Example: +-- ```vim +-- :echo substitute(s, '%\(\x\x\)', SubNr, 'g') +-- ``` +-- The optional argument is a list which contains the whole +-- matched string and up to nine submatches, like what +-- |submatch()| returns. Example: +-- ```vim +-- :echo substitute(s, '%\(\x\x\)', {m -> '0x' .. m[1]}, 'g') +-- +-- ``` +-- Returns an empty string on error. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetString()->substitute(pat, sub, flags) +-- ``` +--- @param string string +--- @return string +function vim.fn.substitute(string, pat, sub, flags) end + +-- Returns a list of swap file names, like what "vim -r" shows. +-- See the |-r| command argument. The 'directory' option is used +-- for the directories to inspect. If you only want to get a +-- list of swap files in the current directory then temporarily +-- set 'directory' to a dot: +-- ```vim +-- let save_dir = &directory +-- let &directory = '.' +-- let swapfiles = swapfilelist() +-- let &directory = save_dir +-- ``` +--- @return any[] +function vim.fn.swapfilelist() end + +-- The result is a dictionary, which holds information about the +-- swapfile {fname}. The available fields are: +-- version Vim version +-- user user name +-- host host name +-- fname original file name +-- pid PID of the Vim process that created the swap +-- file +-- mtime last modification time in seconds +-- inode Optional: INODE number of the file +-- dirty 1 if file was modified, 0 if not +-- In case of failure an "error" item is added with the reason: +-- Cannot open file: file not found or in accessible +-- Cannot read file: cannot read first block +-- Not a swap file: does not contain correct block ID +-- Magic number mismatch: Info in first block is invalid +-- +-- Can also be used as a |method|: +-- ```vim +-- GetFilename()->swapinfo() +-- ``` +--- @return table +function vim.fn.swapinfo(fname) end + +-- The result is the swap file path of the buffer {buf}. +-- For the use of {buf}, see |bufname()| above. +-- If buffer {buf} is the current buffer, the result is equal to +-- |:swapname| (unless there is no swap file). +-- If buffer {buf} has no swap file, returns an empty string. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetBufname()->swapname() +-- ``` +--- @param buf buffer +--- @return string +function vim.fn.swapname(buf) end + +-- The result is a Number, which is the syntax ID at the position +-- {lnum} and {col} in the current window. +-- The syntax ID can be used with |synIDattr()| and +-- |synIDtrans()| to obtain syntax information about text. +-- +-- {col} is 1 for the leftmost column, {lnum} is 1 for the first +-- line. 'synmaxcol' applies, in a longer line zero is returned. +-- Note that when the position is after the last character, +-- that's where the cursor can be in Insert mode, synID() returns +-- zero. {lnum} is used like with |getline()|. +-- +-- When {trans} is |TRUE|, transparent items are reduced to the +-- item that they reveal. This is useful when wanting to know +-- the effective color. When {trans} is |FALSE|, the transparent +-- item is returned. This is useful when wanting to know which +-- syntax item is effective (e.g. inside parens). +-- Warning: This function can be very slow. Best speed is +-- obtained by going through the file in forward direction. +-- +-- Returns zero on error. +-- +-- Example (echoes the name of the syntax item under the cursor): +-- ```vim +-- :echo synIDattr(synID(line("."), col("."), 1), "name") +-- ``` +--- @param lnum number +--- @param col number +--- @return number +function vim.fn.synID(lnum, col, trans) end + +-- The result is a String, which is the {what} attribute of +-- syntax ID {synID}. This can be used to obtain information +-- about a syntax item. +-- {mode} can be "gui" or "cterm", to get the attributes +-- for that mode. When {mode} is omitted, or an invalid value is +-- used, the attributes for the currently active highlighting are +-- used (GUI or cterm). +-- Use synIDtrans() to follow linked highlight groups. +-- {what} result +-- "name" the name of the syntax item +-- "fg" foreground color (GUI: color name used to set +-- the color, cterm: color number as a string, +-- term: empty string) +-- "bg" background color (as with "fg") +-- "font" font name (only available in the GUI) +-- |highlight-font| +-- "sp" special color (as with "fg") |guisp| +-- "fg#" like "fg", but for the GUI and the GUI is +-- running the name in "#RRGGBB" form +-- "bg#" like "fg#" for "bg" +-- "sp#" like "fg#" for "sp" +-- "bold" "1" if bold +-- "italic" "1" if italic +-- "reverse" "1" if reverse +-- "inverse" "1" if inverse (= reverse) +-- "standout" "1" if standout +-- "underline" "1" if underlined +-- "undercurl" "1" if undercurled +-- "underdouble" "1" if double underlined +-- "underdotted" "1" if dotted underlined +-- "underdashed" "1" if dashed underlined +-- "strikethrough" "1" if struckthrough +-- "altfont" "1" if alternative font +-- "nocombine" "1" if nocombine +-- +-- Returns an empty string on error. +-- +-- Example (echoes the color of the syntax item under the +-- cursor): +-- ```vim +-- :echo synIDattr(synIDtrans(synID(line("."), col("."), 1)), "fg") +-- ``` +-- Can also be used as a |method|: +-- ```vim +-- :echo synID(line("."), col("."), 1)->synIDtrans()->synIDattr("fg") +-- ``` +--- @param mode? any +--- @return string +function vim.fn.synIDattr(synID, what, mode) end + +-- The result is a Number, which is the translated syntax ID of +-- {synID}. This is the syntax group ID of what is being used to +-- highlight the character. Highlight links given with +-- ":highlight link" are followed. +-- +-- Returns zero on error. +-- +-- Can also be used as a |method|: +-- ```vim +-- :echo synID(line("."), col("."), 1)->synIDtrans()->synIDattr("fg") +-- ``` +--- @return number +function vim.fn.synIDtrans(synID) end + +-- The result is a |List| with currently three items: +-- 1. The first item in the list is 0 if the character at the +-- position {lnum} and {col} is not part of a concealable +-- region, 1 if it is. {lnum} is used like with |getline()|. +-- 2. The second item in the list is a string. If the first item +-- is 1, the second item contains the text which will be +-- displayed in place of the concealed text, depending on the +-- current setting of 'conceallevel' and 'listchars'. +-- 3. The third and final item in the list is a number +-- representing the specific syntax region matched in the +-- line. When the character is not concealed the value is +-- zero. This allows detection of the beginning of a new +-- concealable region if there are two consecutive regions +-- with the same replacement character. For an example, if +-- the text is "123456" and both "23" and "45" are concealed +-- and replaced by the character "X", then: +-- call returns ~ +-- synconcealed(lnum, 1) [0, '', 0] +-- synconcealed(lnum, 2) [1, 'X', 1] +-- synconcealed(lnum, 3) [1, 'X', 1] +-- synconcealed(lnum, 4) [1, 'X', 2] +-- synconcealed(lnum, 5) [1, 'X', 2] +-- synconcealed(lnum, 6) [0, '', 0] +--- @param lnum number +--- @param col number +--- @return any[] +function vim.fn.synconcealed(lnum, col) end + +-- Return a |List|, which is the stack of syntax items at the +-- position {lnum} and {col} in the current window. {lnum} is +-- used like with |getline()|. Each item in the List is an ID +-- like what |synID()| returns. +-- The first item in the List is the outer region, following are +-- items contained in that one. The last one is what |synID()| +-- returns, unless not the whole item is highlighted or it is a +-- transparent item. +-- This function is useful for debugging a syntax file. +-- Example that shows the syntax stack under the cursor: +-- ```vim +-- for id in synstack(line("."), col(".")) +-- echo synIDattr(id, "name") +-- endfor +-- ``` +-- When the position specified with {lnum} and {col} is invalid +-- an empty list is returned. The position just after the last +-- character in a line and the first column in an empty line are +-- valid positions. +--- @param lnum number +--- @param col number +--- @return any[] +function vim.fn.synstack(lnum, col) end + +-- Note: Prefer |vim.system()| in Lua. +-- +-- Gets the output of {cmd} as a |string| (|systemlist()| returns +-- a |List|) and sets |v:shell_error| to the error code. +-- {cmd} is treated as in |jobstart()|: +-- If {cmd} is a List it runs directly (no 'shell'). +-- If {cmd} is a String it runs in the 'shell', like this: +-- ```vim +-- :call jobstart(split(&shell) + split(&shellcmdflag) + ['{cmd}']) +-- +-- ``` +-- Not to be used for interactive commands. +-- +-- Result is a String, filtered to avoid platform-specific quirks: +-- - is replaced with +-- :echo system(['ls', expand('%:h')]) +-- +-- ``` +-- If {input} is a string it is written to a pipe and passed as +-- stdin to the command. The string is written as-is, line +-- separators are not changed. +-- If {input} is a |List| it is written to the pipe as +-- |writefile()| does with {binary} set to "b" (i.e. with +-- a newline between each list item, and newlines inside list +-- items converted to NULs). +-- When {input} is given and is a valid buffer id, the content of +-- the buffer is written to the file line by line, each line +-- terminated by NL (and NUL where the text has NL). +-- +-- Note: system() cannot write to or read from backgrounded ("&") +-- shell commands, e.g.: +-- ```vim +-- :echo system("cat - &", "foo") +-- ``` +-- which is equivalent to: > +-- $ echo foo | bash -c 'cat - &' +-- < The pipes are disconnected (unless overridden by shell +-- redirection syntax) before input can reach it. Use +-- |jobstart()| instead. +-- +-- Note: Use |shellescape()| or |::S| with |expand()| or +-- |fnamemodify()| to escape special characters in a command +-- argument. 'shellquote' and 'shellxquote' must be properly +-- configured. Example: +-- ```vim +-- :echo system('ls '..shellescape(expand('%:h'))) +-- :echo system('ls '..expand('%:h:S')) +-- +-- ``` +-- Unlike ":!cmd" there is no automatic check for changed files. +-- Use |:checktime| to force a check. +-- +-- Can also be used as a |method|: +-- ```vim +-- :echo GetCmd()->system() +-- ``` +--- @param input? any +--- @return string +function vim.fn.system(cmd, input) end + +-- Same as |system()|, but returns a |List| with lines (parts of +-- output separated by NL) with NULs transformed into NLs. Output +-- is the same as |readfile()| will output with {binary} argument +-- set to "b", except that a final newline is not preserved, +-- unless {keepempty} is non-zero. +-- Note that on MS-Windows you may get trailing CR characters. +-- +-- To see the difference between "echo hello" and "echo -n hello" +-- use |system()| and |split()|: +-- ```vim +-- echo split(system('echo hello'), '\n', 1) +-- ``` +-- Returns an empty string on error. +-- +-- Can also be used as a |method|: +-- ```vim +-- :echo GetCmd()->systemlist() +-- ``` +--- @param input? any +--- @param keepempty? any +--- @return any[] +function vim.fn.systemlist(cmd, input, keepempty) end + +-- The result is a |List|, where each item is the number of the +-- buffer associated with each window in the current tab page. +-- {arg} specifies the number of the tab page to be used. When +-- omitted the current tab page is used. +-- When {arg} is invalid the number zero is returned. +-- To get a list of all buffers in all tabs use this: +-- ```vim +-- let buflist = [] +-- for i in range(tabpagenr('$')) +-- call extend(buflist, tabpagebuflist(i + 1)) +-- endfor +-- ``` +-- Note that a buffer may appear in more than one window. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetTabpage()->tabpagebuflist() +-- ``` +--- @param arg? any +--- @return any[] +function vim.fn.tabpagebuflist(arg) end + +-- The result is a Number, which is the number of the current +-- tab page. The first tab page has number 1. +-- +-- The optional argument {arg} supports the following values: +-- $ the number of the last tab page (the tab page +-- count). +-- # the number of the last accessed tab page +-- (where |g| goes to). If there is no +-- previous tab page, 0 is returned. +-- The number can be used with the |:tab| command. +-- +-- Returns zero on error. +--- @param arg? any +--- @return number +function vim.fn.tabpagenr(arg) end + +-- Like |winnr()| but for tab page {tabarg}. +-- {tabarg} specifies the number of tab page to be used. +-- {arg} is used like with |winnr()|: +-- - When omitted the current window number is returned. This is +-- the window which will be used when going to this tab page. +-- - When "$" the number of windows is returned. +-- - When "#" the previous window nr is returned. +-- Useful examples: +-- ```vim +-- tabpagewinnr(1) " current window of tab page 1 +-- tabpagewinnr(4, '$') " number of windows in tab page 4 +-- ``` +-- When {tabarg} is invalid zero is returned. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetTabpage()->tabpagewinnr() +-- ``` +--- @param arg? any +--- @return number +function vim.fn.tabpagewinnr(tabarg, arg) end + +-- Returns a |List| with the file names used to search for tags +-- for the current buffer. This is the 'tags' option expanded. +--- @return any[] +function vim.fn.tagfiles() end + +-- Returns a |List| of tags matching the regular expression {expr}. +-- +-- If {filename} is passed it is used to prioritize the results +-- in the same way that |:tselect| does. See |tag-priority|. +-- {filename} should be the full path of the file. +-- +-- Each list item is a dictionary with at least the following +-- entries: +-- name Name of the tag. +-- filename Name of the file where the tag is +-- defined. It is either relative to the +-- current directory or a full path. +-- cmd Ex command used to locate the tag in +-- the file. +-- kind Type of the tag. The value for this +-- entry depends on the language specific +-- kind values. Only available when +-- using a tags file generated by +-- Universal/Exuberant ctags or hdrtag. +-- static A file specific tag. Refer to +-- |static-tag| for more information. +-- More entries may be present, depending on the content of the +-- tags file: access, implementation, inherits and signature. +-- Refer to the ctags documentation for information about these +-- fields. For C code the fields "struct", "class" and "enum" +-- may appear, they give the name of the entity the tag is +-- contained in. +-- +-- The ex-command "cmd" can be either an ex search pattern, a +-- line number or a line number followed by a byte number. +-- +-- If there are no matching tags, then an empty list is returned. +-- +-- To get an exact tag match, the anchors '^' and '$' should be +-- used in {expr}. This also make the function work faster. +-- Refer to |tag-regexp| for more information about the tag +-- search regular expression pattern. +-- +-- Refer to |'tags'| for information about how the tags file is +-- located by Vim. Refer to |tags-file-format| for the format of +-- the tags file generated by the different ctags tools. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetTagpattern()->taglist() +-- ``` +--- @param filename? any +--- @return any[] +function vim.fn.taglist(expr, filename) end + +-- Return the tangent of {expr}, measured in radians, as a |Float| +-- in the range [-inf, inf]. +-- {expr} must evaluate to a |Float| or a |Number|. +-- Returns 0.0 if {expr} is not a |Float| or a |Number|. +-- Examples: +-- ```vim +-- :echo tan(10) +-- ``` +-- 0.648361 > +-- :echo tan(-4.01) +-- < -1.181502 +-- +-- Can also be used as a |method|: +-- ```vim +-- Compute()->tan() +-- ``` +--- @return float +function vim.fn.tan(expr) end + +-- Return the hyperbolic tangent of {expr} as a |Float| in the +-- range [-1, 1]. +-- {expr} must evaluate to a |Float| or a |Number|. +-- Returns 0.0 if {expr} is not a |Float| or a |Number|. +-- Examples: +-- ```vim +-- :echo tanh(0.5) +-- ``` +-- 0.462117 > +-- :echo tanh(-1) +-- < -0.761594 +-- +-- Can also be used as a |method|: +-- ```vim +-- Compute()->tanh() +-- ``` +--- @return float +function vim.fn.tanh(expr) end + +-- Generates a (non-existent) filename located in the Nvim root +-- |tempdir|. Scripts can use the filename as a temporary file. +-- Example: +-- ```vim +-- :let tmpfile = tempname() +-- :exe "redir > " .. tmpfile +-- ``` +--- @return string +function vim.fn.tempname() end + +-- Spawns {cmd} in a new pseudo-terminal session connected +-- to the current (unmodified) buffer. Parameters and behavior +-- are the same as |jobstart()| except "pty", "width", "height", +-- and "TERM" are ignored: "height" and "width" are taken from +-- the current window. Note that termopen() implies a "pty" arg +-- to jobstart(), and thus has the implications documented at +-- |jobstart()|. +-- +-- Returns the same values as jobstart(). +-- +-- Terminal environment is initialized as in |jobstart-env|, +-- except $TERM is set to "xterm-256color". Full behavior is +-- described in |terminal|. +--- @param opts? table +function vim.fn.termopen(cmd, opts) end + +-- none free memory right now for testing +function vim.fn.test_garbagecollect_now() end + +-- Return a list with information about timers. +-- When {id} is given only information about this timer is +-- returned. When timer {id} does not exist an empty list is +-- returned. +-- When {id} is omitted information about all timers is returned. +-- +-- For each timer the information is stored in a |Dictionary| with +-- these items: +-- "id" the timer ID +-- "time" time the timer was started with +-- "repeat" number of times the timer will still fire; +-- -1 means forever +-- "callback" the callback +-- +-- Can also be used as a |method|: +-- ```vim +-- GetTimer()->timer_info() +-- ``` +--- @param id? any +--- @return any[] +function vim.fn.timer_info(id) end + +-- Pause or unpause a timer. A paused timer does not invoke its +-- callback when its time expires. Unpausing a timer may cause +-- the callback to be invoked almost immediately if enough time +-- has passed. +-- +-- Pausing a timer is useful to avoid the callback to be called +-- for a short time. +-- +-- If {paused} evaluates to a non-zero Number or a non-empty +-- String, then the timer is paused, otherwise it is unpaused. +-- See |non-zero-arg|. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetTimer()->timer_pause(1) +-- ``` +function vim.fn.timer_pause(timer, paused) end + +-- Create a timer and return the timer ID. +-- +-- {time} is the waiting time in milliseconds. This is the +-- minimum time before invoking the callback. When the system is +-- busy or Vim is not waiting for input the time will be longer. +-- Zero can be used to execute the callback when Vim is back in +-- the main loop. +-- +-- {callback} is the function to call. It can be the name of a +-- function or a |Funcref|. It is called with one argument, which +-- is the timer ID. The callback is only invoked when Vim is +-- waiting for input. +-- +-- {options} is a dictionary. Supported entries: +-- "repeat" Number of times to repeat the callback. +-- -1 means forever. Default is 1. +-- If the timer causes an error three times in a +-- row the repeat is cancelled. +-- +-- Returns -1 on error. +-- +-- Example: +-- ```vim +-- func MyHandler(timer) +-- echo 'Handler called' +-- endfunc +-- let timer = timer_start(500, 'MyHandler', +-- \ {'repeat': 3}) +-- ``` +-- This invokes MyHandler() three times at 500 msec intervals. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetMsec()->timer_start(callback) +-- +-- ``` +-- Not available in the |sandbox|. +--- @param callback fun() +--- @param options? table +--- @return number +function vim.fn.timer_start(time, callback, options) end + +-- Stop a timer. The timer callback will no longer be invoked. +-- {timer} is an ID returned by timer_start(), thus it must be a +-- Number. If {timer} does not exist there is no error. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetTimer()->timer_stop() +-- ``` +function vim.fn.timer_stop(timer) end + +-- Stop all timers. The timer callbacks will no longer be +-- invoked. Useful if some timers is misbehaving. If there are +-- no timers there is no error. +function vim.fn.timer_stopall() end + +-- The result is a copy of the String given, with all uppercase +-- characters turned into lowercase (just like applying |gu| to +-- the string). Returns an empty string on error. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetText()->tolower() +-- ``` +--- @return string +function vim.fn.tolower(expr) end + +-- The result is a copy of the String given, with all lowercase +-- characters turned into uppercase (just like applying |gU| to +-- the string). Returns an empty string on error. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetText()->toupper() +-- ``` +--- @return string +function vim.fn.toupper(expr) end + +-- The result is a copy of the {src} string with all characters +-- which appear in {fromstr} replaced by the character in that +-- position in the {tostr} string. Thus the first character in +-- {fromstr} is translated into the first character in {tostr} +-- and so on. Exactly like the unix "tr" command. +-- This code also deals with multibyte characters properly. +-- +-- Returns an empty string on error. +-- +-- Examples: +-- ```vim +-- echo tr("hello there", "ht", "HT") +-- ``` +-- returns "Hello THere" > +-- echo tr("", "<>", "{}") +-- < returns "{blob}" +-- +-- Can also be used as a |method|: +-- ```vim +-- GetText()->tr(from, to) +-- ``` +--- @return string +function vim.fn.tr(src, fromstr, tostr) end + +-- Return {text} as a String where any character in {mask} is +-- removed from the beginning and/or end of {text}. +-- If {mask} is not given, {mask} is all characters up to 0x20, +-- which includes Tab, space, NL and CR, plus the non-breaking +-- space character 0xa0. +-- The optional {dir} argument specifies where to remove the +-- characters: +-- 0 remove from the beginning and end of {text} +-- 1 remove only at the beginning of {text} +-- 2 remove only at the end of {text} +-- When omitted both ends are trimmed. +-- This function deals with multibyte characters properly. +-- Returns an empty string on error. +-- +-- Examples: +-- ```vim +-- echo trim(" some text ") +-- ``` +-- returns "some text" > +-- echo trim(" \r\t\t\r RESERVE \t\n\x0B\xA0") .. "_TAIL" +-- < returns "RESERVE_TAIL" +-- ```vim +-- echo trim("rmX>rrm", "rm<>") +-- ``` +-- returns "Xrm>X" (characters in the middle are not removed) > +-- echo trim(" vim ", " ", 2) +-- < returns " vim" +-- +-- Can also be used as a |method|: +-- ```vim +-- GetText()->trim() +-- ``` +--- @param text string +--- @param mask? any +--- @param dir? any +--- @return string +function vim.fn.trim(text, mask, dir) end + +-- Return the largest integral value with magnitude less than or +-- equal to {expr} as a |Float| (truncate towards zero). +-- {expr} must evaluate to a |Float| or a |Number|. +-- Returns 0.0 if {expr} is not a |Float| or a |Number|. +-- Examples: +-- ```vim +-- echo trunc(1.456) +-- ``` +-- 1.0 > +-- echo trunc(-5.456) +-- < -5.0 +-- ```vim +-- echo trunc(4.0) +-- ``` +-- 4.0 +-- +-- Can also be used as a |method|: +-- ```vim +-- Compute()->trunc() +-- ``` +--- @return float +function vim.fn.trunc(expr) end + +-- The result is a Number representing the type of {expr}. +-- Instead of using the number directly, it is better to use the +-- v:t_ variable that has the value: +-- Number: 0 (|v:t_number|) +-- String: 1 (|v:t_string|) +-- Funcref: 2 (|v:t_func|) +-- List: 3 (|v:t_list|) +-- Dictionary: 4 (|v:t_dict|) +-- Float: 5 (|v:t_float|) +-- Boolean: 6 (|v:true| and |v:false|) +-- Null: 7 (|v:null|) +-- Blob: 10 (|v:t_blob|) +-- For backward compatibility, this method can be used: +-- ```vim +-- :if type(myvar) == type(0) +-- :if type(myvar) == type("") +-- :if type(myvar) == type(function("tr")) +-- :if type(myvar) == type([]) +-- :if type(myvar) == type({}) +-- :if type(myvar) == type(0.0) +-- :if type(myvar) == type(v:true) +-- ``` +-- In place of checking for |v:null| type it is better to check +-- for |v:null| directly as it is the only value of this type: +-- ```vim +-- :if myvar is v:null +-- ``` +-- To check if the v:t_ variables exist use this: > +-- :if exists('v:t_number') +-- +-- < Can also be used as a |method|: +-- ```vim +-- mylist->type() +-- ``` +--- @return number +function vim.fn.type(expr) end + +-- Return the name of the undo file that would be used for a file +-- with name {name} when writing. This uses the 'undodir' +-- option, finding directories that exist. It does not check if +-- the undo file exists. +-- {name} is always expanded to the full path, since that is what +-- is used internally. +-- If {name} is empty undofile() returns an empty string, since a +-- buffer without a file name will not write an undo file. +-- Useful in combination with |:wundo| and |:rundo|. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetFilename()->undofile() +-- ``` +--- @return string +function vim.fn.undofile(name) end + +-- Return the current state of the undo tree in a dictionary with +-- the following items: +-- "seq_last" The highest undo sequence number used. +-- "seq_cur" The sequence number of the current position in +-- the undo tree. This differs from "seq_last" +-- when some changes were undone. +-- "time_cur" Time last used for |:earlier| and related +-- commands. Use |strftime()| to convert to +-- something readable. +-- "save_last" Number of the last file write. Zero when no +-- write yet. +-- "save_cur" Number of the current position in the undo +-- tree. +-- "synced" Non-zero when the last undo block was synced. +-- This happens when waiting from input from the +-- user. See |undo-blocks|. +-- "entries" A list of dictionaries with information about +-- undo blocks. +-- +-- The first item in the "entries" list is the oldest undo item. +-- Each List item is a |Dictionary| with these items: +-- "seq" Undo sequence number. Same as what appears in +-- |:undolist|. +-- "time" Timestamp when the change happened. Use +-- |strftime()| to convert to something readable. +-- "newhead" Only appears in the item that is the last one +-- that was added. This marks the last change +-- and where further changes will be added. +-- "curhead" Only appears in the item that is the last one +-- that was undone. This marks the current +-- position in the undo tree, the block that will +-- be used by a redo command. When nothing was +-- undone after the last change this item will +-- not appear anywhere. +-- "save" Only appears on the last block before a file +-- write. The number is the write count. The +-- first write has number 1, the last one the +-- "save_last" mentioned above. +-- "alt" Alternate entry. This is again a List of undo +-- blocks. Each item may again have an "alt" +-- item. +--- @return any[] +function vim.fn.undotree() end + +-- Remove second and succeeding copies of repeated adjacent +-- {list} items in-place. Returns {list}. If you want a list +-- to remain unmodified make a copy first: +-- ```vim +-- :let newlist = uniq(copy(mylist)) +-- ``` +-- The default compare function uses the string representation of +-- each item. For the use of {func} and {dict} see |sort()|. +-- +-- Returns zero if {list} is not a |List|. +-- +-- Can also be used as a |method|: +-- ```vim +-- mylist->uniq() +-- ``` +--- @param list any[] +--- @param func? fun() +--- @param dict? table +--- @return any[] +function vim.fn.uniq(list, func, dict) end + +-- Same as |charidx()| but returns the UTF-16 code unit index of +-- the byte at {idx} in {string} (after converting it to UTF-16). +-- +-- When {charidx} is present and TRUE, {idx} is used as the +-- character index in the String {string} instead of as the byte +-- index. +-- An {idx} in the middle of a UTF-8 sequence is rounded +-- downwards to the beginning of that sequence. +-- +-- Returns -1 if the arguments are invalid or if there are less +-- than {idx} bytes in {string}. If there are exactly {idx} bytes +-- the length of the string in UTF-16 code units is returned. +-- +-- See |byteidx()| and |byteidxcomp()| for getting the byte index +-- from the UTF-16 index and |charidx()| for getting the +-- character index from the UTF-16 index. +-- Refer to |string-offset-encoding| for more information. +-- Examples: +-- ```vim +-- echo utf16idx('a😊😊', 3) returns 2 +-- echo utf16idx('a😊😊', 7) returns 4 +-- echo utf16idx('a😊😊', 1, 0, 1) returns 2 +-- echo utf16idx('a😊😊', 2, 0, 1) returns 4 +-- echo utf16idx('aą́c', 6) returns 2 +-- echo utf16idx('aą́c', 6, 1) returns 4 +-- echo utf16idx('a😊😊', 9) returns -1 +-- ``` +-- Can also be used as a |method|: +-- ```vim +-- GetName()->utf16idx(idx) +-- ``` +--- @param string string +--- @param countcc? any +--- @param charidx? any +--- @return number +function vim.fn.utf16idx(string, idx, countcc, charidx) end + +-- Return a |List| with all the values of {dict}. The |List| is +-- in arbitrary order. Also see |items()| and |keys()|. +-- Returns zero if {dict} is not a |Dict|. +-- +-- Can also be used as a |method|: +-- ```vim +-- mydict->values() +-- ``` +--- @param dict table +--- @return any[] +function vim.fn.values(dict) end + +-- The result is a Number, which is the screen column of the file +-- position given with {expr}. That is, the last screen position +-- occupied by the character at that position, when the screen +-- would be of unlimited width. When there is a at the +-- position, the returned Number will be the column at the end of +-- the . For example, for a in column 1, with 'ts' +-- set to 8, it returns 8. |conceal| is ignored. +-- For the byte position use |col()|. +-- +-- For the use of {expr} see |col()|. +-- +-- When 'virtualedit' is used {expr} can be [lnum, col, off], +-- where "off" is the offset in screen columns from the start of +-- the character. E.g., a position within a or after the +-- last character. When "off" is omitted zero is used. When +-- Virtual editing is active in the current mode, a position +-- beyond the end of the line can be returned. Also see +-- |'virtualedit'| +-- +-- The accepted positions are: +-- . the cursor position +-- $ the end of the cursor line (the result is the +-- number of displayed characters in the cursor line +-- plus one) +-- 'x position of mark x (if the mark is not set, 0 is +-- returned) +-- v In Visual mode: the start of the Visual area (the +-- cursor is the end). When not in Visual mode +-- returns the cursor position. Differs from |'<| in +-- that it's updated right away. +-- +-- If {list} is present and non-zero then virtcol() returns a List +-- with the first and last screen position occupied by the +-- character. +-- +-- Note that only marks in the current file can be used. +-- Examples: +-- ```vim +-- " With text "foo^Lbar" and cursor on the "^L": +-- +-- virtcol(".") " returns 5 +-- virtcol(".", 1) " returns [4, 5] +-- virtcol("$") " returns 9 +-- +-- " With text " there", with 't at 'h': +-- +-- virtcol("'t") " returns 6 +-- ``` +-- The first column is 1. 0 is returned for an error. +-- A more advanced example that echoes the maximum length of +-- all lines: +-- ```vim +-- echo max(map(range(1, line('$')), "virtcol([v:val, '$'])")) +-- +-- ``` +-- Can also be used as a |method|: > +-- GetPos()->virtcol() +--- @param list? any[] +--- @return number +function vim.fn.virtcol(expr, list) end + +-- The result is a Number, which is the byte index of the +-- character in window {winid} at buffer line {lnum} and virtual +-- column {col}. +-- +-- If {col} is greater than the last virtual column in line +-- {lnum}, then the byte index of the character at the last +-- virtual column is returned. +-- +-- The {winid} argument can be the window number or the +-- |window-ID|. If this is zero, then the current window is used. +-- +-- Returns -1 if the window {winid} doesn't exist or the buffer +-- line {lnum} or virtual column {col} is invalid. +-- +-- See also |screenpos()|, |virtcol()| and |col()|. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetWinid()->virtcol2col(lnum, col) +-- ``` +--- @param winid window +--- @param lnum number +--- @param col number +--- @return number +function vim.fn.virtcol2col(winid, lnum, col) end + +-- The result is a String, which describes the last Visual mode +-- used in the current buffer. Initially it returns an empty +-- string, but once Visual mode has been used, it returns "v", +-- "V", or "" (a single CTRL-V character) for +-- character-wise, line-wise, or block-wise Visual mode +-- respectively. +-- Example: +-- ```vim +-- :exe "normal " .. visualmode() +-- ``` +-- This enters the same Visual mode as before. It is also useful +-- in scripts if you wish to act differently depending on the +-- Visual mode that was used. +-- If Visual mode is active, use |mode()| to get the Visual mode +-- (e.g., in a |:vmap|). +-- If {expr} is supplied and it evaluates to a non-zero Number or +-- a non-empty String, then the Visual mode will be cleared and +-- the old value is returned. See |non-zero-arg|. +--- @param expr? any +--- @return string +function vim.fn.visualmode(expr) end + +-- Waits until {condition} evaluates to |TRUE|, where {condition} +-- is a |Funcref| or |string| containing an expression. +-- +-- {timeout} is the maximum waiting time in milliseconds, -1 +-- means forever. +-- +-- Condition is evaluated on user events, internal events, and +-- every {interval} milliseconds (default: 200). +-- +-- Returns a status integer: +-- 0 if the condition was satisfied before timeout +-- -1 if the timeout was exceeded +-- -2 if the function was interrupted (by |CTRL-C|) +-- -3 if an error occurred +--- @param interval? any +--- @return number +function vim.fn.wait(timeout, condition, interval) end + +-- Returns |TRUE| when the wildmenu is active and |FALSE| +-- otherwise. See 'wildmenu' and 'wildmode'. +-- This can be used in mappings to handle the 'wildcharm' option +-- gracefully. (Makes only sense with |mapmode-c| mappings). +-- +-- For example to make work like in wildmode, use: +-- ```vim +-- :cnoremap wildmenumode() ? "\\" : "\" +-- ``` +-- (Note, this needs the 'wildcharm' option set appropriately). +--- @return number +function vim.fn.wildmenumode() end + +-- Like `execute()` but in the context of window {id}. +-- The window will temporarily be made the current window, +-- without triggering autocommands or changing directory. When +-- executing {command} autocommands will be triggered, this may +-- have unexpected side effects. Use `:noautocmd` if needed. +-- Example: +-- ```vim +-- call win_execute(winid, 'syntax enable') +-- ``` +-- Doing the same with `setwinvar()` would not trigger +-- autocommands and not actually show syntax highlighting. +-- +-- When window {id} does not exist then no error is given and +-- an empty string is returned. +-- +-- Can also be used as a |method|, the base is passed as the +-- second argument: +-- ```vim +-- GetCommand()->win_execute(winid) +-- ``` +--- @param silent? any +--- @return string +function vim.fn.win_execute(id, command, silent) end + +-- Returns a |List| with |window-ID|s for windows that contain +-- buffer {bufnr}. When there is none the list is empty. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetBufnr()->win_findbuf() +-- ``` +--- @param bufnr buffer +--- @return any[] +function vim.fn.win_findbuf(bufnr) end + +-- Get the |window-ID| for the specified window. +-- When {win} is missing use the current window. +-- With {win} this is the window number. The top window has +-- number 1. +-- Without {tab} use the current tab, otherwise the tab with +-- number {tab}. The first tab has number one. +-- Return zero if the window cannot be found. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetWinnr()->win_getid() +-- ``` +--- @param win? window +--- @param tab? any +--- @return number +function vim.fn.win_getid(win, tab) end + +-- Return the type of the window: +-- "autocmd" autocommand window. Temporary window +-- used to execute autocommands. +-- "command" command-line window |cmdwin| +-- (empty) normal window +-- "loclist" |location-list-window| +-- "popup" floating window |api-floatwin| +-- "preview" preview window |preview-window| +-- "quickfix" |quickfix-window| +-- "unknown" window {nr} not found +-- +-- When {nr} is omitted return the type of the current window. +-- When {nr} is given return the type of this window by number or +-- |window-ID|. +-- +-- Also see the 'buftype' option. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetWinid()->win_gettype() +-- ``` +--- @param nr? number +--- @return string +function vim.fn.win_gettype(nr) end + +-- Go to window with ID {expr}. This may also change the current +-- tabpage. +-- Return TRUE if successful, FALSE if the window cannot be found. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetWinid()->win_gotoid() +-- ``` +--- @return number +function vim.fn.win_gotoid(expr) end + +-- Return a list with the tab number and window number of window +-- with ID {expr}: [tabnr, winnr]. +-- Return [0, 0] if the window cannot be found. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetWinid()->win_id2tabwin() +-- ``` +--- @return any[] +function vim.fn.win_id2tabwin(expr) end + +-- Return the window number of window with ID {expr}. +-- Return 0 if the window cannot be found in the current tabpage. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetWinid()->win_id2win() +-- ``` +--- @return number +function vim.fn.win_id2win(expr) end + +-- Move window {nr}'s vertical separator (i.e., the right border) +-- by {offset} columns, as if being dragged by the mouse. {nr} +-- can be a window number or |window-ID|. A positive {offset} +-- moves right and a negative {offset} moves left. Moving a +-- window's vertical separator will change the width of the +-- window and the width of other windows adjacent to the vertical +-- separator. The magnitude of movement may be smaller than +-- specified (e.g., as a consequence of maintaining +-- 'winminwidth'). Returns TRUE if the window can be found and +-- FALSE otherwise. +-- This will fail for the rightmost window and a full-width +-- window, since it has no separator on the right. +-- Only works for the current tab page. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetWinnr()->win_move_separator(offset) +-- ``` +--- @param nr number +--- @return number +function vim.fn.win_move_separator(nr, offset) end + +-- Move window {nr}'s status line (i.e., the bottom border) by +-- {offset} rows, as if being dragged by the mouse. {nr} can be a +-- window number or |window-ID|. A positive {offset} moves down +-- and a negative {offset} moves up. Moving a window's status +-- line will change the height of the window and the height of +-- other windows adjacent to the status line. The magnitude of +-- movement may be smaller than specified (e.g., as a consequence +-- of maintaining 'winminheight'). Returns TRUE if the window can +-- be found and FALSE otherwise. +-- Only works for the current tab page. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetWinnr()->win_move_statusline(offset) +-- ``` +--- @param nr number +--- @return number +function vim.fn.win_move_statusline(nr, offset) end + +-- Return the screen position of window {nr} as a list with two +-- numbers: [row, col]. The first window always has position +-- [1, 1], unless there is a tabline, then it is [2, 1]. +-- {nr} can be the window number or the |window-ID|. Use zero +-- for the current window. +-- Returns [0, 0] if the window cannot be found in the current +-- tabpage. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetWinid()->win_screenpos() +-- ``` +--- @param nr number +--- @return any[] +function vim.fn.win_screenpos(nr) end + +-- Move the window {nr} to a new split of the window {target}. +-- This is similar to moving to {target}, creating a new window +-- using |:split| but having the same contents as window {nr}, and +-- then closing {nr}. +-- +-- Both {nr} and {target} can be window numbers or |window-ID|s. +-- Both must be in the current tab page. +-- +-- Returns zero for success, non-zero for failure. +-- +-- {options} is a |Dictionary| with the following optional entries: +-- "vertical" When TRUE, the split is created vertically, +-- like with |:vsplit|. +-- "rightbelow" When TRUE, the split is made below or to the +-- right (if vertical). When FALSE, it is done +-- above or to the left (if vertical). When not +-- present, the values of 'splitbelow' and +-- 'splitright' are used. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetWinid()->win_splitmove(target) +-- ``` +--- @param nr number +--- @param options? table +--- @return number +function vim.fn.win_splitmove(nr, target, options) end + +-- The result is a Number, which is the number of the buffer +-- associated with window {nr}. {nr} can be the window number or +-- the |window-ID|. +-- When {nr} is zero, the number of the buffer in the current +-- window is returned. +-- When window {nr} doesn't exist, -1 is returned. +-- Example: +-- ```vim +-- :echo "The file in the current window is " .. bufname(winbufnr(0)) +-- ``` +-- Can also be used as a |method|: +-- ```vim +-- FindWindow()->winbufnr()->bufname() +-- ``` +--- @param nr number +--- @return number +function vim.fn.winbufnr(nr) end + +-- The result is a Number, which is the virtual column of the +-- cursor in the window. This is counting screen cells from the +-- left side of the window. The leftmost column is one. +--- @return number +function vim.fn.wincol() end + +-- The result is a String. For MS-Windows it indicates the OS +-- version. E.g, Windows 10 is "10.0", Windows 8 is "6.2", +-- Windows XP is "5.1". For non-MS-Windows systems the result is +-- an empty string. +--- @return string +function vim.fn.windowsversion() end + +-- The result is a Number, which is the height of window {nr}. +-- {nr} can be the window number or the |window-ID|. +-- When {nr} is zero, the height of the current window is +-- returned. When window {nr} doesn't exist, -1 is returned. +-- An existing window always has a height of zero or more. +-- This excludes any window toolbar line. +-- Examples: +-- ```vim +-- :echo "The current window has " .. winheight(0) .. " lines." +-- +-- ``` +-- Can also be used as a |method|: > +-- GetWinid()->winheight() +-- < +--- @param nr number +--- @return number +function vim.fn.winheight(nr) end + +-- The result is a nested List containing the layout of windows +-- in a tabpage. +-- +-- Without {tabnr} use the current tabpage, otherwise the tabpage +-- with number {tabnr}. If the tabpage {tabnr} is not found, +-- returns an empty list. +-- +-- For a leaf window, it returns: +-- ["leaf", {winid}] +-- For horizontally split windows, which form a column, it +-- returns: +-- ["col", [{nested list of windows}]] +-- For vertically split windows, which form a row, it returns: +-- ["row", [{nested list of windows}]] +-- +-- Example: +-- ```vim +-- " Only one window in the tab page +-- :echo winlayout() +-- ['leaf', 1000] +-- " Two horizontally split windows +-- :echo winlayout() +-- ['col', [['leaf', 1000], ['leaf', 1001]]] +-- " The second tab page, with three horizontally split +-- " windows, with two vertically split windows in the +-- " middle window +-- :echo winlayout(2) +-- ['col', [['leaf', 1002], ['row', [['leaf', 1003], +-- ['leaf', 1001]]], ['leaf', 1000]]] +-- ``` +-- Can also be used as a |method|: +-- ```vim +-- GetTabnr()->winlayout() +-- ``` +--- @param tabnr? number +--- @return any[] +function vim.fn.winlayout(tabnr) end + +-- The result is a Number, which is the screen line of the cursor +-- in the window. This is counting screen lines from the top of +-- the window. The first line is one. +-- If the cursor was moved the view on the file will be updated +-- first, this may cause a scroll. +--- @return number +function vim.fn.winline() end + +-- The result is a Number, which is the number of the current +-- window. The top window has number 1. +-- Returns zero for a popup window. +-- +-- The optional argument {arg} supports the following values: +-- $ the number of the last window (the window +-- count). +-- # the number of the last accessed window (where +-- |CTRL-W_p| goes to). If there is no previous +-- window or it is in another tab page 0 is +-- returned. +-- {N}j the number of the Nth window below the +-- current window (where |CTRL-W_j| goes to). +-- {N}k the number of the Nth window above the current +-- window (where |CTRL-W_k| goes to). +-- {N}h the number of the Nth window left of the +-- current window (where |CTRL-W_h| goes to). +-- {N}l the number of the Nth window right of the +-- current window (where |CTRL-W_l| goes to). +-- The number can be used with |CTRL-W_w| and ":wincmd w" +-- |:wincmd|. +-- When {arg} is invalid an error is given and zero is returned. +-- Also see |tabpagewinnr()| and |win_getid()|. +-- Examples: +-- ```vim +-- let window_count = winnr('$') +-- let prev_window = winnr('#') +-- let wnum = winnr('3k') +-- +-- ``` +-- Can also be used as a |method|: > +-- GetWinval()->winnr() +-- < +--- @param arg? any +--- @return number +function vim.fn.winnr(arg) end + +-- Returns a sequence of |:resize| commands that should restore +-- the current window sizes. Only works properly when no windows +-- are opened or closed and the current window and tab page is +-- unchanged. +-- Example: +-- ```vim +-- :let cmd = winrestcmd() +-- :call MessWithWindowSizes() +-- :exe cmd +-- ``` +--- @return string +function vim.fn.winrestcmd() end + +-- Uses the |Dictionary| returned by |winsaveview()| to restore +-- the view of the current window. +-- Note: The {dict} does not have to contain all values, that are +-- returned by |winsaveview()|. If values are missing, those +-- settings won't be restored. So you can use: +-- ```vim +-- :call winrestview({'curswant': 4}) +-- ``` +-- This will only set the curswant value (the column the cursor +-- wants to move on vertical movements) of the cursor to column 5 +-- (yes, that is 5), while all other settings will remain the +-- same. This is useful, if you set the cursor position manually. +-- +-- If you have changed the values the result is unpredictable. +-- If the window size changed the result won't be the same. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetView()->winrestview() +-- ``` +--- @param dict table +function vim.fn.winrestview(dict) end + +-- Returns a |Dictionary| that contains information to restore +-- the view of the current window. Use |winrestview()| to +-- restore the view. +-- This is useful if you have a mapping that jumps around in the +-- buffer and you want to go back to the original view. +-- This does not save fold information. Use the 'foldenable' +-- option to temporarily switch off folding, so that folds are +-- not opened when moving around. This may have side effects. +-- The return value includes: +-- lnum cursor line number +-- col cursor column (Note: the first column +-- zero, as opposed to what |getcurpos()| +-- returns) +-- coladd cursor column offset for 'virtualedit' +-- curswant column for vertical movement (Note: +-- the first column is zero, as opposed +-- to what |getcurpos()| returns). After +-- |$| command it will be a very large +-- number equal to |v:maxcol|. +-- topline first line in the window +-- topfill filler lines, only in diff mode +-- leftcol first column displayed; only used when +-- 'wrap' is off +-- skipcol columns skipped +-- Note that no option values are saved. +--- @return table +function vim.fn.winsaveview() end + +-- The result is a Number, which is the width of window {nr}. +-- {nr} can be the window number or the |window-ID|. +-- When {nr} is zero, the width of the current window is +-- returned. When window {nr} doesn't exist, -1 is returned. +-- An existing window always has a width of zero or more. +-- Examples: +-- ```vim +-- :echo "The current window has " .. winwidth(0) .. " columns." +-- :if winwidth(0) <= 50 +-- : 50 wincmd | +-- :endif +-- ``` +-- For getting the terminal or screen size, see the 'columns' +-- option. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetWinid()->winwidth() +-- ``` +--- @param nr number +--- @return number +function vim.fn.winwidth(nr) end + +-- The result is a dictionary of byte/chars/word statistics for +-- the current buffer. This is the same info as provided by +-- |g_CTRL-G| +-- The return value includes: +-- bytes Number of bytes in the buffer +-- chars Number of chars in the buffer +-- words Number of words in the buffer +-- cursor_bytes Number of bytes before cursor position +-- (not in Visual mode) +-- cursor_chars Number of chars before cursor position +-- (not in Visual mode) +-- cursor_words Number of words before cursor position +-- (not in Visual mode) +-- visual_bytes Number of bytes visually selected +-- (only in Visual mode) +-- visual_chars Number of chars visually selected +-- (only in Visual mode) +-- visual_words Number of words visually selected +-- (only in Visual mode) +--- @return table +function vim.fn.wordcount() end + +-- When {object} is a |List| write it to file {fname}. Each list +-- item is separated with a NL. Each list item must be a String +-- or Number. +-- All NL characters are replaced with a NUL character. +-- Inserting CR characters needs to be done before passing {list} +-- to writefile(). +-- +-- When {object} is a |Blob| write the bytes to file {fname} +-- unmodified, also when binary mode is not specified. +-- +-- {flags} must be a String. These characters are recognized: +-- +-- 'b' Binary mode is used: There will not be a NL after the +-- last list item. An empty item at the end does cause the +-- last line in the file to end in a NL. +-- +-- 'a' Append mode is used, lines are appended to the file: +-- ```vim +-- :call writefile(["foo"], "event.log", "a") +-- :call writefile(["bar"], "event.log", "a") +-- ``` +-- 'D' Delete the file when the current function ends. This +-- works like: +-- ```vim +-- :defer delete({fname}) +-- ``` +-- Fails when not in a function. Also see |:defer|. +-- +-- 's' fsync() is called after writing the file. This flushes +-- the file to disk, if possible. This takes more time but +-- avoids losing the file if the system crashes. +-- +-- 'S' fsync() is not called, even when 'fsync' is set. +-- +-- When {flags} does not contain "S" or "s" then fsync() is +-- called if the 'fsync' option is set. +-- +-- An existing file is overwritten, if possible. +-- +-- When the write fails -1 is returned, otherwise 0. There is an +-- error message if the file can't be created or when writing +-- fails. +-- +-- Also see |readfile()|. +-- To copy a file byte for byte: +-- ```vim +-- :let fl = readfile("foo", "b") +-- :call writefile(fl, "foocopy", "b") +-- +-- ``` +-- Can also be used as a |method|: > +-- GetText()->writefile("thefile") +--- @param flags? any +--- @return number +function vim.fn.writefile(object, fname, flags) end + +-- Bitwise XOR on the two arguments. The arguments are converted +-- to a number. A List, Dict or Float argument causes an error. +-- Also see `and()` and `or()`. +-- Example: +-- ```vim +-- :let bits = xor(bits, 0x80) +-- ``` +-- Can also be used as a |method|: +-- ```vim +-- :let bits = bits->xor(0x80) +-- ``` +--- @return number +function vim.fn.xor(expr, expr1) end + diff --git a/bundle/neodev.nvim/types/nightly/vim.fn.lua b/bundle/neodev.nvim/types/nightly/vim.fn.lua new file mode 100644 index 000000000..bfcf201fc --- /dev/null +++ b/bundle/neodev.nvim/types/nightly/vim.fn.lua @@ -0,0 +1,5917 @@ +---@meta + + + +-- Return the absolute value of {expr}. When {expr} evaluates to +-- a |Float| abs() returns a |Float|. When {expr} can be +-- converted to a |Number| abs() returns a |Number|. Otherwise +-- abs() gives an error message and returns -1. +-- Examples: +-- ```vim +-- echo abs(1.456) +-- ``` +-- 1.456 > +-- echo abs(-5.456) +-- < 5.456 +-- ```vim +-- echo abs(-4) +-- ``` +-- 4 +-- +-- Can also be used as a |method|: +-- ```vim +-- Compute()->abs() +-- ``` +--- @return float +function vim.fn.abs(expr) end + +-- Return the arc cosine of {expr} measured in radians, as a +-- |Float| in the range of [0, pi]. +-- {expr} must evaluate to a |Float| or a |Number| in the range +-- [-1, 1]. +-- Returns NaN if {expr} is outside the range [-1, 1]. Returns +-- 0.0 if {expr} is not a |Float| or a |Number|. +-- Examples: +-- ```vim +-- :echo acos(0) +-- ``` +-- 1.570796 > +-- :echo acos(-0.5) +-- < 2.094395 +-- +-- Can also be used as a |method|: +-- ```vim +-- Compute()->acos() +-- ``` +--- @return float +function vim.fn.acos(expr) end + +-- Append the item {expr} to |List| or |Blob| {object}. Returns +-- the resulting |List| or |Blob|. Examples: +-- ```vim +-- :let alist = add([1, 2, 3], item) +-- :call add(mylist, "woodstock") +-- ``` +-- Note that when {expr} is a |List| it is appended as a single +-- item. Use |extend()| to concatenate |Lists|. +-- When {object} is a |Blob| then {expr} must be a number. +-- Use |insert()| to add an item at another position. +-- Returns 1 if {object} is not a |List| or a |Blob|. +-- +-- Can also be used as a |method|: +-- ```vim +-- mylist->add(val1)->add(val2) +-- ``` +--- @return any[] +function vim.fn.add(object, expr) end + +-- Bitwise AND on the two arguments. The arguments are converted +-- to a number. A List, Dict or Float argument causes an error. +-- Also see `or()` and `xor()`. +-- Example: +-- ```vim +-- :let flag = and(bits, 0x80) +-- ``` +-- Can also be used as a |method|: > +-- :let flag = bits->and(0x80) +--- @return number +vim.fn["and"] = function(expr, expr1) end + +-- Returns Dictionary of |api-metadata|. +-- +-- View it in a nice human-readable format: +-- ```vim +-- :lua print(vim.inspect(vim.fn.api_info())) +-- ``` +--- @return table +function vim.fn.api_info() end + +-- When {text} is a |List|: Append each item of the |List| as a +-- text line below line {lnum} in the current buffer. +-- Otherwise append {text} as one text line below line {lnum} in +-- the current buffer. +-- Any type of item is accepted and converted to a String. +-- {lnum} can be zero to insert a line before the first one. +-- {lnum} is used like with |getline()|. +-- Returns 1 for failure ({lnum} out of range or out of memory), +-- 0 for success. Example: +-- ```vim +-- :let failed = append(line('$'), "# THE END") +-- :let failed = append(0, ["Chapter 1", "the beginning"]) +-- +-- ``` +-- Can also be used as a |method| after a List: > +-- mylist->append(lnum) +--- @param lnum number +--- @param text string +--- @return number +function vim.fn.append(lnum, text) end + +-- Like |append()| but append the text in buffer {expr}. +-- +-- This function works only for loaded buffers. First call +-- |bufload()| if needed. +-- +-- For the use of {buf}, see |bufname()|. +-- +-- {lnum} is the line number to append below. Note that using +-- |line()| would use the current buffer, not the one appending +-- to. Use "$" to append at the end of the buffer. Other string +-- values are not supported. +-- +-- On success 0 is returned, on failure 1 is returned. +-- +-- If {buf} is not a valid buffer or {lnum} is not valid, an +-- error message is given. Example: +-- ```vim +-- :let failed = appendbufline(13, 0, "# THE START") +-- ``` +-- Can also be used as a |method| after a List: +-- ```vim +-- mylist->appendbufline(buf, lnum) +-- ``` +--- @param buf buffer +--- @param lnum number +--- @param text string +--- @return number +function vim.fn.appendbufline(buf, lnum, text) end + +-- The result is the number of files in the argument list. See +-- |arglist|. +-- If {winid} is not supplied, the argument list of the current +-- window is used. +-- If {winid} is -1, the global argument list is used. +-- Otherwise {winid} specifies the window of which the argument +-- list is used: either the window number or the window ID. +-- Returns -1 if the {winid} argument is invalid. +--- @param winid? window +--- @return number +function vim.fn.argc(winid) end + +-- The result is the current index in the argument list. 0 is +-- the first file. argc() - 1 is the last one. See |arglist|. +--- @return number +function vim.fn.argidx() end + +-- Return the argument list ID. This is a number which +-- identifies the argument list being used. Zero is used for the +-- global argument list. See |arglist|. +-- Returns -1 if the arguments are invalid. +-- +-- Without arguments use the current window. +-- With {winnr} only use this window in the current tab page. +-- With {winnr} and {tabnr} use the window in the specified tab +-- page. +-- {winnr} can be the window number or the |window-ID|. +--- @param winnr? window +--- @param tabnr? number +--- @return number +function vim.fn.arglistid(winnr, tabnr) end + +-- The result is the {nr}th file in the argument list. See +-- |arglist|. "argv(0)" is the first one. Example: +-- ```vim +-- :let i = 0 +-- :while i < argc() +-- : let f = escape(fnameescape(argv(i)), '.') +-- : exe 'amenu Arg.' .. f .. ' :e ' .. f .. '' +-- : let i = i + 1 +-- :endwhile +-- ``` +-- Without the {nr} argument, or when {nr} is -1, a |List| with +-- the whole |arglist| is returned. +-- +-- The {winid} argument specifies the window ID, see |argc()|. +-- For the Vim command line arguments see |v:argv|. +-- +-- Returns an empty string if {nr}th argument is not present in +-- the argument list. Returns an empty List if the {winid} +-- argument is invalid. +--- @param nr? number +--- @param winid? window +--- @return any[] +function vim.fn.argv(nr, winid) end + +-- Return the arc sine of {expr} measured in radians, as a |Float| +-- in the range of [-pi/2, pi/2]. +-- {expr} must evaluate to a |Float| or a |Number| in the range +-- [-1, 1]. +-- Returns NaN if {expr} is outside the range [-1, 1]. Returns +-- 0.0 if {expr} is not a |Float| or a |Number|. +-- Examples: +-- ```vim +-- :echo asin(0.8) +-- ``` +-- 0.927295 > +-- :echo asin(-0.5) +-- < -0.523599 +-- +-- Can also be used as a |method|: +-- ```vim +-- Compute()->asin() +-- ``` +--- @return float +function vim.fn.asin(expr) end + +-- Number assert {cmd} causes a beep +--- @return number +function vim.fn.assert_beeps(cmd) end + +-- Number assert {exp} is equal to {act} +--- @param msg? any +--- @return number +function vim.fn.assert_equal(exp, act, msg) end + +-- Number assert file contents are equal +--- @param msg? any +--- @return number +function vim.fn.assert_equalfile(fname_one, fname_two, msg) end + +-- Number assert {error} is in v:exception +--- @param msg? any +--- @return number +function vim.fn.assert_exception(error, msg) end + +-- Number assert {cmd} fails +--- @param error? any +--- @return number +function vim.fn.assert_fails(cmd, error) end + +-- Number assert {actual} is false +--- @param msg? any +--- @return number +function vim.fn.assert_false(actual, msg) end + +-- Number assert {actual} is inside the range +--- @param msg? any +--- @return number +function vim.fn.assert_inrange(lower, upper, actual, msg) end + +-- Number assert {pat} matches {text} +--- @param text string +--- @param msg? any +--- @return number +function vim.fn.assert_match(pat, text, msg) end + +-- Number assert {cmd} does not cause a beep +--- @return number +function vim.fn.assert_nobeep(cmd) end + +-- Number assert {exp} is not equal {act} +--- @param msg? any +--- @return number +function vim.fn.assert_notequal(exp, act, msg) end + +-- Number assert {pat} not matches {text} +--- @param text string +--- @param msg? any +--- @return number +function vim.fn.assert_notmatch(pat, text, msg) end + +-- Number report a test failure +--- @return number +function vim.fn.assert_report(msg) end + +-- Number assert {actual} is true +--- @param msg? any +--- @return number +function vim.fn.assert_true(actual, msg) end + +-- Return the principal value of the arc tangent of {expr}, in +-- the range [-pi/2, +pi/2] radians, as a |Float|. +-- {expr} must evaluate to a |Float| or a |Number|. +-- Returns 0.0 if {expr} is not a |Float| or a |Number|. +-- Examples: +-- ```vim +-- :echo atan(100) +-- ``` +-- 1.560797 > +-- :echo atan(-4.01) +-- < -1.326405 +-- +-- Can also be used as a |method|: +-- ```vim +-- Compute()->atan() +-- ``` +--- @return float +function vim.fn.atan(expr) end + +-- Return the arc tangent of {expr1} / {expr2}, measured in +-- radians, as a |Float| in the range [-pi, pi]. +-- {expr1} and {expr2} must evaluate to a |Float| or a |Number|. +-- Returns 0.0 if {expr1} or {expr2} is not a |Float| or a +-- |Number|. +-- Examples: +-- ```vim +-- :echo atan2(-1, 1) +-- ``` +-- -0.785398 > +-- :echo atan2(1, -1) +-- < 2.356194 +-- +-- Can also be used as a |method|: +-- ```vim +-- Compute()->atan2(1) +-- ``` +--- @return float +function vim.fn.atan2(expr1, expr2) end + +-- Return a List containing the number value of each byte in Blob +-- {blob}. Examples: +-- ```vim +-- blob2list(0z0102.0304) returns [1, 2, 3, 4] +-- blob2list(0z) returns [] +-- ``` +-- Returns an empty List on error. |list2blob()| does the +-- opposite. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetBlob()->blob2list() +-- ``` +--- @return any[] +function vim.fn.blob2list(blob) end + +-- Put up a file requester. This only works when "has("browse")" +-- returns |TRUE| (only in some GUI versions). +-- The input fields are: +-- {save} when |TRUE|, select file to write +-- {title} title for the requester +-- {initdir} directory to start browsing in +-- {default} default file name +-- An empty string is returned when the "Cancel" button is hit, +-- something went wrong, or browsing is not possible. +--- @return string +function vim.fn.browse(save, title, initdir, default) end + +-- Put up a directory requester. This only works when +-- "has("browse")" returns |TRUE| (only in some GUI versions). +-- On systems where a directory browser is not supported a file +-- browser is used. In that case: select a file in the directory +-- to be used. +-- The input fields are: +-- {title} title for the requester +-- {initdir} directory to start browsing in +-- When the "Cancel" button is hit, something went wrong, or +-- browsing is not possible, an empty string is returned. +--- @return string +function vim.fn.browsedir(title, initdir) end + +-- Add a buffer to the buffer list with name {name} (must be a +-- String). +-- If a buffer for file {name} already exists, return that buffer +-- number. Otherwise return the buffer number of the newly +-- created buffer. When {name} is an empty string then a new +-- buffer is always created. +-- The buffer will not have 'buflisted' set and not be loaded +-- yet. To add some text to the buffer use this: +-- ```vim +-- let bufnr = bufadd('someName') +-- call bufload(bufnr) +-- call setbufline(bufnr, 1, ['some', 'text']) +-- ``` +-- Returns 0 on error. +-- Can also be used as a |method|: +-- ```vim +-- let bufnr = 'somename'->bufadd() +-- ``` +--- @return number +function vim.fn.bufadd(name) end + +-- The result is a Number, which is |TRUE| if a buffer called +-- {buf} exists. +-- If the {buf} argument is a number, buffer numbers are used. +-- Number zero is the alternate buffer for the current window. +-- +-- If the {buf} argument is a string it must match a buffer name +-- exactly. The name can be: +-- - Relative to the current directory. +-- - A full path. +-- - The name of a buffer with 'buftype' set to "nofile". +-- - A URL name. +-- Unlisted buffers will be found. +-- Note that help files are listed by their short name in the +-- output of |:buffers|, but bufexists() requires using their +-- long name to be able to find them. +-- bufexists() may report a buffer exists, but to use the name +-- with a |:buffer| command you may need to use |expand()|. Esp +-- for MS-Windows 8.3 names in the form "c:\DOCUME~1" +-- Use "bufexists(0)" to test for the existence of an alternate +-- file name. +-- +-- Can also be used as a |method|: +-- ```vim +-- let exists = 'somename'->bufexists() +-- ``` +--- @param buf buffer +--- @return number +function vim.fn.bufexists(buf) end + +-- The result is a Number, which is |TRUE| if a buffer called +-- {buf} exists and is listed (has the 'buflisted' option set). +-- The {buf} argument is used like with |bufexists()|. +-- +-- Can also be used as a |method|: +-- ```vim +-- let listed = 'somename'->buflisted() +-- ``` +--- @param buf buffer +--- @return number +function vim.fn.buflisted(buf) end + +-- Ensure the buffer {buf} is loaded. When the buffer name +-- refers to an existing file then the file is read. Otherwise +-- the buffer will be empty. If the buffer was already loaded +-- then there is no change. If the buffer is not related to a +-- file the no file is read (e.g., when 'buftype' is "nofile"). +-- If there is an existing swap file for the file of the buffer, +-- there will be no dialog, the buffer will be loaded anyway. +-- The {buf} argument is used like with |bufexists()|. +-- +-- Can also be used as a |method|: +-- ```vim +-- eval 'somename'->bufload() +-- ``` +--- @param buf buffer +--- @return number +function vim.fn.bufload(buf) end + +-- The result is a Number, which is |TRUE| if a buffer called +-- {buf} exists and is loaded (shown in a window or hidden). +-- The {buf} argument is used like with |bufexists()|. +-- +-- Can also be used as a |method|: +-- ```vim +-- let loaded = 'somename'->bufloaded() +-- ``` +--- @param buf buffer +--- @return number +function vim.fn.bufloaded(buf) end + +-- The result is the name of a buffer. Mostly as it is displayed +-- by the `:ls` command, but not using special names such as +-- "[No Name]". +-- If {buf} is omitted the current buffer is used. +-- If {buf} is a Number, that buffer number's name is given. +-- Number zero is the alternate buffer for the current window. +-- If {buf} is a String, it is used as a |file-pattern| to match +-- with the buffer names. This is always done like 'magic' is +-- set and 'cpoptions' is empty. When there is more than one +-- match an empty string is returned. +-- "" or "%" can be used for the current buffer, "#" for the +-- alternate buffer. +-- A full match is preferred, otherwise a match at the start, end +-- or middle of the buffer name is accepted. If you only want a +-- full match then put "^" at the start and "$" at the end of the +-- pattern. +-- Listed buffers are found first. If there is a single match +-- with a listed buffer, that one is returned. Next unlisted +-- buffers are searched for. +-- If the {buf} is a String, but you want to use it as a buffer +-- number, force it to be a Number by adding zero to it: +-- ```vim +-- :echo bufname("3" + 0) +-- ``` +-- Can also be used as a |method|: > +-- echo bufnr->bufname() +-- +-- < If the buffer doesn't exist, or doesn't have a name, an empty +-- string is returned. +-- ```vim +-- bufname("#") alternate buffer name +-- bufname(3) name of buffer 3 +-- bufname("%") name of current buffer +-- bufname("file2") name of buffer where "file2" matches. +-- ``` +--- @param buf? buffer +--- @return string +function vim.fn.bufname(buf) end + +-- The result is the number of a buffer, as it is displayed by +-- the `:ls` command. For the use of {buf}, see |bufname()| +-- above. +-- If the buffer doesn't exist, -1 is returned. Or, if the +-- {create} argument is present and TRUE, a new, unlisted, +-- buffer is created and its number is returned. +-- bufnr("$") is the last buffer: +-- ```vim +-- :let last_buffer = bufnr("$") +-- ``` +-- The result is a Number, which is the highest buffer number +-- of existing buffers. Note that not all buffers with a smaller +-- number necessarily exist, because ":bwipeout" may have removed +-- them. Use bufexists() to test for the existence of a buffer. +-- +-- Can also be used as a |method|: +-- ```vim +-- echo bufref->bufnr() +-- ``` +--- @param buf? buffer +--- @param create? any +--- @return number +function vim.fn.bufnr(buf, create) end + +-- The result is a Number, which is the |window-ID| of the first +-- window associated with buffer {buf}. For the use of {buf}, +-- see |bufname()| above. If buffer {buf} doesn't exist or +-- there is no such window, -1 is returned. Example: +-- ```vim +-- +-- echo "A window containing buffer 1 is " .. (bufwinid(1)) +-- ``` +-- Only deals with the current tab page. See |win_findbuf()| for +-- finding more. +-- +-- Can also be used as a |method|: +-- ```vim +-- FindBuffer()->bufwinid() +-- ``` +--- @param buf buffer +--- @return number +function vim.fn.bufwinid(buf) end + +-- Like |bufwinid()| but return the window number instead of the +-- |window-ID|. +-- If buffer {buf} doesn't exist or there is no such window, -1 +-- is returned. Example: +-- ```vim +-- +-- echo "A window containing buffer 1 is " .. (bufwinnr(1)) +-- +-- ``` +-- The number can be used with |CTRL-W_w| and ":wincmd w" +-- |:wincmd|. +-- +-- Can also be used as a |method|: +-- ```vim +-- FindBuffer()->bufwinnr() +-- ``` +--- @param buf buffer +--- @return number +function vim.fn.bufwinnr(buf) end + +-- Return the line number that contains the character at byte +-- count {byte} in the current buffer. This includes the +-- end-of-line character, depending on the 'fileformat' option +-- for the current buffer. The first character has byte count +-- one. +-- Also see |line2byte()|, |go| and |:goto|. +-- +-- Returns -1 if the {byte} value is invalid. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetOffset()->byte2line() +-- ``` +--- @return number +function vim.fn.byte2line(byte) end + +-- Return byte index of the {nr}th character in the String +-- {expr}. Use zero for the first character, it then returns +-- zero. +-- If there are no multibyte characters the returned value is +-- equal to {nr}. +-- Composing characters are not counted separately, their byte +-- length is added to the preceding base character. See +-- |byteidxcomp()| below for counting composing characters +-- separately. +-- When {utf16} is present and TRUE, {nr} is used as the UTF-16 +-- index in the String {expr} instead of as the character index. +-- The UTF-16 index is the index in the string when it is encoded +-- with 16-bit words. If the specified UTF-16 index is in the +-- middle of a character (e.g. in a 4-byte character), then the +-- byte index of the first byte in the character is returned. +-- Refer to |string-offset-encoding| for more information. +-- Example : +-- ```vim +-- echo matchstr(str, ".", byteidx(str, 3)) +-- ``` +-- will display the fourth character. Another way to do the +-- same: +-- ```vim +-- let s = strpart(str, byteidx(str, 3)) +-- echo strpart(s, 0, byteidx(s, 1)) +-- ``` +-- Also see |strgetchar()| and |strcharpart()|. +-- +-- If there are less than {nr} characters -1 is returned. +-- If there are exactly {nr} characters the length of the string +-- in bytes is returned. +-- See |charidx()| and |utf16idx()| for getting the character and +-- UTF-16 index respectively from the byte index. +-- Examples: +-- ```vim +-- echo byteidx('a😊😊', 2) returns 5 +-- echo byteidx('a😊😊', 2, 1) returns 1 +-- echo byteidx('a😊😊', 3, 1) returns 5 +-- ``` +-- Can also be used as a |method|: +-- ```vim +-- GetName()->byteidx(idx) +-- ``` +--- @param nr number +--- @param utf16? any +--- @return number +function vim.fn.byteidx(expr, nr, utf16) end + +-- Like byteidx(), except that a composing character is counted +-- as a separate character. Example: +-- ```vim +-- let s = 'e' .. nr2char(0x301) +-- echo byteidx(s, 1) +-- echo byteidxcomp(s, 1) +-- echo byteidxcomp(s, 2) +-- ``` +-- The first and third echo result in 3 ('e' plus composing +-- character is 3 bytes), the second echo results in 1 ('e' is +-- one byte). +-- +-- Can also be used as a |method|: +-- ```vim +-- GetName()->byteidxcomp(idx) +-- ``` +--- @param nr number +--- @param utf16? any +--- @return number +function vim.fn.byteidxcomp(expr, nr, utf16) end + +-- Call function {func} with the items in |List| {arglist} as +-- arguments. +-- {func} can either be a |Funcref| or the name of a function. +-- a:firstline and a:lastline are set to the cursor line. +-- Returns the return value of the called function. +-- {dict} is for functions with the "dict" attribute. It will be +-- used to set the local variable "self". |Dictionary-function| +-- +-- Can also be used as a |method|: +-- ```vim +-- GetFunc()->call([arg, arg], dict) +-- ``` +--- @param func fun() +--- @param dict? table +function vim.fn.call(func, arglist, dict) end + +-- Return the smallest integral value greater than or equal to +-- {expr} as a |Float| (round up). +-- {expr} must evaluate to a |Float| or a |Number|. +-- Examples: +-- ```vim +-- echo ceil(1.456) +-- ``` +-- 2.0 > +-- echo ceil(-5.456) +-- < -5.0 +-- ```vim +-- echo ceil(4.0) +-- ``` +-- 4.0 +-- +-- Returns 0.0 if {expr} is not a |Float| or a |Number|. +-- +-- Can also be used as a |method|: +-- ```vim +-- Compute()->ceil() +-- ``` +--- @return float +function vim.fn.ceil(expr) end + +-- Close a channel or a specific stream associated with it. +-- For a job, {stream} can be one of "stdin", "stdout", +-- "stderr" or "rpc" (closes stdin/stdout for a job started +-- with `"rpc":v:true`) If {stream} is omitted, all streams +-- are closed. If the channel is a pty, this will then close the +-- pty master, sending SIGHUP to the job process. +-- For a socket, there is only one stream, and {stream} should be +-- omitted. +--- @param stream? any +--- @return number +function vim.fn.chanclose(id, stream) end + +-- Return the number of the most recent change. This is the same +-- number as what is displayed with |:undolist| and can be used +-- with the |:undo| command. +-- When a change was made it is the number of that change. After +-- redo it is the number of the redone change. After undo it is +-- one less than the number of the undone change. +-- Returns 0 if the undo list is empty. +--- @return number +function vim.fn.changenr() end + +-- Send data to channel {id}. For a job, it writes it to the +-- stdin of the process. For the stdio channel |channel-stdio|, +-- it writes to Nvim's stdout. Returns the number of bytes +-- written if the write succeeded, 0 otherwise. +-- See |channel-bytes| for more information. +-- +-- {data} may be a string, string convertible, |Blob|, or a list. +-- If {data} is a list, the items will be joined by newlines; any +-- newlines in an item will be sent as NUL. To send a final +-- newline, include a final empty string. Example: +-- ```vim +-- :call chansend(id, ["abc", "123\n456", ""]) +-- ``` +-- will send "abcNL>123NUL>456NL>". +-- +-- chansend() writes raw data, not RPC messages. If the channel +-- was created with `"rpc":v:true` then the channel expects RPC +-- messages, use |rpcnotify()| and |rpcrequest()| instead. +--- @return number +function vim.fn.chansend(id, data) end + +-- Return Number value of the first char in {string}. +-- Examples: +-- ```vim +-- char2nr(" ") returns 32 +-- char2nr("ABC") returns 65 +-- char2nr("á") returns 225 +-- char2nr("á"[0]) returns 195 +-- char2nr("\") returns 128 +-- ``` +-- Non-ASCII characters are always treated as UTF-8 characters. +-- {utf8} is ignored, it exists only for backwards-compatibility. +-- A combining character is a separate character. +-- |nr2char()| does the opposite. +-- +-- Returns 0 if {string} is not a |String|. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetChar()->char2nr() +-- ``` +--- @param string string +--- @param utf8? any +--- @return number +function vim.fn.char2nr(string, utf8) end + +-- Return the character class of the first character in {string}. +-- The character class is one of: +-- 0 blank +-- 1 punctuation +-- 2 word character +-- 3 emoji +-- other specific Unicode class +-- The class is used in patterns and word motions. +-- Returns 0 if {string} is not a |String|. +--- @param string string +--- @return number +function vim.fn.charclass(string) end + +-- Same as |col()| but returns the character index of the column +-- position given with {expr} instead of the byte position. +-- +-- Example: +-- With the cursor on '세' in line 5 with text "여보세요": +-- ```vim +-- charcol('.') returns 3 +-- col('.') returns 7 +-- +-- ``` +-- Can also be used as a |method|: > +-- GetPos()->col() +-- < +--- @param winid? window +--- @return number +function vim.fn.charcol(expr, winid) end + +-- Return the character index of the byte at {idx} in {string}. +-- The index of the first character is zero. +-- If there are no multibyte characters the returned value is +-- equal to {idx}. +-- +-- When {countcc} is omitted or |FALSE|, then composing characters +-- are not counted separately, their byte length is added to the +-- preceding base character. +-- When {countcc} is |TRUE|, then composing characters are +-- counted as separate characters. +-- +-- When {utf16} is present and TRUE, {idx} is used as the UTF-16 +-- index in the String {expr} instead of as the byte index. +-- +-- Returns -1 if the arguments are invalid or if there are less +-- than {idx} bytes. If there are exactly {idx} bytes the length +-- of the string in characters is returned. +-- +-- An error is given and -1 is returned if the first argument is +-- not a string, the second argument is not a number or when the +-- third argument is present and is not zero or one. +-- +-- See |byteidx()| and |byteidxcomp()| for getting the byte index +-- from the character index and |utf16idx()| for getting the +-- UTF-16 index from the character index. +-- Refer to |string-offset-encoding| for more information. +-- Examples: +-- ```vim +-- echo charidx('áb́ć', 3) returns 1 +-- echo charidx('áb́ć', 6, 1) returns 4 +-- echo charidx('áb́ć', 16) returns -1 +-- echo charidx('a😊😊', 4, 0, 1) returns 2 +-- ``` +-- Can also be used as a |method|: +-- ```vim +-- GetName()->charidx(idx) +-- ``` +--- @param string string +--- @param countcc? any +--- @param utf16? any +--- @return number +function vim.fn.charidx(string, idx, countcc, utf16) end + +-- Change the current working directory to {dir}. The scope of +-- the directory change depends on the directory of the current +-- window: +-- - If the current window has a window-local directory +-- (|:lcd|), then changes the window local directory. +-- - Otherwise, if the current tabpage has a local +-- directory (|:tcd|) then changes the tabpage local +-- directory. +-- - Otherwise, changes the global directory. +-- {dir} must be a String. +-- If successful, returns the previous working directory. Pass +-- this to another chdir() to restore the directory. +-- On failure, returns an empty string. +-- +-- Example: +-- ```vim +-- let save_dir = chdir(newdir) +-- if save_dir != "" +-- " ... do some work +-- call chdir(save_dir) +-- endif +-- +-- ``` +-- Can also be used as a |method|: > +-- GetDir()->chdir() +-- < +--- @return string +function vim.fn.chdir(dir) end + +-- Get the amount of indent for line {lnum} according the C +-- indenting rules, as with 'cindent'. +-- The indent is counted in spaces, the value of 'tabstop' is +-- relevant. {lnum} is used just like in |getline()|. +-- When {lnum} is invalid -1 is returned. +-- See |C-indenting|. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetLnum()->cindent() +-- ``` +--- @param lnum number +--- @return number +function vim.fn.cindent(lnum) end + +-- Clears all matches previously defined for the current window +-- by |matchadd()| and the |:match| commands. +-- If {win} is specified, use the window with this number or +-- window ID instead of the current window. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetWin()->clearmatches() +-- ``` +--- @param win? window +function vim.fn.clearmatches(win) end + +-- The result is a Number, which is the byte index of the column +-- position given with {expr}. The accepted positions are: +-- . the cursor position +-- $ the end of the cursor line (the result is the +-- number of bytes in the cursor line plus one) +-- 'x position of mark x (if the mark is not set, 0 is +-- returned) +-- v In Visual mode: the start of the Visual area (the +-- cursor is the end). When not in Visual mode +-- returns the cursor position. Differs from |'<| in +-- that it's updated right away. +-- Additionally {expr} can be [lnum, col]: a |List| with the line +-- and column number. Most useful when the column is "$", to get +-- the last column of a specific line. When "lnum" or "col" is +-- out of range then col() returns zero. +-- With the optional {winid} argument the values are obtained for +-- that window instead of the current window. +-- To get the line number use |line()|. To get both use +-- |getpos()|. +-- For the screen column position use |virtcol()|. For the +-- character position use |charcol()|. +-- Note that only marks in the current file can be used. +-- Examples: +-- ```vim +-- col(".") column of cursor +-- col("$") length of cursor line plus one +-- col("'t") column of mark t +-- col("'" .. markname) column of mark markname +-- ``` +-- The first column is 1. Returns 0 if {expr} is invalid or when +-- the window with ID {winid} is not found. +-- For an uppercase mark the column may actually be in another +-- buffer. +-- For the cursor position, when 'virtualedit' is active, the +-- column is one higher if the cursor is after the end of the +-- line. Also, when using a mapping the cursor isn't +-- moved, this can be used to obtain the column in Insert mode: +-- ```vim +-- :imap echo col(".").."\n" +-- +-- ``` +-- Can also be used as a |method|: > +-- GetPos()->col() +-- < +--- @param winid? window +--- @return number +function vim.fn.col(expr, winid) end + +-- Set the matches for Insert mode completion. +-- Can only be used in Insert mode. You need to use a mapping +-- with CTRL-R = (see |i_CTRL-R|). It does not work after CTRL-O +-- or with an expression mapping. +-- {startcol} is the byte offset in the line where the completed +-- text start. The text up to the cursor is the original text +-- that will be replaced by the matches. Use col('.') for an +-- empty string. "col('.') - 1" will replace one character by a +-- match. +-- {matches} must be a |List|. Each |List| item is one match. +-- See |complete-items| for the kind of items that are possible. +-- "longest" in 'completeopt' is ignored. +-- Note that the after calling this function you need to avoid +-- inserting anything that would cause completion to stop. +-- The match can be selected with CTRL-N and CTRL-P as usual with +-- Insert mode completion. The popup menu will appear if +-- specified, see |ins-completion-menu|. +-- Example: +-- ```vim +-- inoremap =ListMonths() +-- +-- func ListMonths() +-- call complete(col('.'), ['January', 'February', 'March', +-- \ 'April', 'May', 'June', 'July', 'August', 'September', +-- \ 'October', 'November', 'December']) +-- return '' +-- endfunc +-- ``` +-- This isn't very useful, but it shows how it works. Note that +-- an empty string is returned to avoid a zero being inserted. +-- +-- Can also be used as a |method|, the base is passed as the +-- second argument: +-- ```vim +-- GetMatches()->complete(col('.')) +-- ``` +function vim.fn.complete(startcol, matches) end + +-- Add {expr} to the list of matches. Only to be used by the +-- function specified with the 'completefunc' option. +-- Returns 0 for failure (empty string or out of memory), +-- 1 when the match was added, 2 when the match was already in +-- the list. +-- See |complete-functions| for an explanation of {expr}. It is +-- the same as one item in the list that 'omnifunc' would return. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetMoreMatches()->complete_add() +-- ``` +--- @return number +function vim.fn.complete_add(expr) end + +-- Check for a key typed while looking for completion matches. +-- This is to be used when looking for matches takes some time. +-- Returns |TRUE| when searching for matches is to be aborted, +-- zero otherwise. +-- Only to be used by the function specified with the +-- 'completefunc' option. +--- @return number +function vim.fn.complete_check() end + +-- Returns a |Dictionary| with information about Insert mode +-- completion. See |ins-completion|. +-- The items are: +-- mode Current completion mode name string. +-- See |complete_info_mode| for the values. +-- pum_visible |TRUE| if popup menu is visible. +-- See |pumvisible()|. +-- items List of completion matches. Each item is a +-- dictionary containing the entries "word", +-- "abbr", "menu", "kind", "info" and "user_data". +-- See |complete-items|. +-- selected Selected item index. First index is zero. +-- Index is -1 if no item is selected (showing +-- typed text only, or the last completion after +-- no item is selected when using the or +-- keys) +-- inserted Inserted string. [NOT IMPLEMENTED YET] +-- +-- +-- mode values are: +-- "" Not in completion mode +-- "keyword" Keyword completion |i_CTRL-X_CTRL-N| +-- "ctrl_x" Just pressed CTRL-X |i_CTRL-X| +-- "scroll" Scrolling with |i_CTRL-X_CTRL-E| or +-- |i_CTRL-X_CTRL-Y| +-- "whole_line" Whole lines |i_CTRL-X_CTRL-L| +-- "files" File names |i_CTRL-X_CTRL-F| +-- "tags" Tags |i_CTRL-X_CTRL-]| +-- "path_defines" Definition completion |i_CTRL-X_CTRL-D| +-- "path_patterns" Include completion |i_CTRL-X_CTRL-I| +-- "dictionary" Dictionary |i_CTRL-X_CTRL-K| +-- "thesaurus" Thesaurus |i_CTRL-X_CTRL-T| +-- "cmdline" Vim Command line |i_CTRL-X_CTRL-V| +-- "function" User defined completion |i_CTRL-X_CTRL-U| +-- "omni" Omni completion |i_CTRL-X_CTRL-O| +-- "spell" Spelling suggestions |i_CTRL-X_s| +-- "eval" |complete()| completion +-- "unknown" Other internal modes +-- +-- If the optional {what} list argument is supplied, then only +-- the items listed in {what} are returned. Unsupported items in +-- {what} are silently ignored. +-- +-- To get the position and size of the popup menu, see +-- |pum_getpos()|. It's also available in |v:event| during the +-- |CompleteChanged| event. +-- +-- Returns an empty |Dictionary| on error. +-- +-- Examples: +-- ```vim +-- " Get all items +-- call complete_info() +-- " Get only 'mode' +-- call complete_info(['mode']) +-- " Get only 'mode' and 'pum_visible' +-- call complete_info(['mode', 'pum_visible']) +-- +-- ``` +-- Can also be used as a |method|: > +-- GetItems()->complete_info() +-- < +--- @param what? any +--- @return table +function vim.fn.complete_info(what) end + +-- confirm() offers the user a dialog, from which a choice can be +-- 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 +-- alternatives. When {choices} is missing or empty, "&OK" is +-- used (and translated). +-- {msg} is a String, use '\n' to include a newline. Only on +-- some systems the string is wrapped when it doesn't fit. +-- +-- {choices} is a String, with the individual choices separated +-- by '\n', e.g. +-- ```vim +-- confirm("Save changes?", "&Yes\n&No\n&Cancel") +-- ``` +-- The letter after the '&' is the shortcut key for that choice. +-- Thus you can type 'c' to select "Cancel". The shortcut does +-- not need to be the first letter: +-- ```vim +-- confirm("file has been modified", "&Save\nSave &All") +-- ``` +-- For the console, the first letter of each choice is used as +-- the default shortcut key. Case is ignored. +-- +-- The optional {type} String argument gives the type of dialog. +-- It can be one of these values: "Error", "Question", "Info", +-- "Warning" or "Generic". Only the first character is relevant. +-- When {type} is omitted, "Generic" is used. +-- +-- The optional {type} argument gives the type of dialog. This +-- is only used for the icon of the Win32 GUI. It can be one of +-- these values: "Error", "Question", "Info", "Warning" or +-- "Generic". Only the first character is relevant. +-- When {type} is omitted, "Generic" is used. +-- +-- If the user aborts the dialog by pressing , CTRL-C, +-- or another valid interrupt key, confirm() returns 0. +-- +-- An example: +-- ```vim +-- let choice = confirm("What do you want?", +-- \ "&Apples\n&Oranges\n&Bananas", 2) +-- if choice == 0 +-- echo "make up your mind!" +-- elseif choice == 3 +-- echo "tasteful" +-- else +-- echo "I prefer bananas myself." +-- endif +-- ``` +-- In a GUI dialog, buttons are used. The layout of the buttons +-- depends on the 'v' flag in 'guioptions'. If it is included, +-- the buttons are always put vertically. Otherwise, confirm() +-- tries to put the buttons in one horizontal line. If they +-- don't fit, a vertical layout is used anyway. For some systems +-- the horizontal layout is always used. +-- +-- Can also be used as a |method|in: +-- ```vim +-- BuildMessage()->confirm("&Yes\n&No") +-- ``` +--- @param choices? any +--- @param default? any +--- @param type? any +--- @return number +function vim.fn.confirm(msg, choices, default, type) end + +-- Make a copy of {expr}. For Numbers and Strings this isn't +-- different from using {expr} directly. +-- When {expr} is a |List| a shallow copy is created. This means +-- that the original |List| can be changed without changing the +-- copy, and vice versa. But the items are identical, thus +-- changing an item changes the contents of both |Lists|. +-- A |Dictionary| is copied in a similar way as a |List|. +-- Also see |deepcopy()|. +-- Can also be used as a |method|: +-- ```vim +-- mylist->copy() +-- ``` +function vim.fn.copy(expr) end + +-- Return the cosine of {expr}, measured in radians, as a |Float|. +-- {expr} must evaluate to a |Float| or a |Number|. +-- Returns 0.0 if {expr} is not a |Float| or a |Number|. +-- Examples: +-- ```vim +-- :echo cos(100) +-- ``` +-- 0.862319 > +-- :echo cos(-4.01) +-- < -0.646043 +-- +-- Can also be used as a |method|: +-- ```vim +-- Compute()->cos() +-- ``` +--- @return float +function vim.fn.cos(expr) end + +-- Return the hyperbolic cosine of {expr} as a |Float| in the range +-- [1, inf]. +-- {expr} must evaluate to a |Float| or a |Number|. +-- Returns 0.0 if {expr} is not a |Float| or a |Number|. +-- Examples: +-- ```vim +-- :echo cosh(0.5) +-- ``` +-- 1.127626 > +-- :echo cosh(-0.5) +-- < -1.127626 +-- +-- Can also be used as a |method|: +-- ```vim +-- Compute()->cosh() +-- ``` +--- @return float +function vim.fn.cosh(expr) end + +-- Return the number of times an item with value {expr} appears +-- in |String|, |List| or |Dictionary| {comp}. +-- +-- If {start} is given then start with the item with this index. +-- {start} can only be used with a |List|. +-- +-- When {ic} is given and it's |TRUE| then case is ignored. +-- +-- When {comp} is a string then the number of not overlapping +-- occurrences of {expr} is returned. Zero is returned when +-- {expr} is an empty string. +-- +-- Can also be used as a |method|: +-- ```vim +-- mylist->count(val) +-- ``` +--- @param ic? any +--- @param start? number +--- @return number +function vim.fn.count(comp, expr, ic, start) end + +-- Returns a |Dictionary| representing the |context| at {index} +-- from the top of the |context-stack| (see |context-dict|). +-- If {index} is not given, it is assumed to be 0 (i.e.: top). +--- @param index? number +--- @return table +function vim.fn.ctxget(index) end + +-- Pops and restores the |context| at the top of the +-- |context-stack|. +function vim.fn.ctxpop() end + +-- Pushes the current editor state (|context|) on the +-- |context-stack|. +-- If {types} is given and is a |List| of |String|s, it specifies +-- which |context-types| to include in the pushed context. +-- Otherwise, all context types are included. +--- @param types? any +function vim.fn.ctxpush(types) end + +-- Sets the |context| at {index} from the top of the +-- |context-stack| to that represented by {context}. +-- {context} is a Dictionary with context data (|context-dict|). +-- If {index} is not given, it is assumed to be 0 (i.e.: top). +--- @param index? number +function vim.fn.ctxset(context, index) end + +-- Returns the size of the |context-stack|. +--- @return number +function vim.fn.ctxsize() end + +-- Positions the cursor at the column (byte count) {col} in the +-- line {lnum}. The first column is one. +-- +-- When there is one argument {list} this is used as a |List| +-- with two, three or four item: +-- [{lnum}, {col}] +-- [{lnum}, {col}, {off}] +-- [{lnum}, {col}, {off}, {curswant}] +-- This is like the return value of |getpos()| or |getcurpos()|, +-- but without the first item. +-- +-- To position the cursor using {col} as the character count, use +-- |setcursorcharpos()|. +-- +-- Does not change the jumplist. +-- {lnum} is used like with |getline()|, except that if {lnum} is +-- zero, the cursor will stay in the current line. +-- If {lnum} is greater than the number of lines in the buffer, +-- the cursor will be positioned at the last line in the buffer. +-- If {col} is greater than the number of bytes in the line, +-- the cursor will be positioned at the last character in the +-- line. +-- If {col} is zero, the cursor will stay in the current column. +-- If {curswant} is given it is used to set the preferred column +-- for vertical movement. Otherwise {col} is used. +-- +-- When 'virtualedit' is used {off} specifies the offset in +-- screen columns from the start of the character. E.g., a +-- position within a or after the last character. +-- Returns 0 when the position could be set, -1 otherwise. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetCursorPos()->cursor() +-- ``` +--- @param list any[] +--- @return number +function vim.fn.cursor(list) end + +-- Specifically used to interrupt a program being debugged. It +-- will cause process {pid} to get a SIGTRAP. Behavior for other +-- processes is undefined. See |terminal-debug|. +-- (Sends a SIGINT to a process {pid} other than MS-Windows) +-- +-- Returns |TRUE| if successfully interrupted the program. +-- Otherwise returns |FALSE|. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetPid()->debugbreak() +-- ``` +--- @return number +function vim.fn.debugbreak(pid) end + +-- Make a copy of {expr}. For Numbers and Strings this isn't +-- different from using {expr} directly. +-- When {expr} is a |List| a full copy is created. This means +-- that the original |List| can be changed without changing the +-- copy, and vice versa. When an item is a |List|, a copy for it +-- is made, recursively. Thus changing an item in the copy does +-- not change the contents of the original |List|. +-- +-- When {noref} is omitted or zero a contained |List| or +-- |Dictionary| is only copied once. All references point to +-- this single copy. With {noref} set to 1 every occurrence of a +-- |List| or |Dictionary| results in a new copy. This also means +-- that a cyclic reference causes deepcopy() to fail. +-- +-- Nesting is possible up to 100 levels. When there is an item +-- that refers back to a higher level making a deep copy with +-- {noref} set to 1 will fail. +-- Also see |copy()|. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetObject()->deepcopy() +-- ``` +--- @param noref? any +function vim.fn.deepcopy(expr, noref) end + +-- Without {flags} or with {flags} empty: Deletes the file by the +-- name {fname}. +-- +-- This also works when {fname} is a symbolic link. The symbolic +-- link itself is deleted, not what it points to. +-- +-- When {flags} is "d": Deletes the directory by the name +-- {fname}. This fails when directory {fname} is not empty. +-- +-- When {flags} is "rf": Deletes the directory by the name +-- {fname} and everything in it, recursively. BE CAREFUL! +-- Note: on MS-Windows it is not possible to delete a directory +-- that is being used. +-- +-- The result is a Number, which is 0/false if the delete +-- operation was successful and -1/true when the deletion failed +-- or partly failed. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetName()->delete() +-- ``` +--- @param flags? any +--- @return number +function vim.fn.delete(fname, flags) end + +-- Delete lines {first} to {last} (inclusive) from buffer {buf}. +-- If {last} is omitted then delete line {first} only. +-- On success 0 is returned, on failure 1 is returned. +-- +-- This function works only for loaded buffers. First call +-- |bufload()| if needed. +-- +-- For the use of {buf}, see |bufname()| above. +-- +-- {first} and {last} are used like with |getline()|. Note that +-- when using |line()| this refers to the current buffer. Use "$" +-- to refer to the last line in buffer {buf}. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetBuffer()->deletebufline(1) +-- ``` +--- @param buf buffer +--- @param last? any +--- @return number +function vim.fn.deletebufline(buf, first, last) end + +-- Adds a watcher to a dictionary. A dictionary watcher is +-- identified by three components: +-- +-- - A dictionary({dict}); +-- - A key pattern({pattern}). +-- - A function({callback}). +-- +-- After this is called, every change on {dict} and on keys +-- matching {pattern} will result in {callback} being invoked. +-- +-- For example, to watch all global variables: +-- ```vim +-- silent! call dictwatcherdel(g:, '*', 'OnDictChanged') +-- function! OnDictChanged(d,k,z) +-- echomsg string(a:k) string(a:z) +-- endfunction +-- call dictwatcheradd(g:, '*', 'OnDictChanged') +-- ``` +-- For now {pattern} only accepts very simple patterns that can +-- contain a "*" at the end of the string, in which case it will +-- match every key that begins with the substring before the "*". +-- That means if "*" is not the last character of {pattern}, only +-- keys that are exactly equal as {pattern} will be matched. +-- +-- The {callback} receives three arguments: +-- +-- - The dictionary being watched. +-- - The key which changed. +-- - A dictionary containing the new and old values for the key. +-- +-- The type of change can be determined by examining the keys +-- present on the third argument: +-- +-- - If contains both `old` and `new`, the key was updated. +-- - If it contains only `new`, the key was added. +-- - If it contains only `old`, the key was deleted. +-- +-- This function can be used by plugins to implement options with +-- validation and parsing logic. +--- @param dict table +--- @param callback fun() +function vim.fn.dictwatcheradd(dict, pattern, callback) end + +-- Removes a watcher added with |dictwatcheradd()|. All three +-- arguments must match the ones passed to |dictwatcheradd()| in +-- order for the watcher to be successfully deleted. +--- @param dict table +--- @param callback fun() +function vim.fn.dictwatcherdel(dict, pattern, callback) end + +-- Returns |TRUE| when autocommands are being executed and the +-- FileType event has been triggered at least once. Can be used +-- to avoid triggering the FileType event again in the scripts +-- that detect the file type. |FileType| +-- Returns |FALSE| when `:setf FALLBACK` was used. +-- When editing another file, the counter is reset, thus this +-- really checks if the FileType event has been triggered for the +-- current buffer. This allows an autocommand that starts +-- editing another buffer to set 'filetype' and load a syntax +-- file. +--- @return number +function vim.fn.did_filetype() end + +-- Returns the number of filler lines above line {lnum}. +-- These are the lines that were inserted at this point in +-- another diff'ed window. These filler lines are shown in the +-- display but don't exist in the buffer. +-- {lnum} is used like with |getline()|. Thus "." is the current +-- line, "'m" mark m, etc. +-- Returns 0 if the current window is not in diff mode. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetLnum()->diff_filler() +-- ``` +--- @param lnum number +--- @return number +function vim.fn.diff_filler(lnum) end + +-- Returns the highlight ID for diff mode at line {lnum} column +-- {col} (byte index). When the current line does not have a +-- diff change zero is returned. +-- {lnum} is used like with |getline()|. Thus "." is the current +-- line, "'m" mark m, etc. +-- {col} is 1 for the leftmost column, {lnum} is 1 for the first +-- line. +-- The highlight ID can be used with |synIDattr()| to obtain +-- syntax information about the highlighting. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetLnum()->diff_hlID(col) +-- ``` +--- @param lnum number +--- @param col number +--- @return number +function vim.fn.diff_hlID(lnum, col) end + +-- Return the digraph of {chars}. This should be a string with +-- exactly two characters. If {chars} are not just two +-- characters, or the digraph of {chars} does not exist, an error +-- is given and an empty string is returned. +-- +-- Also see |digraph_getlist()|. +-- +-- Examples: +-- ```vim +-- " Get a built-in digraph +-- :echo digraph_get('00') " Returns '∞' +-- +-- " Get a user-defined digraph +-- :call digraph_set('aa', 'あ') +-- :echo digraph_get('aa') " Returns 'あ' +-- ``` +-- Can also be used as a |method|: +-- ```vim +-- GetChars()->digraph_get() +-- ``` +--- @return string +function vim.fn.digraph_get(chars) end + +-- Return a list of digraphs. If the {listall} argument is given +-- and it is TRUE, return all digraphs, including the default +-- digraphs. Otherwise, return only user-defined digraphs. +-- +-- Also see |digraph_get()|. +-- +-- Examples: +-- ```vim +-- " Get user-defined digraphs +-- :echo digraph_getlist() +-- +-- " Get all the digraphs, including default digraphs +-- :echo digraph_getlist(1) +-- ``` +-- Can also be used as a |method|: +-- ```vim +-- GetNumber()->digraph_getlist() +-- ``` +--- @param listall? any +--- @return any[] +function vim.fn.digraph_getlist(listall) end + +-- Add digraph {chars} to the list. {chars} must be a string +-- with two characters. {digraph} is a string with one UTF-8 +-- encoded character. +-- Be careful, composing characters are NOT ignored. This +-- function is similar to |:digraphs| command, but useful to add +-- digraphs start with a white space. +-- +-- The function result is v:true if |digraph| is registered. If +-- this fails an error message is given and v:false is returned. +-- +-- If you want to define multiple digraphs at once, you can use +-- |digraph_setlist()|. +-- +-- Example: +-- ```vim +-- call digraph_set(' ', 'あ') +-- ``` +-- Can be used as a |method|: +-- ```vim +-- GetString()->digraph_set('あ') +-- ``` +--- @return boolean +function vim.fn.digraph_set(chars, digraph) end + +-- Similar to |digraph_set()| but this function can add multiple +-- digraphs at once. {digraphlist} is a list composed of lists, +-- where each list contains two strings with {chars} and +-- {digraph} as in |digraph_set()|. +-- Example: +-- ```vim +-- call digraph_setlist([['aa', 'あ'], ['ii', 'い']]) +-- ``` +-- It is similar to the following: +-- ```vim +-- for [chars, digraph] in [['aa', 'あ'], ['ii', 'い']] +-- call digraph_set(chars, digraph) +-- endfor +-- ``` +-- Except that the function returns after the first error, +-- following digraphs will not be added. +-- +-- Can be used as a |method|: +-- ```vim +-- GetList()->digraph_setlist() +-- ``` +--- @return boolean +function vim.fn.digraph_setlist(digraphlist) end + +-- Return the Number 1 if {expr} is empty, zero otherwise. +-- - A |List| or |Dictionary| is empty when it does not have any +-- items. +-- - A |String| is empty when its length is zero. +-- - A |Number| and |Float| are empty when their value is zero. +-- - |v:false| and |v:null| are empty, |v:true| is not. +-- - A |Blob| is empty when its length is zero. +-- +-- Can also be used as a |method|: +-- ```vim +-- mylist->empty() +-- ``` +--- @return number +function vim.fn.empty(expr) end + +-- Return all of environment variables as dictionary. You can +-- check if an environment variable exists like this: +-- ```vim +-- :echo has_key(environ(), 'HOME') +-- ``` +-- Note that the variable name may be CamelCase; to ignore case +-- use this: +-- ```vim +-- :echo index(keys(environ()), 'HOME', 0, 1) != -1 +-- ``` +--- @return table +function vim.fn.environ() end + +-- Escape the characters in {chars} that occur in {string} with a +-- backslash. Example: +-- ```vim +-- :echo escape('c:\program files\vim', ' \') +-- ``` +-- results in: > +-- c:\\program\ files\\vim +-- < Also see |shellescape()| and |fnameescape()|. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetText()->escape(' \') +-- ``` +--- @param string string +--- @return string +function vim.fn.escape(string, chars) end + +-- Evaluate {string} and return the result. Especially useful to +-- turn the result of |string()| back into the original value. +-- This works for Numbers, Floats, Strings, Blobs and composites +-- of them. Also works for |Funcref|s that refer to existing +-- functions. +-- +-- Can also be used as a |method|: +-- ```vim +-- argv->join()->eval() +-- ``` +--- @param string string +function vim.fn.eval(string) end + +-- Returns 1 when inside an event handler. That is that Vim got +-- interrupted while waiting for the user to type a character, +-- e.g., when dropping a file on Vim. This means interactive +-- commands cannot be used. Otherwise zero is returned. +--- @return number +function vim.fn.eventhandler() end + +-- This function checks if an executable with the name {expr} +-- exists. {expr} must be the name of the program without any +-- arguments. +-- executable() uses the value of $PATH and/or the normal +-- searchpath for programs. +-- On MS-Windows the ".exe", ".bat", etc. can optionally be +-- included. Then the extensions in $PATHEXT are tried. Thus if +-- "foo.exe" does not exist, "foo.exe.bat" can be found. If +-- $PATHEXT is not set then ".exe;.com;.bat;.cmd" is used. A dot +-- by itself can be used in $PATHEXT to try using the name +-- without an extension. When 'shell' looks like a Unix shell, +-- then the name is also tried without adding an extension. +-- On MS-Windows it only checks if the file exists and is not a +-- directory, not if it's really executable. +-- On Windows an executable in the same directory as Vim is +-- always found (it is added to $PATH at |startup|). +-- The result is a Number: +-- 1 exists +-- 0 does not exist +-- -1 not implemented on this system +-- |exepath()| can be used to get the full path of an executable. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetCommand()->executable() +-- ``` +--- @return number +function vim.fn.executable(expr) end + +-- Execute {command} and capture its output. +-- If {command} is a |String|, returns {command} output. +-- If {command} is a |List|, returns concatenated outputs. +-- Line continuations in {command} are not recognized. +-- Examples: +-- ```vim +-- echo execute('echon "foo"') +-- ``` +-- foo > +-- echo execute(['echon "foo"', 'echon "bar"']) +-- < foobar +-- +-- The optional {silent} argument can have these values: +-- "" no `:silent` used +-- "silent" `:silent` used +-- "silent!" `:silent!` used +-- The default is "silent". Note that with "silent!", unlike +-- `:redir`, error messages are dropped. +-- +-- To get a list of lines use `split()` on the result: +-- ```vim +-- execute('args')->split("\n") +-- +-- ``` +-- This function is not available in the |sandbox|. +-- Note: If nested, an outer execute() will not observe output of +-- the inner calls. +-- Note: Text attributes (highlights) are not captured. +-- To execute a command in another window than the current one +-- use `win_execute()`. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetCommand()->execute() +-- ``` +--- @param silent? any +--- @return string +function vim.fn.execute(command, silent) end + +-- Returns the full path of {expr} if it is an executable and +-- given as a (partial or full) path or is found in $PATH. +-- Returns empty string otherwise. +-- If {expr} starts with "./" the |current-directory| is used. +-- +-- Can also be used as a |method|: +-- ```vim +-- GetCommand()->exepath() +-- ``` +--- @return string +function vim.fn.exepath(expr) end + +-- The result is a Number, which is |TRUE| if {expr} is +-- defined, zero otherwise. +-- +-- For checking for a supported feature use |has()|. +-- For checking if a file exists use |filereadable()|. +-- +-- The {expr} argument is a string, which contains one of these: +-- varname internal variable (see +-- dict.key |internal-variables|). Also works +-- list[i] for |curly-braces-names|, |Dictionary| +-- entries, |List| items, etc. +-- Beware that evaluating an index may +-- cause an error message for an invalid +-- expression. E.g.: +-- ```vim +-- :let l = [1, 2, 3] +-- :echo exists("l[5]") +-- ``` +-- 0 > +-- :echo exists("l[xx]") +-- < E121: Undefined variable: xx +-- 0 +-- &option-name Vim option (only checks if it exists, +-- not if it really works) +-- +option-name Vim option that works. +-- $ENVNAME environment variable (could also be +-- done by comparing with an empty +-- string) +-- *funcname built-in function (see |functions|) +-- or user defined function (see +-- |user-function|). Also works for a +-- variable that is a Funcref. +-- :cmdname Ex command: built-in command, user +-- command or command modifier |:command|. +-- Returns: +-- 1 for match with start of a command +-- 2 full match with a command +-- 3 matches several user commands +-- To check for a supported command +-- always check the return value to be 2. +-- :2match The |:2match| command. +-- :3match The |:3match| command (but you +-- probably should not use it, it is +-- reserved for internal usage) +-- #event autocommand defined for this event +-- #event#pattern autocommand defined for this event and +-- pattern (the pattern is taken +-- literally and compared to the +-- autocommand patterns character by +-- character) +-- #group autocommand group exists +-- #group#event autocommand defined for this group and +-- event. +-- #group#event#pattern +-- autocommand defined for this group, +-- event and pattern. +-- ##event autocommand for this event is +-- supported. +-- +-- Examples: +-- ```vim +-- exists("&mouse") +-- exists("$HOSTNAME") +-- exists("*strftime") +-- exists("*s:MyFunc") +-- exists("*MyFunc") +-- exists("bufcount") +-- exists(":Make") +-- exists("#CursorHold") +-- exists("#BufReadPre#*.gz") +-- exists("#filetypeindent") +-- exists("#filetypeindent#FileType") +-- exists("#filetypeindent#FileType#*") +-- exists("##ColorScheme") +-- ``` +-- There must be no space between the symbol (&/$/*/#) and the +-- name. +-- There must be no extra characters after the name, although in +-- a few cases this is ignored. That may become stricter in the +-- future, thus don't count on it! +-- Working example: +-- ```vim +-- exists(":make") +-- ``` +-- NOT working example: > +-- exists(":make install") +-- +-- < Note that the argument must be a string, not the name of the +-- variable itself. For example: +-- ```vim +-- exists(bufcount) +-- ``` +-- This doesn't check for existence of the "bufcount" variable, +-- but gets the value of "bufcount", and checks if that exists. +-- +-- Can also be used as a |method|: +-- ```vim +-- Varname()->exists() +-- ``` +--- @return number +function vim.fn.exists(expr) end + +-- Return the exponential of {expr} as a |Float| in the range +-- [0, inf]. +-- {expr} must evaluate to a |Float| or a |Number|. +-- Returns 0.0 if {expr} is not a |Float| or a |Number|. +-- Examples: +-- ```vim +-- :echo exp(2) +-- ``` +-- 7.389056 > +-- :echo exp(-1) +-- < 0.367879 +-- +-- Can also be used as a |method|: +-- ```vim +-- Compute()->exp() +-- ``` +--- @return float +function vim.fn.exp(expr) end + +-- Expand wildcards and the following special keywords in +-- {string}. 'wildignorecase' applies. +-- +-- 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. +-- +-- If the expansion fails, the result is an empty string. A name +-- for a non-existing file is not included, unless {string} does +-- not start with '%', '#' or '<', see below. +-- +-- When {string} starts with '%', '#' or '<', the expansion is +-- done like for the |cmdline-special| variables with their +-- associated modifiers. Here is a short overview: +-- +-- % current file name +-- # alternate file name +-- #n alternate file name n +-- file name under the cursor +-- autocmd file name +-- autocmd buffer number (as a String!) +-- autocmd matched name +-- C expression under the cursor +-- sourced script file or function name +-- sourced script line number or function +-- line number +-- script file line number, also when in +-- a function +-- "123_" where "123" is the +-- current script ID || +--