From 82987a454c0510955eb828eb1fac5d7b8f6ae5b3 Mon Sep 17 00:00:00 2001 From: CRy386i Date: Fri, 11 Jul 2025 20:11:11 +0300 Subject: [PATCH] Oh my little refactor --- lua/base/other.lua | 26 +++++++++++++++++++ lua/plugins/lazy.lua | 59 +++++++++++++++----------------------------- 2 files changed, 46 insertions(+), 39 deletions(-) diff --git a/lua/base/other.lua b/lua/base/other.lua index 15c75fa..2df247a 100644 --- a/lua/base/other.lua +++ b/lua/base/other.lua @@ -35,3 +35,29 @@ opt.langmap = "ФИСВУАПРШОЛДЬТЩЗЙКЫЕГМЦЧНЯ;ABCDEFGHIJKL opt.colorcolumn = "120" opt.mouse = "" + +vim.filetype.add({ + extension = { + vp = 'glsl', + fp = 'glsl', + gp = 'glsl', + vs = 'glsl', + fs = 'glsl', + gs = 'glsl', + tcs = 'glsl', + tes = 'glsl', + cs = 'glsl', + vert = 'glsl', + frag = 'glsl', + geom = 'glsl', + tess = 'glsl', + shd = 'glsl', + gls = 'glsl', + glsl = 'glsl', + rgen = 'glsl', + comp = 'glsl', + rchit = 'glsl', + rahit = 'glsl', + rmiss = 'glsl', + } +}) diff --git a/lua/plugins/lazy.lua b/lua/plugins/lazy.lua index 45dc2a8..1fd1ba8 100644 --- a/lua/plugins/lazy.lua +++ b/lua/plugins/lazy.lua @@ -71,7 +71,7 @@ require('lazy').setup({ override_generic_sorter = true, -- override the generic sorter override_file_sorter = true, -- override the file sorter case_mode = "smart_case", -- or "ignore_case" or "respect_case" - -- the default case_mode is "smart_case" + -- the default case_mode is "smart_case" } } } @@ -92,7 +92,7 @@ require('lazy').setup({ build = ":TSUpdate", config = function() require("nvim-treesitter.configs").setup { - ensure_installed = { "c", "cpp", "lua" }, + ensure_installed = { 'c', 'cpp', 'lua' }, highlight = { enable = true, } } end @@ -100,12 +100,25 @@ require('lazy').setup({ { 'neovim/nvim-lspconfig', config = function() - -- Setup language servers. - local wk = require("which-key") - local lspconfig = require('lspconfig') - --lspconfig.clangd.setup {} - --lspconfig.neocmake.setup {} + -- Setup language servers + -- Server-specific settings. See `:help lsp-quickstart` + vim.lsp.config('*', { + capabilities = { + textDocument = { + semanticTokens = { + multilineTokenSupport = true, + } + } + }, + root_markers = { '.git' }, + }) + vim.lsp.config('clangd', { + cmd = { 'clangd', '--background-index', '--clang-tidy', '--log=verbose', '--header-insertion=never' }, + filetypes = { 'c', 'cpp' } + }) + vim.lsp.enable('clangd') + local wk = require("which-key") -- Global mappings. -- See `:help vim.diagnostic.*` for documentation on any of the below functions wk.add({ @@ -228,13 +241,6 @@ require('lazy').setup({ { name = 'cmdline' } }) }) - - -- Set up lspconfig. - local capabilities = require('cmp_nvim_lsp').default_capabilities() - -- TODO Replace with each lsp server you've enabled. - --[[require('lspconfig')['clangd'].setup { - capabilities = capabilities - }--]] end, }, { @@ -255,28 +261,3 @@ require('lazy').setup({ } }) -vim.filetype.add({ - extension = { - vp = 'glsl', - fp = 'glsl', - gp = 'glsl', - vs = 'glsl', - fs = 'glsl', - gs = 'glsl', - tcs = 'glsl', - tes = 'glsl', - cs = 'glsl', - vert = 'glsl', - frag = 'glsl', - geom = 'glsl', - tess = 'glsl', - shd = 'glsl', - gls = 'glsl', - glsl = 'glsl', - rgen = 'glsl', - comp = 'glsl', - rchit = 'glsl', - rahit = 'glsl', - rmiss = 'glsl', - } -})