Skip to content

Commit

Permalink
updated README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
uros-5 committed May 13, 2024
1 parent 7bdf065 commit ba3a762
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,48 @@ name = "jinja"
language-servers = ["jinja-lsp"]
```

Neovim configuration

```lua
vim.filetype.add {
extension = {
jinja = 'jinja',
jinja2 = 'jinja',
j2 = 'jinja',
},
}

-- if you want to debug
vim.lsp.set_log_level("debug")

local nvim_lsp = require('lspconfig')
local configs = require('lspconfig.configs')

if not configs.jinja_lsp then
configs.jinja_lsp = {
default_config = {
name = "jinja-lsp",
cmd = { 'path_to_lsp_or_command' },
filetypes = { 'jinja', 'rust' },
root_dir = function(fname)
return "."
--return nvim_lsp.util.find_git_ancestor(fname)
end,
init_options = {
templates = './templates',
backend = { './src' },
lang = "rust"
},
},
}
end
local capabilities = require('cmp_nvim_lsp').default_capabilities(vim.lsp.protocol.make_client_capabilities())
nvim_lsp.jinja_lsp.setup {
capabilities = capabilities
}
nvim_lsp.jinja_lsp.setup {
}
```


Supported languages: Python, Rust

0 comments on commit ba3a762

Please sign in to comment.