From 7a25289673416646758134725bd7eaeef614da2d Mon Sep 17 00:00:00 2001 From: AntoXa PRO Date: Tue, 30 Jan 2024 19:01:57 +0300 Subject: [PATCH] lsp --- nvim/.config/nvim/lua/axp/plugins/lsp.lua | 7 ++++++- .../nvim/lua/axp/plugins/null-ls/init.lua | 1 - nvim/.config/nvim/lua/axp/plugins/telescope.lua | 17 +++++++++++------ 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/nvim/.config/nvim/lua/axp/plugins/lsp.lua b/nvim/.config/nvim/lua/axp/plugins/lsp.lua index 936ffb9..32179db 100644 --- a/nvim/.config/nvim/lua/axp/plugins/lsp.lua +++ b/nvim/.config/nvim/lua/axp/plugins/lsp.lua @@ -22,7 +22,8 @@ local servers = { 'volar', 'dockerls', 'jsonls', - 'yamlls' + 'yamlls', + 'graphql' } -- 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) end + if server_name == 'graphql' then + config.filetypes = { 'graphql', 'typescript', 'javascript' } + end + lspconfig[server_name].setup(config) end } diff --git a/nvim/.config/nvim/lua/axp/plugins/null-ls/init.lua b/nvim/.config/nvim/lua/axp/plugins/null-ls/init.lua index fe970ee..2be9962 100644 --- a/nvim/.config/nvim/lua/axp/plugins/null-ls/init.lua +++ b/nvim/.config/nvim/lua/axp/plugins/null-ls/init.lua @@ -24,7 +24,6 @@ null_ls.setup { vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_) vim.lsp.buf.format() end, { desc = 'Format current buffer with LSP' }) - print(clang_format_config) end end } diff --git a/nvim/.config/nvim/lua/axp/plugins/telescope.lua b/nvim/.config/nvim/lua/axp/plugins/telescope.lua index 00ca2e1..d169995 100644 --- a/nvim/.config/nvim/lua/axp/plugins/telescope.lua +++ b/nvim/.config/nvim/lua/axp/plugins/telescope.lua @@ -1,6 +1,7 @@ local status, telescope = pcall(require, 'telescope') if (not status) then return end +-- Configure. telescope.setup { defaults = { file_ignore_patterns = { @@ -16,14 +17,18 @@ telescope.setup { -- See `:help telescope.builtin` local builtin = require('telescope.builtin') +-- Search. vim.keymap.set('n', 'sf', builtin.find_files) vim.keymap.set('n', 'sw', builtin.grep_string) vim.keymap.set('n', 'sg', builtin.live_grep) +-- Old files. vim.keymap.set('n', '?', builtin.oldfiles) -vim.keymap.set('n', '/', function() - builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { - winblend = 10, - previewer = false, - }) -end) + +-- Search current buffer. +-- vim.keymap.set('n', '/', function() +-- builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { +-- winblend = 10, +-- previewer = false, +-- }) +-- end)