add borders around completion popups
This commit is contained in:
parent
b473cc6d15
commit
9248cf468b
3 changed files with 149 additions and 144 deletions
135
lua/autocmds.lua
135
lua/autocmds.lua
|
|
@ -1,102 +1,101 @@
|
|||
-- Non-plugin autocommands (minimal placeholder for bootstrap)
|
||||
local aug = vim.api.nvim_create_augroup('UserDefaults', { clear = true })
|
||||
local aug = vim.api.nvim_create_augroup("UserDefaults", { clear = true })
|
||||
|
||||
-- Phase 10.3: Templates (auto-populate new files from templates)
|
||||
local template_aug = vim.api.nvim_create_augroup('Templates', { clear = true })
|
||||
local template_aug = vim.api.nvim_create_augroup("Templates", { clear = true })
|
||||
|
||||
vim.api.nvim_create_autocmd("BufNewFile", {
|
||||
group = template_aug,
|
||||
pattern = "*.sh",
|
||||
callback = function()
|
||||
-- Read template at top of file, then move to end
|
||||
vim.cmd('0read ~/.config/nvim/templates/template.sh')
|
||||
vim.cmd('normal! G')
|
||||
end,
|
||||
group = template_aug,
|
||||
pattern = "*.sh",
|
||||
callback = function()
|
||||
-- Read template at top of file, then move to end
|
||||
vim.cmd("0read ~/.config/nvim/templates/template.sh")
|
||||
vim.cmd("normal! G")
|
||||
end,
|
||||
})
|
||||
|
||||
-- Phase 9.4: Per-filetype indentation settings to match formatters
|
||||
|
||||
-- PHP: WordPress coding standards (tabs, displayed as 2 spaces)
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
group = aug,
|
||||
pattern = "php",
|
||||
callback = function()
|
||||
vim.opt_local.expandtab = false -- Use actual tabs (WordPress standard)
|
||||
vim.opt_local.tabstop = 2 -- Display tabs as 2 spaces wide
|
||||
vim.opt_local.shiftwidth = 2 -- Indent/outdent by 2 columns (one tab)
|
||||
vim.opt_local.softtabstop = 2 -- Tab key inserts 2 columns (one tab)
|
||||
end,
|
||||
group = aug,
|
||||
pattern = "php",
|
||||
callback = function()
|
||||
vim.opt_local.expandtab = false -- Use actual tabs (WordPress standard)
|
||||
vim.opt_local.tabstop = 2 -- Display tabs as 2 spaces wide
|
||||
vim.opt_local.shiftwidth = 2 -- Indent/outdent by 2 columns (one tab)
|
||||
vim.opt_local.softtabstop = 2 -- Tab key inserts 2 columns (one tab)
|
||||
end,
|
||||
})
|
||||
|
||||
-- JavaScript, TypeScript, JSON, CSS: Prettier defaults (2 spaces)
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
group = aug,
|
||||
pattern = { "javascript", "javascriptreact", "typescript", "typescriptreact", "json", "css", "scss", "html" },
|
||||
callback = function()
|
||||
vim.opt_local.expandtab = true -- Use spaces (Prettier default)
|
||||
vim.opt_local.tabstop = 2 -- Display as 2 spaces
|
||||
vim.opt_local.shiftwidth = 2 -- Indent by 2
|
||||
vim.opt_local.softtabstop = 2
|
||||
end,
|
||||
group = aug,
|
||||
pattern = { "javascript", "javascriptreact", "typescript", "typescriptreact", "json", "css", "scss", "html" },
|
||||
callback = function()
|
||||
vim.opt_local.expandtab = true -- Use spaces (Prettier default)
|
||||
vim.opt_local.tabstop = 2 -- Display as 2 spaces
|
||||
vim.opt_local.shiftwidth = 2 -- Indent by 2
|
||||
vim.opt_local.softtabstop = 2
|
||||
end,
|
||||
})
|
||||
|
||||
-- Lua: stylua defaults (2 spaces)
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
group = aug,
|
||||
pattern = "lua",
|
||||
callback = function()
|
||||
vim.opt_local.expandtab = true -- Use spaces (common for Lua configs)
|
||||
vim.opt_local.tabstop = 2 -- Display as 2 spaces
|
||||
vim.opt_local.shiftwidth = 2 -- Indent by 2
|
||||
vim.opt_local.softtabstop = 2
|
||||
end,
|
||||
group = aug,
|
||||
pattern = "lua",
|
||||
callback = function()
|
||||
vim.opt_local.expandtab = true -- Use spaces (common for Lua configs)
|
||||
vim.opt_local.tabstop = 2 -- Display as 2 spaces
|
||||
vim.opt_local.shiftwidth = 2 -- Indent by 2
|
||||
vim.opt_local.softtabstop = 2
|
||||
end,
|
||||
})
|
||||
|
||||
-- Markdown: Prettier defaults (2 spaces)
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
group = aug,
|
||||
pattern = "markdown",
|
||||
callback = function()
|
||||
vim.opt_local.expandtab = true -- Use spaces
|
||||
vim.opt_local.tabstop = 2 -- Display as 2 spaces
|
||||
vim.opt_local.shiftwidth = 2 -- Indent by 2
|
||||
vim.opt_local.softtabstop = 2
|
||||
end,
|
||||
group = aug,
|
||||
pattern = "markdown",
|
||||
callback = function()
|
||||
vim.opt_local.expandtab = true -- Use spaces
|
||||
vim.opt_local.tabstop = 2 -- Display as 2 spaces
|
||||
vim.opt_local.shiftwidth = 2 -- Indent by 2
|
||||
vim.opt_local.softtabstop = 2
|
||||
end,
|
||||
})
|
||||
|
||||
-- Python: Black defaults (4 spaces)
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
group = aug,
|
||||
pattern = "python",
|
||||
callback = function()
|
||||
vim.opt_local.expandtab = true -- Use spaces (PEP 8)
|
||||
vim.opt_local.tabstop = 4 -- Display as 4 spaces
|
||||
vim.opt_local.shiftwidth = 4 -- Indent by 4
|
||||
vim.opt_local.softtabstop = 4
|
||||
end,
|
||||
group = aug,
|
||||
pattern = "python",
|
||||
callback = function()
|
||||
vim.opt_local.expandtab = true -- Use spaces (PEP 8)
|
||||
vim.opt_local.tabstop = 4 -- Display as 4 spaces
|
||||
vim.opt_local.shiftwidth = 4 -- Indent by 4
|
||||
vim.opt_local.softtabstop = 4
|
||||
end,
|
||||
})
|
||||
|
||||
-- Phase 11.8: Colorize diagnostic severity in quickfix/location list
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
group = aug,
|
||||
pattern = "qf", -- Applies to both quickfix and location list
|
||||
callback = function()
|
||||
-- Use matchadd() for higher priority highlighting
|
||||
-- This will override the default qf syntax
|
||||
vim.fn.matchadd('qfError', '\\<error\\>', 10)
|
||||
vim.fn.matchadd('qfWarning', '\\<warning\\>', 10)
|
||||
vim.fn.matchadd('qfInfo', '\\<info\\>', 10)
|
||||
vim.fn.matchadd('qfHint', '\\<hint\\>', 10)
|
||||
vim.fn.matchadd('qfNote', '\\<note\\>', 10)
|
||||
|
||||
-- Also match uppercase variants
|
||||
vim.fn.matchadd('qfError', '\\<Error\\>', 10)
|
||||
vim.fn.matchadd('qfWarning', '\\<Warning\\>', 10)
|
||||
vim.fn.matchadd('qfInfo', '\\<Info\\>', 10)
|
||||
vim.fn.matchadd('qfHint', '\\<Hint\\>', 10)
|
||||
vim.fn.matchadd('qfNote', '\\<Note\\>', 10)
|
||||
end,
|
||||
group = aug,
|
||||
pattern = "qf", -- Applies to both quickfix and location list
|
||||
callback = function()
|
||||
-- Use matchadd() for higher priority highlighting
|
||||
-- This will override the default qf syntax
|
||||
vim.fn.matchadd("qfError", "\\<error\\>", 10)
|
||||
vim.fn.matchadd("qfWarning", "\\<warning\\>", 10)
|
||||
vim.fn.matchadd("qfInfo", "\\<info\\>", 10)
|
||||
vim.fn.matchadd("qfHint", "\\<hint\\>", 10)
|
||||
vim.fn.matchadd("qfNote", "\\<note\\>", 10)
|
||||
|
||||
-- Also match uppercase variants
|
||||
vim.fn.matchadd("qfError", "\\<Error\\>", 10)
|
||||
vim.fn.matchadd("qfWarning", "\\<Warning\\>", 10)
|
||||
vim.fn.matchadd("qfInfo", "\\<Info\\>", 10)
|
||||
vim.fn.matchadd("qfHint", "\\<Hint\\>", 10)
|
||||
vim.fn.matchadd("qfNote", "\\<Note\\>", 10)
|
||||
end,
|
||||
})
|
||||
|
||||
return {}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue