From 422e3d1079bf3f787d81391b6e23796b806951b9 Mon Sep 17 00:00:00 2001 From: mirzaev Date: Thu, 23 Feb 2023 01:29:44 +1000 Subject: [PATCH] =?UTF-8?q?=D0=BF=D0=BE=D1=87=D0=B8=D0=BD=D0=B8=D0=BB=20?= =?UTF-8?q?=D1=84=D0=BE=D1=80=D0=BC=D0=B0=D1=82=D0=B8=D1=80=D0=BE=D0=B2?= =?UTF-8?q?=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=B8=20=D0=B4=D0=BE=D0=B1=D0=B0?= =?UTF-8?q?=D0=B2=D0=B8=D0=BB=20=D0=BE=D0=BF=D1=80=D0=B5=D0=B4=D0=B5=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=82=D0=B8=D0=BF=D0=B0=20=D1=84?= =?UTF-8?q?=D0=B0=D0=B9=D0=BB=D0=B0=20.log=20=D0=BA=D0=B0=D0=BA=20json?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ftdetect/log.lua | 5 +++ lua/keymaps/plugins.lua | 2 +- lua/keymaps/system.lua | 2 +- lua/plugins/lspconfig.lua | 24 ++++++++++-- plugin/packer_compiled.lua | 80 +++++++++++++++++++------------------- 5 files changed, 67 insertions(+), 46 deletions(-) create mode 100644 ftdetect/log.lua diff --git a/ftdetect/log.lua b/ftdetect/log.lua new file mode 100644 index 0000000..601340f --- /dev/null +++ b/ftdetect/log.lua @@ -0,0 +1,5 @@ +-- Инициализация настроек для файлов с типом ".log" +vim.api.nvim_create_autocmd({ 'BufNewFile', 'BufRead' }, { + pattern = '*.log', + command = 'set filetype=json' +}) diff --git a/lua/keymaps/plugins.lua b/lua/keymaps/plugins.lua index d520d84..957cb05 100644 --- a/lua/keymaps/plugins.lua +++ b/lua/keymaps/plugins.lua @@ -49,7 +49,7 @@ lspconfig_on_attach = function(client, bufnr) vim.keymap.set('n', 'gr', vim.lsp.buf.references, {noremap = true, silent = true, buffer = bufnr}) -- Форматирование - vim.keymap.set('n', 'f', function() vim.lsp.buf.format { async = true } end, {noremap = true, silent = true, buffer = bufnr}) + vim.keymap.set({'n', 'v', 't'}, 'F', function () vim.lsp.buf.format {async = true} end, {noremap = true, silent = true, buffer = bufnr}) end diff --git a/lua/keymaps/system.lua b/lua/keymaps/system.lua index 4fa485f..6f2d335 100644 --- a/lua/keymaps/system.lua +++ b/lua/keymaps/system.lua @@ -21,4 +21,4 @@ vim.keymap.set({'n', 'i', 'v', 't'}, '', '', {noremap = true, silent = vim.keymap.set({'n', 'i', 'v', 't'}, '', '', {noremap = true, silent = true}) -- Быстрое форматирование всего документа -vim.keymap.set({'n', 'v', 't'}, 'F', '1GVG=', {noremap = true, silent = true}) +vim.keymap.set({'n', 'v', 't'}, 'F', '1GVG=', {noremap = true, silent = true}) diff --git a/lua/plugins/lspconfig.lua b/lua/plugins/lspconfig.lua index 2573d22..524b0bf 100644 --- a/lua/plugins/lspconfig.lua +++ b/lua/plugins/lspconfig.lua @@ -11,16 +11,22 @@ local coq = require('coq') -- Инициализация LSP-серверов -- Инициализация "psalm" (LSP-сервер для PHP) -lspconfig.psalm.setup { +lspconfig.psalm.setup({ on_attach = lspconfig_on_attach, coq.lsp_ensure_capabilities() -} +}) -- Инициализация "vscode-html-language-server" (готовый набросок для HTML) -lspconfig.html.setup { +lspconfig.html.setup({ on_attach = lspconfig_on_attach, capabilities = capabilities -} +}) + +-- Инициализация "vscode-html-language-server" (готовый набросок для CSS) +lspconfig.cssls.setup({ + on_attach = lspconfig_on_attach, + capabilities = capabilities +}) -- Инициализация "vscode-langservers-extracted" (готовый набросок для JavaScript и PostScript) lspconfig.eslint.setup({ @@ -35,3 +41,13 @@ lspconfig.eslint.setup({ lspconfig_on_attach(client, bufnr) end, }) + +-- Инициализация "vscode-langservers-extracted" (готовый набросок для JSON) +lspconfig.jsonls.setup({ + on_attach = lspconfig_on_attach, + capabilities = capabilities, + filetypes = { + 'json', + 'log' + } +}) diff --git a/plugin/packer_compiled.lua b/plugin/packer_compiled.lua index d69b3dc..12f2332 100644 --- a/plugin/packer_compiled.lua +++ b/plugin/packer_compiled.lua @@ -270,46 +270,58 @@ time([[Defining packer_plugins]], false) time([[Config for bufferline.nvim]], true) try_loadstring("\27LJ\2\n2\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\23plugins/bufferline\frequire\0", "config", "bufferline.nvim") time([[Config for bufferline.nvim]], false) --- Config for: nvim-dap -time([[Config for nvim-dap]], true) -try_loadstring("\27LJ\2\n+\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\16plugins/dap\frequire\0", "config", "nvim-dap") -time([[Config for nvim-dap]], false) -- Config for: lspkind-nvim time([[Config for lspkind-nvim]], true) try_loadstring("\27LJ\2\n/\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\20plugins/lspkind\frequire\0", "config", "lspkind-nvim") time([[Config for lspkind-nvim]], false) +-- Config for: symbols-outline.nvim +time([[Config for symbols-outline.nvim]], true) +try_loadstring("\27LJ\2\n7\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\28plugins/symbols-outline\frequire\0", "config", "symbols-outline.nvim") +time([[Config for symbols-outline.nvim]], false) +-- Config for: lualine-lsp-progress +time([[Config for lualine-lsp-progress]], true) +try_loadstring("\27LJ\2\n<\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0!plugins/lualine-lsp-progress\frequire\0", "config", "lualine-lsp-progress") +time([[Config for lualine-lsp-progress]], false) +-- Config for: nvim-dap +time([[Config for nvim-dap]], true) +try_loadstring("\27LJ\2\n+\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\16plugins/dap\frequire\0", "config", "nvim-dap") +time([[Config for nvim-dap]], false) -- Config for: nvim-lint time([[Config for nvim-lint]], true) try_loadstring("\27LJ\2\n,\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\17plugins/lint\frequire\0", "config", "nvim-lint") time([[Config for nvim-lint]], false) --- Config for: nvim-web-devicons -time([[Config for nvim-web-devicons]], true) -try_loadstring("\27LJ\2\n9\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\30plugins/nvim-web-devicons\frequire\0", "config", "nvim-web-devicons") -time([[Config for nvim-web-devicons]], false) -- Config for: trouble.nvim time([[Config for trouble.nvim]], true) try_loadstring("\27LJ\2\n/\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\20plugins/trouble\frequire\0", "config", "trouble.nvim") time([[Config for trouble.nvim]], false) --- Config for: lualine.nvim -time([[Config for lualine.nvim]], true) -try_loadstring("\27LJ\2\n/\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\20plugins/lualine\frequire\0", "config", "lualine.nvim") -time([[Config for lualine.nvim]], false) --- Config for: nvim-treesitter -time([[Config for nvim-treesitter]], true) -try_loadstring("\27LJ\2\n2\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\23plugins/treesitter\frequire\0", "config", "nvim-treesitter") -time([[Config for nvim-treesitter]], false) +-- Config for: coq_nvim +time([[Config for coq_nvim]], true) +try_loadstring("\27LJ\2\n+\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\16plugins/coq\frequire\0", "config", "coq_nvim") +time([[Config for coq_nvim]], false) +-- Config for: nvim-web-devicons +time([[Config for nvim-web-devicons]], true) +try_loadstring("\27LJ\2\n9\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\30plugins/nvim-web-devicons\frequire\0", "config", "nvim-web-devicons") +time([[Config for nvim-web-devicons]], false) -- Config for: diaglist.nvim time([[Config for diaglist.nvim]], true) try_loadstring("\27LJ\2\n0\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\21plugins/diaglist\frequire\0", "config", "diaglist.nvim") time([[Config for diaglist.nvim]], false) +-- Config for: lualine.nvim +time([[Config for lualine.nvim]], true) +try_loadstring("\27LJ\2\n/\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\20plugins/lualine\frequire\0", "config", "lualine.nvim") +time([[Config for lualine.nvim]], false) -- Config for: fidget.nvim time([[Config for fidget.nvim]], true) try_loadstring("\27LJ\2\n.\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\19plugins/fidget\frequire\0", "config", "fidget.nvim") time([[Config for fidget.nvim]], false) --- Config for: telescope.nvim -time([[Config for telescope.nvim]], true) -try_loadstring("\27LJ\2\n1\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\22plugins/telescope\frequire\0", "config", "telescope.nvim") -time([[Config for telescope.nvim]], false) +-- Config for: lush.nvim +time([[Config for lush.nvim]], true) +try_loadstring("\27LJ\2\n,\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\17plugins/lush\frequire\0", "config", "lush.nvim") +time([[Config for lush.nvim]], false) +-- Config for: gitsigns.nvim +time([[Config for gitsigns.nvim]], true) +try_loadstring("\27LJ\2\n0\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\21plugins/gitsigns\frequire\0", "config", "gitsigns.nvim") +time([[Config for gitsigns.nvim]], false) -- Config for: neo-tree.nvim time([[Config for neo-tree.nvim]], true) try_loadstring("\27LJ\2\n0\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\21plugins/neo-tree\frequire\0", "config", "neo-tree.nvim") @@ -318,30 +330,18 @@ time([[Config for neo-tree.nvim]], false) time([[Config for vim-test]], true) try_loadstring("\27LJ\2\n0\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\21plugins/vim-test\frequire\0", "config", "vim-test") time([[Config for vim-test]], false) --- Config for: coq_nvim -time([[Config for coq_nvim]], true) -try_loadstring("\27LJ\2\n+\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\16plugins/coq\frequire\0", "config", "coq_nvim") -time([[Config for coq_nvim]], false) --- Config for: gitsigns.nvim -time([[Config for gitsigns.nvim]], true) -try_loadstring("\27LJ\2\n0\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\21plugins/gitsigns\frequire\0", "config", "gitsigns.nvim") -time([[Config for gitsigns.nvim]], false) --- Config for: symbols-outline.nvim -time([[Config for symbols-outline.nvim]], true) -try_loadstring("\27LJ\2\n7\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\28plugins/symbols-outline\frequire\0", "config", "symbols-outline.nvim") -time([[Config for symbols-outline.nvim]], false) +-- Config for: telescope.nvim +time([[Config for telescope.nvim]], true) +try_loadstring("\27LJ\2\n1\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\22plugins/telescope\frequire\0", "config", "telescope.nvim") +time([[Config for telescope.nvim]], false) +-- Config for: nvim-treesitter +time([[Config for nvim-treesitter]], true) +try_loadstring("\27LJ\2\n2\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\23plugins/treesitter\frequire\0", "config", "nvim-treesitter") +time([[Config for nvim-treesitter]], false) -- Config for: nvim-autopairs time([[Config for nvim-autopairs]], true) try_loadstring("\27LJ\2\n1\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\22plugins/autopairs\frequire\0", "config", "nvim-autopairs") time([[Config for nvim-autopairs]], false) --- Config for: lualine-lsp-progress -time([[Config for lualine-lsp-progress]], true) -try_loadstring("\27LJ\2\n<\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0!plugins/lualine-lsp-progress\frequire\0", "config", "lualine-lsp-progress") -time([[Config for lualine-lsp-progress]], false) --- Config for: lush.nvim -time([[Config for lush.nvim]], true) -try_loadstring("\27LJ\2\n,\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\17plugins/lush\frequire\0", "config", "lush.nvim") -time([[Config for lush.nvim]], false) -- Load plugins in order defined by `after` time([[Sequenced loading]], true) vim.cmd [[ packadd nvim-lspconfig ]]