Merge pull request #94 from kubkon/vim-config
Add Neovim/Vim8 option to config wizard
This commit is contained in:
commit
99a23737f8
16
README.md
16
README.md
@ -14,6 +14,7 @@ Zig Language Server, or `zls`, is a language server for Zig. The Zig wiki states
|
|||||||
- [VSCode](#vscode)
|
- [VSCode](#vscode)
|
||||||
- [Sublime Text 3](#sublime-text-3)
|
- [Sublime Text 3](#sublime-text-3)
|
||||||
- [Kate](#kate)
|
- [Kate](#kate)
|
||||||
|
- [Neovim/Vim8](#neovimvim8)
|
||||||
- [Related Projects](#related-projects)
|
- [Related Projects](#related-projects)
|
||||||
- [License](#license)
|
- [License](#license)
|
||||||
|
|
||||||
@ -100,6 +101,21 @@ Install the `zls-vscode` extension from [here](https://github.com/zigtools/zls-v
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Neovim/Vim8
|
||||||
|
|
||||||
|
- Install the CoC engine from [here](https://github.com/neoclide/coc.nvim).
|
||||||
|
- Issue `:CocConfig` from within your Vim editor, and the following snippet:
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"lanuageserver": {
|
||||||
|
"zls" : {
|
||||||
|
"command": "command_or_path_to_zls",
|
||||||
|
"filetypes": ["zig"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## Related Projects
|
## Related Projects
|
||||||
- [`sublime-zig-language` by @prime31](https://github.com/prime31/sublime-zig-language)
|
- [`sublime-zig-language` by @prime31](https://github.com/prime31/sublime-zig-language)
|
||||||
- Supports basic language features
|
- Supports basic language features
|
||||||
|
16
build.zig
16
build.zig
@ -34,7 +34,7 @@ pub fn config(step: *std.build.Step) anyerror!void {
|
|||||||
|
|
||||||
std.debug.warn("Successfully saved configuration options!\n", .{});
|
std.debug.warn("Successfully saved configuration options!\n", .{});
|
||||||
|
|
||||||
const editor = try zinput.askSelectOne("Which code editor do you use?", enum { VSCode, Sublime, Kate, Other });
|
const editor = try zinput.askSelectOne("Which code editor do you use?", enum { VSCode, Sublime, Kate, Neovim, Vim8, Other });
|
||||||
std.debug.warn("\n", .{});
|
std.debug.warn("\n", .{});
|
||||||
|
|
||||||
switch (editor) {
|
switch (editor) {
|
||||||
@ -78,6 +78,20 @@ pub fn config(step: *std.build.Step) anyerror!void {
|
|||||||
\\}}
|
\\}}
|
||||||
, .{});
|
, .{});
|
||||||
},
|
},
|
||||||
|
.Neovim, .Vim8 => {
|
||||||
|
std.debug.warn(
|
||||||
|
\\To use ZLS in Neovim/Vim8, we recommend using CoC engine. You can get it from 'https://github.com/neoclide/coc.nvim'.
|
||||||
|
\\Then, simply issue cmd from Neovim/Vim8 `:CocConfig`, and add this to your CoC config:
|
||||||
|
\\{{
|
||||||
|
\\ "lanuageserver": {{
|
||||||
|
\\ "zls" : {{
|
||||||
|
\\ "command": "command_or_path_to_zls",
|
||||||
|
\\ "filetypes": ["zig"]
|
||||||
|
\\ }}
|
||||||
|
\\ }}
|
||||||
|
\\}}
|
||||||
|
, .{});
|
||||||
|
},
|
||||||
.Other => {
|
.Other => {
|
||||||
std.debug.warn(
|
std.debug.warn(
|
||||||
\\We might not *officially* support your editor, but you can definitely still use ZLS!
|
\\We might not *officially* support your editor, but you can definitely still use ZLS!
|
||||||
|
Loading…
Reference in New Issue
Block a user