Collapse small functions when formatting

This would allow to write more concise and easy to understands keybinds in
the following commit
This commit is contained in:
orip 2025-04-18 19:18:57 +03:00
parent 6ba2408cdf
commit f4300d0146
4 changed files with 29 additions and 85 deletions

View file

@ -114,9 +114,7 @@ vim.o.showmode = false
-- Schedule the setting after `UiEnter` because it can increase startup-time.
-- Remove this option if you want your OS clipboard to remain independent.
-- See `:help 'clipboard'`
vim.schedule(function()
vim.o.clipboard = 'unnamedplus'
end)
vim.schedule(function() vim.o.clipboard = 'unnamedplus' end)
-- Enable break indent
vim.o.breakindent = true
@ -214,9 +212,7 @@ vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper win
vim.api.nvim_create_autocmd('TextYankPost', {
desc = 'Highlight when yanking (copying) text',
group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }),
callback = function()
vim.hl.on_yank()
end,
callback = function() vim.hl.on_yank() end,
})
-- [[ Install `lazy.nvim` plugin manager ]]
@ -372,9 +368,7 @@ require('lazy').setup({
-- `cond` is a condition used to determine whether this plugin should be
-- installed and loaded.
cond = function()
return vim.fn.executable 'make' == 1
end,
cond = function() return vim.fn.executable 'make' == 1 end,
},
{ 'nvim-telescope/telescope-ui-select.nvim' },
@ -448,17 +442,20 @@ require('lazy').setup({
-- It's also possible to pass additional configuration options.
-- See `:help telescope.builtin.live_grep()` for information about particular keys
vim.keymap.set('n', '<leader>s/', function()
builtin.live_grep {
grep_open_files = true,
prompt_title = 'Live Grep in Open Files',
}
end, { desc = '[S]earch [/] in Open Files' })
vim.keymap.set(
'n',
'<leader>s/',
function()
builtin.live_grep {
grep_open_files = true,
prompt_title = 'Live Grep in Open Files',
}
end,
{ desc = '[S]earch [/] in Open Files' }
)
-- 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' })
vim.keymap.set('n', '<leader>sn', function() builtin.find_files { cwd = vim.fn.stdpath 'config' } end, { desc = '[S]earch [N]eovim files' })
end,
},
@ -619,9 +616,7 @@ require('lazy').setup({
--
-- This may be unwanted, since they displace some of your code
if client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_inlayHint, event.buf) then
map('<leader>th', function()
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf })
end, '[T]oggle Inlay [H]ints')
map('<leader>th', function() vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf }) end, '[T]oggle Inlay [H]ints')
end
end,
})
@ -743,9 +738,7 @@ require('lazy').setup({
keys = {
{
'<leader>f',
function()
require('conform').format { async = true, lsp_format = 'fallback' }
end,
function() require('conform').format { async = true, lsp_format = 'fallback' } end,
mode = '',
desc = '[F]ormat buffer',
},
@ -930,9 +923,7 @@ require('lazy').setup({
-- default behavior. For example, here we set the section for
-- cursor location to LINE:COLUMN
---@diagnostic disable-next-line: duplicate-set-field
statusline.section_location = function()
return '%2l:%-2v'
end
statusline.section_location = function() return '%2l:%-2v' end
-- ... and there is more!
-- Check out: https://github.com/echasnovski/mini.nvim