diff --git a/config/nvim/lua/fschauen/plugins/indent-blankline.lua b/config/nvim/lua/fschauen/plugins/indent-blankline.lua index 40b0963..f1b6c63 100644 --- a/config/nvim/lua/fschauen/plugins/indent-blankline.lua +++ b/config/nvim/lua/fschauen/plugins/indent-blankline.lua @@ -9,15 +9,17 @@ M.lazy = false -- trows an error when lazy loading local chars = { '│', '¦', '┆', '┊', '┊', '┊', '┊', '┊', '┊', '┊' } local show_first_level = false -M.opts = { - enabled = false, - use_treesitter = true, - show_first_indent_level = show_first_level, - show_current_context = true, - show_trailing_blankline_indent = false, - char_list = chars, - context_char_list = chars, - indent_level = #chars + (not show_first_level and 1 or 0), -} +M.config = function() + require('indent_blankline').setup { + enabled = false, + use_treesitter = true, + show_first_indent_level = show_first_level, + show_current_context = true, + show_trailing_blankline_indent = false, + char_list = chars, + context_char_list = chars, + indent_level = #chars + (not show_first_level and 1 or 0), + } +end return M diff --git a/config/nvim/lua/fschauen/plugins/neogit.lua b/config/nvim/lua/fschauen/plugins/neogit.lua index 89b5032..b1a8af3 100644 --- a/config/nvim/lua/fschauen/plugins/neogit.lua +++ b/config/nvim/lua/fschauen/plugins/neogit.lua @@ -8,20 +8,22 @@ M.keys = { { 'gn', 'Neogit' }, } -M.opts = { - disable_hint = true, - signs = { - section = { '', '' }, - item = { '', '' }, - hunk = { '', '' }, - }, - mappings = { - status = { - o = 'GoToFile', - ['='] = 'Toggle', +M.config = function() + require('neogit').setup { + disable_hint = true, + signs = { + section = { '', '' }, + item = { '', '' }, + hunk = { '', '' }, }, - }, -} + mappings = { + status = { + o = 'GoToFile', + ['='] = 'Toggle', + }, + }, + } +end return M diff --git a/config/nvim/lua/fschauen/plugins/nvim-tree.lua b/config/nvim/lua/fschauen/plugins/nvim-tree.lua index 88c30ae..f21d944 100644 --- a/config/nvim/lua/fschauen/plugins/nvim-tree.lua +++ b/config/nvim/lua/fschauen/plugins/nvim-tree.lua @@ -10,68 +10,70 @@ M.keys = { { 'nc', 'NvimTreeClose' }, } -M.opts = { - disable_netrw = true, -- replace netrw with nvim-tree - hijack_cursor = true, -- keep the cursor on begin of the filename - sync_root_with_cwd = true, -- watch for `DirChanged` and refresh the tree +M.config = function() + require('nvim-tree').setup { + disable_netrw = true, -- replace netrw with nvim-tree + hijack_cursor = true, -- keep the cursor on begin of the filename + sync_root_with_cwd = true, -- watch for `DirChanged` and refresh the tree - on_attach = function(bufnr) - local api = require('nvim-tree.api') - api.config.mappings.default_on_attach(bufnr) + on_attach = function(bufnr) + local api = require('nvim-tree.api') + api.config.mappings.default_on_attach(bufnr) - local opts = function(desc) - return { desc = 'nvim-tree: ' .. desc, buffer = bufnr, silent = true } - end + local opts = function(desc) + return { desc = 'nvim-tree: ' .. desc, buffer = bufnr, silent = true } + end - vim.keymap.set('n', 'l', api.node.open.edit, opts('open')) - vim.keymap.set('n', '', api.node.open.edit, opts('open')) - vim.keymap.set('n', 'o', api.node.open.edit, opts('open')) - vim.keymap.set('n', 'h', api.node.navigate.parent_close, opts('close directory')) - end, + vim.keymap.set('n', 'l', api.node.open.edit, opts('open')) + vim.keymap.set('n', '', api.node.open.edit, opts('open')) + vim.keymap.set('n', 'o', api.node.open.edit, opts('open')) + vim.keymap.set('n', 'h', api.node.navigate.parent_close, opts('close directory')) + end, - git = { - ignore = false, -- don't hide files from .gitignore - }, - view = { - adaptive_size = true, -- resize the window based on the longest line - width = 35, -- a little wider than the default 30 - }, - filters = { - dotfiles = false, -- show files starting with a . - custom = { '^\\.git' }, -- don't show .git directory - }, - renderer = { - add_trailing = true, -- add trailing / to folders - highlight_git = true, -- enable highlight based on git attributes - icons = { - git_placement = 'after', - glyphs = { - default = '', - symlink = '', - modified = '●', - folder = { - arrow_closed = '', --    - arrow_open = '', --    - default = '', --   - open = '', --   - empty = '', - empty_open = '', - symlink = '', - symlink_open = '', - }, - git = { - untracked = '?', -- ★ - unstaged = '✶', -- ✗ - staged = '', -- ✓ - deleted = '', - unmerged = '', - renamed = '➜', - ignored = '◌', + git = { + ignore = false, -- don't hide files from .gitignore + }, + view = { + adaptive_size = true, -- resize the window based on the longest line + width = 35, -- a little wider than the default 30 + }, + filters = { + dotfiles = false, -- show files starting with a . + custom = { '^\\.git' }, -- don't show .git directory + }, + renderer = { + add_trailing = true, -- add trailing / to folders + highlight_git = true, -- enable highlight based on git attributes + icons = { + git_placement = 'after', + glyphs = { + default = '', + symlink = '', + modified = '●', + folder = { + arrow_closed = '', --    + arrow_open = '', --    + default = '', --   + open = '', --   + empty = '', + empty_open = '', + symlink = '', + symlink_open = '', + }, + git = { + untracked = '?', -- ★ + unstaged = '✶', -- ✗ + staged = '', -- ✓ + deleted = '', + unmerged = '', + renamed = '➜', + ignored = '◌', + }, }, }, }, - }, -} + } +end return M diff --git a/config/nvim/lua/fschauen/plugins/telescope.lua b/config/nvim/lua/fschauen/plugins/telescope.lua index 4fd161a..ecb3adb 100644 --- a/config/nvim/lua/fschauen/plugins/telescope.lua +++ b/config/nvim/lua/fschauen/plugins/telescope.lua @@ -118,7 +118,7 @@ M.keys = { { 'f', pickers.resume '󰐎 Resume' , desc = ' Telescope Resume ' }, } -M.opts = function() +M.config = function() local actions = require('telescope.actions') local layout = require('telescope.actions.layout') local trouble = vim.F.npcall(require, 'trouble.providers.telescope') or {} @@ -136,7 +136,7 @@ M.opts = function() [''] = trouble.smart_open_with_trouble, } - return { + require('telescope').setup { defaults = { mappings = { i = mappings, @@ -182,10 +182,7 @@ M.opts = function() }, }, } -end -M.config = function(_, opts) - require('telescope').setup(opts) require('telescope').load_extension 'fzf' vim.api.nvim_create_autocmd('User', { diff --git a/config/nvim/lua/fschauen/plugins/todo-comments.lua b/config/nvim/lua/fschauen/plugins/todo-comments.lua index 74e2308..55e50a0 100644 --- a/config/nvim/lua/fschauen/plugins/todo-comments.lua +++ b/config/nvim/lua/fschauen/plugins/todo-comments.lua @@ -14,17 +14,19 @@ M.keys = { { 'ft', 'TodoTelescope' }, } -M.opts = { - keywords = { - TODO = { icon = '󰄬 ' }, - FIX = { icon = ' ' }, - HACK = { icon = ' ' }, - WARN = { icon = ' ' }, - PERF = { icon = '󰓅 ' }, - NOTE = { icon = '' }, - TEST = { icon = '󰙨 ' }, - }, -} +M.config = function() + require('todo-comments').setup { + keywords = { + TODO = { icon = '󰄬 ' }, + FIX = { icon = ' ' }, + HACK = { icon = ' ' }, + WARN = { icon = ' ' }, + PERF = { icon = '󰓅 ' }, + NOTE = { icon = '' }, + TEST = { icon = '󰙨 ' }, + }, + } +end return M diff --git a/config/nvim/lua/fschauen/plugins/treesitter.lua b/config/nvim/lua/fschauen/plugins/treesitter.lua index 7a50809..3b6deed 100644 --- a/config/nvim/lua/fschauen/plugins/treesitter.lua +++ b/config/nvim/lua/fschauen/plugins/treesitter.lua @@ -27,84 +27,84 @@ M.keys = { { 'tn', 'TSNodeUnderCursor' }, } -M.main = 'nvim-treesitter.configs' - -M.opts = { - ensure_installed = { - 'bash', - 'c', - 'cpp', - 'haskell', - 'html', - 'javascript', - 'latex', - 'lua', - 'make', - 'markdown', - 'markdown_inline', - 'python', - 'query', - 'toml', - 'vim', - 'vimdoc', - 'yaml', - }, - highlight = { - enable = true, - disable = { +M.config = function() + require('nvim-treesitter.configs').setup { + ensure_installed = { + 'bash', + 'c', + 'cpp', + 'haskell', + 'html', + 'javascript', + 'latex', + 'lua', + 'make', + 'markdown', + 'markdown_inline', + 'python', + 'query', + 'toml', + 'vim', 'vimdoc', + 'yaml', }, - }, - incremental_selection = { - enable = true, - keymaps = { - init_selection = 'gnn', -- mapped in normal mode - node_incremental = '', -- mapped in visual mode - node_decremental = '', -- mapped in visual mode - scope_incremental = nil, -- disabled, normally mapped in visual mode - }, - }, - refactor = { - highlight_definitions = { enable = true }, - highlight_current_scope = { enable = false }, - smart_rename = { + highlight = { enable = true, - keymaps = { - smart_rename = 'grr', + disable = { + 'vimdoc', }, }, - navigation = { + incremental_selection = { enable = true, keymaps = { - goto_definition = 'gd', -- default: 'gnd' - list_definitions = nil, -- disabled, default: 'gnD' - list_definitions_toc = 'gO', - goto_next_usage = '', - goto_previous_usage = '', + init_selection = 'gnn', -- mapped in normal mode + node_incremental = '', -- mapped in visual mode + node_decremental = '', -- mapped in visual mode + scope_incremental = nil, -- disabled, normally mapped in visual mode }, }, - }, - textobjects = { - select = { + refactor = { + highlight_definitions = { enable = true }, + highlight_current_scope = { enable = false }, + smart_rename = { + enable = true, + keymaps = { + smart_rename = 'grr', + }, + }, + navigation = { + enable = true, + keymaps = { + goto_definition = 'gd', -- default: 'gnd' + list_definitions = nil, -- disabled, default: 'gnD' + list_definitions_toc = 'gO', + goto_next_usage = '', + goto_previous_usage = '', + }, + }, + }, + textobjects = { + select = { + enable = true, + keymaps = { + ['ab'] = '@block.outer', + ['ib'] = '@block.inner', + ['ac'] = '@conditional.outer', + ['ic'] = '@conditional.inner', + ['af'] = '@function.outer', + ['if'] = '@function.inner', + ['al'] = '@loop.outer', + ['il'] = '@loop.inner', + ['aa'] = '@parameter.outer', + ['ia'] = '@parameter.inner', + }, + }, + }, + playground = { enable = true, - keymaps = { - ['ab'] = '@block.outer', - ['ib'] = '@block.inner', - ['ac'] = '@conditional.outer', - ['ic'] = '@conditional.inner', - ['af'] = '@function.outer', - ['if'] = '@function.inner', - ['al'] = '@loop.outer', - ['il'] = '@loop.inner', - ['aa'] = '@parameter.outer', - ['ia'] = '@parameter.inner', - }, }, - }, - playground = { - enable = true, - }, -} + } +end return M diff --git a/config/nvim/lua/fschauen/plugins/trouble.lua b/config/nvim/lua/fschauen/plugins/trouble.lua index 73d57a0..f756b0b 100644 --- a/config/nvim/lua/fschauen/plugins/trouble.lua +++ b/config/nvim/lua/fschauen/plugins/trouble.lua @@ -10,10 +10,12 @@ M.keys = { { 'ld', 'TroubleToggle document_diagnostics' }, } -M.opts = { - padding = false, -- don't add an extra new line of top of the list - auto_preview = false, -- don't preview automatically -} +M.config = function() + require('trouble').setup { + padding = false, -- don't add an extra new line of top of the list + auto_preview = false, -- don't preview automatically + } +end return M diff --git a/config/nvim/lua/fschauen/plugins/virt-column.lua b/config/nvim/lua/fschauen/plugins/virt-column.lua index 023631f..92890f8 100644 --- a/config/nvim/lua/fschauen/plugins/virt-column.lua +++ b/config/nvim/lua/fschauen/plugins/virt-column.lua @@ -17,9 +17,11 @@ M.keys = { { 'sc', toggle_colorcolumn, desc = 'Toggle virtual colunn' }, } -M.opts = { - char = '│', -} +M.config = function() + require('virt-column').setup { + char = '│', + } +end return M