1
0

feat(nvim): clean and trim config

This commit is contained in:
2025-07-05 09:33:28 +02:00
parent 4e43881829
commit c9e48695c5
12 changed files with 182 additions and 347 deletions

View File

@@ -0,0 +1,2 @@
vim.wo.wrap = false
vim.opt.expandtab = true

View File

@@ -1,28 +1,19 @@
{ {
"actions-preview.nvim": { "branch": "master", "commit": "36513ad213855d497b7dd3391a24d1d75d58e36f" },
"blink.cmp": { "branch": "main", "commit": "9bcb14b43852a6f2bfd5ac9ef29cb5cf09b1b39b" }, "blink.cmp": { "branch": "main", "commit": "9bcb14b43852a6f2bfd5ac9ef29cb5cf09b1b39b" },
"compile-mode.nvim": { "branch": "main", "commit": "8dff8d8472363e01499a4e8cc02f5f5595ce3922" },
"cord.nvim": { "branch": "master", "commit": "a4484bb25e343a375d95b250ffadbdcbfbfdf2ac" }, "cord.nvim": { "branch": "master", "commit": "a4484bb25e343a375d95b250ffadbdcbfbfdf2ac" },
"dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" },
"flash.nvim": { "branch": "develop", "commit": "045457978f3fb7df03efa2023dbc8a5f6e9179bd" }, "flash.nvim": { "branch": "develop", "commit": "045457978f3fb7df03efa2023dbc8a5f6e9179bd" },
"formatter.nvim": { "branch": "master", "commit": "b9d7f853da1197b83b8edb4cc4952f7ad3a42e41" }, "formatter.nvim": { "branch": "master", "commit": "b9d7f853da1197b83b8edb4cc4952f7ad3a42e41" },
"gruber-darker.nvim": { "branch": "main", "commit": "a2dda61d9c1225e16951a51d6b89795b0ac35cd6" },
"inc-rename.nvim": { "branch": "main", "commit": "a3e31af13844534c66041ce92f29af7745883875" },
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
"markview.nvim": { "branch": "main", "commit": "d5d37102d24c3d5d032b01263855081b6850509b" }, "markview.nvim": { "branch": "main", "commit": "d5d37102d24c3d5d032b01263855081b6850509b" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" },
"mason.nvim": { "branch": "main", "commit": "8024d64e1330b86044fed4c8494ef3dcd483a67c" }, "mason.nvim": { "branch": "main", "commit": "8024d64e1330b86044fed4c8494ef3dcd483a67c" },
"mini.icons": { "branch": "main", "commit": "94848dad1589a199f876539bd79befb0c5e3abf0" }, "mini.icons": { "branch": "main", "commit": "94848dad1589a199f876539bd79befb0c5e3abf0" },
"nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, "nvim-treesitter": { "branch": "main", "commit": "dafb3cb3cb066774526c1103f3d1d6b34578800b" },
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
"nvim-ufo": { "branch": "main", "commit": "4c64d89c2bf174d95d4ac91cc959a9e43e2f318c" },
"nvim-web-devicons": { "branch": "master", "commit": "19d6211c78169e78bab372b585b6fb17ad974e82" },
"oil.nvim": { "branch": "master", "commit": "bbad9a76b2617ce1221d49619e4e4b659b3c61fc" }, "oil.nvim": { "branch": "master", "commit": "bbad9a76b2617ce1221d49619e4e4b659b3c61fc" },
"oxocarbon.nvim": { "branch": "main", "commit": "acdfdd5d319c36170b5ad2a120283bec2f450081" }, "oxocarbon.nvim": { "branch": "main", "commit": "acdfdd5d319c36170b5ad2a120283bec2f450081" },
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
"smear-cursor.nvim": { "branch": "main", "commit": "4a0f7ac265b4ed1ce4d0af2afc13072763bfa691" }, "smear-cursor.nvim": { "branch": "main", "commit": "4a0f7ac265b4ed1ce4d0af2afc13072763bfa691" },
"telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" }, "telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" },
"todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" }, "todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" },
"vim-fugitive": { "branch": "master", "commit": "593f831d6f6d779cbabb70a4d1e6b1b1936a88af" }, "vim-fugitive": { "branch": "master", "commit": "593f831d6f6d779cbabb70a4d1e6b1b1936a88af" }
"vim-grepper": { "branch": "master", "commit": "acaaf32edaa11d82fb972d2af36b949ec3042928" }
} }

View File

@@ -29,4 +29,36 @@ function M.bootstrap()
return require('lazy') return require('lazy')
end end
M.icons = 'echasnovski/mini.icons'
M.icons_require = function()
return require('mini.icons')
end
--- @enum PlenaryModule
local _ = {
async = 'async',
async_lib = 'async_lib',
job = 'job',
path = 'path',
scandir = 'scandir',
context_manager = 'context_manager',
test_harness = 'test_harness',
filetype = 'filetype',
strings = 'strings',
}
--- @param module PlenaryModule
M.plenary_require = function(module)
return require('plenary.' .. module)
end
M.plenary = 'nvim-lua/plenary.nvim'
--- @enum
M.event = {
BufEnter = 'BufEnter',
BufWinEnter = 'BufWinEnter',
BufWritePost = 'BufWritePost',
VeryLazy = 'VeryLazy',
}
return M return M

View File

@@ -1,28 +1,4 @@
return { return {
{
'smjonas/inc-rename.nvim',
keys = { {
'<leader>cn',
':IncRename ',
} },
config = function()
require('inc_rename').setup({})
end,
},
{
'aznhe21/actions-preview.nvim',
keys = { {
'<leader>ca',
function()
require('actions-preview').code_actions()
end,
} },
opts = {},
-- config = function()
-- require('actions-preview').setup({})
-- vim.keymap.set('n', '<leader>ca', require('actions-preview').code_actions)
-- end,
},
{ {
'vyfor/cord.nvim', 'vyfor/cord.nvim',
event = 'VeryLazy', event = 'VeryLazy',
@@ -33,9 +9,4 @@ return {
'tpope/vim-fugitive', 'tpope/vim-fugitive',
cmd = { 'Git' }, cmd = { 'Git' },
}, },
{
'mhinz/vim-grepper',
cmd = { 'GrepperRg' },
opts = {},
},
} }

View File

@@ -1,22 +1,22 @@
local common = require('BluePlum.lazy')
return { return {
{ 'nvim-tree/nvim-web-devicons' }, { common.icons, opts = {} },
{ 'stevearc/dressing.nvim', opts = {} },
{ {
'folke/todo-comments.nvim', 'folke/todo-comments.nvim',
dependencies = { 'nvim-lua/plenary.nvim' }, dependencies = { 'nvim-lua/plenary.nvim' },
config = function() opts = {},
require('todo-comments').setup() event = common.event.BufWinEnter,
end,
}, },
{ 'norcalli/nvim-colorizer.lua', opts = {} },
{ {
'OXY2DEV/markview.nvim', 'OXY2DEV/markview.nvim',
dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, dependencies = { 'nvim-treesitter/nvim-treesitter', common.icons },
ft = 'markdown', ft = 'markdown',
config = function() opts = {
require('markview') preview = {
vim.api.nvim_set_hl(0, 'MarkviewLayer', { fg = '#2a2a2a', bg = '#373737' }) icon_provider = 'mini',
end, },
},
}, },
{ {
'sphamba/smear-cursor.nvim', 'sphamba/smear-cursor.nvim',

View File

@@ -1,47 +0,0 @@
return {
{
'ej-shafran/compile-mode.nvim',
enabled = false,
dependencies = {
'nvim-lua/plenary.nvim',
'm00qek/baleia.nvim',
},
config = function()
vim.api.nvim_set_hl(0, 'CompileModeInfo', { link = 'DiagnosticInfo' })
vim.api.nvim_set_hl(0, 'CompileModeWarning', { link = 'DiagnosticWarning' })
vim.api.nvim_set_hl(0, 'CompileModeError', { link = 'DiagnosticError' })
vim.api.nvim_set_hl(0, 'CompileModeCommandOutput', { link = 'Statement' })
vim.api.nvim_set_hl(0, 'CompileModeMessage', { link = 'SpellCap' })
vim.api.nvim_set_hl(0, 'CompileModeMessageRow', { link = 'CursorLineNr' })
vim.api.nvim_set_hl(0, 'CompileModeMessageCol', { link = 'CursorLineNr' })
vim.g.compile_mode = {
baleia_setup = true,
}
end,
},
-- {
-- dir = '~/dev/s-ido',
-- name = 's-ido',
-- lazy = false,
-- dev = true,
-- opts = {},
-- keys = {
-- {
-- '<Tab>',
-- function()
-- require('s-ido.commandline').complete()
-- end,
-- mode = 'c',
-- },
-- },
-- },
-- {
-- dir = '~/dev/s-nav',
-- name = 's-nav',
-- lazy = false,
-- dev = true,
-- opts = {},
-- },
}

View File

@@ -1,64 +0,0 @@
return {
{
'kevinhwang91/nvim-ufo',
dependencies = {
{
'kevinhwang91/promise-async',
},
},
enabled = false,
config = function()
-- Implement custom marker provider.
local CustomMarkerProvider = {}
function CustomMarkerProvider.getFolds(bufnr)
local buf = require('ufo.bufmanager'):get(bufnr)
if not buf then
return
end
local openRegex = '#region'
local closeRegex = '#endregion'
local summaryRegx = openRegex .. '%s*(.*)'
local ranges = {}
local stack = {}
local lines = buf:lines(1, -1)
for lnum, line in ipairs(lines) do
-- Check for start marker
if line:match(openRegex) then
table.insert(stack, lnum)
-- Check for end marker
elseif line:match(closeRegex) then
local startLnum = table.remove(stack)
if startLnum then
local summary = lines[startLnum]:match(summaryRegx)
table.insert(ranges, require('ufo.model.foldingrange').new(startLnum - 1, lnum - 1, summary))
end
end
end
return ranges
end
local function customizeSelector(bufnr)
local ranges = CustomMarkerProvider.getFolds(bufnr)
local maybe_additional_ranges = require('ufo').getFolds(bufnr, 'treesitter')
if next(maybe_additional_ranges) ~= nil then
ranges = vim.list_extend(ranges, maybe_additional_ranges)
else
ranges = vim.list_extend(ranges, require('ufo').getFolds(bufnr, 'indent'))
end
return ranges
end
require('ufo').setup({
provider_selector = function(bufnr, filetype, buftype)
return customizeSelector
end,
})
end,
},
}

View File

@@ -1,81 +1,60 @@
return { local common = require('BluePlum.lazy')
{
'mhartington/formatter.nvim',
event = 'BufWritePost',
config = function()
local util = require('formatter.util')
local function prettier() ---@param exe string
---@param args { [number]: string, path: boolean? }
local function formatter(exe, args)
return { return {
exe = 'prettier', function()
args = { local argv = {}
'--config-precedence',
'prefer-file', for _, val in ipairs(args) do
'--single-quote', table.insert(argv, val)
'--use-tabs', end
'--trailing-comma',
'es5', if not args.path == false then
'--bracket-same-line', table.insert(argv, vim.fn.shellescape(vim.api.nvim_buf_get_name(0)))
'--insert-pragma', end
'--stdin-filepath',
vim.fn.shellescape(vim.api.nvim_buf_get_name(0)), return {
}, exe = exe,
args = argv,
stdin = true, stdin = true,
} }
end,
}
end end
require('formatter').setup({ local prettier = formatter('prettier', {
filetype = { '--config-precedence prefer-file',
javascript = { '--single-quote',
prettier, '--use-tabs',
}, '--trailing-comma es5',
typescript = { '--bracket-same-line',
prettier, '--stdin-filepath',
}, })
markdown = {
prettier,
},
css = {
prettier,
},
json = {
prettier,
},
html = {
prettier,
},
scss = {
prettier,
},
rust = {
function()
return {
exe = 'rustfmt',
args = {},
stdin = false,
}
end,
},
lua = {
function()
return { return {
exe = 'stylua', {
args = { 'mhartington/formatter.nvim',
'--indent-type', event = common.event.BufWritePost,
'Tabs', opts = {
'--line-endings', filetype = {
'Unix', javascript = prettier,
'--quote-style', typescript = prettier,
'AutoPreferSingle', markdown = prettier,
'--column-width', css = prettier,
vim.api.nvim_command_output('echo &columns'), json = prettier,
html = prettier,
scss = prettier,
rust = formatter('rustfmt', { path = false }),
lua = formatter('stylua', {
'--indent-type Tabs',
'--line-endings Unix',
'--quote-style AutoPreferSingle',
'--column-width' .. ' ' .. vim.o.columns,
'-', '-',
}, }),
stdin = true,
}
end,
},
['*'] = { ['*'] = {
function() function()
if vim.lsp.buf.formatting then if vim.lsp.buf.formatting then
@@ -84,14 +63,12 @@ return {
end, end,
}, },
}, },
}) },
config = function(lazy)
require('formatter').setup(lazy.opts)
local augroup = vim.api.nvim_create_augroup vim.api.nvim_create_augroup('__formatter__', { clear = true })
local autocmd = vim.api.nvim_create_autocmd vim.api.nvim_create_autocmd(common.event.BufWritePost, {
augroup('__formatter__', {
clear = true,
})
autocmd('BufWritePost', {
group = '__formatter__', group = '__formatter__',
command = ':FormatWriteLock', command = ':FormatWriteLock',
}) })

View File

@@ -1,14 +1,4 @@
local blink_methods = { local common = require('BluePlum.lazy')
icon = function(ctx)
local icon, _, _ = require('mini.icons').get('lsp', ctx.kind)
return icon
end,
highlight = function(ctx)
local _, hi, _ = require('mini.icons').get('lsp', ctx.kind)
vim.print(hi)
return hi
end,
}
return { return {
-- Mason -- Mason
@@ -20,10 +10,10 @@ return {
ensure_installed = { 'lua_ls', 'rust_analyzer' }, ensure_installed = { 'lua_ls', 'rust_analyzer' },
}, },
config = function(lazy) config = function(lazy)
local mlspconfig = require('mason-lspconfig') local mason_lspconfig = require('mason-lspconfig')
mlspconfig.setup(lazy.opts) mason_lspconfig.setup(lazy.opts)
mlspconfig.setup_handlers({ mason_lspconfig.setup_handlers({
vim.lsp.enable, vim.lsp.enable,
}) })
end, end,
@@ -34,9 +24,7 @@ return {
{ {
'Saghen/blink.cmp', 'Saghen/blink.cmp',
dependencies = { dependencies = { common.icons },
'echasnovski/mini.icons',
},
version = '1.*', version = '1.*',
build = 'cargo build --release', build = 'cargo build --release',
opts = { opts = {
@@ -67,7 +55,10 @@ return {
columns = { { 'kind_icon' }, { 'label', 'label_description', gap = 1 }, { 'kind' } }, columns = { { 'kind_icon' }, { 'label', 'label_description', gap = 1 }, { 'kind' } },
components = { components = {
kind_icon = { kind_icon = {
text = blink_methods.icon, text = function(ctx)
local icon, _, _ = common.icons_require().get('lsp', ctx.kind)
return icon
end,
}, },
kind = { kind = {
text = function(ctx) text = function(ctx)

View File

@@ -1,31 +1,27 @@
return { local common = require('BluePlum.lazy')
-- Telescope local telescope = {
{ find_files = function()
'nvim-telescope/telescope.nvim',
dependencies = { 'nvim-lua/plenary.nvim' },
keys = {
{
'<leader>ff',
function()
require('telescope.builtin').find_files({ show_hidden = true }) require('telescope.builtin').find_files({ show_hidden = true })
end, end,
}, live_grep = function()
{
'<leader>fs',
function()
require('telescope.builtin').live_grep() require('telescope.builtin').live_grep()
end, end,
}, buffers = function()
{
'<leader>bb',
function()
require('telescope.builtin').buffers() require('telescope.builtin').buffers()
end, end,
}, }
return {
{
'nvim-telescope/telescope.nvim',
dependencies = { common.plenary },
keys = {
{ '<leader>ff', telescope.find_files },
{ '<leader>fs', telescope.live_grep },
{ '<leader>bb', telescope.buffers },
}, },
}, },
-- Oil
{ {
'stevearc/oil.nvim', 'stevearc/oil.nvim',
opts = { opts = {
@@ -36,18 +32,13 @@ return {
}, },
lazy = false, lazy = false,
keys = { keys = {
{ { '<leader>ex', vim.cmd.Oil },
'<leader>ex',
function()
vim.cmd('Oil')
end,
},
}, },
}, },
{ {
'Kaiser-Yang/flash.nvim', 'Kaiser-Yang/flash.nvim',
branch = 'develop', branch = 'develop',
event = 'VeryLazy', event = common.event.VeryLazy,
opts = { opts = {
modes = { modes = {
char = { char = {

View File

@@ -1,47 +1,41 @@
return { return {
{
'blazkowolf/gruber-darker.nvim',
priority = 999,
config = function()
vim.cmd.colorscheme('gruber-darker')
end,
enabled = false,
},
{ {
'nyoom-engineering/oxocarbon.nvim', 'nyoom-engineering/oxocarbon.nvim',
priority = 999, priority = 999,
config = function() config = function()
vim.cmd.colorscheme('oxocarbon') vim.cmd.colorscheme('oxocarbon')
local function hi(c, link) local groups = {
vim.api.nvim_set_hl(0, 'BlinkCmpKind' .. c, { link = link }) Text = 'Identifier',
end Method = '@function.builtin',
Function = 'Function',
Constructor = '@character',
Field = '@property',
Variable = '@label',
Class = 'Todo',
Interface = 'Type',
Module = 'Macro',
Property = '@property',
Unit = 'Type',
Value = 'Number',
Enum = 'String',
Keyword = 'Identifier',
Snippet = 'Identifier',
Color = 'Identifier',
File = 'Identifier',
Folder = 'identifier',
Reference = 'Identifier',
EnumMember = 'String',
Constant = '@constant.builtin',
Struct = 'Type',
Event = '@constant',
Operator = 'Structure',
TypeParameter = 'Type',
}
hi('Text', 'Identifier') for key, value in pairs(groups) do
hi('Method', '@function.builtin') vim.api.nvim_set_hl(0, 'BlinkCmpKind' .. key, { link = value })
hi('Function', 'Function') end
hi('Constructor', '@character')
hi('Field', '@property')
hi('Variable', '@label')
hi('Class', 'Todo')
hi('Interface', 'Type')
hi('Module', 'Macro')
hi('Property', '@property')
hi('Unit', 'Type')
hi('Value', 'Number')
hi('Enum', 'String')
hi('Keyword', 'Identifier')
hi('Snippet', 'Identifier')
hi('Color', 'Identifier')
hi('File', 'Identifier')
hi('Folder', 'identifier')
hi('Reference', 'Identifier')
hi('EnumMember', 'String')
hi('Constant', '@constant.builtin')
hi('Struct', 'Type')
hi('Event', '@constant')
hi('Operator', 'Structure')
hi('TypeParameter', 'Type')
vim.api.nvim_set_hl(0, 'BlinkCmpMenuSelection', { link = 'IncSearch' }) vim.api.nvim_set_hl(0, 'BlinkCmpMenuSelection', { link = 'IncSearch' })
end, end,

View File

@@ -1,12 +1,12 @@
local common = require('BluePlum.lazy')
return { return {
-- Highlighting
{ {
'nvim-treesitter/nvim-treesitter', 'nvim-treesitter/nvim-treesitter',
-- enabled = false, branch = 'main',
event = 'VeryLazy', event = common.event.VeryLazy,
config = function() build = ':TSUpdate',
vim.cmd('TSUpdate') opts = {
require('nvim-treesitter.configs').setup({
ensure_installed = { 'lua', 'markdown', 'typescript', 'javascript', 'rust', 'json', 'toml' }, ensure_installed = { 'lua', 'markdown', 'typescript', 'javascript', 'rust', 'json', 'toml' },
highlight = { highlight = {
@@ -14,9 +14,6 @@ return {
}, },
auto_install = true, auto_install = true,
},
-- additional_vim_regex_highlighting = true,
})
end,
}, },
} }