diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index d97a44d..259480a 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -66,4 +66,3 @@ require('keymap') -- load general colorscheme require('colorscheme') - diff --git a/.config/nvim/lua/autocmd.lua b/.config/nvim/lua/autocmd.lua index 87a115b..7d0a4fc 100644 --- a/.config/nvim/lua/autocmd.lua +++ b/.config/nvim/lua/autocmd.lua @@ -2,7 +2,7 @@ -- read files correctly vim.filetype.add({ -extension = { + extension = { c = 'c', h = 'c', html = 'html', @@ -13,96 +13,112 @@ extension = { nim = 'nim', py = 'python', tex = 'tex', -}}) + } +}) -- delete trailing whitespaces on save -vim.api.nvim_create_autocmd({'BufWritePre'}, -{pattern = {'*'}, -command = [[%s/\s\+$//e]], -}) +vim.api.nvim_create_autocmd({ 'BufWritePre' }, + { + pattern = { '*' }, + command = [[%s/\s\+$//e]], + }) -- settings for filetype: c -vim.api.nvim_create_autocmd({'VimLeave'}, -{pattern = {'c'}, -command = '!cclear' -}) +vim.api.nvim_create_autocmd({ 'VimLeave' }, + { + pattern = { 'c' }, + command = '!cclear' + }) -vim.api.nvim_create_autocmd({'BufEnter', 'FileType'}, -{pattern = {'c'}, -command = 'set colorcolumn=80' -}) +vim.api.nvim_create_autocmd({ 'BufEnter', 'FileType' }, + { + pattern = { 'c' }, + command = 'set colorcolumn=80' + }) -- settings for filetype: java -vim.api.nvim_create_autocmd({'FileType'}, -{pattern = {'java'}, -command = 'setlocal shiftwidth=2 softtabstop=2', -}) +vim.api.nvim_create_autocmd({ 'FileType' }, + { + pattern = { 'java' }, + command = 'setlocal shiftwidth=2 softtabstop=2', + }) -vim.api.nvim_create_autocmd({'BufEnter', 'FileType'}, -{pattern = {'java'}, -command = 'set colorcolumn=100' -}) +vim.api.nvim_create_autocmd({ 'BufEnter', 'FileType' }, + { + pattern = { 'java' }, + command = 'set colorcolumn=100' + }) -- settings for filetype: javascript -vim.api.nvim_create_autocmd({'FileType'}, -{pattern = {'javascript'}, -command = 'setlocal shiftwidth=2 softtabstop=2', -}) +vim.api.nvim_create_autocmd({ 'FileType' }, + { + pattern = { 'javascript' }, + command = 'setlocal shiftwidth=2 softtabstop=2', + }) -- settings for filetype: lua -vim.api.nvim_create_autocmd({'FileType'}, -{pattern = {'lua'}, -command = 'setlocal shiftwidth=2 softtabstop=2', -}) +vim.api.nvim_create_autocmd({ 'FileType' }, + { + pattern = { 'lua' }, + command = 'setlocal shiftwidth=2 softtabstop=2', + }) -vim.api.nvim_create_autocmd({'BufEnter', 'FileType'}, -{pattern = {'lua'}, -command = 'set colorcolumn=100' -}) +vim.api.nvim_create_autocmd({ 'BufEnter', 'FileType' }, + { + pattern = { 'lua' }, + command = 'set colorcolumn=100' + }) -- settings for filetype: markdown -vim.api.nvim_create_autocmd({'FileType'}, -{pattern = {'markdown'}, -command = 'setlocal shiftwidth=2 softtabstop=2', -}) +vim.api.nvim_create_autocmd({ 'FileType' }, + { + pattern = { 'markdown' }, + command = 'setlocal shiftwidth=2 softtabstop=2', + }) -vim.api.nvim_create_autocmd({'BufEnter', 'FileType'}, -{pattern = {'markdown'}, -command = 'set colorcolumn=100' -}) +vim.api.nvim_create_autocmd({ 'BufEnter', 'FileType' }, + { + pattern = { 'markdown' }, + command = 'set colorcolumn=100' + }) -vim.api.nvim_create_autocmd({'BufEnter', 'FileType'}, -{pattern = {'markdown'}, -command = 'set conceallevel=2' -}) +vim.api.nvim_create_autocmd({ 'BufEnter', 'FileType' }, + { + pattern = { 'markdown' }, + command = 'set conceallevel=2' + }) -- settings for filetype: nim -vim.api.nvim_create_autocmd({'BufEnter', 'FileType'}, -{pattern = {'nim'}, -command = 'set colorcolumn=80' -}) +vim.api.nvim_create_autocmd({ 'BufEnter', 'FileType' }, + { + pattern = { 'nim' }, + command = 'set colorcolumn=80' + }) -- settings for filetype: python -vim.api.nvim_create_autocmd({'BufEnter', 'FileType'}, -{pattern = {'python'}, -command = 'set colorcolumn=80' -}) +vim.api.nvim_create_autocmd({ 'BufEnter', 'FileType' }, + { + pattern = { 'python' }, + command = 'set colorcolumn=80' + }) -- settings for filetype: tex -vim.api.nvim_create_autocmd({'VimLeave'}, -{pattern = {'tex'}, -command = '!texclear %' -}) - -vim.api.nvim_create_autocmd({'BufEnter', 'FileType'}, -{pattern = {'tex'}, -command = 'set colorcolumn=80' -}) +vim.api.nvim_create_autocmd({ 'VimLeave' }, + { + pattern = { 'tex' }, + command = '!texclear %' + }) + +vim.api.nvim_create_autocmd({ 'BufEnter', 'FileType' }, + { + pattern = { 'tex' }, + command = 'set colorcolumn=80' + }) diff --git a/.config/nvim/lua/colorscheme.lua b/.config/nvim/lua/colorscheme.lua index 3935f20..a24374f 100644 --- a/.config/nvim/lua/colorscheme.lua +++ b/.config/nvim/lua/colorscheme.lua @@ -3,4 +3,4 @@ -- basic color settings vim.o.background = 'dark' vim.cmd('colorscheme tccs') -vim.api.nvim_set_hl(0, 'colorcolumn', {bg='#772222'}) +vim.api.nvim_set_hl(0, 'colorcolumn', { bg = '#772222' }) diff --git a/.config/nvim/lua/keymap.lua b/.config/nvim/lua/keymap.lua index 0e1b980..2d5ab43 100644 --- a/.config/nvim/lua/keymap.lua +++ b/.config/nvim/lua/keymap.lua @@ -4,56 +4,56 @@ vim.g.mapleader = "," -- shortcut for split navigation -vim.api.nvim_set_keymap('n', '', 'h', {noremap = true}) -vim.api.nvim_set_keymap('n', '', 'j', {noremap = true}) -vim.api.nvim_set_keymap('n', '', 'k', {noremap = true}) -vim.api.nvim_set_keymap('n', '', 'l', {noremap = true}) +vim.api.nvim_set_keymap('n', '', 'h', { noremap = true }) +vim.api.nvim_set_keymap('n', '', 'j', { noremap = true }) +vim.api.nvim_set_keymap('n', '', 'k', { noremap = true }) +vim.api.nvim_set_keymap('n', '', 'l', { noremap = true }) -- unmap unwanted commands -vim.api.nvim_set_keymap('n', '', '', {noremap = true}) -vim.api.nvim_set_keymap('n', '', '', {noremap = true}) -vim.api.nvim_set_keymap('n', '', '', {noremap = true}) -vim.api.nvim_set_keymap('n', '', '', {noremap = true}) -vim.api.nvim_set_keymap('n', '', '', {noremap = true}) -vim.api.nvim_set_keymap('n', '', '', {noremap = true}) -vim.api.nvim_set_keymap('i', '', '', {noremap = true}) -vim.api.nvim_set_keymap('i', '', '', {noremap = true}) -vim.api.nvim_set_keymap('i', '', '', {noremap = true}) -vim.api.nvim_set_keymap('i', '', '', {noremap = true}) -vim.api.nvim_set_keymap('i', '', '', {noremap = true}) -vim.api.nvim_set_keymap('i', '', '', {noremap = true}) -vim.api.nvim_set_keymap('i', '', '', {noremap = true}) -vim.api.nvim_set_keymap('i', '', '', {noremap = true}) -vim.api.nvim_set_keymap('i', '', '', {noremap = true}) -vim.api.nvim_set_keymap('i', '', '', {noremap = true}) -vim.api.nvim_set_keymap('i', '', '', {noremap = true}) +vim.api.nvim_set_keymap('n', '', '', { noremap = true }) +vim.api.nvim_set_keymap('n', '', '', { noremap = true }) +vim.api.nvim_set_keymap('n', '', '', { noremap = true }) +vim.api.nvim_set_keymap('n', '', '', { noremap = true }) +vim.api.nvim_set_keymap('n', '', '', { noremap = true }) +vim.api.nvim_set_keymap('n', '', '', { noremap = true }) +vim.api.nvim_set_keymap('i', '', '', { noremap = true }) +vim.api.nvim_set_keymap('i', '', '', { noremap = true }) +vim.api.nvim_set_keymap('i', '', '', { noremap = true }) +vim.api.nvim_set_keymap('i', '', '', { noremap = true }) +vim.api.nvim_set_keymap('i', '', '', { noremap = true }) +vim.api.nvim_set_keymap('i', '', '', { noremap = true }) +vim.api.nvim_set_keymap('i', '', '', { noremap = true }) +vim.api.nvim_set_keymap('i', '', '', { noremap = true }) +vim.api.nvim_set_keymap('i', '', '', { noremap = true }) +vim.api.nvim_set_keymap('i', '', '', { noremap = true }) +vim.api.nvim_set_keymap('i', '', '', { noremap = true }) -- mapping Dictionaries -vim.api.nvim_set_keymap('n', '', ':setlocal spell! spelllang=de_de', {noremap = true}) -vim.api.nvim_set_keymap('n', '', ':setlocal spell! spelllang=en_us', {noremap = true}) +vim.api.nvim_set_keymap('n', '', ':setlocal spell! spelllang=de_de', { noremap = true }) +vim.api.nvim_set_keymap('n', '', ':setlocal spell! spelllang=en_us', { noremap = true }) -- compiler for languages -vim.api.nvim_set_keymap('n', 'c', ':w! | !compiler %', {noremap = true}) +vim.api.nvim_set_keymap('n', 'c', ':w! | !compiler %', { noremap = true }) -- open corresponding file (pdf/html/...) -vim.api.nvim_set_keymap('n', 'p', ':!opout %', {noremap = true}) +vim.api.nvim_set_keymap('n', 'p', ':!opout %', { noremap = true }) -- save file as sudo on files that require root permission -vim.api.nvim_set_keymap('c', 'w!!', '"silent! write !sudo tee % >/dev/null" edit!', {noremap = true}) +vim.api.nvim_set_keymap('c', 'w!!', '"silent! write !sudo tee % >/dev/null" edit!', { noremap = true }) -- alias for replacing -vim.api.nvim_set_keymap('n', 'ss', ':%s//gI', {noremap = true}) +vim.api.nvim_set_keymap('n', 'ss', ':%s//gI', { noremap = true }) -- irc compatibility for interactivity -vim.api.nvim_set_keymap('n', 'is', ':.w >> indd', {noremap = true}) +vim.api.nvim_set_keymap('n', 'is', ':.w >> indd', { noremap = true }) -- majutsushi/tagbar -vim.api.nvim_set_keymap('n', '', ':TagbarToggle', {}) +vim.api.nvim_set_keymap('n', '', ':Navbuddy', {}) -- scrooloose/nerdtree -vim.api.nvim_set_keymap('n', '', ':NERDTreeToggle', {}) +vim.api.nvim_set_keymap('n', '', ':Neotree toggle', {}) -- tpope/vim-fugitive vim.api.nvim_set_keymap('n', 'ga', ':Git add %:p', { noremap = true }) diff --git a/.config/nvim/lua/loadplugins.lua b/.config/nvim/lua/loadplugins.lua index 661e528..3667de3 100644 --- a/.config/nvim/lua/loadplugins.lua +++ b/.config/nvim/lua/loadplugins.lua @@ -3,9 +3,9 @@ -- bootstrap packer local ensure_packer = function() local fn = vim.fn - local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim' + local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim' if fn.empty(fn.glob(install_path)) > 0 then - fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path}) + fn.system({ 'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path }) vim.cmd [[packadd packer.nvim]] return true end @@ -16,98 +16,113 @@ local packer_bootstrap = ensure_packer() -- load plugins with packer return require("packer").startup(function(use) - -- package manager (first entry) - use {'wbthomason/packer.nvim'} - - -- improved java syntax highlighting - use {'uiiaoo/java-syntax.vim', - ft = {'java'}} - - -- custom statusline - use {'itchyny/lightline.vim', - require = {"tiyn/vim-tccs"}} - - -- latex asynchronous pdf rendering - use {'donRaphaco/neotex', - ft = {'tex'}} - - -- navigating folders with a file tree - use {'scrooloose/nerdtree', - cmd = 'NERDTreeToggle', - requires = 'ryanoasis/vim-devicons'} - - -- nim language support - use {'zah/nim.vim', - ft = {'nim'}} - - -- automatic closing of brackets - use {'windwp/nvim-autopairs'} - - -- autocompletion and its sources - use {'hrsh7th/nvim-cmp', - requires = {'hrsh7th/cmp-buffer', - 'hrsh7th/cmp-path', - 'hrsh7th/cmp-nvim-lsp', - 'antoinemadec/fixcursorhold.nvim', - 'l3mon4d3/luasnip', - 'saadparwaiz1/cmp_luasnip', - 'neovim/nvim-lspconfig', - 'onsails/lspkind-nvim', - 'williamboman/mason.nvim', - 'williamboman/mason-lspconfig.nvim', - 'jose-elias-alvarez/null-ls.nvim', - 'LostNeophyte/null-ls-embedded', - 'nvim-lua/plenary.nvim', - 'jay-babu/mason-null-ls.nvim'}} - - -- showing color of hex values, etc - use {'norcalli/nvim-colorizer.lua'} - - -- better language highlighting by improved parsing - use {'nvim-treesitter/nvim-treesitter'} - - -- automatically close html-tags - use {'windwp/nvim-ts-autotag', - requires = {'nvim-treesitter/nvim-treesitter'}} - - -- colorful brackets - use {'luochen1990/rainbow'} - - -- show tags - use {'majutsushi/tagbar', - cmd = 'TagbarToggle'} - - -- todo symbols and highlighting - use {'folke/todo-comments.nvim', - requires = {'nvim-lua/plenary.nvim'}} - - -- git wrapper - use {'tpope/vim-fugitive'} - - -- indicate git diff status of line - use {'airblade/vim-gitgutter'} - - -- golang language support - use {'fatih/vim-go', - ft = {'go'}} - - -- markdown language support - use {'preservim/vim-markdown', - ft = {'md'}, - requires = {'godlygeek/tabular'}} - - -- bulk renamer - use {'qpkorr/vim-renamer'} - - -- additional quote/parantheses funtions - use {'tpope/vim-surround'} - - -- colorscheme - use {'tiyn/vim-tccs'} - - -- package manager sync (last entry) - if packer_bootstrap then - require('packer').sync() - end - + -- package manager (first entry) + use { 'wbthomason/packer.nvim' } + + -- improved java syntax highlighting + use { 'uiiaoo/java-syntax.vim', + ft = { 'java' } } + + -- custom statusline + use { 'itchyny/lightline.vim', + require = { "tiyn/vim-tccs" } } + + -- show signature while typing + use { 'ray-x/lsp_signature.nvim' } + + -- latex asynchronous pdf rendering + use { 'donRaphaco/neotex', + ft = { 'tex' } } + + -- fileexplorer on the side + use { + "nvim-neo-tree/neo-tree.nvim", + branch = "v3.x", + requires = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", + "MunifTanjim/nui.nvim", + } + } + + -- nim language support + use { 'zah/nim.vim', + ft = { 'nim' } } + + -- automatic closing of brackets + use { 'windwp/nvim-autopairs' } + + -- autocompletion and its sources + use { 'hrsh7th/nvim-cmp', + requires = { 'hrsh7th/cmp-buffer', + 'hrsh7th/cmp-path', + 'hrsh7th/cmp-nvim-lsp', + 'lukas-reineke/cmp-under-comparator', + 'antoinemadec/fixcursorhold.nvim', + 'l3mon4d3/luasnip', + 'saadparwaiz1/cmp_luasnip', + 'neovim/nvim-lspconfig', + 'onsails/lspkind-nvim', + 'williamboman/mason.nvim', + 'williamboman/mason-lspconfig.nvim', + 'jose-elias-alvarez/null-ls.nvim', + 'LostNeophyte/null-ls-embedded', + 'nvim-lua/plenary.nvim', + 'jay-babu/mason-null-ls.nvim' } } + + -- showing color of hex values, etc + use { 'norcalli/nvim-colorizer.lua' } + + -- show tags + use { + "SmiteshP/nvim-navbuddy", + requires = { + "neovim/nvim-lspconfig", + "SmiteshP/nvim-navic", + "MunifTanjim/nui.nvim", + } + } + + -- better language highlighting by improved parsing + use { 'nvim-treesitter/nvim-treesitter' } + + -- automatically close html-tags + use { 'windwp/nvim-ts-autotag', + requires = { 'nvim-treesitter/nvim-treesitter' } } + + -- colorful brackets + use { 'luochen1990/rainbow' } + + -- todo symbols and highlighting + use { 'folke/todo-comments.nvim', + requires = { 'nvim-lua/plenary.nvim' } } + + -- git wrapper + use { 'tpope/vim-fugitive' } + + -- indicate git diff status of line + use { 'airblade/vim-gitgutter' } + + -- golang language support + use { 'fatih/vim-go', + ft = { 'go' } } + + -- markdown language support + use { 'preservim/vim-markdown', + ft = { 'md' }, + requires = { 'godlygeek/tabular' } } + + -- bulk renamer + use { 'qpkorr/vim-renamer' } + + -- additional quote/parantheses funtions + use { 'tpope/vim-surround' } + + -- colorscheme + use { 'tiyn/vim-tccs' } + + -- package manager sync (last entry) + if packer_bootstrap then + require('packer').sync() + end end) diff --git a/.config/nvim/plugin/lightline.lua b/.config/nvim/plugin/lightline.lua index e9bdee4..09becbf 100644 --- a/.config/nvim/plugin/lightline.lua +++ b/.config/nvim/plugin/lightline.lua @@ -1,2 +1,2 @@ -- itchyny/lightline.vim -vim.g.lightline = { colorscheme = 'tccs'} +vim.g.lightline = { colorscheme = 'tccs' } diff --git a/.config/nvim/plugin/nerdtree.lua b/.config/nvim/plugin/nerdtree.lua deleted file mode 100644 index 32993db..0000000 --- a/.config/nvim/plugin/nerdtree.lua +++ /dev/null @@ -1,2 +0,0 @@ --- scrooloose/nerdtree -vim.g.NERDTreeWinPos = 'left' diff --git a/.config/nvim/plugin/nvim-cmp.lua b/.config/nvim/plugin/nvim-cmp.lua index 311a962..8a3d71f 100644 --- a/.config/nvim/plugin/nvim-cmp.lua +++ b/.config/nvim/plugin/nvim-cmp.lua @@ -1,21 +1,14 @@ -- hrsh7th/nvim-cmp --- mason package manager -require("mason").setup() -require("mason-lspconfig").setup({ - -- automatically install language servers setup below for lspconfig - automatic_setup = true, -}) - -- jose-elias-alvarez/null-ls.nvim local null_ls = require("null-ls") null_ls.setup({ - sources = { - require("null-ls-embedded").nls_source, - null_ls.builtins.formatting.black, - null_ls.builtins.formatting.mdformat, - }, + sources = { + require("null-ls-embedded").nls_source, + null_ls.builtins.formatting.black, + null_ls.builtins.formatting.mdformat, + }, }) require("null-ls").setup({ @@ -27,9 +20,17 @@ require("null-ls").setup({ }, }) +-- mason package manager +require("mason").setup() + +require("mason-lspconfig").setup({ + -- automatically install language servers setup below for lspconfig + automatic_setup = true, +}) + require("mason-null-ls").setup({ - automatic_installation = true, - ensure_installed = {} + automatic_installation = true, + ensure_installed = {} }) -- Add additional capabilities supported by nvim-cmp @@ -43,6 +44,18 @@ local cmp = require("cmp") local luasnip = require("luasnip") local lspkind = require("lspkind") cmp.setup { + sorting = { + comparators = { + cmp.config.compare.offset, + cmp.config.compare.exact, + cmp.config.compare.score, + require "cmp-under-comparator".under, + cmp.config.compare.kind, + cmp.config.compare.sort_text, + cmp.config.compare.length, + cmp.config.compare.order, + }, + }, snippet = { expand = function(args) luasnip.lsp_expand(args.body) @@ -51,27 +64,28 @@ cmp.setup { mapping = { [''] = cmp.mapping(function(fallback) if cmp.visible() then - cmp.select_prev_item() + cmp.select_prev_item() elseif luasnip.jumpable(-1) then - luasnip.jump(-1) + luasnip.jump(-1) else - fallback() + fallback() end end, { "i", "s" }), [''] = cmp.mapping(function(fallback) if cmp.visible() then - cmp.select_next_item() + cmp.select_next_item() elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() + luasnip.expand_or_jump() else - fallback() + fallback() end end, { "i", "s" }), [''] = cmp.mapping.close(), [''] = cmp.mapping.confirm { behavior = cmp.ConfirmBehavior.Replace, select = true, - }}, + } + }, sources = { { name = 'nvim_lsp' }, { name = 'path' }, @@ -84,10 +98,10 @@ cmp.setup { preset = "codicons", maxwidth = 50, menu = { - nvim_lsp = "[LSP]", - path = "[PATH]", + nvim_lsp = "[LSP]", + path = "[PATH]", buffer = "[BUF]", - luasnip = "[SNIP]", + luasnip = "[SNIP]", }, symbol_map = { Text = "", @@ -124,33 +138,47 @@ require("luasnip.loaders.from_snipmate").lazy_load() -- neovim/nvim-lspconfig local nvim_lsp = require('lspconfig') +require "lsp_signature".setup({ + bind = true, + handler_opts = { + border = "rounded" + } +}) + +local navbuddy = require("nvim-navbuddy") + +local attach_func = function(client, bufnr) + navbuddy.attach(client, bufnr) +end + -- Use a loop to conveniently call 'setup' on multiple servers and -- map buffer local keybindings when the language server attaches local servers = { "pyright", "bashls", "texlab", "ccls", "nimls", "marksman" } for _, lsp in ipairs(servers) do - nvim_lsp[lsp].setup { - on_attach=on_attach, - capabilities=capabilities, - flags = { - debounce_text_changes = 150 - } - } + nvim_lsp[lsp].setup { + on_attach = attach_func, + capabilities = capabilities, + flags = { + debounce_text_changes = 150 + } + } end -require'lspconfig'.jdtls.setup{ - on_attach=on_attach, - flags = { - debounce_text_changes = 150 - }, - cmd = { 'jdtls' } +require 'lspconfig'.jdtls.setup { + on_attach = attach_func, + flags = { + debounce_text_changes = 150 + }, + cmd = { 'jdtls' } } -require'lspconfig'.lua_ls.setup { +require 'lspconfig'.lua_ls.setup { + on_attach = attach_func, settings = { Lua = { runtime = { version = 'LuaJIT' }, - diagnostics = { globals = {'vim'} }, + diagnostics = { globals = { 'vim' } }, workspace = { library = vim.api.nvim_get_runtime_file("", true) }, telemetry = { enable = false }, }, diff --git a/.config/nvim/plugin/nvim-colorizer.lua b/.config/nvim/plugin/nvim-colorizer.lua index 6ef84fb..87abf97 100644 --- a/.config/nvim/plugin/nvim-colorizer.lua +++ b/.config/nvim/plugin/nvim-colorizer.lua @@ -1,5 +1,5 @@ -- norcalli/nvim-colorizer.lua require 'colorizer'.setup { - '*'; - '!markdown'; + '*', + '!markdown', } diff --git a/.config/nvim/plugin/todo-comments.lua b/.config/nvim/plugin/todo-comments.lua index 5244288..fe06b51 100644 --- a/.config/nvim/plugin/todo-comments.lua +++ b/.config/nvim/plugin/todo-comments.lua @@ -1,21 +1,21 @@ -- folke/todo-comments.nvim require 'todo-comments'.setup { - signs = true, -- show icons in the signs column + signs = true, -- show icons in the signs column sign_priority = 8, -- sign priority -- keywords recognized as todo comments keywords = { - ERRO = { icon = " ", color = "error"}, + ERRO = { icon = " ", color = "error" }, TODO = { icon = " ", color = "info" }, - HACK = { icon = " ", color = "warning"}, - WARN = { icon = " ", color = "warning"}, - PERF = { icon = " ", color = "default"}, - NOTE = { icon = " ", color = "hint"}, - TEST = { icon = " ", color = "test"}, + HACK = { icon = " ", color = "warning" }, + WARN = { icon = " ", color = "warning" }, + PERF = { icon = " ", color = "default" }, + NOTE = { icon = " ", color = "hint" }, + TEST = { icon = " ", color = "test" }, }, gui_style = { - fg = "NONE", -- The gui style to use for the fg highlight group. - bg = "BOLD", -- The gui style to use for the bg highlight group. + fg = "NONE", -- The gui style to use for the fg highlight group. + bg = "BOLD", -- The gui style to use for the bg highlight group. }, merge_keywords = true, -- when true, custom keywords will be merged with the defaults -- highlighting of the line containing the todo comment @@ -23,16 +23,16 @@ require 'todo-comments'.setup { -- * keyword: highlights of the keyword -- * after: highlights after the keyword (todo text) highlight = { - multiline = true, -- enable multine todo comments - multiline_pattern = "^.", -- lua pattern to match the next multiline from the start of the matched keyword - multiline_context = 10, -- extra lines that will be re-evaluated when changing a line - before = "", -- "fg" or "bg" or empty - keyword = "wide", -- "fg", "bg", "wide", "wide_bg", "wide_fg" or empty. (wide and wide_bg is the same as bg, but will also highlight surrounding characters, wide_fg acts accordingly but with fg) - after = "fg", -- "fg" or "bg" or empty + multiline = true, -- enable multine todo comments + multiline_pattern = "^.", -- lua pattern to match the next multiline from the start of the matched keyword + multiline_context = 10, -- extra lines that will be re-evaluated when changing a line + before = "", -- "fg" or "bg" or empty + keyword = "wide", -- "fg", "bg", "wide", "wide_bg", "wide_fg" or empty. (wide and wide_bg is the same as bg, but will also highlight surrounding characters, wide_fg acts accordingly but with fg) + after = "fg", -- "fg" or "bg" or empty pattern = [[.*<(KEYWORDS)\s*:]], -- pattern or table of patterns, used for highlighting (vim regex) - comments_only = true, -- uses treesitter to match keywords in comments only - max_line_len = 400, -- ignore lines longer than this - exclude = {}, -- list of file types to exclude highlighting + comments_only = true, -- uses treesitter to match keywords in comments only + max_line_len = 400, -- ignore lines longer than this + exclude = {}, -- list of file types to exclude highlighting }, -- list of named colors where we try to extract the guifg from the -- list of highlight groups or use the hex color if hl not found as a fallback