lsp
This commit is contained in:
parent
7a0a7554ec
commit
7a25289673
@ -22,7 +22,8 @@ local servers = {
|
|||||||
'volar',
|
'volar',
|
||||||
'dockerls',
|
'dockerls',
|
||||||
'jsonls',
|
'jsonls',
|
||||||
'yamlls'
|
'yamlls',
|
||||||
|
'graphql'
|
||||||
}
|
}
|
||||||
|
|
||||||
-- This function gets run when an LSP connects to a particular buffer.
|
-- This function gets run when an LSP connects to a particular buffer.
|
||||||
@ -76,6 +77,10 @@ mason_lspconfig.setup_handlers {
|
|||||||
lspconfig[server_name].setup(config)
|
lspconfig[server_name].setup(config)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if server_name == 'graphql' then
|
||||||
|
config.filetypes = { 'graphql', 'typescript', 'javascript' }
|
||||||
|
end
|
||||||
|
|
||||||
lspconfig[server_name].setup(config)
|
lspconfig[server_name].setup(config)
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,6 @@ null_ls.setup {
|
|||||||
vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_)
|
vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_)
|
||||||
vim.lsp.buf.format()
|
vim.lsp.buf.format()
|
||||||
end, { desc = 'Format current buffer with LSP' })
|
end, { desc = 'Format current buffer with LSP' })
|
||||||
print(clang_format_config)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
local status, telescope = pcall(require, 'telescope')
|
local status, telescope = pcall(require, 'telescope')
|
||||||
if (not status) then return end
|
if (not status) then return end
|
||||||
|
|
||||||
|
-- Configure.
|
||||||
telescope.setup {
|
telescope.setup {
|
||||||
defaults = {
|
defaults = {
|
||||||
file_ignore_patterns = {
|
file_ignore_patterns = {
|
||||||
@ -16,14 +17,18 @@ telescope.setup {
|
|||||||
-- See `:help telescope.builtin`
|
-- See `:help telescope.builtin`
|
||||||
local builtin = require('telescope.builtin')
|
local builtin = require('telescope.builtin')
|
||||||
|
|
||||||
|
-- Search.
|
||||||
vim.keymap.set('n', '<leader>sf', builtin.find_files)
|
vim.keymap.set('n', '<leader>sf', builtin.find_files)
|
||||||
vim.keymap.set('n', '<leader>sw', builtin.grep_string)
|
vim.keymap.set('n', '<leader>sw', builtin.grep_string)
|
||||||
vim.keymap.set('n', '<leader>sg', builtin.live_grep)
|
vim.keymap.set('n', '<leader>sg', builtin.live_grep)
|
||||||
|
|
||||||
|
-- Old files.
|
||||||
vim.keymap.set('n', '<leader>?', builtin.oldfiles)
|
vim.keymap.set('n', '<leader>?', builtin.oldfiles)
|
||||||
vim.keymap.set('n', '<leader>/', function()
|
|
||||||
builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown {
|
-- Search current buffer.
|
||||||
winblend = 10,
|
-- vim.keymap.set('n', '<leader>/', function()
|
||||||
previewer = false,
|
-- builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown {
|
||||||
})
|
-- winblend = 10,
|
||||||
end)
|
-- previewer = false,
|
||||||
|
-- })
|
||||||
|
-- end)
|
||||||
|
Loading…
Reference in New Issue
Block a user