diff options
| author | Ariel D'Alessandro <dalessandro.ariel@gmail.com> | 2023-01-17 23:53:34 +0100 |
|---|---|---|
| committer | Ariel D'Alessandro <dalessandro.ariel@gmail.com> | 2023-01-18 09:03:37 +0100 |
| commit | a04f9cd914055244f29e9ff17aa7a723f5db2405 (patch) | |
| tree | 703edf280638e30fe77dd46a60a2e5442e8fd33a /after/plugin | |
| parent | ec9655746b21d5ffb01caf502cf9047f83fc3753 (diff) | |
| download | nvim-conf-a04f9cd914055244f29e9ff17aa7a723f5db2405.tar.gz nvim-conf-a04f9cd914055244f29e9ff17aa7a723f5db2405.zip | |
feat: migration to lazy
Diffstat (limited to 'after/plugin')
| -rw-r--r-- | after/plugin/dressing.lua | 161 | ||||
| -rw-r--r-- | after/plugin/gitsigns.lua | 16 | ||||
| -rw-r--r-- | after/plugin/luasnip.lua | 129 | ||||
| -rw-r--r-- | after/plugin/neotest.lua | 52 | ||||
| -rw-r--r-- | after/plugin/refactoring.lua | 6 | ||||
| -rw-r--r-- | after/plugin/transparent.lua | 20 | ||||
| -rw-r--r-- | after/plugin/treesitter.lua | 64 |
7 files changed, 0 insertions, 448 deletions
diff --git a/after/plugin/dressing.lua b/after/plugin/dressing.lua deleted file mode 100644 index d41a8d1..0000000 --- a/after/plugin/dressing.lua +++ /dev/null @@ -1,161 +0,0 @@ -local ok, dressing = pcall(require, "dressing") -if not ok then - return -end - -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, <Esc> 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 }, - win_options = { - -- Window transparency (0-100) - winblend = 10, - -- Disable line wrapping - wrap = false, - }, - - -- Set to `false` to disable - mappings = { - n = { - ["<Esc>"] = "Close", - ["<CR>"] = "Confirm", - }, - i = { - ["<C-c>"] = "Close", - ["<CR>"] = "Confirm", - ["<Up>"] = "HistoryPrev", - ["<Down>"] = "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", - - 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 = { - ["<Esc>"] = "Close", - ["<C-c>"] = "Close", - ["<CR>"] = "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/after/plugin/gitsigns.lua b/after/plugin/gitsigns.lua deleted file mode 100644 index 268267b..0000000 --- a/after/plugin/gitsigns.lua +++ /dev/null @@ -1,16 +0,0 @@ -local ok, gitsigns = pcall(require, "gitsigns") -if not ok then - return -end - -gitsigns.setup({ - on_attach = function (bufnr) - vim.keymap.set('n', '<leader>hs', gitsigns.stage_hunk, {buffer = bufnr} ) - vim.keymap.set('n', '<leader>hu', gitsigns.undo_stage_hunk, {buffer = bufnr} ) - vim.keymap.set('n', '<leader>hr', gitsigns.reset_hunk, {buffer = bufnr} ) - vim.keymap.set('n', '<leader>hp', gitsigns.preview_hunk, {buffer = bufnr} ) - vim.keymap.set('n', '<leader>hj', gitsigns.next_hunk, {buffer = bufnr} ) - vim.keymap.set('n', '<leader>hk', gitsigns.prev_hunk, {buffer = bufnr} ) - end, - max_file_length = 10000, -}) diff --git a/after/plugin/luasnip.lua b/after/plugin/luasnip.lua deleted file mode 100644 index 8538b8e..0000000 --- a/after/plugin/luasnip.lua +++ /dev/null @@ -1,129 +0,0 @@ -if vim.g.snippets ~= "luasnip" then - return -end - -local ls = require("luasnip") -local types = require("luasnip.util.types") - -ls.config.set_config({ - -- This tells LuaSnip to remember to keep around the last snippet. - -- You can jump back into even if you move outside of the selection - history = true, - - -- This one is cool cause if you have dynamic snippets, it updatesas you type! - updateevents = "TextChanged,TextChangedI", - - -- Autosnippets: - enable_autosnippets = true, - - ext_opts = { - [types.choiceNode] = { - active = { - virt_text = { { "<- Choice", "Error" } }, - }, - }, - }, -}) - --- create snippet --- s(context, nodes, condition, ...) -local snippet = ls.s - --- TODO: Write about this. --- Useful for dynamic nodes and choice nodes --- local snippet_from_nodes = ls.sn - --- This is the simplest node. --- Creates a new text node. Places cursor after node by default. --- t { "this will be inserted" } --- --- Multiple lines are by passing a table of strings. --- t { "line 1", "line 2" } -local t = ls.text_node - --- Insert Node --- Creates a location for the cursor to jump to. --- Possible options to jump to are 1 - N --- If you use 0, that's the final place to jump to. --- --- To create placeholder text, pass it as the second argument --- i(2, "this is placeholder text") -local i = ls.insert_node - --- Function Node --- Takes a function that returns text --- local f = ls.function_node - --- This a choice snippet. You can move through with <c-l> (in my config) --- c(1, { t {"hello"}, t {"world"}, }), --- --- The first argument is the jump position --- The second argument is a table of possible nodes. --- Note, one thing that's nice is you don't have to include --- the jump position for nodes that normally require one (can be nil) --- local c = ls.choice_node - --- local d = ls.dynamic_node - --- TODO: Document what I've learned about lambda --- local l = require("luasnip.extras").lambda - --- local events = require("luasnip.util.events") - -local shortcut = function(val) - if type(val) == "string" then - return { t({ val }), i(0) } - end - - if type(val) == "table" then - for k, v in ipairs(val) do - if type(v) == "string" then - val[k] = t({ v }) - end - end - end - - return val -end - -local make = function(tbl) - local result = {} - for k, v in pairs(tbl) do - table.insert(result, (snippet({ trig = k, desc = v.desc }, shortcut(v)))) - end - - return result -end - -ls.cleanup() -for _, ft_path in ipairs(vim.api.nvim_get_runtime_file("lua/alpha/snips/ft/*.lua", true)) do - local ft = vim.fn.fnamemodify(ft_path, ":t:r") - ls.add_snippets(ft, make(loadfile(ft_path)())) -end - --- <c-k> is my expansion key --- this will expand the current item or jump to the next item within the snippet. -vim.keymap.set({ "i", "s" }, "<c-k>", function() - if ls.expand_or_jumpable() then - ls.expand_or_jump() - end -end, { silent = true }) - --- <c-j> is my jump backwards key. --- this always moves to the previous item within the snippet -vim.keymap.set({ "i", "s" }, "<c-j>", function() - if ls.jumpable(-1) then - ls.jump(-1) - end -end, { silent = true }) - --- <c-l> is selecting within a list of options. --- This is useful for choice nodes (introduced in the forthcoming episode 2) -vim.keymap.set("i", "<c-l>", function() - if ls.choice_active() then - ls.change_choice(1) - end -end) - --- shorcut to source my luasnips file again, which will reload my snippets -vim.keymap.set("n", "<leader><leader>s", "<cmd>source ~/.config/nvim/after/plugin/luasnip.lua<CR>") diff --git a/after/plugin/neotest.lua b/after/plugin/neotest.lua deleted file mode 100644 index a18016e..0000000 --- a/after/plugin/neotest.lua +++ /dev/null @@ -1,52 +0,0 @@ -local ok, neotest = pcall(require, "neotest") -if not ok then - return -end - -neotest.setup({ - adapters = { - require("neotest-go"), - require("neotest-rust"), - require("neotest-plenary"), - require("neotest-vim-test")({ - ignore_file_types = { "go", "lua", "rust", "php" }, - }), - require("laravel.neotest"), - }, -}) - -local hydra = require("hydra") - -local hint = [[ - NeoTest - _n_: Near test _f_: Current file _l_: Last Test _m_: Run Marked _s_: Toggle Summary ^ - ^ ^ _<Esc>_ -]] - -hydra({ - name = "neotest", - hint = hint, - mode = "n", - config = { - color = "teal", - invoke_on_body = true, - hint = { - border = "rounded", - position = "bottom", - }, - }, - body = "<C-t>", - heads = { - { "n", neotest.run.run }, - { - "f", - function() - neotest.run.run(vim.fn.expand("%")) - end, - }, - { "l", neotest.run.run_last }, - { "m", neotest.summary.run_marked }, - { "s", neotest.summary.toggle }, - { "<Esc>", nil, { exit = true } }, - }, -}) diff --git a/after/plugin/refactoring.lua b/after/plugin/refactoring.lua deleted file mode 100644 index ff45c89..0000000 --- a/after/plugin/refactoring.lua +++ /dev/null @@ -1,6 +0,0 @@ -local ok, refactoring = pcall(require, "refactoring") -if not ok then - return -end - -refactoring.setup({}) diff --git a/after/plugin/transparent.lua b/after/plugin/transparent.lua deleted file mode 100644 index 1548dd2..0000000 --- a/after/plugin/transparent.lua +++ /dev/null @@ -1,20 +0,0 @@ -local ok, transparent = pcall(require, "transparent") -if not ok then - return -end - -transparent.setup({ - enable = true, -- boolean: enable transparent - extra_groups = { -- table/string: additional groups that should be cleared - -- In particular, when you set it to 'all', that means all available groups - - -- example of akinsho/nvim-bufferline.lua - "BufferLineTabClose", - "BufferlineBufferSelected", - "BufferLineFill", - "BufferLineBackground", - "BufferLineSeparator", - "BufferLineIndicatorSelected", - }, - exclude = {}, -- table: groups you don't want to clear -}) diff --git a/after/plugin/treesitter.lua b/after/plugin/treesitter.lua deleted file mode 100644 index 69791bd..0000000 --- a/after/plugin/treesitter.lua +++ /dev/null @@ -1,64 +0,0 @@ -if not pcall(require, "nvim-treesitter") then - return -end - -require "nvim-treesitter.configs".setup { - ensure_installed = {"php", "phpdoc", "vim", "go", "gomod", "css", "html", "javascript", "lua", "typescript"}, - highlight = { - enable = true, - additional_vim_regex_highlighting = false, - }, - indent = { - enable = true, - }, - incremental_selection = { - enable = true, - keymaps = { - init_selection = "gnn", - node_incremental = "grn", - scope_incremental = "grc", - node_decremental = "grm", - }, - }, - refactor = { - highlight_definitions = { enable = true }, - smart_rename = { - enable = true, - keymaps = { - smart_rename = "trr", - }, - }, - }, - textobjects = { - select = { - enable = true, - lookahead = true, - keymaps = { - ["af"] = "@function.outer", - ["if"] = "@function.inner", - ["ac"] = "@conditional.outer", - ["ic"] = "@conditional.inner", - ["al"] = "@loop.outer", - ["il"] = "@loop.inner", - } - } - }, - playground = { - enable = true, - disable = {}, - updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code - persist_queries = false, -- Whether the query persists across vim sessions - keybindings = { - toggle_query_editor = 'o', - toggle_hl_groups = 'i', - toggle_injected_languages = 't', - toggle_anonymous_nodes = 'a', - toggle_language_display = 'I', - focus_language = 'f', - unfocus_language = 'F', - update = 'R', - goto_node = '<cr>', - show_help = '?', - }, - } -} |