Add vim command to list LSP workspaces

This commit is contained in:
Talia 2023-12-20 10:24:19 +01:00
parent ab08f3d22a
commit be24b8546f
2 changed files with 6 additions and 5 deletions

View file

@ -4,5 +4,5 @@ WINID=$(kitty @ ls | jq ".[0].platform_window_id")
wmctrl -i -r $WINID -b add,maximized_vert,maximized_horz
xprop -id $(printf "0x%x" $WINID) -f _MOTIF_WM_HINTS 32c -set _MOTIF_WM_HINTS "0x2, 0x0, 0x0, 0x0, 0x0"
kitty @ --to $KITTY_LISTEN_ON set-font-size 24
kitty @ --to $KITTY_LISTEN_ON set-spacing padding-v=60 padding-h=120
kitty @ --to $KITTY_LISTEN_ON set-font-size 20
kitty @ --to $KITTY_LISTEN_ON set-spacing padding=60

View file

@ -13,9 +13,6 @@ return function(_, bufnr)
vim.keymap.set('n', '<leader>wa', vim.lsp.buf.add_workspace_folder, bufopts)
vim.keymap.set('n', '<leader>wr', vim.lsp.buf.remove_workspace_folder, bufopts)
vim.keymap.set('n', '<leader>wl', function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, bufopts)
vim.api.nvim_buf_create_user_command(bufnr, "LspSetWorkspace", function()
for _, workspace in ipairs(vim.lsp.buf.list_workspace_folders()) do
@ -37,4 +34,8 @@ return function(_, bufnr)
vim.api.nvim_buf_create_user_command(bufnr, "Format", function()
vim.lsp.buf.format()
end, {})
vim.api.nvim_buf_create_user_command(bufnr, "LspWorkspaces", function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, bufopts)
end