From 9bf7f623fdef83cb21313868395173f595249aa2 Mon Sep 17 00:00:00 2001 From: Flavien Perineau Date: Wed, 15 Apr 2026 09:30:00 +0200 Subject: [PATCH 01/14] start new config --- .gitignore | 7 +++ .stylua.toml | 6 +++ after/lsp/lua_ls.lua | 35 ++++++++++++ init.lua | 41 ++++++++++++++ nvim-pack-lock.json | 105 ++++++++++++++++++++++++++++++++++++ plugin/10_options.lua | 116 ++++++++++++++++++++++++++++++++++++++++ plugin/12_autogroup.lua | 9 ++++ plugin/20_keymap.lua | 20 +++++++ plugin/autopaire.lua | 13 +++++ plugin/colorschema.lua | 4 ++ plugin/comment.lua | 5 ++ plugin/completion.lua | 12 +++++ plugin/format.lua | 18 +++++++ plugin/fuzyfinder.lua | 18 +++++++ plugin/jump.lua | 4 ++ plugin/lsp.lua | 41 ++++++++++++++ plugin/notify.lua | 6 +++ plugin/oil.lua | 12 +++++ plugin/quickfix.lua | 4 ++ plugin/snippets.lua | 2 + plugin/statuline.lua | 7 +++ plugin/tree.lua | 21 ++++++++ plugin/treesiter.lua | 45 ++++++++++++++++ plugin/whichkey.lua | 10 ++++ 24 files changed, 561 insertions(+) create mode 100644 .gitignore create mode 100644 .stylua.toml create mode 100644 after/lsp/lua_ls.lua create mode 100644 init.lua create mode 100644 nvim-pack-lock.json create mode 100644 plugin/10_options.lua create mode 100644 plugin/12_autogroup.lua create mode 100644 plugin/20_keymap.lua create mode 100644 plugin/autopaire.lua create mode 100644 plugin/colorschema.lua create mode 100644 plugin/comment.lua create mode 100644 plugin/completion.lua create mode 100644 plugin/format.lua create mode 100644 plugin/fuzyfinder.lua create mode 100644 plugin/jump.lua create mode 100644 plugin/lsp.lua create mode 100644 plugin/notify.lua create mode 100644 plugin/oil.lua create mode 100644 plugin/quickfix.lua create mode 100644 plugin/snippets.lua create mode 100644 plugin/statuline.lua create mode 100644 plugin/tree.lua create mode 100644 plugin/treesiter.lua create mode 100644 plugin/whichkey.lua diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..005b535 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +tags +test.sh +.luarc.json +nvim + +spell/ +lazy-lock.json diff --git a/.stylua.toml b/.stylua.toml new file mode 100644 index 0000000..139e939 --- /dev/null +++ b/.stylua.toml @@ -0,0 +1,6 @@ +column_width = 160 +line_endings = "Unix" +indent_type = "Spaces" +indent_width = 2 +quote_style = "AutoPreferSingle" +call_parentheses = "None" diff --git a/after/lsp/lua_ls.lua b/after/lsp/lua_ls.lua new file mode 100644 index 0000000..08acbcd --- /dev/null +++ b/after/lsp/lua_ls.lua @@ -0,0 +1,35 @@ +-- ┌────────────────────┐ +-- │ LSP config example │ +-- └────────────────────┘ +-- +-- This file contains configuration of 'lua_ls' language server. +-- Source: https://github.com/LuaLS/lua-language-server +-- +-- It is used by `:h vim.lsp.enable()` and `:h vim.lsp.config()`. +-- See `:h vim.lsp.Config` and `:h vim.lsp.ClientConfig` for all available fields. +-- +-- This config is designed for Lua's activity around Neovim. It provides only +-- basic config and can be further improved. +return { + on_attach = function(client, buf_id) + -- Reduce very long list of triggers for better 'mini.completion' experience + client.server_capabilities.completionProvider.triggerCharacters = + { '.', ':', '#', '(' } + + -- Use this function to define buffer-local mappings and behavior that depend + -- on attached client or only makes sense if there is language server attached. + end, + -- LuaLS Structure of these settings comes from LuaLS, not Neovim + settings = { + Lua = { + -- Define runtime properties. Use 'LuaJIT', as it is built into Neovim. + runtime = { version = 'LuaJIT', path = vim.split(package.path, ';') }, + workspace = { + -- Don't analyze code from submodules + ignoreSubmodules = true, + -- Add Neovim's methods for easier code writing + library = { vim.env.VIMRUNTIME }, + }, + }, + }, +} diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..2f0a228 --- /dev/null +++ b/init.lua @@ -0,0 +1,41 @@ +_G.Config = {} + +vim.loader.enable(true) +require('vim._core.ui2').enable({}) + +vim.pack.add({"https://github.com/nvim-mini/mini.misc"}) +local misc = require("mini.misc") +Config.now = function(f) misc.safely("now", f) end +Config.later = function(f) misc.safely("later", f) end +Config.now_if_args = vim.fn.argc(-1) > 0 and Config.now or Config.later +Config.on_event = function(ev, f) misc.safely("event:" .. ev, f) end +Config.on_filetype = function(ft, f) misc.safely("filetype:" .. ft, f) end + +-- Define custom autocommand group and helper to create an autocommand. +-- Autocommands are Neovim"s way to define actions that are executed on events +-- (like creating a buffer, setting an option, etc.). +-- +-- See also: +-- - `:h autocommand` +-- - `:h nvim_create_augroup()` +-- - `:h nvim_create_autocmd()` +local gr = vim.api.nvim_create_augroup("custom-config", {}) +Config.new_autocmd = function(event, pattern, callback, desc) + local opts = { group = gr, pattern = pattern, callback = callback, desc = desc } + vim.api.nvim_create_autocmd(event, opts) +end + +-- Define custom `vim.pack.add()` hook helper. Plugin data is passed as +-- argument to the callback. See `:h vim.pack-events`. +-- Example usage: see "plugin/40_plugins.lua". +Config.on_packchanged = function(plugin_name, kinds, callback, desc) + local f = function(ev) + local name, kind = ev.data.spec.name, ev.data.kind + if not (name == plugin_name and vim.tbl_contains(kinds, kind)) then return end + if not ev.data.active then vim.cmd.packadd(plugin_name) end + callback(ev.data) + end + Config.new_autocmd("PackChanged", "*", f, desc) +end + + diff --git a/nvim-pack-lock.json b/nvim-pack-lock.json new file mode 100644 index 0000000..b0c98c6 --- /dev/null +++ b/nvim-pack-lock.json @@ -0,0 +1,105 @@ +{ + "plugins": { + "blink.cmp": { + "rev": "78336bc89ee5365633bcf754d93df01678b5c08f", + "src": "https://github.com/saghen/blink.cmp", + "version": "'v1'" + }, + "conform.nvim": { + "rev": "086a40dc7ed8242c03be9f47fbcee68699cc2395", + "src": "https://github.com/stevearc/conform.nvim" + }, + "fidget.nvim": { + "rev": "889e2e96edef4e144965571d46f7a77bcc4d0ddf", + "src": "https://github.com/j-hui/fidget.nvim" + }, + "friendly-snippets": { + "rev": "6cd7280adead7f586db6fccbd15d2cac7e2188b9", + "src": "https://github.com/rafamadriz/friendly-snippets" + }, + "lualine.nvim": { + "rev": "a905eeebc4e63fdc48b5135d3bf8aea5618fb21c", + "src": "https://github.com/nvim-lualine/lualine.nvim" + }, + "mason-lspconfig.nvim": { + "rev": "0a3b42c3e503df87aef6d6513e13148381495c3a", + "src": "https://github.com/mason-org/mason-lspconfig.nvim" + }, + "mason.nvim": { + "rev": "b03fb0f20bc1d43daf558cda981a2be22e73ac42", + "src": "https://github.com/mason-org/mason.nvim" + }, + "mini.comment": { + "rev": "8e5ff3ed3cc0e8f216617aae01020c00c20f7a87", + "src": "https://github.com/nvim-mini/mini.comment" + }, + "mini.jump": { + "rev": "9e94f41a3ebcd5f5771d36fdedb18fde9d28da76", + "src": "https://github.com/nvim-mini/mini.jump" + }, + "mini.misc": { + "rev": "c72c90e083bcf24bfb2827d63b4752e414023f3e", + "src": "https://github.com/nvim-mini/mini.misc" + }, + "mini.pairs": { + "rev": "42387c7fe68fc0b6e95eaf37f1bb76e7bffaa0d9", + "src": "https://github.com/nvim-mini/mini.pairs" + }, + "nvim-lsp-notify": { + "rev": "9541bdde0b84b7a33a24dbc2eccc3df33d4a0cdb", + "src": "https://github.com/mrded/nvim-lsp-notify" + }, + "nvim-lspconfig": { + "rev": "d10ce09e42bb0ca8600fd610c3bb58676e61208d", + "src": "https://github.com/neovim/nvim-lspconfig" + }, + "nvim-notify": { + "rev": "8701bece920b38ea289b457f902e2ad184131a5d", + "src": "https://github.com/rcarriga/nvim-notify" + }, + "nvim-tree.lua": { + "rev": "509962f21ab7289d8dcd28568af539be39a8c01e", + "src": "https://github.com/nvim-tree/nvim-tree.lua" + }, + "nvim-treesitter": { + "rev": "4916d6592ede8c07973490d9322f187e07dfefac", + "src": "https://github.com/nvim-treesitter/nvim-treesitter" + }, + "nvim-treesitter-textobjects": { + "rev": "851e865342e5a4cb1ae23d31caf6e991e1c99f1e", + "src": "https://github.com/nvim-treesitter/nvim-treesitter-textobjects" + }, + "nvim-web-devicons": { + "rev": "c72328a5494b4502947a022fe69c0c47e53b6aa6", + "src": "https://github.com/nvim-tree/nvim-web-devicons" + }, + "oil.nvim": { + "rev": "0fcc83805ad11cf714a949c98c605ed717e0b83e", + "src": "https://github.com/stevearc/oil.nvim" + }, + "plenary.nvim": { + "rev": "74b06c6c75e4eeb3108ec01852001636d85a932b", + "src": "https://github.com/nvim-lua/plenary.nvim" + }, + "quicker.nvim": { + "rev": "063cc44da1eef8681bbd653b29d3bc961780886a", + "src": "https://github.com/stevearc/quicker.nvim" + }, + "snacks.nvim": { + "rev": "ad9ede6a9cddf16cedbd31b8932d6dcdee9b716e", + "src": "https://github.com/folke/snacks.nvim" + }, + "telescope.nvim": { + "rev": "471eebb1037899fd942cc0f52c012f8773505da1", + "src": "https://github.com/nvim-telescope/telescope.nvim" + }, + "tokyonight.nvim": { + "rev": "cdc07ac78467a233fd62c493de29a17e0cf2b2b6", + "src": "https://github.com/folke/tokyonight.nvim" + }, + "which-key.nvim": { + "rev": "3aab2147e74890957785941f0c1ad87d0a44c15a", + "src": "https://github.com/folke/which-key.nvim.git" + } + } +} diff --git a/plugin/10_options.lua b/plugin/10_options.lua new file mode 100644 index 0000000..29feb52 --- /dev/null +++ b/plugin/10_options.lua @@ -0,0 +1,116 @@ +vim.g.loaded_netrw = 1 +vim.g.loaded_netrwPlugin = 1 + +-- General ==================================================================== +vim.g.mapleader = ' ' -- Use `` as key + +vim.o.mouse = 'a' -- Enable mouse +-- vim.o.mousescroll = 'ver:25,hor:6' -- Customize mouse scroll +vim.o.switchbuf = 'usetab' -- Use already opened buffers when switching +vim.o.undofile = true -- Enable persistent undo + +vim.o.shada = "'100,<50,s10,:1000,/100,@100,h" -- Limit ShaDa file (for startup) + +-- Enable all filetype plugins and syntax (if not enabled, for better startup) +vim.cmd('filetype plugin indent on') +if vim.fn.exists('syntax_on') ~= 1 then vim.cmd('syntax enable') end + +-- UI ========================================================================= +vim.o.breakindent = true -- Indent wrapped lines to match line start +vim.o.breakindentopt = 'list:-1' -- Add padding for lists (if 'wrap' is set) +-- vim.o.colorcolumn = '+1' -- Draw column on the right of maximum width +vim.o.cursorline = true -- Enable current line highlighting +vim.o.linebreak = true -- Wrap lines at 'breakat' (if 'wrap' is set) +vim.o.list = true -- Show helpful text indicators +vim.o.number = true -- Show line numbers +vim.o.relativenumber = true -- Show relative line numbers +vim.o.pumborder = 'single' -- Use border in popup menu +vim.o.pumheight = 10 -- Make popup menu smaller +vim.o.pummaxwidth = 100 -- Make popup menu not too wide +vim.o.ruler = false -- Don't show cursor coordinates +vim.o.shortmess = 'CFOSWaco' -- Disable some built-in completion messages +vim.o.showmode = false -- Don't show mode in command line +vim.o.signcolumn = 'yes' -- Always show signcolumn (less flicker) +vim.o.splitbelow = true -- Horizontal splits will be below +vim.o.splitkeep = 'screen' -- Reduce scroll during window split +vim.o.splitright = true -- Vertical splits will be to the right +vim.o.winborder = 'single' -- Use border in floating windows +vim.o.wrap = true -- Don't visually wrap lines (toggle with \w) +vim.o.confirm = true -- confirm on exit +vim.o.termguicolors = true -- true color +vim.g.diffopt = "vertical," .. vim.o.diffopt -- split vertical for vim diff +vim.go.inccommand = "split" -- show preview of search + +vim.o.cursorlineopt = 'screenline,number' -- Show cursor line per screen line + +-- Special UI symbols. More is set via 'mini.basics' later. +vim.o.fillchars = 'eob: ,fold:╌' +vim.o.listchars = 'extends:…,nbsp:␣,precedes:…,tab:> ' + +-- Folds (see `:h fold-commands`, `:h zM`, `:h zR`, `:h zA`, `:h zj`) +vim.o.foldlevel = 10 -- Fold nothing by default; set to 0 or 1 to fold +vim.o.foldmethod = 'indent' -- Fold based on indent level +vim.o.foldnestmax = 10 -- Limit number of fold levels +vim.o.foldtext = '' -- Show text under fold with its highlighting + +-- Editing ==================================================================== +vim.o.autoindent = true -- Use auto indent +vim.o.expandtab = true -- Convert tabs to spaces +vim.o.formatoptions = 'rqnl1j'-- Improve comment editing +vim.o.ignorecase = true -- Ignore case during search +vim.o.incsearch = true -- Show search matches while typing +vim.o.infercase = true -- Infer case in built-in completion +vim.o.shiftwidth = 2 -- Use this number of spaces for indentation +vim.o.smartcase = true -- Respect case if search pattern has upper case +vim.o.smartindent = true -- Make indenting smart +vim.o.spelloptions = 'camel' -- Treat camelCase word parts as separate words +vim.o.tabstop = 4 -- Show tab as this number of spaces +vim.o.virtualedit = 'block' -- Allow going past end of line in blockwise mode + +vim.o.iskeyword = '@,48-57,_,192-255,-' -- Treat dash as `word` textobject part + +-- Pattern for a start of numbered list (used in `gw`). This reads as +-- "Start of list item is: at least one special character (digit, -, +, *) +-- possibly followed by punctuation (. or `)`) followed by at least one space". +vim.o.formatlistpat = [[^\s*[0-9\-\+\*]\+[\.\)]*\s\+]] + +-- Built-in completion +vim.o.complete = '.,w,b,kspell' -- Use less sources +vim.o.completeopt = 'menuone,noselect,fuzzy,nosort' -- Use custom behavior +vim.o.completetimeout = 100 -- Limit sources delay + +-- Autocommands =============================================================== + +-- Don't auto-wrap comments and don't insert comment leader after hitting 'o'. +-- Do on `FileType` to always override these changes from filetype plugins. +local f = function() vim.cmd('setlocal formatoptions-=c formatoptions-=o') end +Config.new_autocmd('FileType', nil, f, "Proper 'formatoptions'") + +-- There are other autocommands created by 'mini.basics'. See 'plugin/30_mini.lua'. + +-- Diagnostics ================================================================ + +-- Neovim has built-in support for showing diagnostic messages. This configures +-- a more conservative display while still being useful. +-- See `:h vim.diagnostic` and `:h vim.diagnostic.config()`. +local diagnostic_opts = { + -- Show signs on top of any other sign, but only for warnings and errors + signs = { priority = 9999, severity = { min = 'WARN', max = 'ERROR' } }, + + -- Show all diagnostics as underline (for their messages type `ld`) + underline = { severity = { min = 'HINT', max = 'ERROR' } }, + + -- Show more details immediately for errors on the current line + virtual_lines = false, + virtual_text = { + current_line = true, + severity = { min = 'ERROR', max = 'ERROR' }, + }, + + -- Don't update diagnostics when typing + update_in_insert = false, +} + +-- Use `later()` to avoid sourcing `vim.diagnostic` on startup +Config.later(function() vim.diagnostic.config(diagnostic_opts) end) +-- stylua: ignore end diff --git a/plugin/12_autogroup.lua b/plugin/12_autogroup.lua new file mode 100644 index 0000000..5949dfd --- /dev/null +++ b/plugin/12_autogroup.lua @@ -0,0 +1,9 @@ +vim.api.nvim_create_autocmd('TextYankPost', { + group = vim.api.nvim_create_augroup('highlight_yank', {}), + desc = 'Hightlight selection on yank', + pattern = '*', + callback = function() + vim.highlight.on_yank { higroup = 'IncSearch', timeout = 500 } + end, +}) + diff --git a/plugin/20_keymap.lua b/plugin/20_keymap.lua new file mode 100644 index 0000000..4b4534c --- /dev/null +++ b/plugin/20_keymap.lua @@ -0,0 +1,20 @@ +-- ┌─────────────────┐ +-- │ Custom mappings │ +-- └─────────────────┘ +-- +-- This file contains definitions of custom general and Leader mappings. + +-- General mappings =========================================================== + +-- Use this section to add custom general mappings. See `:h vim.keymap.set()`. + +-- An example helper to create a Normal mode mapping +local nmap = function(lhs, rhs, desc) + -- See `:h vim.keymap.set()` + vim.keymap.set('n', lhs, rhs, { desc = desc ,silent=true}) +end + +nmap("", "nohl","disable higlight") +vim.keymap.set('v', ">", ">gv", {silent=true}) +vim.keymap.set('v', "<", "e",vim.diagnostic.open_float,"Line Diagnostic") diff --git a/plugin/autopaire.lua b/plugin/autopaire.lua new file mode 100644 index 0000000..3a64a02 --- /dev/null +++ b/plugin/autopaire.lua @@ -0,0 +1,13 @@ +-- Autopairs functionality. Insert pair when typing opening character and go over +-- right character if it is already to cursor's right. Also provides mappings for +-- `` and `` to perform extra actions when inside pair. +-- Example usage in Insert mode: +-- - `(` - insert "()" and put cursor between them +-- - `)` when there is ")" to the right - jump over ")" without inserting new one +-- - `(` - always insert a single "(" literally. This is useful since +-- 'mini.pairs' doesn't provide particularly smart behavior, like auto balancing +Config.later(function() + vim.pack.add({"https://github.com/nvim-mini/mini.pairs"}) + -- Create pairs not only in Insert, but also in Command line mode + require('mini.pairs').setup({ modes = { command = true } }) +end) diff --git a/plugin/colorschema.lua b/plugin/colorschema.lua new file mode 100644 index 0000000..7e84ec9 --- /dev/null +++ b/plugin/colorschema.lua @@ -0,0 +1,4 @@ +Config.now(function() + vim.pack.add({"https://github.com/folke/tokyonight.nvim"}) + vim.cmd[[colorscheme tokyonight]] +end) diff --git a/plugin/comment.lua b/plugin/comment.lua new file mode 100644 index 0000000..3b4c421 --- /dev/null +++ b/plugin/comment.lua @@ -0,0 +1,5 @@ +Config.later(function() + vim.pack.add({"https://github.com/nvim-mini/mini.comment"}) + require('mini.comment').setup() +end) + diff --git a/plugin/completion.lua b/plugin/completion.lua new file mode 100644 index 0000000..bcfb159 --- /dev/null +++ b/plugin/completion.lua @@ -0,0 +1,12 @@ +Config.now_if_args(function() + vim.pack.add({{src="https://github.com/saghen/blink.cmp",version="v1"},"https://github.com/rafamadriz/friendly-snippets"}) + require("blink.cmp").setup({ + completion={ + documentation={ + auto_show=true, + auto_show_delay_ms=500, + } + }, + signature = { enabled = true } + }) +end) diff --git a/plugin/format.lua b/plugin/format.lua new file mode 100644 index 0000000..642b4fb --- /dev/null +++ b/plugin/format.lua @@ -0,0 +1,18 @@ + +Config.later(function() + vim.pack.add({ "https://github.com/stevearc/conform.nvim" }) + + -- See also: + -- - `:h Conform` + -- - `:h conform-options` + -- - `:h conform-formatters` + require("conform").setup({ + default_format_opts = { + -- Allow formatting from LSP server if no dedicated formatter is available + lsp_format = "fallback", + }, + -- Map of filetype to formatters + -- Make sure that necessary CLI tool is available + formatters_by_ft = { lua = { "stylua" } }, + }) +end) diff --git a/plugin/fuzyfinder.lua b/plugin/fuzyfinder.lua new file mode 100644 index 0000000..ae95401 --- /dev/null +++ b/plugin/fuzyfinder.lua @@ -0,0 +1,18 @@ +Config.later(function () + vim.pack.add({ + "https://github.com/nvim-telescope/telescope.nvim", + "https://github.com/nvim-lua/plenary.nvim", + }) + local builtin = require('telescope.builtin') + + vim.keymap.set('n', 'ff', builtin.find_files, { desc = 'Telescope find files' }) + vim.keymap.set('n', '', builtin.find_files, { desc = 'Telescope find files' }) + vim.keymap.set('n', 'fg', builtin.live_grep, { desc = 'Telescope live grep' }) + vim.keymap.set('n', 'fb', builtin.buffers, { desc = 'Telescope buffers' }) + vim.keymap.set('n', 'fh', builtin.help_tags, { desc = 'Telescope help tags' }) + vim.lsp.buf.references = builtin.lsp_references + vim.lsp.buf.implementation = builtin.lsp_implementations + vim.lsp.buf.definition = builtin.lsp_definitions + vim.lsp.buf.type_definition = builtin.lsp_type_definitions + +end) diff --git a/plugin/jump.lua b/plugin/jump.lua new file mode 100644 index 0000000..0308ae2 --- /dev/null +++ b/plugin/jump.lua @@ -0,0 +1,4 @@ +Config.later(function() + vim.pack.add({"https://github.com/nvim-mini/mini.jump"}) + require('mini.jump').setup() +end) diff --git a/plugin/lsp.lua b/plugin/lsp.lua new file mode 100644 index 0000000..88dcaf5 --- /dev/null +++ b/plugin/lsp.lua @@ -0,0 +1,41 @@ +local nmap = function(lhs, rhs, desc) + -- See `:h vim.keymap.set()` + vim.keymap.set('n', lhs, rhs, { desc = desc }) +end + +Config.now_if_args(function() + vim.pack.add({ 'https://github.com/neovim/nvim-lspconfig' }) + + -- Use `:h vim.lsp.enable()` to automatically enable language server based on + -- the rules provided by 'nvim-lspconfig'. + -- Use `:h vim.lsp.config()` or 'after/lsp/' directory to configure servers. + -- Uncomment and tweak the following `vim.lsp.enable()` call to enable servers. + -- vim.lsp.enable({ + -- -- For example, if `lua-language-server` is installed, use `'lua_ls'` entry + -- }) + Config.on_event("LspAttach",function () + nmap("ca",vim.lsp.buf.code_action,"code action") + nmap("gd",vim.lsp.buf.definition,"Goto Definition") + nmap("gr",vim.lsp.buf.references,"Goto References") + nmap("gI",vim.lsp.buf.implementation,"Goto Implementation") + nmap("gy",vim.lsp.buf.type_definition,"Goto T[y]pe Definition") + nmap("gD",vim.lsp.buf.declaration,"Goto Declaration") + end) + +end) + +-- 'mason-org/mason.nvim' (a.k.a. "Mason") is a great tool (package manager) for +-- installing external language servers, formatters, and linters. It provides +-- a unified interface for installing, updating, and deleting such programs. +-- +-- The caveat is that these programs will be set up to be mostly used inside Neovim. +-- If you need them to work elsewhere, consider using other package managers. +-- +-- You can use it like so: +Config.now_if_args(function() + vim.pack.add({ 'https://github.com/mason-org/mason.nvim',"https://github.com/mason-org/mason-lspconfig.nvim", "https://github.com/j-hui/fidget.nvim" }) + require('mason').setup() + require("mason-lspconfig").setup() + require("fidget").setup{} +end) + diff --git a/plugin/notify.lua b/plugin/notify.lua new file mode 100644 index 0000000..fd777eb --- /dev/null +++ b/plugin/notify.lua @@ -0,0 +1,6 @@ +Config.later(function() + vim.pack.add({"https://github.com/rcarriga/nvim-notify"}) + require("notify").setup() + vim.notify = require("notify") +end) + diff --git a/plugin/oil.lua b/plugin/oil.lua new file mode 100644 index 0000000..aa56212 --- /dev/null +++ b/plugin/oil.lua @@ -0,0 +1,12 @@ +Config.now_if_args(function () + vim.pack.add({"https://github.com/folke/snacks.nvim","https://github.com/stevearc/oil.nvim"}) + require("oil").setup() + vim.api.nvim_create_autocmd("User", { + pattern = "OilActionsPost", + callback = function(event) + if event.data.actions[1].type == "move" then + require("snacks").rename.on_rename_file(event.data.actions[1].src_url, event.data.actions[1].dest_url) + end + end, + }) +end) diff --git a/plugin/quickfix.lua b/plugin/quickfix.lua new file mode 100644 index 0000000..53843ec --- /dev/null +++ b/plugin/quickfix.lua @@ -0,0 +1,4 @@ +Config.later(function () + vim.pack.add({"https://github.com/stevearc/quicker.nvim"}) + require("quicker").setup({}) +end) diff --git a/plugin/snippets.lua b/plugin/snippets.lua new file mode 100644 index 0000000..2e45086 --- /dev/null +++ b/plugin/snippets.lua @@ -0,0 +1,2 @@ + +Config.later(function() vim.pack.add({ 'https://github.com/rafamadriz/friendly-snippets' }) end) diff --git a/plugin/statuline.lua b/plugin/statuline.lua new file mode 100644 index 0000000..68522db --- /dev/null +++ b/plugin/statuline.lua @@ -0,0 +1,7 @@ +Config.now(function () + vim.pack.add({ + 'https://github.com/nvim-tree/nvim-web-devicons', + 'https://github.com/nvim-lualine/lualine.nvim' + }) + require('lualine').setup() +end) diff --git a/plugin/tree.lua b/plugin/tree.lua new file mode 100644 index 0000000..2c24f12 --- /dev/null +++ b/plugin/tree.lua @@ -0,0 +1,21 @@ +Config.later(function () + vim.pack.add({"https://github.com/nvim-tree/nvim-tree.lua","https://github.com/folke/snacks.nvim"}) + + require("nvim-tree").setup() + + vim.keymap.set("n","\\","NvimTreeOpen",{silent=true}) + + local prev = { new_name = "", old_name = "" } -- Prevents duplicate events + vim.api.nvim_create_autocmd("User", { + pattern = "NvimTreeSetup", + callback = function() + local events = require("nvim-tree.api").events + events.subscribe(events.Event.NodeRenamed, function(data) + if prev.new_name ~= data.new_name or prev.old_name ~= data.old_name then + data = data + require("snacks").rename.on_rename_file(data.old_name, data.new_name) + end + end) + end, + }) +end) diff --git a/plugin/treesiter.lua b/plugin/treesiter.lua new file mode 100644 index 0000000..6df46ec --- /dev/null +++ b/plugin/treesiter.lua @@ -0,0 +1,45 @@ +Config.now_if_args(function() + -- Define hook to update tree-sitter parsers after plugin is updated + local ts_update = function() vim.cmd('TSUpdate') end + Config.on_packchanged('nvim-treesitter', { 'update' }, ts_update, ':TSUpdate') + + vim.pack.add({ + 'https://github.com/nvim-treesitter/nvim-treesitter', + 'https://github.com/nvim-treesitter/nvim-treesitter-textobjects', + }) + + -- Define languages which will have parsers installed and auto enabled + -- After changing this, restart Neovim once to install necessary parsers. Wait + -- for the installation to finish before opening a file for added language(s). + local languages = { + -- These are already pre-installed with Neovim. Used as an example. + 'lua', + 'vimdoc', + 'markdown', + -- Add here more languages with which you want to use tree-sitter + -- To see available languages: + -- - Execute `:=require('nvim-treesitter').get_available()` + -- - Visit 'SUPPORTED_LANGUAGES.md' file at + -- https://github.com/nvim-treesitter/nvim-treesitter/blob/main + } + local isnt_installed = function(lang) + return #vim.api.nvim_get_runtime_file('parser/' .. lang .. '.*', false) == 0 + end + local to_install = vim.tbl_filter(isnt_installed, languages) + if #to_install > 0 then require('nvim-treesitter').install(to_install) end + + -- Enable tree-sitter after opening a file for a target language + local filetypes = {} + for _, lang in ipairs(languages) do + for _, ft in ipairs(vim.treesitter.language.get_filetypes(lang)) do + table.insert(filetypes, ft) + end + end + local ts_start = function(ev) + vim.treesitter.start(ev.buf) + vim.wo[0][0].foldexpr = 'v:lua.vim.treesitter.foldexpr()' + vim.wo[0][0].foldmethod = 'expr' + vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" + end + Config.new_autocmd('FileType', filetypes, ts_start, 'Start tree-sitter') +end) diff --git a/plugin/whichkey.lua b/plugin/whichkey.lua new file mode 100644 index 0000000..6f93e04 --- /dev/null +++ b/plugin/whichkey.lua @@ -0,0 +1,10 @@ +Config.later(function () + vim.pack.add({"https://github.com/folke/which-key.nvim.git"}) + local wk = require("which-key") + wk.setup({}) + wk.add({ + {"f",group="+file"}, + {"g",group="+git"}, + {"c",group="+code"}, + }) +end) From 22ab36e3dd37e0a4afa9bc90381d5d995d4afe26 Mon Sep 17 00:00:00 2001 From: Test User Date: Wed, 15 Apr 2026 15:37:30 +0200 Subject: [PATCH 02/14] group empty --- plugin/tree.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugin/tree.lua b/plugin/tree.lua index 2c24f12..d5c616a 100644 --- a/plugin/tree.lua +++ b/plugin/tree.lua @@ -1,7 +1,11 @@ Config.later(function () vim.pack.add({"https://github.com/nvim-tree/nvim-tree.lua","https://github.com/folke/snacks.nvim"}) - require("nvim-tree").setup() + require("nvim-tree").setup({ + renderer={ + group_empty=true + } + }) vim.keymap.set("n","\\","NvimTreeOpen",{silent=true}) From 2703796457bffb0639361e33c9d399d33f9e2a66 Mon Sep 17 00:00:00 2001 From: Test User Date: Wed, 15 Apr 2026 15:44:40 +0200 Subject: [PATCH 03/14] change telescope path --- plugin/fuzyfinder.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugin/fuzyfinder.lua b/plugin/fuzyfinder.lua index ae95401..2272464 100644 --- a/plugin/fuzyfinder.lua +++ b/plugin/fuzyfinder.lua @@ -3,6 +3,11 @@ Config.later(function () "https://github.com/nvim-telescope/telescope.nvim", "https://github.com/nvim-lua/plenary.nvim", }) + require('telescope').setup{ + defaults = { + path_display={"smart"} + } + } local builtin = require('telescope.builtin') vim.keymap.set('n', 'ff', builtin.find_files, { desc = 'Telescope find files' }) From cf779897d300240059a3095810602d99b63248e6 Mon Sep 17 00:00:00 2001 From: Flavien Perineau Date: Wed, 15 Apr 2026 16:02:31 +0200 Subject: [PATCH 04/14] add rename mapping --- plugin/lsp.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/lsp.lua b/plugin/lsp.lua index 88dcaf5..84a4a03 100644 --- a/plugin/lsp.lua +++ b/plugin/lsp.lua @@ -15,6 +15,7 @@ Config.now_if_args(function() -- }) Config.on_event("LspAttach",function () nmap("ca",vim.lsp.buf.code_action,"code action") + nmap("cr",vim.lsp.buf.rename,"code rename") nmap("gd",vim.lsp.buf.definition,"Goto Definition") nmap("gr",vim.lsp.buf.references,"Goto References") nmap("gI",vim.lsp.buf.implementation,"Goto Implementation") @@ -38,4 +39,3 @@ Config.now_if_args(function() require("mason-lspconfig").setup() require("fidget").setup{} end) - From d8cb15074d08802865bb6d072e131a78d9504898 Mon Sep 17 00:00:00 2001 From: Flavien Perineau Date: Wed, 15 Apr 2026 16:24:10 +0200 Subject: [PATCH 05/14] correct treesiter syntax --- plugin/treesiter.lua | 69 ++++++++++++++++++-------------------------- 1 file changed, 28 insertions(+), 41 deletions(-) diff --git a/plugin/treesiter.lua b/plugin/treesiter.lua index 6df46ec..d36cd76 100644 --- a/plugin/treesiter.lua +++ b/plugin/treesiter.lua @@ -1,45 +1,32 @@ Config.now_if_args(function() - -- Define hook to update tree-sitter parsers after plugin is updated - local ts_update = function() vim.cmd('TSUpdate') end - Config.on_packchanged('nvim-treesitter', { 'update' }, ts_update, ':TSUpdate') + -- Define hook to update tree-sitter parsers after plugin is updated + local ts_update = function() vim.cmd('TSUpdate') end + Config.on_packchanged('nvim-treesitter', { 'update' }, ts_update, ':TSUpdate') - vim.pack.add({ - 'https://github.com/nvim-treesitter/nvim-treesitter', - 'https://github.com/nvim-treesitter/nvim-treesitter-textobjects', - }) + vim.pack.add({ + 'https://github.com/nvim-treesitter/nvim-treesitter', + 'https://github.com/nvim-treesitter/nvim-treesitter-textobjects', + }) - -- Define languages which will have parsers installed and auto enabled - -- After changing this, restart Neovim once to install necessary parsers. Wait - -- for the installation to finish before opening a file for added language(s). - local languages = { - -- These are already pre-installed with Neovim. Used as an example. - 'lua', - 'vimdoc', - 'markdown', - -- Add here more languages with which you want to use tree-sitter - -- To see available languages: - -- - Execute `:=require('nvim-treesitter').get_available()` - -- - Visit 'SUPPORTED_LANGUAGES.md' file at - -- https://github.com/nvim-treesitter/nvim-treesitter/blob/main - } - local isnt_installed = function(lang) - return #vim.api.nvim_get_runtime_file('parser/' .. lang .. '.*', false) == 0 - end - local to_install = vim.tbl_filter(isnt_installed, languages) - if #to_install > 0 then require('nvim-treesitter').install(to_install) end + vim.api.nvim_create_autocmd('FileType', { + callback = function(ev) + local lang = vim.treesitter.language.get_lang(ev.match) + local available_langs = require('nvim-treesitter').get_available() + local is_available = vim.tbl_contains(available_langs, lang) + if is_available then + local installed_langs = require('nvim-treesitter').get_installed() + local installed = vim.tbl_contains(installed_langs, lang) + if not installed then + require('nvim-treesitter').install(lang):wait() + end + vim.treesitter.start(ev.buf) + -- require('nvim-treesitter').indentexpr() + -- require('nvim-treesitter').foldexpr() + vim.wo[0][0].foldexpr = 'v:lua.vim.treesitter.foldexpr()' + vim.wo[0][0].foldmethod = 'expr' + vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" + end + end, + }) - -- Enable tree-sitter after opening a file for a target language - local filetypes = {} - for _, lang in ipairs(languages) do - for _, ft in ipairs(vim.treesitter.language.get_filetypes(lang)) do - table.insert(filetypes, ft) - end - end - local ts_start = function(ev) - vim.treesitter.start(ev.buf) - vim.wo[0][0].foldexpr = 'v:lua.vim.treesitter.foldexpr()' - vim.wo[0][0].foldmethod = 'expr' - vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" - end - Config.new_autocmd('FileType', filetypes, ts_start, 'Start tree-sitter') -end) +end) \ No newline at end of file From bef65f10ede86eb65ca6778b481ac0fb382b4263 Mon Sep 17 00:00:00 2001 From: Flavien Perineau Date: Wed, 15 Apr 2026 16:25:58 +0200 Subject: [PATCH 06/14] correct coloscheme --- nvim-pack-lock.json | 4 ---- plugin/colorschema.lua | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/nvim-pack-lock.json b/nvim-pack-lock.json index b0c98c6..ce6080b 100644 --- a/nvim-pack-lock.json +++ b/nvim-pack-lock.json @@ -45,10 +45,6 @@ "rev": "42387c7fe68fc0b6e95eaf37f1bb76e7bffaa0d9", "src": "https://github.com/nvim-mini/mini.pairs" }, - "nvim-lsp-notify": { - "rev": "9541bdde0b84b7a33a24dbc2eccc3df33d4a0cdb", - "src": "https://github.com/mrded/nvim-lsp-notify" - }, "nvim-lspconfig": { "rev": "d10ce09e42bb0ca8600fd610c3bb58676e61208d", "src": "https://github.com/neovim/nvim-lspconfig" diff --git a/plugin/colorschema.lua b/plugin/colorschema.lua index 7e84ec9..84c581c 100644 --- a/plugin/colorschema.lua +++ b/plugin/colorschema.lua @@ -1,4 +1,4 @@ Config.now(function() vim.pack.add({"https://github.com/folke/tokyonight.nvim"}) - vim.cmd[[colorscheme tokyonight]] -end) + vim.cmd[[colorscheme tokyonight-night]] +end) \ No newline at end of file From be37a3fbf284c0d391db7096f0f4b50967d87f1f Mon Sep 17 00:00:00 2001 From: Flavien Perineau Date: Thu, 16 Apr 2026 09:53:34 +0200 Subject: [PATCH 07/14] add format on save --- plugin/format.lua | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/plugin/format.lua b/plugin/format.lua index 642b4fb..507ec21 100644 --- a/plugin/format.lua +++ b/plugin/format.lua @@ -1,18 +1,21 @@ - Config.later(function() - vim.pack.add({ "https://github.com/stevearc/conform.nvim" }) + vim.pack.add { 'https://github.com/stevearc/conform.nvim' } -- See also: -- - `:h Conform` -- - `:h conform-options` -- - `:h conform-formatters` - require("conform").setup({ + require('conform').setup { default_format_opts = { -- Allow formatting from LSP server if no dedicated formatter is available - lsp_format = "fallback", + lsp_format = 'fallback', + }, + format_on_save = { + timeout_ms = 1000, + lsp_format = 'fallback', }, -- Map of filetype to formatters -- Make sure that necessary CLI tool is available - formatters_by_ft = { lua = { "stylua" } }, - }) + formatters_by_ft = { lua = { 'stylua' } }, + } end) From c531eb9517f975fc6aafab2750b1cf425fa48937 Mon Sep 17 00:00:00 2001 From: Flavien Perineau Date: Thu, 16 Apr 2026 10:04:29 +0200 Subject: [PATCH 08/14] add gitsigns --- nvim-pack-lock.json | 4 ++++ plugin/git.lua | 53 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 plugin/git.lua diff --git a/nvim-pack-lock.json b/nvim-pack-lock.json index ce6080b..b354511 100644 --- a/nvim-pack-lock.json +++ b/nvim-pack-lock.json @@ -17,6 +17,10 @@ "rev": "6cd7280adead7f586db6fccbd15d2cac7e2188b9", "src": "https://github.com/rafamadriz/friendly-snippets" }, + "gitsigns.nvim": { + "rev": "8d82c240f190fc33723d48c308ccc1ed8baad69d", + "src": "https://github.com/lewis6991/gitsigns.nvim" + }, "lualine.nvim": { "rev": "a905eeebc4e63fdc48b5135d3bf8aea5618fb21c", "src": "https://github.com/nvim-lualine/lualine.nvim" diff --git a/plugin/git.lua b/plugin/git.lua new file mode 100644 index 0000000..02513da --- /dev/null +++ b/plugin/git.lua @@ -0,0 +1,53 @@ +Config.later(function() + vim.pack.add { 'https://github.com/lewis6991/gitsigns.nvim' } + require('gitsigns').setup { + signs = { + add = { text = '┃' }, + change = { text = '┃' }, + delete = { text = '_' }, + topdelete = { text = '‾' }, + changedelete = { text = '~' }, + untracked = { text = '┆' }, + }, + signs_staged = { + add = { text = '┃' }, + change = { text = '┃' }, + delete = { text = '_' }, + topdelete = { text = '‾' }, + changedelete = { text = '~' }, + untracked = { text = '┆' }, + }, + signs_staged_enable = true, + signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` + numhl = false, -- Toggle with `:Gitsigns toggle_numhl` + linehl = false, -- Toggle with `:Gitsigns toggle_linehl` + word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` + watch_gitdir = { + follow_files = true, + }, + auto_attach = true, + attach_to_untracked = true, + current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` + current_line_blame_opts = { + virt_text = true, + virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align' + delay = 1000, + ignore_whitespace = false, + virt_text_priority = 100, + use_focus = true, + }, + current_line_blame_formatter = ', - ', + blame_formatter = nil, -- Use default + sign_priority = 6, + update_debounce = 100, + status_formatter = nil, -- Use default + max_file_length = 40000, -- Disable if file is longer than this (in lines) + preview_config = { + -- Options passed to nvim_open_win + style = 'minimal', + relative = 'cursor', + row = 0, + col = 1, + }, + } +end) From 2083110f6329667565a4f42b122ab7d53fed71ff Mon Sep 17 00:00:00 2001 From: Flavien Perineau Date: Fri, 17 Apr 2026 09:40:15 +0200 Subject: [PATCH 09/14] add undo between session --- plugin/10_options.lua | 105 ++++++++++++++++++++++-------------------- 1 file changed, 56 insertions(+), 49 deletions(-) diff --git a/plugin/10_options.lua b/plugin/10_options.lua index 29feb52..147f6a4 100644 --- a/plugin/10_options.lua +++ b/plugin/10_options.lua @@ -1,71 +1,74 @@ vim.g.loaded_netrw = 1 vim.g.loaded_netrwPlugin = 1 +vim.opt.undofile = true -- undeo between session -- General ==================================================================== vim.g.mapleader = ' ' -- Use `` as key -vim.o.mouse = 'a' -- Enable mouse +vim.o.mouse = 'a' -- Enable mouse -- vim.o.mousescroll = 'ver:25,hor:6' -- Customize mouse scroll -vim.o.switchbuf = 'usetab' -- Use already opened buffers when switching -vim.o.undofile = true -- Enable persistent undo +vim.o.switchbuf = 'usetab' -- Use already opened buffers when switching +vim.o.undofile = true -- Enable persistent undo vim.o.shada = "'100,<50,s10,:1000,/100,@100,h" -- Limit ShaDa file (for startup) -- Enable all filetype plugins and syntax (if not enabled, for better startup) -vim.cmd('filetype plugin indent on') -if vim.fn.exists('syntax_on') ~= 1 then vim.cmd('syntax enable') end +vim.cmd 'filetype plugin indent on' +if vim.fn.exists 'syntax_on' ~= 1 then + vim.cmd 'syntax enable' +end -- UI ========================================================================= -vim.o.breakindent = true -- Indent wrapped lines to match line start -vim.o.breakindentopt = 'list:-1' -- Add padding for lists (if 'wrap' is set) +vim.o.breakindent = true -- Indent wrapped lines to match line start +vim.o.breakindentopt = 'list:-1' -- Add padding for lists (if 'wrap' is set) -- vim.o.colorcolumn = '+1' -- Draw column on the right of maximum width -vim.o.cursorline = true -- Enable current line highlighting -vim.o.linebreak = true -- Wrap lines at 'breakat' (if 'wrap' is set) -vim.o.list = true -- Show helpful text indicators -vim.o.number = true -- Show line numbers -vim.o.relativenumber = true -- Show relative line numbers -vim.o.pumborder = 'single' -- Use border in popup menu -vim.o.pumheight = 10 -- Make popup menu smaller -vim.o.pummaxwidth = 100 -- Make popup menu not too wide -vim.o.ruler = false -- Don't show cursor coordinates -vim.o.shortmess = 'CFOSWaco' -- Disable some built-in completion messages -vim.o.showmode = false -- Don't show mode in command line -vim.o.signcolumn = 'yes' -- Always show signcolumn (less flicker) -vim.o.splitbelow = true -- Horizontal splits will be below -vim.o.splitkeep = 'screen' -- Reduce scroll during window split -vim.o.splitright = true -- Vertical splits will be to the right -vim.o.winborder = 'single' -- Use border in floating windows -vim.o.wrap = true -- Don't visually wrap lines (toggle with \w) -vim.o.confirm = true -- confirm on exit +vim.o.cursorline = true -- Enable current line highlighting +vim.o.linebreak = true -- Wrap lines at 'breakat' (if 'wrap' is set) +vim.o.list = true -- Show helpful text indicators +vim.o.number = true -- Show line numbers +vim.o.relativenumber = true -- Show relative line numbers +vim.o.pumborder = 'single' -- Use border in popup menu +vim.o.pumheight = 10 -- Make popup menu smaller +vim.o.pummaxwidth = 100 -- Make popup menu not too wide +vim.o.ruler = false -- Don't show cursor coordinates +vim.o.shortmess = 'CFOSWaco' -- Disable some built-in completion messages +vim.o.showmode = false -- Don't show mode in command line +vim.o.signcolumn = 'yes' -- Always show signcolumn (less flicker) +vim.o.splitbelow = true -- Horizontal splits will be below +vim.o.splitkeep = 'screen' -- Reduce scroll during window split +vim.o.splitright = true -- Vertical splits will be to the right +vim.o.winborder = 'single' -- Use border in floating windows +vim.o.wrap = true -- Don't visually wrap lines (toggle with \w) +vim.o.confirm = true -- confirm on exit vim.o.termguicolors = true -- true color -vim.g.diffopt = "vertical," .. vim.o.diffopt -- split vertical for vim diff -vim.go.inccommand = "split" -- show preview of search +vim.g.diffopt = 'vertical,' .. vim.o.diffopt -- split vertical for vim diff +vim.go.inccommand = 'split' -- show preview of search -vim.o.cursorlineopt = 'screenline,number' -- Show cursor line per screen line +vim.o.cursorlineopt = 'screenline,number' -- Show cursor line per screen line -- Special UI symbols. More is set via 'mini.basics' later. vim.o.fillchars = 'eob: ,fold:╌' vim.o.listchars = 'extends:…,nbsp:␣,precedes:…,tab:> ' -- Folds (see `:h fold-commands`, `:h zM`, `:h zR`, `:h zA`, `:h zj`) -vim.o.foldlevel = 10 -- Fold nothing by default; set to 0 or 1 to fold -vim.o.foldmethod = 'indent' -- Fold based on indent level -vim.o.foldnestmax = 10 -- Limit number of fold levels -vim.o.foldtext = '' -- Show text under fold with its highlighting +vim.o.foldlevel = 10 -- Fold nothing by default; set to 0 or 1 to fold +vim.o.foldmethod = 'indent' -- Fold based on indent level +vim.o.foldnestmax = 10 -- Limit number of fold levels +vim.o.foldtext = '' -- Show text under fold with its highlighting -- Editing ==================================================================== -vim.o.autoindent = true -- Use auto indent -vim.o.expandtab = true -- Convert tabs to spaces -vim.o.formatoptions = 'rqnl1j'-- Improve comment editing -vim.o.ignorecase = true -- Ignore case during search -vim.o.incsearch = true -- Show search matches while typing -vim.o.infercase = true -- Infer case in built-in completion -vim.o.shiftwidth = 2 -- Use this number of spaces for indentation -vim.o.smartcase = true -- Respect case if search pattern has upper case -vim.o.smartindent = true -- Make indenting smart -vim.o.spelloptions = 'camel' -- Treat camelCase word parts as separate words -vim.o.tabstop = 4 -- Show tab as this number of spaces -vim.o.virtualedit = 'block' -- Allow going past end of line in blockwise mode +vim.o.autoindent = true -- Use auto indent +vim.o.expandtab = true -- Convert tabs to spaces +vim.o.formatoptions = 'rqnl1j' -- Improve comment editing +vim.o.ignorecase = true -- Ignore case during search +vim.o.incsearch = true -- Show search matches while typing +vim.o.infercase = true -- Infer case in built-in completion +vim.o.shiftwidth = 2 -- Use this number of spaces for indentation +vim.o.smartcase = true -- Respect case if search pattern has upper case +vim.o.smartindent = true -- Make indenting smart +vim.o.spelloptions = 'camel' -- Treat camelCase word parts as separate words +vim.o.tabstop = 4 -- Show tab as this number of spaces +vim.o.virtualedit = 'block' -- Allow going past end of line in blockwise mode vim.o.iskeyword = '@,48-57,_,192-255,-' -- Treat dash as `word` textobject part @@ -75,15 +78,17 @@ vim.o.iskeyword = '@,48-57,_,192-255,-' -- Treat dash as `word` textobject part vim.o.formatlistpat = [[^\s*[0-9\-\+\*]\+[\.\)]*\s\+]] -- Built-in completion -vim.o.complete = '.,w,b,kspell' -- Use less sources -vim.o.completeopt = 'menuone,noselect,fuzzy,nosort' -- Use custom behavior -vim.o.completetimeout = 100 -- Limit sources delay +vim.o.complete = '.,w,b,kspell' -- Use less sources +vim.o.completeopt = 'menuone,noselect,fuzzy,nosort' -- Use custom behavior +vim.o.completetimeout = 100 -- Limit sources delay -- Autocommands =============================================================== -- Don't auto-wrap comments and don't insert comment leader after hitting 'o'. -- Do on `FileType` to always override these changes from filetype plugins. -local f = function() vim.cmd('setlocal formatoptions-=c formatoptions-=o') end +local f = function() + vim.cmd 'setlocal formatoptions-=c formatoptions-=o' +end Config.new_autocmd('FileType', nil, f, "Proper 'formatoptions'") -- There are other autocommands created by 'mini.basics'. See 'plugin/30_mini.lua'. @@ -112,5 +117,7 @@ local diagnostic_opts = { } -- Use `later()` to avoid sourcing `vim.diagnostic` on startup -Config.later(function() vim.diagnostic.config(diagnostic_opts) end) +Config.later(function() + vim.diagnostic.config(diagnostic_opts) +end) -- stylua: ignore end From f92af4f3bd20c9f01d04ef4c2c2f76ddd792cd48 Mon Sep 17 00:00:00 2001 From: Flavien Perineau Date: Mon, 20 Apr 2026 10:54:35 +0200 Subject: [PATCH 10/14] change default selector --- nvim-pack-lock.json | 4 ++++ plugin/fuzyfinder.lua | 26 ++++++++++++++------------ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/nvim-pack-lock.json b/nvim-pack-lock.json index b354511..5c6afd2 100644 --- a/nvim-pack-lock.json +++ b/nvim-pack-lock.json @@ -89,6 +89,10 @@ "rev": "ad9ede6a9cddf16cedbd31b8932d6dcdee9b716e", "src": "https://github.com/folke/snacks.nvim" }, + "telescope-ui-select.nvim": { + "rev": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2", + "src": "https://github.com/nvim-telescope/telescope-ui-select.nvim" + }, "telescope.nvim": { "rev": "471eebb1037899fd942cc0f52c012f8773505da1", "src": "https://github.com/nvim-telescope/telescope.nvim" diff --git a/plugin/fuzyfinder.lua b/plugin/fuzyfinder.lua index 2272464..1af827d 100644 --- a/plugin/fuzyfinder.lua +++ b/plugin/fuzyfinder.lua @@ -1,14 +1,17 @@ -Config.later(function () - vim.pack.add({ - "https://github.com/nvim-telescope/telescope.nvim", - "https://github.com/nvim-lua/plenary.nvim", - }) - require('telescope').setup{ - defaults = { - path_display={"smart"} - } +Config.later(function() + vim.pack.add { + 'https://github.com/nvim-telescope/telescope.nvim', + 'https://github.com/nvim-lua/plenary.nvim', + 'https://github.com/nvim-telescope/telescope-ui-select.nvim', } - local builtin = require('telescope.builtin') + require('telescope').setup { + defaults = { + path_display = { 'smart' }, + }, + } + require('telescope').load_extension 'ui-select' + + local builtin = require 'telescope.builtin' vim.keymap.set('n', 'ff', builtin.find_files, { desc = 'Telescope find files' }) vim.keymap.set('n', '', builtin.find_files, { desc = 'Telescope find files' }) @@ -19,5 +22,4 @@ Config.later(function () vim.lsp.buf.implementation = builtin.lsp_implementations vim.lsp.buf.definition = builtin.lsp_definitions vim.lsp.buf.type_definition = builtin.lsp_type_definitions - -end) +end) \ No newline at end of file From 3b6bca376fbfe0e729df3d331e471da571064406 Mon Sep 17 00:00:00 2001 From: Test User Date: Fri, 8 May 2026 18:46:00 +0200 Subject: [PATCH 11/14] add markdown plugin --- nvim-pack-lock.json | 8 ++++++ plugin/markdown.lua | 4 +++ plugin/treesiter.lua | 60 +++++++++++++++++++++++--------------------- 3 files changed, 44 insertions(+), 28 deletions(-) create mode 100644 plugin/markdown.lua diff --git a/nvim-pack-lock.json b/nvim-pack-lock.json index 5c6afd2..29b29a8 100644 --- a/nvim-pack-lock.json +++ b/nvim-pack-lock.json @@ -25,6 +25,10 @@ "rev": "a905eeebc4e63fdc48b5135d3bf8aea5618fb21c", "src": "https://github.com/nvim-lualine/lualine.nvim" }, + "markview.nvim": { + "rev": "dbf74b6db11c1468d5128a38b26b6d99dc7316e9", + "src": "https://github.com/OXY2DEV/markview.nvim" + }, "mason-lspconfig.nvim": { "rev": "0a3b42c3e503df87aef6d6513e13148381495c3a", "src": "https://github.com/mason-org/mason-lspconfig.nvim" @@ -65,6 +69,10 @@ "rev": "4916d6592ede8c07973490d9322f187e07dfefac", "src": "https://github.com/nvim-treesitter/nvim-treesitter" }, + "nvim-treesitter-context": { + "rev": "b311b30818951d01f7b4bf650521b868b3fece16", + "src": "https://github.com/nvim-treesitter/nvim-treesitter-context" + }, "nvim-treesitter-textobjects": { "rev": "851e865342e5a4cb1ae23d31caf6e991e1c99f1e", "src": "https://github.com/nvim-treesitter/nvim-treesitter-textobjects" diff --git a/plugin/markdown.lua b/plugin/markdown.lua new file mode 100644 index 0000000..3a1f37b --- /dev/null +++ b/plugin/markdown.lua @@ -0,0 +1,4 @@ +Config.later(function() + vim.pack.add { 'https://github.com/OXY2DEV/markview.nvim' } + require('markview').setup() +end) diff --git a/plugin/treesiter.lua b/plugin/treesiter.lua index d36cd76..91a203b 100644 --- a/plugin/treesiter.lua +++ b/plugin/treesiter.lua @@ -1,32 +1,36 @@ Config.now_if_args(function() - -- Define hook to update tree-sitter parsers after plugin is updated - local ts_update = function() vim.cmd('TSUpdate') end - Config.on_packchanged('nvim-treesitter', { 'update' }, ts_update, ':TSUpdate') + -- Define hook to update tree-sitter parsers after plugin is updated + local ts_update = function() + vim.cmd 'TSUpdate' + end + Config.on_packchanged('nvim-treesitter', { 'update' }, ts_update, ':TSUpdate') - vim.pack.add({ - 'https://github.com/nvim-treesitter/nvim-treesitter', - 'https://github.com/nvim-treesitter/nvim-treesitter-textobjects', - }) + vim.pack.add { + 'https://github.com/nvim-treesitter/nvim-treesitter', + 'https://github.com/nvim-treesitter/nvim-treesitter-textobjects', + 'https://github.com/nvim-treesitter/nvim-treesitter-context', + } - vim.api.nvim_create_autocmd('FileType', { - callback = function(ev) - local lang = vim.treesitter.language.get_lang(ev.match) - local available_langs = require('nvim-treesitter').get_available() - local is_available = vim.tbl_contains(available_langs, lang) - if is_available then - local installed_langs = require('nvim-treesitter').get_installed() - local installed = vim.tbl_contains(installed_langs, lang) - if not installed then - require('nvim-treesitter').install(lang):wait() - end - vim.treesitter.start(ev.buf) - -- require('nvim-treesitter').indentexpr() - -- require('nvim-treesitter').foldexpr() - vim.wo[0][0].foldexpr = 'v:lua.vim.treesitter.foldexpr()' - vim.wo[0][0].foldmethod = 'expr' - vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" - end - end, - }) + require('treesitter-context').setup {} + vim.api.nvim_create_autocmd('FileType', { + callback = function(ev) + local lang = vim.treesitter.language.get_lang(ev.match) + local available_langs = require('nvim-treesitter').get_available() + local is_available = vim.tbl_contains(available_langs, lang) + if is_available then + local installed_langs = require('nvim-treesitter').get_installed() + local installed = vim.tbl_contains(installed_langs, lang) + if not installed then + require('nvim-treesitter').install(lang):wait() + end + vim.treesitter.start(ev.buf) + -- require('nvim-treesitter').indentexpr() + -- require('nvim-treesitter').foldexpr() + vim.wo[0][0].foldexpr = 'v:lua.vim.treesitter.foldexpr()' + vim.wo[0][0].foldmethod = 'expr' + vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" + end + end, + }) +end) -end) \ No newline at end of file From 980af5c8243be4cb145ae7b2ac1f128fd04c2098 Mon Sep 17 00:00:00 2001 From: Flavien Perineau Date: Mon, 11 May 2026 10:57:10 +0200 Subject: [PATCH 12/14] change nvim tree open file --- plugin/tree.lua | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/plugin/tree.lua b/plugin/tree.lua index d5c616a..0c564f2 100644 --- a/plugin/tree.lua +++ b/plugin/tree.lua @@ -1,23 +1,23 @@ -Config.later(function () - vim.pack.add({"https://github.com/nvim-tree/nvim-tree.lua","https://github.com/folke/snacks.nvim"}) - - require("nvim-tree").setup({ - renderer={ - group_empty=true - } - }) +Config.later(function() + vim.pack.add { 'https://github.com/nvim-tree/nvim-tree.lua', 'https://github.com/folke/snacks.nvim' } + + require('nvim-tree').setup { + renderer = { + group_empty = true, + }, + } - vim.keymap.set("n","\\","NvimTreeOpen",{silent=true}) + vim.keymap.set('n', '\\', 'NvimTreeFindFile', { silent = true }) - local prev = { new_name = "", old_name = "" } -- Prevents duplicate events - vim.api.nvim_create_autocmd("User", { - pattern = "NvimTreeSetup", + local prev = { new_name = '', old_name = '' } -- Prevents duplicate events + vim.api.nvim_create_autocmd('User', { + pattern = 'NvimTreeSetup', callback = function() - local events = require("nvim-tree.api").events + local events = require('nvim-tree.api').events events.subscribe(events.Event.NodeRenamed, function(data) if prev.new_name ~= data.new_name or prev.old_name ~= data.old_name then data = data - require("snacks").rename.on_rename_file(data.old_name, data.new_name) + require('snacks').rename.on_rename_file(data.old_name, data.new_name) end end) end, From 34dcde46132a81b9fb6c1114c987597310a72b17 Mon Sep 17 00:00:00 2001 From: Test User Date: Fri, 22 May 2026 11:49:47 +0200 Subject: [PATCH 13/14] change keymap --- plugin/20_keymap.lua | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/plugin/20_keymap.lua b/plugin/20_keymap.lua index 4b4534c..d7a972a 100644 --- a/plugin/20_keymap.lua +++ b/plugin/20_keymap.lua @@ -11,10 +11,13 @@ -- An example helper to create a Normal mode mapping local nmap = function(lhs, rhs, desc) -- See `:h vim.keymap.set()` - vim.keymap.set('n', lhs, rhs, { desc = desc ,silent=true}) + vim.keymap.set('n', lhs, rhs, { desc = desc, silent = true }) end -nmap("", "nohl","disable higlight") -vim.keymap.set('v', ">", ">gv", {silent=true}) -vim.keymap.set('v', "<", "e",vim.diagnostic.open_float,"Line Diagnostic") +vim.keymap.set({ 'n', 's', 'i' }, '', function() + vim.cmd 'noh' + return '' +end, { desc = 'Escape and Clear hlsearch', expr = true }) +vim.keymap.set('v', '>', '>gv', { silent = true }) +vim.keymap.set('v', '<', 'e', vim.diagnostic.open_float, 'Line Diagnostic') From 612e57a89f78f7ef30889b39b0ed378c1aae63fe Mon Sep 17 00:00:00 2001 From: Flavien Perineau Date: Mon, 8 Jun 2026 14:28:37 +0200 Subject: [PATCH 14/14] add keymap for visual down and up --- plugin/20_keymap.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugin/20_keymap.lua b/plugin/20_keymap.lua index d7a972a..49db160 100644 --- a/plugin/20_keymap.lua +++ b/plugin/20_keymap.lua @@ -21,3 +21,12 @@ end, { desc = 'Escape and Clear hlsearch', expr = true }) vim.keymap.set('v', '>', '>gv', { silent = true }) vim.keymap.set('v', '<', 'e', vim.diagnostic.open_float, 'Line Diagnostic') + +vim.keymap.set('v', 'j', 'gj', { silent = true }) +vim.keymap.set('n', 'j', 'gj', { silent = true }) +vim.keymap.set('v', 'k', 'gk', { silent = true }) +vim.keymap.set('n', 'k', 'gk', { silent = true }) +vim.keymap.set('v', '', 'gj', { silent = true }) +vim.keymap.set('n', '', 'gj', { silent = true }) +vim.keymap.set('v', '', 'gk', { silent = true }) +vim.keymap.set('n', '', 'gk', { silent = true }) \ No newline at end of file