From f327679ca9d8dc0d5b2c8007ebefa89c6c1a4af9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Kmie=C4=87?= Date: Tue, 14 Feb 2023 14:42:29 +0100 Subject: [PATCH] nvim: move to lazy package manager --- .config/nvim/after/available/boole.rc.lua | 18 -- .config/nvim/after/available/comment.rc.lua | 1 - .config/nvim/after/available/context.rc.lua | 35 --- .config/nvim/after/available/crates.rc.lua | 1 - .../nvim/after/available/debugprint.rc.lua | 1 - .config/nvim/after/available/dressing.rc.lua | 159 ------------ .config/nvim/after/available/femaco.rc.lua | 1 - .config/nvim/after/available/fterm.rc.lua | 41 ---- .config/nvim/after/available/gitsigns.rc.lua | 104 -------- .config/nvim/after/available/icons.rc.lua | 1 - .../nvim/after/available/illuminate.rc.lua | 42 ---- .config/nvim/after/available/indent.rc.lua | 22 -- .config/nvim/after/available/iswap.rc.lua | 1 - .config/nvim/after/available/knap.rc.lua | 29 --- .config/nvim/after/available/lspconfig.rc.lua | 150 ------------ .config/nvim/after/available/lualine.rc.lua | 222 ----------------- .config/nvim/after/available/minimap.rc.lua | 1 - .config/nvim/after/available/mkdnflow.rc.lua | 88 ------- .config/nvim/after/available/neoscroll.rc.lua | 13 - .config/nvim/after/available/nvim-cmp.rc.lua | 68 ------ .config/nvim/after/available/nvim-dap.rc.lua | 0 .config/nvim/after/available/nvim-tree.rc.lua | 127 ---------- .config/nvim/after/available/peek.rc.lua | 34 --- .config/nvim/after/available/snippets.rc.lua | 11 - .config/nvim/after/available/themer.rc.lua | 11 - .../nvim/after/available/treesitter.rc.lua | 58 ----- .config/nvim/after/available/ufo.rc.lua | 12 - .config/nvim/after/available/which.rc.lua | 5 - .config/nvim/after/available/windows.rc.lua | 3 - .config/nvim/after/plugin/boole.rc.lua | 1 - .config/nvim/after/plugin/comment.rc.lua | 1 - .config/nvim/after/plugin/context.rc.lua | 1 - .config/nvim/after/plugin/crates.rc.lua | 1 - .config/nvim/after/plugin/debugprint.rc.lua | 1 - .config/nvim/after/plugin/digraphs.rc.vim | 1 - .config/nvim/after/plugin/dressing.rc.lua | 1 - .config/nvim/after/plugin/femaco.rc.lua | 1 - .config/nvim/after/plugin/fterm.rc.lua | 1 - .config/nvim/after/plugin/gitsigns.rc.lua | 1 - .config/nvim/after/plugin/hlslens.rc.vim | 1 - .config/nvim/after/plugin/icons.rc.lua | 1 - .config/nvim/after/plugin/illuminate.rc.lua | 1 - .config/nvim/after/plugin/indent.rc.lua | 1 - .config/nvim/after/plugin/iswap.rc.lua | 1 - .config/nvim/after/plugin/knap.rc.lua | 1 - .config/nvim/after/plugin/lspconfig.rc.lua | 1 - .config/nvim/after/plugin/lualine.rc.lua | 1 - .config/nvim/after/plugin/minimap.rc.lua | 1 - .config/nvim/after/plugin/mkdnflow.rc.lua | 1 - .config/nvim/after/plugin/neogen.rc.lua | 1 - .config/nvim/after/plugin/neoscroll.rc.lua | 1 - .config/nvim/after/plugin/nvim-cmp.rc.lua | 1 - .config/nvim/after/plugin/nvim-dap.rc.lua | 1 - .config/nvim/after/plugin/nvim-tree.rc.lua | 1 - .config/nvim/after/plugin/peek.rc.lua | 1 - .config/nvim/after/plugin/search-pulse.rc.vim | 1 - .config/nvim/after/plugin/snippets.rc.lua | 1 - .config/nvim/after/plugin/startify.rc.vim | 1 - .config/nvim/after/plugin/themer.rc.lua | 1 - .config/nvim/after/plugin/treesitter.rc.lua | 1 - .config/nvim/after/plugin/ufo.rc.lua | 1 - .config/nvim/after/plugin/vim-test.rc.vim | 1 - .config/nvim/after/plugin/virt-column.rc.vim | 1 - .config/nvim/after/plugin/which.rc.lua | 1 - .config/nvim/after/plugin/windows.rc.lua | 1 - .config/nvim/init.vim | 37 --- .config/nvim/lua/core/mappings.lua | 4 +- .config/nvim/lua/core/plugins.lua | 161 ++----------- .config/nvim/lua/core/temp.lua | 16 -- .config/nvim/lua/plugins/boole.lua | 23 ++ .config/nvim/lua/plugins/comment.lua | 4 + .../nvim/lua/plugins/compiler-explorer.lua | 4 + .config/nvim/lua/plugins/context.lua | 41 ++++ .config/nvim/lua/plugins/crates.lua | 5 + .config/nvim/lua/plugins/debugprint.lua | 4 + .config/nvim/lua/plugins/dressing.lua | 162 +++++++++++++ .config/nvim/lua/plugins/femaco.lua | 5 + .config/nvim/lua/plugins/fterm.lua | 44 ++++ .config/nvim/lua/plugins/gitlinker.lua | 29 +++ .config/nvim/lua/plugins/gitsigns.lua | 107 +++++++++ .config/nvim/lua/plugins/icons.lua | 6 + .config/nvim/lua/plugins/illuminate.lua | 47 ++++ .config/nvim/lua/plugins/image.lua | 13 + .config/nvim/lua/plugins/init.lua | 115 +++++++++ .config/nvim/lua/plugins/knap.lua | 34 +++ .config/nvim/lua/plugins/lspconfig.lua | 155 ++++++++++++ .config/nvim/lua/plugins/lualine.lua | 227 ++++++++++++++++++ .config/nvim/lua/plugins/minimap.lua | 6 + .config/nvim/lua/plugins/mkdnflow.lua | 91 +++++++ .../neogen.rc.lua => lua/plugins/neogen.lua} | 12 +- .config/nvim/lua/plugins/nvim-cmp.lua | 82 +++++++ .config/nvim/lua/plugins/nvim-tree.lua | 134 +++++++++++ .config/nvim/lua/plugins/peek.lua | 42 ++++ .config/nvim/lua/plugins/quicknote.lua | 7 + .config/nvim/lua/plugins/snippets.lua | 21 ++ .config/nvim/lua/plugins/swap.lua | 4 + .config/nvim/lua/plugins/symbols-outline.lua | 4 + .config/nvim/lua/plugins/telescope.lua | 11 + .config/nvim/lua/plugins/treesitter.lua | 95 ++++++++ .config/nvim/lua/plugins/ufo.lua | 18 ++ .config/nvim/lua/plugins/vim-cmake.lua | 33 +++ .config/nvim/lua/plugins/virt-column.lua | 4 + .config/nvim/lua/plugins/which.lua | 4 + .config/nvim/lua/plugins/windows.lua | 12 + 104 files changed, 1617 insertions(+), 1501 deletions(-) delete mode 100644 .config/nvim/after/available/boole.rc.lua delete mode 100644 .config/nvim/after/available/comment.rc.lua delete mode 100644 .config/nvim/after/available/context.rc.lua delete mode 100644 .config/nvim/after/available/crates.rc.lua delete mode 100644 .config/nvim/after/available/debugprint.rc.lua delete mode 100644 .config/nvim/after/available/dressing.rc.lua delete mode 100644 .config/nvim/after/available/femaco.rc.lua delete mode 100644 .config/nvim/after/available/fterm.rc.lua delete mode 100644 .config/nvim/after/available/gitsigns.rc.lua delete mode 100644 .config/nvim/after/available/icons.rc.lua delete mode 100644 .config/nvim/after/available/illuminate.rc.lua delete mode 100644 .config/nvim/after/available/indent.rc.lua delete mode 100644 .config/nvim/after/available/iswap.rc.lua delete mode 100644 .config/nvim/after/available/knap.rc.lua delete mode 100644 .config/nvim/after/available/lspconfig.rc.lua delete mode 100644 .config/nvim/after/available/lualine.rc.lua delete mode 100644 .config/nvim/after/available/minimap.rc.lua delete mode 100644 .config/nvim/after/available/mkdnflow.rc.lua delete mode 100644 .config/nvim/after/available/neoscroll.rc.lua delete mode 100644 .config/nvim/after/available/nvim-cmp.rc.lua delete mode 100644 .config/nvim/after/available/nvim-dap.rc.lua delete mode 100644 .config/nvim/after/available/nvim-tree.rc.lua delete mode 100644 .config/nvim/after/available/peek.rc.lua delete mode 100644 .config/nvim/after/available/snippets.rc.lua delete mode 100644 .config/nvim/after/available/themer.rc.lua delete mode 100644 .config/nvim/after/available/treesitter.rc.lua delete mode 100644 .config/nvim/after/available/ufo.rc.lua delete mode 100644 .config/nvim/after/available/which.rc.lua delete mode 100644 .config/nvim/after/available/windows.rc.lua delete mode 120000 .config/nvim/after/plugin/boole.rc.lua delete mode 120000 .config/nvim/after/plugin/comment.rc.lua delete mode 120000 .config/nvim/after/plugin/context.rc.lua delete mode 120000 .config/nvim/after/plugin/crates.rc.lua delete mode 120000 .config/nvim/after/plugin/debugprint.rc.lua delete mode 120000 .config/nvim/after/plugin/digraphs.rc.vim delete mode 120000 .config/nvim/after/plugin/dressing.rc.lua delete mode 120000 .config/nvim/after/plugin/femaco.rc.lua delete mode 120000 .config/nvim/after/plugin/fterm.rc.lua delete mode 120000 .config/nvim/after/plugin/gitsigns.rc.lua delete mode 120000 .config/nvim/after/plugin/hlslens.rc.vim delete mode 120000 .config/nvim/after/plugin/icons.rc.lua delete mode 120000 .config/nvim/after/plugin/illuminate.rc.lua delete mode 120000 .config/nvim/after/plugin/indent.rc.lua delete mode 120000 .config/nvim/after/plugin/iswap.rc.lua delete mode 120000 .config/nvim/after/plugin/knap.rc.lua delete mode 120000 .config/nvim/after/plugin/lspconfig.rc.lua delete mode 120000 .config/nvim/after/plugin/lualine.rc.lua delete mode 120000 .config/nvim/after/plugin/minimap.rc.lua delete mode 120000 .config/nvim/after/plugin/mkdnflow.rc.lua delete mode 120000 .config/nvim/after/plugin/neogen.rc.lua delete mode 120000 .config/nvim/after/plugin/neoscroll.rc.lua delete mode 120000 .config/nvim/after/plugin/nvim-cmp.rc.lua delete mode 120000 .config/nvim/after/plugin/nvim-dap.rc.lua delete mode 120000 .config/nvim/after/plugin/nvim-tree.rc.lua delete mode 120000 .config/nvim/after/plugin/peek.rc.lua delete mode 120000 .config/nvim/after/plugin/search-pulse.rc.vim delete mode 120000 .config/nvim/after/plugin/snippets.rc.lua delete mode 120000 .config/nvim/after/plugin/startify.rc.vim delete mode 120000 .config/nvim/after/plugin/themer.rc.lua delete mode 120000 .config/nvim/after/plugin/treesitter.rc.lua delete mode 120000 .config/nvim/after/plugin/ufo.rc.lua delete mode 120000 .config/nvim/after/plugin/vim-test.rc.vim delete mode 120000 .config/nvim/after/plugin/virt-column.rc.vim delete mode 120000 .config/nvim/after/plugin/which.rc.lua delete mode 120000 .config/nvim/after/plugin/windows.rc.lua delete mode 100644 .config/nvim/init.vim delete mode 100644 .config/nvim/lua/core/temp.lua create mode 100644 .config/nvim/lua/plugins/boole.lua create mode 100644 .config/nvim/lua/plugins/comment.lua create mode 100644 .config/nvim/lua/plugins/compiler-explorer.lua create mode 100644 .config/nvim/lua/plugins/context.lua create mode 100644 .config/nvim/lua/plugins/crates.lua create mode 100644 .config/nvim/lua/plugins/debugprint.lua create mode 100644 .config/nvim/lua/plugins/dressing.lua create mode 100644 .config/nvim/lua/plugins/femaco.lua create mode 100644 .config/nvim/lua/plugins/fterm.lua create mode 100644 .config/nvim/lua/plugins/gitlinker.lua create mode 100644 .config/nvim/lua/plugins/gitsigns.lua create mode 100644 .config/nvim/lua/plugins/icons.lua create mode 100644 .config/nvim/lua/plugins/illuminate.lua create mode 100644 .config/nvim/lua/plugins/image.lua create mode 100644 .config/nvim/lua/plugins/init.lua create mode 100644 .config/nvim/lua/plugins/knap.lua create mode 100644 .config/nvim/lua/plugins/lspconfig.lua create mode 100644 .config/nvim/lua/plugins/lualine.lua create mode 100644 .config/nvim/lua/plugins/minimap.lua create mode 100644 .config/nvim/lua/plugins/mkdnflow.lua rename .config/nvim/{after/available/neogen.rc.lua => lua/plugins/neogen.lua} (88%) create mode 100644 .config/nvim/lua/plugins/nvim-cmp.lua create mode 100644 .config/nvim/lua/plugins/nvim-tree.lua create mode 100644 .config/nvim/lua/plugins/peek.lua create mode 100644 .config/nvim/lua/plugins/quicknote.lua create mode 100644 .config/nvim/lua/plugins/snippets.lua create mode 100644 .config/nvim/lua/plugins/swap.lua create mode 100644 .config/nvim/lua/plugins/symbols-outline.lua create mode 100644 .config/nvim/lua/plugins/telescope.lua create mode 100644 .config/nvim/lua/plugins/treesitter.lua create mode 100644 .config/nvim/lua/plugins/ufo.lua create mode 100644 .config/nvim/lua/plugins/vim-cmake.lua create mode 100644 .config/nvim/lua/plugins/virt-column.lua create mode 100644 .config/nvim/lua/plugins/which.lua create mode 100644 .config/nvim/lua/plugins/windows.lua diff --git a/.config/nvim/after/available/boole.rc.lua b/.config/nvim/after/available/boole.rc.lua deleted file mode 100644 index 2f822c9..0000000 --- a/.config/nvim/after/available/boole.rc.lua +++ /dev/null @@ -1,18 +0,0 @@ -require('boole').setup{ - mappings = { - increment = '', - decrement = '' - }, - -- User defined loops - additions = { - {'Foo', 'Bar'}, - {'tic', 'tac', 'toe'}, - {'light', 'dark'}, - {'phaseOne', 'phaseTwo', 'phaseThree'}, - {'PhaseOne', 'PhaseTwo', 'PhaseThree'}, - {'Enable', 'Disable'}, - {'ENABLE', 'DISABLE'}, - {'enable', 'disable'}, - {'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine'}, - }, -} diff --git a/.config/nvim/after/available/comment.rc.lua b/.config/nvim/after/available/comment.rc.lua deleted file mode 100644 index a844323..0000000 --- a/.config/nvim/after/available/comment.rc.lua +++ /dev/null @@ -1 +0,0 @@ -require('Comment').setup() diff --git a/.config/nvim/after/available/context.rc.lua b/.config/nvim/after/available/context.rc.lua deleted file mode 100644 index 3e9ae96..0000000 --- a/.config/nvim/after/available/context.rc.lua +++ /dev/null @@ -1,35 +0,0 @@ --- " Configuration for context.vim --- "" Disable context.vim on json files -vim.g.context_filetype_blacklist = {"json", "log"} -require('treesitter-context').setup{ - enable = true, -- Enable this plugin (Can be enabled/disabled later via commands) - throttle = true, -- Throttles plugin updates (may improve performance) - max_lines = 0, -- How many lines the window should span. Values <= 0 mean no limit. - patterns = { -- Match patterns for TS nodes. These get wrapped to match at word boundaries. - -- For all filetypes - -- Note that setting an entry here replaces all other patterns for this entry. - -- By setting the 'default' entry below, you can control which nodes you want to - -- appear in the context window. - default = { - 'class', - 'function', - 'method', - 'for', - 'while', - 'if', - 'switch', - -- 'case', - }, - -- Example for a specific filetype. - -- If a pattern is missing, *open a PR* so everyone can benefit. - rust = { - 'impl_item', - }, - }, - exact_patterns = { - -- Example for a specific filetype with Lua patterns - -- Treat patterns.rust as a Lua pattern (i.e "^impl_item$" will - -- exactly match "impl_item" only) - rust = true, - } -} diff --git a/.config/nvim/after/available/crates.rc.lua b/.config/nvim/after/available/crates.rc.lua deleted file mode 100644 index 1f9edce..0000000 --- a/.config/nvim/after/available/crates.rc.lua +++ /dev/null @@ -1 +0,0 @@ -require('crates').setup() diff --git a/.config/nvim/after/available/debugprint.rc.lua b/.config/nvim/after/available/debugprint.rc.lua deleted file mode 100644 index 2d1bdd3..0000000 --- a/.config/nvim/after/available/debugprint.rc.lua +++ /dev/null @@ -1 +0,0 @@ -require('debugprint').setup() diff --git a/.config/nvim/after/available/dressing.rc.lua b/.config/nvim/after/available/dressing.rc.lua deleted file mode 100644 index 52de648..0000000 --- a/.config/nvim/after/available/dressing.rc.lua +++ /dev/null @@ -1,159 +0,0 @@ -require('dressing').setup({ - input = { - -- Set to false to disable the vim.ui.input implementation - enabled = true, - - -- Default prompt string - default_prompt = "Input:", - - -- Can be 'left', 'right', or 'center' - prompt_align = "left", - - -- When true, will close the modal - insert_only = true, - - -- When true, input will start in insert mode. - start_in_insert = true, - - -- These are passed to nvim_open_win - anchor = "SW", - border = "rounded", - -- 'editor' and 'win' will default to being centered - relative = "cursor", - - -- These can be integers or a float between 0 and 1 (e.g. 0.4 for 40%) - prefer_width = 40, - width = nil, - -- min_width and max_width can be a list of mixed types. - -- min_width = {20, 0.2} means "the greater of 20 columns or 20% of total" - max_width = { 140, 0.9 }, - min_width = { 20, 0.2 }, - - buf_options = {}, - win_options = { - -- Window transparency (0-100) - winblend = 10, - -- Disable line wrapping - wrap = false, - }, - - -- Set to `false` to disable - mappings = { - n = { - [""] = "Close", - [""] = "Confirm", - }, - i = { - [""] = "Close", - [""] = "Confirm", - [""] = "HistoryPrev", - [""] = "HistoryNext", - }, - }, - - override = function(conf) - -- This is the config that will be passed to nvim_open_win. - -- Change values here to customize the layout - return conf - end, - - -- see :help dressing_get_config - get_config = nil, - }, - select = { - -- Set to false to disable the vim.ui.select implementation - enabled = true, - - -- Priority list of preferred vim.select implementations - backend = { "telescope", "fzf_lua", "fzf", "builtin", "nui" }, - - -- Trim trailing `:` from prompt - trim_prompt = true, - - -- Options for telescope selector - -- These are passed into the telescope picker directly. Can be used like: - -- telescope = require('telescope.themes').get_ivy({...}) - telescope = nil, - - -- Options for fzf selector - fzf = { - window = { - width = 0.5, - height = 0.4, - }, - }, - - -- Options for fzf_lua selector - fzf_lua = { - winopts = { - width = 0.5, - height = 0.4, - }, - }, - - -- Options for nui Menu - nui = { - position = "50%", - size = nil, - relative = "editor", - border = { - style = "rounded", - }, - buf_options = { - swapfile = false, - filetype = "DressingSelect", - }, - win_options = { - winblend = 10, - }, - max_width = 80, - max_height = 40, - min_width = 40, - min_height = 10, - }, - - -- Options for built-in selector - builtin = { - -- These are passed to nvim_open_win - anchor = "NW", - border = "rounded", - -- 'editor' and 'win' will default to being centered - relative = "editor", - - buf_options = {}, - win_options = { - -- Window transparency (0-100) - winblend = 10, - }, - - -- These can be integers or a float between 0 and 1 (e.g. 0.4 for 40%) - -- the min_ and max_ options can be a list of mixed types. - -- max_width = {140, 0.8} means "the lesser of 140 columns or 80% of total" - width = nil, - max_width = { 140, 0.8 }, - min_width = { 40, 0.2 }, - height = nil, - max_height = 0.9, - min_height = { 10, 0.2 }, - - -- Set to `false` to disable - mappings = { - [""] = "Close", - [""] = "Close", - [""] = "Confirm", - }, - - override = function(conf) - -- This is the config that will be passed to nvim_open_win. - -- Change values here to customize the layout - return conf - end, - }, - - -- Used to override format_item. See :help dressing-format - format_item_override = {}, - - -- see :help dressing_get_config - get_config = nil, - }, -}) diff --git a/.config/nvim/after/available/femaco.rc.lua b/.config/nvim/after/available/femaco.rc.lua deleted file mode 100644 index 0727360..0000000 --- a/.config/nvim/after/available/femaco.rc.lua +++ /dev/null @@ -1 +0,0 @@ -require('femaco').setup() diff --git a/.config/nvim/after/available/fterm.rc.lua b/.config/nvim/after/available/fterm.rc.lua deleted file mode 100644 index 908e27b..0000000 --- a/.config/nvim/after/available/fterm.rc.lua +++ /dev/null @@ -1,41 +0,0 @@ -require'FTerm'.setup({ - -- Filetype of the terminal buffer - ft = 'FTerm', - - -- Command to run inside the terminal. It could be a `string` or `table` - cmd = os.getenv('SHELL'), - - -- Neovim's native window border. See `:h nvim_open_win` for more configuration options. - border = 'double', - - -- Close the terminal as soon as shell/command exits. - -- Disabling this will mimic the native terminal behaviour. - auto_close = true, - - -- Highlight group for the terminal. See `:h winhl` - hl = 'Normal', - - -- Transparency of the floating window. See `:h winblend` - blend = 0, - - -- Object containing the terminal window dimensions. - -- The value for each field should be between `0` and `1` - dimensions = { - height = 0.9, -- Height of the terminal window - width = 0.9, -- Width of the terminal window - x = 0.5, -- X axis of the terminal window - y = 0.5, -- Y axis of the terminal window - }, - - -- Callback invoked when the terminal exits. - -- See `:h jobstart-options` - on_exit = nil, - - -- Callback invoked when the terminal emits stdout data. - -- See `:h jobstart-options` - on_stdout = nil, - - -- Callback invoked when the terminal emits stderr data. - -- See `:h jobstart-options` - on_stderr = nil, -}) diff --git a/.config/nvim/after/available/gitsigns.rc.lua b/.config/nvim/after/available/gitsigns.rc.lua deleted file mode 100644 index ba4da77..0000000 --- a/.config/nvim/after/available/gitsigns.rc.lua +++ /dev/null @@ -1,104 +0,0 @@ -require('gitsigns').setup { - signs = { - add = {hl = 'GitSignsAdd' , text = '│', numhl='GitSignsAddNr' , linehl='GitSignsAddLn'}, - change = {hl = 'GitSignsChange', text = '│', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'}, - delete = {hl = 'GitSignsDelete', text = '_', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'}, - topdelete = {hl = 'GitSignsDelete', text = '‾', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'}, - changedelete = {hl = 'GitSignsChange', text = '~', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'}, - }, - signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` - numhl = true, -- Toggle with `:Gitsigns toggle_numhl` - linehl = false, -- Toggle with `:Gitsigns toggle_linehl` - word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` - --keymaps = { - -- -- Default keymap options - -- noremap = true, - - -- ['n ]c'] = { expr = true, "&diff ? ']c' : 'Gitsigns next_hunk'"}, - -- ['n [c'] = { expr = true, "&diff ? '[c' : 'Gitsigns prev_hunk'"}, - - -- ['n hs'] = 'Gitsigns stage_hunk', - -- ['v hs'] = 'Gitsigns stage_hunk', - -- ['n hu'] = 'Gitsigns undo_stage_hunk', - -- ['n hr'] = 'Gitsigns reset_hunk', - -- ['v hr'] = ':Gitsigns reset_hunk', - -- ['n hR'] = 'Gitsigns reset_buffer', - -- ['n hp'] = 'Gitsigns preview_hunk', - -- ['n hb'] = 'lua require"gitsigns".blame_line{full=true}', - -- ['n hS'] = 'Gitsigns stage_buffer', - -- ['n hU'] = 'Gitsigns reset_buffer_index', - - -- -- Text objects - -- ['o ih'] = 'Gitsigns select_hunk', - -- ['x ih'] = 'Gitsigns select_hunk' - --}, - on_attach = function(bufnr) - local gs = package.loaded.gitsigns - - local function map(mode, l, r, opts) - opts = opts or {} - opts.buffer = bufnr - vim.keymap.set(mode, l, r, opts) - end - - -- Navigation - map('n', ']c', function() - if vim.wo.diff then return ']c' end - vim.schedule(function() gs.next_hunk() end) - return '' - end, {expr=true}) - - map('n', '[c', function() - if vim.wo.diff then return '[c' end - vim.schedule(function() gs.prev_hunk() end) - return '' - end, {expr=true}) - - -- Actions - map({'n', 'v'}, 'hs', 'Gitsigns stage_hunk') - map({'n', 'v'}, 'hr', 'Gitsigns reset_hunk') - map('n', 'hS', gs.stage_buffer) - map('n', 'hu', gs.undo_stage_hunk) - map('n', 'hR', gs.reset_buffer) - map('n', 'hp', gs.preview_hunk) - map('n', 'hb', function() gs.blame_line{full=true} end) - map('n', 'tb', gs.toggle_current_line_blame) - map('n', 'hd', gs.diffthis) - map('n', 'hD', function() gs.diffthis('~') end) - map('n', 'td', gs.toggle_deleted) - - -- Text object - map({'o', 'x'}, 'ih', ':Gitsigns select_hunk') - end, - - watch_gitdir = { - interval = 1000, - follow_files = true - }, - attach_to_untracked = true, - current_line_blame = true, -- Toggle with `:Gitsigns toggle_current_line_blame` - current_line_blame_opts = { - virt_text = true, - virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align' - delay = 1000, - ignore_whitespace = true, - }, - current_line_blame_formatter_opts = { - relative_time = false - }, - sign_priority = 6, - update_debounce = 100, - status_formatter = nil, -- Use default - max_file_length = 40000, - preview_config = { - -- Options passed to nvim_open_win - border = 'single', - style = 'minimal', - relative = 'cursor', - row = 0, - col = 1 - }, - yadm = { - enable = true - }, -} diff --git a/.config/nvim/after/available/icons.rc.lua b/.config/nvim/after/available/icons.rc.lua deleted file mode 100644 index 11412cd..0000000 --- a/.config/nvim/after/available/icons.rc.lua +++ /dev/null @@ -1 +0,0 @@ -require("icon-picker").setup({disable_legacy_commands = true }) diff --git a/.config/nvim/after/available/illuminate.rc.lua b/.config/nvim/after/available/illuminate.rc.lua deleted file mode 100644 index a8f26d9..0000000 --- a/.config/nvim/after/available/illuminate.rc.lua +++ /dev/null @@ -1,42 +0,0 @@ ---require('illuminate').configure({ --- large_file_cutoff = 3000 ---}) - -HIGHLIGHT = 'highlight' -vim.api.nvim_create_augroup(HIGHLIGHT, { clear = true }) - -require('murmur').setup { - cursor_rgb = 'darkgreen', -- default to '#393939' - max_len = 80, -- maximum word-length to highlight - -- disable_on_lines = 2000, -- to prevent lagging on large files. Default to 2000 lines. - exclude_filetypes = {'log'}, - callbacks = { - -- to trigger the close_events of vim.diagnostic.open_float. - function () - -- Close floating diag. and make it triggerable again. - vim.cmd('doautocmd InsertEnter') - vim.w.diag_shown = false - end, - } -} -vim.api.nvim_create_autocmd('CursorHold', { - group = HIGHLIGHT, - pattern = '*', - callback = function () - -- skip when a float-win already exists. - if vim.w.diag_shown then return end - - -- open float-win when hovering on a cursor-word. - if vim.w.cursor_word ~= '' then - vim.diagnostic.open_float(nil, { - focusable = true, - close_events = { 'InsertEnter' }, - border = 'rounded', - source = 'always', - prefix = ' ', - scope = 'cursor', - }) - vim.w.diag_shown = true - end - end -}) diff --git a/.config/nvim/after/available/indent.rc.lua b/.config/nvim/after/available/indent.rc.lua deleted file mode 100644 index 3ed3e19..0000000 --- a/.config/nvim/after/available/indent.rc.lua +++ /dev/null @@ -1,22 +0,0 @@ ---require("indent_blankline").setup { --- char = "", --- show_current_context = true, --- --show_current_context_start = true, --- space_char_blankline = " ", --- char_highlight_list = { --- "IndentBlanklineIndent1", --- "IndentBlanklineIndent2", --- "IndentBlanklineIndent3", --- "IndentBlanklineIndent4", --- "IndentBlanklineIndent5", --- "IndentBlanklineIndent6", --- }, --- space_char_highlight_list = { --- "IndentBlanklineIndent1", --- "IndentBlanklineIndent2", --- "IndentBlanklineIndent3", --- "IndentBlanklineIndent4", --- "IndentBlanklineIndent5", --- "IndentBlanklineIndent6", --- }, ---} diff --git a/.config/nvim/after/available/iswap.rc.lua b/.config/nvim/after/available/iswap.rc.lua deleted file mode 100644 index deaca66..0000000 --- a/.config/nvim/after/available/iswap.rc.lua +++ /dev/null @@ -1 +0,0 @@ -require('iswap').setup({ autoswap = true }) diff --git a/.config/nvim/after/available/knap.rc.lua b/.config/nvim/after/available/knap.rc.lua deleted file mode 100644 index befd71c..0000000 --- a/.config/nvim/after/available/knap.rc.lua +++ /dev/null @@ -1,29 +0,0 @@ -local gknapsettings = { - htmloutputext = "html", - htmltohtml = "touch %outputfile%", - htmltohtmlviewerlaunch = "google-chrome-beta %outputfile%", - htmltohtmlviewerrefresh = "none", - mdoutputext = "html", - mdtohtml = "pandoc --standalone %docroot% -o %outputfile%", - mdtohtmlviewerlaunch = "google-chrome-beta %outputfile%", - mdtohtmlviewerrefresh = "none", - mdtopdf = "pandoc %docroot% -o %outputfile%", - mdtopdfviewerlaunch = "sioyek %outputfile%", - mdtopdfviewerrefresh = "none", - markdownoutputext = "html", - markdowntohtml = "pandoc --standalone %docroot% -o %outputfile%", - markdowntohtmlviewerlaunch = "google-chrome-beta %outputfile%", - markdowntohtmlviewerrefresh = "none", - markdowntopdf = "pandoc %docroot% -o %outputfile%", - markdowntopdfviewerlaunch = "sioyek %outputfile%", - markdowntopdfviewerrefresh = "none", - texoutputext = "pdf", - textopdf = "pdflatex -interaction=batchmode -halt-on-error -synctex=1 %docroot%", - textopdfviewerlaunch = "sioyek --inverse-search 'nvim --headless -es --cmd \"lua require('\"'\"'knaphelper'\"'\"').relayjump('\"'\"'%servername%'\"'\"','\"'\"'%1'\"'\"',%2,%3)\"' --reuse-instance %outputfile%", - textopdfviewerrefresh = "none", - textopdfforwardjump = "sioyek --inverse-search 'nvim --headless -es --cmd \"lua require('\"'\"'knaphelper'\"'\"').relayjump('\"'\"'%servername%'\"'\"','\"'\"'%1'\"'\"',%2,%3)\"' --reuse-instance --forward-search-file %srcfile% --forward-search-line %line% %outputfile%", - textopdfshorterror = "A=%outputfile% ; LOGFILE=\"${A%.pdf}.log\" ; rubber-info \"$LOGFILE\" 2>&1 | head -n 1", - delay = 250 -} - -vim.g.knap_settings = gknapsettings diff --git a/.config/nvim/after/available/lspconfig.rc.lua b/.config/nvim/after/available/lspconfig.rc.lua deleted file mode 100644 index 54250db..0000000 --- a/.config/nvim/after/available/lspconfig.rc.lua +++ /dev/null @@ -1,150 +0,0 @@ -local nvim_lsp = require('lspconfig') -local clangd_extensions = require('clangd_extensions') -local lsp_signature = require('lsp_signature') - --- Mappings. -local opts = { noremap=true, silent=true } -vim.api.nvim_set_keymap('n', 'e', 'lua vim.diagnostic.open_float()', opts) -vim.api.nvim_set_keymap('n', '[d', 'lua vim.diagnostic.goto_prev()', opts) -vim.api.nvim_set_keymap('n', ']d', 'lua vim.diagnostic.goto_next()', opts) -vim.api.nvim_set_keymap('n', 'E', 'lua vim.diagnostic.set_loclist()', opts) -vim.api.nvim_set_keymap("n", "q", "lua vim.lsp.buf.format{ async = true }", opts) - --- Use an on_attach function to only map the following keys --- after the language server attaches to the current buffer -local on_attach = function(client, bufnr) - --Enable completion triggered by - vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') - - ---- See `:help vim.lsp.*` for documentation on any of the below functions - vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gD', 'lua vim.lsp.buf.declaration()', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gd', 'lua vim.lsp.buf.definition()', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', 'K', 'lua vim.lsp.buf.hover()', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gi', 'lua vim.lsp.buf.implementation()', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', '', 'lua vim.lsp.buf.signature_help()', opts) - --vim.api.nvim_buf_set_keymap(bufnr, 'n', 'wa', 'lua vim.lsp.buf.add_workspace_folder()', opts) - --vim.api.nvim_buf_set_keymap(bufnr, 'n', 'wr', 'lua vim.lsp.buf.remove_workspace_folder()', opts) - --vim.api.nvim_buf_set_keymap(bufnr, 'n', 'wl', 'lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', 'D', 'lua vim.lsp.buf.type_definition()', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', 'rn', 'lua vim.lsp.buf.rename()', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', 'ca', 'lua vim.lsp.buf.code_action()', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gr', 'lua vim.lsp.buf.references()', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', '', 'ClangdSwitchSourceHeader', opts) - - -- require'illuminate'.on_attach(client) - require'virtualtypes'.on_attach() - require'lsp_signature'.on_attach({ - floating_window = true, - floating_window_above_cur_line = false, - floating_window_off_x = 500, - floating_window_off_y = -5, - }) -end - -local signs = { - { name = "DiagnosticSignError", text = "" }, - { name = "DiagnosticSignWarn", text = "" }, - { name = "DiagnosticSignHint", text = "" }, - { name = "DiagnosticSignInfo", text = "" }, -} - -for _, sign in ipairs(signs) do - vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = "" }) -end - ---vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with( --- vim.lsp.diagnostic.on_publish_diagnostics, { --- signs = { --- active = signs, --- --severity_limit = 'info', --- }, --- severity_sort = true, --- underline = false, --- update_in_insert = false, --- --virtual_text = { --- -- spacing = 40, --- -- severity_limit = 'Warning', --- --}, --- virtual_text = false, --- } ---) --- -local capabilities = require('cmp_nvim_lsp').default_capabilities() - -nvim_lsp.groovyls.setup({ - cmd = { "java", "-jar", "/home/kmcr/tools/groovy-language-server/build/libs/groovy-language-server-all.jar" }, - on_attach = on_attach, - --on_publish_diagnostics = diagnostic_handler, - capabilities = capabilities -}) - --- nvim_lsp.ccls.setup( --- coq.lsp_ensure_capabilities({ --- init_options = { --- compilationDatabaseDirectory = "."; --- index = { --- threads = 0; --- }, --- clang = { --- excludeArgs = { "-frounding-math"} ; --- }, --- }, --- root_dir = nvim_lsp.util.root_pattern("compile_commands.json"), --- on_attach = on_attach, --- on_publish_diagnostics = diagnostic_handler, --- flags = { --- debounce_text_changes = 150, --- }} --- ) --- ) - -clangd_extensions.setup({ - server = { - on_attach = on_attach, - root_pattern = { - '.clangd', - '.clang-tidy', - '.clang-format', - 'compile_commands.json', - 'compile_flags.txt', - 'configure.ac', - }, - capabilities = capabilities - }, - inlay_hints = { - max_len_align = true, - max_len_align_padding = 3, - right_align = true, - } -}) - -nvim_lsp.pylsp.setup({ - settings = { - pylint = { - enabled = false - }, - pyflakes = { - enabled = false, - }, - }, - -- flags = { - -- debounce_text_changes = 150, - -- }, - on_attach = on_attach, - capabilities = capabilities - --on_publish_diagnostics = diagnostic_handler, -}) - --- Use a loop to conveniently call 'setup' on multiple servers and --- map buffer local keybindings when the language server attaches -local servers = { "cmake", "rust_analyzer", "bashls", "marksman" } -for _, lsp in ipairs(servers) do - nvim_lsp[lsp].setup({ - on_attach = on_attach, - --on_publish_diagnostics = diagnostic_handler, - capabilities = capabilities, - -- flags = { - -- debounce_text_changes = 150, - -- } - }) -end diff --git a/.config/nvim/after/available/lualine.rc.lua b/.config/nvim/after/available/lualine.rc.lua deleted file mode 100644 index 738387d..0000000 --- a/.config/nvim/after/available/lualine.rc.lua +++ /dev/null @@ -1,222 +0,0 @@ --- Eviline config for lualine --- Author: shadmansaleh --- Credit: glepnir -local lualine = require('lualine') - --- Color table for highlights --- stylua: ignore -local colors = { - bg = '#202328', - fg = '#bbc2cf', - yellow = '#ECBE7B', - cyan = '#008080', - darkblue = '#081633', - green = '#98be65', - orange = '#FF8800', - violet = '#a9a1e1', - magenta = '#c678dd', - blue = '#51afef', - red = '#ec5f67', -} - - -local conditions = { - buffer_not_empty = function() - return vim.fn.empty(vim.fn.expand('%:t')) ~= 1 - end, - hide_in_width = function() - return vim.fn.winwidth(0) > 80 - end, - check_git_workspace = function() - local filepath = vim.fn.expand('%:p:h') - local gitdir = vim.fn.finddir('.git', filepath .. ';') - return gitdir and #gitdir > 0 and #gitdir < #filepath - end, -} - --- Config -local config = { - options = { - -- Disable sections and component separators - component_separators = '', - section_separators = '', - theme = { - -- We are going to use lualine_c an lualine_x as left and - -- right section. Both are highlighted by c theme . So we - -- are just setting default looks o statusline - normal = { c = { fg = colors.fg, bg = colors.bg } }, - inactive = { c = { fg = colors.fg, bg = colors.bg } }, - }, - }, - sections = { - -- these are to remove the defaults - lualine_a = {}, - lualine_b = {}, - lualine_y = {}, - lualine_z = {}, - -- These will be filled later - lualine_c = {}, - lualine_x = {}, - }, - inactive_sections = { - -- these are to remove the defaults - lualine_a = {}, - lualine_b = {}, - lualine_y = {}, - lualine_z = {}, - lualine_c = {}, - lualine_x = {}, - }, -} - --- Inserts a component in lualine_c at left section -local function ins_left(component) - table.insert(config.sections.lualine_c, component) -end - --- Inserts a component in lualine_x ot right section -local function ins_right(component) - table.insert(config.sections.lualine_x, component) -end - -ins_left { - function() - return '▊' - end, - color = { fg = colors.blue }, -- Sets highlighting of component - padding = { left = 0, right = 1 }, -- We don't need space before this -} - -ins_left { - -- mode component - function() - return '' - end, - color = function() - -- auto change color according to neovims mode - local mode_color = { - n = colors.red, - i = colors.green, - v = colors.blue, - [''] = colors.blue, - V = colors.blue, - c = colors.magenta, - no = colors.red, - s = colors.orange, - S = colors.orange, - [''] = colors.orange, - ic = colors.yellow, - R = colors.violet, - Rv = colors.violet, - cv = colors.red, - ce = colors.red, - r = colors.cyan, - rm = colors.cyan, - ['r?'] = colors.cyan, - ['!'] = colors.red, - t = colors.red, - } - return { fg = mode_color[vim.fn.mode()] } - end, - padding = { right = 1 }, -} - -ins_left { - -- filesize component - 'filesize', - cond = conditions.buffer_not_empty, -} - -ins_left { - 'filename', - cond = conditions.buffer_not_empty, - color = { fg = colors.magenta, gui = 'bold' }, -} - -ins_left { 'location' } - -ins_left { 'progress', color = { fg = colors.fg, gui = 'bold' } } - -ins_left { - 'diagnostics', - sources = { 'nvim_diagnostic' }, - symbols = { error = ' ', warn = ' ', info = ' ' }, - diagnostics_color = { - color_error = { fg = colors.red }, - color_warn = { fg = colors.yellow }, - color_info = { fg = colors.cyan }, - }, -} - --- Insert mid section. You can make any number of sections in neovim :) --- for lualine it's any number greater then 2 -ins_left { - function() - return '%=' - end, -} - -ins_left { - -- Lsp server name . - function() - local msg = 'No Active Lsp' - local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype') - local clients = vim.lsp.get_active_clients() - if next(clients) == nil then - return msg - end - for _, client in ipairs(clients) do - local filetypes = client.config.filetypes - if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then - return client.name - end - end - return msg - end, - icon = ' LSP:', - color = { fg = '#ffffff', gui = 'bold' }, -} - --- Add components to right sections -ins_right { - 'o:encoding', -- option component same as &encoding in viml - fmt = string.upper, -- I'm not sure why it's upper case either ;) - cond = conditions.hide_in_width, - color = { fg = colors.green, gui = 'bold' }, -} - -ins_right { - 'fileformat', - fmt = string.upper, - icons_enabled = true, -- I think icons are cool but Eviline doesn't have them. sigh - color = { fg = colors.green, gui = 'bold' }, -} - -ins_right { - 'branch', - icon = '', - color = { fg = colors.violet, gui = 'bold' }, -} - -ins_right { - 'diff', - -- Is it me or the symbol for modified us really weird - symbols = { added = ' ', modified = '柳 ', removed = ' ' }, - diff_color = { - added = { fg = colors.green }, - modified = { fg = colors.orange }, - removed = { fg = colors.red }, - }, - cond = conditions.hide_in_width, -} - -ins_right { - function() - return '▊' - end, - color = { fg = colors.blue }, - padding = { left = 1 }, -} - --- Now don't forget to initialize lualine -lualine.setup(config) diff --git a/.config/nvim/after/available/minimap.rc.lua b/.config/nvim/after/available/minimap.rc.lua deleted file mode 100644 index 01d9e47..0000000 --- a/.config/nvim/after/available/minimap.rc.lua +++ /dev/null @@ -1 +0,0 @@ -require('codewindow').setup() diff --git a/.config/nvim/after/available/mkdnflow.rc.lua b/.config/nvim/after/available/mkdnflow.rc.lua deleted file mode 100644 index b0c1af7..0000000 --- a/.config/nvim/after/available/mkdnflow.rc.lua +++ /dev/null @@ -1,88 +0,0 @@ -require('mkdnflow').setup({ - modules = { - bib = true, - buffers = true, - conceal = true, - cursor = true, - folds = true, - links = true, - lists = true, - maps = true, - paths = true, - tables = true - }, - filetypes = {md = true, rmd = true, markdown = true}, - create_dirs = true, - perspective = { - priority = 'first', - fallback = 'current', - root_tell = false, - nvim_wd_heel = true - }, - wrap = false, - bib = { - default_path = nil, - find_in_root = true - }, - silent = false, - links = { - style = 'markdown', - conceal = false, - implicit_extension = nil, - transform_implicit = false, - transform_explicit = function(text) - text = text:gsub(" ", "-") - text = text:lower() - text = os.date('%Y-%m-%d_')..text - return(text) - end - }, - to_do = { - symbols = {' ', '-', 'X'}, - update_parents = true, - not_started = ' ', - in_progress = '-', - complete = 'X' - }, - tables = { - trim_whitespace = true, - format_on_move = true, - auto_extend_rows = false, - auto_extend_cols = false - }, - mappings = { - MkdnEnter = {{'n', 'v'}, ''}, - MkdnTab = false, - MkdnSTab = false, - MkdnNextLink = {'n', ''}, - MkdnPrevLink = {'n', ''}, - MkdnNextHeading = {'n', ']]'}, - MkdnPrevHeading = {'n', '[['}, - MkdnGoBack = {'n', ''}, - MkdnGoForward = {'n', ''}, - MkdnFollowLink = false, -- see MkdnEnter - MkdnDestroyLink = {'n', ''}, - MkdnTagSpan = {'v', ''}, - MkdnMoveSource = {'n', ''}, - MkdnYankAnchorLink = {'n', 'ya'}, - MkdnYankFileAnchorLink = {'n', 'yfa'}, - MkdnIncreaseHeading = {'n', '+'}, - MkdnDecreaseHeading = {'n', '-'}, - MkdnToggleToDo = {{'n', 'v'}, ''}, - MkdnNewListItem = false, - MkdnNewListItemBelowInsert = {'n', 'o'}, - MkdnNewListItemAboveInsert = {'n', 'O'}, - MkdnExtendList = false, - MkdnUpdateNumbering = {'n', 'nn'}, - MkdnTableNextCell = {'i', ''}, - MkdnTablePrevCell = {'i', ''}, - MkdnTableNextRow = false, - MkdnTablePrevRow = {'i', ''}, - MkdnTableNewRowBelow = {'n', 'ir'}, - MkdnTableNewRowAbove = {'n', 'iR'}, - MkdnTableNewColAfter = {'n', 'ic'}, - MkdnTableNewColBefore = {'n', 'iC'}, - MkdnFoldSection = {'n', 'f'}, - MkdnUnfoldSection = {'n', 'F'} - } -}) diff --git a/.config/nvim/after/available/neoscroll.rc.lua b/.config/nvim/after/available/neoscroll.rc.lua deleted file mode 100644 index 5b86db6..0000000 --- a/.config/nvim/after/available/neoscroll.rc.lua +++ /dev/null @@ -1,13 +0,0 @@ --- require('neoscroll').setup({ --- -- All these keys will be mapped to their corresponding default scrolling animation --- mappings = {'', '', '', '', --- '', '', 'zt', 'zz', 'zb'}, --- hide_cursor = true, -- Hide cursor while scrolling --- stop_eof = true, -- Stop at when scrolling downwards --- use_local_scrolloff = false, -- Use the local scope of scrolloff instead of the global scope --- respect_scrolloff = false, -- Stop scrolling when the cursor reaches the scrolloff margin of the file --- cursor_scrolls_alone = true, -- The cursor will keep on scrolling even if the window cannot scroll further --- easing_function = nil, -- Default easing function --- pre_hook = nil, -- Function to run before the scrolling animation starts --- post_hook = nil, -- Function to run after the scrolling animation ends --- }) diff --git a/.config/nvim/after/available/nvim-cmp.rc.lua b/.config/nvim/after/available/nvim-cmp.rc.lua deleted file mode 100644 index aff919c..0000000 --- a/.config/nvim/after/available/nvim-cmp.rc.lua +++ /dev/null @@ -1,68 +0,0 @@ -local cmp = require'cmp' - -cmp.setup({ - snippet = { - expand = function(args) - require('snippy').expand_snippet(args.body) - end, - }, - window = { - completion = cmp.config.window.bordered(), - documentation = cmp.config.window.bordered(), - }, - mapping = cmp.mapping.preset.insert({ - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping.complete(), - [''] = cmp.mapping.abort(), - [''] = cmp.mapping.confirm({ select = false }), - }), - sources = cmp.config.sources({ - { name = 'nvim_lsp' }, - { name = 'path' }, - { name = 'snippy' }, - { name = 'calc' }, - { name = 'cmp_matlab' }, - { name = 'cmp_git' }, - }, { - { name = 'buffer', keyword_length = 5, max_item_count = 10, priority = -5 }, - }), - sorting = { - comparators = { - cmp.config.compare.offset, - cmp.config.compare.exact, - cmp.config.compare.recently_used, - require("clangd_extensions.cmp_scores"), - cmp.config.compare.kind, - cmp.config.compare.sort_text, - cmp.config.compare.length, - cmp.config.compare.order, - }, - }, -}) - -cmp.setup.cmdline({'/', '?'}, { - mapping = cmp.mapping.preset.cmdline(), - sources = { - { name = 'buffer' } - } -}) - -cmp.setup.cmdline(':', { - mapping = cmp.mapping.preset.cmdline(), - sources = cmp.config.sources({ - { name = 'path' } - }, { - { name = 'cmdline' } - }) -}) - -cmp.setup.filetype('gitcommit', { - sources = cmp.config.sources({ - {name = 'cmp_git' }, - }, { - {name = 'buffer' } - }) -}) - -require("cmp_git").setup() diff --git a/.config/nvim/after/available/nvim-dap.rc.lua b/.config/nvim/after/available/nvim-dap.rc.lua deleted file mode 100644 index e69de29..0000000 diff --git a/.config/nvim/after/available/nvim-tree.rc.lua b/.config/nvim/after/available/nvim-tree.rc.lua deleted file mode 100644 index 17f1545..0000000 --- a/.config/nvim/after/available/nvim-tree.rc.lua +++ /dev/null @@ -1,127 +0,0 @@ -vim.g.nvim_tree_refresh_wait = 1000 - --- following options are the default --- each of these are documented in `:help nvim-tree.OPTION_NAME` -require'nvim-tree'.setup { - disable_netrw = true, - hijack_netrw = true, - open_on_setup = true, - ignore_ft_on_setup = {}, - open_on_tab = false, - hijack_cursor = true, - update_cwd = false, - create_in_closed_folder = false, - hijack_unnamed_buffer_when_opening = true, - sync_root_with_cwd = true, - reload_on_bufenter = true, - respect_buf_cwd = false, - hijack_directories = { - enable = true, - auto_open = true, - }, - diagnostics = { - enable = false, - icons = { - hint = "", - info = "", - warning = "", - error = "", - } - }, - update_focused_file = { - enable = true, - update_cwd = false, - ignore_list = {} - }, - system_open = { - cmd = nil, - args = {} - }, - filters = { - dotfiles = false, - custom = {} - }, - git = { - enable = true, - ignore = false, - timeout = 500, - }, - view = { - width = 35, - hide_root_folder = true, - side = 'left', - mappings = { - custom_only = false, - list = {} - }, - number = false, - relativenumber = false, - signcolumn = "no" - }, - trash = { - cmd = "trash", - require_confirm = true - }, - actions = { - open_file = { - quit_on_open = false, - window_picker = { - exclude = { - filetype = { "notify", "packer", "qf" }, - buftype = { "terminal" }, - }, - }, - }, - change_dir = { - global = true, - }, - }, - renderer = { - indent_markers = { - enable = true -- this option shows indent markers when folders are open - }, - icons = { - show = { - git = true, - folder = true, - file = true, - folder_arrow = false, - }, - glyphs = { - default = '', - symlink = '', - git = { - unstaged = "✗", - staged = "✓", - unmerged = "", - renamed = "➜", - untracked = "★", - deleted = "", - ignored = "◌" - }, - folder = { - arrow_open = "", - arrow_closed = "", - default = "", - open = "", - empty = "", - empty_open = "", - symlink = "", - symlink_open = "", - } - }, - padding = ' ', - symlink_arrow = ' -> ', - }, - group_empty = true, - add_trailing = true, - highlight_git = true, - highlight_opened_files = 'icon', - root_folder_modifier = ':~', - special_files = { - 'README.md', - 'Makefile', - 'MAKEFILE' - }, - }, -} diff --git a/.config/nvim/after/available/peek.rc.lua b/.config/nvim/after/available/peek.rc.lua deleted file mode 100644 index 214ebf8..0000000 --- a/.config/nvim/after/available/peek.rc.lua +++ /dev/null @@ -1,34 +0,0 @@ --- default config: -require('peek').setup({ - auto_load = true, -- whether to automatically load preview when - -- entering another markdown buffer - close_on_bdelete = true, -- close preview window on buffer delete - - syntax = true, -- enable syntax highlighting, affects performance - - theme = 'dark', -- 'dark' or 'light' - - update_on_change = true, - - -- relevant if update_on_change is true - throttle_at = 200000, -- start throttling when file exceeds this - -- amount of bytes in size - throttle_time = 'auto', -- minimum amount of time in milliseconds - -- that has to pass before starting new render -}) - -local peek = require('peek') - -vim.api.nvim_create_user_command('PeekOpen', function() - if not peek.is_open() and vim.bo[vim.api.nvim_get_current_buf()].filetype == 'markdown' then - --vim.fn.system('i3-msg split horizontal') - peek.open() - end -end, {}) - -vim.api.nvim_create_user_command('PeekClose', function() - if peek.is_open() then - peek.close() - --vim.fn.system('i3-msg move left') - end -end, {}) diff --git a/.config/nvim/after/available/snippets.rc.lua b/.config/nvim/after/available/snippets.rc.lua deleted file mode 100644 index 251ed62..0000000 --- a/.config/nvim/after/available/snippets.rc.lua +++ /dev/null @@ -1,11 +0,0 @@ -require('snippy').setup({ - mappings = { - is = { - [''] = 'expand_or_advance', - [''] = 'previous', - }, - nx = { - ['x'] = 'cut_text', - }, - }, -}) diff --git a/.config/nvim/after/available/themer.rc.lua b/.config/nvim/after/available/themer.rc.lua deleted file mode 100644 index 1abe3c3..0000000 --- a/.config/nvim/after/available/themer.rc.lua +++ /dev/null @@ -1,11 +0,0 @@ ---require("themer").setup({ --- colorscheme = "scery", --- enable_installer = true, --- styles = { --- ["function"] = { style = 'italic' }, --- functionbuiltin = { style = 'italic' }, --- variable = { style = 'italic' }, --- variableBuiltIn = { style = 'italic' }, --- parameter = { style = 'italic' }, --- }, ---}) diff --git a/.config/nvim/after/available/treesitter.rc.lua b/.config/nvim/after/available/treesitter.rc.lua deleted file mode 100644 index c225a5d..0000000 --- a/.config/nvim/after/available/treesitter.rc.lua +++ /dev/null @@ -1,58 +0,0 @@ --- Tree-sitter configuration - -ts = require'nvim-treesitter.configs' - -ts.setup { - highlight = { - enable = true, - additional_vim_regex_highlighting = false, - }, - ensure_installed = { - "bash", - "c", - "cmake", - "cpp", - "fish", - "lua", - "rust", - }, - -- disabled, since it mostly shifts to four characters - --indent = { - -- enable = true, - --}, - incremental_selection = { - enable = true, - keymaps = { - init_selection = "ti", - node_incremental = "ti", - scope_incremental = "ts", - node_decremental = "td", - }, - }, - rainbow = { - enable = true, - -- disable = { "jsx", "cpp" }, list of languages you want to disable the plugin for - extended_mode = true, -- Also highlight non-bracket delimiters like html tags, boolean or table: lang -> boolean - max_file_lines = 10000, -- Do not enable for files with more than n lines, int - -- colors = {}, -- table of hex strings - -- termcolors = {} -- table of colour name strings - }, - --textobjects = { - -- swap = { - -- enable = true, - -- swap_next = { - -- ["tan"] = "@parameter.inner", - -- }, - -- swap_previous = { - -- ["tap"] = "@parameter.inner", - -- }, - -- }, - --}, - matchup = { - enable = true, - -- disable = { "c", "ruby" }, - include_match_words - }, -} -vim.opt.foldmethod = "expr" -vim.opt.foldexpr = "nvim_treesitter#foldexpr()" diff --git a/.config/nvim/after/available/ufo.rc.lua b/.config/nvim/after/available/ufo.rc.lua deleted file mode 100644 index 058f962..0000000 --- a/.config/nvim/after/available/ufo.rc.lua +++ /dev/null @@ -1,12 +0,0 @@ -vim.wo.foldcolumn = '1' -vim.wo.foldlevel = 99 -- feel free to decrease the value -vim.wo.foldenable = true - --- tell the sever the capability of foldingRange -local capabilities = vim.lsp.protocol.make_client_capabilities() -capabilities.textDocument.foldingRange = { - dynamicRegistration = false, - lineFoldingOnly = true -} - ---require('ufo').setup() diff --git a/.config/nvim/after/available/which.rc.lua b/.config/nvim/after/available/which.rc.lua deleted file mode 100644 index a5317b2..0000000 --- a/.config/nvim/after/available/which.rc.lua +++ /dev/null @@ -1,5 +0,0 @@ -require("which-key").setup { - -- your configuration comes here - -- or leave it empty to use the default settings - -- refer to the configuration section below -} diff --git a/.config/nvim/after/available/windows.rc.lua b/.config/nvim/after/available/windows.rc.lua deleted file mode 100644 index 743898e..0000000 --- a/.config/nvim/after/available/windows.rc.lua +++ /dev/null @@ -1,3 +0,0 @@ -vim.o.winwidth = 10 -vim.o.winminwidth = 10 -require("windows").setup() diff --git a/.config/nvim/after/plugin/boole.rc.lua b/.config/nvim/after/plugin/boole.rc.lua deleted file mode 120000 index a4b6f24..0000000 --- a/.config/nvim/after/plugin/boole.rc.lua +++ /dev/null @@ -1 +0,0 @@ -../available/boole.rc.lua \ No newline at end of file diff --git a/.config/nvim/after/plugin/comment.rc.lua b/.config/nvim/after/plugin/comment.rc.lua deleted file mode 120000 index 08afaf6..0000000 --- a/.config/nvim/after/plugin/comment.rc.lua +++ /dev/null @@ -1 +0,0 @@ -../available/comment.rc.lua \ No newline at end of file diff --git a/.config/nvim/after/plugin/context.rc.lua b/.config/nvim/after/plugin/context.rc.lua deleted file mode 120000 index 64966c4..0000000 --- a/.config/nvim/after/plugin/context.rc.lua +++ /dev/null @@ -1 +0,0 @@ -../available/context.rc.lua \ No newline at end of file diff --git a/.config/nvim/after/plugin/crates.rc.lua b/.config/nvim/after/plugin/crates.rc.lua deleted file mode 120000 index 936a39f..0000000 --- a/.config/nvim/after/plugin/crates.rc.lua +++ /dev/null @@ -1 +0,0 @@ -../available/crates.rc.lua \ No newline at end of file diff --git a/.config/nvim/after/plugin/debugprint.rc.lua b/.config/nvim/after/plugin/debugprint.rc.lua deleted file mode 120000 index 33a2157..0000000 --- a/.config/nvim/after/plugin/debugprint.rc.lua +++ /dev/null @@ -1 +0,0 @@ -../available/debugprint.rc.lua \ No newline at end of file diff --git a/.config/nvim/after/plugin/digraphs.rc.vim b/.config/nvim/after/plugin/digraphs.rc.vim deleted file mode 120000 index cc14231..0000000 --- a/.config/nvim/after/plugin/digraphs.rc.vim +++ /dev/null @@ -1 +0,0 @@ -../available/digraphs.rc.vim \ No newline at end of file diff --git a/.config/nvim/after/plugin/dressing.rc.lua b/.config/nvim/after/plugin/dressing.rc.lua deleted file mode 120000 index 4e7cbce..0000000 --- a/.config/nvim/after/plugin/dressing.rc.lua +++ /dev/null @@ -1 +0,0 @@ -../available/dressing.rc.lua \ No newline at end of file diff --git a/.config/nvim/after/plugin/femaco.rc.lua b/.config/nvim/after/plugin/femaco.rc.lua deleted file mode 120000 index 7df52d5..0000000 --- a/.config/nvim/after/plugin/femaco.rc.lua +++ /dev/null @@ -1 +0,0 @@ -../available/femaco.rc.lua \ No newline at end of file diff --git a/.config/nvim/after/plugin/fterm.rc.lua b/.config/nvim/after/plugin/fterm.rc.lua deleted file mode 120000 index 5cb9064..0000000 --- a/.config/nvim/after/plugin/fterm.rc.lua +++ /dev/null @@ -1 +0,0 @@ -../available/fterm.rc.lua \ No newline at end of file diff --git a/.config/nvim/after/plugin/gitsigns.rc.lua b/.config/nvim/after/plugin/gitsigns.rc.lua deleted file mode 120000 index ae499e6..0000000 --- a/.config/nvim/after/plugin/gitsigns.rc.lua +++ /dev/null @@ -1 +0,0 @@ -../available/gitsigns.rc.lua \ No newline at end of file diff --git a/.config/nvim/after/plugin/hlslens.rc.vim b/.config/nvim/after/plugin/hlslens.rc.vim deleted file mode 120000 index b3ef854..0000000 --- a/.config/nvim/after/plugin/hlslens.rc.vim +++ /dev/null @@ -1 +0,0 @@ -../available/hlslens.rc.vim \ No newline at end of file diff --git a/.config/nvim/after/plugin/icons.rc.lua b/.config/nvim/after/plugin/icons.rc.lua deleted file mode 120000 index 8f62cfd..0000000 --- a/.config/nvim/after/plugin/icons.rc.lua +++ /dev/null @@ -1 +0,0 @@ -../available/icons.rc.lua \ No newline at end of file diff --git a/.config/nvim/after/plugin/illuminate.rc.lua b/.config/nvim/after/plugin/illuminate.rc.lua deleted file mode 120000 index 09bb709..0000000 --- a/.config/nvim/after/plugin/illuminate.rc.lua +++ /dev/null @@ -1 +0,0 @@ -../available/illuminate.rc.lua \ No newline at end of file diff --git a/.config/nvim/after/plugin/indent.rc.lua b/.config/nvim/after/plugin/indent.rc.lua deleted file mode 120000 index 0ae8a68..0000000 --- a/.config/nvim/after/plugin/indent.rc.lua +++ /dev/null @@ -1 +0,0 @@ -../available/indent.rc.lua \ No newline at end of file diff --git a/.config/nvim/after/plugin/iswap.rc.lua b/.config/nvim/after/plugin/iswap.rc.lua deleted file mode 120000 index 80516ff..0000000 --- a/.config/nvim/after/plugin/iswap.rc.lua +++ /dev/null @@ -1 +0,0 @@ -../available/iswap.rc.lua \ No newline at end of file diff --git a/.config/nvim/after/plugin/knap.rc.lua b/.config/nvim/after/plugin/knap.rc.lua deleted file mode 120000 index 8898650..0000000 --- a/.config/nvim/after/plugin/knap.rc.lua +++ /dev/null @@ -1 +0,0 @@ -../available/knap.rc.lua \ No newline at end of file diff --git a/.config/nvim/after/plugin/lspconfig.rc.lua b/.config/nvim/after/plugin/lspconfig.rc.lua deleted file mode 120000 index 1ab1297..0000000 --- a/.config/nvim/after/plugin/lspconfig.rc.lua +++ /dev/null @@ -1 +0,0 @@ -../available/lspconfig.rc.lua \ No newline at end of file diff --git a/.config/nvim/after/plugin/lualine.rc.lua b/.config/nvim/after/plugin/lualine.rc.lua deleted file mode 120000 index 03d1fe9..0000000 --- a/.config/nvim/after/plugin/lualine.rc.lua +++ /dev/null @@ -1 +0,0 @@ -../available/lualine.rc.lua \ No newline at end of file diff --git a/.config/nvim/after/plugin/minimap.rc.lua b/.config/nvim/after/plugin/minimap.rc.lua deleted file mode 120000 index 41cb308..0000000 --- a/.config/nvim/after/plugin/minimap.rc.lua +++ /dev/null @@ -1 +0,0 @@ -../available/minimap.rc.lua \ No newline at end of file diff --git a/.config/nvim/after/plugin/mkdnflow.rc.lua b/.config/nvim/after/plugin/mkdnflow.rc.lua deleted file mode 120000 index 8a0f6df..0000000 --- a/.config/nvim/after/plugin/mkdnflow.rc.lua +++ /dev/null @@ -1 +0,0 @@ -../available/mkdnflow.rc.lua \ No newline at end of file diff --git a/.config/nvim/after/plugin/neogen.rc.lua b/.config/nvim/after/plugin/neogen.rc.lua deleted file mode 120000 index 33d3263..0000000 --- a/.config/nvim/after/plugin/neogen.rc.lua +++ /dev/null @@ -1 +0,0 @@ -../available/neogen.rc.lua \ No newline at end of file diff --git a/.config/nvim/after/plugin/neoscroll.rc.lua b/.config/nvim/after/plugin/neoscroll.rc.lua deleted file mode 120000 index 10cd1de..0000000 --- a/.config/nvim/after/plugin/neoscroll.rc.lua +++ /dev/null @@ -1 +0,0 @@ -../available/neoscroll.rc.lua \ No newline at end of file diff --git a/.config/nvim/after/plugin/nvim-cmp.rc.lua b/.config/nvim/after/plugin/nvim-cmp.rc.lua deleted file mode 120000 index 03c097e..0000000 --- a/.config/nvim/after/plugin/nvim-cmp.rc.lua +++ /dev/null @@ -1 +0,0 @@ -../available/nvim-cmp.rc.lua \ No newline at end of file diff --git a/.config/nvim/after/plugin/nvim-dap.rc.lua b/.config/nvim/after/plugin/nvim-dap.rc.lua deleted file mode 120000 index 31196fa..0000000 --- a/.config/nvim/after/plugin/nvim-dap.rc.lua +++ /dev/null @@ -1 +0,0 @@ -../available/nvim-dap.rc.lua \ No newline at end of file diff --git a/.config/nvim/after/plugin/nvim-tree.rc.lua b/.config/nvim/after/plugin/nvim-tree.rc.lua deleted file mode 120000 index 877661d..0000000 --- a/.config/nvim/after/plugin/nvim-tree.rc.lua +++ /dev/null @@ -1 +0,0 @@ -../available/nvim-tree.rc.lua \ No newline at end of file diff --git a/.config/nvim/after/plugin/peek.rc.lua b/.config/nvim/after/plugin/peek.rc.lua deleted file mode 120000 index c8b99e2..0000000 --- a/.config/nvim/after/plugin/peek.rc.lua +++ /dev/null @@ -1 +0,0 @@ -../available/peek.rc.lua \ No newline at end of file diff --git a/.config/nvim/after/plugin/search-pulse.rc.vim b/.config/nvim/after/plugin/search-pulse.rc.vim deleted file mode 120000 index 1ef9d71..0000000 --- a/.config/nvim/after/plugin/search-pulse.rc.vim +++ /dev/null @@ -1 +0,0 @@ -../available/search-pulse.rc.vim \ No newline at end of file diff --git a/.config/nvim/after/plugin/snippets.rc.lua b/.config/nvim/after/plugin/snippets.rc.lua deleted file mode 120000 index e81637c..0000000 --- a/.config/nvim/after/plugin/snippets.rc.lua +++ /dev/null @@ -1 +0,0 @@ -../available/snippets.rc.lua \ No newline at end of file diff --git a/.config/nvim/after/plugin/startify.rc.vim b/.config/nvim/after/plugin/startify.rc.vim deleted file mode 120000 index 491cde7..0000000 --- a/.config/nvim/after/plugin/startify.rc.vim +++ /dev/null @@ -1 +0,0 @@ -../available/startify.rc.vim \ No newline at end of file diff --git a/.config/nvim/after/plugin/themer.rc.lua b/.config/nvim/after/plugin/themer.rc.lua deleted file mode 120000 index 2538f55..0000000 --- a/.config/nvim/after/plugin/themer.rc.lua +++ /dev/null @@ -1 +0,0 @@ -../available/themer.rc.lua \ No newline at end of file diff --git a/.config/nvim/after/plugin/treesitter.rc.lua b/.config/nvim/after/plugin/treesitter.rc.lua deleted file mode 120000 index 10fc495..0000000 --- a/.config/nvim/after/plugin/treesitter.rc.lua +++ /dev/null @@ -1 +0,0 @@ -../available/treesitter.rc.lua \ No newline at end of file diff --git a/.config/nvim/after/plugin/ufo.rc.lua b/.config/nvim/after/plugin/ufo.rc.lua deleted file mode 120000 index d6001ed..0000000 --- a/.config/nvim/after/plugin/ufo.rc.lua +++ /dev/null @@ -1 +0,0 @@ -../available/ufo.rc.lua \ No newline at end of file diff --git a/.config/nvim/after/plugin/vim-test.rc.vim b/.config/nvim/after/plugin/vim-test.rc.vim deleted file mode 120000 index bc83dac..0000000 --- a/.config/nvim/after/plugin/vim-test.rc.vim +++ /dev/null @@ -1 +0,0 @@ -../available/vim-test.rc.vim \ No newline at end of file diff --git a/.config/nvim/after/plugin/virt-column.rc.vim b/.config/nvim/after/plugin/virt-column.rc.vim deleted file mode 120000 index 5cf2b9f..0000000 --- a/.config/nvim/after/plugin/virt-column.rc.vim +++ /dev/null @@ -1 +0,0 @@ -../available/virt-column.rc.vim \ No newline at end of file diff --git a/.config/nvim/after/plugin/which.rc.lua b/.config/nvim/after/plugin/which.rc.lua deleted file mode 120000 index 5b831ee..0000000 --- a/.config/nvim/after/plugin/which.rc.lua +++ /dev/null @@ -1 +0,0 @@ -../available/which.rc.lua \ No newline at end of file diff --git a/.config/nvim/after/plugin/windows.rc.lua b/.config/nvim/after/plugin/windows.rc.lua deleted file mode 120000 index 7176afd..0000000 --- a/.config/nvim/after/plugin/windows.rc.lua +++ /dev/null @@ -1 +0,0 @@ -../available/windows.rc.lua \ No newline at end of file diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim deleted file mode 100644 index 31c6b01..0000000 --- a/.config/nvim/init.vim +++ /dev/null @@ -1,37 +0,0 @@ -lua << EOF -require('core.config') -require('core.plugins') -EOF - - -"let mapleader = "\\" -nmap - -"colorscheme enfocado -"lua require('lualine').setup { options = { theme = 'enfocado' } } - -colorscheme falcon -lua require('lualine').setup { options = { theme = 'falcon' } } - -"highlight MatchParen cterm=underline ctermbg=black ctermfg=NONE -"highlight VirtColumn ctermfg=DarkGrey ctermbg=NONE -"hi clear SpellBad -"hi SpellBad cterm=underline - -" Ctags {{{ -if isdirectory($HOME . '/.cache/nvim/tags') == 0 - :silent !mkdir -p ~/.cache/nvim/tags > /dev/null 2>&1 -endif -let g:gutentags_cache_dir='~/.cache/nvim/tags' -"let g:gutentags_ctags_extra_args=['--fields=+l'] - -if isdirectory($HOME . '/.cache/nvim/undo') == 0 - :silent !mkdir -p ~/.cache/nvim/undo > /dev/null 2>&1 -endif -set undodir=~/.cache/nvim/undo/ -set undofile - -lua << EOF -require('core.mappings') -require('core.temp') -EOF diff --git a/.config/nvim/lua/core/mappings.lua b/.config/nvim/lua/core/mappings.lua index 8085528..e3a2aba 100644 --- a/.config/nvim/lua/core/mappings.lua +++ b/.config/nvim/lua/core/mappings.lua @@ -36,8 +36,8 @@ map('i', 'd', 'lua require("better-digraphs").digraphs("i")', expr --map('n', 'fe'. 'FeMaCo', expr_options) -- fterm -map('n', 'i', 'lua require("FTerm").toggle()', expr_options) -map('t', 'i', 'lua require("FTerm").toggle()', expr_options) +map('n', 'i', 'lua require("FTerm").toggle()', default_options) +map('t', 'i', 'lua require("FTerm").toggle()', default_options) -- icon picker map('n', 'i', 'IconPickerNormal', expr_options) diff --git a/.config/nvim/lua/core/plugins.lua b/.config/nvim/lua/core/plugins.lua index cfa5322..c1c4882 100644 --- a/.config/nvim/lua/core/plugins.lua +++ b/.config/nvim/lua/core/plugins.lua @@ -1,148 +1,17 @@ -vim.cmd [[ packadd packer.nvim ]] +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", -- latest stable release + lazypath, + }) +end +vim.opt.rtp:prepend(lazypath) ---git clone --depth 1 https://github.com/wbthomason/packer.nvim\ --- ~/.local/share/nvim/site/pack/packer/start/packer.nvim +vim.g.mapleader = ' ' +vim.g.maplocalleader = ' ' -return require'packer'.startup( function(use) --- Code development helpers {{{ ---use 'nvim-treesitter/nvim-treesitter-textobjects' ---use 'nvim-treesitter/playground' ---use 'p00f/nvim-ts-rainbow' ---use 'vim-test/vim-test' ---use 'RRethy/vim-illuminate' -use {'nvim-treesitter/nvim-treesitter', run = ':TSUpdate'} -use {'mizlan/iswap.nvim', requires = 'nvim-treesitter/nvim-treesitter'} -use {'Saecki/crates.nvim', requires = 'jose-elias-alvarez/null-ls.nvim'} -use 'andrewferrier/debugprint.nvim' -use 'Civitasv/cmake-tools.nvim' -use 'danymat/neogen' -use 'ftilde/vim-ugdb' -use 'jubnzv/virtual-types.nvim' -use 'krady21/compiler-explorer.nvim' -use 'neovim/nvim-lspconfig' -use 'numToStr/Comment.nvim' -use 'p00f/clangd_extensions.nvim' -use 'ray-x/lsp_signature.nvim' -use {'romgrk/nvim-treesitter-context', requires = 'nvim-treesitter/nvim-treesitter'} --- }}} - --- Completion {{{ -use 'hrsh7th/cmp-buffer' -use 'hrsh7th/cmp-cmdline' -use 'hrsh7th/cmp-nvim-lsp' -use 'hrsh7th/cmp-path' -use 'hrsh7th/nvim-cmp' -use 'mstanciu552/cmp-matlab' -use 'petertriho/cmp-git' --- }}} - --- Snippets {{{ ---use 'fhill2/telescope-ultisnips.nvim' -use 'dcampos/cmp-snippy' -use 'dcampos/nvim-snippy' -use 'honza/vim-snippets' --- }}} - --- Files switch, jump and grep-like tools {{{ ---use 'inside/vim-search-pulse' -use 'MunifTanjim/nui.nvim' -use 'ggandor/leap.nvim' -use 'kyazdani42/nvim-tree.lua' -use 'kyazdani42/nvim-web-devicons' -use 'numToStr/FTerm.nvim' -use 'nvim-lua/plenary.nvim' -use 'nvim-lua/popup.nvim' -use 'nvim-telescope/telescope.nvim' -use 'wellle/targets.vim' --- }}} - --- Git integration {{{ -use 'lewis6991/gitsigns.nvim' -use 'tpope/vim-fugitive' --- }}} - --- Support for random filetypes {{{ ---use 'chrisbra/csv.vim' ---use 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() }, 'for': ['markdown', 'vim-plug']} ---use 'vim-pandoc/vim-pandoc' ---use 'weirongxu/plantuml-previewer.vim' | -use 'aklt/plantuml-syntax' -use 'kergoth/vim-bitbake' -- Bitbake templates and syntax -use {'toppair/peek.nvim', run = 'deno task --quiet build:fast'} --- }}} - --- Other plugins (external tools, etc) {{{ ---use 'JMcKiern/vim-shoot' ---use 'MortenStabenau/matlab-vim' ---use 'junegunn/goyo.vim' -use 'folke/which-key.nvim' -use 'nvim-lualine/lualine.nvim' -use 'protex/better-digraphs.nvim' --- }}} - --- Note taking {{{ -use 'nvim-neorg/neorg' -use 'jakewvincent/mkdnflow.nvim' -use 'AckslD/nvim-FeMaco.lua' --- }}} - --- Appearance {{{ ---use 'jaredgorski/spacecamp' ---use 'lifepillar/vim-gruvbox8' ---use 'marko-cerovac/material.nvim' ---use 'srcery-colors/srcery-vim' ---use 'tanvirtin/monokai.nvim' -use{ 'anuvyklack/pretty-fold.nvim', - config = function() - require('pretty-fold').setup() - require('pretty-fold').ft_setup('cpp', { - process_comment_signs = false, - --comment_signs = { - -- '//', -- C++ Doxygen comments - --}, - } - ) - end -} -use {'anuvyklack/windows.nvim', requires = {'anuvyklack/middleclass', 'anuvyklack/animation.nvim'}} -use { 'anuvyklack/fold-preview.nvim', - requires = 'anuvyklack/keymap-amend.nvim', - config = function() - require('fold-preview').setup({ - -- Your configuration goes here. - }) - end -} -use 'lukas-reineke/virt-column.nvim' -use 'stevearc/dressing.nvim' -use 'wuelnerdotexe/vim-enfocado' -use 'fenetikm/falcon' --- }}} - --- Testing phase {{{ ---use 'RRethy/vim-hexokinase', { 'do': 'make hexokinase' } ---use 'euclio/vim-markdown-composer', {'do': ':!cargo build --release --locked'} ---use 'https://git.sr.ht/%7Ewhynothugo/lsp_linesdenvim' ---use 'kevinhwang91/nvim-ufo' | use 'kevinhwang91/promise-async' ---use 'mfussenegger/nvim-dap' ---use 'narutoxy/silicon.lua' ---use 'nguyenvukhang/nvim-toggler' ---use 'rgroli/other.nvim' " Currently doesn't support C/C++ ---use 'smolovk/projector.nvim' -use 'Pocco81/true-zen.nvim' -use 'frabjous/knap' -use 'gorbit99/codewindow.nvim' -use {'krivahtoo/silicon.nvim', run = './install.sh' } -use 'nat-418/boole.nvim' -use 'nullchilly/fsread.nvim' -use 'nyngwang/murmur.lua' -use 'samodostal/image.nvim' -use 'simrat39/symbols-outline.nvim' -use 'ziontee113/icon-picker.nvim' -use 'cbochs/grapple.nvim' -use 'shortcuts/no-neck-pain.nvim' -use 'debugloop/telescope-undo.nvim' -use 'edluffy/specs.nvim' -use { "RutaTang/quicknote.nvim", requires={"nvim-lua/plenary.nvim"}} --- }}} -end ) +return require'lazy'.setup('plugins') diff --git a/.config/nvim/lua/core/temp.lua b/.config/nvim/lua/core/temp.lua deleted file mode 100644 index 2de1791..0000000 --- a/.config/nvim/lua/core/temp.lua +++ /dev/null @@ -1,16 +0,0 @@ -require("virt-column").setup { } -require('compiler-explorer').setup() -require("symbols-outline").setup() - ---require('lsp_lines').setup() - -require('image').setup { - render = { - min_padding = 5, - show_label = true, - use_dither = true, - }, - events = { - update_on_nvim_resize = true, - }, -} diff --git a/.config/nvim/lua/plugins/boole.lua b/.config/nvim/lua/plugins/boole.lua new file mode 100644 index 0000000..08245aa --- /dev/null +++ b/.config/nvim/lua/plugins/boole.lua @@ -0,0 +1,23 @@ +return { + 'nat-418/boole.nvim', + config = function() + require'boole'.setup({ + mappings = { + increment = '', + decrement = '' + }, + -- User defined loops + additions = { + {'Foo', 'Bar'}, + {'tic', 'tac', 'toe'}, + {'light', 'dark'}, + {'phaseOne', 'phaseTwo', 'phaseThree'}, + {'PhaseOne', 'PhaseTwo', 'PhaseThree'}, + {'Enable', 'Disable'}, + {'ENABLE', 'DISABLE'}, + {'enable', 'disable'}, + {'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine'}, + }, + }) + end +} diff --git a/.config/nvim/lua/plugins/comment.lua b/.config/nvim/lua/plugins/comment.lua new file mode 100644 index 0000000..9df2d82 --- /dev/null +++ b/.config/nvim/lua/plugins/comment.lua @@ -0,0 +1,4 @@ +return { + 'numToStr/Comment.nvim', + config = true +} diff --git a/.config/nvim/lua/plugins/compiler-explorer.lua b/.config/nvim/lua/plugins/compiler-explorer.lua new file mode 100644 index 0000000..cf0fb2e --- /dev/null +++ b/.config/nvim/lua/plugins/compiler-explorer.lua @@ -0,0 +1,4 @@ +return { + 'krady21/compiler-explorer.nvim', + config = true +} diff --git a/.config/nvim/lua/plugins/context.lua b/.config/nvim/lua/plugins/context.lua new file mode 100644 index 0000000..31e702e --- /dev/null +++ b/.config/nvim/lua/plugins/context.lua @@ -0,0 +1,41 @@ +return { + 'romgrk/nvim-treesitter-context', + dependencies = 'nvim-treesitter/nvim-treesitter', + config = function() + -- " Configuration for context.vim + -- "" Disable context.vim on json files + vim.g.context_filetype_blacklist = {"json", "log"} + require('treesitter-context').setup{ + enable = true, -- Enable this plugin (Can be enabled/disabled later via commands) + throttle = true, -- Throttles plugin updates (may improve performance) + max_lines = 0, -- How many lines the window should span. Values <= 0 mean no limit. + patterns = { -- Match patterns for TS nodes. These get wrapped to match at word boundaries. + -- For all filetypes + -- Note that setting an entry here replaces all other patterns for this entry. + -- By setting the 'default' entry below, you can control which nodes you want to + -- appear in the context window. + default = { + 'class', + 'function', + 'method', + 'for', + 'while', + 'if', + 'switch', + -- 'case', + }, + -- Example for a specific filetype. + -- If a pattern is missing, *open a PR* so everyone can benefit. + rust = { + 'impl_item', + }, + }, + exact_patterns = { + -- Example for a specific filetype with Lua patterns + -- Treat patterns.rust as a Lua pattern (i.e "^impl_item$" will + -- exactly match "impl_item" only) + rust = true, + } + } + end +} diff --git a/.config/nvim/lua/plugins/crates.lua b/.config/nvim/lua/plugins/crates.lua new file mode 100644 index 0000000..7237d8b --- /dev/null +++ b/.config/nvim/lua/plugins/crates.lua @@ -0,0 +1,5 @@ +return { + 'Saecki/crates.nvim', + dependencies = 'jose-elias-alvarez/null-ls.nvim', + config = true +} diff --git a/.config/nvim/lua/plugins/debugprint.lua b/.config/nvim/lua/plugins/debugprint.lua new file mode 100644 index 0000000..2561845 --- /dev/null +++ b/.config/nvim/lua/plugins/debugprint.lua @@ -0,0 +1,4 @@ +return { + 'andrewferrier/debugprint.nvim', + config = true, +} diff --git a/.config/nvim/lua/plugins/dressing.lua b/.config/nvim/lua/plugins/dressing.lua new file mode 100644 index 0000000..45c5776 --- /dev/null +++ b/.config/nvim/lua/plugins/dressing.lua @@ -0,0 +1,162 @@ +return { + 'stevearc/dressing.nvim', + opts = { + input = { + -- Set to false to disable the vim.ui.input implementation + enabled = true, + + -- Default prompt string + default_prompt = "Input:", + + -- Can be 'left', 'right', or 'center' + prompt_align = "left", + + -- When true, will close the modal + insert_only = true, + + -- When true, input will start in insert mode. + start_in_insert = true, + + -- These are passed to nvim_open_win + anchor = "SW", + border = "rounded", + -- 'editor' and 'win' will default to being centered + relative = "cursor", + + -- These can be integers or a float between 0 and 1 (e.g. 0.4 for 40%) + prefer_width = 40, + width = nil, + -- min_width and max_width can be a list of mixed types. + -- min_width = {20, 0.2} means "the greater of 20 columns or 20% of total" + max_width = { 140, 0.9 }, + min_width = { 20, 0.2 }, + + buf_options = {}, + win_options = { + -- Window transparency (0-100) + winblend = 10, + -- Disable line wrapping + wrap = false, + }, + + -- Set to `false` to disable + mappings = { + n = { + [""] = "Close", + [""] = "Confirm", + }, + i = { + [""] = "Close", + [""] = "Confirm", + [""] = "HistoryPrev", + [""] = "HistoryNext", + }, + }, + + override = function(conf) + -- This is the config that will be passed to nvim_open_win. + -- Change values here to customize the layout + return conf + end, + + -- see :help dressing_get_config + get_config = nil, + }, + select = { + -- Set to false to disable the vim.ui.select implementation + enabled = true, + + -- Priority list of preferred vim.select implementations + backend = { "telescope", "fzf_lua", "fzf", "builtin", "nui" }, + + -- Trim trailing `:` from prompt + trim_prompt = true, + + -- Options for telescope selector + -- These are passed into the telescope picker directly. Can be used like: + -- telescope = require('telescope.themes').get_ivy({...}) + telescope = nil, + + -- Options for fzf selector + fzf = { + window = { + width = 0.5, + height = 0.4, + }, + }, + + -- Options for fzf_lua selector + fzf_lua = { + winopts = { + width = 0.5, + height = 0.4, + }, + }, + + -- Options for nui Menu + nui = { + position = "50%", + size = nil, + relative = "editor", + border = { + style = "rounded", + }, + buf_options = { + swapfile = false, + filetype = "DressingSelect", + }, + win_options = { + winblend = 10, + }, + max_width = 80, + max_height = 40, + min_width = 40, + min_height = 10, + }, + + -- Options for built-in selector + builtin = { + -- These are passed to nvim_open_win + anchor = "NW", + border = "rounded", + -- 'editor' and 'win' will default to being centered + relative = "editor", + + buf_options = {}, + win_options = { + -- Window transparency (0-100) + winblend = 10, + }, + + -- These can be integers or a float between 0 and 1 (e.g. 0.4 for 40%) + -- the min_ and max_ options can be a list of mixed types. + -- max_width = {140, 0.8} means "the lesser of 140 columns or 80% of total" + width = nil, + max_width = { 140, 0.8 }, + min_width = { 40, 0.2 }, + height = nil, + max_height = 0.9, + min_height = { 10, 0.2 }, + + -- Set to `false` to disable + mappings = { + [""] = "Close", + [""] = "Close", + [""] = "Confirm", + }, + + override = function(conf) + -- This is the config that will be passed to nvim_open_win. + -- Change values here to customize the layout + return conf + end, + }, + + -- Used to override format_item. See :help dressing-format + format_item_override = {}, + + -- see :help dressing_get_config + get_config = nil, + }, + } +} diff --git a/.config/nvim/lua/plugins/femaco.lua b/.config/nvim/lua/plugins/femaco.lua new file mode 100644 index 0000000..60ad422 --- /dev/null +++ b/.config/nvim/lua/plugins/femaco.lua @@ -0,0 +1,5 @@ +return { +--require('femaco').setup() + 'AckslD/nvim-FeMaco.lua', + config = true +} diff --git a/.config/nvim/lua/plugins/fterm.lua b/.config/nvim/lua/plugins/fterm.lua new file mode 100644 index 0000000..bf6519a --- /dev/null +++ b/.config/nvim/lua/plugins/fterm.lua @@ -0,0 +1,44 @@ +return { + 'numToStr/FTerm.nvim', + opts = { + -- Filetype of the terminal buffer + ft = 'FTerm', + + -- Command to run inside the terminal. It could be a `string` or `table` + cmd = os.getenv('SHELL'), + + -- Neovim's native window border. See `:h nvim_open_win` for more configuration options. + border = 'double', + + -- Close the terminal as soon as shell/command exits. + -- Disabling this will mimic the native terminal behaviour. + auto_close = true, + + -- Highlight group for the terminal. See `:h winhl` + hl = 'Normal', + + -- Transparency of the floating window. See `:h winblend` + blend = 0, + + -- Object containing the terminal window dimensions. + -- The value for each field should be between `0` and `1` + dimensions = { + height = 0.9, -- Height of the terminal window + width = 0.9, -- Width of the terminal window + x = 0.5, -- X axis of the terminal window + y = 0.5, -- Y axis of the terminal window + }, + + -- Callback invoked when the terminal exits. + -- See `:h jobstart-options` + on_exit = nil, + + -- Callback invoked when the terminal emits stdout data. + -- See `:h jobstart-options` + on_stdout = nil, + + -- Callback invoked when the terminal emits stderr data. + -- See `:h jobstart-options` + on_stderr = nil, + } +} diff --git a/.config/nvim/lua/plugins/gitlinker.lua b/.config/nvim/lua/plugins/gitlinker.lua new file mode 100644 index 0000000..9d415e1 --- /dev/null +++ b/.config/nvim/lua/plugins/gitlinker.lua @@ -0,0 +1,29 @@ +return { + 'ruifm/gitlinker.nvim', + dependencies = { + 'nvim-lua/plenary.nvim' + }, + opts = { + callbacks = { + ["git.viessmann.com"] = function(url_data) + local url = require'gitlinker.hosts'.get_base_https_url(url_data) + if not url_data.file or not url_data.rev then + return url + end + url = url .. "/src/" .. url_data.rev .. "/" .. url_data.file + + if not url_data.lstart then + return url + end + url = url .. "#lines-" .. url_data.lstart + if url_data.lend then + url = url .. ":" .. url_data.lend + end + + return url + end + }, + -- default mapping to call url generation with action_callback + mappings = "gl" + } +} diff --git a/.config/nvim/lua/plugins/gitsigns.lua b/.config/nvim/lua/plugins/gitsigns.lua new file mode 100644 index 0000000..2a64f2e --- /dev/null +++ b/.config/nvim/lua/plugins/gitsigns.lua @@ -0,0 +1,107 @@ +return { + 'lewis6991/gitsigns.nvim', + opts = { + signs = { + add = {hl = 'GitSignsAdd' , text = '│', numhl='GitSignsAddNr' , linehl='GitSignsAddLn'}, + change = {hl = 'GitSignsChange', text = '│', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'}, + delete = {hl = 'GitSignsDelete', text = '_', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'}, + topdelete = {hl = 'GitSignsDelete', text = '‾', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'}, + changedelete = {hl = 'GitSignsChange', text = '~', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'}, + }, + signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` + numhl = true, -- Toggle with `:Gitsigns toggle_numhl` + linehl = false, -- Toggle with `:Gitsigns toggle_linehl` + word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` + --keymaps = { + -- -- Default keymap options + -- noremap = true, + + -- ['n ]c'] = { expr = true, "&diff ? ']c' : 'Gitsigns next_hunk'"}, + -- ['n [c'] = { expr = true, "&diff ? '[c' : 'Gitsigns prev_hunk'"}, + + -- ['n hs'] = 'Gitsigns stage_hunk', + -- ['v hs'] = 'Gitsigns stage_hunk', + -- ['n hu'] = 'Gitsigns undo_stage_hunk', + -- ['n hr'] = 'Gitsigns reset_hunk', + -- ['v hr'] = ':Gitsigns reset_hunk', + -- ['n hR'] = 'Gitsigns reset_buffer', + -- ['n hp'] = 'Gitsigns preview_hunk', + -- ['n hb'] = 'lua require"gitsigns".blame_line{full=true}', + -- ['n hS'] = 'Gitsigns stage_buffer', + -- ['n hU'] = 'Gitsigns reset_buffer_index', + + -- -- Text objects + -- ['o ih'] = 'Gitsigns select_hunk', + -- ['x ih'] = 'Gitsigns select_hunk' + --}, + on_attach = function(bufnr) + local gs = package.loaded.gitsigns + + local function map(mode, l, r, opts) + opts = opts or {} + opts.buffer = bufnr + vim.keymap.set(mode, l, r, opts) + end + + -- Navigation + map('n', ']c', function() + if vim.wo.diff then return ']c' end + vim.schedule(function() gs.next_hunk() end) + return '' + end, {expr=true}) + + map('n', '[c', function() + if vim.wo.diff then return '[c' end + vim.schedule(function() gs.prev_hunk() end) + return '' + end, {expr=true}) + + -- Actions + map({'n', 'v'}, 'hs', 'Gitsigns stage_hunk') + map({'n', 'v'}, 'hr', 'Gitsigns reset_hunk') + map('n', 'hS', gs.stage_buffer) + map('n', 'hu', gs.undo_stage_hunk) + map('n', 'hR', gs.reset_buffer) + map('n', 'hp', gs.preview_hunk) + map('n', 'hb', function() gs.blame_line{full=true} end) + map('n', 'tb', gs.toggle_current_line_blame) + map('n', 'hd', gs.diffthis) + map('n', 'hD', function() gs.diffthis('~') end) + map('n', 'td', gs.toggle_deleted) + + -- Text object + map({'o', 'x'}, 'ih', ':Gitsigns select_hunk') + end, + + watch_gitdir = { + interval = 1000, + follow_files = true + }, + attach_to_untracked = true, + current_line_blame = true, -- Toggle with `:Gitsigns toggle_current_line_blame` + current_line_blame_opts = { + virt_text = true, + virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align' + delay = 1000, + ignore_whitespace = true, + }, + current_line_blame_formatter_opts = { + relative_time = false + }, + sign_priority = 6, + update_debounce = 100, + status_formatter = nil, -- Use default + max_file_length = 40000, + preview_config = { + -- Options passed to nvim_open_win + border = 'single', + style = 'minimal', + relative = 'cursor', + row = 0, + col = 1 + }, + yadm = { + enable = true + }, + } +} diff --git a/.config/nvim/lua/plugins/icons.lua b/.config/nvim/lua/plugins/icons.lua new file mode 100644 index 0000000..bc9a17a --- /dev/null +++ b/.config/nvim/lua/plugins/icons.lua @@ -0,0 +1,6 @@ +return { + 'ziontee113/icon-picker.nvim', + config = function() + require("icon-picker").setup({disable_legacy_commands = true }) + end +} diff --git a/.config/nvim/lua/plugins/illuminate.lua b/.config/nvim/lua/plugins/illuminate.lua new file mode 100644 index 0000000..1b0dbd5 --- /dev/null +++ b/.config/nvim/lua/plugins/illuminate.lua @@ -0,0 +1,47 @@ +return { + 'nyngwang/murmur.lua', + config = function() + --require('illuminate').configure({ + -- large_file_cutoff = 3000 + --}) + + HIGHLIGHT = 'highlight' + vim.api.nvim_create_augroup(HIGHLIGHT, { clear = true }) + + require('murmur').setup { + cursor_rgb = 'darkgreen', -- default to '#393939' + max_len = 80, -- maximum word-length to highlight + -- disable_on_lines = 2000, -- to prevent lagging on large files. Default to 2000 lines. + exclude_filetypes = {'log'}, + callbacks = { + -- to trigger the close_events of vim.diagnostic.open_float. + function () + -- Close floating diag. and make it triggerable again. + vim.cmd('doautocmd InsertEnter') + vim.w.diag_shown = false + end, + } + } + vim.api.nvim_create_autocmd('CursorHold', { + group = HIGHLIGHT, + pattern = '*', + callback = function () + -- skip when a float-win already exists. + if vim.w.diag_shown then return end + + -- open float-win when hovering on a cursor-word. + if vim.w.cursor_word ~= '' then + vim.diagnostic.open_float(nil, { + focusable = true, + close_events = { 'InsertEnter' }, + border = 'rounded', + source = 'always', + prefix = ' ', + scope = 'cursor', + }) + vim.w.diag_shown = true + end + end + }) + end +} diff --git a/.config/nvim/lua/plugins/image.lua b/.config/nvim/lua/plugins/image.lua new file mode 100644 index 0000000..3d9f1af --- /dev/null +++ b/.config/nvim/lua/plugins/image.lua @@ -0,0 +1,13 @@ +return { + 'samodostal/image.nvim', + opts = { + render = { + min_padding = 5, + show_label = true, + use_dither = true, + }, + events = { + update_on_nvim_resize = true, + }, + } +} diff --git a/.config/nvim/lua/plugins/init.lua b/.config/nvim/lua/plugins/init.lua new file mode 100644 index 0000000..594698e --- /dev/null +++ b/.config/nvim/lua/plugins/init.lua @@ -0,0 +1,115 @@ +return {{ +-- Code development helpers {{{ +--"vim-test/vim-test", +--"RRethy/vim-illuminate", +{ "ftilde/vim-ugdb", cmd = "UGDBBreakpoint" }, +"jubnzv/virtual-types.nvim", +'p00f/clangd_extensions.nvim', +'ray-x/lsp_signature.nvim', +"mrjones2014/nvim-ts-rainbow", +-- }}} + +-- }}} + +-- Files switch, jump and grep-like tools {{{ +--"inside/vim-search-pulse", +"MunifTanjim/nui.nvim", +"ggandor/leap.nvim", +"nvim-lua/plenary.nvim", +"nvim-lua/popup.nvim", +"wellle/targets.vim", +-- }}} + +-- Git integration {{{ +"lewis6991/gitsigns.nvim", +"tpope/vim-fugitive", +-- }}} + +-- Support for random filetypes {{{ +--"chrisbra/csv.vim", +--"iamcco/markdown-preview.nvim",, { 'do': { -> mkdp#util#install() }, 'for': ['markdown', 'vim-plug']} +--"vim-pandoc/vim-pandoc", +--"weirongxu/plantuml-previewer.vim", | +"aklt/plantuml-syntax", +"kergoth/vim-bitbake", -- Bitbake templates and syntax +-- }}} + +-- Other plugins (external tools, etc) {{{ +--"JMcKiern/vim-shoot", +--"MortenStabenau/matlab-vim", +--"junegunn/goyo.vim", +"protex/better-digraphs.nvim", +-- }}} + +-- Note taking {{{ +"nvim-neorg/neorg", +-- }}} + +-- Appearance {{{ +--"jaredgorski/spacecamp", +--"lifepillar/vim-gruvbox8", +--"marko-cerovac/material.nvim", +--"srcery-colors/srcery-vim", +--"tanvirtin/monokai.nvim", +{ + 'anuvyklack/pretty-fold.nvim', + config = function() + require('pretty-fold').setup() + require('pretty-fold').ft_setup('cpp', { + process_comment_signs = false, + --comment_signs = { + -- '//', -- C++ Doxygen comments + --}, + }) + end +}, +{ + 'anuvyklack/fold-preview.nvim', + dependencies = 'anuvyklack/keymap-amend.nvim', + config = function() + require('fold-preview').setup({ + -- Your configuration goes here. + }) + end +}, +"stevearc/dressing.nvim", +--"wuelnerdotexe/vim-enfocado", +{ + "fenetikm/falcon", + lazy = false, + config = function() + -- vim.cmd([[ colorscheme falcon]]) + end +}, +{ + "rebelot/kanagawa.nvim", + lazy = false, + config = function() + vim.cmd([[ colorscheme kanagawa]]) + end +}, +-- }}} + +-- Testing phase {{{ +--"RRethy/vim-hexokinase",, { 'do': 'make hexokinase' } +--"euclio/vim-markdown-composer",, {'do': ':!cargo build --release --locked'} + +--"https://git.sr.ht/~whynothugo/lsp_lines.nvim", +--require('lsp_lines').setup() + +--"mfussenegger/nvim-dap", +--"narutoxy/silicon.lua", +--"nguyenvukhang/nvim-toggler", +--"rgroli/other.nvim", " Currently doesn't support C/C++ +--"smolovk/projector.nvim", +"Pocco81/true-zen.nvim", +{'krivahtoo/silicon.nvim', build = './install.sh' }, +"nullchilly/fsread.nvim", +"ziontee113/icon-picker.nvim", +"cbochs/grapple.nvim", +"shortcuts/no-neck-pain.nvim", +"edluffy/specs.nvim", +{ 'ruifm/gitlinker.nvim', dependencies = 'nvim-lua/plenary.nvim'}, +--'jinzhongjia/PS_manager.nvim', +-- }}} +}} diff --git a/.config/nvim/lua/plugins/knap.lua b/.config/nvim/lua/plugins/knap.lua new file mode 100644 index 0000000..7726dd8 --- /dev/null +++ b/.config/nvim/lua/plugins/knap.lua @@ -0,0 +1,34 @@ +return { + 'frabjous/knap', + config = function() + local gknapsettings = { + htmloutputext = "html", + htmltohtml = "touch %outputfile%", + htmltohtmlviewerlaunch = "google-chrome-beta %outputfile%", + htmltohtmlviewerrefresh = "none", + mdoutputext = "html", + mdtohtml = "pandoc --standalone %docroot% -o %outputfile%", + mdtohtmlviewerlaunch = "google-chrome-beta %outputfile%", + mdtohtmlviewerrefresh = "none", + mdtopdf = "pandoc %docroot% -o %outputfile%", + mdtopdfviewerlaunch = "sioyek %outputfile%", + mdtopdfviewerrefresh = "none", + markdownoutputext = "html", + markdowntohtml = "pandoc --standalone %docroot% -o %outputfile%", + markdowntohtmlviewerlaunch = "google-chrome-beta %outputfile%", + markdowntohtmlviewerrefresh = "none", + markdowntopdf = "pandoc %docroot% -o %outputfile%", + markdowntopdfviewerlaunch = "sioyek %outputfile%", + markdowntopdfviewerrefresh = "none", + texoutputext = "pdf", + textopdf = "pdflatex -interaction=batchmode -halt-on-error -synctex=1 %docroot%", + textopdfviewerlaunch = "sioyek --inverse-search 'nvim --headless -es --cmd \"lua require('\"'\"'knaphelper'\"'\"').relayjump('\"'\"'%servername%'\"'\"','\"'\"'%1'\"'\"',%2,%3)\"' --reuse-instance %outputfile%", + textopdfviewerrefresh = "none", + textopdfforwardjump = "sioyek --inverse-search 'nvim --headless -es --cmd \"lua require('\"'\"'knaphelper'\"'\"').relayjump('\"'\"'%servername%'\"'\"','\"'\"'%1'\"'\"',%2,%3)\"' --reuse-instance --forward-search-file %srcfile% --forward-search-line %line% %outputfile%", + textopdfshorterror = "A=%outputfile% ; LOGFILE=\"${A%.pdf}.log\" ; rubber-info \"$LOGFILE\" 2>&1 | head -n 1", + delay = 250 + } + + vim.g.knap_settings = gknapsettings + end +} diff --git a/.config/nvim/lua/plugins/lspconfig.lua b/.config/nvim/lua/plugins/lspconfig.lua new file mode 100644 index 0000000..767716e --- /dev/null +++ b/.config/nvim/lua/plugins/lspconfig.lua @@ -0,0 +1,155 @@ +return { + 'neovim/nvim-lspconfig', + config = function() + local nvim_lsp = require('lspconfig') + local clangd_extensions = require('clangd_extensions') + local lsp_signature = require('lsp_signature') + + -- Mappings. + local opts = { noremap=true, silent=true } + vim.api.nvim_set_keymap('n', 'e', 'lua vim.diagnostic.open_float()', opts) + vim.api.nvim_set_keymap('n', '[d', 'lua vim.diagnostic.goto_prev()', opts) + vim.api.nvim_set_keymap('n', ']d', 'lua vim.diagnostic.goto_next()', opts) + vim.api.nvim_set_keymap('n', 'E', 'lua vim.diagnostic.set_loclist()', opts) + vim.api.nvim_set_keymap("n", "q", "lua vim.lsp.buf.format{ async = true }", opts) + + -- Use an on_attach function to only map the following keys + -- after the language server attaches to the current buffer + local on_attach = function(client, bufnr) + --Enable completion triggered by + vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') + + ---- See `:help vim.lsp.*` for documentation on any of the below functions + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gD', 'lua vim.lsp.buf.declaration()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gd', 'lua vim.lsp.buf.definition()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'K', 'lua vim.lsp.buf.hover()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gi', 'lua vim.lsp.buf.implementation()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', '', 'lua vim.lsp.buf.signature_help()', opts) + --vim.api.nvim_buf_set_keymap(bufnr, 'n', 'wa', 'lua vim.lsp.buf.add_workspace_folder()', opts) + --vim.api.nvim_buf_set_keymap(bufnr, 'n', 'wr', 'lua vim.lsp.buf.remove_workspace_folder()', opts) + --vim.api.nvim_buf_set_keymap(bufnr, 'n', 'wl', 'lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'D', 'lua vim.lsp.buf.type_definition()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'rn', 'lua vim.lsp.buf.rename()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'ca', 'lua vim.lsp.buf.code_action()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gr', 'lua vim.lsp.buf.references()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', '', 'ClangdSwitchSourceHeader', opts) + + -- require'illuminate'.on_attach(client) + require'virtualtypes'.on_attach() + require'lsp_signature'.on_attach({ + floating_window = true, + floating_window_above_cur_line = false, + floating_window_off_x = 500, + floating_window_off_y = -5, + }) + end + + local signs = { + { name = "DiagnosticSignError", text = "" }, + { name = "DiagnosticSignWarn", text = "" }, + { name = "DiagnosticSignHint", text = "" }, + { name = "DiagnosticSignInfo", text = "" }, + } + + for _, sign in ipairs(signs) do + vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = "" }) + end + + --vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with( + -- vim.lsp.diagnostic.on_publish_diagnostics, { + -- signs = { + -- active = signs, + -- --severity_limit = 'info', + -- }, + -- severity_sort = true, + -- underline = false, + -- update_in_insert = false, + -- --virtual_text = { + -- -- spacing = 40, + -- -- severity_limit = 'Warning', + -- --}, + -- virtual_text = false, + -- } + --) + -- + local capabilities = require('cmp_nvim_lsp').default_capabilities() + + nvim_lsp.groovyls.setup({ + cmd = { "java", "-jar", "/home/kmcr/tools/groovy-language-server/build/libs/groovy-language-server-all.jar" }, + on_attach = on_attach, + --on_publish_diagnostics = diagnostic_handler, + capabilities = capabilities + }) + + -- nvim_lsp.ccls.setup( + -- coq.lsp_ensure_capabilities({ + -- init_options = { + -- compilationDatabaseDirectory = "."; + -- index = { + -- threads = 0; + -- }, + -- clang = { + -- excludeArgs = { "-frounding-math"} ; + -- }, + -- }, + -- root_dir = nvim_lsp.util.root_pattern("compile_commands.json"), + -- on_attach = on_attach, + -- on_publish_diagnostics = diagnostic_handler, + -- flags = { + -- debounce_text_changes = 150, + -- }} + -- ) + -- ) + + clangd_extensions.setup({ + server = { + on_attach = on_attach, + root_pattern = { + '.clangd', + '.clang-tidy', + '.clang-format', + 'compile_commands.json', + 'compile_flags.txt', + 'configure.ac', + }, + capabilities = capabilities + }, + inlay_hints = { + max_len_align = true, + max_len_align_padding = 3, + right_align = true, + } + }) + + nvim_lsp.pylsp.setup({ + settings = { + pylint = { + enabled = false + }, + pyflakes = { + enabled = false, + }, + }, + -- flags = { + -- debounce_text_changes = 150, + -- }, + on_attach = on_attach, + capabilities = capabilities + --on_publish_diagnostics = diagnostic_handler, + }) + + -- Use a loop to conveniently call 'setup' on multiple servers and + -- map buffer local keybindings when the language server attaches + local servers = { "cmake", "rust_analyzer", "bashls", "marksman" } + for _, lsp in ipairs(servers) do + nvim_lsp[lsp].setup({ + on_attach = on_attach, + --on_publish_diagnostics = diagnostic_handler, + capabilities = capabilities, + -- flags = { + -- debounce_text_changes = 150, + -- } + }) + end +end +} diff --git a/.config/nvim/lua/plugins/lualine.lua b/.config/nvim/lua/plugins/lualine.lua new file mode 100644 index 0000000..da1c8f6 --- /dev/null +++ b/.config/nvim/lua/plugins/lualine.lua @@ -0,0 +1,227 @@ +return { + 'nvim-lualine/lualine.nvim', + config = function() + -- Eviline config for lualine + -- Author: shadmansaleh + -- Credit: glepnir + local lualine = require('lualine') + + -- Color table for highlights + -- stylua: ignore + local colors = { + bg = '#202328', + fg = '#bbc2cf', + yellow = '#ECBE7B', + cyan = '#008080', + darkblue = '#081633', + green = '#98be65', + orange = '#FF8800', + violet = '#a9a1e1', + magenta = '#c678dd', + blue = '#51afef', + red = '#ec5f67', + } + + + local conditions = { + buffer_not_empty = function() + return vim.fn.empty(vim.fn.expand('%:t')) ~= 1 + end, + hide_in_width = function() + return vim.fn.winwidth(0) > 80 + end, + check_git_workspace = function() + local filepath = vim.fn.expand('%:p:h') + local gitdir = vim.fn.finddir('.git', filepath .. ';') + return gitdir and #gitdir > 0 and #gitdir < #filepath + end, + } + + -- Config + local config = { + options = { + -- Disable sections and component separators + component_separators = '', + section_separators = '', + theme = { + -- We are going to use lualine_c an lualine_x as left and + -- right section. Both are highlighted by c theme . So we + -- are just setting default looks o statusline + normal = { c = { fg = colors.fg, bg = colors.bg } }, + inactive = { c = { fg = colors.fg, bg = colors.bg } }, + }, + }, + sections = { + -- these are to remove the defaults + lualine_a = {}, + lualine_b = {}, + lualine_y = {}, + lualine_z = {}, + -- These will be filled later + lualine_c = {}, + lualine_x = {}, + }, + inactive_sections = { + -- these are to remove the defaults + lualine_a = {}, + lualine_b = {}, + lualine_y = {}, + lualine_z = {}, + lualine_c = {}, + lualine_x = {}, + }, + } + + -- Inserts a component in lualine_c at left section + local function ins_left(component) + table.insert(config.sections.lualine_c, component) + end + + -- Inserts a component in lualine_x ot right section + local function ins_right(component) + table.insert(config.sections.lualine_x, component) + end + + ins_left { + function() + return '▊' + end, + color = { fg = colors.blue }, -- Sets highlighting of component + padding = { left = 0, right = 1 }, -- We don't need space before this + } + + ins_left { + -- mode component + function() + return '' + end, + color = function() + -- auto change color according to neovims mode + local mode_color = { + n = colors.red, + i = colors.green, + v = colors.blue, + [''] = colors.blue, + V = colors.blue, + c = colors.magenta, + no = colors.red, + s = colors.orange, + S = colors.orange, + [''] = colors.orange, + ic = colors.yellow, + R = colors.violet, + Rv = colors.violet, + cv = colors.red, + ce = colors.red, + r = colors.cyan, + rm = colors.cyan, + ['r?'] = colors.cyan, + ['!'] = colors.red, + t = colors.red, + } + return { fg = mode_color[vim.fn.mode()] } + end, + padding = { right = 1 }, + } + + ins_left { + -- filesize component + 'filesize', + cond = conditions.buffer_not_empty, + } + + ins_left { + 'filename', + cond = conditions.buffer_not_empty, + color = { fg = colors.magenta, gui = 'bold' }, + } + + ins_left { 'location' } + + ins_left { 'progress', color = { fg = colors.fg, gui = 'bold' } } + + ins_left { + 'diagnostics', + sources = { 'nvim_diagnostic' }, + symbols = { error = ' ', warn = ' ', info = ' ' }, + diagnostics_color = { + color_error = { fg = colors.red }, + color_warn = { fg = colors.yellow }, + color_info = { fg = colors.cyan }, + }, + } + + -- Insert mid section. You can make any number of sections in neovim :) + -- for lualine it's any number greater then 2 + ins_left { + function() + return '%=' + end, + } + + ins_left { + -- Lsp server name . + function() + local msg = 'No Active Lsp' + local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype') + local clients = vim.lsp.get_active_clients() + if next(clients) == nil then + return msg + end + for _, client in ipairs(clients) do + local filetypes = client.config.filetypes + if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then + return client.name + end + end + return msg + end, + icon = ' LSP:', + color = { fg = '#ffffff', gui = 'bold' }, + } + + -- Add components to right sections + ins_right { + 'o:encoding', -- option component same as &encoding in viml + fmt = string.upper, -- I'm not sure why it's upper case either ;) + cond = conditions.hide_in_width, + color = { fg = colors.green, gui = 'bold' }, + } + + ins_right { + 'fileformat', + fmt = string.upper, + icons_enabled = true, -- I think icons are cool but Eviline doesn't have them. sigh + color = { fg = colors.green, gui = 'bold' }, + } + + ins_right { + 'branch', + icon = '', + color = { fg = colors.violet, gui = 'bold' }, + } + + ins_right { + 'diff', + -- Is it me or the symbol for modified us really weird + symbols = { added = ' ', modified = '柳 ', removed = ' ' }, + diff_color = { + added = { fg = colors.green }, + modified = { fg = colors.orange }, + removed = { fg = colors.red }, + }, + cond = conditions.hide_in_width, + } + + ins_right { + function() + return '▊' + end, + color = { fg = colors.blue }, + padding = { left = 1 }, + } + + -- Now don't forget to initialize lualine + lualine.setup(config) + end +} diff --git a/.config/nvim/lua/plugins/minimap.lua b/.config/nvim/lua/plugins/minimap.lua new file mode 100644 index 0000000..5e6e722 --- /dev/null +++ b/.config/nvim/lua/plugins/minimap.lua @@ -0,0 +1,6 @@ +return { + 'gorbit99/codewindow.nvim', + config = function() + require('codewindow').setup() + end +} diff --git a/.config/nvim/lua/plugins/mkdnflow.lua b/.config/nvim/lua/plugins/mkdnflow.lua new file mode 100644 index 0000000..9ddc918 --- /dev/null +++ b/.config/nvim/lua/plugins/mkdnflow.lua @@ -0,0 +1,91 @@ +return { + 'jakewvincent/mkdnflow.nvim', + opts = { + modules = { + bib = true, + buffers = true, + conceal = true, + cursor = true, + folds = true, + links = true, + lists = true, + maps = true, + paths = true, + tables = true + }, + filetypes = {md = true, rmd = true, markdown = true}, + create_dirs = true, + perspective = { + priority = 'first', + fallback = 'current', + root_tell = false, + nvim_wd_heel = true + }, + wrap = false, + bib = { + default_path = nil, + find_in_root = true + }, + silent = false, + links = { + style = 'markdown', + conceal = false, + implicit_extension = nil, + transform_implicit = false, + transform_explicit = function(text) + text = text:gsub(" ", "-") + text = text:lower() + text = os.date('%Y-%m-%d_')..text + return(text) + end + }, + to_do = { + symbols = {' ', '-', 'X'}, + update_parents = true, + not_started = ' ', + in_progress = '-', + complete = 'X' + }, + tables = { + trim_whitespace = true, + format_on_move = true, + auto_extend_rows = false, + auto_extend_cols = false + }, + mappings = { + MkdnEnter = {{'n', 'v'}, ''}, + MkdnTab = false, + MkdnSTab = false, + MkdnNextLink = {'n', ''}, + MkdnPrevLink = {'n', ''}, + MkdnNextHeading = {'n', ']]'}, + MkdnPrevHeading = {'n', '[['}, + MkdnGoBack = {'n', ''}, + MkdnGoForward = {'n', ''}, + MkdnFollowLink = false, -- see MkdnEnter + MkdnDestroyLink = {'n', ''}, + MkdnTagSpan = {'v', ''}, + MkdnMoveSource = {'n', ''}, + MkdnYankAnchorLink = {'n', 'ya'}, + MkdnYankFileAnchorLink = {'n', 'yfa'}, + MkdnIncreaseHeading = {'n', '+'}, + MkdnDecreaseHeading = {'n', '-'}, + MkdnToggleToDo = {{'n', 'v'}, ''}, + MkdnNewListItem = false, + MkdnNewListItemBelowInsert = {'n', 'o'}, + MkdnNewListItemAboveInsert = {'n', 'O'}, + MkdnExtendList = false, + MkdnUpdateNumbering = {'n', 'nn'}, + MkdnTableNextCell = {'i', ''}, + MkdnTablePrevCell = {'i', ''}, + MkdnTableNextRow = false, + MkdnTablePrevRow = {'i', ''}, + MkdnTableNewRowBelow = {'n', 'ir'}, + MkdnTableNewRowAbove = {'n', 'iR'}, + MkdnTableNewColAfter = {'n', 'ic'}, + MkdnTableNewColBefore = {'n', 'iC'}, + MkdnFoldSection = {'n', 'f'}, + MkdnUnfoldSection = {'n', 'F'} + } + } +} diff --git a/.config/nvim/after/available/neogen.rc.lua b/.config/nvim/lua/plugins/neogen.lua similarity index 88% rename from .config/nvim/after/available/neogen.rc.lua rename to .config/nvim/lua/plugins/neogen.lua index 1bed6e1..c4d3b04 100644 --- a/.config/nvim/after/available/neogen.rc.lua +++ b/.config/nvim/lua/plugins/neogen.lua @@ -1,8 +1,9 @@ -require("neogen").setup({ - --snippet_engine = 'ultisnips', - input_after_comment = true, -}) - +return { + 'danymat/neogen', + opts = { + --snippet_engine = 'ultisnips', + input_after_comment = true, + } -- { -- { nil, "///!", { no_results = true, type = { "func", "file", "class" } } }, -- { nil, "///! @file", { no_results = true, type = { "file" } } }, @@ -20,3 +21,4 @@ require("neogen").setup({ -- { i.Return, " * @return $1" }, -- { nil, " */", { type = { "func", "class", "type" } } }, -- } +} diff --git a/.config/nvim/lua/plugins/nvim-cmp.lua b/.config/nvim/lua/plugins/nvim-cmp.lua new file mode 100644 index 0000000..0c89f89 --- /dev/null +++ b/.config/nvim/lua/plugins/nvim-cmp.lua @@ -0,0 +1,82 @@ +return { + 'hrsh7th/nvim-cmp', + dependencies = { + 'mstanciu552/cmp-matlab', + 'petertriho/cmp-git', + 'hrsh7th/cmp-buffer', + 'hrsh7th/cmp-cmdline', + 'hrsh7th/cmp-nvim-lsp', + 'hrsh7th/cmp-path', + }, + event = "InsertEnter", + config = function() + local cmp = require'cmp' + + cmp.setup({ + snippet = { + expand = function(args) + require('snippy').expand_snippet(args.body) + end, + }, + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + }, + mapping = cmp.mapping.preset.insert({ + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping.complete(), + [''] = cmp.mapping.abort(), + [''] = cmp.mapping.confirm({ select = false }), + }), + sources = cmp.config.sources({ + { name = 'nvim_lsp' }, + { name = 'path' }, + { name = 'snippy' }, + { name = 'calc' }, + { name = 'cmp_matlab' }, + { name = 'cmp_git' }, + }, { + { name = 'buffer', keyword_length = 5, max_item_count = 10, priority = -5 }, + }), + sorting = { + comparators = { + cmp.config.compare.offset, + cmp.config.compare.exact, + cmp.config.compare.recently_used, + require("clangd_extensions.cmp_scores"), + cmp.config.compare.kind, + cmp.config.compare.sort_text, + cmp.config.compare.length, + cmp.config.compare.order, + }, + }, + }) + + cmp.setup.cmdline({'/', '?'}, { + mapping = cmp.mapping.preset.cmdline(), + sources = { + { name = 'buffer' } + } + }) + + cmp.setup.cmdline(':', { + mapping = cmp.mapping.preset.cmdline(), + sources = cmp.config.sources({ + { name = 'path' } + }, { + { name = 'cmdline' } + }) + }) + + cmp.setup.filetype('gitcommit', { + sources = cmp.config.sources({ + {name = 'cmp_git' }, + }, { + {name = 'buffer' } + }) + }) + + require("cmp_git").setup() + end +} diff --git a/.config/nvim/lua/plugins/nvim-tree.lua b/.config/nvim/lua/plugins/nvim-tree.lua new file mode 100644 index 0000000..151d2de --- /dev/null +++ b/.config/nvim/lua/plugins/nvim-tree.lua @@ -0,0 +1,134 @@ +return { + 'kyazdani42/nvim-tree.lua', + dependencies = { + 'kyazdani42/nvim-web-devicons', + }, + config = function() + vim.g.nvim_tree_refresh_wait = 1000 + + -- following options are the default + -- each of these are documented in `:help nvim-tree.OPTION_NAME` + require'nvim-tree'.setup { + disable_netrw = true, + hijack_netrw = true, + ignore_ft_on_setup = {}, + open_on_tab = false, + hijack_cursor = true, + update_cwd = false, + create_in_closed_folder = false, + hijack_unnamed_buffer_when_opening = true, + sync_root_with_cwd = true, + reload_on_bufenter = true, + respect_buf_cwd = false, + hijack_directories = { + enable = true, + auto_open = true, + }, + diagnostics = { + enable = false, + icons = { + hint = "", + info = "", + warning = "", + error = "", + } + }, + update_focused_file = { + enable = true, + update_cwd = false, + ignore_list = {} + }, + system_open = { + cmd = nil, + args = {} + }, + filters = { + dotfiles = false, + custom = {} + }, + git = { + enable = true, + ignore = false, + timeout = 500, + }, + view = { + width = 35, + hide_root_folder = true, + side = 'left', + mappings = { + custom_only = false, + list = {} + }, + number = false, + relativenumber = false, + signcolumn = "no" + }, + trash = { + cmd = "trash", + require_confirm = true + }, + actions = { + open_file = { + quit_on_open = false, + window_picker = { + exclude = { + filetype = { "notify", "packer", "qf" }, + buftype = { "terminal" }, + }, + }, + }, + change_dir = { + global = true, + }, + }, + renderer = { + indent_markers = { + enable = true -- this option shows indent markers when folders are open + }, + icons = { + show = { + git = true, + folder = true, + file = true, + folder_arrow = false, + }, + glyphs = { + default = '', + symlink = '', + git = { + unstaged = "✗", + staged = "✓", + unmerged = "", + renamed = "➜", + untracked = "★", + deleted = "", + ignored = "◌" + }, + folder = { + arrow_open = "", + arrow_closed = "", + default = "", + open = "", + empty = "", + empty_open = "", + symlink = "", + symlink_open = "", + } + }, + padding = ' ', + symlink_arrow = ' -> ', + }, + group_empty = true, + add_trailing = true, + highlight_git = true, + highlight_opened_files = 'icon', + root_folder_modifier = ':~', + special_files = { + 'README.md', + 'Makefile', + 'MAKEFILE' + }, + }, + } + end +} diff --git a/.config/nvim/lua/plugins/peek.lua b/.config/nvim/lua/plugins/peek.lua new file mode 100644 index 0000000..638b4f5 --- /dev/null +++ b/.config/nvim/lua/plugins/peek.lua @@ -0,0 +1,42 @@ +return { + 'toppair/peek.nvim', + build = 'deno task --quiet build:fast', + config = function() + -- default config: + require('peek').setup({ + app = 'browser', -- open in a local browser. not deno + + auto_load = true, -- whether to automatically load preview when + -- entering another markdown buffer + close_on_bdelete = true, -- close preview window on buffer delete + + syntax = true, -- enable syntax highlighting, affects performance + + theme = 'dark', -- 'dark' or 'light' + + update_on_change = true, + + -- relevant if update_on_change is true + throttle_at = 200000, -- start throttling when file exceeds this + -- amount of bytes in size + throttle_time = 'auto', -- minimum amount of time in milliseconds + -- that has to pass before starting new render + }) + + local peek = require('peek') + + vim.api.nvim_create_user_command('PeekOpen', function() + if not peek.is_open() and vim.bo[vim.api.nvim_get_current_buf()].filetype == 'markdown' then + --vim.fn.system('i3-msg split horizontal') + peek.open() + end + end, {}) + + vim.api.nvim_create_user_command('PeekClose', function() + if peek.is_open() then + peek.close() + --vim.fn.system('i3-msg move left') + end + end, {}) + end +} diff --git a/.config/nvim/lua/plugins/quicknote.lua b/.config/nvim/lua/plugins/quicknote.lua new file mode 100644 index 0000000..9c1d73d --- /dev/null +++ b/.config/nvim/lua/plugins/quicknote.lua @@ -0,0 +1,7 @@ +return { + 'RutaTang/quicknote.nvim', + dependencies= { + 'nvim-lua/plenary.nvim' + }, + config = true +} diff --git a/.config/nvim/lua/plugins/snippets.lua b/.config/nvim/lua/plugins/snippets.lua new file mode 100644 index 0000000..ea1e695 --- /dev/null +++ b/.config/nvim/lua/plugins/snippets.lua @@ -0,0 +1,21 @@ +return { + 'dcampos/nvim-snippy', + dependencies = { + 'dcampos/cmp-snippy', + 'honza/vim-snippets', + }, + event = "InsertEnter", + config = function() + require('snippy').setup({ + mappings = { + is = { + [''] = 'expand_or_advance', + [''] = 'previous', + }, + nx = { + ['x'] = 'cut_text', + }, + }, + }) +end +} diff --git a/.config/nvim/lua/plugins/swap.lua b/.config/nvim/lua/plugins/swap.lua new file mode 100644 index 0000000..0135f66 --- /dev/null +++ b/.config/nvim/lua/plugins/swap.lua @@ -0,0 +1,4 @@ +return { + 'Wansmer/sibling-swap.nvim', + config = true +} diff --git a/.config/nvim/lua/plugins/symbols-outline.lua b/.config/nvim/lua/plugins/symbols-outline.lua new file mode 100644 index 0000000..50208d7 --- /dev/null +++ b/.config/nvim/lua/plugins/symbols-outline.lua @@ -0,0 +1,4 @@ +return { + 'simrat39/symbols-outline.nvim', + config = true +} diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua new file mode 100644 index 0000000..77ba81d --- /dev/null +++ b/.config/nvim/lua/plugins/telescope.lua @@ -0,0 +1,11 @@ +return { + 'nvim-telescope/telescope.nvim', + dependencies = { + 'debugloop/telescope-undo.nvim', + }, + --cmd = ":Telescope", + config = function() + -- require('telescope').load_extension('ultisnips') + require('telescope').load_extension('undo') + end +} diff --git a/.config/nvim/lua/plugins/treesitter.lua b/.config/nvim/lua/plugins/treesitter.lua new file mode 100644 index 0000000..bbff4d8 --- /dev/null +++ b/.config/nvim/lua/plugins/treesitter.lua @@ -0,0 +1,95 @@ +return { + 'nvim-treesitter/nvim-treesitter', + dependencies = { + 'mizlan/iswap.nvim', + 'romgrk/nvim-treesitter-context', + --"nvim-treesitter/nvim-treesitter-textobjects", + --"nvim-treesitter/playground", + }, + build = ':TSUpdate', + config = function() + -- Tree-sitter configuration + + ts = require'nvim-treesitter.configs' + + ts.setup { + highlight = { + enable = true, + additional_vim_regex_highlighting = false, + }, + ensure_installed = { + "arduino", + "awk", + "bash", + "bibtex", + "c", + "cmake", + "comment", + "cpp", + "devicetree", + "diff", + "fish", + "gitattributes", + "gitcommit", + "gitignore", + "help", + "http", + "ini", + "jq", + "json", + "latex", + "lua", + "make", + "markdown", + "markdown_inline", + "ninja", + "proto", + "python", + "regex", + "rust", + "toml", + "vim", + "yaml", + }, + -- disabled, since it mostly shifts to four characters + --indent = { + -- enable = true, + --}, + incremental_selection = { + enable = true, + keymaps = { + init_selection = "ti", + node_incremental = "ti", + scope_incremental = "ts", + node_decremental = "td", + }, + }, + rainbow = { + enable = true, + -- disable = { "jsx", "cpp" }, list of languages you want to disable the plugin for + extended_mode = true, -- Also highlight non-bracket delimiters like html tags, boolean or table: lang -> boolean + max_file_lines = 5000, -- Do not enable for files with more than n lines, int + -- colors = {}, -- table of hex strings + -- termcolors = {} -- table of colour name strings + }, + --textobjects = { + -- swap = { + -- enable = true, + -- swap_next = { + -- ["tan"] = "@parameter.inner", + -- }, + -- swap_previous = { + -- ["tap"] = "@parameter.inner", + -- }, + -- }, + --}, + matchup = { + enable = true, + -- disable = { "c", "ruby" }, + include_match_words + }, + } + vim.opt.foldmethod = "expr" + vim.opt.foldexpr = "nvim_treesitter#foldexpr()" + end +} diff --git a/.config/nvim/lua/plugins/ufo.lua b/.config/nvim/lua/plugins/ufo.lua new file mode 100644 index 0000000..73e2ce7 --- /dev/null +++ b/.config/nvim/lua/plugins/ufo.lua @@ -0,0 +1,18 @@ +return { + 'kevinhwang91/nvim-ufo', + dependencies = { + 'kevinhwang91/promise-async', + }, + config = function() + vim.wo.foldcolumn = '1' + vim.wo.foldlevel = 99 -- feel free to decrease the value + vim.wo.foldenable = true + + -- tell the sever the capability of foldingRange + local capabilities = vim.lsp.protocol.make_client_capabilities() + capabilities.textDocument.foldingRange = { + dynamicRegistration = false, + lineFoldingOnly = true + } + end +} diff --git a/.config/nvim/lua/plugins/vim-cmake.lua b/.config/nvim/lua/plugins/vim-cmake.lua new file mode 100644 index 0000000..c468c6c --- /dev/null +++ b/.config/nvim/lua/plugins/vim-cmake.lua @@ -0,0 +1,33 @@ +return { + 'Civitasv/cmake-tools.nvim', + config = function() + --let g:cmake_build_options = [ "-j10" ] + -- + --let g:cmake_root_markers = ['.svn'] + -- + -- + --let g:cmake_jump_on_error = 0 " We do not want to focus the console + --augroup vim-cmake-group + --autocmd User CMakeBuildFailed :cfirst + --augroup END + -- + --augroup vim-cmake-group + --autocmd! User CMakeBuildSucceeded CMakeClose + --augroup END + + require("cmake-tools").setup { + cmake_command = "cmake", + cmake_build_directory = "build", + cmake_generate_options = { "-D", "CMAKE_EXPORT_COMPILE_COMMANDS=1" }, + cmake_build_options = {}, + cmake_console_size = 10, -- cmake output window height + cmake_show_console = "always", -- "always", "only_on_error" + cmake_dap_configuration = { name = "cpp", type = "codelldb", request = "launch" }, -- dap configuration, optional + --cmake_dap_open_command = require("dap").repl.open, -- optional + cmake_variants_message = { + short = { show = true }, + long = { show = true, max_length = 40 } + } + } + end +} diff --git a/.config/nvim/lua/plugins/virt-column.lua b/.config/nvim/lua/plugins/virt-column.lua new file mode 100644 index 0000000..41f15a1 --- /dev/null +++ b/.config/nvim/lua/plugins/virt-column.lua @@ -0,0 +1,4 @@ +return { + 'lukas-reineke/virt-column.nvim', + config = true +} diff --git a/.config/nvim/lua/plugins/which.lua b/.config/nvim/lua/plugins/which.lua new file mode 100644 index 0000000..e54f7d5 --- /dev/null +++ b/.config/nvim/lua/plugins/which.lua @@ -0,0 +1,4 @@ +return { + 'folke/which-key.nvim', + config = true +} diff --git a/.config/nvim/lua/plugins/windows.lua b/.config/nvim/lua/plugins/windows.lua new file mode 100644 index 0000000..ef4c5e6 --- /dev/null +++ b/.config/nvim/lua/plugins/windows.lua @@ -0,0 +1,12 @@ +return { + 'anuvyklack/windows.nvim', + dependencies = { + 'anuvyklack/middleclass', + 'anuvyklack/animation.nvim' + }, + config = function() + vim.o.winwidth = 10 + vim.o.winminwidth = 10 + require("windows").setup() + end +}