feat(nvim): clean and trim config
This commit is contained in:
@@ -1,28 +1,4 @@
|
||||
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',
|
||||
event = 'VeryLazy',
|
||||
@@ -33,9 +9,4 @@ return {
|
||||
'tpope/vim-fugitive',
|
||||
cmd = { 'Git' },
|
||||
},
|
||||
{
|
||||
'mhinz/vim-grepper',
|
||||
cmd = { 'GrepperRg' },
|
||||
opts = {},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
local common = require('BluePlum.lazy')
|
||||
|
||||
return {
|
||||
{ 'nvim-tree/nvim-web-devicons' },
|
||||
{ 'stevearc/dressing.nvim', opts = {} },
|
||||
{ common.icons, opts = {} },
|
||||
{
|
||||
'folke/todo-comments.nvim',
|
||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||
config = function()
|
||||
require('todo-comments').setup()
|
||||
end,
|
||||
opts = {},
|
||||
event = common.event.BufWinEnter,
|
||||
},
|
||||
{ 'norcalli/nvim-colorizer.lua', opts = {} },
|
||||
{
|
||||
'OXY2DEV/markview.nvim',
|
||||
dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' },
|
||||
dependencies = { 'nvim-treesitter/nvim-treesitter', common.icons },
|
||||
ft = 'markdown',
|
||||
config = function()
|
||||
require('markview')
|
||||
vim.api.nvim_set_hl(0, 'MarkviewLayer', { fg = '#2a2a2a', bg = '#373737' })
|
||||
end,
|
||||
opts = {
|
||||
preview = {
|
||||
icon_provider = 'mini',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
'sphamba/smear-cursor.nvim',
|
||||
|
||||
@@ -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 = {},
|
||||
-- },
|
||||
}
|
||||
@@ -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,
|
||||
},
|
||||
}
|
||||
@@ -1,97 +1,74 @@
|
||||
local common = require('BluePlum.lazy')
|
||||
|
||||
---@param exe string
|
||||
---@param args { [number]: string, path: boolean? }
|
||||
local function formatter(exe, args)
|
||||
return {
|
||||
function()
|
||||
local argv = {}
|
||||
|
||||
for _, val in ipairs(args) do
|
||||
table.insert(argv, val)
|
||||
end
|
||||
|
||||
if not args.path == false then
|
||||
table.insert(argv, vim.fn.shellescape(vim.api.nvim_buf_get_name(0)))
|
||||
end
|
||||
|
||||
return {
|
||||
exe = exe,
|
||||
args = argv,
|
||||
stdin = true,
|
||||
}
|
||||
end,
|
||||
}
|
||||
end
|
||||
|
||||
local prettier = formatter('prettier', {
|
||||
'--config-precedence prefer-file',
|
||||
'--single-quote',
|
||||
'--use-tabs',
|
||||
'--trailing-comma es5',
|
||||
'--bracket-same-line',
|
||||
'--stdin-filepath',
|
||||
})
|
||||
|
||||
return {
|
||||
{
|
||||
'mhartington/formatter.nvim',
|
||||
event = 'BufWritePost',
|
||||
config = function()
|
||||
local util = require('formatter.util')
|
||||
event = common.event.BufWritePost,
|
||||
opts = {
|
||||
filetype = {
|
||||
javascript = prettier,
|
||||
typescript = prettier,
|
||||
markdown = prettier,
|
||||
css = prettier,
|
||||
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,
|
||||
'-',
|
||||
}),
|
||||
|
||||
local function prettier()
|
||||
return {
|
||||
exe = 'prettier',
|
||||
args = {
|
||||
'--config-precedence',
|
||||
'prefer-file',
|
||||
'--single-quote',
|
||||
'--use-tabs',
|
||||
'--trailing-comma',
|
||||
'es5',
|
||||
'--bracket-same-line',
|
||||
'--insert-pragma',
|
||||
'--stdin-filepath',
|
||||
vim.fn.shellescape(vim.api.nvim_buf_get_name(0)),
|
||||
},
|
||||
stdin = true,
|
||||
}
|
||||
end
|
||||
|
||||
require('formatter').setup({
|
||||
filetype = {
|
||||
javascript = {
|
||||
prettier,
|
||||
},
|
||||
typescript = {
|
||||
prettier,
|
||||
},
|
||||
markdown = {
|
||||
prettier,
|
||||
},
|
||||
css = {
|
||||
prettier,
|
||||
},
|
||||
json = {
|
||||
prettier,
|
||||
},
|
||||
html = {
|
||||
prettier,
|
||||
},
|
||||
scss = {
|
||||
prettier,
|
||||
},
|
||||
rust = {
|
||||
function()
|
||||
return {
|
||||
exe = 'rustfmt',
|
||||
args = {},
|
||||
stdin = false,
|
||||
}
|
||||
end,
|
||||
},
|
||||
|
||||
lua = {
|
||||
function()
|
||||
return {
|
||||
exe = 'stylua',
|
||||
args = {
|
||||
'--indent-type',
|
||||
'Tabs',
|
||||
'--line-endings',
|
||||
'Unix',
|
||||
'--quote-style',
|
||||
'AutoPreferSingle',
|
||||
'--column-width',
|
||||
vim.api.nvim_command_output('echo &columns'),
|
||||
'-',
|
||||
},
|
||||
stdin = true,
|
||||
}
|
||||
end,
|
||||
},
|
||||
['*'] = {
|
||||
function()
|
||||
if vim.lsp.buf.formatting then
|
||||
vim.lsp.buf.format()
|
||||
end
|
||||
end,
|
||||
},
|
||||
['*'] = {
|
||||
function()
|
||||
if vim.lsp.buf.formatting then
|
||||
vim.lsp.buf.format()
|
||||
end
|
||||
end,
|
||||
},
|
||||
})
|
||||
},
|
||||
},
|
||||
config = function(lazy)
|
||||
require('formatter').setup(lazy.opts)
|
||||
|
||||
local augroup = vim.api.nvim_create_augroup
|
||||
local autocmd = vim.api.nvim_create_autocmd
|
||||
augroup('__formatter__', {
|
||||
clear = true,
|
||||
})
|
||||
autocmd('BufWritePost', {
|
||||
vim.api.nvim_create_augroup('__formatter__', { clear = true })
|
||||
vim.api.nvim_create_autocmd(common.event.BufWritePost, {
|
||||
group = '__formatter__',
|
||||
command = ':FormatWriteLock',
|
||||
})
|
||||
|
||||
@@ -1,14 +1,4 @@
|
||||
local blink_methods = {
|
||||
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,
|
||||
}
|
||||
local common = require('BluePlum.lazy')
|
||||
|
||||
return {
|
||||
-- Mason
|
||||
@@ -20,10 +10,10 @@ return {
|
||||
ensure_installed = { 'lua_ls', 'rust_analyzer' },
|
||||
},
|
||||
config = function(lazy)
|
||||
local mlspconfig = require('mason-lspconfig')
|
||||
local mason_lspconfig = require('mason-lspconfig')
|
||||
|
||||
mlspconfig.setup(lazy.opts)
|
||||
mlspconfig.setup_handlers({
|
||||
mason_lspconfig.setup(lazy.opts)
|
||||
mason_lspconfig.setup_handlers({
|
||||
vim.lsp.enable,
|
||||
})
|
||||
end,
|
||||
@@ -34,9 +24,7 @@ return {
|
||||
|
||||
{
|
||||
'Saghen/blink.cmp',
|
||||
dependencies = {
|
||||
'echasnovski/mini.icons',
|
||||
},
|
||||
dependencies = { common.icons },
|
||||
version = '1.*',
|
||||
build = 'cargo build --release',
|
||||
opts = {
|
||||
@@ -67,7 +55,10 @@ return {
|
||||
columns = { { 'kind_icon' }, { 'label', 'label_description', gap = 1 }, { 'kind' } },
|
||||
components = {
|
||||
kind_icon = {
|
||||
text = blink_methods.icon,
|
||||
text = function(ctx)
|
||||
local icon, _, _ = common.icons_require().get('lsp', ctx.kind)
|
||||
return icon
|
||||
end,
|
||||
},
|
||||
kind = {
|
||||
text = function(ctx)
|
||||
|
||||
@@ -1,31 +1,27 @@
|
||||
local common = require('BluePlum.lazy')
|
||||
local telescope = {
|
||||
find_files = function()
|
||||
require('telescope.builtin').find_files({ show_hidden = true })
|
||||
end,
|
||||
live_grep = function()
|
||||
require('telescope.builtin').live_grep()
|
||||
end,
|
||||
buffers = function()
|
||||
require('telescope.builtin').buffers()
|
||||
end,
|
||||
}
|
||||
|
||||
return {
|
||||
-- Telescope
|
||||
{
|
||||
'nvim-telescope/telescope.nvim',
|
||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||
dependencies = { common.plenary },
|
||||
keys = {
|
||||
{
|
||||
'<leader>ff',
|
||||
function()
|
||||
require('telescope.builtin').find_files({ show_hidden = true })
|
||||
end,
|
||||
},
|
||||
{
|
||||
'<leader>fs',
|
||||
function()
|
||||
require('telescope.builtin').live_grep()
|
||||
end,
|
||||
},
|
||||
{
|
||||
'<leader>bb',
|
||||
function()
|
||||
require('telescope.builtin').buffers()
|
||||
end,
|
||||
},
|
||||
{ '<leader>ff', telescope.find_files },
|
||||
{ '<leader>fs', telescope.live_grep },
|
||||
{ '<leader>bb', telescope.buffers },
|
||||
},
|
||||
},
|
||||
|
||||
-- Oil
|
||||
{
|
||||
'stevearc/oil.nvim',
|
||||
opts = {
|
||||
@@ -36,18 +32,13 @@ return {
|
||||
},
|
||||
lazy = false,
|
||||
keys = {
|
||||
{
|
||||
'<leader>ex',
|
||||
function()
|
||||
vim.cmd('Oil')
|
||||
end,
|
||||
},
|
||||
{ '<leader>ex', vim.cmd.Oil },
|
||||
},
|
||||
},
|
||||
{
|
||||
'Kaiser-Yang/flash.nvim',
|
||||
branch = 'develop',
|
||||
event = 'VeryLazy',
|
||||
event = common.event.VeryLazy,
|
||||
opts = {
|
||||
modes = {
|
||||
char = {
|
||||
|
||||
@@ -1,47 +1,41 @@
|
||||
return {
|
||||
{
|
||||
'blazkowolf/gruber-darker.nvim',
|
||||
priority = 999,
|
||||
config = function()
|
||||
vim.cmd.colorscheme('gruber-darker')
|
||||
end,
|
||||
enabled = false,
|
||||
},
|
||||
{
|
||||
'nyoom-engineering/oxocarbon.nvim',
|
||||
priority = 999,
|
||||
config = function()
|
||||
vim.cmd.colorscheme('oxocarbon')
|
||||
|
||||
local function hi(c, link)
|
||||
vim.api.nvim_set_hl(0, 'BlinkCmpKind' .. c, { link = link })
|
||||
end
|
||||
local groups = {
|
||||
Text = 'Identifier',
|
||||
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')
|
||||
hi('Method', '@function.builtin')
|
||||
hi('Function', 'Function')
|
||||
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')
|
||||
for key, value in pairs(groups) do
|
||||
vim.api.nvim_set_hl(0, 'BlinkCmpKind' .. key, { link = value })
|
||||
end
|
||||
|
||||
vim.api.nvim_set_hl(0, 'BlinkCmpMenuSelection', { link = 'IncSearch' })
|
||||
end,
|
||||
|
||||
@@ -1,22 +1,19 @@
|
||||
local common = require('BluePlum.lazy')
|
||||
|
||||
return {
|
||||
-- Highlighting
|
||||
{
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
-- enabled = false,
|
||||
event = 'VeryLazy',
|
||||
config = function()
|
||||
vim.cmd('TSUpdate')
|
||||
require('nvim-treesitter.configs').setup({
|
||||
ensure_installed = { 'lua', 'markdown', 'typescript', 'javascript', 'rust', 'json', 'toml' },
|
||||
branch = 'main',
|
||||
event = common.event.VeryLazy,
|
||||
build = ':TSUpdate',
|
||||
opts = {
|
||||
ensure_installed = { 'lua', 'markdown', 'typescript', 'javascript', 'rust', 'json', 'toml' },
|
||||
|
||||
highlight = {
|
||||
enable = true,
|
||||
},
|
||||
highlight = {
|
||||
enable = true,
|
||||
},
|
||||
|
||||
auto_install = true,
|
||||
|
||||
-- additional_vim_regex_highlighting = true,
|
||||
})
|
||||
end,
|
||||
auto_install = true,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user