mirror of
https://github.com/neovim/neovim.git
synced 2026-05-01 03:24:49 +00:00
Merge branch 'master' into option-fixes
This commit is contained in:
42
.travis.yml
42
.travis.yml
@@ -10,7 +10,7 @@ env:
|
||||
# http://docs.travis-ci.com/user/speeding-up-the-build/#Paralellizing-your-build-on-one-VM
|
||||
- MAKE_CMD="make -j2"
|
||||
# Update PATH for pip.
|
||||
- PATH="$(python2.7 -c 'import site; print(site.getuserbase())')/bin:/usr/lib/llvm-symbolizer-3.9/bin:$PATH"
|
||||
- PATH="$(python2.7 -c 'import site; print(site.getuserbase())')/bin:/usr/lib/llvm-symbolizer-4.0/bin:$PATH"
|
||||
# Build directory for Neovim.
|
||||
- BUILD_DIR="$TRAVIS_BUILD_DIR/build"
|
||||
# Build directory for third-party dependencies.
|
||||
@@ -21,13 +21,15 @@ env:
|
||||
- INSTALL_PREFIX="$HOME/nvim-install"
|
||||
# Log directory for Clang sanitizers and Valgrind.
|
||||
- LOG_DIR="$BUILD_DIR/log"
|
||||
# Nvim log file.
|
||||
- NVIM_LOG_FILE="$BUILD_DIR/.nvimlog"
|
||||
# Default CMake flags.
|
||||
- CMAKE_FLAGS="-DTRAVIS_CI_BUILD=ON
|
||||
-DCMAKE_BUILD_TYPE=Debug
|
||||
-DCMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX
|
||||
-DBUSTED_OUTPUT_TYPE=nvim
|
||||
-DDEPS_PREFIX=$DEPS_BUILD_DIR/usr
|
||||
-DMIN_LOG_LEVEL=2"
|
||||
-DMIN_LOG_LEVEL=3"
|
||||
- DEPS_CMAKE_FLAGS="-DDEPS_DOWNLOAD_DIR:PATH=$DEPS_DOWNLOAD_DIR"
|
||||
# Additional CMake flags for 32-bit builds.
|
||||
- CMAKE_FLAGS_32BIT="-DCMAKE_SYSTEM_LIBRARY_PATH=/lib32:/usr/lib32:/usr/local/lib32
|
||||
@@ -47,14 +49,19 @@ env:
|
||||
- FUNCTIONALTEST=functionaltest
|
||||
- CI_TARGET=tests
|
||||
|
||||
matrix:
|
||||
jobs:
|
||||
include:
|
||||
- stage: sanitizers
|
||||
os: linux
|
||||
compiler: clang-4.0
|
||||
env: >
|
||||
CLANG_SANITIZER=ASAN_UBSAN
|
||||
CMAKE_FLAGS="$CMAKE_FLAGS -DPREFER_LUA=ON"
|
||||
- os: linux
|
||||
env: CI_TARGET=lint
|
||||
- os: linux
|
||||
compiler: gcc-5
|
||||
env: GCOV=gcov-5 CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_GCOV=ON"
|
||||
- os: linux
|
||||
compiler: clang-4.0
|
||||
env: CLANG_SANITIZER=TSAN
|
||||
- stage: normal builds
|
||||
os: linux
|
||||
compiler: gcc-5
|
||||
env: FUNCTIONALTEST=functionaltest-lua
|
||||
- os: linux
|
||||
@@ -63,18 +70,19 @@ matrix:
|
||||
# dependencies in a separate cache.
|
||||
compiler: gcc-5 -m32
|
||||
env: BUILD_32BIT=ON
|
||||
- os: linux
|
||||
compiler: clang-3.9
|
||||
env: CLANG_SANITIZER=ASAN_UBSAN
|
||||
- os: linux
|
||||
compiler: clang-3.9
|
||||
env: CLANG_SANITIZER=TSAN
|
||||
- os: osx
|
||||
compiler: clang
|
||||
osx_image: xcode7.3 # macOS 10.11
|
||||
- os: osx
|
||||
compiler: gcc-4.9
|
||||
osx_image: xcode7.3 # macOS 10.11
|
||||
- stage: lint
|
||||
os: linux
|
||||
env: CI_TARGET=lint
|
||||
- stage: coverage
|
||||
os: linux
|
||||
compiler: gcc-5
|
||||
env: GCOV=gcov-5 CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_GCOV=ON"
|
||||
allow_failures:
|
||||
- env: GCOV=gcov-5 CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_GCOV=ON"
|
||||
fast_finish: true
|
||||
@@ -90,13 +98,13 @@ addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-trusty-3.9
|
||||
- llvm-toolchain-trusty-4.0
|
||||
packages:
|
||||
- autoconf
|
||||
- automake
|
||||
- apport
|
||||
- build-essential
|
||||
- clang-3.9
|
||||
- clang-4.0
|
||||
- cmake
|
||||
- cscope
|
||||
- g++-5-multilib
|
||||
@@ -107,7 +115,7 @@ addons:
|
||||
- language-pack-tr
|
||||
- libc6-dev-i386
|
||||
- libtool
|
||||
- llvm-3.9-dev
|
||||
- llvm-4.0-dev
|
||||
- locales
|
||||
- pkg-config
|
||||
- unzip
|
||||
|
||||
@@ -64,11 +64,11 @@ set_property(CACHE CMAKE_BUILD_TYPE PROPERTY
|
||||
# version string, else they are combined with the result of `git describe`.
|
||||
set(NVIM_VERSION_MAJOR 0)
|
||||
set(NVIM_VERSION_MINOR 2)
|
||||
set(NVIM_VERSION_PATCH 0)
|
||||
set(NVIM_VERSION_PATCH 1)
|
||||
set(NVIM_VERSION_PRERELEASE "-dev") # for package maintainers
|
||||
|
||||
# API level
|
||||
set(NVIM_API_LEVEL 2) # Bump this after any API change.
|
||||
set(NVIM_API_LEVEL 3) # Bump this after any API change.
|
||||
set(NVIM_API_LEVEL_COMPAT 0) # Adjust this after a _breaking_ API change.
|
||||
set(NVIM_API_PRERELEASE true)
|
||||
|
||||
@@ -96,15 +96,15 @@ if(CMAKE_C_FLAGS_RELEASE MATCHES "-O3")
|
||||
string(REPLACE "-O3" "-O2" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
|
||||
endif()
|
||||
|
||||
# Disable logging for release-type builds.
|
||||
if(NOT CMAKE_C_FLAGS_RELEASE MATCHES DDISABLE_LOG)
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DDISABLE_LOG")
|
||||
# Minimize logging for release-type builds.
|
||||
if(NOT CMAKE_C_FLAGS_RELEASE MATCHES DMIN_LOG_LEVEL)
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DMIN_LOG_LEVEL=3")
|
||||
endif()
|
||||
if(NOT CMAKE_C_FLAGS_MINSIZEREL MATCHES DDISABLE_LOG)
|
||||
set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} -DDISABLE_LOG")
|
||||
if(NOT CMAKE_C_FLAGS_MINSIZEREL MATCHES DMIN_LOG_LEVEL)
|
||||
set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} -DMIN_LOG_LEVEL=3")
|
||||
endif()
|
||||
if(NOT CMAKE_C_FLAGS_RELWITHDEBINFO MATCHES DDISABLE_LOG)
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -DDISABLE_LOG")
|
||||
if(NOT CMAKE_C_FLAGS_RELWITHDEBINFO MATCHES DMIN_LOG_LEVEL)
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -DMIN_LOG_LEVEL=3")
|
||||
endif()
|
||||
|
||||
# Enable assertions for RelWithDebInfo.
|
||||
@@ -221,9 +221,14 @@ else()
|
||||
add_definitions(-Wall -Wextra -pedantic -Wno-unused-parameter
|
||||
-Wstrict-prototypes -std=gnu99)
|
||||
|
||||
check_c_compiler_flag(-Wimplicit-fallthrough HAS_WIMPLICIT_FALLTHROUGH_FLAG)
|
||||
if(HAS_WIMPLICIT_FALLTHROUGH_FLAG)
|
||||
add_definitions(-Wimplicit-fallthrough)
|
||||
endif()
|
||||
|
||||
# On FreeBSD 64 math.h uses unguarded C11 extension, which taints clang
|
||||
# 3.4.1 used there.
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" AND CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
add_definitions(-Wno-c11-extensions)
|
||||
endif()
|
||||
endif()
|
||||
@@ -309,6 +314,20 @@ include_directories(SYSTEM ${LIBUV_INCLUDE_DIRS})
|
||||
find_package(Msgpack 1.0.0 REQUIRED)
|
||||
include_directories(SYSTEM ${MSGPACK_INCLUDE_DIRS})
|
||||
|
||||
# Note: The test lib requires LuaJIT; it will be skipped if LuaJIT is missing.
|
||||
option(PREFER_LUA "Prefer Lua over LuaJIT in the nvim executable." OFF)
|
||||
|
||||
if(PREFER_LUA)
|
||||
find_package(Lua REQUIRED)
|
||||
set(LUA_PREFERRED_INCLUDE_DIRS ${LUA_INCLUDE_DIR})
|
||||
set(LUA_PREFERRED_LIBRARIES ${LUA_LIBRARIES})
|
||||
find_package(LuaJit)
|
||||
else()
|
||||
find_package(LuaJit REQUIRED)
|
||||
set(LUA_PREFERRED_INCLUDE_DIRS ${LUAJIT_INCLUDE_DIRS})
|
||||
set(LUA_PREFERRED_LIBRARIES ${LUAJIT_LIBRARIES})
|
||||
endif()
|
||||
|
||||
list(APPEND CMAKE_REQUIRED_INCLUDES "${MSGPACK_INCLUDE_DIRS}")
|
||||
check_c_source_compiles("
|
||||
#include <msgpack.h>
|
||||
@@ -324,11 +343,7 @@ if(MSGPACK_HAS_FLOAT32)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNVIM_MSGPACK_HAS_FLOAT32")
|
||||
endif()
|
||||
|
||||
if(UNIX)
|
||||
option(FEAT_TUI "Enable the Terminal UI" ON)
|
||||
else()
|
||||
option(FEAT_TUI "Enable the Terminal UI" OFF)
|
||||
endif()
|
||||
option(FEAT_TUI "Enable the Terminal UI" ON)
|
||||
|
||||
if(FEAT_TUI)
|
||||
find_package(Unibilium REQUIRED)
|
||||
@@ -430,11 +445,7 @@ message(STATUS "Using the Lua interpreter ${LUA_PRG}.")
|
||||
find_program(BUSTED_PRG NAMES busted busted.bat)
|
||||
find_program(BUSTED_LUA_PRG busted-lua)
|
||||
if(NOT BUSTED_OUTPUT_TYPE)
|
||||
if(WIN32)
|
||||
set(BUSTED_OUTPUT_TYPE "plainTerminal")
|
||||
else()
|
||||
set(BUSTED_OUTPUT_TYPE "utfTerminal")
|
||||
endif()
|
||||
set(BUSTED_OUTPUT_TYPE "nvim")
|
||||
endif()
|
||||
|
||||
find_program(LUACHECK_PRG luacheck)
|
||||
@@ -445,7 +456,6 @@ include(InstallHelpers)
|
||||
file(GLOB MANPAGES
|
||||
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
man/nvim.1)
|
||||
|
||||
install_helper(
|
||||
FILES ${MANPAGES}
|
||||
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
|
||||
@@ -453,11 +463,11 @@ install_helper(
|
||||
# MIN_LOG_LEVEL for log.h
|
||||
if(DEFINED MIN_LOG_LEVEL)
|
||||
if(NOT MIN_LOG_LEVEL MATCHES "^[0-3]$")
|
||||
message(FATAL_ERROR "MIN_LOG_LEVEL must be a number 0-3")
|
||||
message(FATAL_ERROR "invalid MIN_LOG_LEVEL: " ${MIN_LOG_LEVEL})
|
||||
endif()
|
||||
message(STATUS "MIN_LOG_LEVEL set to ${MIN_LOG_LEVEL}")
|
||||
else()
|
||||
message(STATUS "MIN_LOG_LEVEL not specified, defaulting to INFO(1)")
|
||||
message(STATUS "MIN_LOG_LEVEL not specified, defaulting to 1 (INFO)")
|
||||
endif()
|
||||
|
||||
# Go down the tree.
|
||||
@@ -590,9 +600,26 @@ if(LUACHECK_PRG)
|
||||
add_custom_target(testlint
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-DLUACHECK_PRG=${LUACHECK_PRG}
|
||||
-DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
|
||||
-DLUAFILES_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
|
||||
-DIGNORE_PATTERN="*/preload.lua"
|
||||
-DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
|
||||
-P ${PROJECT_SOURCE_DIR}/cmake/RunTestsLint.cmake)
|
||||
-P ${PROJECT_SOURCE_DIR}/cmake/RunLuacheck.cmake)
|
||||
|
||||
add_custom_target(
|
||||
blobcodelint
|
||||
COMMAND
|
||||
${CMAKE_COMMAND}
|
||||
-DLUACHECK_PRG=${LUACHECK_PRG}
|
||||
-DLUAFILES_DIR=${CMAKE_CURRENT_SOURCE_DIR}/src/nvim/lua
|
||||
-DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
|
||||
-DREAD_GLOBALS=vim
|
||||
-P ${PROJECT_SOURCE_DIR}/cmake/RunLuacheck.cmake
|
||||
)
|
||||
# TODO(ZyX-I): Run linter for all lua code in src
|
||||
add_custom_target(
|
||||
lualint
|
||||
DEPENDS blobcodelint
|
||||
)
|
||||
endif()
|
||||
|
||||
set(CPACK_PACKAGE_NAME "Neovim")
|
||||
|
||||
@@ -6,9 +6,10 @@ Getting started
|
||||
If you want to help but don't know where to start, here are some
|
||||
low-risk/isolated tasks:
|
||||
|
||||
- Merge a [Vim patch].
|
||||
- [Merge a Vim patch].
|
||||
- Try a [complexity:low] issue.
|
||||
- Fix [clang-scan], [coverity](#coverity), and [PVS](#pvs-studio) warnings.
|
||||
- Fix bugs found by [clang scan-build](#clang-scan-build),
|
||||
[coverity](#coverity), and [PVS](#pvs-studio).
|
||||
|
||||
Developer guidelines
|
||||
--------------------
|
||||
@@ -22,18 +23,16 @@ Reporting problems
|
||||
- Check the [**FAQ**][wiki-faq].
|
||||
- Search [existing issues][github-issues] (including closed!)
|
||||
- Update Neovim to the latest version to see if your problem persists.
|
||||
- If you're using a plugin manager, comment out your plugins, then add them back
|
||||
in one by one, to narrow down the cause of the issue.
|
||||
- Crash reports which include a stacktrace are 10x more valuable.
|
||||
- [Bisecting][git-bisect] to the cause of a regression often leads to an
|
||||
immediate fix.
|
||||
- Disable plugins incrementally, to narrow down the cause of the issue.
|
||||
- When reporting a crash, include a stacktrace.
|
||||
- [Bisect][git-bisect] to the cause of a regression, if you are able. This is _extremely_ helpful.
|
||||
- Check `$NVIM_LOG_FILE`, if it exists.
|
||||
|
||||
Pull requests ("PRs")
|
||||
---------------------
|
||||
|
||||
- To avoid duplicate work, create a `[WIP]` pull request as soon as possible.
|
||||
- Avoid cosmetic changes to unrelated files in the same commit: noise makes
|
||||
reviews take longer.
|
||||
- Avoid cosmetic changes to unrelated files in the same commit.
|
||||
- Use a [feature branch][git-feature-branch] instead of the master branch.
|
||||
- Use a **rebase workflow** for small PRs.
|
||||
- After addressing review comments, it's fine to rebase and force-push.
|
||||
@@ -43,7 +42,7 @@ Pull requests ("PRs")
|
||||
- Use the `ri` git alias:
|
||||
```
|
||||
[alias]
|
||||
ri = "!sh -c 't=\"${1:-master}\" ; s=\"${2:-HEAD}\" ; if git merge-base --is-ancestor \"$t\" \"$s\" ; then o=\"$t\" ; else mb=\"$(git merge-base \"$t\" \"$s\")\" ; if test \"x$mb\" = x ; then o=\"$t\" ; else lm=\"$(git log -n1 --merges \"$t..$s\" --pretty=%H)\" ; if test \"x$lm\" = x ; then o=\"$mb\" ; else o=\"$lm\" ; fi ; fi ; fi ; [ $# -gt 0 ] && shift ; [ $# -gt 0 ] && shift ; git rebase --interactive \"$o\" \"$@\"' -"
|
||||
ri = "!sh -c 't=\"${1:-master}\"; s=\"${2:-HEAD}\"; mb=\"$(git merge-base \"$t\" \"$s\")\"; if test \"x$mb\" = x ; then o=\"$t\"; else lm=\"$(git log -n1 --merges \"$t..$s\" --pretty=%H)\"; if test \"x$lm\" = x ; then o=\"$mb\"; else o=\"$lm\"; fi; fi; test $# -gt 0 && shift; test $# -gt 0 && shift; git rebase --interactive \"$o\" \"$@\"'"
|
||||
```
|
||||
This avoids unnecessary rebases yet still allows you to combine related
|
||||
commits, separate monolithic commits, etc.
|
||||
@@ -86,10 +85,11 @@ the VCS/git logs more valuable.
|
||||
|
||||
### Automated builds (CI)
|
||||
|
||||
Each pull request must pass the automated builds ([travis CI] and [quickbuild]).
|
||||
Each pull request must pass the automated builds on [travis CI], [quickbuild]
|
||||
and [AppVeyor].
|
||||
|
||||
- CI builds are compiled with [`-Werror`][gcc-warnings], so if your PR
|
||||
introduces any compiler warnings, the build will fail.
|
||||
- CI builds are compiled with [`-Werror`][gcc-warnings], so compiler warnings
|
||||
will fail the build.
|
||||
- If any tests fail, the build will fail.
|
||||
See [Building Neovim#running-tests][wiki-run-tests] to run tests locally.
|
||||
Passing locally doesn't guarantee passing the CI build, because of the
|
||||
@@ -112,11 +112,19 @@ QuickBuild uses this invocation:
|
||||
VERBOSE=1 nvim unittest-prereqs functionaltest-prereqs
|
||||
|
||||
|
||||
### Clang scan-build
|
||||
|
||||
The auto-generated [clang-scan] report presents walk-throughs of bugs found by
|
||||
Clang's [scan-build](https://clang-analyzer.llvm.org/scan-build.html) static
|
||||
analyzer. To verify a fix locally, run `scan-build` like this:
|
||||
|
||||
rm -rf build/
|
||||
scan-build --use-analyzer=/usr/bin/clang make
|
||||
|
||||
### Coverity
|
||||
|
||||
[Coverity](https://scan.coverity.com/projects/neovim-neovim) runs against the
|
||||
master build. If you want to view the defects, just request access at the
|
||||
_Contributor_ level. An Admin will grant you permission.
|
||||
master build. To view the defects, just request access; you will be approved.
|
||||
|
||||
Use this commit-message format for coverity fixes:
|
||||
|
||||
@@ -126,8 +134,9 @@ where `<id>` is the Coverity ID (CID). For example see [#804](https://github.com
|
||||
|
||||
### PVS-Studio
|
||||
|
||||
Run `scripts/pvscheck.sh` to check the codebase with [PVS
|
||||
Studio](https://www.viva64.com/en/pvs-studio/).
|
||||
View the [PVS analysis report](https://neovim.io/doc/reports/pvs/) to see bugs
|
||||
found by [PVS Studio](https://www.viva64.com/en/pvs-studio/).
|
||||
You can run `scripts/pvscheck.sh` locally to run PVS on your machine.
|
||||
|
||||
Reviewing
|
||||
---------
|
||||
@@ -163,6 +172,7 @@ as context, use the `-W` argument as well.
|
||||
[3174]: https://github.com/neovim/neovim/issues/3174
|
||||
[travis CI]: https://travis-ci.org/neovim/neovim
|
||||
[quickbuild]: http://neovim-qb.szakmeister.net/dashboard
|
||||
[Vim patch]: https://github.com/neovim/neovim/wiki/Merging-patches-from-upstream-Vim
|
||||
[AppVeyor]: https://ci.appveyor.com/project/neovim/neovim
|
||||
[Merge a Vim patch]: https://github.com/neovim/neovim/wiki/Merging-patches-from-upstream-Vim
|
||||
[clang-scan]: https://neovim.io/doc/reports/clang/
|
||||
[complexity:low]: https://github.com/neovim/neovim/issues?q=is%3Aopen+is%3Aissue+label%3Acomplexity%3Alow
|
||||
|
||||
10
Makefile
10
Makefile
@@ -107,6 +107,9 @@ functionaltest-lua: | nvim
|
||||
testlint: | build/.ran-cmake deps
|
||||
$(BUILD_CMD) -C build testlint
|
||||
|
||||
lualint: | build/.ran-cmake deps
|
||||
$(BUILD_CMD) -C build lualint
|
||||
|
||||
unittest: | nvim
|
||||
+$(BUILD_CMD) -C build unittest
|
||||
|
||||
@@ -135,6 +138,9 @@ clint-full: build/.ran-cmake
|
||||
check-single-includes: build/.ran-cmake
|
||||
+$(BUILD_CMD) -C build check-single-includes
|
||||
|
||||
lint: check-single-includes clint testlint
|
||||
appimage:
|
||||
bash scripts/genappimage.sh
|
||||
|
||||
.PHONY: test testlint functionaltest unittest lint clint clean distclean nvim libnvim cmake deps install
|
||||
lint: check-single-includes clint testlint lualint
|
||||
|
||||
.PHONY: test testlint lualint functionaltest unittest lint clint clean distclean nvim libnvim cmake deps install appimage
|
||||
|
||||
50
README.md
50
README.md
@@ -8,11 +8,13 @@
|
||||
|
||||
[](https://travis-ci.org/neovim/neovim)
|
||||
[](https://ci.appveyor.com/project/neovim/neovim/branch/master)
|
||||
[](https://waffle.io/neovim/neovim)
|
||||
[](https://coveralls.io/r/neovim/neovim)
|
||||
[](https://scan.coverity.com/projects/2227)
|
||||
[](https://neovim.io/doc/reports/clang)
|
||||
[](https://neovim.io/doc/reports/pvs)
|
||||
|
||||
<a href="https://buildd.debian.org/neovim"><img src="https://www.debian.org/logos/openlogo-nd-25.png" width="13" height="15">Debian</a>
|
||||
[](https://github.com/neovim/neovim/releases/)
|
||||
|
||||
Neovim is a project that seeks to aggressively refactor Vim in order to:
|
||||
|
||||
@@ -37,34 +39,41 @@ See [the wiki](https://github.com/neovim/neovim/wiki/Building-Neovim) for detail
|
||||
Install from package
|
||||
--------------------
|
||||
|
||||
Packages are in [Homebrew], [Debian], [Ubuntu], [Fedora], [Arch Linux], and
|
||||
[more](https://github.com/neovim/neovim/wiki/Installing-Neovim).
|
||||
Pre-built packages for Windows, macOS, and Linux are found at the
|
||||
[Releases](https://github.com/neovim/neovim/releases/) page.
|
||||
|
||||
Managed packages are in [Homebrew], [Debian], [Ubuntu], [Fedora], [Arch Linux], [Gentoo],
|
||||
and [more](https://github.com/neovim/neovim/wiki/Installing-Neovim)!
|
||||
|
||||
Project layout
|
||||
--------------
|
||||
|
||||
- `ci/`: Build server scripts
|
||||
- `cmake/`: Build scripts
|
||||
- `runtime/`: Application files
|
||||
- [`src/`](src/nvim/README.md): Application source code
|
||||
- `third-party/`: CMake sub-project to build third-party dependencies (if the
|
||||
`USE_BUNDLED_DEPS` flag is undefined or `USE_BUNDLED` CMake option is false).
|
||||
- [`test/`](test/README.md): Test files
|
||||
├─ ci/ Build server scripts
|
||||
├─ cmake/ Build scripts
|
||||
├─ runtime/ User plugins/docs
|
||||
├─ src/ Source code
|
||||
├─ third-party/ CMake subproject to build dependencies
|
||||
└─ test/ Test code
|
||||
|
||||
What's been done so far
|
||||
-----------------------
|
||||
- `third-party/` is activated if `USE_BUNDLED_DEPS` is undefined or the
|
||||
`USE_BUNDLED` CMake option is true.
|
||||
- [Source README](src/nvim/README.md)
|
||||
- [Test README](test/README.md)
|
||||
|
||||
- RPC API based on [MessagePack](https://msgpack.org)
|
||||
- Embedded [terminal emulator](https://neovim.io/doc/user/nvim_terminal_emulator.html)
|
||||
Features
|
||||
--------
|
||||
|
||||
- Modern [GUIs](https://github.com/neovim/neovim/wiki/Related-projects#gui)
|
||||
- [API](https://github.com/neovim/neovim/wiki/Related-projects#api-clients)
|
||||
access from any language including clojure, lisp, go, haskell, lua,
|
||||
javascript, perl, python, ruby, rust.
|
||||
- Embedded, scriptable [terminal emulator](https://neovim.io/doc/user/nvim_terminal_emulator.html)
|
||||
- Asynchronous [job control](https://github.com/neovim/neovim/pull/2247)
|
||||
- [Shared data (shada)](https://github.com/neovim/neovim/pull/2506) among multiple editor instances
|
||||
- [XDG base directories](https://github.com/neovim/neovim/pull/3470) support
|
||||
- [libuv](https://github.com/libuv/libuv/)-based platform/OS layer
|
||||
- [Pushdown automaton](https://github.com/neovim/neovim/pull/3413) input model
|
||||
- 1000s of new tests
|
||||
- Legacy tests converted to Lua tests
|
||||
- Compatible with most Vim plugins, including Ruby and Python plugins.
|
||||
|
||||
See [`:help nvim-features`][nvim-features] for a comprehensive list.
|
||||
See [`:help nvim-features`][nvim-features] for the full list!
|
||||
|
||||
License
|
||||
-------
|
||||
@@ -95,11 +104,12 @@ See `LICENSE` for details.
|
||||
[license-commit]: https://github.com/neovim/neovim/commit/b17d9691a24099c9210289f16afb1a498a89d803
|
||||
[nvim-features]: https://neovim.io/doc/user/vim_diff.html#nvim-features
|
||||
[Roadmap]: https://neovim.io/roadmap/
|
||||
[advanced UIs]: https://github.com/neovim/neovim/wiki/Related-projects#gui-projects
|
||||
[advanced UIs]: https://github.com/neovim/neovim/wiki/Related-projects#gui
|
||||
[Homebrew]: https://github.com/neovim/homebrew-neovim#installation
|
||||
[Debian]: https://packages.debian.org/testing/neovim
|
||||
[Ubuntu]: http://packages.ubuntu.com/search?keywords=neovim
|
||||
[Fedora]: https://admin.fedoraproject.org/pkgdb/package/rpms/neovim
|
||||
[Arch Linux]: https://www.archlinux.org/packages/?q=neovim
|
||||
[Gentoo]: https://packages.gentoo.org/packages/app-editors/neovim
|
||||
|
||||
<!-- vim: set tw=80: -->
|
||||
|
||||
10
ci/build.bat
10
ci/build.bat
@@ -17,7 +17,7 @@ set PATH=C:\Program Files (x86)\CMake\bin\cpack.exe;%PATH%
|
||||
|
||||
:: Build third-party dependencies
|
||||
C:\msys64\usr\bin\bash -lc "pacman --verbose --noconfirm -Su" || goto :error
|
||||
C:\msys64\usr\bin\bash -lc "pacman --verbose --noconfirm --needed -S mingw-w64-%ARCH%-cmake mingw-w64-%ARCH%-perl mingw-w64-%ARCH%-diffutils gperf" || goto :error
|
||||
C:\msys64\usr\bin\bash -lc "pacman --verbose --noconfirm --needed -S mingw-w64-%ARCH%-cmake mingw-w64-%ARCH%-perl mingw-w64-%ARCH%-diffutils mingw-w64-%ARCH%-unibilium gperf" || goto :error
|
||||
|
||||
:: Setup python (use AppVeyor system python)
|
||||
C:\Python27\python.exe -m pip install neovim || goto :error
|
||||
@@ -31,14 +31,14 @@ python3 -c "import neovim; print(str(neovim))" || goto :error
|
||||
|
||||
mkdir .deps
|
||||
cd .deps
|
||||
cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release ..\third-party\ || goto :error
|
||||
cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=RelWithDebInfo ..\third-party\ || goto :error
|
||||
mingw32-make VERBOSE=1 || goto :error
|
||||
cd ..
|
||||
|
||||
:: Build Neovim
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DBUSTED_OUTPUT_TYPE=nvim -DGPERF_PRG="C:\msys64\usr\bin\gperf.exe" .. || goto :error
|
||||
cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUSTED_OUTPUT_TYPE=nvim -DGPERF_PRG="C:\msys64\usr\bin\gperf.exe" .. || goto :error
|
||||
mingw32-make VERBOSE=1 || goto :error
|
||||
bin\nvim --version || goto :error
|
||||
|
||||
@@ -46,8 +46,8 @@ bin\nvim --version || goto :error
|
||||
mingw32-make functionaltest VERBOSE=1 || goto :error
|
||||
|
||||
:: Build artifacts
|
||||
cpack -G ZIP -C Release
|
||||
if defined APPVEYOR_REPO_TAG_NAME cpack -G NSIS -C Release
|
||||
cpack -G ZIP -C RelWithDebInfo
|
||||
if defined APPVEYOR_REPO_TAG_NAME cpack -G NSIS -C RelWithDebInfo
|
||||
|
||||
goto :EOF
|
||||
:error
|
||||
|
||||
@@ -7,10 +7,11 @@ build_make() {
|
||||
}
|
||||
|
||||
build_deps() {
|
||||
if [[ "${BUILD_32BIT}" == ON ]]; then
|
||||
if test "${BUILD_32BIT}" = ON ; then
|
||||
DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} ${CMAKE_FLAGS_32BIT}"
|
||||
fi
|
||||
if [[ "${FUNCTIONALTEST}" == "functionaltest-lua" ]]; then
|
||||
if test "${FUNCTIONALTEST}" = "functionaltest-lua" \
|
||||
|| test "${CLANG_SANITIZER}" = "ASAN_UBSAN" ; then
|
||||
DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} -DUSE_BUNDLED_LUA=ON"
|
||||
fi
|
||||
|
||||
@@ -18,16 +19,15 @@ build_deps() {
|
||||
|
||||
# If there is a valid cache and we're not forced to recompile,
|
||||
# use cached third-party dependencies.
|
||||
if [[ -f "${CACHE_MARKER}" ]] && [[ "${BUILD_NVIM_DEPS}" != true ]]; then
|
||||
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
|
||||
local statcmd="stat -f '%Sm'"
|
||||
else
|
||||
local statcmd="stat -c '%y'"
|
||||
if test -f "${CACHE_MARKER}" && test "${BUILD_NVIM_DEPS}" != "true" ; then
|
||||
local statcmd="stat -c '%y'"
|
||||
if test "${TRAVIS_OS_NAME}" = osx ; then
|
||||
statcmd="stat -f '%Sm'"
|
||||
fi
|
||||
echo "Using third-party dependencies from Travis's cache (last updated: $(${statcmd} "${CACHE_MARKER}"))."
|
||||
|
||||
mkdir -p "$(dirname "${DEPS_BUILD_DIR}")"
|
||||
mv "${HOME}/.cache/nvim-deps" "${DEPS_BUILD_DIR}"
|
||||
mkdir -p "$(dirname "${DEPS_BUILD_DIR}")"
|
||||
mv "${HOME}/.cache/nvim-deps" "${DEPS_BUILD_DIR}"
|
||||
else
|
||||
mkdir -p "${DEPS_BUILD_DIR}"
|
||||
fi
|
||||
@@ -46,10 +46,10 @@ build_deps() {
|
||||
}
|
||||
|
||||
prepare_build() {
|
||||
if [[ -n "${CLANG_SANITIZER}" ]]; then
|
||||
if test -n "${CLANG_SANITIZER}" ; then
|
||||
CMAKE_FLAGS="${CMAKE_FLAGS} -DCLANG_${CLANG_SANITIZER}=ON"
|
||||
fi
|
||||
if [[ "${BUILD_32BIT}" == ON ]]; then
|
||||
if test "${BUILD_32BIT}" = ON ; then
|
||||
CMAKE_FLAGS="${CMAKE_FLAGS} ${CMAKE_FLAGS_32BIT}"
|
||||
fi
|
||||
|
||||
@@ -61,24 +61,24 @@ prepare_build() {
|
||||
|
||||
build_nvim() {
|
||||
echo "Building nvim."
|
||||
if ! top_make nvim; then
|
||||
if ! top_make nvim ; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$CLANG_SANITIZER" != "TSAN" ]; then
|
||||
if test "$CLANG_SANITIZER" != "TSAN" ; then
|
||||
echo "Building libnvim."
|
||||
if ! top_make libnvim; then
|
||||
if ! top_make libnvim ; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Building nvim-test."
|
||||
if ! top_make nvim-test; then
|
||||
if ! top_make nvim-test ; then
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Invoke nvim to trigger *San early.
|
||||
if ! (bin/nvim --version && bin/nvim -u NONE -e -c ':qall'); then
|
||||
if ! (bin/nvim --version && bin/nvim -u NONE -e -c ':qall') ; then
|
||||
asan_check "${LOG_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -11,20 +11,48 @@ FAIL_SUMMARY=""
|
||||
END_MARKER="$BUILD_DIR/.tests_finished"
|
||||
FAIL_SUMMARY_FILE="$BUILD_DIR/.test_errors"
|
||||
|
||||
ANSI_CLEAR="\033[0K"
|
||||
|
||||
travis_fold() {
|
||||
local action="$1"
|
||||
local name="$2"
|
||||
name="$(echo -n "$name" | tr '\n\0' '--' | sed 's/[^A-Za-z0-9]\{1,\}/-/g')"
|
||||
name="$(echo -n "$name" | sed 's/-$//')"
|
||||
echo -en "travis_fold:${action}:${name}\r${ANSI_CLEAR}"
|
||||
}
|
||||
|
||||
if test "$TRAVIS" != "true" ; then
|
||||
travis_fold() {
|
||||
return 0
|
||||
}
|
||||
fi
|
||||
|
||||
enter_suite() {
|
||||
set +x
|
||||
FAILED=0
|
||||
rm -f "${END_MARKER}"
|
||||
local suite_name="$1"
|
||||
export NVIM_TEST_CURRENT_SUITE="${NVIM_TEST_CURRENT_SUITE}/$suite_name"
|
||||
travis_fold start "${NVIM_TEST_CURRENT_SUITE}"
|
||||
set -x
|
||||
}
|
||||
|
||||
exit_suite() {
|
||||
set +x
|
||||
if test -f "$NVIM_LOG_FILE" ; then
|
||||
printf "===============================================================================\n"
|
||||
printf "NVIM_LOG_FILE: $NVIM_LOG_FILE\n"
|
||||
cat "$NVIM_LOG_FILE" 2>/dev/null || printf '(empty)'
|
||||
printf "\n"
|
||||
rm -rf "$NVIM_LOG_FILE"
|
||||
fi
|
||||
travis_fold end "${NVIM_TEST_CURRENT_SUITE}"
|
||||
if test $FAILED -ne 0 ; then
|
||||
echo "Suite ${NVIM_TEST_CURRENT_SUITE} failed, summary:"
|
||||
echo "${FAIL_SUMMARY}"
|
||||
fi
|
||||
export NVIM_TEST_CURRENT_SUITE="${NVIM_TEST_CURRENT_SUITE%/*}"
|
||||
if test "x$1" != "x--continue" ; then
|
||||
if test "$1" != "--continue" ; then
|
||||
exit $FAILED
|
||||
else
|
||||
local saved_failed=$FAILED
|
||||
@@ -61,7 +89,7 @@ run_test() {
|
||||
|
||||
run_test_wd() {
|
||||
local hang_ok=
|
||||
if test "x$1" = "x--allow-hang" ; then
|
||||
if test "$1" = "--allow-hang" ; then
|
||||
hang_ok=1
|
||||
shift
|
||||
fi
|
||||
@@ -82,21 +110,31 @@ run_test_wd() {
|
||||
|
||||
local output_file="$(mktemp)"
|
||||
local status_file="$(mktemp)"
|
||||
local sid_file="$(mktemp)"
|
||||
|
||||
local restarts=5
|
||||
local prev_tmpsize=-1
|
||||
while test $restarts -gt 0 ; do
|
||||
: > "${status_file}"
|
||||
(
|
||||
set -o pipefail
|
||||
ret=0
|
||||
if ! eval "$cmd" 2>&1 | tee -a "$output_file" ; then
|
||||
ret=1
|
||||
fi
|
||||
echo "$ret" > "$status_file"
|
||||
exit $ret
|
||||
) &
|
||||
local pid=$!
|
||||
: > "$status_file"
|
||||
: > "$sid_file"
|
||||
setsid \
|
||||
env \
|
||||
output_file="$output_file" \
|
||||
status_file="$status_file" \
|
||||
sid_file="$sid_file" \
|
||||
cmd="$cmd" \
|
||||
CI_DIR="$CI_DIR" \
|
||||
sh -c '
|
||||
. "${CI_DIR}/common/test.sh"
|
||||
ps -o sid= > "$sid_file"
|
||||
(
|
||||
ret=0
|
||||
if ! eval "$cmd" 2>&1 ; then
|
||||
ret=1
|
||||
fi
|
||||
echo "$ret" > "$status_file"
|
||||
) | tee -a "$output_file"
|
||||
'
|
||||
while test "$(stat -c "%s" "$status_file")" -eq 0 ; do
|
||||
prev_tmpsize=$tmpsize
|
||||
sleep $timeout
|
||||
@@ -106,13 +144,23 @@ run_test_wd() {
|
||||
break
|
||||
fi
|
||||
done
|
||||
restarts=$[ restarts - 1 ]
|
||||
restarts=$(( restarts - 1 ))
|
||||
if test "$(stat -c "%s" "$status_file")" -eq 0 ; then
|
||||
# status file not updated, assuming hang
|
||||
kill -KILL $pid
|
||||
# Status file not updated, assuming hang
|
||||
|
||||
# SID not known, this should not ever happen
|
||||
if test "$(stat -c "%s" "$sid_file")" -eq 0 ; then
|
||||
fail "$test_name" E "Shell did not run"
|
||||
break
|
||||
fi
|
||||
|
||||
# Kill all processes which belong to one session: should get rid of test
|
||||
# processes as well as sh itself.
|
||||
pkill -KILL -s$(cat "$sid_file")
|
||||
|
||||
if test $restarts -eq 0 ; then
|
||||
if test "x$hang_ok" = "x" ; then
|
||||
fail "${test_name}" E "Test hang up"
|
||||
if test -z "$hang_ok" ; then
|
||||
fail "$test_name" E "Test hang up"
|
||||
fi
|
||||
else
|
||||
echo "Test ${test_name} hang up, restarting"
|
||||
@@ -120,21 +168,25 @@ run_test_wd() {
|
||||
fi
|
||||
else
|
||||
local new_failed="$(cat "$status_file")"
|
||||
if test "x$new_failed" != "x0" ; then
|
||||
fail "${test_name}" F "Test failed in run_test_wd"
|
||||
if test "$new_failed" != "0" ; then
|
||||
fail "$test_name" F "Test failed in run_test_wd"
|
||||
fi
|
||||
return 0
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
rm -f "$output_file"
|
||||
rm -f "$status_file"
|
||||
rm -f "$sid_file"
|
||||
}
|
||||
|
||||
ended_successfully() {
|
||||
if [[ -f "${FAIL_SUMMARY_FILE}" ]]; then
|
||||
if test -f "${FAIL_SUMMARY_FILE}" ; then
|
||||
echo 'Test failed, complete summary:'
|
||||
cat "${FAIL_SUMMARY_FILE}"
|
||||
return 1
|
||||
fi
|
||||
if ! [[ -f "${END_MARKER}" ]] ; then
|
||||
if ! test -f "${END_MARKER}" ; then
|
||||
echo 'ended_successfully called before end marker was touched'
|
||||
return 1
|
||||
fi
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
source "${CI_DIR}/common/build.sh"
|
||||
source "${CI_DIR}/common/suite.sh"
|
||||
. "${CI_DIR}/common/build.sh"
|
||||
. "${CI_DIR}/common/suite.sh"
|
||||
|
||||
print_core() {
|
||||
local app="$1"
|
||||
@@ -9,7 +9,7 @@ print_core() {
|
||||
return 0
|
||||
fi
|
||||
echo "======= Core file $core ======="
|
||||
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
|
||||
if test "${TRAVIS_OS_NAME}" = osx ; then
|
||||
lldb -Q -o "bt all" -f "${app}" -c "${core}"
|
||||
else
|
||||
gdb -n -batch -ex 'thread apply all bt full' "${app}" -c "${core}"
|
||||
@@ -23,13 +23,13 @@ check_core_dumps() {
|
||||
shift
|
||||
fi
|
||||
local app="${1:-${BUILD_DIR}/bin/nvim}"
|
||||
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
|
||||
if test "${TRAVIS_OS_NAME}" = osx ; then
|
||||
local cores="$(find /cores/ -type f -print)"
|
||||
else
|
||||
local cores="$(find ./ -type f -name 'core.*' -print)"
|
||||
fi
|
||||
|
||||
if [ -z "${cores}" ]; then
|
||||
if test -z "${cores}" ; then
|
||||
return
|
||||
fi
|
||||
local core
|
||||
@@ -61,7 +61,7 @@ check_logs() {
|
||||
cat "${log}"
|
||||
err=1
|
||||
done
|
||||
if [[ -n "${err}" ]]; then
|
||||
if test -n "${err}" ; then
|
||||
fail 'logs' E 'Runtime errors detected.'
|
||||
fi
|
||||
}
|
||||
@@ -76,7 +76,7 @@ asan_check() {
|
||||
|
||||
run_unittests() {(
|
||||
enter_suite unittests
|
||||
ulimit -c unlimited
|
||||
ulimit -c unlimited || true
|
||||
if ! build_make unittest ; then
|
||||
fail 'unittests' F 'Unit tests failed'
|
||||
fi
|
||||
@@ -86,7 +86,7 @@ run_unittests() {(
|
||||
|
||||
run_functionaltests() {(
|
||||
enter_suite functionaltests
|
||||
ulimit -c unlimited
|
||||
ulimit -c unlimited || true
|
||||
if ! build_make ${FUNCTIONALTEST}; then
|
||||
fail 'functionaltests' F 'Functional tests failed'
|
||||
fi
|
||||
@@ -98,7 +98,7 @@ run_functionaltests() {(
|
||||
|
||||
run_oldtests() {(
|
||||
enter_suite oldtests
|
||||
ulimit -c unlimited
|
||||
ulimit -c unlimited || true
|
||||
if ! make -C "${TRAVIS_BUILD_DIR}/src/nvim/testdir"; then
|
||||
reset
|
||||
fail 'oldtests' F 'Legacy tests failed'
|
||||
@@ -109,6 +109,27 @@ run_oldtests() {(
|
||||
exit_suite
|
||||
)}
|
||||
|
||||
check_runtime_files() {(
|
||||
set +x
|
||||
local test_name="$1" ; shift
|
||||
local message="$1" ; shift
|
||||
local tst="$1" ; shift
|
||||
|
||||
cd runtime
|
||||
for file in $(git ls-files "$@") ; do
|
||||
# Check that test is not trying to work with files with spaces/etc
|
||||
# Prefer failing the build over using more robust construct because files
|
||||
# with IFS are not welcome.
|
||||
if ! test -e "$file" ; then
|
||||
fail "$test_name" E \
|
||||
"It appears that $file is only a part of the file name"
|
||||
fi
|
||||
if ! test "$tst" "$INSTALL_PREFIX/share/nvim/runtime/$file" ; then
|
||||
fail "$test_name" F "$(printf "$message" "$file")"
|
||||
fi
|
||||
done
|
||||
)}
|
||||
|
||||
install_nvim() {(
|
||||
enter_suite 'install_nvim'
|
||||
if ! build_make install ; then
|
||||
@@ -117,34 +138,37 @@ install_nvim() {(
|
||||
fi
|
||||
|
||||
"${INSTALL_PREFIX}/bin/nvim" --version
|
||||
"${INSTALL_PREFIX}/bin/nvim" -u NONE -e -c ':help' -c ':qall' || {
|
||||
if ! "${INSTALL_PREFIX}/bin/nvim" -u NONE -e -c ':help' -c ':qall' ; then
|
||||
echo "Running ':help' in the installed nvim failed."
|
||||
echo "Maybe the helptags have not been generated properly."
|
||||
fail 'help' F 'Failed running :help'
|
||||
}
|
||||
fi
|
||||
|
||||
local genvimsynf=syntax/vim/generated.vim
|
||||
# Check that all runtime files were installed
|
||||
for file in doc/tags $genvimsynf $(
|
||||
cd runtime ; git ls-files | grep -e '.vim$' -e '.ps$' -e '.dict$' -e '.py$' -e '.tutor$'
|
||||
) ; do
|
||||
if ! test -e "${INSTALL_PREFIX}/share/nvim/runtime/$file" ; then
|
||||
fail 'runtime-install' F "It appears that $file is not installed."
|
||||
fi
|
||||
done
|
||||
check_runtime_files \
|
||||
'runtime-install' \
|
||||
'It appears that %s is not installed.' \
|
||||
-e \
|
||||
'*.vim' '*.ps' '*.dict' '*.py' '*.tutor'
|
||||
|
||||
# Check that some runtime files are installed and are executables
|
||||
check_runtime_files \
|
||||
'not-exe' \
|
||||
'It appears that %s is not installed or is not executable.' \
|
||||
-x \
|
||||
'*.awk' '*.sh' '*.bat'
|
||||
|
||||
# Check that generated syntax file has function names, #5060.
|
||||
local genvimsynf=syntax/vim/generated.vim
|
||||
local gpat='syn keyword vimFuncName .*eval'
|
||||
if ! grep -q "$gpat" "${INSTALL_PREFIX}/share/nvim/runtime/$genvimsynf"; then
|
||||
if ! grep -q "$gpat" "${INSTALL_PREFIX}/share/nvim/runtime/$genvimsynf" ; then
|
||||
fail 'funcnames' F "It appears that $genvimsynf does not contain $gpat."
|
||||
fi
|
||||
|
||||
for file in $(
|
||||
cd runtime ; git ls-files | grep -e '.awk$' -e '.sh$' -e '.bat$'
|
||||
) ; do
|
||||
if ! test -x "${INSTALL_PREFIX}/share/nvim/runtime/$file" ; then
|
||||
fail 'not-exe' F "It appears that $file is not installed or is not executable."
|
||||
fi
|
||||
done
|
||||
exit_suite
|
||||
)}
|
||||
|
||||
csi_clean() {
|
||||
find "${BUILD_DIR}/bin" -name 'test-includes-*' -delete
|
||||
find "${BUILD_DIR}" -name '*test-include*.o' -delete
|
||||
}
|
||||
|
||||
@@ -8,17 +8,26 @@ CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
source "${CI_DIR}/common/build.sh"
|
||||
source "${CI_DIR}/common/suite.sh"
|
||||
|
||||
enter_suite 'lint'
|
||||
|
||||
set -x
|
||||
|
||||
csi_clean() {
|
||||
find "${BUILD_DIR}/bin" -name 'test-includes-*' -delete
|
||||
find "${BUILD_DIR}" -name '*test-include*.o' -delete
|
||||
}
|
||||
enter_suite 'clint'
|
||||
|
||||
run_test 'top_make clint-full' clint
|
||||
|
||||
exit_suite --continue
|
||||
|
||||
enter_suite 'testlint'
|
||||
|
||||
run_test 'top_make testlint' testlint
|
||||
|
||||
exit_suite --continue
|
||||
|
||||
enter_suite 'lualint'
|
||||
|
||||
run_test 'top_make lualint' lualint
|
||||
|
||||
exit_suite --continue
|
||||
|
||||
enter_suite single-includes
|
||||
|
||||
CLICOLOR_FORCE=1 run_test_wd \
|
||||
--allow-hang \
|
||||
10s \
|
||||
@@ -26,4 +35,6 @@ CLICOLOR_FORCE=1 run_test_wd \
|
||||
'csi_clean' \
|
||||
single-includes
|
||||
|
||||
exit_suite --continue
|
||||
|
||||
end_tests
|
||||
|
||||
@@ -8,16 +8,18 @@ source "${CI_DIR}/common/build.sh"
|
||||
source "${CI_DIR}/common/test.sh"
|
||||
source "${CI_DIR}/common/suite.sh"
|
||||
|
||||
set -x
|
||||
|
||||
enter_suite tests
|
||||
enter_suite build
|
||||
|
||||
check_core_dumps --delete quiet
|
||||
|
||||
prepare_build
|
||||
build_nvim
|
||||
|
||||
if [ "$CLANG_SANITIZER" != "TSAN" ]; then
|
||||
exit_suite --continue
|
||||
|
||||
enter_suite tests
|
||||
|
||||
if test "$CLANG_SANITIZER" != "TSAN" ; then
|
||||
# Additional threads are only created when the builtin UI starts, which
|
||||
# doesn't happen in the unit/functional tests
|
||||
run_test run_unittests
|
||||
@@ -27,4 +29,6 @@ run_test run_oldtests
|
||||
|
||||
run_test install_nvim
|
||||
|
||||
exit_suite --continue
|
||||
|
||||
end_tests
|
||||
|
||||
@@ -65,7 +65,7 @@ if(HAVE_LIBKSTAT)
|
||||
endif()
|
||||
|
||||
check_library_exists(kvm kvm_open "kvm.h" HAVE_LIBKVM)
|
||||
if(HAVE_LIBKVM)
|
||||
if(HAVE_LIBKVM AND NOT CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
|
||||
list(APPEND LIBUV_LIBRARIES kvm)
|
||||
endif()
|
||||
|
||||
|
||||
197
cmake/FindLua.cmake
Normal file
197
cmake/FindLua.cmake
Normal file
@@ -0,0 +1,197 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||
|
||||
#.rst:
|
||||
# FindLua
|
||||
# -------
|
||||
#
|
||||
#
|
||||
#
|
||||
# Locate Lua library This module defines
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# LUA_FOUND - if false, do not try to link to Lua
|
||||
# LUA_LIBRARIES - both lua and lualib
|
||||
# LUA_INCLUDE_DIR - where to find lua.h
|
||||
# LUA_VERSION_STRING - the version of Lua found
|
||||
# LUA_VERSION_MAJOR - the major version of Lua
|
||||
# LUA_VERSION_MINOR - the minor version of Lua
|
||||
# LUA_VERSION_PATCH - the patch version of Lua
|
||||
#
|
||||
#
|
||||
#
|
||||
# Note that the expected include convention is
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# #include "lua.h"
|
||||
#
|
||||
# and not
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# #include <lua/lua.h>
|
||||
#
|
||||
# This is because, the lua location is not standardized and may exist in
|
||||
# locations other than lua/
|
||||
|
||||
unset(_lua_include_subdirs)
|
||||
unset(_lua_library_names)
|
||||
unset(_lua_append_versions)
|
||||
|
||||
# this is a function only to have all the variables inside go away automatically
|
||||
function(_lua_set_version_vars)
|
||||
set(LUA_VERSIONS5 5.3 5.2 5.1 5.0)
|
||||
|
||||
if (Lua_FIND_VERSION_EXACT)
|
||||
if (Lua_FIND_VERSION_COUNT GREATER 1)
|
||||
set(_lua_append_versions ${Lua_FIND_VERSION_MAJOR}.${Lua_FIND_VERSION_MINOR})
|
||||
endif ()
|
||||
elseif (Lua_FIND_VERSION)
|
||||
# once there is a different major version supported this should become a loop
|
||||
if (NOT Lua_FIND_VERSION_MAJOR GREATER 5)
|
||||
if (Lua_FIND_VERSION_COUNT EQUAL 1)
|
||||
set(_lua_append_versions ${LUA_VERSIONS5})
|
||||
else ()
|
||||
foreach (subver IN LISTS LUA_VERSIONS5)
|
||||
if (NOT subver VERSION_LESS ${Lua_FIND_VERSION})
|
||||
list(APPEND _lua_append_versions ${subver})
|
||||
endif ()
|
||||
endforeach ()
|
||||
endif ()
|
||||
endif ()
|
||||
else ()
|
||||
# once there is a different major version supported this should become a loop
|
||||
set(_lua_append_versions ${LUA_VERSIONS5})
|
||||
endif ()
|
||||
|
||||
list(APPEND _lua_include_subdirs "include/lua" "include")
|
||||
|
||||
foreach (ver IN LISTS _lua_append_versions)
|
||||
string(REGEX MATCH "^([0-9]+)\\.([0-9]+)$" _ver "${ver}")
|
||||
list(APPEND _lua_include_subdirs
|
||||
include/lua${CMAKE_MATCH_1}${CMAKE_MATCH_2}
|
||||
include/lua${CMAKE_MATCH_1}.${CMAKE_MATCH_2}
|
||||
include/lua-${CMAKE_MATCH_1}.${CMAKE_MATCH_2}
|
||||
)
|
||||
endforeach ()
|
||||
|
||||
set(_lua_include_subdirs "${_lua_include_subdirs}" PARENT_SCOPE)
|
||||
set(_lua_append_versions "${_lua_append_versions}" PARENT_SCOPE)
|
||||
endfunction(_lua_set_version_vars)
|
||||
|
||||
function(_lua_check_header_version _hdr_file)
|
||||
# At least 5.[012] have different ways to express the version
|
||||
# so all of them need to be tested. Lua 5.2 defines LUA_VERSION
|
||||
# and LUA_RELEASE as joined by the C preprocessor, so avoid those.
|
||||
file(STRINGS "${_hdr_file}" lua_version_strings
|
||||
REGEX "^#define[ \t]+LUA_(RELEASE[ \t]+\"Lua [0-9]|VERSION([ \t]+\"Lua [0-9]|_[MR])).*")
|
||||
|
||||
string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_MAJOR[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_MAJOR ";${lua_version_strings};")
|
||||
if (LUA_VERSION_MAJOR MATCHES "^[0-9]+$")
|
||||
string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_MINOR[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_MINOR ";${lua_version_strings};")
|
||||
string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_RELEASE[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_PATCH ";${lua_version_strings};")
|
||||
set(LUA_VERSION_STRING "${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}.${LUA_VERSION_PATCH}")
|
||||
else ()
|
||||
string(REGEX REPLACE ".*;#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([0-9.]+)\"[ \t]*;.*" "\\1" LUA_VERSION_STRING ";${lua_version_strings};")
|
||||
if (NOT LUA_VERSION_STRING MATCHES "^[0-9.]+$")
|
||||
string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION[ \t]+\"Lua ([0-9.]+)\"[ \t]*;.*" "\\1" LUA_VERSION_STRING ";${lua_version_strings};")
|
||||
endif ()
|
||||
string(REGEX REPLACE "^([0-9]+)\\.[0-9.]*$" "\\1" LUA_VERSION_MAJOR "${LUA_VERSION_STRING}")
|
||||
string(REGEX REPLACE "^[0-9]+\\.([0-9]+)[0-9.]*$" "\\1" LUA_VERSION_MINOR "${LUA_VERSION_STRING}")
|
||||
string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]).*" "\\1" LUA_VERSION_PATCH "${LUA_VERSION_STRING}")
|
||||
endif ()
|
||||
foreach (ver IN LISTS _lua_append_versions)
|
||||
if (ver STREQUAL "${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}")
|
||||
set(LUA_VERSION_MAJOR ${LUA_VERSION_MAJOR} PARENT_SCOPE)
|
||||
set(LUA_VERSION_MINOR ${LUA_VERSION_MINOR} PARENT_SCOPE)
|
||||
set(LUA_VERSION_PATCH ${LUA_VERSION_PATCH} PARENT_SCOPE)
|
||||
set(LUA_VERSION_STRING ${LUA_VERSION_STRING} PARENT_SCOPE)
|
||||
return()
|
||||
endif ()
|
||||
endforeach ()
|
||||
endfunction(_lua_check_header_version)
|
||||
|
||||
_lua_set_version_vars()
|
||||
|
||||
if (LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/lua.h")
|
||||
_lua_check_header_version("${LUA_INCLUDE_DIR}/lua.h")
|
||||
endif ()
|
||||
|
||||
if (NOT LUA_VERSION_STRING)
|
||||
foreach (subdir IN LISTS _lua_include_subdirs)
|
||||
unset(LUA_INCLUDE_PREFIX CACHE)
|
||||
find_path(LUA_INCLUDE_PREFIX ${subdir}/lua.h
|
||||
HINTS
|
||||
ENV LUA_DIR
|
||||
PATHS
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/sw # Fink
|
||||
/opt/local # DarwinPorts
|
||||
/opt/csw # Blastwave
|
||||
/opt
|
||||
)
|
||||
if (LUA_INCLUDE_PREFIX)
|
||||
_lua_check_header_version("${LUA_INCLUDE_PREFIX}/${subdir}/lua.h")
|
||||
if (LUA_VERSION_STRING)
|
||||
set(LUA_INCLUDE_DIR "${LUA_INCLUDE_PREFIX}/${subdir}")
|
||||
break()
|
||||
endif ()
|
||||
endif ()
|
||||
endforeach ()
|
||||
endif ()
|
||||
unset(_lua_include_subdirs)
|
||||
unset(_lua_append_versions)
|
||||
|
||||
if (LUA_VERSION_STRING)
|
||||
set(_lua_library_names
|
||||
lua${LUA_VERSION_MAJOR}${LUA_VERSION_MINOR}
|
||||
lua${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}
|
||||
lua-${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}
|
||||
lua.${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}
|
||||
)
|
||||
endif ()
|
||||
|
||||
find_library(LUA_LIBRARY
|
||||
NAMES ${_lua_library_names} lua
|
||||
HINTS
|
||||
ENV LUA_DIR
|
||||
PATH_SUFFIXES lib
|
||||
PATHS
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/sw
|
||||
/opt/local
|
||||
/opt/csw
|
||||
/opt
|
||||
)
|
||||
unset(_lua_library_names)
|
||||
|
||||
if (LUA_LIBRARY)
|
||||
# include the math library for Unix
|
||||
if (UNIX AND NOT APPLE AND NOT BEOS)
|
||||
find_library(LUA_MATH_LIBRARY m)
|
||||
set(LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}")
|
||||
|
||||
# include dl library for statically-linked Lua library
|
||||
get_filename_component(LUA_LIB_EXT ${LUA_LIBRARY} EXT)
|
||||
if(LUA_LIB_EXT STREQUAL CMAKE_STATIC_LIBRARY_SUFFIX)
|
||||
list(APPEND LUA_LIBRARIES ${CMAKE_DL_LIBS})
|
||||
endif()
|
||||
|
||||
# For Windows and Mac, don't need to explicitly include the math library
|
||||
else ()
|
||||
set(LUA_LIBRARIES "${LUA_LIBRARY}")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua
|
||||
REQUIRED_VARS LUA_LIBRARIES LUA_INCLUDE_DIR
|
||||
VERSION_VAR LUA_VERSION_STRING)
|
||||
|
||||
mark_as_advanced(LUA_INCLUDE_DIR LUA_LIBRARY LUA_MATH_LIBRARY)
|
||||
@@ -1,3 +1,12 @@
|
||||
# Fix CMAKE_INSTALL_MANDIR on BSD before including GNUInstallDirs. #6771
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "BSD" AND NOT DEFINED CMAKE_INSTALL_MANDIR)
|
||||
if(DEFINED ENV{MANPREFIX})
|
||||
set(CMAKE_INSTALL_MANDIR "$ENV{MANPREFIX}/man")
|
||||
else()
|
||||
set(CMAKE_INSTALL_MANDIR "/usr/local/man")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# For $CMAKE_INSTALL_{DATAROOT,MAN, ...}DIR
|
||||
include(GNUInstallDirs)
|
||||
|
||||
|
||||
22
cmake/RunLuacheck.cmake
Normal file
22
cmake/RunLuacheck.cmake
Normal file
@@ -0,0 +1,22 @@
|
||||
set(LUACHECK_ARGS -q "${LUAFILES_DIR}")
|
||||
if(DEFINED IGNORE_PATTERN)
|
||||
list(APPEND LUACHECK_ARGS --exclude-files "${LUAFILES_DIR}/${IGNORE_PATTERN}")
|
||||
endif()
|
||||
if(DEFINED CHECK_PATTERN)
|
||||
list(APPEND LUACHECK_ARGS --include-files "${LUAFILES_DIR}/${CHECK_PATTERN}")
|
||||
endif()
|
||||
if(DEFINED READ_GLOBALS)
|
||||
list(APPEND LUACHECK_ARGS --read-globals "${READ_GLOBALS}")
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND "${LUACHECK_PRG}" ${LUACHECK_ARGS}
|
||||
WORKING_DIRECTORY "${LUAFILES_DIR}"
|
||||
ERROR_VARIABLE err
|
||||
RESULT_VARIABLE res
|
||||
)
|
||||
|
||||
if(NOT res EQUAL 0)
|
||||
message(STATUS "Output to stderr:\n${err}")
|
||||
message(FATAL_ERROR "Linting tests failed with error: ${res}.")
|
||||
endif()
|
||||
@@ -3,6 +3,10 @@ set(ENV{NVIM_RPLUGIN_MANIFEST} ${WORKING_DIR}/Xtest_rplugin_manifest)
|
||||
set(ENV{XDG_CONFIG_HOME} ${WORKING_DIR}/Xtest_xdg/config)
|
||||
set(ENV{XDG_DATA_HOME} ${WORKING_DIR}/Xtest_xdg/share)
|
||||
|
||||
if(NOT DEFINED ENV{NVIM_LOG_FILE})
|
||||
set(ENV{NVIM_LOG_FILE} ${WORKING_DIR}/.nvimlog)
|
||||
endif()
|
||||
|
||||
if(NVIM_PRG)
|
||||
set(ENV{NVIM_PRG} "${NVIM_PRG}")
|
||||
endif()
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
set(IGNORE_FILES "${TEST_DIR}/*/preload.lua")
|
||||
|
||||
execute_process(
|
||||
COMMAND ${LUACHECK_PRG} -q ${TEST_DIR} --exclude-files ${IGNORE_FILES}
|
||||
WORKING_DIRECTORY ${TEST_DIR}
|
||||
ERROR_VARIABLE err
|
||||
RESULT_VARIABLE res
|
||||
${EXTRA_ARGS})
|
||||
|
||||
if(NOT res EQUAL 0)
|
||||
message(STATUS "Output to stderr:\n${err}")
|
||||
message(FATAL_ERROR "Linting tests failed with error: ${res}.")
|
||||
endif()
|
||||
@@ -31,9 +31,8 @@
|
||||
#
|
||||
# CMAKE_BUILD_TYPE := Debug
|
||||
|
||||
# By default, nvim's log level is INFO (1) (unless CMAKE_BUILD_TYPE is
|
||||
# "Release", in which case logging is disabled).
|
||||
# The log level must be a number DEBUG (0), INFO (1), WARNING (2) or ERROR (3).
|
||||
# The default log level is 1 (INFO) (unless CMAKE_BUILD_TYPE is "Release").
|
||||
# Log levels: 0 (DEBUG), 1 (INFO), 2 (WARNING), 3 (ERROR)
|
||||
# CMAKE_EXTRA_FLAGS += -DMIN_LOG_LEVEL=1
|
||||
|
||||
# By default, nvim uses bundled versions of its required third-party
|
||||
|
||||
@@ -2,12 +2,13 @@
|
||||
" Description: Perform Ada specific completion & tagging.
|
||||
" Language: Ada (2005)
|
||||
" $Id: ada.vim 887 2008-07-08 14:29:01Z krischik $
|
||||
" Maintainer: Martin Krischik <krischik@users.sourceforge.net>
|
||||
" Maintainer: Mathias Brousset <mathiasb17@gmail.com>
|
||||
" Martin Krischik <krischik@users.sourceforge.net>
|
||||
" Taylor Venable <taylor@metasyntax.net>
|
||||
" Neil Bird <neil@fnxweb.com>
|
||||
" Ned Okie <nokie@radford.edu>
|
||||
" $Author: krischik $
|
||||
" $Date: 2008-07-08 16:29:01 +0200 (Di, 08 Jul 2008) $
|
||||
" $Date: 2017-01-31 20:20:05 +0200 (Mon, 01 Jan 2017) $
|
||||
" Version: 4.6
|
||||
" $Revision: 887 $
|
||||
" $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/ada.vim $
|
||||
@@ -23,6 +24,7 @@
|
||||
" 09.05.2007 MK Session just won't work no matter how much
|
||||
" tweaking is done
|
||||
" 19.09.2007 NO still some mapleader problems
|
||||
" 31.01.2017 MB fix more mapleader problems
|
||||
" Help Page: ft-ada-functions
|
||||
"------------------------------------------------------------------------------
|
||||
|
||||
@@ -585,11 +587,11 @@ function ada#Map_Menu (Text, Keys, Command)
|
||||
\ " :" . a:Command . "<CR>"
|
||||
execute
|
||||
\ "nnoremap <buffer>" .
|
||||
\ escape(l:leader . "a" . a:Keys , '\') .
|
||||
\ " <Leader>a" . a:Keys .
|
||||
\" :" . a:Command
|
||||
execute
|
||||
\ "inoremap <buffer>" .
|
||||
\ escape(l:leader . "a" . a:Keys , '\') .
|
||||
\ " <Learder>a" . a:Keys .
|
||||
\" <C-O>:" . a:Command
|
||||
endif
|
||||
return
|
||||
|
||||
184
runtime/autoload/context.vim
Normal file
184
runtime/autoload/context.vim
Normal file
@@ -0,0 +1,184 @@
|
||||
" Language: ConTeXt typesetting engine
|
||||
" Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com>
|
||||
" Latest Revision: 2016 Oct 21
|
||||
|
||||
let s:keepcpo= &cpo
|
||||
set cpo&vim
|
||||
|
||||
" Helper functions {{{
|
||||
function! s:context_echo(message, mode)
|
||||
redraw
|
||||
echo "\r"
|
||||
execute 'echohl' a:mode
|
||||
echomsg '[ConTeXt]' a:message
|
||||
echohl None
|
||||
endf
|
||||
|
||||
function! s:sh()
|
||||
return has('win32') || has('win64') || has('win16') || has('win95')
|
||||
\ ? ['cmd.exe', '/C']
|
||||
\ : ['/bin/sh', '-c']
|
||||
endfunction
|
||||
|
||||
" For backward compatibility
|
||||
if exists('*win_getid')
|
||||
|
||||
function! s:win_getid()
|
||||
return win_getid()
|
||||
endf
|
||||
|
||||
function! s:win_id2win(winid)
|
||||
return win_id2win(a:winid)
|
||||
endf
|
||||
|
||||
else
|
||||
|
||||
function! s:win_getid()
|
||||
return winnr()
|
||||
endf
|
||||
|
||||
function! s:win_id2win(winnr)
|
||||
return a:winnr
|
||||
endf
|
||||
|
||||
endif
|
||||
" }}}
|
||||
|
||||
" ConTeXt jobs {{{
|
||||
if has('job')
|
||||
|
||||
let g:context_jobs = []
|
||||
|
||||
" Print the status of ConTeXt jobs
|
||||
function! context#job_status()
|
||||
let l:jobs = filter(g:context_jobs, 'job_status(v:val) == "run"')
|
||||
let l:n = len(l:jobs)
|
||||
call s:context_echo(
|
||||
\ 'There '.(l:n == 1 ? 'is' : 'are').' '.(l:n == 0 ? 'no' : l:n)
|
||||
\ .' job'.(l:n == 1 ? '' : 's').' running'
|
||||
\ .(l:n == 0 ? '.' : ' (' . join(l:jobs, ', ').').'),
|
||||
\ 'ModeMsg')
|
||||
endfunction
|
||||
|
||||
" Stop all ConTeXt jobs
|
||||
function! context#stop_jobs()
|
||||
let l:jobs = filter(g:context_jobs, 'job_status(v:val) == "run"')
|
||||
for job in l:jobs
|
||||
call job_stop(job)
|
||||
endfor
|
||||
sleep 1
|
||||
let l:tmp = []
|
||||
for job in l:jobs
|
||||
if job_status(job) == "run"
|
||||
call add(l:tmp, job)
|
||||
endif
|
||||
endfor
|
||||
let g:context_jobs = l:tmp
|
||||
if empty(g:context_jobs)
|
||||
call s:context_echo('Done. No jobs running.', 'ModeMsg')
|
||||
else
|
||||
call s:context_echo('There are still some jobs running. Please try again.', 'WarningMsg')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! context#callback(path, job, status)
|
||||
if index(g:context_jobs, a:job) != -1 && job_status(a:job) != 'run' " just in case
|
||||
call remove(g:context_jobs, index(g:context_jobs, a:job))
|
||||
endif
|
||||
call s:callback(a:path, a:job, a:status)
|
||||
endfunction
|
||||
|
||||
function! context#close_cb(channel)
|
||||
call job_status(ch_getjob(a:channel)) " Trigger exit_cb's callback for faster feedback
|
||||
endfunction
|
||||
|
||||
function! s:typeset(path)
|
||||
call add(g:context_jobs,
|
||||
\ job_start(add(s:sh(), context#command() . ' ' . shellescape(fnamemodify(a:path, ":t"))), {
|
||||
\ 'close_cb' : 'context#close_cb',
|
||||
\ 'exit_cb' : function(get(b:, 'context_callback', get(g:, 'context_callback', 'context#callback')),
|
||||
\ [a:path]),
|
||||
\ 'in_io' : 'null'
|
||||
\ }))
|
||||
endfunction
|
||||
|
||||
else " No jobs
|
||||
|
||||
function! context#job_status()
|
||||
call s:context_echo('Not implemented', 'WarningMsg')
|
||||
endfunction!
|
||||
|
||||
function! context#stop_jobs()
|
||||
call s:context_echo('Not implemented', 'WarningMsg')
|
||||
endfunction
|
||||
|
||||
function! context#callback(path, job, status)
|
||||
call s:callback(a:path, a:job, a:status)
|
||||
endfunction
|
||||
|
||||
function! s:typeset(path)
|
||||
execute '!' . context#command() . ' ' . shellescape(fnamemodify(a:path, ":t"))
|
||||
call call(get(b:, 'context_callback', get(g:, 'context_callback', 'context#callback')),
|
||||
\ [a:path, 0, v:shell_error])
|
||||
endfunction
|
||||
|
||||
endif " has('job')
|
||||
|
||||
function! s:callback(path, job, status) abort
|
||||
if a:status < 0 " Assume the job was terminated
|
||||
return
|
||||
endif
|
||||
" Get info about the current window
|
||||
let l:winid = s:win_getid() " Save window id
|
||||
let l:efm = &l:errorformat " Save local errorformat
|
||||
let l:cwd = fnamemodify(getcwd(), ":p") " Save local working directory
|
||||
" Set errorformat to parse ConTeXt errors
|
||||
execute 'setl efm=' . escape(b:context_errorformat, ' ')
|
||||
try " Set cwd to expand error file correctly
|
||||
execute 'lcd' fnameescape(fnamemodify(a:path, ':h'))
|
||||
catch /.*/
|
||||
execute 'setl efm=' . escape(l:efm, ' ')
|
||||
throw v:exception
|
||||
endtry
|
||||
try
|
||||
execute 'cgetfile' fnameescape(fnamemodify(a:path, ':r') . '.log')
|
||||
botright cwindow
|
||||
finally " Restore cwd and errorformat
|
||||
execute s:win_id2win(l:winid) . 'wincmd w'
|
||||
execute 'lcd ' . fnameescape(l:cwd)
|
||||
execute 'setl efm=' . escape(l:efm, ' ')
|
||||
endtry
|
||||
if a:status == 0
|
||||
call s:context_echo('Success!', 'ModeMsg')
|
||||
else
|
||||
call s:context_echo('There are errors. ', 'ErrorMsg')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! context#command()
|
||||
return get(b:, 'context_mtxrun', get(g:, 'context_mtxrun', 'mtxrun'))
|
||||
\ . ' --script context --autogenerate --nonstopmode'
|
||||
\ . ' --synctex=' . (get(b:, 'context_synctex', get(g:, 'context_synctex', 0)) ? '1' : '0')
|
||||
\ . ' ' . get(b:, 'context_extra_options', get(g:, 'context_extra_options', ''))
|
||||
endfunction
|
||||
|
||||
" Accepts an optional path (useful for big projects, when the file you are
|
||||
" editing is not the project's root document). If no argument is given, uses
|
||||
" the path of the current buffer.
|
||||
function! context#typeset(...) abort
|
||||
let l:path = fnamemodify(strlen(a:000[0]) > 0 ? a:1 : expand("%"), ":p")
|
||||
let l:cwd = fnamemodify(getcwd(), ":p") " Save local working directory
|
||||
call s:context_echo('Typesetting...', 'ModeMsg')
|
||||
execute 'lcd' fnameescape(fnamemodify(l:path, ":h"))
|
||||
try
|
||||
call s:typeset(l:path)
|
||||
finally " Restore local working directory
|
||||
execute 'lcd ' . fnameescape(l:cwd)
|
||||
endtry
|
||||
endfunction!
|
||||
"}}}
|
||||
|
||||
let &cpo = s:keepcpo
|
||||
unlet s:keepcpo
|
||||
|
||||
" vim: sw=2 fdm=marker
|
||||
25
runtime/autoload/contextcomplete.vim
Normal file
25
runtime/autoload/contextcomplete.vim
Normal file
@@ -0,0 +1,25 @@
|
||||
" Language: ConTeXt typesetting engine
|
||||
" Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com>
|
||||
" Latest Revision: 2016 Oct 15
|
||||
|
||||
let s:keepcpo= &cpo
|
||||
set cpo&vim
|
||||
|
||||
" Complete keywords in MetaPost blocks
|
||||
function! contextcomplete#Complete(findstart, base)
|
||||
if a:findstart == 1
|
||||
if len(synstack(line('.'), 1)) > 0 &&
|
||||
\ synIDattr(synstack(line('.'), 1)[0], "name") ==# 'contextMPGraphic'
|
||||
return syntaxcomplete#Complete(a:findstart, a:base)
|
||||
else
|
||||
return -3
|
||||
endif
|
||||
else
|
||||
return syntaxcomplete#Complete(a:findstart, a:base)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
let &cpo = s:keepcpo
|
||||
unlet s:keepcpo
|
||||
|
||||
" vim: sw=2 fdm=marker
|
||||
@@ -1,6 +1,6 @@
|
||||
" Vim autoload file for editing compressed files.
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2014 Nov 05
|
||||
" Last Change: 2016 Sep 28
|
||||
|
||||
" These functions are used by the gzip plugin.
|
||||
|
||||
@@ -63,6 +63,9 @@ fun gzip#read(cmd)
|
||||
" set 'modifiable'
|
||||
let ma_save = &ma
|
||||
setlocal ma
|
||||
" set 'write'
|
||||
let write_save = &write
|
||||
set write
|
||||
" Reset 'foldenable', otherwise line numbers get adjusted.
|
||||
if has("folding")
|
||||
let fen_save = &fen
|
||||
@@ -127,6 +130,7 @@ fun gzip#read(cmd)
|
||||
let &pm = pm_save
|
||||
let &cpo = cpo_save
|
||||
let &l:ma = ma_save
|
||||
let &write = write_save
|
||||
if has("folding")
|
||||
let &l:fen = fen_save
|
||||
endif
|
||||
|
||||
@@ -66,6 +66,7 @@ function! health#check(plugin_names) abort
|
||||
" needed for plasticboy/vim-markdown, because it uses fdm=expr
|
||||
normal! zR
|
||||
setlocal nomodified
|
||||
setlocal bufhidden=hide
|
||||
redraw|echo ''
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -4,15 +4,6 @@ function! s:check_config() abort
|
||||
let ok = v:true
|
||||
call health#report_start('Configuration')
|
||||
|
||||
if get(g:, 'loaded_sensible', 0)
|
||||
let ok = v:false
|
||||
let sensible_pi = globpath(&runtimepath, '**/sensible.vim', 1, 1)
|
||||
call health#report_info("found sensible.vim plugin:\n".join(sensible_pi, "\n"))
|
||||
call health#report_error("sensible.vim plugin is not needed; Nvim has the same defaults built-in."
|
||||
\ ." Also, sensible.vim sets 'ttimeoutlen' to a sub-optimal value.",
|
||||
\ ["Remove sensible.vim plugin, or wrap it in a `if !has('nvim')` check."])
|
||||
endif
|
||||
|
||||
if exists('$NVIM_TUI_ENABLE_CURSOR_SHAPE')
|
||||
let ok = v:false
|
||||
call health#report_warn("$NVIM_TUI_ENABLE_CURSOR_SHAPE is ignored in Nvim 0.2+",
|
||||
|
||||
@@ -31,13 +31,23 @@ endfunction
|
||||
|
||||
" Handler for s:system() function.
|
||||
function! s:system_handler(jobid, data, event) dict abort
|
||||
if a:event == 'stdout' || a:event == 'stderr'
|
||||
if a:event ==# 'stdout' || a:event ==# 'stderr'
|
||||
let self.output .= join(a:data, '')
|
||||
elseif a:event == 'exit'
|
||||
elseif a:event ==# 'exit'
|
||||
let s:shell_error = a:data
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Attempts to construct a shell command from an args list.
|
||||
" Only for display, to help users debug a failed command.
|
||||
function! s:shellify(cmd) abort
|
||||
if type(a:cmd) != type([])
|
||||
return a:cmd
|
||||
endif
|
||||
return join(map(copy(a:cmd),
|
||||
\'v:val =~# ''\m[\-.a-zA-Z_/]'' ? shellescape(v:val) : v:val'), ' ')
|
||||
endfunction
|
||||
|
||||
" Run a system command and timeout after 30 seconds.
|
||||
function! s:system(cmd, ...) abort
|
||||
let stdin = a:0 ? a:1 : ''
|
||||
@@ -54,8 +64,7 @@ function! s:system(cmd, ...) abort
|
||||
let jobid = jobstart(a:cmd, opts)
|
||||
|
||||
if jobid < 1
|
||||
call health#report_error(printf('Command error %d: %s', jobid,
|
||||
\ type(a:cmd) == type([]) ? join(a:cmd) : a:cmd)))
|
||||
call health#report_error(printf('Command error (job=%d): %s', jobid, s:shellify(a:cmd)))
|
||||
let s:shell_error = 1
|
||||
return opts.output
|
||||
endif
|
||||
@@ -66,13 +75,11 @@ function! s:system(cmd, ...) abort
|
||||
|
||||
let res = jobwait([jobid], 30000)
|
||||
if res[0] == -1
|
||||
call health#report_error(printf('Command timed out: %s',
|
||||
\ type(a:cmd) == type([]) ? join(a:cmd) : a:cmd))
|
||||
call health#report_error(printf('Command timed out: %s', s:shellify(a:cmd)))
|
||||
call jobstop(jobid)
|
||||
elseif s:shell_error != 0 && !ignore_error
|
||||
call health#report_error(printf("Command error (%d) %s: %s", jobid,
|
||||
\ type(a:cmd) == type([]) ? join(a:cmd) : a:cmd,
|
||||
\ opts.output))
|
||||
call health#report_error(printf("Command error (job=%d): %s\nOutput: %s", jobid,
|
||||
\ s:shellify(a:cmd), opts.output))
|
||||
endif
|
||||
|
||||
return opts.output
|
||||
@@ -116,7 +123,7 @@ function! s:check_clipboard() abort
|
||||
let clipboard_tool = provider#clipboard#Executable()
|
||||
if empty(clipboard_tool)
|
||||
call health#report_warn(
|
||||
\ "No clipboard tool found. Clipboard registers will not work.",
|
||||
\ 'No clipboard tool found. Clipboard registers will not work.',
|
||||
\ [':help clipboard'])
|
||||
else
|
||||
call health#report_ok('Clipboard tool found: '. clipboard_tool)
|
||||
@@ -157,7 +164,7 @@ function! s:version_info(python) abort
|
||||
\ ]))
|
||||
|
||||
if empty(python_version)
|
||||
let python_version = 'unable to parse python response'
|
||||
let python_version = 'unable to parse '.a:python.' response'
|
||||
endif
|
||||
|
||||
let nvim_path = s:trim(s:system([
|
||||
@@ -169,14 +176,14 @@ function! s:version_info(python) abort
|
||||
|
||||
" Assuming that multiple versions of a package are installed, sort them
|
||||
" numerically in descending order.
|
||||
function! s:compare(metapath1, metapath2)
|
||||
function! s:compare(metapath1, metapath2) abort
|
||||
let a = matchstr(fnamemodify(a:metapath1, ':p:h:t'), '[0-9.]\+')
|
||||
let b = matchstr(fnamemodify(a:metapath2, ':p:h:t'), '[0-9.]\+')
|
||||
return a == b ? 0 : a > b ? 1 : -1
|
||||
endfunction
|
||||
|
||||
" Try to get neovim.VERSION (added in 0.1.11dev).
|
||||
let nvim_version = s:system(['python', '-c',
|
||||
let nvim_version = s:system([a:python, '-c',
|
||||
\ 'from neovim import VERSION as v; '.
|
||||
\ 'print("{}.{}.{}{}".format(v.major, v.minor, v.patch, v.prerelease))'],
|
||||
\ '', 1, 1)
|
||||
@@ -429,8 +436,8 @@ function! s:check_ruby() abort
|
||||
|
||||
if !executable('ruby') || !executable('gem')
|
||||
call health#report_warn(
|
||||
\ "`ruby` and `gem` must be in $PATH.",
|
||||
\ ["Install Ruby and verify that `ruby` and `gem` commands work."])
|
||||
\ '`ruby` and `gem` must be in $PATH.',
|
||||
\ ['Install Ruby and verify that `ruby` and `gem` commands work.'])
|
||||
return
|
||||
endif
|
||||
call health#report_info('Ruby: '. s:system('ruby -v'))
|
||||
@@ -445,21 +452,21 @@ function! s:check_ruby() abort
|
||||
endif
|
||||
call health#report_info('Host: '. host)
|
||||
|
||||
let latest_gem_cmd = 'gem list -ra ^neovim$'
|
||||
let latest_gem_cmd = has('win32') ? 'cmd /c gem list -ra ^^neovim$' : 'gem list -ra ^neovim$'
|
||||
let latest_gem = s:system(split(latest_gem_cmd))
|
||||
if s:shell_error || empty(latest_gem)
|
||||
call health#report_error('Failed to run: '. latest_gem_cmd,
|
||||
\ ["Make sure you're connected to the internet.",
|
||||
\ "Are you behind a firewall or proxy?"])
|
||||
\ 'Are you behind a firewall or proxy?'])
|
||||
return
|
||||
endif
|
||||
let latest_gem = get(split(latest_gem, ' (\|, \|)$' ), 1, 'not found')
|
||||
let latest_gem = get(split(latest_gem, 'neovim (\|, \|)$' ), 1, 'not found')
|
||||
|
||||
let current_gem_cmd = host .' --version'
|
||||
let current_gem = s:system(current_gem_cmd)
|
||||
if s:shell_error
|
||||
call health#report_error('Failed to run: '. current_gem_cmd,
|
||||
\ ["Report this issue with the output of: ", current_gem_cmd])
|
||||
\ ['Report this issue with the output of: ', current_gem_cmd])
|
||||
return
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,16 +1,31 @@
|
||||
" Maintainer: Anmol Sethi <anmol@aubble.com>
|
||||
|
||||
let s:man_find_arg = "-w"
|
||||
let s:find_arg = '-w'
|
||||
let s:localfile_arg = v:true " Always use -l if possible. #6683
|
||||
let s:section_arg = '-s'
|
||||
|
||||
" TODO(nhooyr) Completion may work on SunOS; I'm not sure if `man -l` displays
|
||||
" the list of searched directories.
|
||||
try
|
||||
if !has('win32') && $OSTYPE !~? 'cygwin\|linux' && system('uname -s') =~? 'SunOS' && system('uname -r') =~# '^5'
|
||||
let s:man_find_arg = '-l'
|
||||
function! s:init_section_flag()
|
||||
call system(['env', 'MANPAGER=cat', 'man', s:section_arg, '1', 'man'])
|
||||
if v:shell_error
|
||||
let s:section_arg = '-S'
|
||||
endif
|
||||
catch /E145:/
|
||||
" Ignore the error in restricted mode
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
function! s:init() abort
|
||||
call s:init_section_flag()
|
||||
" TODO(nhooyr): Does `man -l` on SunOS list searched directories?
|
||||
try
|
||||
if !has('win32') && $OSTYPE !~? 'cygwin\|linux' && system('uname -s') =~? 'SunOS' && system('uname -r') =~# '^5'
|
||||
let s:find_arg = '-l'
|
||||
endif
|
||||
" Check for -l support.
|
||||
call s:get_page(s:get_path('', 'man')[0:-2])
|
||||
catch /E145:/
|
||||
" Ignore the error in restricted mode
|
||||
catch /command error .*/
|
||||
let s:localfile_arg = v:false
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
function! man#open_page(count, count1, mods, ...) abort
|
||||
if a:0 > 2
|
||||
@@ -88,10 +103,8 @@ endfunction
|
||||
|
||||
" Handler for s:system() function.
|
||||
function! s:system_handler(jobid, data, event) dict abort
|
||||
if a:event == 'stdout'
|
||||
let self.stdout .= join(a:data, "\n")
|
||||
elseif a:event == 'stderr'
|
||||
let self.stderr .= join(a:data, "\n")
|
||||
if a:event is# 'stdout' || a:event is# 'stderr'
|
||||
let self[a:event] .= join(a:data, "\n")
|
||||
else
|
||||
let self.exit_code = a:data
|
||||
endif
|
||||
@@ -118,7 +131,7 @@ function! s:system(cmd, ...) abort
|
||||
try
|
||||
call jobstop(jobid)
|
||||
throw printf('command timed out: %s', join(a:cmd))
|
||||
catch /^Vim\%((\a\+)\)\=:E900/
|
||||
catch /^Vim(call):E900:/
|
||||
endtry
|
||||
elseif res[0] == -2
|
||||
throw printf('command interrupted: %s', join(a:cmd))
|
||||
@@ -135,7 +148,8 @@ function! s:get_page(path) abort
|
||||
let manwidth = empty($MANWIDTH) ? winwidth(0) : $MANWIDTH
|
||||
" Force MANPAGER=cat to ensure Vim is not recursively invoked (by man-db).
|
||||
" http://comments.gmane.org/gmane.editors.vim.devel/29085
|
||||
return s:system(['env', 'MANPAGER=cat', 'MANWIDTH='.manwidth, 'man', a:path])
|
||||
let cmd = ['env', 'MANPAGER=cat', 'MANWIDTH='.manwidth, 'man']
|
||||
return s:system(cmd + (s:localfile_arg ? ['-l', a:path] : [a:path]))
|
||||
endfunction
|
||||
|
||||
function! s:put_page(page) abort
|
||||
@@ -151,6 +165,31 @@ function! s:put_page(page) abort
|
||||
setlocal filetype=man
|
||||
endfunction
|
||||
|
||||
function! man#show_toc() abort
|
||||
let bufname = bufname('%')
|
||||
let info = getloclist(0, {'winid': 1})
|
||||
if !empty(info) && getwinvar(info.winid, 'qf_toc') ==# bufname
|
||||
lopen
|
||||
return
|
||||
endif
|
||||
|
||||
let toc = []
|
||||
let lnum = 2
|
||||
let last_line = line('$') - 1
|
||||
while lnum && lnum < last_line
|
||||
let text = getline(lnum)
|
||||
if text =~# '^\%( \{3\}\)\=\S.*$'
|
||||
call add(toc, {'bufnr': bufnr('%'), 'lnum': lnum, 'text': text})
|
||||
endif
|
||||
let lnum = nextnonblank(lnum + 1)
|
||||
endwhile
|
||||
|
||||
call setloclist(0, toc, ' ')
|
||||
call setloclist(0, [], 'a', {'title': 'Man TOC'})
|
||||
lopen
|
||||
let w:qf_toc = bufname
|
||||
endfunction
|
||||
|
||||
" attempt to extract the name and sect out of 'name(sect)'
|
||||
" otherwise just return the largest string of valid characters in ref
|
||||
function! man#extract_sect_and_name_ref(ref) abort
|
||||
@@ -174,14 +213,14 @@ endfunction
|
||||
|
||||
function! s:get_path(sect, name) abort
|
||||
if empty(a:sect)
|
||||
return s:system(['man', s:man_find_arg, a:name])
|
||||
return s:system(['man', s:find_arg, a:name])
|
||||
endif
|
||||
" '-s' flag handles:
|
||||
" - tokens like 'printf(echo)'
|
||||
" - sections starting with '-'
|
||||
" - 3pcap section (found on macOS)
|
||||
" - commas between sections (for section priority)
|
||||
return s:system(['man', s:man_find_arg, '-s', a:sect, a:name])
|
||||
return s:system(['man', s:find_arg, s:section_arg, a:sect, a:name])
|
||||
endfunction
|
||||
|
||||
function! s:verify_exists(sect, name) abort
|
||||
@@ -306,7 +345,7 @@ endfunction
|
||||
|
||||
function! s:complete(sect, psect, name) abort
|
||||
try
|
||||
let mandirs = join(split(s:system(['man', s:man_find_arg]), ':\|\n'), ',')
|
||||
let mandirs = join(split(s:system(['man', s:find_arg]), ':\|\n'), ',')
|
||||
catch
|
||||
call s:error(v:exception)
|
||||
return
|
||||
@@ -348,3 +387,5 @@ function! man#init_pager() abort
|
||||
endtry
|
||||
execute 'silent file man://'.fnameescape(ref)
|
||||
endfunction
|
||||
|
||||
call s:init()
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
if &cp || exists("g:loaded_netrw")
|
||||
finish
|
||||
endif
|
||||
" netrw requires vim having patch 213; netrw will benefit from vim's having patch#656, too
|
||||
if v:version < 704 || !has("patch213")
|
||||
" netrw requires vim having patch 7.4.213; netrw will benefit from vim's having patch#656, too
|
||||
if v:version < 704 || (v:version == 704 && !has("patch213"))
|
||||
if !exists("s:needpatch213")
|
||||
unsilent echomsg "***sorry*** this version of netrw requires vim v7.4 with patch 213"
|
||||
endif
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
" Maintainer: Dávid Szabó ( complex857 AT gmail DOT com )
|
||||
" Previous Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
|
||||
" URL: https://github.com/shawncplus/phpcomplete.vim
|
||||
" Last Change: 2015 Jul 13
|
||||
" Last Change: 2016 Oct 10
|
||||
"
|
||||
" OPTIONS:
|
||||
"
|
||||
@@ -195,6 +195,8 @@ function! phpcomplete#CompletePHP(findstart, base) " {{{
|
||||
" }}}
|
||||
elseif context =~? 'implements'
|
||||
return phpcomplete#CompleteClassName(a:base, ['i'], current_namespace, imports)
|
||||
elseif context =~? 'instanceof'
|
||||
return phpcomplete#CompleteClassName(a:base, ['c', 'n'], current_namespace, imports)
|
||||
elseif context =~? 'extends\s\+.\+$' && a:base == ''
|
||||
return ['implements']
|
||||
elseif context =~? 'extends'
|
||||
@@ -787,6 +789,8 @@ function! phpcomplete#CompleteClassName(base, kinds, current_namespace, imports)
|
||||
|
||||
if kinds == ['c', 'i']
|
||||
let filterstr = 'v:val =~? "\\(class\\|interface\\)\\s\\+[a-zA-Z_\\x7f-\\xff][a-zA-Z_0-9\\x7f-\\xff]*\\s*"'
|
||||
elseif kinds == ['c', 'n']
|
||||
let filterstr = 'v:val =~? "\\(class\\|namespace\\)\\s\\+[a-zA-Z_\\x7f-\\xff][a-zA-Z_0-9\\x7f-\\xff]*\\s*"'
|
||||
elseif kinds == ['c']
|
||||
let filterstr = 'v:val =~? "class\\s\\+[a-zA-Z_\\x7f-\\xff][a-zA-Z_0-9\\x7f-\\xff]*\\s*"'
|
||||
elseif kinds == ['i']
|
||||
@@ -931,7 +935,7 @@ function! phpcomplete#EvaluateModifiers(modifiers, required_modifiers, prohibite
|
||||
endfor
|
||||
|
||||
for modifier in a:modifiers
|
||||
" if the modifier is prohibited its a no match
|
||||
" if the modifier is prohibited it's a no match
|
||||
if index(a:prohibited_modifiers, modifier) != -1
|
||||
return 0
|
||||
endif
|
||||
@@ -996,7 +1000,7 @@ function! phpcomplete#CompleteUserClass(context, base, sccontent, visibility) "
|
||||
let required_modifiers += ['static']
|
||||
endif
|
||||
let all_variable = filter(deepcopy(a:sccontent),
|
||||
\ 'v:val =~ "^\\s*\\(var\\s\\+\\|public\\s\\+\\|protected\\s\\+\\|private\\s\\+\\|final\\s\\+\\|abstract\\s\\+\\|static\\s\\+\\)\\+\\$"')
|
||||
\ 'v:val =~ "\\(^\\s*\\(var\\s\\+\\|public\\s\\+\\|protected\\s\\+\\|private\\s\\+\\|final\\s\\+\\|abstract\\s\\+\\|static\\s\\+\\)\\+\\$\\|^\\s*\\(\\/\\|\\*\\)*\\s*@property\\s\\+\\S\\+\\s\\S\\{-}\\s*$\\)"')
|
||||
|
||||
let variables = []
|
||||
for i in all_variable
|
||||
@@ -1160,6 +1164,14 @@ function! phpcomplete#GetTaglist(pattern) " {{{
|
||||
endif
|
||||
|
||||
let tags = taglist(a:pattern)
|
||||
for tag in tags
|
||||
for prop in keys(tag)
|
||||
if prop == 'cmd' || prop == 'static' || prop == 'kind' || prop == 'builtin'
|
||||
continue
|
||||
endif
|
||||
let tag[prop] = substitute(tag[prop], '\\\\', '\\', 'g')
|
||||
endfor
|
||||
endfor
|
||||
let s:cache_tags[a:pattern] = tags
|
||||
let has_key = has_key(s:cache_tags, a:pattern)
|
||||
let s:cache_tags_checksum = cache_checksum
|
||||
@@ -1379,7 +1391,7 @@ function! phpcomplete#GetCallChainReturnType(classname_candidate, class_candidat
|
||||
" Get Structured information of all classes and subclasses including namespace and includes
|
||||
" try to find the method's return type in docblock comment
|
||||
for classstructure in classcontents
|
||||
let docblock_target_pattern = 'function\s\+&\?'.method.'\|\(public\|private\|protected\|var\).\+\$'.method
|
||||
let docblock_target_pattern = 'function\s\+&\?'.method.'\>\|\(public\|private\|protected\|var\).\+\$'.method.'\>\|@property.\+\$'.method.'\>'
|
||||
let doc_str = phpcomplete#GetDocBlock(split(classstructure.content, '\n'), docblock_target_pattern)
|
||||
if doc_str != ''
|
||||
break
|
||||
@@ -1387,8 +1399,17 @@ function! phpcomplete#GetCallChainReturnType(classname_candidate, class_candidat
|
||||
endfor
|
||||
if doc_str != ''
|
||||
let docblock = phpcomplete#ParseDocBlock(doc_str)
|
||||
if has_key(docblock.return, 'type') || has_key(docblock.var, 'type')
|
||||
let type = has_key(docblock.return, 'type') ? docblock.return.type : docblock.var.type
|
||||
if has_key(docblock.return, 'type') || has_key(docblock.var, 'type') || len(docblock.properties) > 0
|
||||
let type = has_key(docblock.return, 'type') ? docblock.return.type : has_key(docblock.var, 'type') ? docblock.var.type : ''
|
||||
|
||||
if type == ''
|
||||
for property in docblock.properties
|
||||
if property.description =~? method
|
||||
let type = property.type
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
|
||||
" there's a namespace in the type, threat the type as FQCN
|
||||
if type =~ '\\'
|
||||
@@ -1554,6 +1575,9 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
|
||||
elseif get(methodstack, 0) =~# function_invocation_pattern
|
||||
let function_name = matchstr(methodstack[0], '^\s*\zs'.function_name_pattern)
|
||||
let function_file = phpcomplete#GetFunctionLocation(function_name, a:current_namespace)
|
||||
if function_file == ''
|
||||
let function_file = phpcomplete#GetFunctionLocation(function_name, '\')
|
||||
endif
|
||||
|
||||
if function_file == 'VIMPHP_BUILTINFUNCTION'
|
||||
" built in function, grab the return type from the info string
|
||||
@@ -1569,7 +1593,7 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
|
||||
let [class_candidate_namespace, function_imports] = phpcomplete#GetCurrentNameSpace(file_lines)
|
||||
" try to expand the classname of the returned type with the context got from the function's source file
|
||||
|
||||
let [classname_candidate, unused] = phpcomplete#ExpandClassName(classname_candidate, class_candidate_namespace, function_imports)
|
||||
let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(classname_candidate, class_candidate_namespace, function_imports)
|
||||
endif
|
||||
endif
|
||||
if classname_candidate != ''
|
||||
@@ -1650,9 +1674,10 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
|
||||
let sub_methodstack = phpcomplete#GetMethodStack(matchstr(line, '^\s*'.object.'\s*=&\?\s*\s\+\zs.*'))
|
||||
let [classname_candidate, class_candidate_namespace] = phpcomplete#GetCallChainReturnType(
|
||||
\ classname,
|
||||
\ a:current_namespace,
|
||||
\ namespace_for_class,
|
||||
\ a:imports,
|
||||
\ sub_methodstack)
|
||||
|
||||
return (class_candidate_namespace == '\' || class_candidate_namespace == '') ? classname_candidate : class_candidate_namespace.'\'.classname_candidate
|
||||
endif
|
||||
endif
|
||||
@@ -1783,6 +1808,9 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
|
||||
let [function_name, function_namespace] = phpcomplete#ExpandClassName(function_name, a:current_namespace, a:imports)
|
||||
|
||||
let function_file = phpcomplete#GetFunctionLocation(function_name, function_namespace)
|
||||
if function_file == ''
|
||||
let function_file = phpcomplete#GetFunctionLocation(function_name, '\')
|
||||
endif
|
||||
|
||||
if function_file == 'VIMPHP_BUILTINFUNCTION'
|
||||
" built in function, grab the return type from the info string
|
||||
@@ -1798,7 +1826,7 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
|
||||
let classname_candidate = docblock.return.type
|
||||
let [class_candidate_namespace, function_imports] = phpcomplete#GetCurrentNameSpace(file_lines)
|
||||
" try to expand the classname of the returned type with the context got from the function's source file
|
||||
let [classname_candidate, unused] = phpcomplete#ExpandClassName(classname_candidate, class_candidate_namespace, function_imports)
|
||||
let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(classname_candidate, class_candidate_namespace, function_imports)
|
||||
break
|
||||
endif
|
||||
endif
|
||||
@@ -1861,6 +1889,8 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
|
||||
for tag in tags
|
||||
if tag.kind ==? 'v' && tag.cmd =~? '=\s*new\s\+\zs'.class_name_pattern.'\ze'
|
||||
let classname = matchstr(tag.cmd, '=\s*new\s\+\zs'.class_name_pattern.'\ze')
|
||||
" unescape the classname, it would have "\" doubled since it is an ex command
|
||||
let classname = substitute(classname, '\\\(\_.\)', '\1', 'g')
|
||||
return classname
|
||||
endif
|
||||
endfor
|
||||
@@ -2077,6 +2107,19 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam
|
||||
endif
|
||||
call searchpair('{', '', '}', 'W')
|
||||
let class_closing_bracket_line = line('.')
|
||||
|
||||
" Include class docblock
|
||||
let doc_line = cfline - 1
|
||||
if getline(doc_line) =~? '^\s*\*/'
|
||||
while doc_line != 0
|
||||
if getline(doc_line) =~? '^\s*/\*\*'
|
||||
let cfline = doc_line
|
||||
break
|
||||
endif
|
||||
let doc_line -= 1
|
||||
endwhile
|
||||
endif
|
||||
|
||||
let classcontent = join(getline(cfline, class_closing_bracket_line), "\n")
|
||||
|
||||
let used_traits = []
|
||||
@@ -2241,8 +2284,19 @@ function! phpcomplete#GetDocBlock(sccontent, search) " {{{
|
||||
let line = a:sccontent[i]
|
||||
" search for a function declaration
|
||||
if line =~? a:search
|
||||
let l = i - 1
|
||||
" start backward serch for the comment block
|
||||
if line =~? '@property'
|
||||
let doc_line = i
|
||||
while doc_line != sccontent_len - 1
|
||||
if a:sccontent[doc_line] =~? '^\s*\*/'
|
||||
let l = doc_line
|
||||
break
|
||||
endif
|
||||
let doc_line += 1
|
||||
endwhile
|
||||
else
|
||||
let l = i - 1
|
||||
endif
|
||||
" start backward search for the comment block
|
||||
while l != 0
|
||||
let line = a:sccontent[l]
|
||||
" if it's a one line docblock like comment and we can just return it right away
|
||||
@@ -2263,7 +2317,7 @@ function! phpcomplete#GetDocBlock(sccontent, search) " {{{
|
||||
return ''
|
||||
end
|
||||
|
||||
while l != 0
|
||||
while l >= 0
|
||||
let line = a:sccontent[l]
|
||||
if line =~? '^\s*/\*\*'
|
||||
let comment_start = l
|
||||
@@ -2297,9 +2351,10 @@ function! phpcomplete#ParseDocBlock(docblock) " {{{
|
||||
\ 'return': {},
|
||||
\ 'throws': [],
|
||||
\ 'var': {},
|
||||
\ 'properties': [],
|
||||
\ }
|
||||
|
||||
let res.description = substitute(matchstr(a:docblock, '\zs\_.\{-}\ze\(@var\|@param\|@return\|$\)'), '\(^\_s*\|\_s*$\)', '', 'g')
|
||||
let res.description = substitute(matchstr(a:docblock, '\zs\_.\{-}\ze\(@type\|@var\|@param\|@return\|$\)'), '\(^\_s*\|\_s*$\)', '', 'g')
|
||||
let docblock_lines = split(a:docblock, "\n")
|
||||
|
||||
let param_lines = filter(copy(docblock_lines), 'v:val =~? "^@param"')
|
||||
@@ -2334,15 +2389,26 @@ function! phpcomplete#ParseDocBlock(docblock) " {{{
|
||||
endif
|
||||
endfor
|
||||
|
||||
let var_line = filter(copy(docblock_lines), 'v:val =~? "^@var"')
|
||||
let var_line = filter(copy(docblock_lines), 'v:val =~? "^\\(@var\\|@type\\)"')
|
||||
if len(var_line) > 0
|
||||
let var_parts = matchlist(var_line[0], '@var\s\+\(\S\+\)\s*\(.*\)')
|
||||
let var_parts = matchlist(var_line[0], '\(@var\|@type\)\s\+\(\S\+\)\s*\(.*\)')
|
||||
let res['var'] = {
|
||||
\ 'line': var_parts[0],
|
||||
\ 'type': phpcomplete#GetTypeFromDocBlockParam(get(var_parts, 1, '')),
|
||||
\ 'description': get(var_parts, 2, '')}
|
||||
\ 'type': phpcomplete#GetTypeFromDocBlockParam(get(var_parts, 2, '')),
|
||||
\ 'description': get(var_parts, 3, '')}
|
||||
endif
|
||||
|
||||
let property_lines = filter(copy(docblock_lines), 'v:val =~? "^@property"')
|
||||
for property_line in property_lines
|
||||
let parts = matchlist(property_line, '\(@property\)\s\+\(\S\+\)\s*\(.*\)')
|
||||
if len(parts) > 0
|
||||
call add(res.properties, {
|
||||
\ 'line': parts[0],
|
||||
\ 'type': phpcomplete#GetTypeFromDocBlockParam(get(parts, 2, '')),
|
||||
\ 'description': get(parts, 3, '')})
|
||||
endif
|
||||
endfor
|
||||
|
||||
return res
|
||||
endfunction
|
||||
" }}}
|
||||
@@ -2498,6 +2564,7 @@ function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{
|
||||
let name = matchstr(name, '\\\zs[^\\]\+\ze$')
|
||||
endif
|
||||
endif
|
||||
|
||||
" leading slash is not required use imports are always absolute
|
||||
let imports[name] = {'name': object, 'kind': ''}
|
||||
endfor
|
||||
@@ -2533,6 +2600,7 @@ function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{
|
||||
elseif !exists('no_namespace_candidate')
|
||||
" save the first namespacless match to be used if no better
|
||||
" candidate found later on
|
||||
let tag.namespace = namespace_for_classes
|
||||
let no_namespace_candidate = tag
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -8,7 +8,7 @@ let s:paste = {}
|
||||
" ownership of the selection, so we know how long the cache is valid.
|
||||
let s:selection = { 'owner': 0, 'data': [] }
|
||||
|
||||
function! s:selection.on_exit(jobid, data, event)
|
||||
function! s:selection.on_exit(jobid, data, event) abort
|
||||
" At this point this nvim instance might already have launched
|
||||
" a new provider instance. Don't drop ownership in this case.
|
||||
if self.owner == a:jobid
|
||||
@@ -18,7 +18,7 @@ endfunction
|
||||
|
||||
let s:selections = { '*': s:selection, '+': copy(s:selection)}
|
||||
|
||||
function! s:try_cmd(cmd, ...)
|
||||
function! s:try_cmd(cmd, ...) abort
|
||||
let argv = split(a:cmd, " ")
|
||||
let out = a:0 ? systemlist(argv, a:1, 1) : systemlist(argv, [''], 1)
|
||||
if v:shell_error
|
||||
@@ -34,7 +34,7 @@ function! s:try_cmd(cmd, ...)
|
||||
endfunction
|
||||
|
||||
" Returns TRUE if `cmd` exits with success, else FALSE.
|
||||
function! s:cmd_ok(cmd)
|
||||
function! s:cmd_ok(cmd) abort
|
||||
call system(a:cmd)
|
||||
return v:shell_error == 0
|
||||
endfunction
|
||||
@@ -47,7 +47,12 @@ function! provider#clipboard#Error() abort
|
||||
endfunction
|
||||
|
||||
function! provider#clipboard#Executable() abort
|
||||
if has('mac') && executable('pbcopy')
|
||||
if exists('g:clipboard')
|
||||
let s:copy = get(g:clipboard, 'copy', { '+': v:null, '*': v:null })
|
||||
let s:paste = get(g:clipboard, 'paste', { '+': v:null, '*': v:null })
|
||||
let s:cache_enabled = get(g:clipboard, 'cache_enabled', 1)
|
||||
return get(g:clipboard, 'name', 'g:clipboard')
|
||||
elseif has('mac') && executable('pbcopy')
|
||||
let s:copy['+'] = 'pbcopy'
|
||||
let s:paste['+'] = 'pbpaste'
|
||||
let s:copy['*'] = s:copy['+']
|
||||
@@ -84,6 +89,12 @@ function! provider#clipboard#Executable() abort
|
||||
let s:copy['*'] = s:copy['+']
|
||||
let s:paste['*'] = s:paste['+']
|
||||
return 'win32yank'
|
||||
elseif exists('$TMUX') && executable('tmux')
|
||||
let s:copy['+'] = 'tmux load-buffer -'
|
||||
let s:paste['+'] = 'tmux save-buffer -'
|
||||
let s:copy['*'] = s:copy['+']
|
||||
let s:paste['*'] = s:paste['+']
|
||||
return 'tmux'
|
||||
endif
|
||||
|
||||
let s:err = 'clipboard: No clipboard tool available. :help clipboard'
|
||||
@@ -96,14 +107,14 @@ endif
|
||||
|
||||
let s:clipboard = {}
|
||||
|
||||
function! s:clipboard.get(reg)
|
||||
function! s:clipboard.get(reg) abort
|
||||
if s:selections[a:reg].owner > 0
|
||||
return s:selections[a:reg].data
|
||||
end
|
||||
return s:try_cmd(s:paste[a:reg])
|
||||
endfunction
|
||||
|
||||
function! s:clipboard.set(lines, regtype, reg)
|
||||
function! s:clipboard.set(lines, regtype, reg) abort
|
||||
if a:reg == '"'
|
||||
call s:clipboard.set(a:lines,a:regtype,'+')
|
||||
if s:copy['*'] != s:copy['+']
|
||||
@@ -138,6 +149,6 @@ function! s:clipboard.set(lines, regtype, reg)
|
||||
let selection.owner = jobid
|
||||
endfunction
|
||||
|
||||
function! provider#clipboard#Call(method, args)
|
||||
function! provider#clipboard#Call(method, args) abort
|
||||
return call(s:clipboard[a:method],a:args,s:clipboard)
|
||||
endfunction
|
||||
|
||||
@@ -16,7 +16,11 @@ function! s:job_opts.on_stderr(chan_id, data, event)
|
||||
endfunction
|
||||
|
||||
function! provider#ruby#Detect() abort
|
||||
return exepath('neovim-ruby-host')
|
||||
if exists("g:ruby_host_prog")
|
||||
return g:ruby_host_prog
|
||||
else
|
||||
return exepath('neovim-ruby-host')
|
||||
end
|
||||
endfunction
|
||||
|
||||
function! provider#ruby#Prog()
|
||||
@@ -24,15 +28,15 @@ function! provider#ruby#Prog()
|
||||
endfunction
|
||||
|
||||
function! provider#ruby#Require(host) abort
|
||||
let args = [provider#ruby#Prog()]
|
||||
let prog = provider#ruby#Prog()
|
||||
let ruby_plugins = remote#host#PluginsForHost(a:host.name)
|
||||
|
||||
for plugin in ruby_plugins
|
||||
call add(args, plugin.path)
|
||||
let prog .= " " . shellescape(plugin.path)
|
||||
endfor
|
||||
|
||||
try
|
||||
let channel_id = jobstart(args, s:job_opts)
|
||||
let channel_id = jobstart(prog, s:job_opts)
|
||||
if rpcrequest(channel_id, 'poll') ==# 'ok'
|
||||
return channel_id
|
||||
endif
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
begin
|
||||
require "neovim/ruby_provider"
|
||||
require 'neovim/ruby_provider'
|
||||
rescue LoadError
|
||||
warn(
|
||||
"Your neovim RubyGem is missing or out of date. " +
|
||||
"Install the latest version using `gem install neovim`."
|
||||
)
|
||||
warn('Your neovim RubyGem is missing or out of date.',
|
||||
'Install the latest version using `gem install neovim`.')
|
||||
end
|
||||
|
||||
@@ -93,7 +93,7 @@ function! s:GetBufferRubyEntity( name, type, ... )
|
||||
|
||||
let stopline = 1
|
||||
|
||||
let crex = '^\s*\<' . a:type . '\>\s*\<' . a:name . '\>\s*\(<\s*.*\s*\)\?'
|
||||
let crex = '^\s*\<' . a:type . '\>\s*\<' . escape(a:name, '*') . '\>\s*\(<\s*.*\s*\)\?'
|
||||
let [lnum,lcol] = searchpos( crex, 'w' )
|
||||
"let [lnum,lcol] = searchpairpos( crex . '\zs', '', '\(end\|}\)', 'w' )
|
||||
|
||||
@@ -149,7 +149,7 @@ function! s:GetRubyVarType(v)
|
||||
let ctors = ctors.'\)'
|
||||
|
||||
let fstr = '=\s*\([^ \t]\+.' . ctors .'\>\|[\[{"''/]\|%[xwQqr][(\[{@]\|[A-Za-z0-9@:\-()\.]\+...\?\|lambda\|&\)'
|
||||
let sstr = ''.a:v.'\>\s*[+\-*/]*'.fstr
|
||||
let sstr = ''.escape(a:v, '*').'\>\s*[+\-*/]*'.fstr
|
||||
let [lnum,lcol] = searchpos(sstr,'nb',stopline)
|
||||
if lnum != 0 && lcol != 0
|
||||
let str = matchstr(getline(lnum),fstr,lcol)
|
||||
@@ -196,7 +196,7 @@ function! rubycomplete#Complete(findstart, base)
|
||||
if c =~ '\w'
|
||||
continue
|
||||
elseif ! c =~ '\.'
|
||||
idx = -1
|
||||
let idx = -1
|
||||
break
|
||||
else
|
||||
break
|
||||
@@ -266,6 +266,28 @@ class VimRubyCompletion
|
||||
end
|
||||
end
|
||||
|
||||
def load_gems
|
||||
fpath = VIM::evaluate("get(g:, 'rubycomplete_gemfile_path', 'Gemfile')")
|
||||
return unless File.file?(fpath) && File.readable?(fpath)
|
||||
want_bundler = VIM::evaluate("get(g:, 'rubycomplete_use_bundler')")
|
||||
parse_file = !want_bundler
|
||||
begin
|
||||
require 'bundler'
|
||||
Bundler.setup
|
||||
Bundler.require
|
||||
rescue Exception
|
||||
parse_file = true
|
||||
end
|
||||
if parse_file
|
||||
File.new(fpath).each_line do |line|
|
||||
begin
|
||||
require $1 if /\s*gem\s*['"]([^'"]+)/.match(line)
|
||||
rescue Exception
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def load_buffer_class(name)
|
||||
dprint "load_buffer_class(%s) START" % name
|
||||
classdef = get_buffer_entity(name, 's:GetBufferRubyClass("%s")')
|
||||
@@ -588,6 +610,10 @@ class VimRubyCompletion
|
||||
load_rails
|
||||
end
|
||||
|
||||
want_gems = VIM::evaluate("get(g:, 'rubycomplete_load_gemfile')")
|
||||
load_gems unless want_gems.to_i.zero?
|
||||
|
||||
|
||||
input = VIM::Buffer.current.line
|
||||
cpos = VIM::Window.current.cursor[1] - 1
|
||||
input = input[0..cpos]
|
||||
@@ -678,7 +704,9 @@ class VimRubyCompletion
|
||||
cv = eval("self.class.constants")
|
||||
vartype = get_var_type( receiver )
|
||||
dprint "vartype: %s" % vartype
|
||||
if vartype != ''
|
||||
|
||||
invalid_vartype = ['', "gets"]
|
||||
if !invalid_vartype.include?(vartype)
|
||||
load_buffer_class( vartype )
|
||||
|
||||
begin
|
||||
@@ -706,7 +734,7 @@ class VimRubyCompletion
|
||||
methods.concat m.instance_methods(false)
|
||||
}
|
||||
end
|
||||
variables += add_rails_columns( "#{vartype}" ) if vartype && vartype.length > 0
|
||||
variables += add_rails_columns( "#{vartype}" ) if vartype && !invalid_vartype.include?(vartype)
|
||||
|
||||
when /^\(?\s*[A-Za-z0-9:^@.%\/+*\(\)]+\.\.\.?[A-Za-z0-9:^@.%\/+*\(\)]+\s*\)?\.([^.]*)/
|
||||
message = $1
|
||||
|
||||
@@ -45,7 +45,7 @@ call map(copy(s:SHADA_ENTRY_NAMES),
|
||||
let s:SHADA_MAP_ENTRIES = {
|
||||
\'search_pattern': ['sp', 'sh', 'ss', 'sb', 'sm', 'sc', 'sl', 'se', 'so',
|
||||
\ 'su'],
|
||||
\'register': ['n', 'rc', 'rw', 'rt'],
|
||||
\'register': ['n', 'rc', 'rw', 'rt', 'ru'],
|
||||
\'global_mark': ['n', 'f', 'l', 'c'],
|
||||
\'local_mark': ['f', 'n', 'l', 'c'],
|
||||
\'jump': ['f', 'l', 'c'],
|
||||
@@ -139,6 +139,7 @@ let s:SHADA_STANDARD_KEYS = {
|
||||
\'rt': ['type', 'regtype', s:SHADA_ENUMS.regtype.CHARACTERWISE],
|
||||
\'rw': ['block width', 'uint', 0],
|
||||
\'rc': ['contents', 'binarray', s:SHADA_REQUIRED],
|
||||
\'ru': ['is_unnamed', 'boolean', g:msgpack#false],
|
||||
\'n': ['name', 'intchar', char2nr('"')],
|
||||
\'l': ['line number', 'uint', 1],
|
||||
\'c': ['column', 'uint', 0],
|
||||
|
||||
@@ -117,7 +117,7 @@ fun! tar#Browse(tarfile)
|
||||
if !filereadable(a:tarfile)
|
||||
" call Decho('a:tarfile<'.a:tarfile.'> not filereadable')
|
||||
if a:tarfile !~# '^\a\+://'
|
||||
" if its an url, don't complain, let url-handlers such as vim do its thing
|
||||
" if it's an url, don't complain, let url-handlers such as vim do its thing
|
||||
redraw!
|
||||
echohl Error | echo "***error*** (tar#Browse) File not readable<".a:tarfile.">" | echohl None
|
||||
endif
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" zip.vim: Handles browsing zipfiles
|
||||
" AUTOLOAD PORTION
|
||||
" Date: Jul 02, 2013
|
||||
" Version: 27
|
||||
" Date: Sep 13, 2016
|
||||
" Version: 28
|
||||
" Maintainer: Charles E Campbell <NdrOchip@ScampbellPfamily.AbizM-NOSPAM>
|
||||
" License: Vim License (see vim's :help license)
|
||||
" Copyright: Copyright (C) 2005-2013 Charles E. Campbell {{{1
|
||||
@@ -20,10 +20,10 @@
|
||||
if &cp || exists("g:loaded_zip")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_zip= "v27"
|
||||
let g:loaded_zip= "v28"
|
||||
if v:version < 702
|
||||
echohl WarningMsg
|
||||
echo "***warning*** this version of zip needs vim 7.2"
|
||||
echo "***warning*** this version of zip needs vim 7.2 or later"
|
||||
echohl Normal
|
||||
finish
|
||||
endif
|
||||
@@ -53,6 +53,9 @@ endif
|
||||
if !exists("g:zip_unzipcmd")
|
||||
let g:zip_unzipcmd= "unzip"
|
||||
endif
|
||||
if !exists("g:zip_extractcmd")
|
||||
let g:zip_extractcmd= g:zip_unzipcmd
|
||||
endif
|
||||
|
||||
" ----------------
|
||||
" Functions: {{{1
|
||||
@@ -62,14 +65,14 @@ endif
|
||||
" zip#Browse: {{{2
|
||||
fun! zip#Browse(zipfile)
|
||||
" call Dfunc("zip#Browse(zipfile<".a:zipfile.">)")
|
||||
" sanity check: insure that the zipfile has "PK" as its first two letters
|
||||
" sanity check: ensure that the zipfile has "PK" as its first two letters
|
||||
" (zipped files have a leading PK as a "magic cookie")
|
||||
if !filereadable(a:zipfile) || readfile(a:zipfile, "", 1)[0] !~ '^PK'
|
||||
exe "noautocmd e ".fnameescape(a:zipfile)
|
||||
" call Dret("zip#Browse : not a zipfile<".a:zipfile.">")
|
||||
return
|
||||
" else " Decho
|
||||
" call Decho("zip#Browse: a:zipfile<".a:zipfile."> passed PK test - its a zip file")
|
||||
" call Decho("zip#Browse: a:zipfile<".a:zipfile."> passed PK test - it's a zip file")
|
||||
endif
|
||||
|
||||
let repkeep= &report
|
||||
@@ -92,7 +95,7 @@ fun! zip#Browse(zipfile)
|
||||
endif
|
||||
if !filereadable(a:zipfile)
|
||||
if a:zipfile !~# '^\a\+://'
|
||||
" if its an url, don't complain, let url-handlers such as vim do its thing
|
||||
" if it's an url, don't complain, let url-handlers such as vim do its thing
|
||||
redraw!
|
||||
echohl Error | echo "***error*** (zip#Browse) File not readable<".a:zipfile.">" | echohl None
|
||||
" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||
@@ -136,8 +139,10 @@ fun! zip#Browse(zipfile)
|
||||
return
|
||||
endif
|
||||
|
||||
" Maps associated with zip plugin
|
||||
setlocal noma nomod ro
|
||||
noremap <silent> <buffer> <cr> :call <SID>ZipBrowseSelect()<cr>
|
||||
noremap <silent> <buffer> <cr> :call <SID>ZipBrowseSelect()<cr>
|
||||
noremap <silent> <buffer> x :call zip#Extract()<cr>
|
||||
|
||||
let &report= repkeep
|
||||
" call Dret("zip#Browse")
|
||||
@@ -204,6 +209,15 @@ fun! zip#Read(fname,mode)
|
||||
endif
|
||||
" call Decho("zipfile<".zipfile.">")
|
||||
" call Decho("fname <".fname.">")
|
||||
" sanity check
|
||||
if !executable(substitute(g:zip_unzipcmd,'\s\+.*$','',''))
|
||||
redraw!
|
||||
echohl Error | echo "***error*** (zip#Read) sorry, your system doesn't appear to have the ".g:zip_unzipcmd." program" | echohl None
|
||||
" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||
let &report= repkeep
|
||||
" call Dret("zip#Write")
|
||||
return
|
||||
endif
|
||||
|
||||
" the following code does much the same thing as
|
||||
" exe "keepj sil! r! ".g:zip_unzipcmd." -p -- ".s:Escape(zipfile,1)." ".s:Escape(fnameescape(fname),1)
|
||||
@@ -236,9 +250,9 @@ fun! zip#Write(fname)
|
||||
set report=10
|
||||
|
||||
" sanity checks
|
||||
if !executable(g:zip_zipcmd)
|
||||
if !executable(substitute(g:zip_zipcmd,'\s\+.*$','',''))
|
||||
redraw!
|
||||
echohl Error | echo "***error*** (zip#Write) sorry, your system doesn't appear to have the zip pgm" | echohl None
|
||||
echohl Error | echo "***error*** (zip#Write) sorry, your system doesn't appear to have the ".g:zip_zipcmd." program" | echohl None
|
||||
" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||
let &report= repkeep
|
||||
" call Dret("zip#Write")
|
||||
@@ -344,6 +358,48 @@ fun! zip#Write(fname)
|
||||
" call Dret("zip#Write")
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" zip#Extract: extract a file from a zip archive {{{2
|
||||
fun! zip#Extract()
|
||||
" call Dfunc("zip#Extract()")
|
||||
|
||||
let repkeep= &report
|
||||
set report=10
|
||||
let fname= getline(".")
|
||||
" call Decho("fname<".fname.">")
|
||||
|
||||
" sanity check
|
||||
if fname =~ '^"'
|
||||
let &report= repkeep
|
||||
" call Dret("zip#Extract")
|
||||
return
|
||||
endif
|
||||
if fname =~ '/$'
|
||||
redraw!
|
||||
echohl Error | echo "***error*** (zip#Extract) Please specify a file, not a directory" | echohl None
|
||||
let &report= repkeep
|
||||
" call Dret("zip#Extract")
|
||||
return
|
||||
endif
|
||||
|
||||
" extract the file mentioned under the cursor
|
||||
" call Decho("system(".g:zip_extractcmd." ".shellescape(b:zipfile)." ".shellescape(shell).")")
|
||||
call system(g:zip_extractcmd." ".shellescape(b:zipfile)." ".shellescape(shell))
|
||||
" call Decho("zipfile<".b:zipfile.">")
|
||||
if v:shell_error != 0
|
||||
echohl Error | echo "***error*** ".g:zip_extractcmd." ".b:zipfile." ".fname.": failed!" | echohl NONE
|
||||
elseif !filereadable(fname)
|
||||
echohl Error | echo "***error*** attempted to extract ".fname." but it doesn't appear to be present!"
|
||||
else
|
||||
echo "***note*** successfully extracted ".fname
|
||||
endif
|
||||
|
||||
" restore option
|
||||
let &report= repkeep
|
||||
|
||||
" call Dret("zip#Extract")
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" s:Escape: {{{2
|
||||
fun! s:Escape(fname,isfilt)
|
||||
|
||||
@@ -41,9 +41,16 @@ this autocmd might be useful:
|
||||
autocmd SourcePre */colors/blue_sky.vim set background=dark
|
||||
Replace "blue_sky" with the name of the colorscheme.
|
||||
|
||||
In case you want to tweak a colorscheme after it was loaded, check out that
|
||||
In case you want to tweak a colorscheme after it was loaded, check out the
|
||||
ColorScheme autocmd event.
|
||||
|
||||
To customize a colorscheme use another name, e.g. "~/.vim/colors/mine.vim",
|
||||
and use `:runtime` to load the original colorscheme:
|
||||
" load the "evening" colorscheme
|
||||
runtime colors/evening.vim
|
||||
" change the color of statements
|
||||
hi Statement ctermfg=Blue guifg=Blue
|
||||
|
||||
To see which highlight group is used where, find the help for
|
||||
"highlight-groups" and "group-name".
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
" Vim color file
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2006 Apr 14
|
||||
" Last Change: 2016 Oct 10
|
||||
|
||||
" This color scheme uses a dark grey background.
|
||||
|
||||
@@ -45,8 +45,8 @@ hi CursorColumn term=reverse ctermbg=Black guibg=grey40
|
||||
hi CursorLine term=underline cterm=underline guibg=grey40
|
||||
|
||||
" Groups for syntax highlighting
|
||||
hi Constant term=underline ctermfg=Magenta guifg=#ffa0a0 guibg=grey5
|
||||
hi Special term=bold ctermfg=LightRed guifg=Orange guibg=grey5
|
||||
hi Constant term=underline ctermfg=Magenta guifg=#ffa0a0
|
||||
hi Special term=bold ctermfg=LightRed guifg=Orange
|
||||
if &t_Co > 8
|
||||
hi Statement term=bold cterm=bold ctermfg=Yellow guifg=#ffff60 gui=bold
|
||||
endif
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
" vim: tw=0 ts=4 sw=4
|
||||
" Vim color file
|
||||
" Maintainer: Ron Aaron <ron@ronware.org>
|
||||
" Last Change: 2013 May 23
|
||||
" Last Change: 2016 Sep 04
|
||||
|
||||
hi clear
|
||||
set background=dark
|
||||
@@ -45,6 +45,7 @@ hi TabLineFill term=bold,reverse cterm=bold ctermfg=lightblue ctermbg=white g
|
||||
hi TabLineSel term=reverse ctermfg=white ctermbg=lightblue guifg=white guibg=blue
|
||||
hi Underlined term=underline cterm=bold,underline ctermfg=lightblue guifg=lightblue gui=bold,underline
|
||||
hi Ignore ctermfg=black ctermbg=black guifg=black guibg=black
|
||||
hi EndOfBuffer term=bold cterm=bold ctermfg=darkred guifg=#cc0000 gui=bold
|
||||
hi link IncSearch Visual
|
||||
hi link String Constant
|
||||
hi link Character Constant
|
||||
|
||||
54
runtime/compiler/context.vim
Normal file
54
runtime/compiler/context.vim
Normal file
@@ -0,0 +1,54 @@
|
||||
" Vim compiler file
|
||||
" Compiler: ConTeXt typesetting engine
|
||||
" Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com>
|
||||
" Last Change: 2016 Oct 21
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let s:keepcpo= &cpo
|
||||
set cpo&vim
|
||||
|
||||
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
" If makefile exists and we are not asked to ignore it, we use standard make
|
||||
" (do not redefine makeprg)
|
||||
if get(b:, 'context_ignore_makefile', get(g:, 'context_ignore_makefile', 0)) ||
|
||||
\ (!filereadable('Makefile') && !filereadable('makefile'))
|
||||
let current_compiler = 'context'
|
||||
" The following assumes that the current working directory is set to the
|
||||
" directory of the file to be typeset
|
||||
let &l:makeprg = get(b:, 'context_mtxrun', get(g:, 'context_mtxrun', 'mtxrun'))
|
||||
\ . ' --script context --autogenerate --nonstopmode --synctex='
|
||||
\ . (get(b:, 'context_synctex', get(g:, 'context_synctex', 0)) ? '1' : '0')
|
||||
\ . ' ' . get(b:, 'context_extra_options', get(g:, 'context_extra_options', ''))
|
||||
\ . ' ' . shellescape(expand('%:p:t'))
|
||||
else
|
||||
let current_compiler = 'make'
|
||||
endif
|
||||
|
||||
let b:context_errorformat = ''
|
||||
\ . '%-Popen source%.%#> %f,'
|
||||
\ . '%-Qclose source%.%#> %f,'
|
||||
\ . "%-Popen source%.%#name '%f',"
|
||||
\ . "%-Qclose source%.%#name '%f',"
|
||||
\ . '%Etex %trror%.%#mp error on line %l in file %f:%.%#,'
|
||||
\ . 'tex %trror%.%#error on line %l in file %f: %m,'
|
||||
\ . '%Elua %trror%.%#error on line %l in file %f:,'
|
||||
\ . '%+Emetapost %#> error: %#,'
|
||||
\ . '! error: %#%m,'
|
||||
\ . '%-C %#,'
|
||||
\ . '%C! %m,'
|
||||
\ . '%Z[ctxlua]%m,'
|
||||
\ . '%+C<*> %.%#,'
|
||||
\ . '%-C%.%#,'
|
||||
\ . '%Z...%m,'
|
||||
\ . '%-Zno-error,'
|
||||
\ . '%-G%.%#' " Skip remaining lines
|
||||
|
||||
execute 'CompilerSet errorformat=' . escape(b:context_errorformat, ' ')
|
||||
|
||||
let &cpo = s:keepcpo
|
||||
unlet s:keepcpo
|
||||
16
runtime/compiler/csslint.vim
Normal file
16
runtime/compiler/csslint.vim
Normal file
@@ -0,0 +1,16 @@
|
||||
" Vim compiler file
|
||||
" Compiler: csslint for CSS
|
||||
" Maintainer: Daniel Moch <daniel@danielmoch.com>
|
||||
" Last Change: 2016 May 21
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "csslint"
|
||||
|
||||
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
CompilerSet makeprg=csslint\ --format=compact
|
||||
CompilerSet errorformat=%-G,%-G%f:\ lint\ free!,%f:\ line\ %l\\,\ col\ %c\\,\ %trror\ -\ %m,%f:\ line\ %l\\,\ col\ %c\\,\ %tarning\ -\ %m,%f:\ line\ %l\\,\ col\ %c\\,\ %m
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim compiler file
|
||||
" Compiler: Cucumber
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" Last Change: 2010 Aug 09
|
||||
" Last Change: 2016 Aug 29
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
@@ -19,7 +19,7 @@ CompilerSet makeprg=cucumber
|
||||
|
||||
CompilerSet errorformat=
|
||||
\%W%m\ (Cucumber::Undefined),
|
||||
\%E%m\ (%.%#),
|
||||
\%E%m\ (%\\S%#),
|
||||
\%Z%f:%l,
|
||||
\%Z%f:%l:%.%#
|
||||
|
||||
|
||||
26
runtime/compiler/ghc.vim
Normal file
26
runtime/compiler/ghc.vim
Normal file
@@ -0,0 +1,26 @@
|
||||
" Vim compiler file
|
||||
" Compiler: GHC Haskell Compiler
|
||||
" Maintainer: Daniel Campoverde <alx@sillybytes.net>
|
||||
" Latest Revision: 2016-11-29
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "ghc"
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
CompilerSet errorformat=
|
||||
\%-G%.%#:\ build,
|
||||
\%-G%.%#preprocessing\ library\ %.%#,
|
||||
\%-G[%.%#]%.%#,
|
||||
\%E%f:%l:%c:\ %m,
|
||||
\%-G--%.%#
|
||||
|
||||
if exists('g:compiler_ghc_ignore_unmatched_lines')
|
||||
CompilerSet errorformat+=%-G%.%#
|
||||
endif
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim compiler file
|
||||
" Compiler: Haml
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" Last Change: 2013 May 30
|
||||
" Last Change: 2016 Aug 29
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
@@ -15,7 +15,7 @@ endif
|
||||
let s:cpo_save = &cpo
|
||||
set cpo-=C
|
||||
|
||||
CompilerSet makeprg=haml\ -c
|
||||
CompilerSet makeprg=haml
|
||||
|
||||
CompilerSet errorformat=
|
||||
\Haml\ %trror\ on\ line\ %l:\ %m,
|
||||
|
||||
16
runtime/compiler/pylint.vim
Normal file
16
runtime/compiler/pylint.vim
Normal file
@@ -0,0 +1,16 @@
|
||||
" Vim compiler file
|
||||
" Compiler: Pylint for Python
|
||||
" Maintainer: Daniel Moch <daniel@danielmoch.com>
|
||||
" Last Change: 2016 May 20
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "pylint"
|
||||
|
||||
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
CompilerSet makeprg=pylint\ --output-format=text\ --msg-template=\"{path}:{line}:{column}:{C}:\ [{symbol}]\ {msg}\"\ --reports=no
|
||||
CompilerSet errorformat=%A%f:%l:%c:%t:\ %m,%A%f:%l:\ %m,%A%f:(%l):\ %m,%-Z%p^%.%#,%-G%.%#
|
||||
@@ -27,7 +27,11 @@ CompilerSet errorformat=
|
||||
\%\\s%#[%f:%l:\ %#%m,
|
||||
\%\\s%#%f:%l:\ %#%m,
|
||||
\%\\s%#%f:%l:,
|
||||
\%m\ [%f:%l]:
|
||||
\%m\ [%f:%l]:,
|
||||
\%+Erake\ aborted!,
|
||||
\%+EDon't\ know\ how\ to\ build\ task\ %.%#,
|
||||
\%+Einvalid\ option:%.%#,
|
||||
\%+Irake\ %\\S%\\+%\\s%\\+#\ %.%#
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
@@ -22,9 +22,10 @@ CompilerSet errorformat=
|
||||
\%f:%l:\ %tarning:\ %m,
|
||||
\%E%.%#:in\ `load':\ %f:%l:%m,
|
||||
\%E%f:%l:in\ `%*[^']':\ %m,
|
||||
\%-Z\ \ \ \ \ \#\ %f:%l:%.%#,
|
||||
\%-Z\ \ \ \ \ %\\+\#\ %f:%l:%.%#,
|
||||
\%E\ \ %\\d%\\+)%.%#,
|
||||
\%C\ \ \ \ \ %m,
|
||||
\%C%\\s%#,
|
||||
\%-G%.%#
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
|
||||
@@ -17,6 +17,8 @@ let s:cpo_save = &cpo
|
||||
set cpo-=C
|
||||
|
||||
CompilerSet makeprg=testrb
|
||||
" CompilerSet makeprg=ruby\ -Itest
|
||||
" CompilerSet makeprg=m
|
||||
|
||||
CompilerSet errorformat=\%W\ %\\+%\\d%\\+)\ Failure:,
|
||||
\%C%m\ [%f:%l]:,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim compiler file
|
||||
" Compiler: Sass
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" Last Change: 2013 May 30
|
||||
" Last Change: 2016 Aug 29
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
@@ -15,7 +15,7 @@ endif
|
||||
let s:cpo_save = &cpo
|
||||
set cpo-=C
|
||||
|
||||
CompilerSet makeprg=sass\ -c
|
||||
CompilerSet makeprg=sass
|
||||
|
||||
CompilerSet errorformat=
|
||||
\%f:%l:%m\ (Sass::Syntax%trror),
|
||||
|
||||
@@ -11,6 +11,8 @@ via |msgpack-rpc|, Lua and VimL (|eval-api|).
|
||||
|
||||
Applications can also embed libnvim to work with the C API directly.
|
||||
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
API Types *api-types*
|
||||
|
||||
@@ -46,6 +48,7 @@ version.api_compatible API is backwards-compatible with this level
|
||||
version.api_prerelease Declares the current API level as unstable >
|
||||
(version.api_prerelease && fn.since == version.api_level)
|
||||
functions API function signatures
|
||||
ui_events UI event signatures |rpc-remote-ui|
|
||||
{fn}.since API level where function {fn} was introduced
|
||||
{fn}.deprecated_since API level where function {fn} was deprecated
|
||||
types Custom handle types defined by Nvim
|
||||
@@ -268,7 +271,7 @@ nvim_get_option({name}) *nvim_get_option()*
|
||||
{name} Option name
|
||||
|
||||
Return:~
|
||||
Option value
|
||||
Option value (global)
|
||||
|
||||
nvim_set_option({name}, {value}) *nvim_set_option()*
|
||||
Sets an option value
|
||||
@@ -368,6 +371,17 @@ nvim_get_color_by_name({name}) *nvim_get_color_by_name()*
|
||||
nvim_get_color_map() *nvim_get_color_map()*
|
||||
TODO: Documentation
|
||||
|
||||
nvim_get_mode() *nvim_get_mode()*
|
||||
Gets the current mode.
|
||||
mode: Mode string. |mode()|
|
||||
blocking: true if Nvim is waiting for input.
|
||||
|
||||
Attributes:~
|
||||
{async}
|
||||
|
||||
Return:~
|
||||
Dictionary { "mode": String, "blocking": Boolean }
|
||||
|
||||
nvim_get_api_info() *nvim_get_api_info()*
|
||||
TODO: Documentation
|
||||
|
||||
@@ -512,15 +526,6 @@ nvim_buf_set_option({buffer}, {name}, {value}) *nvim_buf_set_option()*
|
||||
{name} Option name
|
||||
{value} Option value
|
||||
|
||||
nvim_buf_get_number({buffer}) *nvim_buf_get_number()*
|
||||
Gets the buffer number
|
||||
|
||||
Parameters:~
|
||||
{buffer} Buffer handle
|
||||
|
||||
Return:~
|
||||
Buffer number
|
||||
|
||||
nvim_buf_get_name({buffer}) *nvim_buf_get_name()*
|
||||
Gets the full file name for the buffer
|
||||
|
||||
|
||||
@@ -8,17 +8,7 @@ Automatic commands *autocommand*
|
||||
|
||||
For a basic explanation, see section |40.3| in the user manual.
|
||||
|
||||
1. Introduction |autocmd-intro|
|
||||
2. Defining autocommands |autocmd-define|
|
||||
3. Removing autocommands |autocmd-remove|
|
||||
4. Listing autocommands |autocmd-list|
|
||||
5. Events |autocmd-events|
|
||||
6. Patterns |autocmd-patterns|
|
||||
7. Buffer-local autocommands |autocmd-buflocal|
|
||||
8. Groups |autocmd-groups|
|
||||
9. Executing autocommands |autocmd-execute|
|
||||
10. Using autocommands |autocmd-use|
|
||||
11. Disabling autocommands |autocmd-disable|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Introduction *autocmd-intro*
|
||||
@@ -30,7 +20,7 @@ files matching *.c. You can also use autocommands to implement advanced
|
||||
features, such as editing compressed files (see |gzip-example|). The usual
|
||||
place to put autocommands is in your vimrc file.
|
||||
|
||||
*E203* *E204* *E143* *E855*
|
||||
*E203* *E204* *E143* *E855* *E937*
|
||||
WARNING: Using autocommands is very powerful, and may lead to unexpected side
|
||||
effects. Be careful not to destroy your text.
|
||||
- It's a good idea to do some testing on an expendable copy of a file first.
|
||||
@@ -76,11 +66,15 @@ exception is that "<sfile>" is expanded when the autocmd is defined. Example:
|
||||
|
||||
Here Vim expands <sfile> to the name of the file containing this line.
|
||||
|
||||
When your vimrc file is sourced twice, the autocommands will appear twice.
|
||||
To avoid this, put this command in your vimrc file, before defining
|
||||
autocommands: >
|
||||
`:autocmd` adds to the list of autocommands regardless of whether they are
|
||||
already present. When your .vimrc file is sourced twice, the autocommands
|
||||
will appear twice. To avoid this, define your autocommands in a group, so
|
||||
that you can easily clear them: >
|
||||
|
||||
:autocmd! " Remove ALL autocommands for the current group.
|
||||
augroup vimrc
|
||||
autocmd! " Remove all vimrc autocommands
|
||||
au BufNewFile,BufRead *.html so <sfile>:h/html.vim
|
||||
augroup END
|
||||
|
||||
If you don't want to remove all autocommands, you can instead use a variable
|
||||
to ensure that Vim includes the autocommands only once: >
|
||||
@@ -127,8 +121,13 @@ prompt. When one command outputs two messages this can happen anyway.
|
||||
|
||||
:au[tocmd]! [group] {event}
|
||||
Remove ALL autocommands for {event}.
|
||||
Warning: You should not do this without a group for
|
||||
|BufRead| and other common events, it can break
|
||||
plugins, syntax highlighting, etc.
|
||||
|
||||
:au[tocmd]! [group] Remove ALL autocommands.
|
||||
Warning: You should normally not do this without a
|
||||
group, it breaks plugins, syntax highlighting, etc.
|
||||
|
||||
When the [group] argument is not given, Vim uses the current group (as defined
|
||||
with ":augroup"); otherwise, Vim uses the group defined with [group].
|
||||
@@ -422,8 +421,8 @@ BufUnload Before unloading a buffer. This is when the
|
||||
NOTE: When this autocommand is executed, the
|
||||
current buffer "%" may be different from the
|
||||
buffer being unloaded "<afile>".
|
||||
Don't change to another buffer, it will cause
|
||||
problems.
|
||||
Don't change to another buffer or window, it
|
||||
will cause problems!
|
||||
When exiting and v:dying is 2 or more this
|
||||
event is not triggered.
|
||||
*BufWinEnter*
|
||||
@@ -794,7 +793,9 @@ QuickFixCmdPre Before a quickfix command is run (|:make|,
|
||||
|:vimgrepadd|, |:lvimgrepadd|, |:cscope|,
|
||||
|:cfile|, |:cgetfile|, |:caddfile|, |:lfile|,
|
||||
|:lgetfile|, |:laddfile|, |:helpgrep|,
|
||||
|:lhelpgrep|).
|
||||
|:lhelpgrep|, |:cexpr|, |:cgetexpr|,
|
||||
|:caddexpr|, |:cbuffer|, |:cgetbuffer|,
|
||||
|:caddbuffer|).
|
||||
The pattern is matched against the command
|
||||
being run. When |:grep| is used but 'grepprg'
|
||||
is set to "internal" it still matches "grep".
|
||||
@@ -1002,7 +1003,7 @@ WinLeave Before leaving a window. If the window to be
|
||||
|
||||
*WinNew*
|
||||
WinNew When a new window was created. Not done for
|
||||
the fist window, when Vim has just started.
|
||||
the first window, when Vim has just started.
|
||||
Before a WinEnter event.
|
||||
|
||||
==============================================================================
|
||||
@@ -1086,6 +1087,9 @@ Note that for all systems the '/' character is used for path separator (even
|
||||
Windows). This was done because the backslash is difficult to use in a pattern
|
||||
and to make the autocommands portable across different systems.
|
||||
|
||||
It is possible to use |pattern| items, but they may not work as expected,
|
||||
because of the translation done for the above.
|
||||
|
||||
*autocmd-changes*
|
||||
Matching with the pattern is done when an event is triggered. Changing the
|
||||
buffer name in one of the autocommands, or even deleting the buffer, does not
|
||||
@@ -1184,11 +1188,12 @@ name!
|
||||
different from existing {event} names, as this
|
||||
most likely will not do what you intended.
|
||||
|
||||
*:augroup-delete* *E367* *W19*
|
||||
*:augroup-delete* *E367* *W19* *E936*
|
||||
:aug[roup]! {name} Delete the autocmd group {name}. Don't use
|
||||
this if there is still an autocommand using
|
||||
this group! You will get a warning if doing
|
||||
it anyway.
|
||||
it anyway. when the group is the current group
|
||||
you will get error E936.
|
||||
|
||||
To enter autocommands for a specific group, use this method:
|
||||
1. Select the group with ":augroup {name}".
|
||||
|
||||
@@ -9,20 +9,10 @@ changing text means deleting the text and replacing it with other text using
|
||||
one command. You can undo all of these commands. You can repeat the non-Ex
|
||||
commands with the "." command.
|
||||
|
||||
1. Deleting text |deleting|
|
||||
2. Delete and insert |delete-insert|
|
||||
3. Simple changes |simple-change| *changing*
|
||||
4. Complex changes |complex-change|
|
||||
4.1 Filter commands |filter|
|
||||
4.2 Substitute |:substitute|
|
||||
4.3 Search and replace |search-replace|
|
||||
4.4 Changing tabs |change-tabs|
|
||||
5. Copying and moving text |copy-move|
|
||||
6. Formatting text |formatting|
|
||||
7. Sorting text |sorting|
|
||||
|
||||
For inserting text see |insert.txt|.
|
||||
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Deleting text *deleting* *E470*
|
||||
|
||||
@@ -259,7 +249,7 @@ Or use "caw" (see |aw|).
|
||||
command is executed.
|
||||
|
||||
==============================================================================
|
||||
3. Simple changes *simple-change*
|
||||
3. Simple changes *simple-change* *changing*
|
||||
|
||||
*r*
|
||||
r{char} Replace the character under the cursor with {char}.
|
||||
@@ -398,11 +388,6 @@ CTRL-X Subtract [count] from the number or alphabetic
|
||||
{Visual}CTRL-X Subtract [count] from the number or alphabetic
|
||||
character in the highlighted text. {not in Vi}
|
||||
|
||||
On MS-Windows, this is mapped to cut Visual text
|
||||
|dos-standard-mappings|. If you want to disable the
|
||||
mapping, use this: >
|
||||
silent! vunmap <C-X>
|
||||
<
|
||||
*v_g_CTRL-X*
|
||||
{Visual}g CTRL-X Subtract [count] from the number or alphabetic
|
||||
character in the highlighted text. If several lines
|
||||
@@ -614,12 +599,14 @@ Directory for temporary files is created in the first suitable directory of:
|
||||
For the {pattern} see |pattern|.
|
||||
{string} can be a literal string, or something
|
||||
special; see |sub-replace-special|.
|
||||
*E939*
|
||||
When [range] and [count] are omitted, replace in the
|
||||
current line only.
|
||||
When [count] is given, replace in [count] lines,
|
||||
starting with the last line in [range]. When [range]
|
||||
is omitted start in the current line.
|
||||
Also see |cmdline-ranges|.
|
||||
current line only. When [count] is given, replace in
|
||||
[count] lines, starting with the last line in [range].
|
||||
When [range] is omitted start in the current line.
|
||||
[count] must be a positive number. Also see
|
||||
|cmdline-ranges|.
|
||||
|
||||
See |:s_flags| for [flags].
|
||||
|
||||
:[range]s[ubstitute] [flags] [count]
|
||||
@@ -833,6 +820,7 @@ The numbering of "\1", "\2" etc. is done based on which "\(" comes first in
|
||||
the pattern (going left to right). When a parentheses group matches several
|
||||
times, the last one will be used for "\1", "\2", etc. Example: >
|
||||
:s/\(\(a[a-d] \)*\)/\2/ modifies "aa ab x" to "ab x"
|
||||
The "\2" is for "\(a[a-d] \)". At first it matches "aa ", secondly "ab ".
|
||||
|
||||
When using parentheses in combination with '|', like in \([ab]\)\|\([cd]\),
|
||||
either the first or second pattern in parentheses did not match, so either
|
||||
|
||||
@@ -13,13 +13,7 @@ Command-line mode is used to enter Ex commands (":"), search patterns
|
||||
Basic command line editing is explained in chapter 20 of the user manual
|
||||
|usr_20.txt|.
|
||||
|
||||
1. Command-line editing |cmdline-editing|
|
||||
2. Command-line completion |cmdline-completion|
|
||||
3. Ex command-lines |cmdline-lines|
|
||||
4. Ex command-line ranges |cmdline-ranges|
|
||||
5. Ex command-line flags |ex-flags|
|
||||
6. Ex special characters |cmdline-special|
|
||||
7. Command-line window |cmdline-window|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Command-line editing *cmdline-editing*
|
||||
@@ -219,9 +213,10 @@ CTRL-Y When there is a modeless selection, copy the selection into
|
||||
the clipboard. |modeless-selection|
|
||||
If there is no selection CTRL-Y is inserted as a character.
|
||||
|
||||
CTRL-J *c_CTRL-J* *c_<NL>* *c_<CR>* *c_CR*
|
||||
CTRL-M or CTRL-J *c_CTRL-M* *c_CTRL-J* *c_<NL>* *c_<CR>* *c_CR*
|
||||
<CR> or <NL> start entered command
|
||||
*c_<Esc>* *c_Esc*
|
||||
|
||||
CTRL-[ *c_CTRL-[* *c_<Esc>* *c_Esc*
|
||||
<Esc> When typed and 'x' not present in 'cpoptions', quit
|
||||
Command-line mode without executing. In macros or when 'x'
|
||||
present in 'cpoptions', start entered command.
|
||||
@@ -394,12 +389,26 @@ CTRL-L A match is done on the pattern in front of the cursor. If
|
||||
If there are multiple matches the longest common part is
|
||||
inserted in place of the pattern. If the result is shorter
|
||||
than the pattern, no completion is done.
|
||||
*/_CTRL-L*
|
||||
When 'incsearch' is set, entering a search pattern for "/" or
|
||||
"?" and the current match is displayed then CTRL-L will add
|
||||
one character from the end of the current match. If
|
||||
'ignorecase' and 'smartcase' are set and the command line has
|
||||
no uppercase characters, the added character is converted to
|
||||
lowercase.
|
||||
*c_CTRL-G* */_CTRL-G*
|
||||
CTRL-G When 'incsearch' is set, entering a search pattern for "/" or
|
||||
"?" and the current match is displayed then CTRL-G will move
|
||||
to the next match (does not take |search-offset| into account)
|
||||
Use CTRL-T to move to the previous match. Hint: on a regular
|
||||
keyboard T is above G.
|
||||
*c_CTRL-T* */_CTRL-T*
|
||||
CTRL-T When 'incsearch' is set, entering a search pattern for "/" or
|
||||
"?" and the current match is displayed then CTRL-T will move
|
||||
to the previous match (does not take |search-offset| into
|
||||
account).
|
||||
Use CTRL-G to move to the next match. Hint: on a regular
|
||||
keyboard T is above G.
|
||||
|
||||
The 'wildchar' option defaults to <Tab> (CTRL-E when in Vi compatible mode; in
|
||||
a previous version <Esc> was used). In the pattern standard wildcards '*' and
|
||||
@@ -999,10 +1008,10 @@ There are several ways to leave the command-line window:
|
||||
Insert and in Normal mode.
|
||||
CTRL-C Continue in Command-line mode. The command-line under the
|
||||
cursor is used as the command-line. Works both in Insert and
|
||||
in Normal mode. ":close" also works. There is no redraw,
|
||||
thus the window will remain visible.
|
||||
in Normal mode. There is no redraw, thus the window will
|
||||
remain visible.
|
||||
:quit Discard the command line and go back to Normal mode.
|
||||
":exit", ":xit" and CTRL-\ CTRL-N also work.
|
||||
":close", ":exit", ":xit" and CTRL-\ CTRL-N also work.
|
||||
:qall Quit Vim, unless there are changes in some buffer.
|
||||
:qall! Quit Vim, discarding changes to any buffer.
|
||||
|
||||
|
||||
@@ -9,9 +9,7 @@ Debugging Vim *debug-vim*
|
||||
This is for debugging Vim itself, when it doesn't work properly.
|
||||
For debugging Vim scripts, functions, etc. see |debug-scripts|
|
||||
|
||||
1. Location of a crash, using gcc and gdb |debug-gcc|
|
||||
2. Locating memory leaks |debug-leaks|
|
||||
3. Windows Bug Reporting |debug-win32|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
|
||||
|
||||
@@ -26,9 +26,6 @@ Events ~
|
||||
*EncodingChanged* Never fired; 'encoding' is always "utf-8".
|
||||
*FileEncoding* Never fired; equivalent to |EncodingChanged|.
|
||||
|
||||
Highlight groups ~
|
||||
*hl-VisualNOS* Obsolete. |vim-differences| {Nvim}
|
||||
|
||||
Keycodes ~
|
||||
*<MouseDown>* Use <ScrollWheelUp> instead.
|
||||
*<MouseUp>* Use <ScrollWheelDown> instead.
|
||||
|
||||
@@ -6,14 +6,13 @@
|
||||
|
||||
Development of Nvim. *development*
|
||||
|
||||
1. Design goals |design-goals|
|
||||
2. Developer guidelines |dev-help|
|
||||
|
||||
Nvim is open source software. Everybody is encouraged to contribute.
|
||||
https://github.com/neovim/neovim/blob/master/CONTRIBUTING.md
|
||||
|
||||
See src/nvim/README.md for an overview of the source code.
|
||||
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
Design goals *design-goals*
|
||||
|
||||
|
||||
@@ -10,11 +10,7 @@ eight versions of the same file.
|
||||
|
||||
The basics are explained in section |08.7| of the user manual.
|
||||
|
||||
1. Starting diff mode |diff-mode|
|
||||
2. Viewing diffs |view-diffs|
|
||||
3. Jumping to diffs |jumpto-diffs|
|
||||
4. Copying diffs |copy-diffs|
|
||||
5. Diff options |diff-options|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Starting diff mode
|
||||
@@ -123,6 +119,8 @@ file for a moment and come back to the same file and be in diff mode again.
|
||||
related options only happens in a window that has 'diff' set,
|
||||
if the current window does not have 'diff' set then no options
|
||||
in it are changed.
|
||||
Hidden buffers are also removed from the list of diff'ed
|
||||
buffers.
|
||||
|
||||
The `:diffoff` command resets the relevant options to the values they had when
|
||||
using `:diffsplit`, `:diffpatch` , `:diffthis`. or starting Vim in diff mode.
|
||||
@@ -156,7 +154,8 @@ The alignment of text will go wrong when:
|
||||
|
||||
All the buffers edited in a window where the 'diff' option is set will join in
|
||||
the diff. This is also possible for hidden buffers. They must have been
|
||||
edited in a window first for this to be possible.
|
||||
edited in a window first for this to be possible. To get rid of the hidden
|
||||
buffers use `:diffoff!`.
|
||||
|
||||
*:DiffOrig* *diff-original-file*
|
||||
Since 'diff' is a window-local option, it's possible to view the same buffer
|
||||
|
||||
@@ -14,9 +14,7 @@ with CTRL-V (see |i_CTRL-V|).
|
||||
There is a brief introduction on digraphs in the user manual: |24.9|
|
||||
An alternative is using the 'keymap' option.
|
||||
|
||||
1. Defining digraphs |digraphs-define|
|
||||
2. Using digraphs |digraphs-use|
|
||||
3. Default digraphs |digraphs-default|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Defining digraphs *digraphs-define*
|
||||
|
||||
@@ -6,17 +6,7 @@
|
||||
|
||||
Editing files *edit-files*
|
||||
|
||||
1. Introduction |edit-intro|
|
||||
2. Editing a file |edit-a-file|
|
||||
3. The argument list |argument-list|
|
||||
4. Writing |writing|
|
||||
5. Writing and quitting |write-quit|
|
||||
6. Dialogs |edit-dialogs|
|
||||
7. The current directory |current-directory|
|
||||
8. Editing binary files |edit-binary|
|
||||
9. Encryption |encryption|
|
||||
10. Timestamps |timestamps|
|
||||
11. File Searching |file-searching|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Introduction *edit-intro*
|
||||
@@ -160,7 +150,8 @@ start editing another file, Vim will refuse this. In order to overrule this
|
||||
protection, add a '!' to the command. The changes will then be lost. For
|
||||
example: ":q" will not work if the buffer was changed, but ":q!" will. To see
|
||||
whether the buffer was changed use the "CTRL-G" command. The message includes
|
||||
the string "[Modified]" if the buffer has been changed.
|
||||
the string "[Modified]" if the buffer has been changed, or "+" if the 'm' flag
|
||||
is in 'shortmess'.
|
||||
|
||||
If you want to automatically save the changes without asking, switch on the
|
||||
'autowriteall' option. 'autowrite' is the associated Vi-compatible option
|
||||
|
||||
@@ -12,23 +12,7 @@ Note: Expression evaluation can be disabled at compile time. If this has been
|
||||
done, the features in this document are not available. See |+eval| and
|
||||
|no-eval-feature|.
|
||||
|
||||
1. Variables |variables|
|
||||
1.1 Variable types
|
||||
1.2 Function references |Funcref|
|
||||
1.3 Lists |Lists|
|
||||
1.4 Dictionaries |Dictionaries|
|
||||
1.5 More about variables |more-variables|
|
||||
2. Expression syntax |expression-syntax|
|
||||
3. Internal variable |internal-variables|
|
||||
4. Builtin Functions |functions|
|
||||
5. Defining functions |user-functions|
|
||||
6. Curly braces names |curly-braces-names|
|
||||
7. Commands |expression-commands|
|
||||
8. Exception handling |exception-handling|
|
||||
9. Examples |eval-examples|
|
||||
10. No +eval feature |no-eval-feature|
|
||||
11. The sandbox |eval-sandbox|
|
||||
12. Textlock |textlock|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Variables *variables*
|
||||
@@ -38,6 +22,8 @@ done, the features in this document are not available. See |+eval| and
|
||||
There are six types of variables:
|
||||
|
||||
Number A 32 or 64 bit signed number. |expr-number| *Number*
|
||||
64-bit Number is available only when compiled with the
|
||||
|+num64| feature.
|
||||
Examples: -123 0x10 0177 0b1011
|
||||
|
||||
Float A floating point number. |floating-point-format| *Float*
|
||||
@@ -107,7 +93,7 @@ To test for a non-empty string, use empty(): >
|
||||
*non-zero-arg*
|
||||
Function arguments often behave slightly different from |TRUE|: If the
|
||||
argument is present and it evaluates to a non-zero Number, |v:true| or a
|
||||
non-empty String, then the value is considere to be TRUE.
|
||||
non-empty String, then the value is considered to be TRUE.
|
||||
Note that " " and "0" are also non-empty strings, thus cause the mode to be
|
||||
cleared. A List, Dictionary or Float is not a Number or String, thus
|
||||
evaluates to FALSE.
|
||||
@@ -394,10 +380,6 @@ This works like: >
|
||||
: let index = index + 1
|
||||
:endwhile
|
||||
|
||||
Note that all items in the list should be of the same type, otherwise this
|
||||
results in error |E706|. To avoid this |:unlet| the variable at the end of
|
||||
the loop.
|
||||
|
||||
If all you want to do is modify each item in the list then the |map()|
|
||||
function will be a simpler method than a for loop.
|
||||
|
||||
@@ -631,13 +613,17 @@ It's possible to form a variable name with curly braces, see
|
||||
|
||||
Expression syntax summary, from least to most significant:
|
||||
|
||||
|expr1| expr2 ? expr1 : expr1 if-then-else
|
||||
|expr1| expr2
|
||||
expr2 ? expr1 : expr1 if-then-else
|
||||
|
||||
|expr2| expr3 || expr3 .. logical OR
|
||||
|expr2| expr3
|
||||
expr3 || expr3 .. logical OR
|
||||
|
||||
|expr3| expr4 && expr4 .. logical AND
|
||||
|expr3| expr4
|
||||
expr4 && expr4 .. logical AND
|
||||
|
||||
|expr4| expr5 == expr5 equal
|
||||
|expr4| expr5
|
||||
expr5 == expr5 equal
|
||||
expr5 != expr5 not equal
|
||||
expr5 > expr5 greater than
|
||||
expr5 >= expr5 greater than or equal
|
||||
@@ -654,24 +640,28 @@ Expression syntax summary, from least to most significant:
|
||||
expr5 is expr5 same |List| instance
|
||||
expr5 isnot expr5 different |List| instance
|
||||
|
||||
|expr5| expr6 + expr6 .. number addition or list concatenation
|
||||
|expr5| expr6
|
||||
expr6 + expr6 .. number addition or list concatenation
|
||||
expr6 - expr6 .. number subtraction
|
||||
expr6 . expr6 .. string concatenation
|
||||
|
||||
|expr6| expr7 * expr7 .. number multiplication
|
||||
|expr6| expr7
|
||||
expr7 * expr7 .. number multiplication
|
||||
expr7 / expr7 .. number division
|
||||
expr7 % expr7 .. number modulo
|
||||
|
||||
|expr7| ! expr7 logical NOT
|
||||
|expr7| expr8
|
||||
! expr7 logical NOT
|
||||
- expr7 unary minus
|
||||
+ expr7 unary plus
|
||||
|
||||
|expr8| expr8[expr1] byte of a String or item of a |List|
|
||||
|expr8| expr9
|
||||
expr8[expr1] byte of a String or item of a |List|
|
||||
expr8[expr1 : expr1] substring of a String or sublist of a |List|
|
||||
expr8.name entry in a |Dictionary|
|
||||
expr8(expr1, ...) function call with |Funcref| variable
|
||||
|
||||
|expr9| number number constant
|
||||
|expr9| number number constant
|
||||
"string" string constant, backslash is special
|
||||
'string' string constant, ' is doubled
|
||||
[expr1, ...] |List|
|
||||
@@ -899,6 +889,11 @@ When dividing a Number by zero the result depends on the value:
|
||||
<0 / 0 = -0x7fffffff (like negative infinity)
|
||||
(before Vim 7.2 it was always 0x7fffffff)
|
||||
|
||||
When 64-bit Number support is enabled:
|
||||
0 / 0 = -0x8000000000000000 (like NaN for Float)
|
||||
>0 / 0 = 0x7fffffffffffffff (like positive infinity)
|
||||
<0 / 0 = -0x7fffffffffffffff (like negative infinity)
|
||||
|
||||
When the righthand side of '%' is zero, the result is 0.
|
||||
|
||||
None of these work for |Funcref|s.
|
||||
@@ -931,7 +926,7 @@ expr8[expr1] item of String or |List| *expr-[]* *E111*
|
||||
|
||||
If expr8 is a Number or String this results in a String that contains the
|
||||
expr1'th single byte from expr8. expr8 is used as a String, expr1 as a
|
||||
Number. This doesn't recognize multi-byte encodings, see |byteidx()| for
|
||||
Number. This doesn't recognize multi-byte encodings, see `byteidx()` for
|
||||
an alternative, or use `split()` to turn the string into a list of characters.
|
||||
|
||||
Index zero gives the first byte. This is like it works in C. Careful:
|
||||
@@ -1214,7 +1209,7 @@ The arguments are optional. Example: >
|
||||
< error function
|
||||
*closure*
|
||||
Lambda expressions can access outer scope variables and arguments. This is
|
||||
often called a closure. Example where "i" a and "a:arg" are used in a lambda
|
||||
often called a closure. Example where "i" and "a:arg" are used in a lambda
|
||||
while they exist in the function scope. They remain valid even after the
|
||||
function returns: >
|
||||
:function Foo(arg)
|
||||
@@ -1233,7 +1228,7 @@ Examples for using a lambda expression with |sort()|, |map()| and |filter()|: >
|
||||
:echo sort([3,7,2,1,4], {a, b -> a - b})
|
||||
< [1, 2, 3, 4, 7]
|
||||
|
||||
The lambda expression is also useful for Channel, Job and timer: >
|
||||
The lambda expression is also useful for jobs and timers: >
|
||||
:let timer = timer_start(500,
|
||||
\ {-> execute("echo 'Handler called'", "")},
|
||||
\ {'repeat': 3})
|
||||
@@ -1297,7 +1292,8 @@ b:changedtick The total number of changes to the current buffer. It is
|
||||
: let my_changedtick = b:changedtick
|
||||
: call My_Update()
|
||||
:endif
|
||||
<
|
||||
< You cannot change or delete the b:changedtick variable.
|
||||
|
||||
*window-variable* *w:var* *w:*
|
||||
A variable name that is preceded with "w:" is local to the current window. It
|
||||
is deleted when the window is closed.
|
||||
@@ -1760,9 +1756,7 @@ v:profiling Normally zero. Set to one after using ":profile start".
|
||||
See |profiling|.
|
||||
|
||||
*v:progname* *progname-variable*
|
||||
v:progname Contains the name (with path removed) with which Nvim was
|
||||
invoked. Allows you to do special initialisations for any
|
||||
name you might symlink to Nvim.
|
||||
v:progname The name by which Nvim was invoked (with path removed).
|
||||
Read-only.
|
||||
|
||||
*v:progpath* *progpath-variable*
|
||||
@@ -1949,16 +1943,23 @@ argidx() Number current index in the argument list
|
||||
arglistid([{winnr} [, {tabnr}]]) Number argument list id
|
||||
argv({nr}) String {nr} entry of the argument list
|
||||
argv() List the argument list
|
||||
assert_equal({exp}, {act} [, {msg}]) none assert {exp} is equal to {act}
|
||||
assert_exception( {error} [, {msg}]) none assert {error} is in v:exception
|
||||
assert_fails( {cmd} [, {error}]) none assert {cmd} fails
|
||||
assert_false({actual} [, {msg}]) none assert {actual} is false
|
||||
assert_equal({exp}, {act} [, {msg}])
|
||||
none assert {exp} is equal to {act}
|
||||
assert_exception({error} [, {msg}])
|
||||
none assert {error} is in v:exception
|
||||
assert_fails({cmd} [, {error}]) none assert {cmd} fails
|
||||
assert_false({actual} [, {msg}])
|
||||
none assert {actual} is false
|
||||
assert_inrange({lower}, {upper}, {actual} [, {msg}])
|
||||
none assert {actual} is inside the range
|
||||
assert_match( {pat}, {text} [, {msg}]) none assert {pat} matches {text}
|
||||
assert_notequal( {exp}, {act} [, {msg}]) none assert {exp} is not equal {act}
|
||||
assert_notmatch( {pat}, {text} [, {msg}]) none assert {pat} not matches {text}
|
||||
assert_true({actual} [, {msg}]) none assert {actual} is true
|
||||
assert_match({pat}, {text} [, {msg}])
|
||||
none assert {pat} matches {text}
|
||||
assert_notequal({exp}, {act} [, {msg}])
|
||||
none assert {exp} is not equal {act}
|
||||
assert_notmatch({pat}, {text} [, {msg}])
|
||||
none assert {pat} not matches {text}
|
||||
assert_report({msg}) none report a test failure
|
||||
assert_true({actual} [, {msg}]) none assert {actual} is true
|
||||
asin({expr}) Float arc sine of {expr}
|
||||
atan({expr}) Float arc tangent of {expr}
|
||||
atan2({expr}, {expr}) Float arc tangent of {expr1} / {expr2}
|
||||
@@ -2023,8 +2024,8 @@ expand({expr} [, {nosuf} [, {list}]])
|
||||
feedkeys({string} [, {mode}]) Number add key sequence to typeahead buffer
|
||||
filereadable({file}) Number |TRUE| if {file} is a readable file
|
||||
filewritable({file}) Number |TRUE| if {file} is a writable file
|
||||
filter({expr}, {string}) List/Dict remove items from {expr} where
|
||||
{string} is 0
|
||||
filter({expr1}, {expr2}) List/Dict remove items from {expr1} where
|
||||
{expr2} is 0
|
||||
finddir({name}[, {path}[, {count}]])
|
||||
String find directory {name} in {path}
|
||||
findfile({name}[, {path}[, {count}]])
|
||||
@@ -2048,7 +2049,7 @@ garbagecollect([{atexit}]) none free memory, breaking cyclic references
|
||||
get({list}, {idx} [, {def}]) any get item {idx} from {list} or {def}
|
||||
get({dict}, {key} [, {def}]) any get item {key} from {dict} or {def}
|
||||
get({func}, {what}) any get property of funcref/partial {func}
|
||||
getbufinfo( [{expr}]) List information about buffers
|
||||
getbufinfo([{expr}]) List information about buffers
|
||||
getbufline({expr}, {lnum} [, {end}])
|
||||
List lines {lnum} to {end} of buffer {expr}
|
||||
getbufvar({expr}, {varname} [, {def}])
|
||||
@@ -2147,7 +2148,8 @@ lispindent({lnum}) Number Lisp indent for line {lnum}
|
||||
localtime() Number current time
|
||||
log({expr}) Float natural logarithm (base e) of {expr}
|
||||
log10({expr}) Float logarithm of Float {expr} to base 10
|
||||
map({expr}, {string}) List/Dict change each item in {expr} to {expr}
|
||||
luaeval({expr}[, {expr}]) any evaluate Lua expression
|
||||
map({expr1}, {expr2}) List/Dict change each item in {expr1} to {expr}
|
||||
maparg({name}[, {mode} [, {abbr} [, {dict}]]])
|
||||
String or Dict
|
||||
rhs of mapping {name} in mode {mode}
|
||||
@@ -2169,8 +2171,8 @@ matchstr({expr}, {pat}[, {start}[, {count}]])
|
||||
String {count}'th match of {pat} in {expr}
|
||||
matchstrpos({expr}, {pat}[, {start}[, {count}]])
|
||||
List {count}'th match of {pat} in {expr}
|
||||
max({list}) Number maximum value of items in {list}
|
||||
min({list}) Number minimum value of items in {list}
|
||||
max({expr}) Number maximum value of items in {expr}
|
||||
min({expr}) Number minimum value of items in {expr}
|
||||
mkdir({name} [, {path} [, {prot}]])
|
||||
Number create directory {name}
|
||||
mode([expr]) String current editing mode
|
||||
@@ -2465,7 +2467,7 @@ assert_exception({error} [, {msg}]) *assert_exception()*
|
||||
assert_fails({cmd} [, {error}]) *assert_fails()*
|
||||
Run {cmd} and add an error message to |v:errors| if it does
|
||||
NOT produce an error.
|
||||
When {error} is given it must match |v:errmsg|.
|
||||
When {error} is given it must match in |v:errmsg|.
|
||||
|
||||
assert_false({actual} [, {msg}]) *assert_false()*
|
||||
When {actual} is not false an error message is added to
|
||||
@@ -2513,6 +2515,9 @@ assert_notmatch({pattern}, {actual} [, {msg}])
|
||||
The opposite of `assert_match()`: add an error message to
|
||||
|v:errors| when {pattern} matches {actual}.
|
||||
|
||||
assert_report({msg}) *assert_report()*
|
||||
Report a test failure directly, using {msg}.
|
||||
|
||||
assert_true({actual} [, {msg}]) *assert_true()*
|
||||
When {actual} is not true an error message is added to
|
||||
|v:errors|, like with |assert_equal()|.
|
||||
@@ -2857,8 +2862,6 @@ confirm({msg} [, {choices} [, {default} [, {type}]]])
|
||||
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.
|
||||
Note: confirm() is only supported when compiled with dialog
|
||||
support, see |+dialog_con| and |+dialog_gui|.
|
||||
|
||||
{msg} is displayed in a |dialog| with {choices} as the
|
||||
alternatives. When {choices} is missing or empty, "&OK" is
|
||||
@@ -3044,6 +3047,8 @@ delete({fname} [, {flags}]) *delete()*
|
||||
|
||||
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 if the delete operation was
|
||||
successful and -1 when the deletion failed or partly failed.
|
||||
@@ -3478,9 +3483,10 @@ filter({expr1}, {expr2}) *filter()*
|
||||
is zero remove the item from the |List| or |Dictionary|.
|
||||
{expr2} must be a |string| or |Funcref|.
|
||||
|
||||
if {expr2} is a |string|, inside {expr2} |v:val| has the value
|
||||
If {expr2} is a |string|, inside {expr2} |v:val| has the value
|
||||
of the current item. For a |Dictionary| |v:key| has the key
|
||||
of the current item.
|
||||
of the current item and for a |List| |v:key| has the index of
|
||||
the current item.
|
||||
For a |Dictionary| |v:key| has the key of the current item.
|
||||
Examples: >
|
||||
call filter(mylist, 'v:val !~ "OLD"')
|
||||
@@ -3503,6 +3509,10 @@ filter({expr1}, {expr2}) *filter()*
|
||||
return a:idx % 2 == 1
|
||||
endfunc
|
||||
call filter(mylist, function('Odd'))
|
||||
< It is shorter when using a |lambda|: >
|
||||
call filter(myList, {idx, val -> idx * val <= 42})
|
||||
< If you do not use "val" you can leave it out: >
|
||||
call filter(myList, {idx -> idx % 2 == 1})
|
||||
<
|
||||
The operation is done in-place. If you want a |List| or
|
||||
|Dictionary| to remain unmodified make a copy first: >
|
||||
@@ -3543,17 +3553,19 @@ float2nr({expr}) *float2nr()*
|
||||
decimal point.
|
||||
{expr} must evaluate to a |Float| or a Number.
|
||||
When the value of {expr} is out of range for a |Number| the
|
||||
result is truncated to 0x7fffffff or -0x7fffffff. NaN results
|
||||
in -0x80000000.
|
||||
result is truncated to 0x7fffffff or -0x7fffffff (or when
|
||||
64-bit Number support is enabled, 0x7fffffffffffffff or
|
||||
-0x7fffffffffffffff. NaN results in -0x80000000 (or when
|
||||
64-bit Number support is enabled, -0x8000000000000000).
|
||||
Examples: >
|
||||
echo float2nr(3.95)
|
||||
< 3 >
|
||||
echo float2nr(-23.45)
|
||||
< -23 >
|
||||
echo float2nr(1.0e100)
|
||||
< 2147483647 >
|
||||
< 2147483647 (or 9223372036854775807) >
|
||||
echo float2nr(-1.0e150)
|
||||
< -2147483647 >
|
||||
< -2147483647 (or -9223372036854775807) >
|
||||
echo float2nr(1.0e-100)
|
||||
< 0
|
||||
|
||||
@@ -3639,11 +3651,14 @@ foldtext() Returns a String, to be displayed for a closed fold. This is
|
||||
|v:foldstart|, |v:foldend| and |v:folddashes| variables.
|
||||
The returned string looks like this: >
|
||||
+-- 45 lines: abcdef
|
||||
< The number of dashes depends on the foldlevel. The "45" is
|
||||
the number of lines in the fold. "abcdef" is the text in the
|
||||
first non-blank line of the fold. Leading white space, "//"
|
||||
or "/*" and the text from the 'foldmarker' and 'commentstring'
|
||||
options is removed.
|
||||
< The number of leading dashes depends on the foldlevel. The
|
||||
"45" is the number of lines in the fold. "abcdef" is the text
|
||||
in the first non-blank line of the fold. Leading white space,
|
||||
"//" or "/*" and the text from the 'foldmarker' and
|
||||
'commentstring' options is removed.
|
||||
When used to draw the actual foldtext, the rest of the line
|
||||
will be filled with the fold char from the 'fillchars'
|
||||
setting.
|
||||
{not available when compiled without the |+folding| feature}
|
||||
|
||||
foldtextresult({lnum}) *foldtextresult()*
|
||||
@@ -4538,6 +4553,7 @@ histadd({history}, {item}) *histadd()*
|
||||
"expr" or "=" typed expression history
|
||||
"input" or "@" input line history
|
||||
"debug" or ">" debug command history
|
||||
empty the current or last used history
|
||||
The {history} string does not need to be the whole name, one
|
||||
character is sufficient.
|
||||
If {item} does already exist in the history, it will be
|
||||
@@ -4667,10 +4683,23 @@ index({list}, {expr} [, {start} [, {ic}]]) *index()*
|
||||
|
||||
|
||||
input({prompt} [, {text} [, {completion}]]) *input()*
|
||||
input({opts})
|
||||
The result is a String, which is whatever the user typed on
|
||||
the command-line. The {prompt} argument is either a prompt
|
||||
string, or a blank string (for no prompt). A '\n' can be used
|
||||
in the prompt to start a new line.
|
||||
|
||||
In the second form it accepts a single dictionary with the
|
||||
following keys, any of which may be omitted:
|
||||
|
||||
Key Default Description ~
|
||||
prompt "" Same as {prompt} in the first form.
|
||||
default "" Same as {text} in the first form.
|
||||
completion nothing Same as {completion} in the first form.
|
||||
cancelreturn "" Same as {cancelreturn} from
|
||||
|inputdialog()|. Also works with
|
||||
input().
|
||||
|
||||
The highlighting set with |:echohl| is used for the prompt.
|
||||
The input is entered just like a command-line, with the same
|
||||
editing commands and mappings. There is a separate history
|
||||
@@ -4712,6 +4741,7 @@ input({prompt} [, {text} [, {completion}]]) *input()*
|
||||
:endfunction
|
||||
|
||||
inputdialog({prompt} [, {text} [, {cancelreturn}]]) *inputdialog()*
|
||||
inputdialog({opts})
|
||||
Like |input()|, but when the GUI is running and text dialogs
|
||||
are supported, a dialog window pops up to input the text.
|
||||
Example: >
|
||||
@@ -4723,7 +4753,6 @@ inputdialog({prompt} [, {text} [, {cancelreturn}]]) *inputdialog()*
|
||||
omitted an empty string is returned.
|
||||
Hitting <Enter> works like pressing the OK button. Hitting
|
||||
<Esc> works like pressing the Cancel button.
|
||||
NOTE: Command-line completion is not supported.
|
||||
|
||||
inputlist({textlist}) *inputlist()*
|
||||
{textlist} must be a |List| of strings. This |List| is
|
||||
@@ -4874,9 +4903,9 @@ jobstart({cmd}[, {opts}]) {Nvim} *jobstart()*
|
||||
unless cmd[0] is some form of "cmd.exe".
|
||||
|
||||
{opts} is a dictionary with these keys:
|
||||
on_stdout: stdout event handler (function name or |Funcref|)
|
||||
on_stderr: stderr event handler (function name or |Funcref|)
|
||||
on_exit : exit event handler (function name or |Funcref|)
|
||||
|on_stdout|: stdout event handler (function name or |Funcref|)
|
||||
|on_stderr|: stderr event handler (function name or |Funcref|)
|
||||
|on_exit| : exit event handler (function name or |Funcref|)
|
||||
cwd : Working directory of the job; defaults to
|
||||
|current-directory|.
|
||||
rpc : If set, |msgpack-rpc| will be used to communicate
|
||||
@@ -5112,6 +5141,9 @@ log10({expr}) *log10()*
|
||||
:echo log10(0.01)
|
||||
< -2.0
|
||||
|
||||
luaeval({expr}[, {expr}])
|
||||
Evaluate Lua expression {expr} and return its result converted
|
||||
to Vim data structures. See |lua-luaeval| for more details.
|
||||
|
||||
map({expr1}, {expr2}) *map()*
|
||||
{expr1} must be a |List| or a |Dictionary|.
|
||||
@@ -5140,6 +5172,10 @@ map({expr1}, {expr2}) *map()*
|
||||
return a:key . '-' . a:val
|
||||
endfunc
|
||||
call map(myDict, function('KeyValue'))
|
||||
< It is shorter when using a |lambda|: >
|
||||
call map(myDict, {key, val -> key . '-' . val})
|
||||
< If you do not use "val" you can leave it out: >
|
||||
call map(myDict, {key -> 'item: ' . key})
|
||||
<
|
||||
The operation is done in-place. If you want a |List| or
|
||||
|Dictionary| to remain unmodified make a copy first: >
|
||||
@@ -5461,16 +5497,20 @@ matchstrpos({expr}, {pat}[, {start}[, {count}]]) *matchstrpos()*
|
||||
The type isn't changed, it's not necessarily a String.
|
||||
|
||||
*max()*
|
||||
max({list}) Return the maximum value of all items in {list}.
|
||||
If {list} is not a list or one of the items in {list} cannot
|
||||
be used as a Number this results in an error.
|
||||
An empty |List| results in zero.
|
||||
max({expr}) Return the maximum value of all items in {expr}.
|
||||
{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.
|
||||
|
||||
*min()*
|
||||
min({list}) Return the minimum value of all items in {list}.
|
||||
If {list} is not a list or one of the items in {list} cannot
|
||||
be used as a Number this results in an error.
|
||||
An empty |List| results in zero.
|
||||
min({expr}) Return the minimum value of all items in {expr}.
|
||||
{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.
|
||||
|
||||
*mkdir()* *E739*
|
||||
mkdir({name} [, {path} [, {prot}]])
|
||||
@@ -5706,7 +5746,7 @@ printf({fmt}, {expr1} ...) *printf()*
|
||||
%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
|
||||
%G floating point number, as %F or %E depending on value
|
||||
%% the % character itself
|
||||
%p representation of the pointer to the container
|
||||
|
||||
@@ -6167,7 +6207,7 @@ rpcstop({channel}) {Nvim} *rpcstop()*
|
||||
connecting to |v:servername|.
|
||||
|
||||
screenattr(row, col) *screenattr()*
|
||||
Like screenchar(), but return the attribute. This is a rather
|
||||
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.
|
||||
|
||||
@@ -6442,11 +6482,20 @@ serverlist() *serverlist()*
|
||||
nvim --cmd "echo serverlist()" --cmd "q"
|
||||
<
|
||||
serverstart([{address}]) *serverstart()*
|
||||
Opens a named pipe or TCP socket at {address} for clients to
|
||||
connect to and returns {address}. If no address is given, it
|
||||
is equivalent to: >
|
||||
Opens a TCP socket (IPv4/IPv6), Unix domain socket (Unix),
|
||||
or named pipe (Windows) at {address} for clients to connect
|
||||
to and returns {address}.
|
||||
|
||||
If {address} contains `:`, a TCP socket is used. Everything in
|
||||
front of the last occurrence of `:` is the IP or hostname,
|
||||
everything after it the port. If the port is empty or `0`,
|
||||
a random port will be assigned.
|
||||
|
||||
If no address is given, it is equivalent to: >
|
||||
:call serverstart(tempname())
|
||||
|
||||
< |$NVIM_LISTEN_ADDRESS| is set to {address} if not already set.
|
||||
|
||||
*--servername*
|
||||
The Vim command-line option `--servername` can be imitated: >
|
||||
nvim --cmd "let g:server_addr = serverstart('foo')"
|
||||
@@ -6692,6 +6741,8 @@ setreg({regname}, {value} [, {options}])
|
||||
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 <Tab> 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 <NL> for
|
||||
@@ -6836,6 +6887,21 @@ sinh({expr}) *sinh()*
|
||||
:echo sinh(-0.9)
|
||||
< -1.026517
|
||||
|
||||
sockconnect({mode}, {address}, {opts}) *sockconnect()*
|
||||
Connect a socket to an address. If {mode} is "pipe" then
|
||||
{address} should be the path of a named pipe. 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. Currently only rpc sockets are supported, so
|
||||
{opts} must be passed with "rpc" set to |TRUE|.
|
||||
|
||||
{opts} is a dictionary with these keys:
|
||||
rpc : If set, |msgpack-rpc| will be used to communicate
|
||||
over the socket.
|
||||
Returns:
|
||||
- The channel ID on success, which is used by
|
||||
|rpcnotify()| and |rpcrequest()| and |rpcstop()|.
|
||||
- 0 on invalid arguments or connection failure.
|
||||
|
||||
sort({list} [, {func} [, {dict}]]) *sort()* *E702*
|
||||
Sort the items in {list} in-place. Returns {list}.
|
||||
@@ -7041,7 +7107,7 @@ strcharpart({src}, {start}[, {len}]) *strcharpart()*
|
||||
Like |strpart()| but using character index and length instead
|
||||
of byte index and length.
|
||||
When a character index is used where a character does not
|
||||
exist it is assumed to be one byte. For example: >
|
||||
exist it is assumed to be one character. For example: >
|
||||
strcharpart('abc', -1, 2)
|
||||
< results in 'a'.
|
||||
|
||||
@@ -7401,10 +7467,10 @@ systemlist({cmd} [, {input} [, {keepempty}]]) *systemlist()*
|
||||
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 present and it's non-zero.
|
||||
unless {keepempty} is non-zero.
|
||||
Note that on MS-Windows you may get trailing CR characters.
|
||||
|
||||
Returns an empty string on error, so be careful not to run
|
||||
into |E706|.
|
||||
Returns an empty string on error.
|
||||
|
||||
|
||||
tabpagebuflist([{arg}]) *tabpagebuflist()*
|
||||
@@ -7579,13 +7645,14 @@ timer_start({time}, {callback} [, {options}])
|
||||
busy or Vim is not waiting for input the time will be longer.
|
||||
|
||||
{callback} is the function to call. It can be the name of a
|
||||
function or a Funcref. It is called with one argument, which
|
||||
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 calling the
|
||||
callback. -1 means forever.
|
||||
callback. -1 means forever. When not present
|
||||
the callback will be called once.
|
||||
|
||||
Example: >
|
||||
func MyHandler(timer)
|
||||
@@ -7875,7 +7942,7 @@ winnr([{arg}]) The result is a Number, which is the number of the current
|
||||
is returned.
|
||||
The number can be used with |CTRL-W_w| and ":wincmd w"
|
||||
|:wincmd|.
|
||||
Also see |tabpagewinnr()|.
|
||||
Also see |tabpagewinnr()| and |win_getid()|.
|
||||
|
||||
*winrestcmd()*
|
||||
winrestcmd() Returns a sequence of |:resize| commands that should restore
|
||||
@@ -7938,7 +8005,10 @@ winwidth({nr}) *winwidth()*
|
||||
:if winwidth(0) <= 50
|
||||
: exe "normal 50\<C-W>|"
|
||||
:endif
|
||||
<
|
||||
< For getting the terminal or screen size, see the 'columns'
|
||||
option.
|
||||
|
||||
|
||||
wordcount() *wordcount()*
|
||||
The result is a dictionary of byte/chars/word statistics for
|
||||
the current buffer. This is the same info as provided by
|
||||
@@ -8009,7 +8079,7 @@ There are four types of features:
|
||||
:if has("cindent")
|
||||
2. Features that are only supported when certain conditions have been met.
|
||||
Example: >
|
||||
:if has("gui_running")
|
||||
:if has("win32")
|
||||
< *has-patch*
|
||||
3. {Nvim} version. The "nvim-1.2.3" feature means that the Nvim version is
|
||||
1.2.3 or later. Example: >
|
||||
@@ -8044,17 +8114,14 @@ browse Compiled with |:browse| support, and browse() will
|
||||
browsefilter Compiled with support for |browsefilter|.
|
||||
byte_offset Compiled with support for 'o' in 'statusline'
|
||||
cindent Compiled with 'cindent' support.
|
||||
clientserver Compiled with remote invocation support |clientserver|.
|
||||
clipboard Compiled with 'clipboard' support.
|
||||
cmdline_compl Compiled with |cmdline-completion| support.
|
||||
cmdline_hist Compiled with |cmdline-history| support.
|
||||
cmdline_info Compiled with 'showcmd' and 'ruler' support.
|
||||
comments Compiled with |'comments'| support.
|
||||
compatible Compiled to be very Vi compatible.
|
||||
cscope Compiled with |cscope| support.
|
||||
debug Compiled with "DEBUG" defined.
|
||||
dialog_con Compiled with console dialog support.
|
||||
dialog_gui Compiled with GUI dialog support.
|
||||
digraphs Compiled with support for digraphs.
|
||||
eval Compiled with expression evaluation support. Always
|
||||
true, of course!
|
||||
@@ -8072,9 +8139,6 @@ fname_case Case in file names matters (for Windows this is not
|
||||
present).
|
||||
folding Compiled with |folding| support.
|
||||
gettext Compiled with message translation |multi-lang|
|
||||
gui Compiled with GUI enabled.
|
||||
gui_running Vim is running in the GUI, or it will start soon.
|
||||
gui_win32 Compiled with MS Windows Win32 GUI.
|
||||
iconv Can use iconv() for conversion.
|
||||
insert_expand Compiled with support for CTRL-X expansion commands in
|
||||
Insert mode.
|
||||
@@ -8089,8 +8153,7 @@ lispindent Compiled with support for lisp indenting.
|
||||
listcmds Compiled with commands for the buffer list |:files|
|
||||
and the argument list |arglist|.
|
||||
localmap Compiled with local mappings and abbr. |:map-local|
|
||||
mac Macintosh version of Vim.
|
||||
macunix Macintosh version of Vim, using Unix files (OS-X).
|
||||
mac macOS version of Vim.
|
||||
menu Compiled with support for |:menu|.
|
||||
mksession Compiled with support for |:mksession|.
|
||||
modify_fname Compiled with file name modifiers. |filename-modifiers|
|
||||
@@ -8098,17 +8161,16 @@ mouse Compiled with support mouse.
|
||||
mouseshape Compiled with support for 'mouseshape'.
|
||||
multi_byte Compiled with support for 'encoding'
|
||||
multi_byte_encoding 'encoding' is set to a multi-byte encoding.
|
||||
multi_byte_ime Compiled with support for IME input method.
|
||||
multi_lang Compiled with support for multiple languages.
|
||||
num64 Compiled with 64-bit |Number| support.
|
||||
nvim This is Nvim. |has-patch|
|
||||
ole Compiled with OLE automation support for Win32.
|
||||
path_extra Compiled with up/downwards search in 'path' and 'tags'
|
||||
persistent_undo Compiled with support for persistent undo history.
|
||||
postscript Compiled with PostScript file printing.
|
||||
printer Compiled with |:hardcopy| support.
|
||||
profile Compiled with |:profile| support.
|
||||
python Compiled with Python 2.x interface. |has-python|
|
||||
python3 Compiled with Python 3.x interface. |has-python|
|
||||
python Legacy Vim Python 2.x API is available. |has-python|
|
||||
python3 Legacy Vim Python 3.x API is available. |has-python|
|
||||
quickfix Compiled with |quickfix| support.
|
||||
reltime Compiled with |reltime()| support.
|
||||
rightleft Compiled with 'rightleft' support.
|
||||
@@ -8131,15 +8193,12 @@ tag_old_static Compiled with support for old static tags
|
||||
|tag-old-static|.
|
||||
tag_any_white Compiled with support for any white characters in tags
|
||||
files |tag-any-white|.
|
||||
terminfo Compiled with terminfo instead of termcap.
|
||||
termresponse Compiled with support for |t_RV| and |v:termresponse|.
|
||||
textobjects Compiled with support for |text-objects|.
|
||||
tgetent Compiled with tgetent support, able to use a termcap
|
||||
or terminfo file.
|
||||
timers Compiled with |timer_start()| support.
|
||||
title Compiled with window title support |'title'|.
|
||||
toolbar Compiled with support for |gui-toolbar|.
|
||||
unix Unix version of Vim.
|
||||
unnamedplus Compiled with support for "unnamedplus" in 'clipboard'
|
||||
user_commands User-defined commands.
|
||||
vertsplit Compiled with vertically split windows |:vsplit|.
|
||||
vim_starting True while initial source'ing takes place. |startup|
|
||||
@@ -8152,17 +8211,9 @@ vreplace Compiled with |gR| and |gr| commands.
|
||||
wildignore Compiled with 'wildignore' option.
|
||||
wildmenu Compiled with 'wildmenu' option.
|
||||
win32 Windows version of Vim (32 or 64 bit).
|
||||
win32unix Windows version of Vim, using Unix files (Cygwin).
|
||||
win64 Windows version of Vim (64 bit).
|
||||
winaltkeys Compiled with 'winaltkeys' option.
|
||||
windows Compiled with support for more than one window.
|
||||
writebackup Compiled with 'writebackup' default on.
|
||||
xfontset Compiled with X fontset support |xfontset|.
|
||||
xim Compiled with X input method support |xim|.
|
||||
xpm Compiled with pixmap support.
|
||||
xpm_w32 Compiled with pixmap support for Win32. (Only for
|
||||
backward compatibility. Use "xpm" instead.)
|
||||
x11 Compiled with X11 support.
|
||||
|
||||
*string-match*
|
||||
Matching a pattern in a String
|
||||
@@ -8634,6 +8685,11 @@ This does NOT work: >
|
||||
value and the global value are changed.
|
||||
Example: >
|
||||
:let &path = &path . ',/usr/local/include'
|
||||
< This also works for terminal codes in the form t_xx.
|
||||
But only for alphanumerical names. Example: >
|
||||
:let &t_k1 = "\<Esc>[234;"
|
||||
< When the code does not exist yet it will be created as
|
||||
a terminal key code, there is no error.
|
||||
|
||||
:let &{option-name} .= {expr1}
|
||||
For a string option: Append {expr1} to the value.
|
||||
|
||||
@@ -6,12 +6,10 @@
|
||||
|
||||
Filetypes *filetype* *file-type*
|
||||
|
||||
1. Filetypes |filetypes|
|
||||
2. Filetype plugin |filetype-plugins|
|
||||
3. Docs for the default filetype plugins. |ftplugin-docs|
|
||||
|
||||
Also see |autocmd.txt|.
|
||||
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Filetypes *filetypes* *file-types*
|
||||
|
||||
@@ -542,6 +540,7 @@ K or CTRL-] Jump to the manpage for the <cWORD> under the
|
||||
cursor. Takes a count for the section.
|
||||
CTRL-T Jump back to the location that the manpage was
|
||||
opened from.
|
||||
META-] Show the manpage outline in the |location-list|.
|
||||
q :quit if invoked as $MANPAGER, otherwise :close.
|
||||
|
||||
Variables:
|
||||
@@ -565,6 +564,17 @@ These maps can be disabled with >
|
||||
:let g:no_pdf_maps = 1
|
||||
<
|
||||
|
||||
PYTHON *ft-python-plugin* *PEP8*
|
||||
|
||||
By default the following options are set, in accordance with PEP8: >
|
||||
|
||||
setlocal expandtab shiftwidth=4 softtabstop=4 tabstop=8
|
||||
|
||||
To disable this behaviour, set the following variable in your vimrc: >
|
||||
|
||||
let g:python_recommended_style = 0
|
||||
|
||||
|
||||
RPM SPEC *ft-spec-plugin*
|
||||
|
||||
Since the text for this plugin is rather long it has been put in a separate
|
||||
|
||||
@@ -9,10 +9,7 @@ Folding *Folding* *folding* *folds*
|
||||
You can find an introduction on folding in chapter 28 of the user manual.
|
||||
|usr_28.txt|
|
||||
|
||||
1. Fold methods |fold-methods|
|
||||
2. Fold commands |fold-commands|
|
||||
3. Fold options |fold-options|
|
||||
4. Behavior of folds |fold-behavior|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Fold methods *fold-methods*
|
||||
|
||||
@@ -6,34 +6,17 @@
|
||||
|
||||
Vim's Graphical User Interface *gui* *GUI*
|
||||
|
||||
1. Starting the GUI |gui-start|
|
||||
2. Scrollbars |gui-scrollbars|
|
||||
3. Mouse Control |gui-mouse|
|
||||
4. Making GUI Selections |gui-selections|
|
||||
5. Menus |menus|
|
||||
6. Extras |gui-extras|
|
||||
|
||||
Other GUI documentation:
|
||||
|gui_w32.txt| For specific items of the Win32 GUI.
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Starting the GUI *gui-start* *E229* *E233*
|
||||
|
||||
First you must make sure you actually have a version of Vim with the GUI code
|
||||
included.
|
||||
|
||||
How to start the GUI depends on the system used. Mostly you can run the
|
||||
GUI version of Vim with:
|
||||
gvim [options] [files...]
|
||||
|
||||
*ginit.vim* *gui-init* *gvimrc* *$MYGVIMRC*
|
||||
The gvimrc file is where GUI-specific startup commands should be placed. It
|
||||
is always sourced after the |init.vim| file. If you have one then the
|
||||
$MYGVIMRC environment variable has its name.
|
||||
|
||||
When the GUI starts up initializations are carried out, in this order:
|
||||
- The 'term' option is set to "builtin_gui" and terminal options are reset to
|
||||
their default value for the GUI |terminal-options|.
|
||||
- If the system menu file exists, it is sourced. The name of this file is
|
||||
normally "$VIMRUNTIME/menu.vim". You can check this with ":version". Also
|
||||
see |$VIMRUNTIME|. To skip loading the system menu include 'M' in
|
||||
@@ -92,8 +75,7 @@ and only the first one that is found is read.
|
||||
:winp[os] {X} {Y} *E466*
|
||||
Put the GUI vim window at the given {X} and {Y} coordinates.
|
||||
The coordinates should specify the position in pixels of the
|
||||
top left corner of the window. Does not work in all versions.
|
||||
Does work in an (new) xterm |xterm-color|.
|
||||
top left corner of the window.
|
||||
When the GUI window has not been opened yet, the values are
|
||||
remembered until the window is opened. The position is
|
||||
adjusted to make the window fit on the screen (if possible).
|
||||
@@ -872,30 +854,4 @@ This section describes other features which are related to the GUI.
|
||||
- In the GUI, several normal keys may have modifiers in mappings etc, these
|
||||
are <Space>, <Tab>, <NL>, <CR>, <Esc>.
|
||||
|
||||
- To check in a Vim script if the GUI is being used, you can use something
|
||||
like this: >
|
||||
|
||||
if has("gui_running")
|
||||
echo "yes, we have a GUI"
|
||||
else
|
||||
echo "Boring old console"
|
||||
endif
|
||||
< *setting-guifont*
|
||||
- When you use the same vimrc file on various systems, you can use something
|
||||
like this to set options specifically for each type of GUI: >
|
||||
|
||||
if has("gui_running")
|
||||
if has("gui_gtk2")
|
||||
:set guifont=Luxi\ Mono\ 12
|
||||
elseif has("x11")
|
||||
" Also for GTK 1
|
||||
:set guifont=*-lucidatypewriter-medium-r-normal-*-*-180-*-*-m-*-*
|
||||
elseif has("gui_win32")
|
||||
:set guifont=Luxi_Mono:h12:cANSI
|
||||
endif
|
||||
endif
|
||||
|
||||
A recommended Japanese font is MS Mincho. You can find info here:
|
||||
http://www.lexikan.com/mincho.htm
|
||||
|
||||
vim:tw=78:sw=4:ts=8:ft=help:norl:
|
||||
|
||||
@@ -148,28 +148,22 @@ Special issues ~
|
||||
|
||||
GUI ~
|
||||
|gui.txt| Graphical User Interface (GUI)
|
||||
|gui_w32.txt| Win32 GUI
|
||||
|
||||
Interfaces ~
|
||||
|if_cscop.txt| using Cscope with Vim
|
||||
|if_pyth.txt| Python interface
|
||||
|if_ruby.txt| Ruby interface
|
||||
|debugger.txt| Interface with a debugger
|
||||
|sign.txt| debugging signs
|
||||
|
||||
Versions ~
|
||||
|vim_diff.txt| Main differences between Nvim and Vim
|
||||
|vi_diff.txt| Main differences between Vim and Vi
|
||||
*sys-file-list*
|
||||
Remarks about specific systems ~
|
||||
|os_win32.txt| MS-Windows
|
||||
*standard-plugin-list*
|
||||
Standard plugins ~
|
||||
|pi_gzip.txt| Reading and writing compressed files
|
||||
|pi_netrw.txt| Reading and writing files over a network
|
||||
|pi_paren.txt| Highlight matching parens
|
||||
|pi_tar.txt| Tar file explorer
|
||||
|pi_vimball.txt| Create a self-installing Vim script
|
||||
|pi_zip.txt| Zip archive explorer
|
||||
|
||||
LOCAL ADDITIONS: *local-additions*
|
||||
|
||||
@@ -6,9 +6,7 @@
|
||||
|
||||
Help on help files *helphelp*
|
||||
|
||||
1. Help commands |online-help|
|
||||
2. Translated help files |help-translated|
|
||||
3. Writing help files |help-writing|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Help commands *online-help*
|
||||
@@ -25,12 +23,20 @@ Help on help files *helphelp*
|
||||
The 'helplang' option is used to select a language, if
|
||||
the main help file is available in several languages.
|
||||
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
*{subject}* *E149* *E661*
|
||||
:h[elp] {subject} Like ":help", additionally jump to the tag {subject}.
|
||||
{subject} can include wildcards like "*", "?" and
|
||||
For example: >
|
||||
:help options
|
||||
|
||||
< {subject} can include wildcards such as "*", "?" and
|
||||
"[a-z]":
|
||||
:help z? jump to help for any "z" command
|
||||
:help z. jump to the help for "z."
|
||||
But when a tag exists it is taken literally:
|
||||
:help :? jump to help for ":?"
|
||||
|
||||
If there is no full match for the pattern, or there
|
||||
are several matches, the "best" match will be used.
|
||||
A sophisticated algorithm is used to decide which
|
||||
@@ -67,18 +73,19 @@ Help on help files *helphelp*
|
||||
example to find help for CTRL-V in Insert mode: >
|
||||
:help i^V
|
||||
<
|
||||
To use a regexp |pattern|, first do ":help" and then
|
||||
It is also possible to first do ":help" and then
|
||||
use ":tag {pattern}" in the help window. The
|
||||
":tnext" command can then be used to jump to other
|
||||
matches, "tselect" to list matches and choose one. >
|
||||
:help index| :tse z.
|
||||
:help index
|
||||
:tselect /.*mode
|
||||
|
||||
< When there is no argument you will see matches for
|
||||
"help", to avoid listing all possible matches (that
|
||||
would be very slow).
|
||||
The number of matches displayed is limited to 300.
|
||||
|
||||
This command can be followed by '|' and another
|
||||
The `:help` command can be followed by '|' and another
|
||||
command, but you don't need to escape the '|' inside a
|
||||
help command. So these both work: >
|
||||
:help |
|
||||
|
||||
@@ -12,15 +12,7 @@ a cscope query is just like jumping to any tag; it is saved on the tag stack
|
||||
so that with the right keyboard mappings, you can jump back and forth between
|
||||
functions as you normally would with |tags|.
|
||||
|
||||
1. Cscope introduction |cscope-intro|
|
||||
2. Cscope related commands |cscope-commands|
|
||||
3. Cscope options |cscope-options|
|
||||
4. How to use cscope in Vim |cscope-howtouse|
|
||||
5. Limitations |cscope-limitations|
|
||||
6. Suggested usage |cscope-suggestions|
|
||||
7. Availability & Information |cscope-info|
|
||||
|
||||
This is currently for Unix and Win32 only.
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Cscope introduction *cscope-intro*
|
||||
|
||||
311
runtime/doc/if_lua.txt
Normal file
311
runtime/doc/if_lua.txt
Normal file
@@ -0,0 +1,311 @@
|
||||
*if_lua.txt* Nvim
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Luis Carvalho
|
||||
|
||||
|
||||
Lua Interface to Nvim *lua* *Lua*
|
||||
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Importing modules *lua-require*
|
||||
|
||||
Neovim lua interface automatically adjusts `package.path` and `package.cpath`
|
||||
according to effective &runtimepath value. Adjustment happens after
|
||||
'runtimepath' is changed. `package.path` is adjusted by simply appending
|
||||
`/lua/?.lua` and `/lua/?/init.lua` to each directory from 'runtimepath' (`/`
|
||||
is actually the first character of `package.config`).
|
||||
|
||||
Similarly to `package.path`, modified directories from `runtimepath` are also
|
||||
added to `package.cpath`. In this case, instead of appending `/lua/?.lua` and
|
||||
`/lua/?/init.lua` to each runtimepath, all unique `?`-containing suffixes of
|
||||
the existing `package.cpath` are used. Here is an example:
|
||||
|
||||
1. Given that
|
||||
- 'runtimepath' contains `/foo/bar,/xxx;yyy/baz,/abc`;
|
||||
- initial (defined at compile time or derived from
|
||||
`$LUA_CPATH`/`$LUA_INIT`) `package.cpath` contains
|
||||
`./?.so;/def/ghi/a?d/j/g.elf;/def/?.so`.
|
||||
2. It finds `?`-containing suffixes `/?.so`, `/a?d/j/g.elf` and `/?.so`, in
|
||||
order: parts of the path starting from the first path component containing
|
||||
question mark and preceding path separator.
|
||||
3. The suffix of `/def/?.so`, namely `/?.so` is not unique, as it’s the same
|
||||
as the suffix of the first path from `package.path` (i.e. `./?.so`). Which
|
||||
leaves `/?.so` and `/a?d/j/g.elf`, in this order.
|
||||
4. 'runtimepath' has three paths: `/foo/bar`, `/xxx;yyy/baz` and `/abc`. The
|
||||
second one contains semicolon which is a paths separator so it is out,
|
||||
leaving only `/foo/bar` and `/abc`, in order.
|
||||
5. The cartesian product of paths from 4. and suffixes from 3. is taken,
|
||||
giving four variants. In each variant `/lua` path segment is inserted
|
||||
between path and suffix, leaving
|
||||
|
||||
- `/foo/bar/lua/?.so`
|
||||
- `/foo/bar/lua/a?d/j/g.elf`
|
||||
- `/abc/lua/?.so`
|
||||
- `/abc/lua/a?d/j/g.elf`
|
||||
|
||||
6. New paths are prepended to the original `package.cpath`.
|
||||
|
||||
The result will look like this:
|
||||
|
||||
`/foo/bar,/xxx;yyy/baz,/abc` ('runtimepath')
|
||||
× `./?.so;/def/ghi/a?d/j/g.elf;/def/?.so` (`package.cpath`)
|
||||
|
||||
= `/foo/bar/lua/?.so;/foo/bar/lua/a?d/j/g.elf;/abc/lua/?.so;/abc/lua/a?d/j/g.elf;./?.so;/def/ghi/a?d/j/g.elf;/def/?.so`
|
||||
|
||||
Note: to keep up with 'runtimepath' updates paths added at previous update are
|
||||
remembered and removed at the next update, while all paths derived from the
|
||||
new 'runtimepath' are prepended as described above. This allows removing
|
||||
paths when path is removed from 'runtimepath', adding paths when they are
|
||||
added and reordering `package.path`/`package.cpath` content if 'runtimepath'
|
||||
was reordered.
|
||||
|
||||
Note 2: even though adjustments happens automatically Neovim does not track
|
||||
current values of `package.path` or `package.cpath`. If you happened to
|
||||
delete some paths from there you need to reset 'runtimepath' to make them
|
||||
readded. Just running `let &runtimepath = &runtimepath` should work.
|
||||
|
||||
Note 3: skipping paths from 'runtimepath' which contain semicolons applies
|
||||
both to `package.path` and `package.cpath`. Given that there is a number of
|
||||
badly written plugins using shell which will not work with paths containing
|
||||
semicolons it is better to not have them in 'runtimepath' at all.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
1.1. Example of the plugin which uses lua modules: *lua-require-example*
|
||||
|
||||
The following example plugin adds a command `:MakeCharBlob` which transforms
|
||||
current buffer into a long `unsigned char` array. Lua contains transformation
|
||||
function in a module `lua/charblob.lua` which is imported in
|
||||
`autoload/charblob.vim` (`require("charblob")`). Example plugin is supposed
|
||||
to be put into any directory from 'runtimepath', e.g. `~/.config/nvim` (in
|
||||
this case `lua/charblob.lua` means `~/.config/nvim/lua/charblob.lua`).
|
||||
|
||||
autoload/charblob.vim: >
|
||||
|
||||
function charblob#encode_buffer()
|
||||
call setline(1, luaeval(
|
||||
\ 'require("charblob").encode(unpack(_A))',
|
||||
\ [getline(1, '$'), &textwidth, ' ']))
|
||||
endfunction
|
||||
|
||||
plugin/charblob.vim: >
|
||||
|
||||
if exists('g:charblob_loaded')
|
||||
finish
|
||||
endif
|
||||
let g:charblob_loaded = 1
|
||||
|
||||
command MakeCharBlob :call charblob#encode_buffer()
|
||||
|
||||
lua/charblob.lua: >
|
||||
|
||||
local function charblob_bytes_iter(lines)
|
||||
local init_s = {
|
||||
next_line_idx = 1,
|
||||
next_byte_idx = 1,
|
||||
lines = lines,
|
||||
}
|
||||
local function next(s, _)
|
||||
if lines[s.next_line_idx] == nil then
|
||||
return nil
|
||||
end
|
||||
if s.next_byte_idx > #(lines[s.next_line_idx]) then
|
||||
s.next_line_idx = s.next_line_idx + 1
|
||||
s.next_byte_idx = 1
|
||||
return ('\n'):byte()
|
||||
end
|
||||
local ret = lines[s.next_line_idx]:byte(s.next_byte_idx)
|
||||
if ret == ('\n'):byte() then
|
||||
ret = 0 -- See :h NL-used-for-NUL.
|
||||
end
|
||||
s.next_byte_idx = s.next_byte_idx + 1
|
||||
return ret
|
||||
end
|
||||
return next, init_s, nil
|
||||
end
|
||||
|
||||
local function charblob_encode(lines, textwidth, indent)
|
||||
local ret = {
|
||||
'const unsigned char blob[] = {',
|
||||
indent,
|
||||
}
|
||||
for byte in charblob_bytes_iter(lines) do
|
||||
-- .- space + number (width 3) + comma
|
||||
if #(ret[#ret]) + 5 > textwidth then
|
||||
ret[#ret + 1] = indent
|
||||
else
|
||||
ret[#ret] = ret[#ret] .. ' '
|
||||
end
|
||||
ret[#ret] = ret[#ret] .. (('%3u,'):format(byte))
|
||||
end
|
||||
ret[#ret + 1] = '};'
|
||||
return ret
|
||||
end
|
||||
|
||||
return {
|
||||
bytes_iter = charblob_bytes_iter,
|
||||
encode = charblob_encode,
|
||||
}
|
||||
|
||||
==============================================================================
|
||||
2. Commands *lua-commands*
|
||||
|
||||
*:lua*
|
||||
:[range]lua {chunk}
|
||||
Execute Lua chunk {chunk}.
|
||||
|
||||
Examples:
|
||||
>
|
||||
:lua vim.api.nvim_command('echo "Hello, Neovim!"')
|
||||
<
|
||||
|
||||
:[range]lua << {endmarker}
|
||||
{script}
|
||||
{endmarker}
|
||||
Execute Lua script {script}.
|
||||
Note: This command doesn't work when the Lua
|
||||
feature wasn't compiled in. To avoid errors, see
|
||||
|script-here|.
|
||||
|
||||
{endmarker} must NOT be preceded by any white space. If {endmarker} is
|
||||
omitted from after the "<<", a dot '.' must be used after {script}, like
|
||||
for the |:append| and |:insert| commands.
|
||||
This form of the |:lua| command is mainly useful for including Lua code
|
||||
in Vim scripts.
|
||||
|
||||
Example:
|
||||
>
|
||||
function! CurrentLineInfo()
|
||||
lua << EOF
|
||||
local linenr = vim.api.nvim_win_get_cursor(0)[1]
|
||||
local curline = vim.api.nvim_buf_get_lines(
|
||||
0, linenr, linenr + 1, false)[1]
|
||||
print(string.format("Current line [%d] has %d bytes",
|
||||
linenr, #curline))
|
||||
EOF
|
||||
endfunction
|
||||
|
||||
Note that the variables are prefixed with `local`: they will disappear when
|
||||
block finishes. This is not the case for globals.
|
||||
|
||||
To see what version of Lua you have: >
|
||||
:lua print(_VERSION)
|
||||
|
||||
If you use LuaJIT you can also use this: >
|
||||
:lua print(jit.version)
|
||||
<
|
||||
|
||||
*:luado*
|
||||
:[range]luado {body} Execute Lua function "function (line, linenr) {body}
|
||||
end" for each line in the [range], with the function
|
||||
argument being set to the text of each line in turn,
|
||||
without a trailing <EOL>, and the current line number.
|
||||
If the value returned by the function is a string it
|
||||
becomes the text of the line in the current turn. The
|
||||
default for [range] is the whole file: "1,$".
|
||||
|
||||
Examples:
|
||||
>
|
||||
:luado return string.format("%s\t%d", line:reverse(), #line)
|
||||
|
||||
:lua require"lpeg"
|
||||
:lua -- balanced parenthesis grammar:
|
||||
:lua bp = lpeg.P{ "(" * ((1 - lpeg.S"()") + lpeg.V(1))^0 * ")" }
|
||||
:luado if bp:match(line) then return "-->\t" .. line end
|
||||
<
|
||||
|
||||
*:luafile*
|
||||
:[range]luafile {file}
|
||||
Execute Lua script in {file}.
|
||||
The whole argument is used as a single file name.
|
||||
|
||||
Examples:
|
||||
>
|
||||
:luafile script.lua
|
||||
:luafile %
|
||||
<
|
||||
|
||||
All these commands execute a Lua chunk from either the command line (:lua and
|
||||
:luado) or a file (:luafile) with the given line [range]. Similarly to the Lua
|
||||
interpreter, each chunk has its own scope and so only global variables are
|
||||
shared between command calls. All Lua default libraries are available. In
|
||||
addition, Lua "print" function has its output redirected to the Vim message
|
||||
area, with arguments separated by a white space instead of a tab.
|
||||
|
||||
Lua uses the "vim" module (see |lua-vim|) to issue commands to Neovim
|
||||
and manage buffers (|lua-buffer|) and windows (|lua-window|). However,
|
||||
procedures that alter buffer content, open new buffers, and change cursor
|
||||
position are restricted when the command is executed in the |sandbox|.
|
||||
|
||||
|
||||
==============================================================================
|
||||
2. The vim module *lua-vim*
|
||||
|
||||
Lua interfaces Vim through the "vim" module. Currently it only has `api`
|
||||
submodule which is a table with all API functions. Descriptions of these
|
||||
functions may be found in |api.txt|.
|
||||
|
||||
==============================================================================
|
||||
3. The luaeval function *lua-luaeval* *lua-eval*
|
||||
*luaeval()*
|
||||
|
||||
The (dual) equivalent of "vim.eval" for passing Lua values to Vim is
|
||||
"luaeval". "luaeval" takes an expression string and an optional argument used
|
||||
for _A inside expression and returns the result of the expression. It is
|
||||
semantically equivalent in Lua to:
|
||||
>
|
||||
local chunkheader = "local _A = select(1, ...) return "
|
||||
function luaeval (expstr, arg)
|
||||
local chunk = assert(loadstring(chunkheader .. expstr, "luaeval"))
|
||||
return chunk(arg) -- return typval
|
||||
end
|
||||
|
||||
Note that "_A" receives the argument to "luaeval". Lua nils, numbers, strings,
|
||||
tables and booleans are converted to their Vim respective types. An error is
|
||||
thrown if conversion of any of the remaining Lua types is attempted.
|
||||
|
||||
Note 2: lua tables are used as both dictionaries and lists, thus making it
|
||||
impossible to determine whether empty table is meant to be empty list or empty
|
||||
dictionary. Additionally lua does not have integer numbers. To distinguish
|
||||
between these cases there is the following agreement:
|
||||
|
||||
0. Empty table is empty list.
|
||||
1. Table with N incrementally growing integral numbers, starting from 1 and
|
||||
ending with N is considered to be a list.
|
||||
2. Table with string keys, none of which contains NUL byte, is considered to
|
||||
be a dictionary.
|
||||
3. Table with string keys, at least one of which contains NUL byte, is also
|
||||
considered to be a dictionary, but this time it is converted to
|
||||
a |msgpack-special-map|.
|
||||
4. Table with `vim.type_idx` key may be a dictionary, a list or floating-point
|
||||
value:
|
||||
- `{[vim.type_idx]=vim.types.float, [vim.val_idx]=1}` is converted to
|
||||
a floating-point 1.0. Note that by default integral lua numbers are
|
||||
converted to |Number|s, non-integral are converted to |Float|s. This
|
||||
variant allows integral |Float|s.
|
||||
- `{[vim.type_idx]=vim.types.dictionary}` is converted to an empty
|
||||
dictionary, `{[vim.type_idx]=vim.types.dictionary, [42]=1, a=2}` is
|
||||
converted to a dictionary `{'a': 42}`: non-string keys are ignored.
|
||||
Without `vim.type_idx` key tables with keys not fitting in 1., 2. or 3.
|
||||
are errors.
|
||||
- `{[vim.type_idx]=vim.types.list}` is converted to an empty list. As well
|
||||
as `{[vim.type_idx]=vim.types.list, [42]=1}`: integral keys that do not
|
||||
form a 1-step sequence from 1 to N are ignored, as well as all
|
||||
non-integral keys.
|
||||
|
||||
Examples: >
|
||||
|
||||
:echo luaeval('math.pi')
|
||||
:function Rand(x,y) " random uniform between x and y
|
||||
: return luaeval('(_A.y-_A.x)*math.random()+_A.x', {'x':a:x,'y':a:y})
|
||||
: endfunction
|
||||
:echo Rand(1,10)
|
||||
|
||||
Note that currently second argument to `luaeval` undergoes VimL to lua
|
||||
conversion, so changing containers in lua do not affect values in VimL. Return
|
||||
value is also always converted. When converting, |msgpack-special-dict|s are
|
||||
treated specially.
|
||||
|
||||
==============================================================================
|
||||
vim:tw=78:ts=8:noet:ft=help:norl:
|
||||
@@ -6,18 +6,10 @@
|
||||
|
||||
The Python Interface to Vim *python* *Python*
|
||||
|
||||
1. Commands |python-commands|
|
||||
2. The vim module |python-vim|
|
||||
3. Buffer objects |python-buffer|
|
||||
4. Range objects |python-range|
|
||||
5. Window objects |python-window|
|
||||
6. Tab page objects |python-tabpage|
|
||||
7. vim.bindeval objects |python-bindeval-objects|
|
||||
8. pyeval(), py3eval() Vim functions |python-pyeval|
|
||||
9. Python 3 |python3|
|
||||
|
||||
See |provider-python| for more information. {Nvim}
|
||||
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Commands *python-commands*
|
||||
|
||||
@@ -48,7 +40,11 @@ Example: >
|
||||
print 'EAT ME'
|
||||
EOF
|
||||
endfunction
|
||||
<
|
||||
|
||||
To see what version of Python you have: >
|
||||
:python import sys
|
||||
:python print(sys.version)
|
||||
|
||||
Note: Python is very sensitive to the indenting. Make sure the "class" line
|
||||
and "EOF" do not have any indent.
|
||||
|
||||
@@ -683,7 +679,7 @@ vim.Function object *python-Function*
|
||||
8. pyeval() and py3eval() Vim functions *python-pyeval*
|
||||
|
||||
To facilitate bi-directional interface, you can use |pyeval()| and |py3eval()|
|
||||
functions to evaluate Python expressions and pass their values to VimL.
|
||||
functions to evaluate Python expressions and pass their values to Vim script.
|
||||
|
||||
==============================================================================
|
||||
9. Python 3 *python3*
|
||||
@@ -692,6 +688,10 @@ functions to evaluate Python expressions and pass their values to VimL.
|
||||
The `:py3` and `:python3` commands work similar to `:python`. A simple check
|
||||
if the `:py3` command is working: >
|
||||
:py3 print("Hello")
|
||||
|
||||
To see what version of Python you have: >
|
||||
:py3 import sys
|
||||
:py3 print(sys.version)
|
||||
< *:py3file*
|
||||
The `:py3file` command works similar to `:pyfile`.
|
||||
*:py3do*
|
||||
|
||||
@@ -5,18 +5,13 @@
|
||||
|
||||
The Ruby Interface to Vim *ruby* *Ruby*
|
||||
|
||||
|
||||
1. Commands |ruby-commands|
|
||||
2. The VIM module |ruby-vim|
|
||||
3. VIM::Buffer objects |ruby-buffer|
|
||||
4. VIM::Window objects |ruby-window|
|
||||
5. Global variables |ruby-globals|
|
||||
|
||||
*E266* *E267* *E268* *E269* *E270* *E271* *E272* *E273*
|
||||
|
||||
The home page for ruby is http://www.ruby-lang.org/. You can find links for
|
||||
downloading Ruby there.
|
||||
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Commands *ruby-commands*
|
||||
|
||||
@@ -54,6 +49,9 @@ Example Vim script: >
|
||||
EOF
|
||||
endfunction
|
||||
<
|
||||
To see what version of Ruby you have: >
|
||||
:ruby print RUBY_VERSION
|
||||
<
|
||||
|
||||
*:rubydo* *:rubyd* *E265*
|
||||
:[range]rubyd[o] {cmd} Evaluate Ruby command {cmd} for each line in the
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
|
||||
This file is about indenting C programs and other files.
|
||||
|
||||
1. Indenting C style programs |C-indenting|
|
||||
2. Indenting by expression |indent-expression|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Indenting C style programs *C-indenting*
|
||||
|
||||
@@ -10,22 +10,13 @@ short description. The lists are sorted on ASCII value.
|
||||
Tip: When looking for certain functionality, use a search command. E.g.,
|
||||
to look for deleting something, use: "/delete".
|
||||
|
||||
1. Insert mode |insert-index|
|
||||
2. Normal mode |normal-index|
|
||||
2.1. Text objects |objects|
|
||||
2.2. Window commands |CTRL-W|
|
||||
2.3. Square bracket commands |[|
|
||||
2.4. Commands starting with 'g' |g|
|
||||
2.5. Commands starting with 'z' |z|
|
||||
3. Visual mode |visual-index|
|
||||
4. Command-line editing |ex-edit-index|
|
||||
5. EX commands |ex-cmd-index|
|
||||
|
||||
For an overview of options see help.txt |option-list|.
|
||||
For an overview of built-in functions see |functions|.
|
||||
For a list of Vim variables see |vim-variable|.
|
||||
For a complete listing of all help items see |help-tags|.
|
||||
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Insert mode *insert-index*
|
||||
|
||||
@@ -982,7 +973,7 @@ tag command action in Command-line editing mode ~
|
||||
|c_CTRL-E| CTRL-E cursor to end of command-line
|
||||
|'cedit'| CTRL-F default value for 'cedit': opens the
|
||||
command-line window; otherwise not used
|
||||
CTRL-G not used
|
||||
|c_CTRL-G| CTRL-G next match when 'incsearch' is active
|
||||
|c_<BS>| <BS> delete the character in front of the cursor
|
||||
|c_digraph| {char1} <BS> {char2}
|
||||
enter digraph when 'digraph' is on
|
||||
@@ -1000,7 +991,7 @@ tag command action in Command-line editing mode ~
|
||||
|c_CTRL-L| CTRL-L do completion on the pattern in front of the
|
||||
cursor and insert the longest common part
|
||||
|c_<CR>| <CR> execute entered command
|
||||
|c_<CR>| CTRL-M same as <CR>
|
||||
|c_CTRL-M| CTRL-M same as <CR>
|
||||
|c_CTRL-N| CTRL-N after using 'wildchar' with multiple matches:
|
||||
go to next match, otherwise: same as <Down>
|
||||
CTRL-O not used
|
||||
@@ -1015,7 +1006,7 @@ tag command action in Command-line editing mode ~
|
||||
insert the contents of a register or object
|
||||
under the cursor literally
|
||||
CTRL-S (used for terminal control flow)
|
||||
CTRL-T not used
|
||||
|c_CTRL-T| CTRL-T previous match when 'incsearch' is active
|
||||
|c_CTRL-U| CTRL-U remove all characters
|
||||
|c_CTRL-V| CTRL-V insert next non-digit literally, insert three
|
||||
digit decimal number as a single byte.
|
||||
@@ -1024,7 +1015,7 @@ tag command action in Command-line editing mode ~
|
||||
CTRL-Y copy (yank) modeless selection
|
||||
CTRL-Z not used (reserved for suspend)
|
||||
|c_<Esc>| <Esc> abandon command-line without executing it
|
||||
|c_<Esc>| CTRL-[ same as <Esc>
|
||||
|c_CTRL-[| CTRL-[ same as <Esc>
|
||||
|c_CTRL-\_CTRL-N| CTRL-\ CTRL-N go to Normal mode, abandon command-line
|
||||
|c_CTRL-\_CTRL-G| CTRL-\ CTRL-G go to mode specified with 'insertmode',
|
||||
abandon command-line
|
||||
@@ -1340,6 +1331,9 @@ tag command action ~
|
||||
|:ltag| :lt[ag] jump to tag and add matching tags to the
|
||||
location list
|
||||
|:lunmap| :lu[nmap] like ":unmap!" but includes Lang-Arg mode
|
||||
|:lua| :lua execute Lua command
|
||||
|:luado| :luad[o] execute Lua command for each line
|
||||
|:luafile| :luaf[ile] execute Lua script file
|
||||
|:lvimgrep| :lv[imgrep] search for pattern in files
|
||||
|:lvimgrepadd| :lvimgrepa[dd] like :vimgrep, but append to current list
|
||||
|:lwindow| :lw[indow] open or close location window
|
||||
|
||||
@@ -13,20 +13,11 @@ commands for inserting text in other ways.
|
||||
An overview of the most often used commands can be found in chapter 24 of the
|
||||
user manual |usr_24.txt|.
|
||||
|
||||
1. Special keys |ins-special-keys|
|
||||
2. Special special keys |ins-special-special|
|
||||
3. 'textwidth' and 'wrapmargin' options |ins-textwidth|
|
||||
4. 'expandtab', 'smarttab' and 'softtabstop' options |ins-expandtab|
|
||||
5. Replace mode |Replace-mode|
|
||||
6. Virtual Replace mode |Virtual-Replace-mode|
|
||||
7. Insert mode completion |ins-completion|
|
||||
8. Insert mode commands |inserting|
|
||||
9. Ex insert commands |inserting-ex|
|
||||
10. Inserting a file |inserting-file|
|
||||
|
||||
Also see 'virtualedit', for moving the cursor to positions where there is no
|
||||
character. Useful for editing a table.
|
||||
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Special keys *ins-special-keys*
|
||||
|
||||
|
||||
@@ -6,14 +6,7 @@
|
||||
|
||||
Introduction to Vim *ref* *reference*
|
||||
|
||||
1. Introduction |intro|
|
||||
2. Vim on the internet |internet|
|
||||
3. Credits |credits|
|
||||
4. Notation |notation|
|
||||
5. Modes, introduction |vim-modes-intro|
|
||||
6. Switching from mode to mode |mode-switching|
|
||||
7. The window contents |window-contents|
|
||||
8. Definitions |definitions|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Introduction *intro*
|
||||
@@ -34,11 +27,6 @@ It can be accessed from within Vim with the <Help> or <F1> key and with the
|
||||
is not located in the default place. You can jump to subjects like with tags:
|
||||
Use CTRL-] to jump to a subject under the cursor, use CTRL-T to jump back.
|
||||
|
||||
This manual refers to Vim on various machines. There may be small differences
|
||||
between different computers and terminals. Besides the remarks given in this
|
||||
document, there is a separate document for each supported system, see
|
||||
|sys-file-list|.
|
||||
|
||||
*pronounce*
|
||||
Vim is pronounced as one word, like Jim, not vi-ai-em. It's written with a
|
||||
capital, since it's a name, again like Jim.
|
||||
@@ -92,21 +80,18 @@ mention that.
|
||||
|
||||
*mail-list* *maillist*
|
||||
There are several mailing lists for Vim:
|
||||
<vim@vim.org>
|
||||
<vim@vim.org> *vim-use* *vim_use*
|
||||
For discussions about using existing versions of Vim: Useful mappings,
|
||||
questions, answers, where to get a specific version, etc. There are
|
||||
quite a few people watching this list and answering questions, also
|
||||
for beginners. Don't hesitate to ask your question here.
|
||||
<vim-dev@vim.org> *vim-dev* *vimdev*
|
||||
<vim-dev@vim.org> *vim-dev* *vim_dev* *vimdev*
|
||||
For discussions about changing Vim: New features, porting, patches,
|
||||
beta-test versions, etc.
|
||||
<vim-announce@vim.org> *vim-announce*
|
||||
<vim-announce@vim.org> *vim-announce* *vim_announce*
|
||||
Announcements about new versions of Vim; also for beta-test versions
|
||||
and ports to different systems. This is a read-only list.
|
||||
<vim-multibyte@vim.org> *vim-multibyte*
|
||||
For discussions about using and improving the multi-byte aspects of
|
||||
Vim.
|
||||
<vim-mac@vim.org> *vim-mac*
|
||||
<vim-mac@vim.org> *vim-mac* *vim_mac*
|
||||
For discussions about using and improving the Macintosh version of
|
||||
Vim.
|
||||
|
||||
@@ -131,10 +116,7 @@ http://www.vim.org/maillist.php
|
||||
|
||||
Bug reports: *bugs* *bug-reports* *bugreport.vim*
|
||||
|
||||
Send bug reports to: Vim Developers <vim-dev@vim.org>
|
||||
This is a maillist, you need to become a member first and many people will see
|
||||
the message. If you don't want that, e.g. because it is a security issue,
|
||||
send it to <bugs@vim.org>, this only goes to the Vim maintainer (that's Bram).
|
||||
Report bugs on GitHub: https://github.com/neovim/neovim/issues
|
||||
|
||||
Please be brief; all the time that is spent on answering mail is subtracted
|
||||
from the time that is spent on improving Vim! Always give a reproducible
|
||||
@@ -453,7 +435,6 @@ notation meaning equivalent decimal value(s) ~
|
||||
<M-...> alt-key or meta-key *META* *meta* *alt* *<M-*
|
||||
<A-...> same as <M-...> *<A-*
|
||||
<D-...> command-key or "super" key *<D-*
|
||||
<t_xx> key with "xx" entry in termcap
|
||||
-----------------------------------------------------------------------
|
||||
|
||||
Note: The shifted cursor keys, the help key, and the undo key are only
|
||||
@@ -488,7 +469,6 @@ the ":map" command. The rules are:
|
||||
<S-F11> Shifted function key 11
|
||||
<M-a> Meta- a ('a' with bit 8 set)
|
||||
<M-A> Meta- A ('A' with bit 8 set)
|
||||
<t_kd> "kd" termcap entry (cursor down key)
|
||||
|
||||
The <> notation uses <lt> to escape the special meaning of key names. Using a
|
||||
backslash also works, but only when 'cpoptions' does not include the 'B' flag.
|
||||
@@ -509,7 +489,7 @@ examples and use them directly. Or type them literally, including the '<' and
|
||||
==============================================================================
|
||||
5. Modes, introduction *vim-modes-intro* *vim-modes*
|
||||
|
||||
Vim has six BASIC modes:
|
||||
Vim has seven BASIC modes:
|
||||
|
||||
*Normal* *Normal-mode* *command-mode*
|
||||
Normal mode In Normal mode you can enter all the normal editor
|
||||
@@ -545,6 +525,13 @@ Ex mode Like Command-line mode, but after entering a command
|
||||
you remain in Ex mode. Very limited editing of the
|
||||
command line. |Ex-mode|
|
||||
|
||||
*Terminal-mode*
|
||||
Terminal mode In Terminal mode all input (except |c_CTRL-\_CTRL-N|)
|
||||
is sent to the process running in the current
|
||||
|terminal| buffer.
|
||||
If the 'showmode' option is on "-- TERMINAL --" is shown
|
||||
at the bottom of the window.
|
||||
|
||||
There are six ADDITIONAL modes. These are variants of the BASIC modes:
|
||||
|
||||
*Operator-pending* *Operator-pending-mode*
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
|
||||
Nvim's facilities for job control *job-control*
|
||||
|
||||
1. Introduction |job-control-intro|
|
||||
2. Usage |job-control-usage|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Introduction *job-control-intro*
|
||||
@@ -76,6 +75,7 @@ Here's what is happening:
|
||||
- The `JobHandler()` function is a callback passed to |jobstart()| to handle
|
||||
various job events. It takes care of displaying stdout/stderr received from
|
||||
the shells.
|
||||
*on_stdout* *on_stderr* *on_exit*
|
||||
- The arguments passed to `JobHandler()` are:
|
||||
|
||||
0: The job id
|
||||
|
||||
@@ -9,21 +9,7 @@ Key mapping, abbreviations and user-defined commands.
|
||||
This subject is introduced in sections |05.3|, |24.7| and |40.1| of the user
|
||||
manual.
|
||||
|
||||
1. Key mapping |key-mapping|
|
||||
1.1 MAP COMMANDS |:map-commands|
|
||||
1.2 Special arguments |:map-arguments|
|
||||
1.3 Mapping and modes |:map-modes|
|
||||
1.4 Listing mappings |map-listing|
|
||||
1.5 Mapping special keys |:map-special-keys|
|
||||
1.6 Special characters |:map-special-chars|
|
||||
1.7 What keys to map |map-which-keys|
|
||||
1.8 Examples |map-examples|
|
||||
1.9 Using mappings |map-typing|
|
||||
1.10 Mapping alt-keys |:map-alt-keys|
|
||||
1.11 Mapping an operator |:map-operator|
|
||||
2. Abbreviations |abbreviations|
|
||||
3. Local mappings and functions |script-local|
|
||||
4. User-defined commands |user-commands|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Key mapping *key-mapping* *mapping* *macro*
|
||||
@@ -437,6 +423,9 @@ with a space.
|
||||
Note: When using mappings for Visual mode, you can use the "'<" mark, which
|
||||
is the start of the last selected Visual area in the current buffer |'<|.
|
||||
|
||||
The |:filter| command can be used to select what mappings to list. The
|
||||
pattern is matched against the {lhs} and {rhs} in the raw form.
|
||||
|
||||
*:map-verbose*
|
||||
When 'verbose' is non-zero, listing a key map will also display where it was
|
||||
last defined. Example: >
|
||||
@@ -450,42 +439,30 @@ See |:verbose-cmd| for more information.
|
||||
|
||||
1.5 MAPPING SPECIAL KEYS *:map-special-keys*
|
||||
|
||||
There are three ways to map a special key:
|
||||
There are two ways to map a special key:
|
||||
1. The Vi-compatible method: Map the key code. Often this is a sequence that
|
||||
starts with <Esc>. To enter a mapping like this you type ":map " and then
|
||||
you have to type CTRL-V before hitting the function key. Note that when
|
||||
the key code for the key is in the termcap (the t_ options), it will
|
||||
automatically be translated into the internal code and become the second
|
||||
way of mapping (unless the 'k' flag is included in 'cpoptions').
|
||||
the key code for the key is in the termcap, it will automatically be
|
||||
translated into the internal code and become the second way of mapping
|
||||
(unless the 'k' flag is included in 'cpoptions').
|
||||
2. The second method is to use the internal code for the function key. To
|
||||
enter such a mapping type CTRL-K and then hit the function key, or use
|
||||
the form "#1", "#2", .. "#9", "#0", "<Up>", "<S-Down>", "<S-F7>", etc.
|
||||
(see table of keys |key-notation|, all keys from <Up> can be used). The
|
||||
first ten function keys can be defined in two ways: Just the number, like
|
||||
"#2", and with "<F>", like "<F2>". Both stand for function key 2. "#0"
|
||||
refers to function key 10, defined with option 't_f10', which may be
|
||||
function key zero on some keyboards. The <> form cannot be used when
|
||||
'cpoptions' includes the '<' flag.
|
||||
3. Use the termcap entry, with the form <t_xx>, where "xx" is the name of the
|
||||
termcap entry. Any string entry can be used. For example: >
|
||||
:map <t_F3> G
|
||||
< Maps function key 13 to "G". This does not work if 'cpoptions' includes
|
||||
the '<' flag.
|
||||
|
||||
The advantage of the second and third method is that the mapping will work on
|
||||
different terminals without modification (the function key will be
|
||||
translated into the same internal code or the actual key code, no matter what
|
||||
terminal you are using. The termcap must be correct for this to work, and you
|
||||
must use the same mappings).
|
||||
refers to function key 10. The <> form cannot be used when 'cpoptions'
|
||||
includes the '<' flag.
|
||||
|
||||
DETAIL: Vim first checks if a sequence from the keyboard is mapped. If it
|
||||
isn't the terminal key codes are tried (see |terminal-options|). If a
|
||||
terminal code is found it is replaced with the internal code. Then the check
|
||||
for a mapping is done again (so you can map an internal code to something
|
||||
else). What is written into the script file depends on what is recognized.
|
||||
If the terminal key code was recognized as a mapping the key code itself is
|
||||
written to the script file. If it was recognized as a terminal code the
|
||||
internal code is written to the script file.
|
||||
isn't the terminal key codes are tried. If a terminal code is found it is
|
||||
replaced with the internal code. Then the check for a mapping is done again
|
||||
(so you can map an internal code to something else). What is written into the
|
||||
script file depends on what is recognized. If the terminal key code was
|
||||
recognized as a mapping the key code itself is written to the script file. If
|
||||
it was recognized as a terminal code the internal code is written to the
|
||||
script file.
|
||||
|
||||
|
||||
1.6 SPECIAL CHARACTERS *:map-special-chars*
|
||||
@@ -1136,6 +1113,10 @@ scripts.
|
||||
" Command has the -register attribute
|
||||
b Command is local to current buffer
|
||||
(see below for details on attributes)
|
||||
The list can be filtered on command name with
|
||||
|:filter|, e.g., to list all commands with "Pyth" in
|
||||
the name: >
|
||||
filter Pyth command
|
||||
|
||||
:com[mand] {cmd} List the user-defined commands that start with {cmd}
|
||||
|
||||
|
||||
@@ -14,26 +14,10 @@ For an introduction to the most common features, see |usr_45.txt| in the user
|
||||
manual.
|
||||
For changing the language of messages and menus see |mlang.txt|.
|
||||
|
||||
{not available when compiled without the |+multi_byte| feature}
|
||||
|
||||
|
||||
1. Getting started |mbyte-first|
|
||||
2. Locale |mbyte-locale|
|
||||
3. Encoding |mbyte-encoding|
|
||||
4. Using a terminal |mbyte-terminal|
|
||||
5. Fonts on X11 |mbyte-fonts-X11|
|
||||
6. Fonts on MS-Windows |mbyte-fonts-MSwin|
|
||||
7. Input on X11 |mbyte-XIM|
|
||||
8. Input on MS-Windows |mbyte-IME|
|
||||
9. Input with a keymap |mbyte-keymap|
|
||||
10. Using UTF-8 |mbyte-utf8|
|
||||
11. Overview of options |mbyte-options|
|
||||
|
||||
NOTE: This file contains UTF-8 characters. These may show up as strange
|
||||
characters or boxes when using another encoding.
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Getting started *mbyte-first*
|
||||
Getting started *mbyte-first*
|
||||
|
||||
This is a summary of the multibyte features in Vim. If you are lucky it works
|
||||
as described and you can start using Vim without much trouble. If something
|
||||
@@ -89,8 +73,7 @@ be displayed and edited correctly.
|
||||
|
||||
For the GUI you must select fonts that work with UTF-8. This
|
||||
is the difficult part. It depends on the system you are using, the locale and
|
||||
a few other things. See the chapters on fonts: |mbyte-fonts-X11| for
|
||||
X-Windows and |mbyte-fonts-MSwin| for MS-Windows.
|
||||
a few other things.
|
||||
|
||||
For X11 you can set the 'guifontset' option to a list of fonts that together
|
||||
cover the characters that are used. Example for Korean: >
|
||||
@@ -120,7 +103,7 @@ The options 'iminsert', 'imsearch' and 'imcmdline' can be used to chose
|
||||
the different input methods or disable them temporarily.
|
||||
|
||||
==============================================================================
|
||||
2. Locale *mbyte-locale*
|
||||
Locale *mbyte-locale*
|
||||
|
||||
The easiest setup is when your whole system uses the locale you want to work
|
||||
in. But it's also possible to set the locale for one shell you are working
|
||||
@@ -209,7 +192,7 @@ Or specify $LANG when starting Vim:
|
||||
You could make a small shell script for this.
|
||||
|
||||
==============================================================================
|
||||
3. Encoding *mbyte-encoding*
|
||||
Encoding *mbyte-encoding*
|
||||
|
||||
In Nvim UTF-8 is always used internally to encode characters.
|
||||
This applies to all the places where text is used, including buffers (files
|
||||
@@ -418,49 +401,7 @@ neither of them can be found Vim will still work but some conversions won't be
|
||||
possible.
|
||||
|
||||
==============================================================================
|
||||
4. Using a terminal *mbyte-terminal*
|
||||
|
||||
The GUI fully supports multi-byte characters. It is also possible in a
|
||||
terminal, if the terminal supports the same encoding that Vim uses. Thus this
|
||||
is less flexible.
|
||||
|
||||
For example, you can run Vim in a xterm with added multi-byte support and/or
|
||||
|XIM|. Examples are kterm (Kanji term) and hanterm (for Korean), Eterm
|
||||
(Enlightened terminal) and rxvt.
|
||||
|
||||
UTF-8 IN XFREE86 XTERM *UTF8-xterm*
|
||||
|
||||
This is a short explanation of how to use UTF-8 character encoding in the
|
||||
xterm that comes with XFree86 by Thomas Dickey (text by Markus Kuhn).
|
||||
|
||||
Get the latest xterm version which has now UTF-8 support:
|
||||
|
||||
http://invisible-island.net/xterm/xterm.html
|
||||
|
||||
Compile it with "./configure --enable-wide-chars ; make"
|
||||
|
||||
Also get the ISO 10646-1 version of various fonts, which is available on
|
||||
|
||||
http://www.cl.cam.ac.uk/~mgk25/download/ucs-fonts.tar.gz
|
||||
|
||||
and install the font as described in the README file.
|
||||
|
||||
Now start xterm with >
|
||||
|
||||
xterm -u8 -fn -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1
|
||||
or, for bigger character: >
|
||||
xterm -u8 -fn -misc-fixed-medium-r-normal--15-140-75-75-c-90-iso10646-1
|
||||
|
||||
and you will have a working UTF-8 terminal emulator. Try both >
|
||||
|
||||
cat utf-8-demo.txt
|
||||
vim utf-8-demo.txt
|
||||
|
||||
with the demo text that comes with ucs-fonts.tar.gz in order to see
|
||||
whether there are any problems with UTF-8 in your xterm.
|
||||
|
||||
==============================================================================
|
||||
5. Fonts on X11 *mbyte-fonts-X11*
|
||||
Fonts on X11 *mbyte-fonts-X11*
|
||||
|
||||
Unfortunately, using fonts in X11 is complicated. The name of a single-byte
|
||||
font is a long string. For multi-byte fonts we need several of these...
|
||||
@@ -596,20 +537,7 @@ Also make sure that you set 'guifontset' before setting fonts for highlight
|
||||
groups.
|
||||
|
||||
==============================================================================
|
||||
6. Fonts on MS-Windows *mbyte-fonts-MSwin*
|
||||
|
||||
The simplest is to use the font dialog to select fonts and try them out. You
|
||||
can find this at the "Edit/Select Font..." menu. Once you find a font name
|
||||
that works well you can use this command to see its name: >
|
||||
|
||||
:set guifont
|
||||
|
||||
Then add a command to your |ginit.vim| file to set 'guifont': >
|
||||
|
||||
:set guifont=courier_new:h12
|
||||
|
||||
==============================================================================
|
||||
7. Input on X11 *mbyte-XIM*
|
||||
Input on X11 *mbyte-XIM*
|
||||
|
||||
X INPUT METHOD (XIM) BACKGROUND *XIM* *xim* *x-input-method*
|
||||
|
||||
@@ -768,7 +696,7 @@ For example, when you are using kinput2 as |IM-server| and sh, >
|
||||
<
|
||||
|
||||
==============================================================================
|
||||
8. Input on MS-Windows *mbyte-IME*
|
||||
Input on MS-Windows *mbyte-IME*
|
||||
|
||||
(Windows IME support) *multibyte-ime* *IME*
|
||||
|
||||
@@ -842,7 +770,7 @@ Cursor color when IME or XIM is on *CursorIM*
|
||||
status is on.
|
||||
|
||||
==============================================================================
|
||||
9. Input with a keymap *mbyte-keymap*
|
||||
Input with a keymap *mbyte-keymap*
|
||||
|
||||
When the keyboard doesn't produce the characters you want to enter in your
|
||||
text, you can use the 'keymap' option. This will translate one or more
|
||||
@@ -1090,7 +1018,7 @@ Combining forms:
|
||||
ﭏ 0xfb4f Xal alef-lamed
|
||||
|
||||
==============================================================================
|
||||
10. Using UTF-8 *mbyte-utf8* *UTF-8* *utf-8* *utf8*
|
||||
Using UTF-8 *mbyte-utf8* *UTF-8* *utf-8* *utf8*
|
||||
*Unicode* *unicode*
|
||||
The Unicode character set was designed to include all characters from other
|
||||
character sets. Therefore it is possible to write text in any language using
|
||||
@@ -1222,7 +1150,7 @@ not everybody is able to type a composing character.
|
||||
|
||||
|
||||
==============================================================================
|
||||
11. Overview of options *mbyte-options*
|
||||
Overview of options *mbyte-options*
|
||||
|
||||
These options are relevant for editing multi-byte files. Check the help in
|
||||
options.txt for detailed information.
|
||||
|
||||
@@ -8,9 +8,7 @@ This file contains an alphabetical list of messages and error messages that
|
||||
Vim produces. You can use this if you don't understand what the message
|
||||
means. It is not complete though.
|
||||
|
||||
1. Old messages |:messages|
|
||||
2. Error messages |error-messages|
|
||||
3. Messages |messages|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Old messages *:messages* *:mes* *message-history*
|
||||
@@ -39,10 +37,7 @@ back.
|
||||
Note: If the output has been stopped with "q" at the more prompt, it will only
|
||||
be displayed up to this point.
|
||||
The previous command output is cleared when another command produces output.
|
||||
|
||||
If you are using translated messages, the first printed line tells who
|
||||
maintains the messages or the translations. You can use this to contact the
|
||||
maintainer when you spot a mistake.
|
||||
The "g<" output is not redirected.
|
||||
|
||||
If you want to find help on a specific (error) message, use the ID at the
|
||||
start of the message. For example, to get help on the message: >
|
||||
@@ -127,8 +122,9 @@ closed properly. Mostly harmless.
|
||||
Command too recursive
|
||||
|
||||
This happens when an Ex command executes an Ex command that executes an Ex
|
||||
command, etc. This is only allowed 200 times. When it's more there probably
|
||||
is an endless loop. Probably a |:execute| or |:source| command is involved.
|
||||
command, etc. The limit is 200 or the value of 'maxfuncdepth', whatever is
|
||||
larger. When it's more there probably is an endless loop. Probably a
|
||||
|:execute| or |:source| command is involved.
|
||||
|
||||
*E254* >
|
||||
Cannot allocate color {name}
|
||||
|
||||
@@ -11,11 +11,7 @@ multi-byte text see |multibyte|.
|
||||
|
||||
The basics are explained in the user manual: |usr_45.txt|.
|
||||
|
||||
1. Messages |multilang-messages|
|
||||
2. Menus |multilang-menus|
|
||||
3. Scripts |multilang-scripts|
|
||||
|
||||
Also see |help-translated| for multi-language help.
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Messages *multilang-messages*
|
||||
|
||||
@@ -10,16 +10,6 @@ These commands move the cursor position. If the new position is off of the
|
||||
screen, the screen is scrolled to show the cursor (see also 'scrolljump' and
|
||||
'scrolloff' options).
|
||||
|
||||
1. Motions and operators |operator|
|
||||
2. Left-right motions |left-right-motions|
|
||||
3. Up-down motions |up-down-motions|
|
||||
4. Word motions |word-motions|
|
||||
5. Text object motions |object-motions|
|
||||
6. Text object selection |object-select|
|
||||
7. Marks |mark-motions|
|
||||
8. Jumps |jump-motions|
|
||||
9. Various motions |various-motions|
|
||||
|
||||
General remarks:
|
||||
|
||||
If you want to know where you are in the file use the "CTRL-G" command
|
||||
@@ -36,6 +26,8 @@ The 'virtualedit' option can be set to make it possible to move the cursor to
|
||||
positions where there is no character or within a multi-column character (like
|
||||
a tab).
|
||||
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Motions and operators *operator*
|
||||
|
||||
|
||||
@@ -6,12 +6,7 @@
|
||||
|
||||
RPC API for Nvim *RPC* *rpc* *msgpack-rpc*
|
||||
|
||||
1. Introduction |rpc-intro|
|
||||
2. API mapping |rpc-api|
|
||||
3. Connecting |rpc-connecting|
|
||||
4. Clients |rpc-api-client|
|
||||
5. Types |rpc-types|
|
||||
6. Remote UIs |rpc-remote-ui|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Introduction *rpc-intro*
|
||||
@@ -33,7 +28,7 @@ programs can:
|
||||
The RPC API is like a more powerful version of Vim's `clientserver` feature.
|
||||
|
||||
==============================================================================
|
||||
2. API mapping *rpc-api*
|
||||
2. API mapping *rpc-api*
|
||||
|
||||
The Nvim C |API| is automatically exposed to the RPC API by the build system,
|
||||
which parses headers at src/nvim/api/*. A dispatch function is generated which
|
||||
@@ -197,7 +192,7 @@ prefix is stripped off.
|
||||
5. Types *rpc-types*
|
||||
|
||||
The Nvim C API uses custom types for all functions. |api-types|
|
||||
For the purpose of mapping to msgpack, the types can be split into two groups:
|
||||
At the RPC layer, the types can be split into two groups:
|
||||
|
||||
- Basic types that map natively to msgpack (and probably have a default
|
||||
representation in msgpack-supported programming languages)
|
||||
@@ -219,15 +214,16 @@ Special types (msgpack EXT) ~
|
||||
Window -> enum value kObjectTypeWindow
|
||||
Tabpage -> enum value kObjectTypeTabpage
|
||||
|
||||
An API method expecting one of these types may be passed an integer instead,
|
||||
although they are not interchangeable. For example, a Buffer may be passed as
|
||||
an integer, but not a Window or Tabpage.
|
||||
API functions expecting one of the special EXT types may be passed an integer
|
||||
instead, but not another EXT type. E.g. Buffer may be passed as an integer but
|
||||
not as a Window or Tabpage. The EXT object data is the object id encoded as
|
||||
a msgpack integer: For buffers this is the |bufnr()| and for windows the
|
||||
|window-ID|. For tabpages the id is an internal handle, not the tabpage
|
||||
number.
|
||||
|
||||
To determine the type codes of the special EXT types, inspect the `types` key
|
||||
of the |api-metadata| at runtime. Example JSON representation: >
|
||||
|
||||
The most reliable way of determining the type codes for the special Nvim types
|
||||
is to inspect the `types` key of metadata dictionary returned by the
|
||||
`nvim_get_api_info` method at runtime. Here's a sample JSON representation of
|
||||
the `types` object:
|
||||
>
|
||||
"types": {
|
||||
"Buffer": {
|
||||
"id": 0,
|
||||
@@ -242,7 +238,7 @@ the `types` object:
|
||||
"prefix": "nvim_tabpage_"
|
||||
}
|
||||
}
|
||||
<
|
||||
|
||||
Even for statically compiled clients it is good practice to avoid hardcoding
|
||||
the type codes, because a client may be built against one Nvim version but
|
||||
connect to another with different type codes.
|
||||
@@ -251,9 +247,9 @@ connect to another with different type codes.
|
||||
6. Remote UIs *rpc-remote-ui*
|
||||
|
||||
GUIs can be implemented as external processes communicating with Nvim over the
|
||||
RPC API. Currently the UI model consists of a terminal-like grid with one
|
||||
single, monospace font size. Some elements (UI "widgets") can be drawn
|
||||
separately from the grid.
|
||||
RPC API. The UI model consists of a terminal-like grid with a single,
|
||||
monospace font size. Some elements (UI "widgets") can be drawn separately from
|
||||
the grid ("externalized").
|
||||
|
||||
After connecting to Nvim (usually a spawned, embedded instance) use the
|
||||
|nvim_ui_attach| API method to tell Nvim that your program wants to draw the
|
||||
@@ -264,10 +260,11 @@ a dictionary with these (optional) keys:
|
||||
colors.
|
||||
Set to false to use terminal color codes (at
|
||||
most 256 different colors).
|
||||
`popupmenu_external` Instead of drawing the completion popupmenu on
|
||||
the grid, Nvim will send higher-level events to
|
||||
the ui and let it draw the popupmenu.
|
||||
Defaults to false.
|
||||
`ext_popupmenu` Externalize the popupmenu. |ui-ext-popupmenu|
|
||||
`ext_tabline` Externalize the tabline. |ui-ext-tabline|
|
||||
Externalized widgets will not be drawn by
|
||||
Nvim; only high-level data will be published
|
||||
in new UI event kinds.
|
||||
|
||||
Nvim will then send msgpack-rpc notifications, with the method name "redraw"
|
||||
and a single argument, an array of screen updates (described below). These
|
||||
@@ -417,6 +414,7 @@ properties specified in the corresponding item. The set of modes reported will
|
||||
change in new versions of Nvim, for instance more submodes and temporary
|
||||
states might be represented as separate modes.
|
||||
|
||||
*ui-ext-popupmenu*
|
||||
["popupmenu_show", items, selected, row, col]
|
||||
When `popupmenu_external` is set to true, nvim will not draw the
|
||||
popupmenu on the grid, instead when the popupmenu is to be displayed
|
||||
@@ -436,5 +434,12 @@ states might be represented as separate modes.
|
||||
["popupmenu_hide"]
|
||||
The popupmenu is hidden.
|
||||
|
||||
*ui-ext-tabline*
|
||||
["tabline_update", curtab, tabs]
|
||||
Tabline was updated. UIs should present this data in a custom tabline
|
||||
widget.
|
||||
curtab: Current Tabpage
|
||||
tabs: List of Dicts [{ "tab": Tabpage, "name": String }, ...]
|
||||
|
||||
==============================================================================
|
||||
vim:tw=78:ts=8:noet:ft=help:norl:
|
||||
|
||||
@@ -4,23 +4,25 @@
|
||||
NVIM REFERENCE MANUAL
|
||||
|
||||
|
||||
Nvim *nvim* *nvim-intro*
|
||||
Nvim *nvim* *nvim-intro*
|
||||
|
||||
If you are new to Vim (and Nvim) see |help.txt| or type ":Tutor".
|
||||
If you already use Vim (but not Nvim) see |nvim-from-vim| for a quickstart.
|
||||
If you are new to Vim see |help.txt|, or type ":Tutor".
|
||||
If you already use Vim see |nvim-from-vim| for a quickstart.
|
||||
|
||||
Nvim is emphatically a fork of Vim, not a clone: compatibility with Vim is
|
||||
maintained where possible. See |vim_diff.txt| for the complete reference of
|
||||
differences from Vim.
|
||||
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
Transitioning from Vim *nvim-from-vim*
|
||||
|
||||
To start the transition, link your previous configuration so Nvim can use it:
|
||||
To start the transition, create ~/.config/nvim/init.vim with these contents:
|
||||
>
|
||||
mkdir ~/.config
|
||||
ln -s ~/.vim ~/.config/nvim
|
||||
ln -s ~/.vimrc ~/.config/nvim/init.vim
|
||||
set runtimepath^=~/.vim runtimepath+=~/.vim/after
|
||||
let &packpath = &runtimepath
|
||||
source ~/.vimrc
|
||||
<
|
||||
Note: If your system sets `$XDG_CONFIG_HOME`, use that instead of `~/.config`
|
||||
in the code above. Nvim follows the XDG |base-directories| convention.
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
NVIM REFERENCE MANUAL by Thiago de Arruda
|
||||
|
||||
|
||||
Terminal emulator *terminal-emulator*
|
||||
Terminal emulator *terminal* *terminal-emulator*
|
||||
|
||||
Nvim embeds a VT220/xterm terminal emulator based on libvterm. The terminal is
|
||||
presented as a special buffer type, asynchronously updated from the virtual
|
||||
@@ -15,6 +15,8 @@ Terminal buffers behave mostly like normal 'nomodifiable' buffers, except:
|
||||
- 'scrollback' controls how many off-screen lines are kept.
|
||||
- Terminal output is followed if the cursor is on the last line.
|
||||
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
Spawning *terminal-emulator-spawning*
|
||||
|
||||
@@ -41,29 +43,35 @@ restarting the {cmd} when the session is loaded.
|
||||
==============================================================================
|
||||
Input *terminal-emulator-input*
|
||||
|
||||
To send input, enter terminal mode using any command that would enter "insert
|
||||
To send input, enter |Terminal-mode| using any command that would enter "insert
|
||||
mode" in a normal buffer, such as |i| or |:startinsert|. In this mode all keys
|
||||
except <C-\><C-N> are sent to the underlying program. Use <C-\><C-N> to return
|
||||
to normal mode. |CTRL-\_CTRL-N|
|
||||
to normal-mode. |CTRL-\_CTRL-N|
|
||||
|
||||
Terminal mode has its own |:tnoremap| namespace for mappings, this can be used
|
||||
to automate any terminal interaction. To map <Esc> to exit terminal mode: >
|
||||
Terminal-mode has its own |:tnoremap| namespace for mappings, this can be used
|
||||
to automate any terminal interaction.
|
||||
|
||||
To map <Esc> to exit terminal-mode: >
|
||||
:tnoremap <Esc> <C-\><C-n>
|
||||
<
|
||||
Navigating to other windows is only possible in normal mode. For convenience,
|
||||
you could use these mappings: >
|
||||
:tnoremap <A-h> <C-\><C-n><C-w>h
|
||||
:tnoremap <A-j> <C-\><C-n><C-w>j
|
||||
:tnoremap <A-k> <C-\><C-n><C-w>k
|
||||
:tnoremap <A-l> <C-\><C-n><C-w>l
|
||||
|
||||
To simulate |i_CTRL-R| in terminal-mode: >
|
||||
:tnoremap <expr> <C-R> '<C-\><C-N>"'.nr2char(getchar()).'pi'
|
||||
|
||||
To use `ALT+{h,j,k,l}` to navigate windows from any mode: >
|
||||
:tnoremap <A-h> <C-\><C-N><C-w>h
|
||||
:tnoremap <A-j> <C-\><C-N><C-w>j
|
||||
:tnoremap <A-k> <C-\><C-N><C-w>k
|
||||
:tnoremap <A-l> <C-\><C-N><C-w>l
|
||||
:inoremap <A-h> <C-\><C-N><C-w>h
|
||||
:inoremap <A-j> <C-\><C-N><C-w>j
|
||||
:inoremap <A-k> <C-\><C-N><C-w>k
|
||||
:inoremap <A-l> <C-\><C-N><C-w>l
|
||||
:nnoremap <A-h> <C-w>h
|
||||
:nnoremap <A-j> <C-w>j
|
||||
:nnoremap <A-k> <C-w>k
|
||||
:nnoremap <A-l> <C-w>l
|
||||
<
|
||||
Then you can use `Alt+{h,j,k,l}` to navigate between windows from any mode.
|
||||
|
||||
Mouse input is supported, and has the following behavior:
|
||||
Mouse input has the following behavior:
|
||||
|
||||
- If the program has enabled mouse events, the corresponding events will be
|
||||
forwarded to the program.
|
||||
@@ -81,6 +89,16 @@ Options: 'scrollback'
|
||||
Events: |TermOpen|, |TermClose|
|
||||
Highlight groups: |hl-TermCursor|, |hl-TermCursorNC|
|
||||
|
||||
Terminal sets local defaults for some options, which may differ from your
|
||||
global configuration.
|
||||
|
||||
- 'list' is disabled
|
||||
- 'wrap' is disabled
|
||||
- 'relativenumber' is disabled in |Terminal-mode| (and cannot be enabled)
|
||||
|
||||
You can change the defaults with a TermOpen autocommand: >
|
||||
au TermOpen * setlocal list
|
||||
|
||||
Terminal colors can be customized with these variables:
|
||||
|
||||
- `{g,b}:terminal_color_$NUM`: The terminal color palette, where `$NUM` is the
|
||||
|
||||
@@ -6,11 +6,7 @@
|
||||
|
||||
Options *options*
|
||||
|
||||
1. Setting options |set-option|
|
||||
2. Automatically setting options |auto-setting|
|
||||
3. Options summary |option-summary|
|
||||
|
||||
For an overview of options see help.txt |option-list|.
|
||||
For an overview of options see quickref.txt |option-list|.
|
||||
|
||||
Vim has a number of internal variables and switches which can be set to
|
||||
achieve special effects. These options come in three forms:
|
||||
@@ -18,6 +14,8 @@ achieve special effects. These options come in three forms:
|
||||
number has a numeric value
|
||||
string has a string value
|
||||
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Setting options *set-option* *E764*
|
||||
|
||||
@@ -130,39 +128,6 @@ A few special texts:
|
||||
Last set from error handler ~
|
||||
Option was cleared when evaluating it resulted in an error.
|
||||
|
||||
{not available when compiled without the |+eval| feature}
|
||||
|
||||
*:set-termcap* *E522*
|
||||
For {option} the form "t_xx" may be used to set a terminal option. This will
|
||||
override the value from the termcap. You can then use it in a mapping. If
|
||||
the "xx" part contains special characters, use the <t_xx> form: >
|
||||
:set <t_#4>=^[Ot
|
||||
This can also be used to translate a special code for a normal key. For
|
||||
example, if Alt-b produces <Esc>b, use this: >
|
||||
:set <M-b>=^[b
|
||||
(the ^[ is a real <Esc> here, use CTRL-V <Esc> to enter it)
|
||||
The advantage over a mapping is that it works in all situations.
|
||||
|
||||
You can define any key codes, e.g.: >
|
||||
:set t_xy=^[foo;
|
||||
There is no warning for using a name that isn't recognized. You can map these
|
||||
codes as you like: >
|
||||
:map <t_xy> something
|
||||
< *E846*
|
||||
When a key code is not set, it's like it does not exist. Trying to get its
|
||||
value will result in an error: >
|
||||
:set t_kb=
|
||||
:set t_kb
|
||||
E846: Key code not set: t_kb
|
||||
|
||||
The t_xx options cannot be set from a |modeline| or in the |sandbox|, for
|
||||
security reasons.
|
||||
|
||||
The listing from ":set" looks different from Vi. Long string options are put
|
||||
at the end of the list. The number of options is quite large. The output of
|
||||
"set all" probably does not fit on the screen, causing Vim to give the
|
||||
|more-prompt|.
|
||||
|
||||
*option-backslash*
|
||||
To include white space in a string option value it has to be preceded with a
|
||||
backslash. To include a backslash you have to use two. Effectively this
|
||||
@@ -628,7 +593,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
See Unicode Standard Annex #11 (http://www.unicode.org/reports/tr11).
|
||||
|
||||
Vim may set this option automatically at startup time when Vim is
|
||||
compiled with the |+termresponse| feature and if |t_u7| is set to the
|
||||
compiled with the |+termresponse| feature and if t_u7 is set to the
|
||||
escape sequence to request cursor position report.
|
||||
|
||||
*'autochdir'* *'acd'* *'noautochdir'* *'noacd'*
|
||||
@@ -2092,7 +2057,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
uhex Show unprintable characters hexadecimal as <xx>
|
||||
instead of using ^C and ~C.
|
||||
|
||||
When neither "lastline" or "truncate" is included, a last line that
|
||||
When neither "lastline" nor "truncate" is included, a last line that
|
||||
doesn't fit is replaced with "@" lines.
|
||||
|
||||
*'eadirection'* *'ead'*
|
||||
@@ -2219,10 +2184,15 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
*'exrc'* *'ex'* *'noexrc'* *'noex'*
|
||||
'exrc' 'ex' boolean (default off)
|
||||
global
|
||||
Enables the reading of .nvimrc and .exrc in the current directory.
|
||||
If you switch this option on you should also consider setting the
|
||||
'secure' option (see |initialization|). Using this option comes
|
||||
with a potential security risk, use with care!
|
||||
Enables the reading of .vimrc and .exrc in the current directory.
|
||||
Setting this option is a potential security leak. E.g., consider
|
||||
unpacking a package or fetching files from github, a .vimrc in there
|
||||
might be a trojan horse. BETTER NOT SET THIS OPTION!
|
||||
Instead, define an autocommand in your .vimrc to set options for a
|
||||
matching directory.
|
||||
|
||||
If you do switch this option on you should also consider setting the
|
||||
'secure' option (see |initialization|).
|
||||
This option cannot be set from a |modeline| or in the |sandbox|, for
|
||||
security reasons.
|
||||
Also see |init.vim| and |gui-init|.
|
||||
@@ -2784,23 +2754,24 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
security reasons.
|
||||
|
||||
*'guicursor'* *'gcr'* *E545* *E546* *E548* *E549*
|
||||
'guicursor' 'gcr' string (default "n-v-c:block-Cursor/lCursor,
|
||||
ve:ver35-Cursor,
|
||||
o:hor50-Cursor,
|
||||
i-ci:ver25-Cursor/lCursor,
|
||||
r-cr:hor20-Cursor/lCursor,
|
||||
sm:block-Cursor
|
||||
-blinkwait175-blinkoff150-blinkon175")
|
||||
'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 some
|
||||
terminals. Unset to disable: >
|
||||
:set guicursor=
|
||||
<
|
||||
terminals.
|
||||
|
||||
With tmux you might need this in ~/.tmux.conf (see terminal-overrides
|
||||
in the tmux(1) manual page): >
|
||||
set -ga terminal-overrides ',*:Ss=\E[%p1%d q:Se=\E[2 q'
|
||||
<
|
||||
The option is a comma separated list of parts. Each part consists of a
|
||||
|
||||
< 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:
|
||||
@@ -2828,16 +2799,9 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
the cursor starts blinking, blinkon is the time that
|
||||
the cursor is shown and blinkoff is the time that the
|
||||
cursor is not shown. The times are in msec. When one
|
||||
of the numbers is zero, there is no blinking. The
|
||||
default is: "blinkwait700-blinkon400-blinkoff250".
|
||||
These numbers are used for a missing entry. This
|
||||
means that blinking is enabled by default. To switch
|
||||
blinking off you can use "blinkon0". The cursor only
|
||||
blinks when Vim is waiting for input, not while
|
||||
executing a command.
|
||||
To make the cursor blink in an xterm, see
|
||||
|xterm-blink|.
|
||||
{group-name}
|
||||
of the numbers is zero, there is no blinking. E.g.: >
|
||||
:set guicursor=n:blinkon0
|
||||
< {group-name}
|
||||
a highlight group name, that sets the color and font
|
||||
for the cursor
|
||||
{group-name}/{group-name}
|
||||
@@ -3156,81 +3120,9 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
Think twice when using ":q!" or ":qa!".
|
||||
|
||||
*'highlight'* *'hl'*
|
||||
'highlight' 'hl' string (default: string of "c:group,..." pairs)
|
||||
'highlight' 'hl' Removed. |vim-differences|
|
||||
global
|
||||
This option can be used to set highlighting mode for various
|
||||
occasions. It is a comma separated list of character pairs. The
|
||||
first character in a pair gives the occasion, the second the mode to
|
||||
use for that occasion. The occasions are:
|
||||
|hl-SpecialKey| 8 Meta and special keys listed with ":map"
|
||||
|hl-Whitespace| 0
|
||||
|hl-EndOfBuffer| ~ lines after the last line in the buffer
|
||||
|hl-TermCursor| z Cursor in a focused terminal
|
||||
|hl-TermCursorNC| Z Cursor in an unfocused terminal
|
||||
|hl-NonText| @ '@' at the end of the window and
|
||||
characters from 'showbreak'
|
||||
|hl-Directory| d directories in CTRL-D listing and other special
|
||||
things in listings
|
||||
|hl-ErrorMsg| e error messages
|
||||
|hl-IncSearch| i 'incsearch' highlighting
|
||||
|hl-Search| l last search pattern highlighting (see 'hlsearch')
|
||||
|hl-MoreMsg| m |more-prompt|
|
||||
|hl-ModeMsg| M Mode (e.g., "-- INSERT --")
|
||||
|hl-LineNr| n line number for ":number" and ":#" commands, and
|
||||
when 'number' or 'relativenumber' option is set.
|
||||
|hl-CursorLineNr| N like n for when 'cursorline' or 'relativenumber' is
|
||||
set.
|
||||
|hl-Question| r |hit-enter| prompt and yes/no questions
|
||||
|hl-StatusLine| s status line of current window |status-line|
|
||||
|hl-StatusLineNC| S status lines of not-current windows
|
||||
|hl-Title| t Titles for output from ":set all", ":autocmd" etc.
|
||||
|hl-VertSplit| c column used to separate vertically split windows
|
||||
|hl-Visual| v Visual mode
|
||||
|hl-WarningMsg| w warning messages
|
||||
|hl-WildMenu| W wildcard matches displayed for 'wildmenu'
|
||||
|hl-Folded| f line used for closed folds
|
||||
|hl-FoldColumn| F 'foldcolumn'
|
||||
|hl-DiffAdd| A added line in diff mode
|
||||
|hl-DiffChange| C changed line in diff mode
|
||||
|hl-DiffDelete| D deleted line in diff mode
|
||||
|hl-DiffText| T inserted text in diff mode
|
||||
|hl-SignColumn| > column used for |signs|
|
||||
|hl-SpellBad| B misspelled word |spell|
|
||||
|hl-SpellCap| P word that should start with capital |spell|
|
||||
|hl-SpellRare| R rare word |spell|
|
||||
|hl-SpellLocal| L word from other region |spell|
|
||||
|hl-Conceal| - the placeholders used for concealed characters
|
||||
(see 'conceallevel')
|
||||
|hl-Pmenu| + popup menu normal line
|
||||
|hl-PmenuSel| = popup menu normal line
|
||||
|hl-PmenuSbar| x popup menu scrollbar
|
||||
|hl-PmenuThumb| X popup menu scrollbar thumb
|
||||
|
||||
|hl-TabLine| *
|
||||
|hl-TabLineFill| _
|
||||
|hl-TabLineSel| #
|
||||
|
||||
|hl-ColorColumn| o
|
||||
|hl-CursorColumn| !
|
||||
|hl-CursorLine| .
|
||||
|hl-QuickFixLine| q
|
||||
|
||||
The display modes are:
|
||||
r reverse (termcap entry "mr" and "me")
|
||||
i italic (termcap entry "ZH" and "ZR")
|
||||
b bold (termcap entry "md" and "me")
|
||||
s standout (termcap entry "so" and "se")
|
||||
u underline (termcap entry "us" and "ue")
|
||||
c undercurl (termcap entry "Cs" and "Ce")
|
||||
n no highlighting
|
||||
- no highlighting
|
||||
: use a highlight group
|
||||
The default is used for occasions that are not included.
|
||||
When using the ':' display mode, this must be followed by the name of
|
||||
a highlight group. A highlight group can be used to define any type
|
||||
of highlighting, including using color. See |:highlight| on how to
|
||||
define one. The default uses a different group for each occasion.
|
||||
See |highlight-default| for the default highlight groups.
|
||||
The builtin |highlight-groups| cannot be changed.
|
||||
|
||||
*'hlsearch'* *'hls'* *'nohlsearch'* *'nohls'*
|
||||
'hlsearch' 'hls' boolean (default on)
|
||||
@@ -3426,6 +3318,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
original position when no match is found and when pressing <Esc>. You
|
||||
still need to finish the search command with <Enter> 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.
|
||||
@@ -3915,10 +3809,11 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
global
|
||||
Changes the special characters that can be used in search patterns.
|
||||
See |pattern|.
|
||||
NOTE: To avoid portability problems with using patterns, always keep
|
||||
this option at the default "on". 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|.
|
||||
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|.
|
||||
|
||||
*'makeef'* *'mef'*
|
||||
'makeef' 'mef' string (default: "")
|
||||
@@ -4003,6 +3898,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
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 resursion, see |E169|.
|
||||
See also |:function|.
|
||||
|
||||
*'maxmapdepth'* *'mmd'* *E223*
|
||||
@@ -4114,7 +4011,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
local to buffer
|
||||
When off the buffer contents cannot be changed. The 'fileformat' and
|
||||
'fileencoding' options also can't be changed.
|
||||
Can be reset with the |-M| command line argument.
|
||||
Can be reset on startup with the |-M| command line argument.
|
||||
|
||||
*'modified'* *'mod'* *'nomodified'* *'nomod'*
|
||||
'modified' 'mod' boolean (default off)
|
||||
@@ -4147,7 +4044,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
listing continues until finished.
|
||||
|
||||
*'mouse'* *E538*
|
||||
'mouse' string (default "a")
|
||||
'mouse' string (default "")
|
||||
global
|
||||
|
||||
Enable the use of the mouse. Only works for certain terminals.
|
||||
@@ -4407,7 +4304,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
*'paste'* *'nopaste'*
|
||||
'paste' boolean (default off)
|
||||
global
|
||||
You probably don't have to set this option: |bracketed-paste-mode|.
|
||||
This option is obsolete; |bracketed-paste-mode| is built-in.
|
||||
|
||||
Put Vim in Paste mode. This is useful if you want to cut or copy
|
||||
some text from one window and paste it in Vim. This will avoid
|
||||
@@ -4471,7 +4368,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
Note that typing <F10> in paste mode inserts "<F10>", since in paste
|
||||
mode everything is inserted literally, except the 'pastetoggle' key
|
||||
sequence.
|
||||
When the value has several bytes 'ttimeoutlen' applies.
|
||||
No timeout is used, this means that a multi-key 'pastetoggle' can not
|
||||
be triggered manually.
|
||||
|
||||
*'pex'* *'patchexpr'*
|
||||
'patchexpr' 'pex' string (default "")
|
||||
@@ -4685,6 +4583,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
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.
|
||||
|
||||
*'redrawtime'* *'rdt'*
|
||||
'redrawtime' 'rdt' number (default 2000)
|
||||
@@ -4884,7 +4783,9 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
ordering. This is for preferences to overrule or add to the
|
||||
distributed defaults or system-wide settings (rarely needed).
|
||||
|
||||
More entries are added when using |packages|.
|
||||
More entries are added when using |packages|. If it gets very long
|
||||
then `:set rtp` will be truncated, use `:echo &rtp` to see the full
|
||||
string.
|
||||
|
||||
Note that, unlike 'path', no wildcards like "**" are allowed. Normal
|
||||
wildcards are allowed, but can significantly slow down searching for
|
||||
@@ -6871,6 +6772,24 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
'winheight' applies to the current window. Use 'winminheight' to set
|
||||
the minimal height for other windows.
|
||||
|
||||
*'winhighlight'* *'winhl'*
|
||||
'winhighlight' 'winhl' string (default empty)
|
||||
local to window
|
||||
Window-local highlights. Comma-delimited list of |group-name| pairs
|
||||
"{hl-builtin}:{hl-group},..." where each {hl-builtin} is a group (from
|
||||
|highlight-groups|) to be overridden by {hl-group} in the window where
|
||||
this option was set. Only builting ui highlights are supported, not
|
||||
syntax highlighting. For that purpose, use |:ownsyntax|.
|
||||
|
||||
Most highlights occuring within the frame of a window are supported.
|
||||
Highlights of vertical separators are determined by the window to the
|
||||
left of the separator. The highlight of a tabpage in |tabline| is
|
||||
determined by the last focused window in the tabpage. Highlights of
|
||||
the popupmenu are determined by the current window. Highlights in the
|
||||
message area are not overridable. Example for overriding the
|
||||
backgrond color: >
|
||||
set winhighlight=Normal:MyNormal,NormalNC:MyNormalNC
|
||||
<
|
||||
*'winfixheight'* *'wfh'* *'nowinfixheight'* *'nowfh'*
|
||||
'winfixheight' 'wfh' boolean (default off)
|
||||
local to window
|
||||
|
||||
@@ -1,38 +1,11 @@
|
||||
*os_win32.txt* Nvim
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by George Reilly
|
||||
NVIM REFERENCE MANUAL
|
||||
|
||||
|
||||
*win32* *Win32* *MS-Windows*
|
||||
This file documents the idiosyncrasies of the Win32 version of Vim.
|
||||
|
||||
The Win32 version of Vim works on Windows XP, Vista and Windows 7.
|
||||
There are both console and GUI versions.
|
||||
|
||||
The 32 bit version also runs on 64 bit MS-Windows systems.
|
||||
|
||||
1. Known problems |win32-problems|
|
||||
2. Startup |win32-startup|
|
||||
3. Using the mouse |win32-mouse|
|
||||
4. Win32 mini FAQ |win32-faq|
|
||||
|
||||
Additionally, there are a number of common Win32 and DOS items:
|
||||
File locations |dos-locations|
|
||||
Using backslashes |dos-backslash|
|
||||
Standard mappings |dos-standard-mappings|
|
||||
Screen output and colors |dos-colors|
|
||||
File formats |dos-file-formats|
|
||||
:cd command |dos-:cd|
|
||||
Interrupting |dos-CTRL-Break|
|
||||
Temp files |dos-temp-files|
|
||||
Shell option default |dos-shell|
|
||||
|
||||
Win32 GUI |gui-w32|
|
||||
|
||||
Credits:
|
||||
The Win32 version was written by George V. Reilly <george@reilly.org>.
|
||||
The GUI version was made by George V. Reilly and Robert Webb.
|
||||
This file documents the Win32 version of Nvim.
|
||||
|
||||
==============================================================================
|
||||
1. Known problems *win32-problems*
|
||||
|
||||
@@ -9,16 +9,7 @@ Patterns and search commands *pattern-searches*
|
||||
The very basics can be found in section |03.9| of the user manual. A few more
|
||||
explanations are in chapter 27 |usr_27.txt|.
|
||||
|
||||
1. Search commands |search-commands|
|
||||
2. The definition of a pattern |search-pattern|
|
||||
3. Magic |/magic|
|
||||
4. Overview of pattern items |pattern-overview|
|
||||
5. Multi items |pattern-multi-items|
|
||||
6. Ordinary atoms |pattern-atoms|
|
||||
7. Ignoring case in a pattern |/ignorecase|
|
||||
8. Composing characters |patterns-composing|
|
||||
9. Compare with Perl patterns |perl-patterns|
|
||||
10. Highlighting matches |match-highlight|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Search commands *search-commands*
|
||||
@@ -130,8 +121,7 @@ gD Goto global Declaration. When the cursor is on a
|
||||
ends before the cursor position.
|
||||
|
||||
*CTRL-C*
|
||||
CTRL-C Interrupt current (search) command. Use CTRL-Break on
|
||||
Windows |dos-CTRL-Break|.
|
||||
CTRL-C Interrupt current (search) command.
|
||||
In Normal mode, any pending command is aborted.
|
||||
|
||||
*:noh* *:nohlsearch*
|
||||
@@ -354,8 +344,8 @@ For starters, read chapter 27 of the user manual |usr_27.txt|.
|
||||
*/\%#=* *two-engines* *NFA*
|
||||
Vim includes two regexp engines:
|
||||
1. An old, backtracking engine that supports everything.
|
||||
2. A new, NFA engine that works much faster on some patterns, but does not
|
||||
support everything.
|
||||
2. A new, NFA engine that works much faster on some patterns, possibly slower
|
||||
on some patterns.
|
||||
|
||||
Vim will automatically select the right engine for you. However, if you run
|
||||
into a problem or want to specifically select one engine or the other, you can
|
||||
|
||||
@@ -25,6 +25,8 @@ with these extensions:
|
||||
*.bz2 bzip2
|
||||
*.lzma lzma
|
||||
*.xz xz
|
||||
*.lz lzip
|
||||
*.zst zstd
|
||||
|
||||
That's actually the only thing you need to know. There are no options.
|
||||
|
||||
|
||||
@@ -2,10 +2,7 @@
|
||||
|
||||
Author: TJ DeVries <devries.timothyj@gmail.com>
|
||||
|
||||
==============================================================================
|
||||
1. Introduction |health.vim-intro|
|
||||
2. Commands and functions |health.vim-manual|
|
||||
3. Create a healthcheck |health.vim-dev|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
Introduction *healthcheck* *health.vim-intro*
|
||||
@@ -100,15 +97,12 @@ health#{plugin}#check() function in autoload/health/{plugin}.vim.
|
||||
|:CheckHealth| automatically finds and invokes such functions.
|
||||
|
||||
If your plugin is named "jslint", then its healthcheck function must be >
|
||||
|
||||
health#jslint#check()
|
||||
<
|
||||
|
||||
defined in this file on 'runtimepath': >
|
||||
|
||||
autoload/health/jslint.vim
|
||||
<
|
||||
Here's a sample to get started: >
|
||||
|
||||
Here's a sample to get started: >
|
||||
function! health#jslint#check() abort
|
||||
call health#report_start('sanity checks')
|
||||
" perform arbitrary checks
|
||||
@@ -121,7 +115,7 @@ Here's a sample to get started: >
|
||||
\ ['npm install --save jslint'])
|
||||
endif
|
||||
endfunction
|
||||
<
|
||||
|
||||
==============================================================================
|
||||
|
||||
vim:tw=78:ts=8:ft=help:fdm=marker
|
||||
|
||||
@@ -530,7 +530,7 @@ variable (ex. scp uses the variable g:netrw_scp_cmd, which is defaulted to
|
||||
let g:netrw_sftp_cmd= '"c:\Program Files\PuTTY\psftp.exe"'
|
||||
<
|
||||
(note: it has been reported that windows 7 with putty v0.6's "-batch" option
|
||||
doesn't work, so its best to leave it off for that system)
|
||||
doesn't work, so it's best to leave it off for that system)
|
||||
|
||||
See |netrw-p8| for more about putty, pscp, psftp, etc.
|
||||
|
||||
@@ -1204,7 +1204,7 @@ The :NetrwMB command is available outside of netrw buffers (once netrw has been
|
||||
invoked in the session).
|
||||
|
||||
The file ".netrwbook" holds bookmarks when netrw (and vim) is not active. By
|
||||
default, its stored on the first directory on the user's |'runtimepath'|.
|
||||
default, it's stored on the first directory on the user's |'runtimepath'|.
|
||||
|
||||
Related Topics:
|
||||
|netrw-gb| how to return (go) to a bookmark
|
||||
@@ -1429,7 +1429,7 @@ be used in that count.
|
||||
*.netrwhist*
|
||||
See |g:netrw_dirhistmax| for how to control the quantity of history stack
|
||||
slots. The file ".netrwhist" holds history when netrw (and vim) is not
|
||||
active. By default, its stored on the first directory on the user's
|
||||
active. By default, it's stored on the first directory on the user's
|
||||
|'runtimepath'|.
|
||||
|
||||
Related Topics:
|
||||
@@ -3269,7 +3269,7 @@ The user function is passed one argument; it resembles >
|
||||
|
||||
fun! ExampleUserMapFunc(islocal)
|
||||
<
|
||||
where a:islocal is 1 if its a local-directory system call or 0 when
|
||||
where a:islocal is 1 if it's a local-directory system call or 0 when
|
||||
remote-directory system call.
|
||||
|
||||
Use netrw#Expose("varname") to access netrw-internal (script-local)
|
||||
@@ -3593,7 +3593,7 @@ Example: Clear netrw's marked file list via a mapping on gu >
|
||||
|
||||
*netrw-p16*
|
||||
P16. When editing remote files (ex. :e ftp://hostname/path/file),
|
||||
under Windows I get an |E303| message complaining that its unable
|
||||
under Windows I get an |E303| message complaining that it's unable
|
||||
to open a swap file.
|
||||
|
||||
(romainl) It looks like you are starting Vim from a protected
|
||||
@@ -3647,7 +3647,7 @@ Example: Clear netrw's marked file list via a mapping on gu >
|
||||
P21. I've made a directory (or file) with an accented character, but
|
||||
netrw isn't letting me enter that directory/read that file:
|
||||
|
||||
Its likely that the shell or o/s is using a different encoding
|
||||
It's likely that the shell or o/s is using a different encoding
|
||||
than you have vim (netrw) using. A patch to vim supporting
|
||||
"systemencoding" may address this issue in the future; for
|
||||
now, just have netrw use the proper encoding. For example: >
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
Author: Charles E. Campbell <NdrOchip@ScampbellPfamily.AbizM>
|
||||
(remove NOSPAM from Campbell's email first)
|
||||
Copyright: Copyright (C) 2005-2012 Charles E Campbell *zip-copyright*
|
||||
Copyright: Copyright (C) 2005-2015 Charles E Campbell *zip-copyright*
|
||||
The VIM LICENSE (see |copyright|) applies to the files in this
|
||||
package, including zipPlugin.vim, zip.vim, and pi_zip.vim. except use
|
||||
"zip.vim" instead of "VIM". Like anything else that's free, zip.vim
|
||||
@@ -33,6 +33,9 @@ Copyright: Copyright (C) 2005-2012 Charles E Campbell *zip-copyright*
|
||||
also write to the file. Currently, one may not make a new file in
|
||||
zip archives via the plugin.
|
||||
|
||||
*zip-x*
|
||||
x : may extract a listed file when the cursor is atop it
|
||||
|
||||
OPTIONS
|
||||
|
||||
*g:zip_nomax*
|
||||
@@ -60,6 +63,11 @@ Copyright: Copyright (C) 2005-2012 Charles E Campbell *zip-copyright*
|
||||
It's used during the writing (updating) of a file already in a zip
|
||||
file; by default: >
|
||||
let g:zip_zipcmd= "zip"
|
||||
<
|
||||
*g:zip_extractcmd*
|
||||
This option specifies the program (and any options needed) used to
|
||||
extract a file from a zip archive. By default, >
|
||||
let g:zip_extractcmd= g:zip_unzipcmd
|
||||
<
|
||||
PREVENTING LOADING~
|
||||
|
||||
@@ -83,8 +91,26 @@ Copyright: Copyright (C) 2005-2012 Charles E Campbell *zip-copyright*
|
||||
One can simply extend this line to accommodate additional extensions that
|
||||
should be treated as zip files.
|
||||
|
||||
Alternatively, one may change *g:zipPlugin_ext* in one's .vimrc.
|
||||
Currently (11/30/15) it holds: >
|
||||
|
||||
let g:zipPlugin_ext= '*.zip,*.jar,*.xpi,*.ja,*.war,*.ear,*.celzip,
|
||||
\ *.oxt,*.kmz,*.wsz,*.xap,*.docx,*.docm,*.dotx,*.dotm,*.potx,*.potm,
|
||||
\ *.ppsx,*.ppsm,*.pptx,*.pptm,*.ppam,*.sldx,*.thmx,*.xlam,*.xlsx,*.xlsm,
|
||||
\ *.xlsb,*.xltx,*.xltm,*.xlam,*.crtx,*.vdw,*.glox,*.gcsx,*.gqsx,*.epub'
|
||||
|
||||
==============================================================================
|
||||
4. History *zip-history* {{{1
|
||||
v28 Oct 08, 2014 * changed the sanity checks for executables to reflect
|
||||
the command actually to be attempted in zip#Read()
|
||||
and zip#Write()
|
||||
* added the extraction of a file capability
|
||||
Nov 30, 2015 * added *.epub to the |g:zipPlugin_ext| list
|
||||
Sep 13, 2016 * added *.apk to the |g:zipPlugin_ext| list and
|
||||
sorted the suffices.
|
||||
v27 Jul 02, 2013 * sanity check: zipfile must have "PK" as its first
|
||||
two bytes.
|
||||
* modified to allow zipfile: entries in quickfix lists
|
||||
v26 Nov 15, 2012 * (Jason Spiro) provided a lot of new extensions that
|
||||
are synonyms for .zip
|
||||
v25 Jun 27, 2011 * using keepj with unzip -Z
|
||||
|
||||
@@ -6,14 +6,7 @@
|
||||
|
||||
Printing *printing*
|
||||
|
||||
1. Introduction |print-intro|
|
||||
2. Print options |print-options|
|
||||
3. PostScript Printing |postscript-printing|
|
||||
4. PostScript Printing Encoding |postscript-print-encoding|
|
||||
5. PostScript CJK Printing |postscript-cjk-printing|
|
||||
6. PostScript Printing Troubleshooting |postscript-print-trouble|
|
||||
7. PostScript Utilities |postscript-print-util|
|
||||
8. Formfeed Characters |printing-formfeed|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Introduction *print-intro*
|
||||
|
||||
@@ -8,6 +8,8 @@ Providers *provider*
|
||||
|
||||
Nvim delegates some features to dynamic "providers".
|
||||
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
Python integration *provider-python*
|
||||
|
||||
@@ -97,33 +99,65 @@ RUBY PROVIDER CONFIGURATION ~
|
||||
*g:loaded_ruby_provider*
|
||||
To disable Ruby support: >
|
||||
let g:loaded_ruby_provider = 1
|
||||
<
|
||||
*g:ruby_host_prog*
|
||||
Command to start the Ruby host. By default this is `neovim-ruby-host`. For users
|
||||
who use per-project Ruby versions with tools like RVM or rbenv, setting this can
|
||||
prevent the need to install the `neovim` gem in every project.
|
||||
|
||||
To use an absolute path (e.g. to an rbenv installation): >
|
||||
let g:ruby_host_prog = '~/.rbenv/versions/2.4.1/bin/neovim-ruby-host'
|
||||
<
|
||||
|
||||
To use the RVM "system" Ruby installation: >
|
||||
let g:ruby_host_prog = 'rvm system do neovim-ruby-host'
|
||||
<
|
||||
|
||||
==============================================================================
|
||||
Clipboard integration *provider-clipboard* *clipboard*
|
||||
|
||||
Nvim has no direct connection to the system clipboard. Instead it is
|
||||
accessible through a |provider| which transparently uses shell commands for
|
||||
communicating with the clipboard.
|
||||
Nvim has no direct connection to the system clipboard. Instead it depends on
|
||||
a |provider| which transparently uses shell commands to communicate with the
|
||||
system clipboard or any other clipboard "backend".
|
||||
|
||||
Clipboard access is implicitly enabled if any of the following clipboard tools
|
||||
are found in your `$PATH`.
|
||||
To ALWAYS use the clipboard for ALL operations (instead of interacting with
|
||||
the '+' and/or '*' registers explicitly): >
|
||||
|
||||
- xclip
|
||||
- xsel (newer alternative to xclip)
|
||||
- pbcopy/pbpaste (macOS)
|
||||
- lemonade (for SSH) https://github.com/pocke/lemonade
|
||||
- doitclient (for SSH) http://www.chiark.greenend.org.uk/~sgtatham/doit/
|
||||
|
||||
The presence of a suitable clipboard tool implicitly enables the '+' and '*'
|
||||
registers.
|
||||
|
||||
If you want to ALWAYS use the clipboard for ALL operations (as opposed
|
||||
to interacting with the '+' and/or '*' registers explicitly), set the
|
||||
following option:
|
||||
>
|
||||
set clipboard+=unnamedplus
|
||||
<
|
||||
See 'clipboard' for details and more options.
|
||||
See 'clipboard' for details and options.
|
||||
|
||||
*clipboard-tool*
|
||||
The presence of a working clipboard tool implicitly enables the '+' and '*'
|
||||
registers. Nvim looks for these clipboard tools, in order of priority:
|
||||
|
||||
- |g:clipboard|
|
||||
- pbcopy/pbpaste (macOS)
|
||||
- xclip
|
||||
- xsel (newer alternative to xclip)
|
||||
- lemonade (for SSH) https://github.com/pocke/lemonade
|
||||
- doitclient (for SSH) http://www.chiark.greenend.org.uk/~sgtatham/doit/
|
||||
- win32yank (Windows)
|
||||
- tmux (if $TMUX is set)
|
||||
|
||||
*g:clipboard*
|
||||
To configure a custom clipboard tool, set `g:clipboard` to a dictionary: >
|
||||
let g:clipboard = {
|
||||
\ 'name': 'myClipboard',
|
||||
\ 'copy': {
|
||||
\ '+': 'tmux load-buffer -',
|
||||
\ '*': 'tmux load-buffer -',
|
||||
\ },
|
||||
\ 'paste': {
|
||||
\ '+': 'tmux save-buffer -',
|
||||
\ '*': 'tmux save-buffer -',
|
||||
\ },
|
||||
\ 'cache_enabled': 1,
|
||||
\ }
|
||||
|
||||
If `cache_enabled` is |TRUE| then when a selection is copied, Nvim will cache
|
||||
the selection until the copy command process dies. When pasting, if the copy
|
||||
process has not died, the cached selection is applied.
|
||||
|
||||
==============================================================================
|
||||
X11 selection mechanism *clipboard-x11* *x11-selection*
|
||||
|
||||
@@ -6,15 +6,7 @@
|
||||
|
||||
This subject is introduced in section |30.1| of the user manual.
|
||||
|
||||
1. Using QuickFix commands |quickfix|
|
||||
2. The error window |quickfix-window|
|
||||
3. Using more than one list of errors |quickfix-error-lists|
|
||||
4. Using :make |:make_makeprg|
|
||||
5. Using :grep |grep|
|
||||
6. Selecting a compiler |compiler-select|
|
||||
7. The error format |error-file-format|
|
||||
8. The directory stack |quickfix-directory-stack|
|
||||
9. Specific error file formats |errorformats|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
=============================================================================
|
||||
1. Using QuickFix commands *quickfix* *Quickfix* *E42*
|
||||
@@ -872,7 +864,7 @@ need to write down a "todo" list.
|
||||
|
||||
|
||||
The Vim plugins in the "compiler" directory will set options to use the
|
||||
selected compiler. For ":compiler" local options are set, for ":compiler!"
|
||||
selected compiler. For `:compiler` local options are set, for `:compiler!`
|
||||
global options.
|
||||
*current_compiler*
|
||||
To support older Vim versions, the plugins always use "current_compiler" and
|
||||
|
||||
@@ -988,7 +988,6 @@ Short explanation of each option: *option-list*
|
||||
|g_CTRL-G| g CTRL-G show cursor column, line, and character
|
||||
position
|
||||
|CTRL-C| CTRL-C during searches: Interrupt the search
|
||||
|dos-CTRL-Break| CTRL-Break Windows: during searches: Interrupt the search
|
||||
|<Del>| <Del> while entering a count: delete last character
|
||||
|:version| :ve[rsion] show version information
|
||||
|:normal| :norm[al][!] {commands}
|
||||
@@ -1027,6 +1026,8 @@ Short explanation of each option: *option-list*
|
||||
|c_<Up>| <Up>/<Down> recall older/newer command-line that starts
|
||||
with current command
|
||||
|c_<S-Up>| <S-Up>/<S-Down> recall older/newer command-line from history
|
||||
|c_CTRL-G| CTRL-G next match when 'incsearch' is active
|
||||
|c_CTRL-T| CTRL-T previous match when 'incsearch' is active
|
||||
|:history| :his[tory] show older command-lines
|
||||
|
||||
Context-sensitive completion on the command-line:
|
||||
|
||||
@@ -15,8 +15,7 @@ You can recover most of your changes from the files that Vim uses to store
|
||||
the contents of the file. Mostly you can recover your work with one command:
|
||||
vim -r filename
|
||||
|
||||
1. The swap file |swap-file|
|
||||
2. Recovery |recovery|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. The swap file *swap-file*
|
||||
|
||||
@@ -6,9 +6,7 @@
|
||||
|
||||
Vim client-server communication *client-server*
|
||||
|
||||
1. Common functionality |clientserver|
|
||||
2. X11 specific items |x11-clientserver|
|
||||
3. MS-Windows specific items |w32-clientserver|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Common functionality *clientserver*
|
||||
|
||||
@@ -6,10 +6,7 @@
|
||||
|
||||
Nvim support for remote plugins *remote-plugin*
|
||||
|
||||
1. Introduction |remote-plugin-intro|
|
||||
2. Plugin hosts |remote-plugin-hosts|
|
||||
3. Example |remote-plugin-example|
|
||||
4. Plugin manifest |remote-plugin-manifest|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Introduction *remote-plugin-intro*
|
||||
|
||||
@@ -8,14 +8,7 @@ Repeating commands, Vim scripts and debugging *repeating*
|
||||
|
||||
Chapter 26 of the user manual introduces repeating |usr_26.txt|.
|
||||
|
||||
1. Single repeats |single-repeat|
|
||||
2. Multiple repeats |multi-repeat|
|
||||
3. Complex repeats |complex-repeat|
|
||||
4. Using Vim scripts |using-scripts|
|
||||
5. Using Vim packages |packages|
|
||||
6. Creating Vim packages |package-create|
|
||||
7. Debugging scripts |debug-scripts|
|
||||
8. Profiling |profiling|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Single repeats *single-repeat*
|
||||
@@ -152,7 +145,7 @@ q Stops recording.
|
||||
:[addr]@: Repeat last command-line. First set cursor at line
|
||||
[addr] (default is current line).
|
||||
|
||||
*:@@*
|
||||
:[addr]@ *:@@*
|
||||
:[addr]@@ Repeat the previous :@{0-9a-z"}. First set cursor at
|
||||
line [addr] (default is current line).
|
||||
|
||||
@@ -357,8 +350,7 @@ terminal-independent two character codes. This means that they can be used
|
||||
in the same way on different kinds of terminals. The first character of a
|
||||
key code is 0x80 or 128, shown on the screen as "~@". The second one can be
|
||||
found in the list |key-notation|. Any of these codes can also be entered
|
||||
with CTRL-V followed by the three digit decimal code. This does NOT work for
|
||||
the <t_xx> termcap codes, these can only be used in mappings.
|
||||
with CTRL-V followed by the three digit decimal code.
|
||||
|
||||
*:source_crnl* *W15*
|
||||
Windows: Files that are read with ":source" normally have <CR><NL> <EOL>s.
|
||||
@@ -369,12 +361,6 @@ something like ":map <F1> :help^M", where "^M" is a <CR>. If the first line
|
||||
ends in a <CR>, but following ones don't, you will get an error message,
|
||||
because the <CR> from the first lines will be lost.
|
||||
|
||||
Mac Classic: Files that are read with ":source" normally have <CR> <EOL>s.
|
||||
These always work. If you are using a file with <NL> <EOL>s (for example, a
|
||||
file made on Unix), this will be recognized if 'fileformats' is not empty and
|
||||
the first line does not end in a <CR>. Be careful not to use a file with <NL>
|
||||
linebreaks which has a <CR> in first line.
|
||||
|
||||
On other systems, Vim expects ":source"ed files to end in a <NL>. These
|
||||
always work. If you are using a file with <CR><NL> <EOL>s (for example, a
|
||||
file made on Windows), all lines will have a trailing <CR>. This may cause
|
||||
|
||||
@@ -6,10 +6,7 @@
|
||||
|
||||
Russian language localization and support in Vim *russian* *Russian*
|
||||
|
||||
1. Introduction |russian-intro|
|
||||
2. Russian keymaps |russian-keymap|
|
||||
3. Localization |russian-l18n|
|
||||
4. Known issues |russian-issues|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
===============================================================================
|
||||
1. Introduction *russian-intro*
|
||||
|
||||
@@ -16,12 +16,7 @@ upwards in the buffer, the text in the window moves downwards on your screen.
|
||||
|
||||
See section |03.7| of the user manual for an introduction.
|
||||
|
||||
1. Scrolling downwards |scroll-down|
|
||||
2. Scrolling upwards |scroll-up|
|
||||
3. Scrolling relative to cursor |scroll-cursor|
|
||||
4. Scrolling horizontally |scroll-horizontal|
|
||||
5. Scrolling synchronously |scroll-binding|
|
||||
6. Scrolling with a mouse wheel |scroll-mouse-wheel|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Scrolling downwards *scroll-down*
|
||||
@@ -108,7 +103,8 @@ z^ Without [count]: Redraw with the line just above the
|
||||
3. Scrolling relative to cursor *scroll-cursor*
|
||||
|
||||
The following commands reposition the edit window (the part of the buffer that
|
||||
you see) while keeping the cursor on the same line:
|
||||
you see) while keeping the cursor on the same line. Note that the 'scrolloff'
|
||||
option may cause context lines to show above and below the cursor.
|
||||
|
||||
*z<CR>*
|
||||
z<CR> Redraw, line [count] at top of window (default
|
||||
|
||||
@@ -7,8 +7,7 @@
|
||||
|
||||
Sign Support Features *sign-support*
|
||||
|
||||
1. Introduction |sign-intro|
|
||||
2. Commands |sign-commands|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Introduction *sign-intro* *signs*
|
||||
|
||||
@@ -6,10 +6,7 @@
|
||||
|
||||
Spell checking *spell*
|
||||
|
||||
1. Quick start |spell-quickstart|
|
||||
2. Remarks on spell checking |spell-remarks|
|
||||
3. Generating a spell file |spell-mkspell|
|
||||
4. Spell file format |spell-file-format|
|
||||
Type <M-]> to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
1. Quick start *spell-quickstart* *E756*
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user