Compare commits

..

1 Commits

Author SHA1 Message Date
orip
e4b8f93e45 Migrate to vim.pack 2026-04-20 01:50:46 +03:00
8 changed files with 261 additions and 254 deletions

103
init.lua
View File

@ -84,9 +84,6 @@ I hope you enjoy your Neovim journey,
P.S. You can delete this when you're done too. It's your config now! :)
--]]
-- Enables faster startup time by caching your compiled Lua modules.
vim.loader.enable()
-- Set <space> as the leader key
-- See `:help mapleader`
-- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used)
@ -97,7 +94,7 @@ vim.g.maplocalleader = ' '
vim.g.have_nerd_font = false
-- [[ Setting options ]]
-- See `:help vim.o`
-- See `:help vim.o`
-- NOTE: You can change these options as you wish!
-- For more options, you can see `:help option-list`
@ -233,17 +230,18 @@ vim.api.nvim_create_autocmd('TextYankPost', {
callback = function() vim.hl.on_yank() end,
})
-- [[ Install plugins with `vim.pack` ]]
-- See `:help vim.pack`, `:help vim.pack-examples` or
-- the excellent blog post from the creator of mini.nvim https://echasnovski.com/blog/2026-03-13-a-guide-to-vim-pack
-- [[ Configure and install plugins with `vim.pack` ]]
--
-- To inspect plugin state and pending updates, run
-- :lua vim.pack.update(nil, { offline = true })
--
-- To update plugins, run
-- :lua vim.pack.update()
--
-- NOTE: Here is where you install your plugins.
local gh = function(repo) return 'https://github.com/' .. repo end
local function run_build(name, cmd, cwd)
local run_build = function(name, cmd, cwd)
local result = vim.system(cmd, { cwd = cwd }):wait()
if result.code ~= 0 then
local stderr = result.stderr or ''
@ -254,8 +252,6 @@ local function run_build(name, cmd, cwd)
end
end
-- This autocommand runs after a plugin is installed or updated and runs the appropriate build command for that plugin if necessary.
-- See `:help vim.pack-events`
vim.api.nvim_create_autocmd('PackChanged', {
callback = function(ev)
local name = ev.data.spec.name
@ -280,11 +276,8 @@ vim.api.nvim_create_autocmd('PackChanged', {
end,
})
local gh = function(repo) return 'https://github.com/' .. repo end
---@type (string|vim.pack.Spec)[]
local plugins = {
-- You can specify plugins using just a git URL. It will use the default branch (usually `main` or `master`)
gh 'NMAC427/guess-indent.nvim',
gh 'lewis6991/gitsigns.nvim',
gh 'folke/which-key.nvim',
@ -297,14 +290,11 @@ local plugins = {
gh 'WhoIsSethDaniel/mason-tool-installer.nvim',
gh 'j-hui/fidget.nvim',
gh 'stevearc/conform.nvim',
-- You can also specify plugin using a version range for its git tag.
-- See `:help vim.version.range()` for more info
{ src = gh 'saghen/blink.cmp', version = vim.version.range '1.*' },
{ src = gh 'L3MON4D3/LuaSnip', version = vim.version.range '2.*' },
{ src = gh 'saghen/blink.cmp', version = vim.version.range '1.x' },
{ src = gh 'L3MON4D3/LuaSnip', version = vim.version.range '2.x' },
gh 'folke/tokyonight.nvim',
gh 'folke/todo-comments.nvim',
gh 'nvim-mini/mini.nvim',
-- It is also possible to specify a branch or a specific commit to checkout
{ src = gh 'nvim-treesitter/nvim-treesitter', version = 'main' },
}
@ -313,14 +303,8 @@ if vim.fn.executable 'make' == 1 then table.insert(plugins, gh 'nvim-telescope/t
-- Useful for getting pretty icons, but requires a Nerd Font.
if vim.g.have_nerd_font then table.insert(plugins, gh 'nvim-tree/nvim-web-devicons') end
-- NOTE: Here is where the plugins are actually installed.
vim.pack.add(plugins)
-- [[ Configure plugins ]]
-- For most plugins you need to call their `.setup()` to start them
--
-- For example, here is the simplest possible setup for `guess-indent.nvim`,
-- which will automatically detect and set your indentation settings based on the current file.
require('guess-indent').setup {}
-- Here is a more advanced example where we pass configuration
@ -351,16 +335,24 @@ require('which-key').setup {
{ 'gr', group = 'LSP Actions', mode = { 'n' } },
},
}
-- Fuzzy Finder (files, lsp, etc)
--
-- By default, Telescope is included and acts as your picker for everything.
-- [[ Fuzzy Finder (files, lsp, etc) ]]
-- # TODO: Rework this docstring
--
-- If you would like to switch to a different picker (like snacks, or fzf-lua)
-- you can disable the Telescope plugin by setting enabled to false and enable
-- your replacement picker by requiring it explicitly (e.g. 'custom.plugins.snacks')
-- Note: If you customize your config for yourself,
-- its best to remove the Telescope plugin config entirely
-- instead of just disabling it here, to keep your config clean.
--
-- Telescope is a fuzzy finder that comes with a lot of different things that
-- it can fuzzy find! It's more than just a "file finder", it can search
-- many different aspects of Neovim, your workspace, LSP, and more!
--
-- There are lots of other alternative pickers (like snacks.picker, or fzf-lua)
-- so feel free to experiment and see what you like!
--
-- The easiest way to use Telescope, is to start by doing something like:
-- :Telescope help_tags
--
@ -376,6 +368,7 @@ require('which-key').setup {
-- Telescope picker. This is really useful to discover what Telescope can
-- do as well as how to actually do it!
-- [[ Configure Telescope ]]
-- See `:help telescope` and `:help telescope.setup()`
require('telescope').setup {
-- You can put your default mappings / updates / etc. in here
@ -470,7 +463,15 @@ vim.keymap.set(
-- Shortcut for searching your Neovim configuration files
vim.keymap.set('n', '<leader>sn', function() builtin.find_files { cwd = vim.fn.stdpath 'config' } end, { desc = '[S]earch [N]eovim files' })
-- [[ LSP Configuration ]]
-- LSP Plugins
-- Automatically install LSPs and related tools to stdpath for Neovim
-- Mason must be loaded before its dependents so we need to set it up here.
require('mason').setup {}
-- Useful status updates for LSP.
require('fidget').setup {}
-- Brief aside: **What is LSP?**
--
-- LSP is an initialism you've probably heard, but might not understand what it is.
@ -496,9 +497,6 @@ vim.keymap.set('n', '<leader>sn', function() builtin.find_files { cwd = vim.fn.s
-- If you're wondering about lsp vs treesitter, you can check out the wonderfully
-- and elegantly composed help section, `:help lsp-vs-treesitter`
-- Useful status updates for LSP.
require('fidget').setup {}
-- This function gets run when an LSP attaches to a particular buffer.
-- That is to say, every time a new file is opened that is associated with
-- an lsp (for example, opening `main.rs` is associated with `rust_analyzer`) this
@ -620,9 +618,6 @@ local servers = {
},
}
-- Automatically install LSPs and related tools to stdpath for Neovim
require('mason').setup {}
-- Ensure the servers and tools above are installed
--
-- To check the current status of installed tools and/or manually install
@ -642,7 +637,7 @@ for name, server in pairs(servers) do
vim.lsp.enable(name)
end
-- [[ Formatting ]]
-- Autoformat
require('conform').setup {
notify_on_error = false,
format_on_save = function(bufnr)
@ -673,19 +668,17 @@ require('conform').setup {
vim.keymap.set({ 'n', 'v' }, '<leader>f', function() require('conform').format { async = true } end, { desc = '[F]ormat buffer' })
-- [[ Autocompletion Configuration ]]
-- Snippet Engine
require('luasnip').setup {}
--
-- `friendly-snippets` contains a variety of premade snippets.
-- See the README about individual language/framework/plugin snippets:
-- https://github.com/rafamadriz/friendly-snippets
--
-- vim.pack.add { gh 'rafamadriz/friendly-snippets' }
-- vim.pack.add(gh 'rafamadriz/friendly-snippets')
-- require('luasnip.loaders.from_vscode').lazy_load()
require('luasnip').setup {}
-- The autocomplete engine
-- Autocompletion
require('blink.cmp').setup {
keymap = {
-- 'default' (recommended) for mappings similar to built-in completions
@ -746,10 +739,9 @@ require('blink.cmp').setup {
signature = { enabled = true },
}
-- [[ Colorscheme ]]
-- You can easily change to a different colorscheme.
-- Change the name of the colorscheme plugin below, and then
-- change the command under that to load whatever the name of that colorscheme is.
-- change the command in the config to whatever the name of that colorscheme is.
--
-- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`.
---@diagnostic disable-next-line: missing-fields
@ -807,11 +799,9 @@ statusline.section_location = function() return '%2l:%-2v' end
-- ... and there is more!
-- Check out: https://github.com/nvim-mini/mini.nvim
-- [[ Configure Treesitter ]]
-- Used ighlight, edit, and navigate code
--
-- See `:help nvim-treesitter-intro`
-- Highlight, edit, and navigate code
-- [[ Configure Treesitter ]] See `:help nvim-treesitter-intro`
-- ensure basic parser are installed
local parsers = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }
require('nvim-treesitter').install(parsers)
@ -869,17 +859,20 @@ vim.api.nvim_create_autocmd('FileType', {
-- Here are some example plugins that I've included in the Kickstart repository.
-- Uncomment any of the lines below to enable them (you will need to restart nvim).
--
-- require 'kickstart.plugins.debug'
-- require 'kickstart.plugins.indent_line'
-- require 'kickstart.plugins.lint'
-- require 'kickstart.plugins.autopairs'
-- require 'kickstart.plugins.neo-tree'
-- require 'kickstart.plugins.gitsigns' -- adds gitsigns recommended keymaps
-- require 'kickstart.plugins.debug'()
-- require 'kickstart.plugins.indent_line'()
-- require 'kickstart.plugins.lint'()
-- require 'kickstart.plugins.autopairs'()
-- require 'kickstart.plugins.neo-tree'()
-- require 'kickstart.plugins.gitsigns'() -- adds gitsigns recommended keymaps
-- NOTE: You can add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
--
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
-- require 'custom.plugins'
-- require('custom.plugins')()
--
-- For additional information with loading, sourcing and examples see `:help vim.pack`
-- and `:help vim.pack-examples`
-- The line beneath this is called `modeline`. See `:help modeline`
-- vim: ts=2 sts=2 sw=2 et

View File

@ -3,6 +3,8 @@
--
-- See the kickstart.nvim README for more information
-- Example:
-- vim.pack.add({ 'https://github.com/folke/trouble.nvim' })
-- require('trouble').setup {}
return function()
-- Example:
-- vim.pack.add({ 'https://github.com/folke/trouble.nvim' })
-- require('trouble').setup {}
end

View File

@ -1,5 +1,7 @@
-- autopairs
-- https://github.com/windwp/nvim-autopairs
vim.pack.add { 'https://github.com/windwp/nvim-autopairs' }
require('nvim-autopairs').setup {}
return function()
vim.pack.add { 'https://github.com/windwp/nvim-autopairs' }
require('nvim-autopairs').setup {}
end

View File

@ -6,90 +6,92 @@
-- be extended to other languages as well. That's why it's called
-- kickstart.nvim and not kitchen-sink.nvim ;)
vim.pack.add {
'https://github.com/mfussenegger/nvim-dap',
'https://github.com/rcarriga/nvim-dap-ui',
'https://github.com/nvim-neotest/nvim-nio',
'https://github.com/mason-org/mason.nvim',
'https://github.com/jay-babu/mason-nvim-dap.nvim',
'https://github.com/leoluz/nvim-dap-go',
}
return function()
vim.pack.add {
'https://github.com/mfussenegger/nvim-dap',
'https://github.com/rcarriga/nvim-dap-ui',
'https://github.com/nvim-neotest/nvim-nio',
'https://github.com/mason-org/mason.nvim',
'https://github.com/jay-babu/mason-nvim-dap.nvim',
'https://github.com/leoluz/nvim-dap-go',
}
-- Basic debugging keymaps, feel free to change to your liking!
vim.keymap.set('n', '<F5>', function() require('dap').continue() end, { desc = 'Debug: Start/Continue' })
vim.keymap.set('n', '<F1>', function() require('dap').step_into() end, { desc = 'Debug: Step Into' })
vim.keymap.set('n', '<F2>', function() require('dap').step_over() end, { desc = 'Debug: Step Over' })
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' })
vim.keymap.set('n', '<leader>B', function() require('dap').set_breakpoint(vim.fn.input 'Breakpoint condition: ') end, { desc = 'Debug: Set Breakpoint' })
-- 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.' })
-- Basic debugging keymaps, feel free to change to your liking!
vim.keymap.set('n', '<F5>', function() require('dap').continue() end, { desc = 'Debug: Start/Continue' })
vim.keymap.set('n', '<F1>', function() require('dap').step_into() end, { desc = 'Debug: Step Into' })
vim.keymap.set('n', '<F2>', function() require('dap').step_over() end, { desc = 'Debug: Step Over' })
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' })
vim.keymap.set('n', '<leader>B', function() require('dap').set_breakpoint(vim.fn.input 'Breakpoint condition: ') end, { desc = 'Debug: Set Breakpoint' })
-- 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.' })
local dap = require 'dap'
local dapui = require 'dapui'
local dap = require 'dap'
local dapui = require 'dapui'
require('mason-nvim-dap').setup {
-- Makes a best effort to setup the various debuggers with
-- reasonable debug configurations
automatic_installation = true,
require('mason-nvim-dap').setup {
-- Makes a best effort to setup the various debuggers with
-- reasonable debug configurations
automatic_installation = true,
-- You can provide additional configuration to the handlers,
-- see mason-nvim-dap README for more information
handlers = {},
-- You can provide additional configuration to the handlers,
-- see mason-nvim-dap README for more information
handlers = {},
-- You'll need to check that you have the required things installed
-- 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|
---@diagnostic disable-next-line: missing-fields
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 = '*' },
---@diagnostic disable-next-line: missing-fields
controls = {
icons = {
pause = '',
play = '',
step_into = '',
step_over = '',
step_out = '',
step_back = 'b',
run_last = '▶▶',
terminate = '',
disconnect = '',
-- You'll need to check that you have the required things installed
-- 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',
},
},
}
}
-- 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 UI setup
-- For more information, see |:help nvim-dap-ui|
---@diagnostic disable-next-line: missing-fields
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 = '*' },
---@diagnostic disable-next-line: missing-fields
controls = {
icons = {
pause = '',
play = '',
step_into = '',
step_over = '',
step_out = '',
step_back = 'b',
run_last = '▶▶',
terminate = '',
disconnect = '',
},
},
}
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
-- 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
-- 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,
},
}
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

@ -2,56 +2,58 @@
-- NOTE: gitsigns is already included in init.lua but contains only the base
-- config. This will add also the recommended keymaps.
vim.pack.add { 'https://github.com/lewis6991/gitsigns.nvim' }
return function()
vim.pack.add { 'https://github.com/lewis6991/gitsigns.nvim' }
require('gitsigns').setup {
on_attach = function(bufnr)
local gitsigns = require 'gitsigns'
require('gitsigns').setup {
on_attach = function(bufnr)
local gitsigns = require 'gitsigns'
local function map(mode, l, r, opts)
opts = opts or {}
opts.buffer = bufnr
vim.keymap.set(mode, l, r, opts)
end
-- Navigation
map('n', ']c', function()
if vim.wo.diff then
vim.cmd.normal { ']c', bang = true }
else
gitsigns.nav_hunk 'next'
local function map(mode, l, r, opts)
opts = opts or {}
opts.buffer = bufnr
vim.keymap.set(mode, l, r, opts)
end
end, { desc = 'Jump to next git [c]hange' })
map('n', '[c', function()
if vim.wo.diff then
vim.cmd.normal { '[c', bang = true }
else
gitsigns.nav_hunk 'prev'
end
end, { desc = 'Jump to previous git [c]hange' })
-- Navigation
map('n', ']c', function()
if vim.wo.diff then
vim.cmd.normal { ']c', bang = true }
else
gitsigns.nav_hunk 'next'
end
end, { desc = 'Jump to next git [c]hange' })
-- Actions
-- visual mode
map('v', '<leader>hs', function() gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [s]tage hunk' })
map('v', '<leader>hr', function() gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [r]eset hunk' })
-- normal mode
map('n', '<leader>hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' })
map('n', '<leader>hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' })
map('n', '<leader>hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' })
map('n', '<leader>hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' })
map('n', '<leader>hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' })
map('n', '<leader>hi', gitsigns.preview_hunk_inline, { desc = 'git preview hunk [i]nline' })
map('n', '<leader>hb', function() gitsigns.blame_line { full = true } end, { desc = 'git [b]lame line' })
map('n', '<leader>hd', gitsigns.diffthis, { desc = 'git [d]iff against index' })
map('n', '<leader>hD', function() gitsigns.diffthis '@' end, { desc = 'git [D]iff against last commit' })
map('n', '<leader>hQ', function() gitsigns.setqflist 'all' end, { desc = 'git hunk [Q]uickfix list (all files in repo)' })
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' })
map('n', '[c', function()
if vim.wo.diff then
vim.cmd.normal { '[c', bang = true }
else
gitsigns.nav_hunk 'prev'
end
end, { desc = 'Jump to previous git [c]hange' })
-- Text object
map({ 'o', 'x' }, 'ih', gitsigns.select_hunk)
end,
}
-- Actions
-- visual mode
map('v', '<leader>hs', function() gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [s]tage hunk' })
map('v', '<leader>hr', function() gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [r]eset hunk' })
-- normal mode
map('n', '<leader>hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' })
map('n', '<leader>hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' })
map('n', '<leader>hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' })
map('n', '<leader>hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' })
map('n', '<leader>hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' })
map('n', '<leader>hi', gitsigns.preview_hunk_inline, { desc = 'git preview hunk [i]nline' })
map('n', '<leader>hb', function() gitsigns.blame_line { full = true } end, { desc = 'git [b]lame line' })
map('n', '<leader>hd', gitsigns.diffthis, { desc = 'git [d]iff against index' })
map('n', '<leader>hD', function() gitsigns.diffthis '@' end, { desc = 'git [D]iff against last commit' })
map('n', '<leader>hQ', function() gitsigns.setqflist 'all' end, { desc = 'git hunk [Q]uickfix list (all files in repo)' })
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,
}
end

View File

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

View File

@ -1,53 +1,55 @@
-- Linting
vim.pack.add { 'https://github.com/mfussenegger/nvim-lint' }
return function()
vim.pack.add { 'https://github.com/mfussenegger/nvim-lint' }
local lint = require 'lint'
lint.linters_by_ft = {
markdown = { 'markdownlint' }, -- Make sure to install `markdownlint` via mason / npm
}
local lint = require 'lint'
lint.linters_by_ft = {
markdown = { 'markdownlint' }, -- Make sure to install `markdownlint` via mason / npm
}
-- 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
-- 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,
})
-- 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,
})
end

View File

@ -1,26 +1,28 @@
-- Neo-tree is a Neovim plugin to browse the file system
-- https://github.com/nvim-neo-tree/neo-tree.nvim
local plugins = {
{ src = 'https://github.com/nvim-neo-tree/neo-tree.nvim', version = vim.version.range '*' },
'https://github.com/nvim-lua/plenary.nvim',
'https://github.com/MunifTanjim/nui.nvim',
}
return function()
local plugins = {
'https://github.com/nvim-neo-tree/neo-tree.nvim',
'https://github.com/nvim-lua/plenary.nvim',
'https://github.com/MunifTanjim/nui.nvim',
}
if vim.g.have_nerd_font then
table.insert(plugins, 'https://github.com/nvim-tree/nvim-web-devicons') -- not strictly required, but recommended
end
if vim.g.have_nerd_font then
table.insert(plugins, 'https://github.com/nvim-tree/nvim-web-devicons') -- not strictly required, but recommended
end
vim.pack.add(plugins)
vim.pack.add(plugins)
vim.keymap.set('n', '\\', '<Cmd>Neotree reveal<CR>', { desc = 'NeoTree reveal', silent = true })
vim.keymap.set('n', '\\', '<Cmd>Neotree reveal<CR>', { desc = 'NeoTree reveal', silent = true })
require('neo-tree').setup {
filesystem = {
window = {
mappings = {
['\\'] = 'close_window',
require('neo-tree').setup {
filesystem = {
window = {
mappings = {
['\\'] = 'close_window',
},
},
},
},
}
}
end