1
0

neovim changes

This commit is contained in:
2025-01-25 22:22:13 +01:00
parent 4c1db847d5
commit 565cbf064a
14 changed files with 253 additions and 199 deletions

View File

@@ -11,9 +11,32 @@ return {
},
{
'aznhe21/actions-preview.nvim',
config = function()
require('actions-preview').setup({})
vim.keymap.set('n', '<leader>ca', require('actions-preview').code_actions)
end,
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',
branch = 'client-server',
build = ':Cord update',
opts = {},
},
{
'tpope/vim-fugitive',
cmd = { 'Git' },
},
{
'mhinz/vim-grepper',
cmd = { 'GrepperRg' },
opts = {},
},
}

View File

@@ -22,6 +22,8 @@ return {
'sphamba/smear-cursor.nvim',
opts = {
time_interval = 10,
legacy_computing_symbols_support = true,
cursor_color = '#fcdc34',
},
},
}

View File

@@ -1,6 +1,7 @@
return {
{
'ej-shafran/compile-mode.nvim',
enabled = false,
dependencies = {
'nvim-lua/plenary.nvim',
'm00qek/baleia.nvim',

View File

@@ -1,63 +1,64 @@
return {
{
'kevinhwang91/nvim-ufo',
dependencies = {
{
'kevinhwang91/promise-async',
},
},
config = function()
-- Implement custom marker provider.
local CustomMarkerProvider = {}
'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
function CustomMarkerProvider.getFolds(bufnr)
local buf = require('ufo.bufmanager'):get(bufnr)
if not buf then
return
end
local openRegex = '#region'
local closeRegex = '#endregion'
local openRegex = '#region'
local closeRegex = '#endregion'
local summaryRegx = openRegex .. '%s*(.*)'
local summaryRegx = openRegex .. '%s*(.*)'
local ranges = {}
local stack = {}
local lines = buf:lines(1, -1)
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
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
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
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,
},
require('ufo').setup({
provider_selector = function(bufnr, filetype, buftype)
return customizeSelector
end,
})
end,
},
}

View File

@@ -2,6 +2,7 @@ return {
{
'tjex/formatter.nvim',
branch = 'fix-305-index-out-of-bounds',
event = 'BufWritePost',
config = function()
local util = require('formatter.util')
@@ -47,6 +48,15 @@ return {
scss = {
prettier,
},
rust = {
function()
return {
exe = 'rustfmt',
args = {},
stdin = false,
}
end,
},
lua = {
function()
@@ -84,7 +94,7 @@ return {
})
autocmd('BufWritePost', {
group = '__formatter__',
command = ':FormatWrite',
command = ':FormatWriteLock',
})
end,
},

View File

@@ -1,20 +1,36 @@
return {
-- Mason
{ 'williamboman/mason.nvim', opts = {}, cmd = 'Mason' },
{ 'williamboman/mason-lspconfig.nvim', opts = {} },
{ 'williamboman/mason.nvim', opts = {}, cmd = 'Mason', event = 'VeryLazy' },
{ 'williamboman/mason-lspconfig.nvim', opts = {}, event = 'VeryLazy' },
-- Lsp configuration
{ 'VonHeikemen/lsp-zero.nvim' },
{ 'neovim/nvim-lspconfig' },
-- Completion
{ 'hrsh7th/nvim-cmp', dependencies = { 'hrsh7th/cmp-calc', 'L3MON4D3/LuaSnip', 'hrsh7th/cmp-nvim-lsp', 'onsails/lspkind.nvim' } },
{
'hrsh7th/nvim-cmp',
event = 'VeryLazy',
dependencies = {
'hrsh7th/cmp-calc',
'hrsh7th/cmp-cmdline',
'hrsh7th/cmp-path',
'hrsh7th/cmp-buffer',
'L3MON4D3/LuaSnip',
'hrsh7th/cmp-nvim-lsp',
'onsails/lspkind.nvim',
},
},
-- Additions
{ 'ray-x/lsp_signature.nvim', event = 'VeryLazy', opts = {
hint_prefix = '',
} },
{
'ray-x/lsp_signature.nvim',
event = 'VeryLazy',
opts = {
hint_prefix = '',
},
},
-- Rust
{ 'mrcjkb/rustaceanvim' },
-- { 'mrcjkb/rustaceanvim' },
}

View File

@@ -4,12 +4,16 @@ return {
'nvim-telescope/telescope.nvim',
dependencies = { 'nvim-lua/plenary.nvim' },
keys = {
{ '<leader>ff', function() require('telescope.builtin').find_files({ show_hidden = true }) end },
{
'<leader>ff',
function()
require('telescope.builtin').find_files({ show_hidden = true })
end,
},
{ '<leader>fs', require('telescope.builtin').live_grep },
{ '<leader>bb', require('telescope.builtin').buffers },
},
},
{ 'nvim-lua/plenary.nvim' },
-- Oil
{

View File

@@ -2,6 +2,8 @@ return {
-- Highlighting
{
'nvim-treesitter/nvim-treesitter',
-- enabled = false,
event = 'VeryLazy',
config = function()
vim.cmd('TSUpdate')
require('nvim-treesitter.configs').setup({