Repository navigation
Expand file tree
/
Copy path.nvim.lua
More file actions
49 lines (42 loc) · 1.37 KB
/
Copy path.nvim.lua
File metadata and controls
49 lines (42 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
-- 1. Define the custom LSP configuration for tmux
vim.lsp.config("tmux_ls", {
cmd = { "tmux-language-server" },
filetypes = { "tmux" },
root_markers = { ".git", ".tmux.conf", "tmux.conf" },
})
-- vim.lsp.config("lua_ls", {
-- settings = {
-- Lua = {
-- signatureHelp = { enabled = true },
-- diagnostics = {
-- globals = { "nixInfo", "vim", "Snacks", "lzn", "Util", "Icons" },
-- disable = { "missing-fields" },
-- },
-- },
-- },
-- })
-- 2. Enable it globally (automatically attaches when filetype matches)
vim.lsp.enable("tmux_ls")
vim.filetype.add({
pattern = {
[".*tmux%.conf"] = "tmux",
},
})
vim.api.nvim_create_autocmd("LspAttach", {
group = vim.api.nvim_create_augroup("UserLspConfig", {}),
callback = function(ev)
local client = assert(vim.lsp.get_client_by_id(ev.data.client_id))
-- Example keymaps for navigation/inspection
local opts = { buffer = ev.buf }
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
vim.keymap.set("n", "K", function()
vim.lsp.buf.hover({ border = "rounded", silent = true })
end, opts)
-- Enable built-in completion if supported
if client:supports_method("textDocument/completion") then
vim.lsp.completion.enable(true, client.id, ev.buf, { autotrigger = true })
end
end,
})
-- vim.treesitter.language.add('python', { path = "" })
vim.treesitter.language.register("tmux", { "conf", "tmux" })