feat/pack #1

Merged
tomas.mirchev merged 9 commits from feat/pack into main 2025-10-26 04:18:15 +00:00
3 changed files with 26 additions and 13 deletions
Showing only changes of commit ae3d2d20ee - Show all commits

View File

@ -20,7 +20,7 @@ au('VimEnter', {
au('TextYankPost', { au('TextYankPost', {
group = group, group = group,
callback = function() callback = function()
vim.highlight.on_yank({ timeout = 400 }) vim.highlight.on_yank({ timeout = 200 })
end, end,
}) })
@ -61,15 +61,15 @@ au({ 'WinLeave', 'InsertEnter' }, {
-- Autocompletion -- Autocompletion
au('LspAttach', { au('LspAttach', {
group = group, group = group,
callback = function(ev) callback = function(event)
local client = vim.lsp.get_client_by_id(ev.data.client_id) local client = vim.lsp.get_client_by_id(event.data.client_id)
if not client then if not client then
return return
end end
-- Enable native completion -- Enable native completion
if client:supports_method('textDocument/completion') then if client:supports_method('textDocument/completion') then
vim.lsp.completion.enable(true, client.id, ev.buf, { autotrigger = true }) vim.lsp.completion.enable(true, client.id, event.buf, { autotrigger = true })
end end
end, end,
}) })

View File

@ -16,7 +16,6 @@ vim.g.loaded_vimballPlugin = 1
vim.g.loaded_matchit = 1 vim.g.loaded_matchit = 1
vim.g.loaded_2html_plugin = 1 vim.g.loaded_2html_plugin = 1
vim.g.loaded_rrhelper = 1 vim.g.loaded_rrhelper = 1
vim.g.loaded_matchparen = 1
vim.g.loaded_tutor_mode_plugin = 1 vim.g.loaded_tutor_mode_plugin = 1
vim.g.loaded_spellfile_plugin = 1 vim.g.loaded_spellfile_plugin = 1
vim.g.loaded_logipat = 1 vim.g.loaded_logipat = 1
@ -87,7 +86,7 @@ vim.opt.undofile = true
vim.opt.swapfile = false vim.opt.swapfile = false
-- Tweaks -- Tweaks
vim.opt.updatetime = 1000 vim.opt.updatetime = 50
vim.opt.timeout = true vim.opt.timeout = true
vim.opt.ttimeout = true vim.opt.ttimeout = true
vim.opt.timeoutlen = 500 vim.opt.timeoutlen = 500

View File

@ -296,14 +296,28 @@ function M.lint.setup()
once = true, once = true,
callback = function() callback = function()
local lint = require('lint') local lint = require('lint')
lint.linters_by_ft = (M.general and M.general.linters_by_ft) or {} lint.linters_by_ft = M.general.linters_by_ft
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, {
function M.debounce(ms, fn)
local timer = vim.uv.new_timer()
return function(...)
local argv = { ... }
timer:start(ms, 0, function()
timer:stop()
vim.schedule_wrap(fn)(unpack(argv))
end)
end
end
function M.lint()
if vim.bo.modifiable then
lint.try_lint()
end
end
vim.api.nvim_create_autocmd({ 'BufReadPost', 'InsertLeave', 'TextChanged' }, {
group = vim.api.nvim_create_augroup('language-manager.lint', { clear = true }), group = vim.api.nvim_create_augroup('language-manager.lint', { clear = true }),
callback = function() callback = M.debounce(100, M.lint),
if vim.bo.modifiable then
lint.try_lint()
end
end,
}) })
end, end,
}) })