Update init.lua
This commit is contained in:
parent
bfaa12ad03
commit
9dee583a33
54
init.lua
54
init.lua
|
@ -699,8 +699,8 @@ require('lazy').setup({
|
|||
},
|
||||
opts = {
|
||||
notify_on_error = false,
|
||||
-- format_on_save = function(bufnr)
|
||||
format_on_save = false,
|
||||
format_on_save = function(bufnr)
|
||||
-- format_on_save = false,
|
||||
-- Disable "format_on_save lsp_fallback" for languages that don't
|
||||
-- have a well standardized coding style. You can add additional
|
||||
-- languages here or re-enable it for the disabled ones.
|
||||
|
@ -919,6 +919,56 @@ require('lazy').setup({
|
|||
-- - sr)' - [S]urround [R]eplace [)] [']
|
||||
require('mini.surround').setup()
|
||||
|
||||
require('mini.animate').setup {
|
||||
opts = function()
|
||||
-- don't use animate when scrolling with the mouse
|
||||
local mouse_scrolled = false
|
||||
for _, scroll in ipairs { 'Up', 'Down' } do
|
||||
local key = '<ScrollWheel' .. scroll .. '>'
|
||||
vim.keymap.set({ '', 'i' }, key, function()
|
||||
mouse_scrolled = true
|
||||
return key
|
||||
end, { expr = true })
|
||||
end
|
||||
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
pattern = 'grug-far',
|
||||
callback = function()
|
||||
vim.b.minianimate_disable = true
|
||||
end,
|
||||
})
|
||||
|
||||
LazyVim.toggle.map('<leader>ua', {
|
||||
name = 'Mini Animate',
|
||||
get = function()
|
||||
return not vim.g.minianimate_disable
|
||||
end,
|
||||
set = function(state)
|
||||
vim.g.minianimate_disable = not state
|
||||
end,
|
||||
})
|
||||
|
||||
local animate = require 'mini.animate'
|
||||
return {
|
||||
resize = {
|
||||
timing = animate.gen_timing.linear { duration = 50, unit = 'total' },
|
||||
},
|
||||
scroll = {
|
||||
timing = animate.gen_timing.linear { duration = 100, unit = 'total' },
|
||||
subscroll = animate.gen_subscroll.equal {
|
||||
predicate = function(total_scroll)
|
||||
if mouse_scrolled then
|
||||
mouse_scrolled = false
|
||||
return false
|
||||
end
|
||||
return total_scroll > 1
|
||||
end,
|
||||
},
|
||||
},
|
||||
}
|
||||
end,
|
||||
}
|
||||
|
||||
-- Simple and easy statusline.
|
||||
-- You could remove this setup call if you don't like it,
|
||||
-- and try some other statusline plugin
|
||||
|
|
Loading…
Reference in New Issue