From f902b33d5992743ca675c2b7b3103255727a0d51 Mon Sep 17 00:00:00 2001 From: Montso Mokake <46648413+Montso@users.noreply.github.com> Date: Mon, 11 Aug 2025 20:34:45 +0200 Subject: [PATCH 1/3] Update .gitignore, removed lock-json --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index 005b535b606..8a192cab54d 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,3 @@ test.sh nvim spell/ -lazy-lock.json From 55c3b55c39527467b02176452b3ce549605a01e9 Mon Sep 17 00:00:00 2001 From: montso Date: Sun, 7 Sep 2025 13:12:50 +0200 Subject: [PATCH 2/3] enable custom plugins --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index b98ffc6198a..ed464d6ec9f 100644 --- a/init.lua +++ b/init.lua @@ -984,7 +984,7 @@ require('lazy').setup({ -- This is the easiest way to modularize your config. -- -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. - -- { import = 'custom.plugins' }, + { import = 'custom.plugins' }, -- -- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec` -- Or use telescope! From b0138d34ea6db7471713d25e4ab708445980a83b Mon Sep 17 00:00:00 2001 From: montso Date: Mon, 6 Jul 2026 15:48:41 +0200 Subject: [PATCH 3/3] custom configurations update --- init.lua | 55 ++++++++++++++++++++++++++++++++++++++++++++++---- lazy-lock.json | 24 ++++++++++++++++++++++ 2 files changed, 75 insertions(+), 4 deletions(-) create mode 100644 lazy-lock.json diff --git a/init.lua b/init.lua index ed464d6ec9f..4e347eaf341 100644 --- a/init.lua +++ b/init.lua @@ -91,7 +91,7 @@ vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' -- Set to true if you have a Nerd Font installed and selected in the terminal -vim.g.have_nerd_font = false +vim.g.have_nerd_font = true -- [[ Setting options ]] -- See `:help vim.o` @@ -175,7 +175,18 @@ vim.keymap.set('n', '', 'nohlsearch') -- Diagnostic keymaps vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) +local opts = { noremap = true, silent = true } +local function quickfix() + vim.lsp.buf.code_action { + filter = function(a) + return a.isPreferred + end, + apply = true, + } +end + +vim.keymap.set('n', 'qf', quickfix, opts) -- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier -- for people to discover. Otherwise, you normally need to press , which -- is not what someone will guess without a bit more experience. @@ -247,8 +258,10 @@ rtp:prepend(lazypath) -- NOTE: Here is where you install your plugins. require('lazy').setup({ -- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link). - 'NMAC427/guess-indent.nvim', -- Detect tabstop and shiftwidth automatically - + { + 'NMAC427/guess-indent.nvim', -- Detect tabstop and shiftwidth automatically + event = 'VimEnter', + }, -- NOTE: Plugins can also be added by using a table, -- with the first argument being the link and the following -- keys can be used to configure plugin behavior/loading/etc. @@ -670,8 +683,40 @@ require('lazy').setup({ -- - capabilities (table): Override fields in capabilities. Can be used to disable certain LSP features. -- - settings (table): Override the default settings passed when initializing the server. -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ + local util = require 'lspconfig.util' local servers = { - -- clangd = {}, + clangd = { + cmd = { + 'clangd', + '--background-index', -- Keep a persistent index for faster nav + '--clang-tidy', -- Enable static analysis + '--completion-style=detailed', -- Better completion info + '--header-insertion=never', -- Avoid unwanted #include insertions + '--function-arg-placeholders=0', -- Avoid intrusive placeholders + '--offset-encoding=utf-16', -- Match Neovim default (important) + }, + filetypes = { 'c', 'cpp', 'objc', 'objcpp' }, + root_dir = function(fname) + -- Common STM32 project roots: .clangd, Makefile, or CubeIDE files + return util.root_pattern('.clangd', 'compile_commands.json', 'Makefile', '.git')(fname) or vim.fs.dirname(fname) + end, + capabilities = vim.tbl_deep_extend('force', vim.lsp.protocol.make_client_capabilities(), { + offsetEncoding = { 'utf-16' }, + textDocument = { + completion = { + completionItem = { + snippetSupport = false, + }, + }, + }, + }), + on_init = function(client, result) + -- Safeguard against offset encoding mismatch + if result and result.offsetEncoding then + client.offset_encoding = result.offsetEncoding + end + end, + }, -- gopls = {}, -- pyright = {}, -- rust_analyzer = {}, @@ -1012,5 +1057,7 @@ require('lazy').setup({ }, }) +-- disable modeline +vim.opt.modeline = false -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 00000000000..d1c33ddea25 --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,24 @@ +{ + "LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" }, + "blink.cmp": { "branch": "main", "commit": "b19413d214068f316c78978b08264ed1c41830ec" }, + "conform.nvim": { "branch": "master", "commit": "5420c4b5ea0aeb99c09cfbd4fd0b70d257b44f25" }, + "fidget.nvim": { "branch": "main", "commit": "64463022a1f2ff1318ab22a2ea4125ed9313a483" }, + "gitsigns.nvim": { "branch": "main", "commit": "718e1eda17ebab87f686af5dcc7684b204041eef" }, + "guess-indent.nvim": { "branch": "main", "commit": "84a4987ff36798c2fc1169cbaff67960aed9776f" }, + "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, + "lazydev.nvim": { "branch": "main", "commit": "5231c62aa83c2f8dc8e7ba957aa77098cda1257d" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "9f9c67795d0795a6e8612f5a899ca64a074a1076" }, + "mason-tool-installer.nvim": { "branch": "main", "commit": "517ef5994ef9d6b738322664d5fdd948f0fdeb46" }, + "mason.nvim": { "branch": "main", "commit": "57e5a8addb8c71fb063ee4acda466c7cf6ad2800" }, + "mini.nvim": { "branch": "main", "commit": "7e55c3d2c04da134085a31156196836f80a89982" }, + "nvim-lspconfig": { "branch": "master", "commit": "d696e36d5792daf828f8c8e8d4b9aa90c1a10c2a" }, + "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, + "nvim-web-devicons": { "branch": "master", "commit": "6788013bb9cb784e606ada44206b0e755e4323d7" }, + "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" }, + "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, + "telescope.nvim": { "branch": "master", "commit": "4d0f5e0e7f69071e315515c385fab2a4eff07b3d" }, + "todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" }, + "tokyonight.nvim": { "branch": "main", "commit": "5da1b76e64daf4c5d410f06bcb6b9cb640da7dfd" }, + "which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" } +}