[[plugins]] repo = 'nvim-treesitter/nvim-treesitter' if = '!has("win32")' on_event = ['BufRead', 'CursorHold'] on_ft = ['help'] hook_post_update = 'TSUpdate' lua_source = ''' require('nvim-treesitter.configs').setup { ensure_installed = 'all', ignore_install = { 'hoon', 'mlir', 'ocamllex', 'swift', 'unison', }, sync_install = true, additional_vim_regex_highlighting = false, highlight = { enable = true, }, indent = { enable = true, disable = { 'help', 'toml', }, }, } ''' hook_source = ''' " Custom colors highlight CandyBlue gui=NONE guibg=NONE guifg=#1e95fd highlight CandyCranberry gui=NONE guibg=NONE guifg=#4ae2e2 highlight CandyEmerald gui=NONE guibg=NONE guifg=#44ff44 highlight CandyGreen gui=NONE guibg=NONE guifg=#66ff66 highlight CandyLime gui=NONE guibg=NONE guifg=#4ae2e2 highlight CandyOrange gui=NONE guibg=NONE guifg=#ffb30a highlight CandyRed gui=NONE guibg=NONE guifg=#ff6666 highlight CandySky gui=NONE guibg=NONE guifg=#6699ff highlight CandyViolet gui=NONE guibg=NONE guifg=#ff13ff highlight CandyWhite gui=NONE guibg=NONE guifg=#cccccc highlight CandyYellow gui=NONE guibg=NONE guifg=#ffd30a highlight CandyCoral gui=NONE guibg=NONE guifg=#f820ff highlight CandyTurquoise gui=NONE guibg=NONE guifg=#1bc8c8 highlight CandyCrimson gui=NONE guibg=NONE guifg=#ff4444 " neovim treesitter colors highlight! link @attribute CandyViolet highlight! link @boolean Boolean highlight! link @character Character highlight! link @character.special SpecialChar highlight! link @comment Comment highlight! link @comment.note WarningMsg highlight! link @conditional CandyCoral highlight! link @constant Constant highlight! link @constant.builtin CandyGreen highlight! link @constant.macro CandyViolet highlight! link @constructor CandyEmerald highlight! link @debug Character highlight! link @error Error highlight! link @exception Exception highlight! link @field CandyBlue highlight! link @float Float highlight! link @function CandyCranberry highlight! link @function.builtin CandySky highlight! link @function.call CandySky highlight! link @function.macro CandySky highlight! link @include CandyCranberry highlight! link @keyword CandyEmerald highlight! link @keyword.function Keyword highlight! link @keyword.operator CandyViolet highlight! link @keyword.return CandyRed highlight! link @label Label highlight! link @markup.link PreProc highlight! link @markup.raw String highlight! link @method CandyTurquoise highlight! link @method.call CandyTurquoise highlight! link @namespace CandyBlue highlight! link @none Normal highlight! link @number Number highlight! link @operator Operator highlight! link @parameter CandyYellow highlight! link @preproc PreProc highlight! link @property Identifier highlight! link @punctuation.special Special highlight! link @repeat Repeat highlight! link @storageclass CandyBlue highlight! link @string String highlight! link @string.escape SpecialChar highlight! link @string.regex String highlight! link @symbol Identifier highlight! link @tag SpecialChar highlight! link @tag.attribute CandyBlue highlight! link @tag.delimiter CandyLime highlight! link @text None highlight! link @text.danger ErrorMsg highlight! link @text.emphasis Italic highlight! link @text.environment CandyGreen highlight! link @text.environment.name CandyLime highlight! link @text.literal CandyYellow highlight! link @text.math CandyBlue highlight! link @text.note Todo highlight! link @text.reference CandySky highlight! link @text.strike Underlined highlight! link @text.strong Bold highlight! link @text.tile Title highlight! link @text.underline Underlined highlight! link @text.uri Underlined highlight! link @text.warning WarningMsg highlight! link @todo Todo highlight! link @type Type highlight! link @type.builtin Type highlight! link @type.definition Type highlight! link @type.qualifier Type highlight! link @variable Identifier highlight! link @variable.builtin CandyLime highlight! link @variable.global CandyViolet highlight! link @variable.parameter CandyYellow ''' [[plugins]] repo = 'neovim/nvim-lspconfig' lua_source = ''' -- NOTE: Disable lsp watcher. Too slow on linux -- https://github.com/neovim/neovim/issues/23725#issuecomment-1561364086 require('vim.lsp._watchfiles')._watchfunc = function() return function() end end vim.lsp.handlers['textDocument/publishDiagnostics'] = vim.lsp.with( vim.lsp.diagnostic.on_publish_diagnostics, { update_in_insert = false, virtual_text = { severity = { min = 'WARN', }, severity_sort = true, format = function(diagnostic) if diagnostic.code then return string.format( '%s (%s: %s)', diagnostic.message, diagnostic.source, diagnostic.code ) else return string.format( '%s (%s)', diagnostic.message, diagnostic.source ) end end, }, }) ''' [[plugins]] repo = 'williamboman/mason-lspconfig.nvim' on_source = 'nvim-lspconfig' depends = 'ddc-source-lsp' lua_source = ''' -- https://zenn.dev/kawarimidoll/articles/2b57745045b225 require('mason-lspconfig').setup_handlers({ function(server_name) local nvim_lsp = require('lspconfig') local opts = {} if server_name == 'vtsls' then -- NOTE: Must be node directory if vim.fn.findfile('package.json', '.;') == '' then return end opts.root_dir = nvim_lsp.util.root_pattern('package.json') elseif server_name == 'denols' then -- NOTE: Disable denols. It is too slow. -- Disable nest.land imports -- https://github.com/neovim/nvim-lspconfig/pull/2793 opts = { settings = { deno = { suggest = { imports = { autoDiscover = false, hosts = { ['https://x.nest.land'] = false, }, }, }, }, }, } return elseif server_name == 'solargraph' then opts.single_file_support = true opts.capabilities = {} elseif server_name == 'lua_ls' then opts = { settings = { Lua = { runtime = { -- Tell the language server which version of Lua you're using -- (most likely LuaJIT in the case of Neovim) version = 'LuaJIT', }, diagnostics = { -- Get the language server to recognize the `vim` global globals = { 'vim', 'require', }, }, workspace = { -- Make the server aware of Neovim runtime files library = vim.api.nvim_get_runtime_file("", true), }, -- Do not send telemetry data telemetry = { enable = false, }, }, }, } elseif server_name == 'rust_analyzer' then local capabilities = require("ddc_source_lsp").make_client_capabilities() opts.capabilities = capabilities end nvim_lsp[server_name].setup(opts) end }) ''' [[plugins]] repo = 'williamboman/mason.nvim' depends = 'nvim-lspconfig' on_event = 'FileType' lua_source = ''' require('mason').setup() ''' [[plugins]] repo = 'atusy/tsnode-marker.nvim' depends = 'nvim-treesitter' on_ft = 'markdown' lua_source = ''' vim.api.nvim_create_autocmd('FileType', { group = vim.api.nvim_create_augroup('tsnode-marker-markdown', {}), pattern = 'markdown', callback = function(ctx) require('tsnode-marker').set_automark(ctx.buf, { target = { 'code_fence_content' }, -- list of target node types hl_group = 'CursorLine', -- highlight group }) end, }) ''' [[plugins]] repo = 'rcarriga/nvim-notify' on_lua = 'notify' [[plugins]] repo = 'chomosuke/typst-preview.nvim' on_ft = 'typst' [[plugins]] repo = 'hrsh7th/nvim-anydent' on_event = ['BufRead', 'CursorHold'] lua_source = ''' vim.api.nvim_create_autocmd('FileType', { callback = function() if not vim.tbl_contains({ 'html', 'yaml', 'markdown', }, vim.bo.filetype) then require('anydent').attach() end end }) '''