feat(nvim): combined and removed plugins

This commit is contained in:
2023-09-02 13:35:10 +03:00
parent 8eb0d2bcab
commit 4de181e3b2
27 changed files with 188 additions and 336 deletions

View File

@@ -46,7 +46,7 @@ wk.register({
},
},
g = {
name = "Goto buffer",
name = "[g]oto buffer",
["1"] = { "<cmd>buffer! 1<cr>", "Buffer 1" },
["2"] = { "<cmd>buffer! 2<cr>", "Buffer 2" },
["3"] = { "<cmd>buffer! 3<cr>", "Buffer 3" },
@@ -67,9 +67,7 @@ wk.register({
p = { ":lua vim.diagnostic.goto_prev()<CR>", "[D]iagnostics: [p]rev" },
},
e = {
function()
vim.cmd("Neotree focus source=filesystem position=left")
end,
function() vim.cmd("Neotree focus source=filesystem position=left") end,
"Toggle the sidebar tree of the root folder.",
},
f = {
@@ -79,6 +77,13 @@ wk.register({
-- Find recursively a text across the root folder subfiles.
g = { ':lua require("telescope.builtin").live_grep()<cr>', "[f]ind text with [g]rep" },
},
G = {
-- defined in plugins/gitsigns.lua
name = "Git",
b = {
name = "blame",
},
},
h = {
name = "[h]arpoon",
a = { "<cmd>lua require('harpoon.mark').add_file()<cr>", "[h]arpoon: [A]dd file" },
@@ -92,7 +97,7 @@ wk.register({
},
--- Remap debugging to "H" from LV default of "h"
H = {
name = "[H]elp/Conceal/Telescope",
name = "[H]elp/Conceal/Treesitter",
c = {
name = "[c]onceal",
h = { ":set conceallevel=1<cr>", "hide/conceal" },
@@ -118,6 +123,10 @@ wk.register({
q = { ":qa<cr>", "[q]uit: [q]uit all" },
f = { ":qa!<cr>", "[q]uit: all with [f]orce" },
},
r = {
-- defined in plugins/refactoring-nvim.lua
name = "[r]efactor",
},
t = {
name = "[t]elescope",
-- Find recursively TODOs, NOTEs, FIXITs, ... across the root folder subfiles.

View File

@@ -103,7 +103,7 @@ vim.o.spelllang = "en_gb"
vim.bo.spelllang = "en_gb"
-- Global statusline.
vim.opt.laststatus = 3
vim.opt.laststatus = 2
-- When "on" the commands listed below move the cursor to the first non-blank
-- of the line. When off the cursor is kept in the same column (if possible).
@@ -132,7 +132,7 @@ set("MRU_File", "~/.cache/vim_mru_files")
--------------------API------------------------
-- Change title accordingly.
-- option('title', true)
option("title", true)
-- Set clipboard to be global across the system
option("clipboard", "unnamedplus")
@@ -147,7 +147,4 @@ option("dictionary", "/usr/share/dict/words")
option("wildignore", "*/tmp*/,*/node_modules/*,_site,*/__pycache__/,*/venv/*,*/target/*,*/.vim$,~$,*/.log")
-- Folding
option("foldmethod", "syntax")
-- File format for neovim reading
option("fileformat", "unix")
option("foldmethod", "indent")

View File

@@ -1 +0,0 @@
return { "kazhala/close-buffers.nvim" }

View File

@@ -1,4 +0,0 @@
return {
"LudoPinelli/comment-box.nvim",
opts = {},
}

View File

@@ -1,29 +0,0 @@
return {
"anuvyklack/fold-preview.nvim",
dependencies = { "anuvyklack/keymap-amend.nvim", "ray-x/lsp_signature.nvim" },
config = function()
local fp = require("fold-preview")
local map = require("fold-preview").mapping
local keymap = vim.keymap
keymap.amend = require("keymap-amend")
fp.setup({
default_keybindings = false,
-- another settings
})
keymap.amend("n", "K", function(original)
if not fp.show_preview() then original() end
-- or
-- if not fp.toggle_preview() then original() end
-- to close preview on second press on K.
end)
keymap.amend("n", "h", map.close_preview_open_fold)
keymap.amend("n", "l", map.close_preview_open_fold)
keymap.amend("n", "zo", map.close_preview)
keymap.amend("n", "zO", map.close_preview)
keymap.amend("n", "zc", map.close_preview_without_defer)
keymap.amend("n", "zR", map.close_preview)
keymap.amend("n", "zM", map.close_preview_without_defer)
end,
}

View File

@@ -37,19 +37,19 @@ return {
end, { expr = true })
-- Actions
map("n", "<leader>hs", gs.stage_hunk, { desc = "Stage Hunk" })
map("n", "<leader>hr", gs.reset_hunk, { desc = "Reset Hunk" })
map("v", "<leader>hs", function() gs.stage_hunk({ vim.fn.line("."), vim.fn.line("v") }) end)
map("v", "<leader>hr", function() gs.reset_hunk({ vim.fn.line("."), vim.fn.line("v") }) end)
map("n", "<leader>hS", gs.stage_buffer, { desc = "Stage Buffer" })
map("n", "<leader>hu", gs.undo_stage_hunk, { desc = "Undo Stage Hunk" })
map("n", "<leader>hR", gs.reset_buffer, { desc = "Reset Buffer" })
map("n", "<leader>hp", gs.preview_hunk, { desc = "Preview Hunk" })
map("n", "<leader>hb", function() gs.blame_line({ full = true }) end, { desc = "Blame Line" })
map("n", "<leader>tb", gs.toggle_current_line_blame, { desc = "Toggle Current Line Blame" })
map("n", "<leader>hd", gs.diffthis, { desc = "Diff This" })
map("n", "<leader>hD", function() gs.diffthis("~") end)
map("n", "<leader>td", gs.toggle_deleted, { desc = "Toggle Deleted" })
map("n", "<leader>Ghs", gs.stage_hunk, { desc = "Stage Hunk" })
map("n", "<leader>Ghr", gs.reset_hunk, { desc = "Reset Hunk" })
map("v", "<leader>Ghs", function() gs.stage_hunk({ vim.fn.line("."), vim.fn.line("v") }) end)
map("v", "<leader>Ghr", function() gs.reset_hunk({ vim.fn.line("."), vim.fn.line("v") }) end)
map("n", "<leader>GhS", gs.stage_buffer, { desc = "Stage Buffer" })
map("n", "<leader>Ghu", gs.undo_stage_hunk, { desc = "Undo Stage Hunk" })
map("n", "<leader>GhR", gs.reset_buffer, { desc = "Reset Buffer" })
map("n", "<leader>Ghp", gs.preview_hunk, { desc = "Preview Hunk" })
map("n", "<leader>Gbl", function() gs.blame_line({ full = true }) end, { desc = "Blame Line" })
map("n", "<leader>Gbt", gs.toggle_current_line_blame, { desc = "Toggle Current Line Blame" })
map("n", "<leader>Ghd", gs.diffthis, { desc = "Diff This" })
map("n", "<leader>GhD", function() gs.diffthis("~") end)
map("n", "<leader>Gtd", gs.toggle_deleted, { desc = "Toggle Deleted" })
-- Text object
map({ "o", "x" }, "ih", ":<C-U>Gitsigns select_hunk<CR>")

View File

@@ -1 +0,0 @@
return { "ThePrimeagen/harpoon" }

View File

@@ -1,70 +0,0 @@
-- Floating statuslines for Neovim
-- https://github.com/b0o/incline.nvim
--
-- Lightweight floating statuslines, best used with
-- Neovim's global statusline (set laststatus=3).
return {
"b0o/incline.nvim",
config = {
debounce_threshold = {
falling = 50,
rising = 0,
},
hide = {
cursorline = true,
focused_win = false,
only_win = true,
},
highlight = {
groups = {
InclineNormal = {
default = true,
group = "NormalFloat",
},
InclineNormalNC = {
default = true,
group = "NormalFloat",
},
},
},
ignore = {
buftypes = "special",
filetypes = {},
floating_wins = true,
unlisted_buffers = true,
wintypes = "special",
},
render = "basic",
window = {
margin = {
horizontal = 1,
vertical = 1,
},
options = {
signcolumn = "no",
wrap = false,
},
padding = 1,
padding_char = " ",
placement = {
horizontal = "right",
vertical = "top",
},
width = "fit",
winhighlight = {
active = {
EndOfBuffer = "None",
Normal = "InclineNormal",
Search = "None",
},
inactive = {
EndOfBuffer = "None",
Normal = "InclineNormalNC",
Search = "None",
},
},
zindex = 10,
},
},
}

View File

@@ -1,16 +1,47 @@
return {
--
-- Menu
--
-- Plenary is used by many other plugins
{ "nvim-lua/plenary.nvim", lazy = true },
-- Icons on menu
"onsails/lspkind-nvim",
-- Restore folds and cursor position
"senderle/restoreview",
--
-- Appearance
--
-- Create key bindings that stick. WhichKey is a lua plugin for Neovim that
-- displays a popup with possible keybindings of the command you started typing.
-- https://github.com/folke/which-key.nvim
{
"folke/which-key.nvim",
enabled = true,
lazy = false,
init = function()
vim.o.timeout = true
vim.o.timeoutlen = 300
end,
opts = {
plugins = { spelling = true, marks = true, registers = true },
},
},
-- Neovim plugin to improve the default vim.ui interfaces
-- https://github.com/stevearc/dressing.nvim
{
"stevearc/dressing.nvim",
lazy = true,
init = function()
---@diagnostic disable-next-line: duplicate-set-field
vim.ui.select = function(...)
require("lazy").load({ plugins = { "dressing.nvim" } })
return vim.ui.select(...)
end
---@diagnostic disable-next-line: duplicate-set-field
vim.ui.input = function(...)
require("lazy").load({ plugins = { "dressing.nvim" } })
return vim.ui.input(...)
end
end,
},
-- The theme of choise, catppuccin
---- https://github.com/catppuccin/nvim
@@ -20,9 +51,7 @@ return {
priority = 10000,
enabled = true,
lazy = false,
config = function()
vim.cmd.colorscheme("catppuccin")
end,
config = function() vim.cmd.colorscheme("catppuccin") end,
opts = {
flavour = "mocha",
transparent_background = true,
@@ -73,7 +102,7 @@ return {
symbols_outline = true,
telescope = {
enabled = true,
style = "catppuccin"
style = "catppuccin",
},
ts_rainbow = true,
treesitter = true,
@@ -83,7 +112,42 @@ return {
},
},
"rcarriga/nvim-notify",
-- Notifications as a popup
-- https://github.com/rcarriga/nvim-notify
{
"rcarriga/nvim-notify",
keys = {
{
"<leader>un",
function() require("notify").dismiss({ silent = true, pending = true }) end,
desc = "Dismiss all Notifications",
},
},
opts = {
timeout = 3000,
max_height = function() return math.floor(vim.o.lines * 0.75) end,
max_width = function() return math.floor(vim.o.columns * 0.75) end,
},
init = function() vim.notify = require("notify") end,
},
{
"dstein64/vim-startuptime",
cmd = "StartupTime",
config = function() vim.g.startuptime_tries = 10 end,
},
{ "ThePrimeagen/harpoon" },
-- A Neovim plugin hiding your colorcolumn when unneeded.
-- https://github.com/m4xshen/smartcolumn.nvim
{
"m4xshen/smartcolumn.nvim",
opts = {
colorcolumn = { "80", "100", "120" },
disabled_filetypes = { "help", "text", "markdown", "json", "lazy", "starter", "neo-tree" },
},
},
-- Status information for LSP.
"j-hui/fidget.nvim",
@@ -91,8 +155,55 @@ return {
-- Close buffer without messing up with the window.
"famiu/bufdelete.nvim",
-- Delete multiple vim buffers based on different conditions
-- https://github.com/kazhala/close-buffers.nvim
"kazhala/close-buffers.nvim",
"nyoom-engineering/oxocarbon.nvim",
-- JSONLS
"b0o/schemastore.nvim",
-- sleuth.vim: Heuristically set buffer options
-- https://github.com/tpope/vim-sleuth
"tpope/vim-sleuth",
-- Neovim plugin for locking a buffer to a window
-- https://github.com/stevearc/stickybuf.nvim
{ "stevearc/stickybuf.nvim", opts = {} },
-- Describe the regexp under the cursor
-- https://github.com/bennypowers/nvim-regexplainer
{
"bennypowers/nvim-regexplainer",
requires = {
"nvim-treesitter/nvim-treesitter",
"MunifTanjim/nui.nvim",
},
opts = {
-- automatically show the explainer when the cursor enters a regexp
auto = true,
},
},
-- Clarify and beautify your comments using boxes and lines.
-- https://github.com/LudoPinelli/comment-box.nvim
{ "LudoPinelli/comment-box.nvim", opts = {} },
{
"codota/tabnine-nvim",
name = "tabnine",
build = vim.loop.os_uname().sysname == "Windows_NT" and "pwsh.exe -file .\\dl_binaries.ps1" or "./dl_binaries.sh",
cmd = { "TabnineStatus", "TabnineDisable", "TabnineEnable", "TabnineToggle" },
event = "User",
opts = { accept_keymap = "<C-e>" },
},
-- Vim plugin for automatic time tracking and metrics generated from your programming activity.
-- https://github.com/wakatime/vim-wakatime
{
"wakatime/vim-wakatime",
lazy = false,
enabled = true,
},
}

View File

@@ -1,9 +1,20 @@
-- 🗺️ A legend for your keymaps, commands, and autocmds, with which-key.nvim integration
-- https://github.com/mrjones2014/legendary.nvim
return {
"mrjones2014/legendary.nvim",
version = "*",
-- since legendary.nvim handles all your keymaps/commands,
-- its recommended to load legendary.nvim before other plugins
priority = 10000,
lazy = false,
-- sqlite is only needed if you want to use frecency sorting
-- dependencies = { 'kkharji/sqlite.lua' }
opts = {
lazy_nvim = {
auto_register = true,
},
which_key = {
auto_register = true,
},
},
}

View File

@@ -1,36 +0,0 @@
-- Signs for built-in marks.
return {
"chentoast/marks.nvim",
config = {
-- whether to map keybinds or not. default true
default_mappings = true,
-- which builtin marks to show. default {}
builtin_marks = { ".", "<", ">", "^" },
-- whether movements cycle back to the beginning/end of buffer. default true
cyclic = true,
-- whether the shada file is updated after modifying uppercase marks. default false
force_write_shada = false,
-- how often (in ms) to redraw signs/recompute mark positions.
-- higher values will have better performance but may cause visual lag,
-- while lower values may cause performance penalties. default 150.
refresh_interval = 250,
-- sign priorities for each type of mark - builtin marks, uppercase marks, lowercase
-- marks, and bookmarks.
-- can be either a table with all/none of the keys, or a single number, in which case
-- the priority applies to all marks.
-- default 10.
sign_priority = { lower = 10, upper = 15, builtin = 8, bookmark = 20 },
-- disables mark tracking for specific filetypes. default {}
excluded_filetypes = {},
-- marks.nvim allows you to configure up to 10 bookmark groups, each with its own
-- sign/virttext. Bookmarks can be used to group together positions and quickly move
-- across multiple buffers. default sign is '!@#$%^&*()' (from 0 to 9), and
-- default virt_text is "".
bookmark_0 = {
sign = "",
virt_text = "hello world",
},
mappings = {},
},
}

View File

@@ -137,7 +137,8 @@ return {
folder_closed = "",
folder_open = "",
folder_empty = "-",
-- The next two settings are only a fallback, if you use nvim-web-devicons and configure default icons there
-- The next two settings are only a fallback,
-- if you use nvim-web-devicons and configure default icons there
-- then these will never be used.
default = "*",
highlight = "NeoTreeFileIcon",

View File

@@ -1,6 +1,9 @@
local prefix = "<leader>a"
-- A better annotation generator. Supports multiple languages and annotation conventions.
-- https://github.com/danymat/neogen
return {
"danymat/neogen",
dependencies = "nvim-treesitter/nvim-treesitter",
version = "*",
cmd = "Neogen",
opts = {
snippet_engine = "luasnip",
@@ -11,10 +14,10 @@ return {
},
},
keys = {
{ prefix .. "<cr>", function() require("neogen").generate({ type = "current" }) end, desc = "Current" },
{ prefix .. "c", function() require("neogen").generate({ type = "class" }) end, desc = "Class" },
{ prefix .. "f", function() require("neogen").generate({ type = "func" }) end, desc = "Function" },
{ prefix .. "t", function() require("neogen").generate({ type = "type" }) end, desc = "Type" },
{ prefix .. "F", function() require("neogen").generate({ type = "file" }) end, desc = "File" },
{ "<leader>aa", function() require("neogen").generate({ type = "current" }) end, desc = "Current" },
{ "<leader>ac", function() require("neogen").generate({ type = "class" }) end, desc = "Class" },
{ "<leader>af", function() require("neogen").generate({ type = "func" }) end, desc = "Function" },
{ "<leader>at", function() require("neogen").generate({ type = "type" }) end, desc = "Type" },
{ "<leader>aF", function() require("neogen").generate({ type = "file" }) end, desc = "File" },
},
}

View File

@@ -4,14 +4,15 @@ return {
dependencies = {
-- Automatically install LSPs to stdpath for neovim
{ "williamboman/mason.nvim", config = true },
"williamboman/mason-lspconfig.nvim",
{ "williamboman/mason-lspconfig.nvim" },
-- Useful status updates for LSP
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
{ "j-hui/fidget.nvim", tag = "legacy", opts = {} },
-- NOTE: using tag legacy, fidget is being re-written completely
{ "j-hui/fidget.nvim", event = "LspAttach", tag = "legacy", opts = {} },
-- Additional lua configuration, makes nvim stuff amazing!
"folke/neodev.nvim",
{ "folke/neodev.nvim" },
},
init = function()
-- disable lsp watcher. Too slow on linux

View File

@@ -1,9 +0,0 @@
return {
"chrisgrieser/nvim-origami",
event = "BufReadPost", -- later or on keypress would prevent saving folds
opts = {
keepFoldsAcrossSessions = true,
pauseFoldsOnSearch = true,
setupFoldKeymaps = true,
},
}

View File

@@ -1,5 +0,0 @@
return {
"bennypowers/nvim-regexplainer",
opts = {},
ft = { "html", "javascript", "javascriptreact", "typescript", "typescriptreact" },
}

View File

@@ -1,55 +0,0 @@
-- Fold code.
return {
"anuvyklack/pretty-fold.nvim",
config = {
fill_char = "",
sections = {
left = {
"content",
},
right = {
" ",
"number_of_folded_lines",
": ",
"percentage",
" ",
function(config) return config.fill_char:rep(3) end,
},
},
remove_fold_markers = false,
-- Keep the indentation of the content of the fold string.
keep_indentation = true,
-- Possible values:
-- "delete" : Delete all comment signs from the fold string.
-- "spaces" : Replace all comment signs with equal number of spaces.
-- false : Do nothing with comment signs.
process_comment_signs = "spaces",
-- Comment signs additional to the value of `&commentstring` option.
comment_signs = {
{ "/**", "*/" }, -- multiline comment
{ "<!--", "-->" }, -- multiline comment
{ "%--[[", "--]]" }, -- multiline comment
},
-- List of patterns that will be removed from content foldtext section.
stop_words = {
"@brief%s*", -- (for C++) Remove '@brief' and all spaces after.
},
add_close_pattern = true,
matchup_patterns = {
{ "{", "}" },
{ "%(", ")" }, -- % to escape lua pattern char
{ "%[", "]" }, -- % to escape lua pattern char
{ "if%s", "end" },
{ "do%s", "end" },
{ "for%s", "end" },
{ "function%s*%(", "end" }, -- 'function(' or 'function ('
},
},
}

View File

@@ -1,14 +0,0 @@
return {
{
"jay-babu/project.nvim",
name = "project_nvim",
event = "VeryLazy",
opts = { ignore_lsp = { "lua_ls" } },
},
{
"nvim-telescope/telescope.nvim",
optional = true,
dependencies = { "project_nvim" },
opts = function() require("telescope").load_extension("projects") end,
},
}

View File

@@ -1,6 +1,9 @@
return {
"ThePrimeagen/refactoring.nvim",
dependencies = { "nvim-lua/plenary.nvim", "nvim-treesitter/nvim-treesitter" },
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
},
cmd = { "Refactor" },
opts = {},
keys = {

View File

@@ -1,7 +0,0 @@
return {
"m4xshen/smartcolumn.nvim",
opts = {
colorcolumn = { "80", "100", "120" },
disabled_filetypes = { "help", "text", "markdown", "json", "lazy", "starter", "neo-tree" },
},
}

View File

@@ -1 +0,0 @@
return { "stevearc/stickybuf.nvim", opts = {} }

View File

@@ -1,8 +0,0 @@
return {
"codota/tabnine-nvim",
name = "tabnine",
build = vim.loop.os_uname().sysname == "Windows_NT" and "pwsh.exe -file .\\dl_binaries.ps1" or "./dl_binaries.sh",
cmd = { "TabnineStatus", "TabnineDisable", "TabnineEnable", "TabnineToggle" },
event = "User",
opts = { accept_keymap = "<C-e>" },
}

View File

@@ -2,8 +2,8 @@
return {
"nvim-telescope/telescope.nvim",
dependencies = {
"nvim-lua/popup.nvim",
"nvim-lua/plenary.nvim",
{ "nvim-lua/popup.nvim" },
{ "nvim-lua/plenary.nvim" },
-- Fuzzy Finder Algorithm which requires local dependencies to be built.
-- Only load if `make` is available. Make sure you have the system
-- requirements installed.
@@ -14,7 +14,7 @@ return {
build = "make",
cond = function() return vim.fn.executable("make") == 1 end,
},
"nvim-telescope/telescope-file-browser.nvim",
{ "nvim-telescope/telescope-file-browser.nvim" },
},
config = function()
local actions = require("telescope.actions")
@@ -82,9 +82,9 @@ return {
mappings = {
i = {
["<c-d>"] = actions.delete_buffer + actions.move_to_top,
}
}
}
},
},
},
},
extensions_list = { "themes", "terms" },

View File

@@ -1,23 +0,0 @@
-- Move faster between context.
return {
"andymass/vim-matchup",
dependencies = "nvim-treesitter/nvim-treesitter",
config = {
highlight = {
enable = true,
disable = {},
},
indent = {
enable = false,
disable = {},
},
autotag = {
enable = true,
},
matchup = {
enable = true, -- mandatory, false will disable the whole extension
--disable = { "c", "ruby" }, -- optional, list of language that will be disabled
},
},
}

View File

@@ -1 +0,0 @@
return { "tpope/vim-sleuth" }

View File

@@ -1,5 +0,0 @@
return {
"wakatime/vim-wakatime",
lazy = false,
enabled = true,
}

View File

@@ -1,15 +0,0 @@
local vim = vim
return {
"folke/which-key.nvim",
enabled = true,
lazy = false,
init = function()
vim.o.timeout = true
vim.o.timeoutlen = 300
end,
opts = {
-- your configuration comes here
-- or leave it empty to use the default settings
},
}