Add Neovim LSP for Yaml files

This commit is contained in:
Daniel Siepmann 2022-03-17 09:01:15 +01:00
parent 2dae9f5813
commit d7f83654e8
Signed by: Daniel Siepmann
GPG key ID: 33D6629915560EF4
2 changed files with 19 additions and 8 deletions

View file

@ -203,16 +203,12 @@ in {
# TODO: Check out these plugins as additions / replacements:
# - https://github.com/weilbith/nvim-code-action-menu/ Check with phpactor and lsp
# - https://github.com/anuvyklack/pretty-fold.nvim Allows easily cosumization of folds
# - https://github.com/glacambre/firenvim Give it another try, integrates neovim into firefox
# - https://github.com/kristijanhusak/vim-dadbod-ui Use vim as db browser
#
# - https://github.com/b0o/SchemaStore.nvim/ autointegrate schemas for json/yaml
#
# - https://github.com/lambdalisue/vim-pager/ (try once I use neovim as pager again)
#
# - https://github.com/hrsh7th/nvim-cmp (due to actual help of each parameter while adding values to function call)
# - https://github.com/weilbith/nvim-code-action-menu/ Check again in future, right now not of much useness on my setup.
#
# Related to diffs / merging
#
@ -324,19 +320,32 @@ in {
plugin = nvim-lspconfig;
type = "lua";
config = ''
require'lspconfig'.phpactor.setup({
require('lspconfig').phpactor.setup({
cmd = {
'${pkgs.php80}/bin/php',
'${phpactor}/bin/phpactor',
'language-server',
},
})
require'lspconfig'.vimls.setup({
require('lspconfig').vimls.setup({
cmd = {
'${pkgs.nodePackages.vim-language-server}/bin/vim-language-server',
'--stdio',
},
})
require('lspconfig').yamlls.setup({
cmd = {
'${pkgs.nodePackages.yaml-language-server}/bin/yaml-language-server',
'--stdio',
},
settings = {
yaml = {
schemaStore = {
enable = true,
},
},
},
})
'';
}

View file

@ -3,3 +3,5 @@ setlocal softtabstop=2 " edit as if the tabs are 2 characters wide
setlocal shiftwidth=2 " number of spaces to use for indent and unindent
setlocal nospell
setlocal omnifunc=v:lua.vim.lsp.omnifunc