diff --git a/blob/neolite.jpg b/blob/neolite.jpg new file mode 100644 index 0000000..59572e6 Binary files /dev/null and b/blob/neolite.jpg differ diff --git a/lua/buffer-tabs.lua b/lua/buffer-tabs.lua index 3240452..c4ce633 100644 --- a/lua/buffer-tabs.lua +++ b/lua/buffer-tabs.lua @@ -3,11 +3,11 @@ vim.opt.termguicolors = true local ok, bufferline = pcall(require, "bufferline") if not ok then - return + return end bufferline.setup({ - options = { - mode = "tabs", -- set to "buffers" to only show buffers instead - }, + options = { + mode = "tabs", -- set to "buffers" to only show buffers instead + }, }) diff --git a/lua/colorschemes.lua b/lua/colorschemes.lua index e58e730..0181e05 100644 --- a/lua/colorschemes.lua +++ b/lua/colorschemes.lua @@ -1,130 +1,130 @@ local colorscheme = "onedark" if colorscheme == "onedark" then - -- Onedark Default Configuration - local ok, onedark = pcall(require, "onedark") - if not ok then - return - end - onedark.setup({ - -- Main options -- - style = "darker", -- Default theme style. Choose between 'dark', 'darker', 'cool', 'deep', 'warm', 'warmer' and 'light' - transparent = false, -- Show/hide background - 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 - cmp_itemkind_reverse = false, -- reverse item kind highlights in cmp menu - -- 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 'ts' - toggle_style_list = { "dark", "darker", "cool", "deep", "warm", "warmer", "light" }, -- List of styles to toggle between - -- Change code style --- - -- Options are italic, bold, underline, none - -- You can configure multiple style with comma seperated, For e.g., keywords = 'italic,bold' - code_style = { - comments = "italic", - keywords = "none", - functions = "none", - strings = "none", - variables = "none", - }, - -- Lualine options -- - lualine = { - transparent = false, -- lualine center bar transparency - }, - -- Custom Highlights -- - colors = {}, -- Override default colors - highlights = {}, -- Override highlight groups - -- Plugins Config -- - diagnostics = { - darker = true, -- darker colors for diagnostic - undercurl = true, -- use undercurl instead of underline for diagnostics - background = true, -- use background color for virtual text - }, - }) + -- Onedark Default Configuration + local ok, onedark = pcall(require, "onedark") + if not ok then + return + end + onedark.setup({ + -- Main options -- + style = "darker", -- Default theme style. Choose between 'dark', 'darker', 'cool', 'deep', 'warm', 'warmer' and 'light' + transparent = false, -- Show/hide background + 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 + cmp_itemkind_reverse = false, -- reverse item kind highlights in cmp menu + -- 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 'ts' + toggle_style_list = { "dark", "darker", "cool", "deep", "warm", "warmer", "light" }, -- List of styles to toggle between + -- Change code style --- + -- Options are italic, bold, underline, none + -- You can configure multiple style with comma seperated, For e.g., keywords = 'italic,bold' + code_style = { + comments = "italic", + keywords = "none", + functions = "none", + strings = "none", + variables = "none", + }, + -- Lualine options -- + lualine = { + transparent = false, -- lualine center bar transparency + }, + -- Custom Highlights -- + colors = {}, -- Override default colors + highlights = {}, -- Override highlight groups + -- Plugins Config -- + diagnostics = { + darker = true, -- darker colors for diagnostic + undercurl = true, -- use undercurl instead of underline for diagnostics + background = true, -- use background color for virtual text + }, + }) - -- Load One Dark - onedark.load() + -- Load One Dark + onedark.load() end if colorscheme == "catppuccin" then - -- Catppuccin - local ok, catppuccin = pcall(require, "catppuccin") - if not ok then - return - end - catppuccin.setup({ - flavour = "mocha", -- latte, frappe, macchiato, mocha - background = { - -- :h background - light = "latte", - dark = "mocha", - }, - transparent_background = false, - show_end_of_buffer = false, -- show the '~' characters after the end of buffers - term_colors = false, - dim_inactive = { - enabled = false, - shade = "dark", - percentage = 0.15, - }, - no_italic = false, -- Force no italic - no_bold = false, -- Force no bold - styles = { - comments = { "italic" }, - conditionals = { "italic" }, - loops = {}, - functions = {}, - keywords = {}, - strings = {}, - variables = {}, - numbers = {}, - booleans = {}, - properties = {}, - types = {}, - operators = {}, - }, - color_overrides = {}, - custom_highlights = {}, - integrations = { - cmp = true, - gitsigns = true, - nvimtree = true, - telescope = true, - notify = false, - mini = false, - -- For more plugins integrations please scroll down (https://github.com/catppuccin/nvim#integrations) - }, - }) + -- Catppuccin + local ok, catppuccin = pcall(require, "catppuccin") + if not ok then + return + end + catppuccin.setup({ + flavour = "mocha", -- latte, frappe, macchiato, mocha + background = { + -- :h background + light = "latte", + dark = "mocha", + }, + transparent_background = false, + show_end_of_buffer = false, -- show the '~' characters after the end of buffers + term_colors = false, + dim_inactive = { + enabled = false, + shade = "dark", + percentage = 0.15, + }, + no_italic = false, -- Force no italic + no_bold = false, -- Force no bold + styles = { + comments = { "italic" }, + conditionals = { "italic" }, + loops = {}, + functions = {}, + keywords = {}, + strings = {}, + variables = {}, + numbers = {}, + booleans = {}, + properties = {}, + types = {}, + operators = {}, + }, + color_overrides = {}, + custom_highlights = {}, + integrations = { + cmp = true, + gitsigns = true, + nvimtree = true, + telescope = true, + notify = false, + mini = false, + -- For more plugins integrations please scroll down (https://github.com/catppuccin/nvim#integrations) + }, + }) - -- Load Catppuccin - catppuccin.load() + -- Load Catppuccin + catppuccin.load() end if colorscheme == "gruvbox" then - -- setup must be called before loading the colorscheme - -- Default options: - local ok, gruvbox = pcall(require, "gruvbox") - if not ok then - return - end + -- setup must be called before loading the colorscheme + -- Default options: + local ok, gruvbox = pcall(require, "gruvbox") + if not ok then + return + end - gruvbox.setup({ - undercurl = true, - underline = true, - bold = true, - italic = true, - strikethrough = true, - invert_selection = false, - invert_signs = false, - invert_tabline = false, - invert_intend_guides = false, - inverse = true, -- invert background for search, diffs, statuslines and errors - contrast = "", -- can be "hard", "soft" or empty string - palette_overrides = {}, - overrides = {}, - dim_inactive = false, - transparent_mode = false, - }) + gruvbox.setup({ + undercurl = true, + underline = true, + bold = true, + italic = true, + strikethrough = true, + invert_selection = false, + invert_signs = false, + invert_tabline = false, + invert_intend_guides = false, + inverse = true, -- invert background for search, diffs, statuslines and errors + contrast = "", -- can be "hard", "soft" or empty string + palette_overrides = {}, + overrides = {}, + dim_inactive = false, + transparent_mode = false, + }) - -- Load Gruvbox - gruvbox.load() + -- Load Gruvbox + gruvbox.load() end diff --git a/lua/completions.lua b/lua/completions.lua index 27dee09..846455c 100644 --- a/lua/completions.lua +++ b/lua/completions.lua @@ -1,86 +1,86 @@ local ok, cmp = pcall(require, "cmp") if not ok then - return + return end local luasnip_ok, luasnip = pcall(require, "luasnip") if not luasnip_ok then - return + return end local luasnip_vscode_ok, luasnip_vscode = pcall(require, "luasnip/loaders/from_vscode") if not luasnip_vscode_ok then - return + return end local has_words_before = function() - unpack = unpack or table.unpack - 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 + unpack = unpack or table.unpack + 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 end luasnip_vscode.lazy_load() cmp.setup({ - view = { - --entries = { name = "custom", selection_order = "near_cursor" }, - }, - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) -- For `luasnip` users. - end, - }, - mapping = { - [""] = cmp.mapping.confirm({ select = true }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - -- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable() - -- they way you will only jump inside the snippet region - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - elseif has_words_before() then - cmp.complete() - else - fallback() - end - end, { "i", "s" }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { "i", "s" }), - }, - sources = { - { name = "nvim_lsp" }, - { name = "luasnip" }, - { name = "buffer" }, - { name = "path" }, - }, - confirm_opts = { - behavior = cmp.ConfirmBehavior.Replace, - select = false, - }, - experimental = { - ghost_text = false, - }, - formatting = { - fields = { "kind", "abbr", "menu" }, - format = function(entry, vim_item) - local lk_ok, lspkind = pcall(require, "lspkind") - if not lk_ok then - return - end - local kind = lspkind.cmp_format({ mode = "symbol_text", maxwidth = 50 })(entry, vim_item) - local strings = vim.split(kind.kind, "%s", { trimempty = true }) - kind.kind = " " .. (strings[1] or "") .. " " - kind.menu = " (" .. (strings[2] or "") .. ")" + view = { + --entries = { name = "custom", selection_order = "near_cursor" }, + }, + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) -- For `luasnip` users. + end, + }, + mapping = { + [""] = cmp.mapping.confirm({ select = true }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + -- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable() + -- they way you will only jump inside the snippet region + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + elseif has_words_before() then + cmp.complete() + else + fallback() + end + end, { "i", "s" }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { "i", "s" }), + }, + sources = { + { name = "nvim_lsp" }, + { name = "luasnip" }, + { name = "buffer" }, + { name = "path" }, + }, + confirm_opts = { + behavior = cmp.ConfirmBehavior.Replace, + select = false, + }, + experimental = { + ghost_text = false, + }, + formatting = { + fields = { "kind", "abbr", "menu" }, + format = function(entry, vim_item) + local lk_ok, lspkind = pcall(require, "lspkind") + if not lk_ok then + return + end + local kind = lspkind.cmp_format({ mode = "symbol_text", maxwidth = 50 })(entry, vim_item) + local strings = vim.split(kind.kind, "%s", { trimempty = true }) + kind.kind = " " .. (strings[1] or "") .. " " + kind.menu = " (" .. (strings[2] or "") .. ")" - return kind - end, - }, + return kind + end, + }, }) diff --git a/lua/file-tree.lua b/lua/file-tree.lua index e7c4f17..3610a47 100644 --- a/lua/file-tree.lua +++ b/lua/file-tree.lua @@ -1,5 +1,5 @@ -- disable netrw - vim.g.loaded_netrw = 1 +vim.g.loaded_netrw = 1 vim.g.loaded_netrwPlugin = 1 -- set termguicolors to enable highlight groups diff --git a/lua/lsp-config.lua b/lua/lsp-config.lua index 7929164..f4922e9 100644 --- a/lua/lsp-config.lua +++ b/lua/lsp-config.lua @@ -1,50 +1,50 @@ local lspconfig_status_ok, lspconfig = pcall(require, "lspconfig") if not lspconfig_status_ok then - return + return end local mason_status_ok, mason = pcall(require, "mason") if not mason_status_ok then - return + return end local mason_lspconfig_status_ok, mason_lspconfig = pcall(require, "mason-lspconfig") if not mason_lspconfig_status_ok then - return + return end mason.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") if not cnl_ok then - return + return end local capabilities = cmp_nvim_lsp.default_capabilities() mason_lspconfig.setup_handlers({ - function(server) - lspconfig[server].setup({ capabilities = capabilities }) - lspconfig.lua_ls.setup({ - capabilities = capabilities, - settings = { - Lua = { - diagnostics = { - -- Get the language server to recognize the `vim` global - globals = { "vim" }, - }, - }, - }, - }) - end, - ["rust_analyzer"] = function() - local rt_ok, rust_tools = pcall(require, "rust-tools") - if rt_ok then - rust_tools.setup({}) - end - end + function(server) + lspconfig[server].setup({ capabilities = capabilities }) + lspconfig.lua_ls.setup({ + capabilities = capabilities, + settings = { + Lua = { + diagnostics = { + -- Get the language server to recognize the `vim` global + globals = { "vim" }, + }, + }, + }, + }) + end, + ["rust_analyzer"] = function() + local rt_ok, rust_tools = pcall(require, "rust-tools") + if rt_ok then + rust_tools.setup({}) + end + end, }) diff --git a/lua/lsp-format.lua b/lua/lsp-format.lua index 7dd69e1..f2824bb 100644 --- a/lua/lsp-format.lua +++ b/lua/lsp-format.lua @@ -1,29 +1,29 @@ local ok, null_ls = pcall(require, "null-ls") if not ok then - return + return end local formatting = null_ls.builtins.formatting local augroup = vim.api.nvim_create_augroup("LspFormatting", {}) null_ls.setup({ - sources = { - formatting.rustfmt, - formatting.stylua, - formatting.black, - formatting.prettier, - }, -- you can reuse a shared lspconfig on_attach callback here - on_attach = function(client, bufnr) - if client.supports_method("textDocument/formatting") then - vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr }) - vim.api.nvim_create_autocmd("BufWritePre", { - group = augroup, - buffer = bufnr, - callback = function() - -- on 0.8, you should use vim.lsp.buf.format({ bufnr = bufnr }) instead - vim.lsp.buf.format({ bufnr = bufnr }) - end, - }) - end - end, + sources = { + formatting.rustfmt, + formatting.stylua, + formatting.black, + formatting.prettier, + }, -- you can reuse a shared lspconfig on_attach callback here + on_attach = function(client, bufnr) + if client.supports_method("textDocument/formatting") then + vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr }) + vim.api.nvim_create_autocmd("BufWritePre", { + group = augroup, + buffer = bufnr, + callback = function() + -- on 0.8, you should use vim.lsp.buf.format({ bufnr = bufnr }) instead + vim.lsp.buf.format({ bufnr = bufnr }) + end, + }) + end + end, }) diff --git a/lua/plugins.lua b/lua/plugins.lua index c6b33a8..9fa3046 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -1,85 +1,85 @@ local ok, packer = pcall(require, "packer") if not ok then - return + return end packer.startup(function(use) - -- Onedark colorscheme - use({ "navarasu/onedark.nvim" }) + -- Onedark colorscheme + use({ "navarasu/onedark.nvim" }) - -- Gruvbox colorscheme - use({ "ellisonleao/gruvbox.nvim" }) + -- Gruvbox colorscheme + use({ "ellisonleao/gruvbox.nvim" }) - -- Catppuccin colorscheme - use({ "catppuccin/nvim", as = "catppuccin" }) + -- Catppuccin colorscheme + use({ "catppuccin/nvim", as = "catppuccin" }) - -- Plugin manager - use({ "wbthomason/packer.nvim" }) + -- Plugin manager + use({ "wbthomason/packer.nvim" }) - -- Terminal - use({ "akinsho/toggleterm.nvim", tag = "*" }) + -- Terminal + use({ "akinsho/toggleterm.nvim", tag = "*" }) - -- File tree - use({ - "nvim-tree/nvim-tree.lua", - requires = { - "nvim-tree/nvim-web-devicons", -- optional, for file icons - }, - tag = "nightly", -- optional, updated every week. (see issue #1193) - }) + -- File tree + use({ + "nvim-tree/nvim-tree.lua", + requires = { + "nvim-tree/nvim-web-devicons", -- optional, for file icons + }, + tag = "nightly", -- optional, updated every week. (see issue #1193) + }) - -- Statusline - use({ - "nvim-lualine/lualine.nvim", - requires = { "kyazdani42/nvim-web-devicons", opt = true }, - }) + -- Statusline + use({ + "nvim-lualine/lualine.nvim", + requires = { "kyazdani42/nvim-web-devicons", opt = true }, + }) - -- Buffer tabs - use({ "akinsho/bufferline.nvim", tag = "v3.*", requires = "nvim-tree/nvim-web-devicons" }) + -- Buffer tabs + use({ "akinsho/bufferline.nvim", tag = "v3.*", requires = "nvim-tree/nvim-web-devicons" }) - use({ - "nvim-telescope/telescope.nvim", - tag = "0.1.1", - -- or , branch = '0.1.x', - requires = { { "nvim-lua/plenary.nvim" } }, - }) + use({ + "nvim-telescope/telescope.nvim", + tag = "0.1.1", + -- or , branch = '0.1.x', + requires = { { "nvim-lua/plenary.nvim" } }, + }) - -- LSP manager - use({ "williamboman/mason.nvim" }) - use({ "williamboman/mason-lspconfig.nvim" }) - use({ "neovim/nvim-lspconfig" }) + -- LSP manager + use({ "williamboman/mason.nvim" }) + use({ "williamboman/mason-lspconfig.nvim" }) + use({ "neovim/nvim-lspconfig" }) - use({ "jose-elias-alvarez/null-ls.nvim" }) + use({ "jose-elias-alvarez/null-ls.nvim" }) - -- Completions - use("hrsh7th/nvim-cmp") -- The completion plugin - use("hrsh7th/cmp-buffer") -- buffer completions - use("hrsh7th/cmp-path") -- path completions - use("saadparwaiz1/cmp_luasnip") -- snippet completions + -- Completions + use("hrsh7th/nvim-cmp") -- The completion plugin + use("hrsh7th/cmp-buffer") -- buffer completions + use("hrsh7th/cmp-path") -- path completions + use("saadparwaiz1/cmp_luasnip") -- snippet completions - use("onsails/lspkind.nvim") - use("windwp/nvim-autopairs") - use("hrsh7th/cmp-nvim-lsp") + use("onsails/lspkind.nvim") + use("windwp/nvim-autopairs") + use("hrsh7th/cmp-nvim-lsp") - -- Snippets - use("L3MON4D3/LuaSnip") --snippet engine - use("rafamadriz/friendly-snippets") -- a bunch of snippets to use + -- Snippets + use("L3MON4D3/LuaSnip") --snippet engine + use("rafamadriz/friendly-snippets") -- a bunch of snippets to use - use({ - "nvim-treesitter/nvim-treesitter", - run = function() - local ntsi_ok, nvim_treesitter_install = pcall(require, "nvim-treesitter.install") - if ntsi_ok then - local ts_update = nvim_treesitter_install.install.update({ with_sync = true }) - ts_update() - end - end, - }) + use({ + "nvim-treesitter/nvim-treesitter", + run = function() + local ntsi_ok, nvim_treesitter_install = pcall(require, "nvim-treesitter.install") + if ntsi_ok then + local ts_update = nvim_treesitter_install.install.update({ with_sync = true }) + ts_update() + end + end, + }) - --use 'neovim/nvim-lspconfig' - use 'simrat39/rust-tools.nvim' + --use 'neovim/nvim-lspconfig' + use("simrat39/rust-tools.nvim") - -- Debugging - --use 'nvim-lua/plenary.nvim' - use 'mfussenegger/nvim-dap' + -- Debugging + --use 'nvim-lua/plenary.nvim' + use("mfussenegger/nvim-dap") end) diff --git a/lua/statusline.lua b/lua/statusline.lua index 12c1eef..515443d 100644 --- a/lua/statusline.lua +++ b/lua/statusline.lua @@ -1,45 +1,45 @@ local ok, lualine = pcall(require, "lualine") if not ok then - return + return end lualine.setup({ - options = { - icons_enabled = true, - theme = "auto", - component_separators = { left = "", right = "" }, - section_separators = { left = "", right = "" }, - disabled_filetypes = { - statusline = {}, - winbar = {}, - }, - ignore_focus = {}, - always_divide_middle = true, - globalstatus = false, - refresh = { - statusline = 1000, - tabline = 1000, - winbar = 1000, - }, - }, - sections = { - lualine_a = { "mode" }, - lualine_b = { "branch", "diff", "diagnostics" }, - lualine_c = { "filename" }, - lualine_x = { "encoding", "fileformat", "filetype" }, - lualine_y = { "progress" }, - lualine_z = { "location" }, - }, - inactive_sections = { - lualine_a = {}, - lualine_b = {}, - lualine_c = { "filename" }, - lualine_x = { "location" }, - lualine_y = {}, - lualine_z = {}, - }, - tabline = {}, - winbar = {}, - inactive_winbar = {}, - extensions = {}, + options = { + icons_enabled = true, + theme = "auto", + component_separators = { left = "", right = "" }, + section_separators = { left = "", right = "" }, + disabled_filetypes = { + statusline = {}, + winbar = {}, + }, + ignore_focus = {}, + always_divide_middle = true, + globalstatus = false, + refresh = { + statusline = 1000, + tabline = 1000, + winbar = 1000, + }, + }, + sections = { + lualine_a = { "mode" }, + lualine_b = { "branch", "diff", "diagnostics" }, + lualine_c = { "filename" }, + lualine_x = { "encoding", "fileformat", "filetype" }, + lualine_y = { "progress" }, + lualine_z = { "location" }, + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = { "filename" }, + lualine_x = { "location" }, + lualine_y = {}, + lualine_z = {}, + }, + tabline = {}, + winbar = {}, + inactive_winbar = {}, + extensions = {}, }) diff --git a/lua/syntax-highlight.lua b/lua/syntax-highlight.lua index 00a8a30..975b084 100644 --- a/lua/syntax-highlight.lua +++ b/lua/syntax-highlight.lua @@ -1,42 +1,42 @@ local ok, nvim_treesitter = pcall(require, "nvim-treesitter.configs") if not ok then - return + return end nvim_treesitter.setup({ - -- A list of parser names, or "all" (the four listed parsers should always be installed) - ensure_installed = { "c", "help", "lua", "vim", "cpp", "rust" }, - -- Install parsers synchronously (only applied to `ensure_installed`) - sync_install = false, - -- Automatically install missing parsers when entering buffer - -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally - auto_install = true, - -- List of parsers to ignore installing (for "all") - ignore_install = { "javascript" }, - ---- 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")! + -- A list of parser names, or "all" (the four listed parsers should always be installed) + ensure_installed = { "c", "help", "lua", "vim", "cpp", "rust" }, + -- Install parsers synchronously (only applied to `ensure_installed`) + sync_install = false, + -- Automatically install missing parsers when entering buffer + -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally + auto_install = true, + -- List of parsers to ignore installing (for "all") + ignore_install = { "javascript" }, + ---- 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")! - highlight = { - enable = true, - -- 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 - -- the name of the parser) - -- list of language that will be disabled - disable = { "" }, - -- Or use a function for more flexibility, e.g. to disable slow treesitter highlight for large files - --disable = function(lang, buf) - -- local max_filesize = 100 * 1024 -- 100 KB - -- 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 - -- return true - -- end - --end, + highlight = { + enable = true, + -- 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 + -- the name of the parser) + -- list of language that will be disabled + disable = { "" }, + -- Or use a function for more flexibility, e.g. to disable slow treesitter highlight for large files + --disable = function(lang, buf) + -- local max_filesize = 100 * 1024 -- 100 KB + -- 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 + -- return true + -- end + --end, - -- 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). - -- 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 - additional_vim_regex_highlighting = true, - }, - indent = { enable = true, disable = { "yaml" } }, + -- 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). + -- 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 + additional_vim_regex_highlighting = true, + }, + indent = { enable = true, disable = { "yaml" } }, })