Format the plugin configs

This commit is contained in:
2023-03-05 13:50:46 +05:30
parent 43140cc257
commit d3432b7ffc
10 changed files with 368 additions and 368 deletions

BIN
blob/neolite.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

View File

@@ -3,11 +3,11 @@ vim.opt.termguicolors = true
local ok, bufferline = pcall(require, "bufferline") local ok, bufferline = pcall(require, "bufferline")
if not ok then if not ok then
return return
end end
bufferline.setup({ bufferline.setup({
options = { options = {
mode = "tabs", -- set to "buffers" to only show buffers instead mode = "tabs", -- set to "buffers" to only show buffers instead
}, },
}) })

View File

@@ -1,130 +1,130 @@
local colorscheme = "onedark" local colorscheme = "onedark"
if colorscheme == "onedark" then if colorscheme == "onedark" then
-- Onedark Default Configuration -- Onedark Default Configuration
local ok, onedark = pcall(require, "onedark") local ok, onedark = pcall(require, "onedark")
if not ok then if not ok then
return return
end end
onedark.setup({ onedark.setup({
-- Main options -- -- Main options --
style = "darker", -- Default theme style. Choose between 'dark', 'darker', 'cool', 'deep', 'warm', 'warmer' and 'light' style = "darker", -- Default theme style. Choose between 'dark', 'darker', 'cool', 'deep', 'warm', 'warmer' and 'light'
transparent = false, -- Show/hide background transparent = false, -- Show/hide background
term_colors = true, -- Change terminal color as per the selected theme style term_colors = true, -- Change terminal color as per the selected theme style
ending_tildes = false, -- Show the end-of-buffer tildes. By default they are hidden ending_tildes = false, -- Show the end-of-buffer tildes. By default they are hidden
cmp_itemkind_reverse = false, -- reverse item kind highlights in cmp menu cmp_itemkind_reverse = false, -- reverse item kind highlights in cmp menu
-- toggle theme style --- -- toggle theme style ---
toggle_style_key = nil, -- keybind to toggle theme style. Leave it nil to disable it, or set it to a string, for example '<leader>ts' toggle_style_key = nil, -- keybind to toggle theme style. Leave it nil to disable it, or set it to a string, for example '<leader>ts'
toggle_style_list = { "dark", "darker", "cool", "deep", "warm", "warmer", "light" }, -- List of styles to toggle between toggle_style_list = { "dark", "darker", "cool", "deep", "warm", "warmer", "light" }, -- List of styles to toggle between
-- Change code style --- -- Change code style ---
-- Options are italic, bold, underline, none -- Options are italic, bold, underline, none
-- You can configure multiple style with comma seperated, For e.g., keywords = 'italic,bold' -- You can configure multiple style with comma seperated, For e.g., keywords = 'italic,bold'
code_style = { code_style = {
comments = "italic", comments = "italic",
keywords = "none", keywords = "none",
functions = "none", functions = "none",
strings = "none", strings = "none",
variables = "none", variables = "none",
}, },
-- Lualine options -- -- Lualine options --
lualine = { lualine = {
transparent = false, -- lualine center bar transparency transparent = false, -- lualine center bar transparency
}, },
-- Custom Highlights -- -- Custom Highlights --
colors = {}, -- Override default colors colors = {}, -- Override default colors
highlights = {}, -- Override highlight groups highlights = {}, -- Override highlight groups
-- Plugins Config -- -- Plugins Config --
diagnostics = { diagnostics = {
darker = true, -- darker colors for diagnostic darker = true, -- darker colors for diagnostic
undercurl = true, -- use undercurl instead of underline for diagnostics undercurl = true, -- use undercurl instead of underline for diagnostics
background = true, -- use background color for virtual text background = true, -- use background color for virtual text
}, },
}) })
-- Load One Dark -- Load One Dark
onedark.load() onedark.load()
end end
if colorscheme == "catppuccin" then if colorscheme == "catppuccin" then
-- Catppuccin -- Catppuccin
local ok, catppuccin = pcall(require, "catppuccin") local ok, catppuccin = pcall(require, "catppuccin")
if not ok then if not ok then
return return
end end
catppuccin.setup({ catppuccin.setup({
flavour = "mocha", -- latte, frappe, macchiato, mocha flavour = "mocha", -- latte, frappe, macchiato, mocha
background = { background = {
-- :h background -- :h background
light = "latte", light = "latte",
dark = "mocha", dark = "mocha",
}, },
transparent_background = false, transparent_background = false,
show_end_of_buffer = false, -- show the '~' characters after the end of buffers show_end_of_buffer = false, -- show the '~' characters after the end of buffers
term_colors = false, term_colors = false,
dim_inactive = { dim_inactive = {
enabled = false, enabled = false,
shade = "dark", shade = "dark",
percentage = 0.15, percentage = 0.15,
}, },
no_italic = false, -- Force no italic no_italic = false, -- Force no italic
no_bold = false, -- Force no bold no_bold = false, -- Force no bold
styles = { styles = {
comments = { "italic" }, comments = { "italic" },
conditionals = { "italic" }, conditionals = { "italic" },
loops = {}, loops = {},
functions = {}, functions = {},
keywords = {}, keywords = {},
strings = {}, strings = {},
variables = {}, variables = {},
numbers = {}, numbers = {},
booleans = {}, booleans = {},
properties = {}, properties = {},
types = {}, types = {},
operators = {}, operators = {},
}, },
color_overrides = {}, color_overrides = {},
custom_highlights = {}, custom_highlights = {},
integrations = { integrations = {
cmp = true, cmp = true,
gitsigns = true, gitsigns = true,
nvimtree = true, nvimtree = true,
telescope = true, telescope = true,
notify = false, notify = false,
mini = false, mini = false,
-- For more plugins integrations please scroll down (https://github.com/catppuccin/nvim#integrations) -- For more plugins integrations please scroll down (https://github.com/catppuccin/nvim#integrations)
}, },
}) })
-- Load Catppuccin -- Load Catppuccin
catppuccin.load() catppuccin.load()
end end
if colorscheme == "gruvbox" then if colorscheme == "gruvbox" then
-- setup must be called before loading the colorscheme -- setup must be called before loading the colorscheme
-- Default options: -- Default options:
local ok, gruvbox = pcall(require, "gruvbox") local ok, gruvbox = pcall(require, "gruvbox")
if not ok then if not ok then
return return
end end
gruvbox.setup({ gruvbox.setup({
undercurl = true, undercurl = true,
underline = true, underline = true,
bold = true, bold = true,
italic = true, italic = true,
strikethrough = true, strikethrough = true,
invert_selection = false, invert_selection = false,
invert_signs = false, invert_signs = false,
invert_tabline = false, invert_tabline = false,
invert_intend_guides = false, invert_intend_guides = false,
inverse = true, -- invert background for search, diffs, statuslines and errors inverse = true, -- invert background for search, diffs, statuslines and errors
contrast = "", -- can be "hard", "soft" or empty string contrast = "", -- can be "hard", "soft" or empty string
palette_overrides = {}, palette_overrides = {},
overrides = {}, overrides = {},
dim_inactive = false, dim_inactive = false,
transparent_mode = false, transparent_mode = false,
}) })
-- Load Gruvbox -- Load Gruvbox
gruvbox.load() gruvbox.load()
end end

View File

@@ -1,86 +1,86 @@
local ok, cmp = pcall(require, "cmp") local ok, cmp = pcall(require, "cmp")
if not ok then if not ok then
return return
end end
local luasnip_ok, luasnip = pcall(require, "luasnip") local luasnip_ok, luasnip = pcall(require, "luasnip")
if not luasnip_ok then if not luasnip_ok then
return return
end end
local luasnip_vscode_ok, luasnip_vscode = pcall(require, "luasnip/loaders/from_vscode") local luasnip_vscode_ok, luasnip_vscode = pcall(require, "luasnip/loaders/from_vscode")
if not luasnip_vscode_ok then if not luasnip_vscode_ok then
return return
end end
local has_words_before = function() local has_words_before = function()
unpack = unpack or table.unpack unpack = unpack or table.unpack
local line, col = unpack(vim.api.nvim_win_get_cursor(0)) local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
end end
luasnip_vscode.lazy_load() luasnip_vscode.lazy_load()
cmp.setup({ cmp.setup({
view = { view = {
--entries = { name = "custom", selection_order = "near_cursor" }, --entries = { name = "custom", selection_order = "near_cursor" },
}, },
snippet = { snippet = {
expand = function(args) expand = function(args)
luasnip.lsp_expand(args.body) -- For `luasnip` users. luasnip.lsp_expand(args.body) -- For `luasnip` users.
end, end,
}, },
mapping = { mapping = {
["<CR>"] = cmp.mapping.confirm({ select = true }), ["<CR>"] = cmp.mapping.confirm({ select = true }),
["<Tab>"] = cmp.mapping(function(fallback) ["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then if cmp.visible() then
cmp.select_next_item() cmp.select_next_item()
-- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable() -- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable()
-- they way you will only jump inside the snippet region -- they way you will only jump inside the snippet region
elseif luasnip.expand_or_jumpable() then elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump() luasnip.expand_or_jump()
elseif has_words_before() then elseif has_words_before() then
cmp.complete() cmp.complete()
else else
fallback() fallback()
end end
end, { "i", "s" }), end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback) ["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then if cmp.visible() then
cmp.select_prev_item() cmp.select_prev_item()
elseif luasnip.jumpable(-1) then elseif luasnip.jumpable(-1) then
luasnip.jump(-1) luasnip.jump(-1)
else else
fallback() fallback()
end end
end, { "i", "s" }), end, { "i", "s" }),
}, },
sources = { sources = {
{ name = "nvim_lsp" }, { name = "nvim_lsp" },
{ name = "luasnip" }, { name = "luasnip" },
{ name = "buffer" }, { name = "buffer" },
{ name = "path" }, { name = "path" },
}, },
confirm_opts = { confirm_opts = {
behavior = cmp.ConfirmBehavior.Replace, behavior = cmp.ConfirmBehavior.Replace,
select = false, select = false,
}, },
experimental = { experimental = {
ghost_text = false, ghost_text = false,
}, },
formatting = { formatting = {
fields = { "kind", "abbr", "menu" }, fields = { "kind", "abbr", "menu" },
format = function(entry, vim_item) format = function(entry, vim_item)
local lk_ok, lspkind = pcall(require, "lspkind") local lk_ok, lspkind = pcall(require, "lspkind")
if not lk_ok then if not lk_ok then
return return
end end
local kind = lspkind.cmp_format({ mode = "symbol_text", maxwidth = 50 })(entry, vim_item) local kind = lspkind.cmp_format({ mode = "symbol_text", maxwidth = 50 })(entry, vim_item)
local strings = vim.split(kind.kind, "%s", { trimempty = true }) local strings = vim.split(kind.kind, "%s", { trimempty = true })
kind.kind = " " .. (strings[1] or "") .. " " kind.kind = " " .. (strings[1] or "") .. " "
kind.menu = " (" .. (strings[2] or "") .. ")" kind.menu = " (" .. (strings[2] or "") .. ")"
return kind return kind
end, end,
}, },
}) })

View File

@@ -1,5 +1,5 @@
-- disable netrw -- disable netrw
vim.g.loaded_netrw = 1 vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1 vim.g.loaded_netrwPlugin = 1
-- set termguicolors to enable highlight groups -- set termguicolors to enable highlight groups

View File

@@ -1,50 +1,50 @@
local lspconfig_status_ok, lspconfig = pcall(require, "lspconfig") local lspconfig_status_ok, lspconfig = pcall(require, "lspconfig")
if not lspconfig_status_ok then if not lspconfig_status_ok then
return return
end end
local mason_status_ok, mason = pcall(require, "mason") local mason_status_ok, mason = pcall(require, "mason")
if not mason_status_ok then if not mason_status_ok then
return return
end end
local mason_lspconfig_status_ok, mason_lspconfig = pcall(require, "mason-lspconfig") local mason_lspconfig_status_ok, mason_lspconfig = pcall(require, "mason-lspconfig")
if not mason_lspconfig_status_ok then if not mason_lspconfig_status_ok then
return return
end end
mason.setup({}) mason.setup({})
mason_lspconfig.setup({ mason_lspconfig.setup({
ensure_installed = { "lua_ls", "rust_analyzer", "clangd" }, ensure_installed = { "lua_ls", "rust_analyzer", "clangd" },
}) })
local cnl_ok, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp") local cnl_ok, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp")
if not cnl_ok then if not cnl_ok then
return return
end end
local capabilities = cmp_nvim_lsp.default_capabilities() local capabilities = cmp_nvim_lsp.default_capabilities()
mason_lspconfig.setup_handlers({ mason_lspconfig.setup_handlers({
function(server) function(server)
lspconfig[server].setup({ capabilities = capabilities }) lspconfig[server].setup({ capabilities = capabilities })
lspconfig.lua_ls.setup({ lspconfig.lua_ls.setup({
capabilities = capabilities, capabilities = capabilities,
settings = { settings = {
Lua = { Lua = {
diagnostics = { diagnostics = {
-- Get the language server to recognize the `vim` global -- Get the language server to recognize the `vim` global
globals = { "vim" }, globals = { "vim" },
}, },
}, },
}, },
}) })
end, end,
["rust_analyzer"] = function() ["rust_analyzer"] = function()
local rt_ok, rust_tools = pcall(require, "rust-tools") local rt_ok, rust_tools = pcall(require, "rust-tools")
if rt_ok then if rt_ok then
rust_tools.setup({}) rust_tools.setup({})
end end
end end,
}) })

View File

@@ -1,29 +1,29 @@
local ok, null_ls = pcall(require, "null-ls") local ok, null_ls = pcall(require, "null-ls")
if not ok then if not ok then
return return
end end
local formatting = null_ls.builtins.formatting local formatting = null_ls.builtins.formatting
local augroup = vim.api.nvim_create_augroup("LspFormatting", {}) local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
null_ls.setup({ null_ls.setup({
sources = { sources = {
formatting.rustfmt, formatting.rustfmt,
formatting.stylua, formatting.stylua,
formatting.black, formatting.black,
formatting.prettier, formatting.prettier,
}, -- you can reuse a shared lspconfig on_attach callback here }, -- you can reuse a shared lspconfig on_attach callback here
on_attach = function(client, bufnr) on_attach = function(client, bufnr)
if client.supports_method("textDocument/formatting") then if client.supports_method("textDocument/formatting") then
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr }) vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
vim.api.nvim_create_autocmd("BufWritePre", { vim.api.nvim_create_autocmd("BufWritePre", {
group = augroup, group = augroup,
buffer = bufnr, buffer = bufnr,
callback = function() callback = function()
-- on 0.8, you should use vim.lsp.buf.format({ bufnr = bufnr }) instead -- on 0.8, you should use vim.lsp.buf.format({ bufnr = bufnr }) instead
vim.lsp.buf.format({ bufnr = bufnr }) vim.lsp.buf.format({ bufnr = bufnr })
end, end,
}) })
end end
end, end,
}) })

View File

@@ -1,85 +1,85 @@
local ok, packer = pcall(require, "packer") local ok, packer = pcall(require, "packer")
if not ok then if not ok then
return return
end end
packer.startup(function(use) packer.startup(function(use)
-- Onedark colorscheme -- Onedark colorscheme
use({ "navarasu/onedark.nvim" }) use({ "navarasu/onedark.nvim" })
-- Gruvbox colorscheme -- Gruvbox colorscheme
use({ "ellisonleao/gruvbox.nvim" }) use({ "ellisonleao/gruvbox.nvim" })
-- Catppuccin colorscheme -- Catppuccin colorscheme
use({ "catppuccin/nvim", as = "catppuccin" }) use({ "catppuccin/nvim", as = "catppuccin" })
-- Plugin manager -- Plugin manager
use({ "wbthomason/packer.nvim" }) use({ "wbthomason/packer.nvim" })
-- Terminal -- Terminal
use({ "akinsho/toggleterm.nvim", tag = "*" }) use({ "akinsho/toggleterm.nvim", tag = "*" })
-- File tree -- File tree
use({ use({
"nvim-tree/nvim-tree.lua", "nvim-tree/nvim-tree.lua",
requires = { requires = {
"nvim-tree/nvim-web-devicons", -- optional, for file icons "nvim-tree/nvim-web-devicons", -- optional, for file icons
}, },
tag = "nightly", -- optional, updated every week. (see issue #1193) tag = "nightly", -- optional, updated every week. (see issue #1193)
}) })
-- Statusline -- Statusline
use({ use({
"nvim-lualine/lualine.nvim", "nvim-lualine/lualine.nvim",
requires = { "kyazdani42/nvim-web-devicons", opt = true }, requires = { "kyazdani42/nvim-web-devicons", opt = true },
}) })
-- Buffer tabs -- Buffer tabs
use({ "akinsho/bufferline.nvim", tag = "v3.*", requires = "nvim-tree/nvim-web-devicons" }) use({ "akinsho/bufferline.nvim", tag = "v3.*", requires = "nvim-tree/nvim-web-devicons" })
use({ use({
"nvim-telescope/telescope.nvim", "nvim-telescope/telescope.nvim",
tag = "0.1.1", tag = "0.1.1",
-- or , branch = '0.1.x', -- or , branch = '0.1.x',
requires = { { "nvim-lua/plenary.nvim" } }, requires = { { "nvim-lua/plenary.nvim" } },
}) })
-- LSP manager -- LSP manager
use({ "williamboman/mason.nvim" }) use({ "williamboman/mason.nvim" })
use({ "williamboman/mason-lspconfig.nvim" }) use({ "williamboman/mason-lspconfig.nvim" })
use({ "neovim/nvim-lspconfig" }) use({ "neovim/nvim-lspconfig" })
use({ "jose-elias-alvarez/null-ls.nvim" }) use({ "jose-elias-alvarez/null-ls.nvim" })
-- Completions -- Completions
use("hrsh7th/nvim-cmp") -- The completion plugin use("hrsh7th/nvim-cmp") -- The completion plugin
use("hrsh7th/cmp-buffer") -- buffer completions use("hrsh7th/cmp-buffer") -- buffer completions
use("hrsh7th/cmp-path") -- path completions use("hrsh7th/cmp-path") -- path completions
use("saadparwaiz1/cmp_luasnip") -- snippet completions use("saadparwaiz1/cmp_luasnip") -- snippet completions
use("onsails/lspkind.nvim") use("onsails/lspkind.nvim")
use("windwp/nvim-autopairs") use("windwp/nvim-autopairs")
use("hrsh7th/cmp-nvim-lsp") use("hrsh7th/cmp-nvim-lsp")
-- Snippets -- Snippets
use("L3MON4D3/LuaSnip") --snippet engine use("L3MON4D3/LuaSnip") --snippet engine
use("rafamadriz/friendly-snippets") -- a bunch of snippets to use use("rafamadriz/friendly-snippets") -- a bunch of snippets to use
use({ use({
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
run = function() run = function()
local ntsi_ok, nvim_treesitter_install = pcall(require, "nvim-treesitter.install") local ntsi_ok, nvim_treesitter_install = pcall(require, "nvim-treesitter.install")
if ntsi_ok then if ntsi_ok then
local ts_update = nvim_treesitter_install.install.update({ with_sync = true }) local ts_update = nvim_treesitter_install.install.update({ with_sync = true })
ts_update() ts_update()
end end
end, end,
}) })
--use 'neovim/nvim-lspconfig' --use 'neovim/nvim-lspconfig'
use 'simrat39/rust-tools.nvim' use("simrat39/rust-tools.nvim")
-- Debugging -- Debugging
--use 'nvim-lua/plenary.nvim' --use 'nvim-lua/plenary.nvim'
use 'mfussenegger/nvim-dap' use("mfussenegger/nvim-dap")
end) end)

View File

@@ -1,45 +1,45 @@
local ok, lualine = pcall(require, "lualine") local ok, lualine = pcall(require, "lualine")
if not ok then if not ok then
return return
end end
lualine.setup({ lualine.setup({
options = { options = {
icons_enabled = true, icons_enabled = true,
theme = "auto", theme = "auto",
component_separators = { left = "", right = "" }, component_separators = { left = "", right = "" },
section_separators = { left = "", right = "" }, section_separators = { left = "", right = "" },
disabled_filetypes = { disabled_filetypes = {
statusline = {}, statusline = {},
winbar = {}, winbar = {},
}, },
ignore_focus = {}, ignore_focus = {},
always_divide_middle = true, always_divide_middle = true,
globalstatus = false, globalstatus = false,
refresh = { refresh = {
statusline = 1000, statusline = 1000,
tabline = 1000, tabline = 1000,
winbar = 1000, winbar = 1000,
}, },
}, },
sections = { sections = {
lualine_a = { "mode" }, lualine_a = { "mode" },
lualine_b = { "branch", "diff", "diagnostics" }, lualine_b = { "branch", "diff", "diagnostics" },
lualine_c = { "filename" }, lualine_c = { "filename" },
lualine_x = { "encoding", "fileformat", "filetype" }, lualine_x = { "encoding", "fileformat", "filetype" },
lualine_y = { "progress" }, lualine_y = { "progress" },
lualine_z = { "location" }, lualine_z = { "location" },
}, },
inactive_sections = { inactive_sections = {
lualine_a = {}, lualine_a = {},
lualine_b = {}, lualine_b = {},
lualine_c = { "filename" }, lualine_c = { "filename" },
lualine_x = { "location" }, lualine_x = { "location" },
lualine_y = {}, lualine_y = {},
lualine_z = {}, lualine_z = {},
}, },
tabline = {}, tabline = {},
winbar = {}, winbar = {},
inactive_winbar = {}, inactive_winbar = {},
extensions = {}, extensions = {},
}) })

View File

@@ -1,42 +1,42 @@
local ok, nvim_treesitter = pcall(require, "nvim-treesitter.configs") local ok, nvim_treesitter = pcall(require, "nvim-treesitter.configs")
if not ok then if not ok then
return return
end end
nvim_treesitter.setup({ nvim_treesitter.setup({
-- A list of parser names, or "all" (the four listed parsers should always be installed) -- A list of parser names, or "all" (the four listed parsers should always be installed)
ensure_installed = { "c", "help", "lua", "vim", "cpp", "rust" }, ensure_installed = { "c", "help", "lua", "vim", "cpp", "rust" },
-- Install parsers synchronously (only applied to `ensure_installed`) -- Install parsers synchronously (only applied to `ensure_installed`)
sync_install = false, sync_install = false,
-- Automatically install missing parsers when entering buffer -- Automatically install missing parsers when entering buffer
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
auto_install = true, auto_install = true,
-- List of parsers to ignore installing (for "all") -- List of parsers to ignore installing (for "all")
ignore_install = { "javascript" }, ignore_install = { "javascript" },
---- If you need to change the installation directory of the parsers (see -> Advanced Setup) ---- If you need to change the installation directory of the parsers (see -> Advanced Setup)
-- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")! -- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")!
highlight = { highlight = {
enable = true, enable = true,
-- NOTE: these are the names of the parsers and not the filetype. (for example if you want to -- NOTE: these are the names of the parsers and not the filetype. (for example if you want to
-- disable highlighting for the `tex` filetype, you need to include `latex` in this list as this is -- disable highlighting for the `tex` filetype, you need to include `latex` in this list as this is
-- the name of the parser) -- the name of the parser)
-- list of language that will be disabled -- list of language that will be disabled
disable = { "" }, disable = { "" },
-- Or use a function for more flexibility, e.g. to disable slow treesitter highlight for large files -- Or use a function for more flexibility, e.g. to disable slow treesitter highlight for large files
--disable = function(lang, buf) --disable = function(lang, buf)
-- local max_filesize = 100 * 1024 -- 100 KB -- local max_filesize = 100 * 1024 -- 100 KB
-- local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf)) -- local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
-- if ok and stats and stats.size > max_filesize then -- if ok and stats and stats.size > max_filesize then
-- return true -- return true
-- end -- end
--end, --end,
-- Setting this to true will run `:h syntax` and tree-sitter at the same time. -- Setting this to true will run `:h syntax` and tree-sitter at the same time.
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights. -- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages -- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = true, additional_vim_regex_highlighting = true,
}, },
indent = { enable = true, disable = { "yaml" } }, indent = { enable = true, disable = { "yaml" } },
}) })