Skip to content

Commit

Permalink
docs: add example to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
qvalentin committed Nov 16, 2024
1 parent 01195ff commit c8d35ad
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
21 changes: 15 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Helm-ls is a [helm](https://github.com/helm/helm) language server protocol [LSP]
- [Default Configuration](#default-configuration)
- [Editor Config examples](#editor-config-examples)
- [Neovim](#neovim)
- [Vim Helm Plugin](#vim-helm-plugin)
- [Filetype detection](#filetype-detection)
- [nvim-lspconfig setup](#nvim-lspconfig-setup)
- [coc.nvim setup](#cocnvim-setup)
- [VSCode](#vscode)
Expand Down Expand Up @@ -215,12 +215,19 @@ settings = {

### Neovim

#### Vim Helm Plugin
#### Filetype detection

To get filetype detection working, you'll need the [vim-helm](https://github.com/towolf/vim-helm) plugin installed before using helm_ls, to install it using vim-plug (or use your preferred plugin manager):
To get filetype detection working, you can use one of the folowing plugins:

- [helm-ls.nvim](https://github.com/qvalentin/helm-ls.nvim): recommended, but requires you to use [tree-sitter](https://github.com/ngalaiko/tree-sitter-go-template?tab=readme-ov-file#neovim-integration-using-nvim-treesitter) for syntax highlighting. Also provides some additional features.
- [vim-helm](https://github.com/towolf/vim-helm): known to cause problems with yaml-language-server when used with another plugin manger than lazy

install it using lazy (or use your preferred plugin manager):

```lua
Plug 'towolf/vim-helm'
{ "qvalentin/helm-ls.nvim", ft = "helm" }
-- or { "towolf/vim-helm", ft = "helm" },
-- or even both
```

#### nvim-lspconfig setup
Expand All @@ -242,11 +249,13 @@ lspconfig.helm_ls.setup {
```

See [examples/nvim/init.lua](https://github.com/mrjosh/helm-ls/blob/master/examples/nvim/init.lua) for an
complete example, which also includes yaml-language-server.
complete example using lazy, or [examples/nvim/init.lua](https://github.com/mrjosh/helm-ls/blob/master/examples/vim-plug/init.lua) for vim-plug.
The examples also include the setup for yaml-language-server.

> [!TIP]
>
> If you are using [AstroNvim](https://github.com/AstroNvim/AstroNvim) you can just install the [astrocommunity](https://github.com/AstroNvim/astrocommunity) helm pack.
> If you are using [AstroNvim](https://github.com/AstroNvim/AstroNvim) you can just install the [astrocommunity](https://github.com/AstroNvim/astrocommunity) helm pack
> or if using [LazyVim](https://github.com/LazyVim/LazyVim) its [LazyVimHelm](https://github.com/LazyVim/LazyVim) plugin.
#### coc.nvim setup

Expand Down
1 change: 1 addition & 0 deletions examples/nvim/init.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
-- a minimal example config for setting up neovim with helm-ls and yamlls
-- test it with: nvim -u init.lua

-- setup lazy plugin manager
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
Expand Down
2 changes: 2 additions & 0 deletions examples/vim-plug/init.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
-- a minimal example config for setting up neovim with helm-ls and yamlls using the plugin manager vim-plug
-- test it with: nvim -u init.lua

local Plug = vim.fn["plug#"]

-- install required plugins
Expand Down

0 comments on commit c8d35ad

Please sign in to comment.