Set fuzzy lsp bindings based on installed packages

This commit is contained in:
ViViDboarder 2021-08-25 16:28:24 -07:00
parent 21c33a47f8
commit 1ac22e81b2

View File

@ -52,13 +52,14 @@ local function default_attach(client, bufnr)
]]) ]])
end end
-- Some override telescope bindings -- Some override some fuzzy finder bindings to use lsp sources
-- TODO: Detect telescope or nvim-lspfuzzy and set keymap accordingly if packer_plugins["nvim-lspfuzzy"] then
buf_set_keymap("n", "<leader>t", "<cmd>lua vim.lsp.buf.document_symbol()<CR>", opts) buf_set_keymap("n", "<leader>t", "<cmd>lua vim.lsp.buf.document_symbol()<CR>", opts)
-- buf_set_keymap("n", "<leader>ft", "<cmd>lua vim.lsp.buf.workspace_symbol()<CR>", opts) -- buf_set_keymap("n", "<leader>ft", "<cmd>lua vim.lsp.buf.workspace_symbol()<CR>", opts)
elseif packer_plugins["telescope.nvim"] then
-- buf_set_keymap("n", "<leader>t", "<cmd>Telescope lsp_document_symbols<CR>", opts) buf_set_keymap("n", "<leader>t", "<cmd>Telescope lsp_document_symbols<CR>", opts)
-- buf_set_keymap("n", "<leader>ft", "<cmd>Telescope lsp_dynamic_workspace_symbols<CR>", opts) buf_set_keymap("n", "<leader>ft", "<cmd>Telescope lsp_dynamic_workspace_symbols<CR>", opts)
end
end end
local function config_lsp() local function config_lsp()