1
0

update to v0.12

This commit is contained in:
Rokas Puzonas 2026-07-05 16:58:30 +03:00
parent 8a026411bc
commit 80186c9a54
14 changed files with 1304 additions and 1476 deletions

10
.gitignore vendored
View File

@ -1,2 +1,8 @@
plugin/packer-compiled.lua tags
*.log test.sh
.luarc.json
nvim
spell/
.DS_Store

View File

@ -1,21 +1,5 @@
# Neovim Config # Neovim config
To ignore changes to local plugins file. Used for keeping computer specific configs/plugins It might to be the best, it might contains bugs, but it's mine and I like it.
```shell
git update-index --assume-unchanged lua/plugins-local.lua
```
## Requirements Used [kickstart.nvim#f0a2108](https://github.com/nvim-lua/kickstart.nvim/tree/f0a2108ed51547793c758d9318bad94f242b22e5) as a template
* ripgrep - for telescope
* [A patched font](https://www.nerdfonts.com/) - for icons
## Todo
* Automatic updating of comments at `#endif`,
```c
#ifdef FOOBAR
// ...
#endif // FOOBAR
// The text "FOOBAR" above should update when the paring `#ifdef` updates
```
* Correctly indent `#ifdef` blocks
* Fix cmacro indent to not reformat lines, if nothing needs to be changed

1899
init.lua

File diff suppressed because it is too large Load Diff

View File

@ -1,52 +0,0 @@
{
"DoxygenToolkit.vim": { "branch": "master", "commit": "afd8663d36d2ec19d26befdb10e89e912d26bbd3" },
"LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" },
"cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" },
"cmp-path": { "branch": "main", "commit": "c6635aae33a50d6010bf1aa756ac2398a2d54c32" },
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
"conform.nvim": { "branch": "master", "commit": "6632e7d788a85bf8405ea0c812d343fc308b7b8c" },
"dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" },
"editorconfig-vim": { "branch": "master", "commit": "91bd0b0a2c6a72a110ab9feae335e1224480c233" },
"fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" },
"gitsigns.nvim": { "branch": "main", "commit": "02eafb1273afec94447f66d1a43fc5e477c2ab8a" },
"global-note.nvim": { "branch": "main", "commit": "1e0d4bba425d971ed3ce40d182c574a25507115c" },
"indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" },
"kitty-navigator.nvim": { "branch": "main", "commit": "abaaa37fe14cf762a8957a64ff50d2233aff7fe6" },
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
"lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" },
"lazygit.nvim": { "branch": "main", "commit": "b9eae3badab982e71abab96d3ee1d258f0c07961" },
"luvit-meta": { "branch": "main", "commit": "1df30b60b1b4aecfebc785aa98943db6c6989716" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" },
"mason-nvim-dap.nvim": { "branch": "main", "commit": "4c2cdc69d69fe00c15ae8648f7e954d99e5de3ea" },
"mason-tool-installer.nvim": { "branch": "main", "commit": "1255518cb067e038a4755f5cb3e980f79b6ab89c" },
"mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" },
"mini.nvim": { "branch": "main", "commit": "ed581c333798e08a68fbe1aecfdf95d3c1432d3f" },
"move.nvim": { "branch": "main", "commit": "cccbd4ea9049ca5f99f025ffaddb7392359c7d6a" },
"nvim-bqf": { "branch": "main", "commit": "e20417d5e589e03eaaaadc4687904528500608be" },
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
"nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" },
"nvim-dap": { "branch": "master", "commit": "7aade9e99bef5f0735cf966e715b3ce45515d786" },
"nvim-dap-go": { "branch": "main", "commit": "8763ced35b19c8dc526e04a70ab07c34e11ad064" },
"nvim-dap-ui": { "branch": "master", "commit": "881a69e25bd6658864fab47450025490b74be878" },
"nvim-lint": { "branch": "master", "commit": "3615c26c4922ae5f7366f0c1943a0e7cece04325" },
"nvim-lspconfig": { "branch": "master", "commit": "32b6a6449aaba11461fffbb596dd6310af79eea4" },
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
"nvim-treesitter": { "branch": "master", "commit": "684eeac91ed8e297685a97ef70031d19ac1de25a" },
"nvim-web-devicons": { "branch": "master", "commit": "c90dee4e930ab9f49fa6d77f289bff335b49e972" },
"oil.nvim": { "branch": "master", "commit": "302bbaceeafc690e6419e0c8296e804d60cb9446" },
"playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" },
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
"quick-scope": { "branch": "master", "commit": "f2b6043e04d9ef05205c8953e389304a4c1946f2" },
"srcery-vim": { "branch": "master", "commit": "d8915c0153ed451c975fa20356cb8c254232aa28" },
"tabular": { "branch": "master", "commit": "12437cd1b53488e24936ec4b091c9324cafee311" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" },
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
"telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
"todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" },
"vim-glsl": { "branch": "master", "commit": "40dd0b143ef93f3930a8a409f60c1bb85e28b727" },
"vim-indent-object": { "branch": "master", "commit": "8ab36d5ec2a3a60468437a95e142ce994df598c6" },
"vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" },
"vim-smoothie": { "branch": "master", "commit": "df1e324e9f3395c630c1c523d0555a01d2eb1b7e" },
"which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" },
"zen-mode.nvim": { "branch": "main", "commit": "863f150ca321b3dd8aa1a2b69b5f411a220e144f" }
}

View File

@ -12,7 +12,7 @@ local check_version = function()
return return
end end
if vim.version.ge(vim.version(), '0.10-dev') then if vim.version.ge(vim.version(), '0.12') then
vim.health.ok(string.format("Neovim version is: '%s'", verstr)) vim.health.ok(string.format("Neovim version is: '%s'", verstr))
else else
vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr)) vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr))

View File

@ -1,16 +1,5 @@
-- autopairs -- autopairs
-- https://github.com/windwp/nvim-autopairs -- https://github.com/windwp/nvim-autopairs
return { vim.pack.add { 'https://github.com/windwp/nvim-autopairs' }
'windwp/nvim-autopairs', require('nvim-autopairs').setup {}
event = 'InsertEnter',
-- Optional dependency
dependencies = { 'hrsh7th/nvim-cmp' },
config = function()
require('nvim-autopairs').setup {}
-- If you want to automatically add `(` after selecting a function or method
local cmp_autopairs = require 'nvim-autopairs.completion.cmp'
local cmp = require 'cmp'
cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done())
end,
}

View File

@ -6,143 +6,90 @@
-- be extended to other languages as well. That's why it's called -- be extended to other languages as well. That's why it's called
-- kickstart.nvim and not kitchen-sink.nvim ;) -- kickstart.nvim and not kitchen-sink.nvim ;)
return { vim.pack.add {
-- NOTE: Yes, you can install new plugins here! 'https://github.com/mfussenegger/nvim-dap',
'mfussenegger/nvim-dap', 'https://github.com/rcarriga/nvim-dap-ui',
-- NOTE: And you can specify dependencies as well 'https://github.com/nvim-neotest/nvim-nio',
dependencies = { 'https://github.com/mason-org/mason.nvim',
-- Creates a beautiful debugger UI 'https://github.com/jay-babu/mason-nvim-dap.nvim',
'rcarriga/nvim-dap-ui', 'https://github.com/leoluz/nvim-dap-go',
}
-- Required dependency for nvim-dap-ui
'nvim-neotest/nvim-nio', -- Basic debugging keymaps, feel free to change to your liking!
vim.keymap.set('n', '<F5>', function() require('dap').continue() end, { desc = 'Debug: Start/Continue' })
-- Installs the debug adapters for you vim.keymap.set('n', '<F1>', function() require('dap').step_into() end, { desc = 'Debug: Step Into' })
'williamboman/mason.nvim', vim.keymap.set('n', '<F2>', function() require('dap').step_over() end, { desc = 'Debug: Step Over' })
'jay-babu/mason-nvim-dap.nvim', vim.keymap.set('n', '<F3>', function() require('dap').step_out() end, { desc = 'Debug: Step Out' })
vim.keymap.set('n', '<leader>b', function() require('dap').toggle_breakpoint() end, { desc = 'Debug: Toggle Breakpoint' })
-- Add your own debuggers here vim.keymap.set('n', '<leader>B', function() require('dap').set_breakpoint(vim.fn.input 'Breakpoint condition: ') end, { desc = 'Debug: Set Breakpoint' })
'leoluz/nvim-dap-go', -- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception.
}, vim.keymap.set('n', '<F7>', function() require('dapui').toggle() end, { desc = 'Debug: See last session result.' })
keys = {
-- Basic debugging keymaps, feel free to change to your liking! local dap = require 'dap'
{ local dapui = require 'dapui'
'<F5>',
function() require('mason-nvim-dap').setup {
require('dap').continue() -- Makes a best effort to setup the various debuggers with
end, -- reasonable debug configurations
desc = 'Debug: Start/Continue', automatic_installation = true,
},
{ -- You can provide additional configuration to the handlers,
'<F1>', -- see mason-nvim-dap README for more information
function() handlers = {},
require('dap').step_into()
end, -- You'll need to check that you have the required things installed
desc = 'Debug: Step Into', -- online, please don't ask me how to install them :)
}, ensure_installed = {
{ -- Update this to ensure that you have the debuggers for the langs you want
'<F2>', 'delve',
function() },
require('dap').step_over() }
end,
desc = 'Debug: Step Over', -- Dap UI setup
}, -- For more information, see |:help nvim-dap-ui|
{ ---@diagnostic disable-next-line: missing-fields
'<F3>', dapui.setup {
function() -- Set icons to characters that are more likely to work in every terminal.
require('dap').step_out() -- Feel free to remove or use ones that you like more! :)
end, -- Don't feel like these are good choices.
desc = 'Debug: Step Out', icons = { expanded = '', collapsed = '', current_frame = '*' },
}, ---@diagnostic disable-next-line: missing-fields
{ controls = {
'<leader>b', icons = {
function() pause = '',
require('dap').toggle_breakpoint() play = '',
end, step_into = '',
desc = 'Debug: Toggle Breakpoint', step_over = '',
}, step_out = '',
{ step_back = 'b',
'<leader>B', run_last = '▶▶',
function() terminate = '',
require('dap').set_breakpoint(vim.fn.input 'Breakpoint condition: ') disconnect = '',
end, },
desc = 'Debug: Set Breakpoint', },
}, }
-- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception.
{ -- Change breakpoint icons
'<F7>', -- vim.api.nvim_set_hl(0, 'DapBreak', { fg = '#e51400' })
function() -- vim.api.nvim_set_hl(0, 'DapStop', { fg = '#ffcc00' })
require('dapui').toggle() -- local breakpoint_icons = vim.g.have_nerd_font
end, -- and { Breakpoint = '', BreakpointCondition = '', BreakpointRejected = '', LogPoint = '', Stopped = '' }
desc = 'Debug: See last session result.', -- or { Breakpoint = '●', BreakpointCondition = '⊜', BreakpointRejected = '⊘', LogPoint = '◆', Stopped = '⭔' }
}, -- for type, icon in pairs(breakpoint_icons) do
}, -- local tp = 'Dap' .. type
config = function() -- local hl = (type == 'Stopped') and 'DapStop' or 'DapBreak'
local dap = require 'dap' -- vim.fn.sign_define(tp, { text = icon, texthl = hl, numhl = hl })
local dapui = require 'dapui' -- end
require('mason-nvim-dap').setup { dap.listeners.after.event_initialized['dapui_config'] = dapui.open
-- Makes a best effort to setup the various debuggers with dap.listeners.before.event_terminated['dapui_config'] = dapui.close
-- reasonable debug configurations dap.listeners.before.event_exited['dapui_config'] = dapui.close
automatic_installation = true,
-- Install golang specific config
-- You can provide additional configuration to the handlers, require('dap-go').setup {
-- see mason-nvim-dap README for more information delve = {
handlers = {}, -- On Windows delve must be run attached or it crashes.
-- See https://github.com/leoluz/nvim-dap-go/blob/main/README.md#configuring
-- You'll need to check that you have the required things installed detached = vim.fn.has 'win32' == 0,
-- online, please don't ask me how to install them :) },
ensure_installed = {
-- Update this to ensure that you have the debuggers for the langs you want
'delve',
},
}
-- Dap UI setup
-- For more information, see |:help nvim-dap-ui|
dapui.setup {
-- Set icons to characters that are more likely to work in every terminal.
-- Feel free to remove or use ones that you like more! :)
-- Don't feel like these are good choices.
icons = { expanded = '', collapsed = '', current_frame = '*' },
controls = {
icons = {
pause = '',
play = '',
step_into = '',
step_over = '',
step_out = '',
step_back = 'b',
run_last = '▶▶',
terminate = '',
disconnect = '',
},
},
}
-- Change breakpoint icons
-- vim.api.nvim_set_hl(0, 'DapBreak', { fg = '#e51400' })
-- vim.api.nvim_set_hl(0, 'DapStop', { fg = '#ffcc00' })
-- local breakpoint_icons = vim.g.have_nerd_font
-- and { Breakpoint = '', BreakpointCondition = '', BreakpointRejected = '', LogPoint = '', Stopped = '' }
-- or { Breakpoint = '●', BreakpointCondition = '⊜', BreakpointRejected = '⊘', LogPoint = '◆', Stopped = '⭔' }
-- for type, icon in pairs(breakpoint_icons) do
-- local tp = 'Dap' .. type
-- local hl = (type == 'Stopped') and 'DapStop' or 'DapBreak'
-- vim.fn.sign_define(tp, { text = icon, texthl = hl, numhl = hl })
-- end
dap.listeners.after.event_initialized['dapui_config'] = dapui.open
dap.listeners.before.event_terminated['dapui_config'] = dapui.close
dap.listeners.before.event_exited['dapui_config'] = dapui.close
-- Install golang specific config
require('dap-go').setup {
delve = {
-- On Windows delve must be run attached or it crashes.
-- See https://github.com/leoluz/nvim-dap-go/blob/main/README.md#configuring
detached = vim.fn.has 'win32' == 0,
},
}
end,
} }

View File

@ -1,59 +1,57 @@
-- Adds git related signs to the gutter, as well as utilities for managing changes -- Adds git related signs to the gutter, as well as utilities for managing changes
-- NOTE: gitsigns is already included in init.lua but contains only the base
-- config. This will add also the recommended keymaps.
return { vim.pack.add { 'https://github.com/lewis6991/gitsigns.nvim' }
{
'lewis6991/gitsigns.nvim',
opts = {
on_attach = function(bufnr)
local gitsigns = require 'gitsigns'
local function map(mode, l, r, opts) require('gitsigns').setup {
opts = opts or {} on_attach = function(bufnr)
opts.buffer = bufnr local gitsigns = require 'gitsigns'
vim.keymap.set(mode, l, r, opts)
end
-- Navigation local function map(mode, l, r, opts)
map('n', ']c', function() opts = opts or {}
if vim.wo.diff then opts.buffer = bufnr
vim.cmd.normal { ']c', bang = true } vim.keymap.set(mode, l, r, opts)
else end
gitsigns.nav_hunk 'next'
end
end, { desc = 'Jump to next git [c]hange' })
map('n', '[c', function() -- Navigation
if vim.wo.diff then map('n', ']c', function()
vim.cmd.normal { '[c', bang = true } if vim.wo.diff then
else vim.cmd.normal { ']c', bang = true }
gitsigns.nav_hunk 'prev' else
end gitsigns.nav_hunk 'next'
end, { desc = 'Jump to previous git [c]hange' }) end
end, { desc = 'Jump to next git [c]hange' })
-- Actions map('n', '[c', function()
-- visual mode if vim.wo.diff then
map('v', '<leader>hs', function() vim.cmd.normal { '[c', bang = true }
gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } else
end, { desc = 'git [s]tage hunk' }) gitsigns.nav_hunk 'prev'
map('v', '<leader>hr', function() end
gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'Jump to previous git [c]hange' })
end, { desc = 'git [r]eset hunk' })
-- normal mode -- Actions
map('n', '<leader>hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' }) -- visual mode
map('n', '<leader>hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' }) map('v', '<leader>hs', function() gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [s]tage hunk' })
map('n', '<leader>hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' }) map('v', '<leader>hr', function() gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [r]eset hunk' })
map('n', '<leader>hu', gitsigns.undo_stage_hunk, { desc = 'git [u]ndo stage hunk' }) -- normal mode
map('n', '<leader>hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' }) map('n', '<leader>hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' })
map('n', '<leader>hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' }) map('n', '<leader>hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' })
map('n', '<leader>hb', gitsigns.blame_line, { desc = 'git [b]lame line' }) map('n', '<leader>hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' })
map('n', '<leader>hd', gitsigns.diffthis, { desc = 'git [d]iff against index' }) map('n', '<leader>hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' })
map('n', '<leader>hD', function() map('n', '<leader>hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' })
gitsigns.diffthis '@' map('n', '<leader>hi', gitsigns.preview_hunk_inline, { desc = 'git preview hunk [i]nline' })
end, { desc = 'git [D]iff against last commit' }) map('n', '<leader>hb', function() gitsigns.blame_line { full = true } end, { desc = 'git [b]lame line' })
-- Toggles map('n', '<leader>hd', gitsigns.diffthis, { desc = 'git [d]iff against index' })
map('n', '<leader>tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' }) map('n', '<leader>hD', function() gitsigns.diffthis '@' end, { desc = 'git [D]iff against last commit' })
map('n', '<leader>tD', gitsigns.toggle_deleted, { desc = '[T]oggle git show [D]eleted' }) map('n', '<leader>hQ', function() gitsigns.setqflist 'all' end, { desc = 'git hunk [Q]uickfix list (all files in repo)' })
end, map('n', '<leader>hq', gitsigns.setqflist, { desc = 'git hunk [q]uickfix list (all changes in this file)' })
}, -- Toggles
}, map('n', '<leader>tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' })
map('n', '<leader>tw', gitsigns.toggle_word_diff, { desc = '[T]oggle git intra-line [w]ord diff' })
-- Text object
map({ 'o', 'x' }, 'ih', gitsigns.select_hunk)
end,
} }

View File

@ -1,9 +1,6 @@
return { -- Add indentation guides even on blank lines
{ -- Add indentation guides even on blank lines
'lukas-reineke/indent-blankline.nvim', -- Enable `lukas-reineke/indent-blankline.nvim`
-- Enable `lukas-reineke/indent-blankline.nvim` -- See `:help ibl`
-- See `:help ibl` vim.pack.add { 'https://github.com/lukas-reineke/indent-blankline.nvim' }
main = 'ibl', require('ibl').setup {}
opts = {},
},
}

View File

@ -1,60 +1,53 @@
return { -- Linting
{ -- Linting vim.pack.add { 'https://github.com/mfussenegger/nvim-lint' }
'mfussenegger/nvim-lint',
event = { 'BufReadPre', 'BufNewFile' },
config = function()
local lint = require 'lint'
lint.linters_by_ft = {
markdown = {},
}
-- To allow other plugins to add linters to require('lint').linters_by_ft, local lint = require 'lint'
-- instead set linters_by_ft like this: lint.linters_by_ft = {
-- lint.linters_by_ft = lint.linters_by_ft or {} markdown = { 'markdownlint' }, -- Make sure to install `markdownlint` via mason / npm
-- lint.linters_by_ft['markdown'] = { 'markdownlint' }
--
-- However, note that this will enable a set of default linters,
-- which will cause errors unless these tools are available:
-- {
-- clojure = { "clj-kondo" },
-- dockerfile = { "hadolint" },
-- inko = { "inko" },
-- janet = { "janet" },
-- json = { "jsonlint" },
-- markdown = { "vale" },
-- rst = { "vale" },
-- ruby = { "ruby" },
-- terraform = { "tflint" },
-- text = { "vale" }
-- }
--
-- You can disable the default linters by setting their filetypes to nil:
-- lint.linters_by_ft['clojure'] = nil
-- lint.linters_by_ft['dockerfile'] = nil
-- lint.linters_by_ft['inko'] = nil
-- lint.linters_by_ft['janet'] = nil
-- lint.linters_by_ft['json'] = nil
-- lint.linters_by_ft['markdown'] = nil
-- lint.linters_by_ft['rst'] = nil
-- lint.linters_by_ft['ruby'] = nil
-- lint.linters_by_ft['terraform'] = nil
-- lint.linters_by_ft['text'] = nil
-- Create autocommand which carries out the actual linting
-- on the specified events.
local lint_augroup = vim.api.nvim_create_augroup('lint', { clear = true })
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, {
group = lint_augroup,
callback = function()
-- Only run the linter in buffers that you can modify in order to
-- avoid superfluous noise, notably within the handy LSP pop-ups that
-- describe the hovered symbol using Markdown.
if vim.opt_local.modifiable:get() then
lint.try_lint()
end
end,
})
end,
},
} }
-- To allow other plugins to add linters to require('lint').linters_by_ft,
-- instead set linters_by_ft like this:
-- lint.linters_by_ft = lint.linters_by_ft or {}
-- lint.linters_by_ft['markdown'] = { 'markdownlint' }
--
-- However, note that this will enable a set of default linters,
-- which will cause errors unless these tools are available:
-- {
-- clojure = { "clj-kondo" },
-- dockerfile = { "hadolint" },
-- inko = { "inko" },
-- janet = { "janet" },
-- json = { "jsonlint" },
-- markdown = { "vale" },
-- rst = { "vale" },
-- ruby = { "ruby" },
-- terraform = { "tflint" },
-- text = { "vale" }
-- }
--
-- You can disable the default linters by setting their filetypes to nil:
-- lint.linters_by_ft['clojure'] = nil
-- lint.linters_by_ft['dockerfile'] = nil
-- lint.linters_by_ft['inko'] = nil
-- lint.linters_by_ft['janet'] = nil
-- lint.linters_by_ft['json'] = nil
-- lint.linters_by_ft['markdown'] = nil
-- lint.linters_by_ft['rst'] = nil
-- lint.linters_by_ft['ruby'] = nil
-- lint.linters_by_ft['terraform'] = nil
-- lint.linters_by_ft['text'] = nil
-- Create autocommand which carries out the actual linting
-- on the specified events.
local lint_augroup = vim.api.nvim_create_augroup('lint', { clear = true })
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, {
group = lint_augroup,
callback = function()
-- Only run the linter in buffers that you can modify in order to
-- avoid superfluous noise, notably within the handy LSP pop-ups that
-- describe the hovered symbol using Markdown.
if vim.bo.modifiable then lint.try_lint() end
end,
})

View File

@ -1,24 +1,19 @@
-- Neo-tree is a Neovim plugin to browse the file system -- Neo-tree is a Neovim plugin to browse the file system
-- https://github.com/nvim-neo-tree/neo-tree.nvim -- https://github.com/nvim-neo-tree/neo-tree.nvim
return { vim.pack.add {
'nvim-neo-tree/neo-tree.nvim', { src = 'https://github.com/nvim-neo-tree/neo-tree.nvim', version = vim.version.range '*' },
version = '*', 'https://github.com/nvim-lua/plenary.nvim',
dependencies = { 'https://github.com/MunifTanjim/nui.nvim',
'nvim-lua/plenary.nvim', }
'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended
'MunifTanjim/nui.nvim', vim.keymap.set('n', '\\', '<Cmd>Neotree reveal<CR>', { desc = 'NeoTree reveal', silent = true })
},
cmd = 'Neotree', require('neo-tree').setup {
keys = { filesystem = {
{ '\\', ':Neotree reveal<CR>', desc = 'NeoTree reveal', silent = true }, window = {
}, mappings = {
opts = { ['\\'] = 'close_window',
filesystem = {
window = {
mappings = {
['\\'] = 'close_window',
},
}, },
}, },
}, },

View File

@ -1,39 +1,33 @@
local M = {} -- TODO: Make it work with buffer which don't have a filename yet
function M.load() vim.api.nvim_create_user_command('AddIncludeGuard', function(data)
-- TODO: Make it work with buffer which don't have a filename yet local bufnr = vim.api.nvim_get_current_buf()
local name_pattern = data.fargs[1] or '%s_'
vim.api.nvim_create_user_command('AddIncludeGuard', function(data) local function formatName(filename)
local bufnr = vim.api.nvim_get_current_buf() local parts = vim.split(filename, '[/\\]', { trimempty = true })
local name_pattern = data.fargs[1] or '%s_' local last_part = parts[#parts]
local ext = last_part:match '%.([^%.]+)$'
local name = last_part:gsub('%.[^%.]+$', '')
local function formatName(filename) if ext == 'h' or ext == 'hpp' then
local parts = vim.split(filename, '[/\\]', { trimempty = true }) name = name .. '_H'
local last_part = parts[#parts]
local ext = last_part:match '%.([^%.]+)$'
local name = last_part:gsub('%.[^%.]+$', '')
if ext == 'h' or ext == 'hpp' then
name = name .. '_H'
end
return name_pattern:format(name:upper())
end end
local buf_filename = vim.api.nvim_buf_get_name(bufnr) return name_pattern:format(name:upper())
local guard_name = formatName(buf_filename) end
vim.api.nvim_buf_set_lines(bufnr, 0, 0, false, { local buf_filename = vim.api.nvim_buf_get_name(bufnr)
'#ifndef ' .. guard_name, local guard_name = formatName(buf_filename)
'#define ' .. guard_name,
'',
})
vim.api.nvim_buf_set_lines(bufnr, -1, -1, false, { vim.api.nvim_buf_set_lines(bufnr, 0, 0, false, {
'', '#ifndef ' .. guard_name,
'#endif //' .. guard_name, '#define ' .. guard_name,
}) '',
end, { nargs = '?' }) })
end
return M vim.api.nvim_buf_set_lines(bufnr, -1, -1, false, {
'',
'#endif //' .. guard_name,
})
end, { nargs = '?' })

View File

@ -1,40 +1,35 @@
local M = {}
function M.load() -- Setup tree sitter
-- Setup tree sitter require('nvim-treesitter.parsers').uci = {
local parser_config = require('nvim-treesitter.parsers').get_parser_configs() install_info = {
parser_config.uci = { url = 'git@rpuzonas.com:rpuzonas/tree-sitter-uci.git',
install_info = { files = { 'src/parser.c' },
url = 'git@rpuzonas.com:rpuzonas/tree-sitter-uci.git', branch = 'main',
files = { 'src/parser.c' }, generate_requires_npm = false,
branch = 'main', requires_generate_from_grammar = false,
generate_requires_npm = false, },
requires_generate_from_grammar = false, filetype = 'uci',
}, }
filetype = 'uci',
}
-- Determine UCI filetype by contents of file. -- Determine UCI filetype by contents of file.
-- If file has no extension and at least one line contains the word "config" -- If file has no extension and at least one line contains the word "config"
-- TODO: -- TODO:
--[[ --[[
vim.filetype.add({ vim.filetype.add({
pattern = { pattern = {
[".*/etc/config/.*"] = "uci", [".*/etc/config/.*"] = "uci",
[".*/[^%.]+"] = { [".*/[^%.]+"] = {
priority = -math.huge, priority = -math.huge,
function(_, bufnr) function(_, bufnr)
for _, line in ipairs(vim.filetype.getlines(bufnr)) do for _, line in ipairs(vim.filetype.getlines(bufnr)) do
if line:find("config") ~= nil then if line:find("config") ~= nil then
return "uci" return "uci"
end end
end end
end end
} }
} }
}) })
]] ]]
-- --
end
return M

175
nvim-pack-lock.json Normal file
View File

@ -0,0 +1,175 @@
{
"plugins": {
"DoxygenToolkit.vim": {
"rev": "afd8663d36d2ec19d26befdb10e89e912d26bbd3",
"src": "https://github.com/vim-scripts/DoxygenToolkit.vim"
},
"LuaSnip": {
"rev": "642b0c595e11608b4c18219e93b88d7637af27bc",
"src": "https://github.com/L3MON4D3/LuaSnip",
"version": "2.0.0 - 3.0.0"
},
"blink.cmp": {
"rev": "78336bc89ee5365633bcf754d93df01678b5c08f",
"src": "https://github.com/saghen/blink.cmp",
"version": "1.0.0 - 2.0.0"
},
"conform.nvim": {
"rev": "619363c30309d29ffa631e67c8183f2a72caa373",
"src": "https://github.com/stevearc/conform.nvim"
},
"editorconfig-vim": {
"rev": "13b86c5c691785ffbf2d6508c621dabb08e93df0",
"src": "https://github.com/editorconfig/editorconfig-vim"
},
"fidget.nvim": {
"rev": "6f793b2bcd2d35e201c09520f698bb763220908a",
"src": "https://github.com/j-hui/fidget.nvim"
},
"gitsigns.nvim": {
"rev": "eb60cc7b94c46005237fd34170d76f3a089a90aa",
"src": "https://github.com/lewis6991/gitsigns.nvim"
},
"guess-indent.nvim": {
"rev": "84a4987ff36798c2fc1169cbaff67960aed9776f",
"src": "https://github.com/NMAC427/guess-indent.nvim"
},
"indent-blankline.nvim": {
"rev": "d28a3f70721c79e3c5f6693057ae929f3d9c0a03",
"src": "https://github.com/lukas-reineke/indent-blankline.nvim"
},
"kitty-navigator.nvim": {
"rev": "116b88674503edb21481bebdd62212485817fa4a",
"src": "https://github.com/MunsMan/kitty-navigator.nvim"
},
"lazygit.nvim": {
"rev": "a04ad0dbc725134edbee3a5eea29290976695357",
"src": "https://github.com/kdheepak/lazygit.nvim"
},
"mason-lspconfig.nvim": {
"rev": "47059d71b42d74b0a1e9f61c1d99d301039c3b5b",
"src": "https://github.com/mason-org/mason-lspconfig.nvim"
},
"mason-nvim-dap.nvim": {
"rev": "9a10e096703966335bd5c46c8c875d5b0690dade",
"src": "https://github.com/jay-babu/mason-nvim-dap.nvim"
},
"mason-tool-installer.nvim": {
"rev": "443f1ef8b5e6bf47045cb2217b6f748a223cf7dc",
"src": "https://github.com/WhoIsSethDaniel/mason-tool-installer.nvim"
},
"mason.nvim": {
"rev": "2a6940af80375532e5e9e7c1f2fc6319a1b7a69d",
"src": "https://github.com/mason-org/mason.nvim"
},
"mini.nvim": {
"rev": "c5cdbadeb423ff724e27a42ab2d1c504d1d6fc5a",
"src": "https://github.com/nvim-mini/mini.nvim"
},
"move.nvim": {
"rev": "599b14047b82e92874b9a408e4df228b965c3a1d",
"src": "https://github.com/fedepujol/move.nvim"
},
"nvim-bqf": {
"rev": "ba2b365969d7c2c6301d48e13aeee59568765529",
"src": "https://github.com/kevinhwang91/nvim-bqf"
},
"nvim-colorizer.lua": {
"rev": "81e676d3203c9eb6e4c0ccf1eba1679296ef923f",
"src": "https://github.com/catgoose/nvim-colorizer.lua"
},
"nvim-dap": {
"rev": "9e848e09a697ee95302a3ef2dd43fd6eb709e570",
"src": "https://github.com/mfussenegger/nvim-dap"
},
"nvim-dap-go": {
"rev": "b4421153ead5d726603b02743ea40cf26a51ed5f",
"src": "https://github.com/leoluz/nvim-dap-go"
},
"nvim-dap-ui": {
"rev": "1a66cabaa4a4da0be107d5eda6d57242f0fe7e49",
"src": "https://github.com/rcarriga/nvim-dap-ui"
},
"nvim-lint": {
"rev": "a219b2c9e5b4765e5c845aba119dad55806fcaf1",
"src": "https://github.com/mfussenegger/nvim-lint"
},
"nvim-lspconfig": {
"rev": "d696e36d5792daf828f8c8e8d4b9aa90c1a10c2a",
"src": "https://github.com/neovim/nvim-lspconfig"
},
"nvim-nio": {
"rev": "21f5324bfac14e22ba26553caf69ec76ae8a7662",
"src": "https://github.com/nvim-neotest/nvim-nio"
},
"nvim-treesitter": {
"rev": "4916d6592ede8c07973490d9322f187e07dfefac",
"src": "https://github.com/nvim-treesitter/nvim-treesitter",
"version": "'main'"
},
"nvim-web-devicons": {
"rev": "6788013bb9cb784e606ada44206b0e755e4323d7",
"src": "https://github.com/nvim-tree/nvim-web-devicons"
},
"oil.nvim": {
"rev": "756dec855b4811f2d27f067a3aca477f368d99f5",
"src": "https://github.com/stevearc/oil.nvim"
},
"plenary.nvim": {
"rev": "74b06c6c75e4eeb3108ec01852001636d85a932b",
"src": "https://github.com/nvim-lua/plenary.nvim"
},
"quick-scope": {
"rev": "6cee1d9e0b9ac0fbffeb538d4a5ba9f5628fabbc",
"src": "https://github.com/unblevable/quick-scope"
},
"srcery-vim": {
"rev": "38f52babe0fa2b11719b51eb045a85244d6d7883",
"src": "https://github.com/srcery-colors/srcery-vim"
},
"tabular": {
"rev": "12437cd1b53488e24936ec4b091c9324cafee311",
"src": "https://github.com/godlygeek/tabular"
},
"telescope-fzf-native.nvim": {
"rev": "b25b749b9db64d375d782094e2b9dce53ad53a40",
"src": "https://github.com/nvim-telescope/telescope-fzf-native.nvim"
},
"telescope-ui-select.nvim": {
"rev": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2",
"src": "https://github.com/nvim-telescope/telescope-ui-select.nvim"
},
"telescope.nvim": {
"rev": "427b576c16792edad01a92b89721d923c19ad60f",
"src": "https://github.com/nvim-telescope/telescope.nvim"
},
"todo-comments.nvim": {
"rev": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668",
"src": "https://github.com/folke/todo-comments.nvim"
},
"tokyonight.nvim": {
"rev": "cdc07ac78467a233fd62c493de29a17e0cf2b2b6",
"src": "https://github.com/folke/tokyonight.nvim"
},
"vim-glsl": {
"rev": "40dd0b143ef93f3930a8a409f60c1bb85e28b727",
"src": "https://github.com/tikhomirov/vim-glsl"
},
"vim-indent-object": {
"rev": "8ab36d5ec2a3a60468437a95e142ce994df598c6",
"src": "https://github.com/michaeljsmith/vim-indent-object"
},
"vim-sleuth": {
"rev": "be69bff86754b1aa5adcbb527d7fcd1635a84080",
"src": "https://github.com/tpope/vim-sleuth"
},
"vim-smoothie": {
"rev": "df1e324e9f3395c630c1c523d0555a01d2eb1b7e",
"src": "https://github.com/psliwka/vim-smoothie"
},
"which-key.nvim": {
"rev": "3aab2147e74890957785941f0c1ad87d0a44c15a",
"src": "https://github.com/folke/which-key.nvim"
}
}
}