mirror of
https://github.com/marianozunino/nvim.git
synced 2025-06-28 18:43:50 -03:00
chore: some qol crap
This commit is contained in:
parent
867159343a
commit
6fb744cdae
34 changed files with 433 additions and 598 deletions
|
@ -1,7 +1,6 @@
|
|||
-- Create autogroups first
|
||||
local MZuninoGroup = vim.api.nvim_create_augroup("mzunino", {})
|
||||
local yank_group = vim.api.nvim_create_augroup("HighlightYank", {})
|
||||
local bigfile_group = vim.api.nvim_create_augroup("bigfile", {})
|
||||
|
||||
-- Set bigfile size threshold
|
||||
vim.g.bigfile_size = 1024 * 1024 * 1.5 -- 1.5 MB
|
||||
|
@ -50,15 +49,3 @@ vim.filetype.add({
|
|||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- Bigfile handling
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
group = bigfile_group,
|
||||
pattern = "bigfile",
|
||||
callback = function(ev)
|
||||
vim.b.minianimate_disable = true
|
||||
vim.schedule(function()
|
||||
vim.bo[ev.buf].syntax = vim.filetype.match({ buf = ev.buf }) or ""
|
||||
end)
|
||||
end,
|
||||
})
|
||||
|
|
39
lua/config/lsp/vtsls.lua
Normal file
39
lua/config/lsp/vtsls.lua
Normal file
|
@ -0,0 +1,39 @@
|
|||
return {
|
||||
-- explicitly add default filetypes, so that we can extend
|
||||
-- them in related extras
|
||||
filetypes = {
|
||||
"javascript",
|
||||
"javascriptreact",
|
||||
"javascript.jsx",
|
||||
"typescript",
|
||||
"typescriptreact",
|
||||
"typescript.tsx",
|
||||
},
|
||||
settings = {
|
||||
complete_function_calls = true,
|
||||
vtsls = {
|
||||
enableMoveToFileCodeAction = true,
|
||||
autoUseWorkspaceTsdk = true,
|
||||
experimental = {
|
||||
maxInlayHintLength = 30,
|
||||
completion = {
|
||||
enableServerSideFuzzyMatch = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
typescript = {
|
||||
updateImportsOnFileMove = { enabled = "always" },
|
||||
suggest = {
|
||||
completeFunctionCalls = true,
|
||||
},
|
||||
inlayHints = {
|
||||
enumMemberValues = { enabled = true },
|
||||
functionLikeReturnTypes = { enabled = true },
|
||||
parameterNames = { enabled = "literals" },
|
||||
parameterTypes = { enabled = true },
|
||||
propertyDeclarationTypes = { enabled = true },
|
||||
variableTypes = { enabled = false },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
|
@ -39,9 +39,9 @@ end, { desc = "Quit all" })
|
|||
|
||||
-- create a user command to save without formatting :noa w
|
||||
vim.api.nvim_create_user_command("W", function()
|
||||
-- if buffer is empty, don't save
|
||||
if vim.fn.empty(vim.fn.expand("%:t")) == 1 then
|
||||
return vim.notify("Buffer is empty, not saving", vim.log.levels.ERROR)
|
||||
Snacks.notifier.notify("Buffer is empty, not saving", vim.log.levels.ERROR)
|
||||
return
|
||||
end
|
||||
vim.api.nvim_command("noa w")
|
||||
end, { nargs = 0, desc = "Save without formatting" })
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue