aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fl.fischer@fau.de>2021-02-16 16:15:24 +0100
committerFlorian Fischer <florian.fl.fischer@fau.de>2021-02-16 16:15:24 +0100
commit8f088abfc43f964e65b1fbcb64b8d665a0a2da29 (patch)
treefd9400d62bcf07ebf4ef4eb318f979d5ddff9bad /README.md
parent1195f8eb8e32810f150b0091a6c23749fdecf767 (diff)
downloadvis-lspc-8f088abfc43f964e65b1fbcb64b8d665a0a2da29.tar.gz
vis-lspc-8f088abfc43f964e65b1fbcb64b8d665a0a2da29.zip
Support user choice and other improvements
* Add support for user choices by piping the available choices through lspc.menu_cmd which must be a dmenu|vis-menu|fzf like tool. * Mention all commands and options in the README * Add support for textDocument/references * Support opening new location in a horizonatl or vertical split * Internal refactoring * Group binding, vis command and event code * Return error messages and use vis:info only in vis commands * Fix a bug on unexpected server termination
Diffstat (limited to 'README.md')
-rw-r--r--README.md54
1 files changed, 46 insertions, 8 deletions
diff --git a/README.md b/README.md
index f9e49d2..0ee4c45 100644
--- a/README.md
+++ b/README.md
@@ -8,6 +8,7 @@ vis-lspc currently supports:
* `textDocument/completion`
* `textDocument/declaration`
* `textDocument/definition`
+* `textDocument/references`
* `textDocument/typeDefinition`
* `textDocument/implementation`
@@ -32,11 +33,26 @@ Currently only clangd is available and somewhat tested.
There should be a mapping between vis syntax/lexer names and LSP [languageId](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocumentItem).
For example the syntax for C code in vis is called 'ansi_c' and in LSP 'c'.
+## Requirements
+
+* vis must be compiled with the Lua [communicate API](https://github.com/martanne/vis/pull/675).
+* Optional: the json implementation of your choice
+ * must be usable by calling `require('json')`
+ * must provide `json.encode, json.decode`
+
+## Installation
+
+1. Clone this repository into your vis plugins directory
+2. Load the plugin in your `visrc.lua` with `require('plugins/vis-lspc')`
+
+
## Usage
Note that till `textDocument/didChange` is implemented vis-lspc is hardly usable.
But if you are brave there are some default key bindings:
+### Default Bindings
+
Normal mode:
<F2> - start a language server for win.syntax
<F3> - open win.file with a running language server
@@ -45,17 +61,39 @@ But if you are brave there are some default key bindings:
Normal and Insert mode:
<C- > - get completions
-## Requirements
-* vis must be compiled with the Lua [communicate API](https://github.com/martanne/vis/pull/675).
-* Optional: the json implementation of your choice
- * must be usable by calling `require('json')`
- * must provide `json.encode, json.decode`
+### Available commands
-## Installation
+ # language-server management:
+ lspc-start-server [syntax] - start a language server for syntax or win.syntax
+ lspc-stop-server [syntax] - stop the language server for syntax or win.syntax
-1. Clone this repository into your vis plugins directory
-2. Load the plugin in your `visrc.lua` with `require('plugins/vis-lspc')`
+ # file registration:
+ lspc-open - register the file in the current window
+ lspc-close - unregister the file in the current window
+
+ # navigation commands (they all operate on the symbol under the main cursor):
+ lspc-completion - syntax completion
+ lspc-references [e | vsplit | hsplit] - select and open a reference
+ lspc-declaration [e | vsplit | hsplit] - select and open a declaration
+ lspc-definition [e | vsplit | hsplit] - open the definition
+ lspc-typeDeclaration [e | vsplit | hsplit] - select and open a type declaration
+ lspc-implementation [e | vsplit | hsplit] - I actually have no idea what this does
+
+ lspc-back - navigate back in the goto history
+
+### Available configuration fields
+
+The module table returned by `require('plugins/vis-lspc')` can be use to configure
+some aspects of vis-lspc.
+
+Available fields are:
+
+* `name = 'vis-lspc'` - the name vis-lspc introduces itself to a language server
+* `logging = false` - enable logging only useful for debugging vis-lspc
+* `log_file = 'vis-lspc.log'` - file vis-lspc writes all log messages to
+* `autostart = true` - try to start a language server in WIN_OPEN
+* `menu_cmd = 'fzf' or 'vis-menu'` - program to prompt for user choices
## License