Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(plugins): tidying up #1221

Merged
merged 1 commit into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 19 additions & 11 deletions lua/keymap/editor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -68,28 +68,36 @@ local plug_map = {
["n|<C-j>"] = map_cu("SmartCursorMoveDown"):with_silent():with_noremap():with_desc("window: Focus down"),
["n|<C-k>"] = map_cu("SmartCursorMoveUp"):with_silent():with_noremap():with_desc("window: Focus up"),
["n|<C-l>"] = map_cu("SmartCursorMoveRight"):with_silent():with_noremap():with_desc("window: Focus right"),
["n|<leader>Wh"] = map_cu("SmartSwapLeft"):with_silent():with_noremap():with_desc("window: Move window to left"),
["n|<leader>Wj"] = map_cu("SmartSwapDown"):with_silent():with_noremap():with_desc("window: Move window to down"),
["n|<leader>Wk"] = map_cu("SmartSwapUp"):with_silent():with_noremap():with_desc("window: Move window to up"),
["n|<leader>Wl"] = map_cu("SmartSwapRight"):with_silent():with_noremap():with_desc("window: Move window to right"),
["n|<leader>Wh"] = map_cu("SmartSwapLeft"):with_silent():with_noremap():with_desc("window: Move window leftward"),
["n|<leader>Wj"] = map_cu("SmartSwapDown"):with_silent():with_noremap():with_desc("window: Move window downward"),
["n|<leader>Wk"] = map_cu("SmartSwapUp"):with_silent():with_noremap():with_desc("window: Move window upward"),
["n|<leader>Wl"] = map_cu("SmartSwapRight"):with_silent():with_noremap():with_desc("window: Move window rightward"),

-- Plugin: nvim-spectre
["n|<leader>Ss"] = map_cmd([[<Cmd>lua require("spectre").toggle()<CR>]])
["n|<leader>Ss"] = map_callback(function()
require("spectre").toggle()
end)
:with_silent()
:with_noremap()
:with_desc("editn: Toggle search&replace panel"),
["n|<leader>Sp"] = map_cmd([[<Cmd>lua require("spectre").open_visual({select_word=true})<CR>]])
:with_desc("editn: Toggle search & replace panel"),
["n|<leader>Sp"] = map_callback(function()
require("spectre").open_visual({ select_word = true })
end)
:with_silent()
:with_noremap()
:with_desc("editn: search&replace current word (project)"),
["v|<leader>Sp"] = map_cmd([[<Esc><Cmd>lua require("spectre").open_visual()<CR>]])
["v|<leader>Sp"] = map_callback(function()
require("spectre").open_visual()
end)
:with_silent()
:with_noremap()
:with_desc("edit: search&replace current word (project)"),
["n|<leader>Sf"] = map_cmd([[<Cmd>lua require("spectre").open_file_search({select_word=true})<CR>]])
:with_desc("edit: search & replace current word (project)"),
["n|<leader>Sf"] = map_callback(function()
require("spectre").open_file_search({ select_word = true })
end)
:with_silent()
:with_noremap()
:with_desc("editn: search&replace current word (file)"),
:with_desc("editn: search & replace current word (file)"),

-- Plugin: nvim-treehopper
["o|m"] = map_cu("lua require('tsht').nodes()"):with_silent():with_desc("jump: Operate across syntax tree"),
Expand Down
29 changes: 2 additions & 27 deletions lua/modules/configs/completion/neoconf.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ local M = {}

M.setup = function()
require("modules.utils").load_plugin("neoconf", {
-- send new configuration to lsp clients when changing json settings
live_reload = true,
-- name of the local settings files
local_settings = ".neoconf.json",
-- name of the global settings file in your Neovim config directory
Expand All @@ -12,33 +14,6 @@ M.setup = function()
coc = true, -- global/local coc-settings.json
nlsp = true, -- global/local nlsp-settings.nvim json settings
},
-- send new configuration to lsp clients when changing json settings
live_reload = true,
-- set the filetype to jsonc for settings files, so you can use comments
-- make sure you have the jsonc treesitter parser installed!
filetype_jsonc = true,
plugins = {
-- configures lsp clients with settings in the following order:
-- - lua settings passed in lspconfig setup
-- - global json settings
-- - local json settings
lspconfig = {
enabled = true,
},
-- configures jsonls to get completion in .nvim.settings.json files
jsonls = {
enabled = true,
-- only show completion in json settings for configured lsp servers
configured_servers_only = true,
},
-- configures lua_ls to get completion of lspconfig server settings
lua_ls = {
-- by default, lua_ls annotations are only enabled in your neovim config directory
enabled_for_neovim_config = true,
-- explicitely enable adding annotations. Mostly relevant to put in your local .nvim.settings.json file
enabled = false,
},
},
})
end

Expand Down
11 changes: 11 additions & 0 deletions lua/modules/configs/editor/align.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
return function()
require("modules.utils").load_plugin("mini.align", {
-- Whether to disable showing non-error feedback
silent = false,
-- Module mappings. Use `''` (empty string) to disable one.
mappings = {
start = "gea",
start_with_preview = "geA",
},
})
end
7 changes: 1 addition & 6 deletions lua/modules/configs/editor/local-highlight.lua
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
return function()
require("modules.utils").load_plugin("local-highlight", {
file_types = nil,
hlgroup = "Search",
cw_hlgroup = nil,
-- Whether to display highlights in INSERT mode or not
hlgroup = "IlluminatedWordText",
insert_mode = false,
min_match_len = 1,
max_match_len = math.huge,
})
end
8 changes: 0 additions & 8 deletions lua/modules/configs/editor/mini-align.lua

This file was deleted.

92 changes: 0 additions & 92 deletions lua/modules/configs/editor/smart-splits.lua

This file was deleted.

14 changes: 14 additions & 0 deletions lua/modules/configs/editor/splits.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
return function()
require("modules.utils").load_plugin("smart-splits", {
-- Ignored buffer types (only while resizing)
ignored_buftypes = {
"nofile",
"quickfix",
"prompt",
},
-- Ignored filetypes (only while resizing)
ignored_filetypes = { "NvimTree" },
-- the default number of lines/columns to resize by at a time
default_amount = 3,
})
end
2 changes: 1 addition & 1 deletion lua/modules/configs/ui/catppuccin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ return function()
harpoon = false,
headlines = false,
hop = true,
illuminate = false,
illuminate = true,
indent_blankline = { enabled = true, colored_indent_levels = false },
leap = false,
lightspeed = false,
Expand Down
2 changes: 1 addition & 1 deletion lua/modules/configs/ui/lualine.lua
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ return function()

tabwidth = {
function()
return icons.ui.Tab .. vim.api.nvim_get_option_value("shiftwidth", { scope = "local" })
return icons.ui.Tab .. vim.api.nvim_get_option_value("tabstop", { scope = "local" })
end,
padding = 1,
},
Expand Down
42 changes: 42 additions & 0 deletions lua/modules/configs/ui/todo.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
return function()
local icons = {
diagnostics = require("modules.utils.icons").get("diagnostics"),
ui = require("modules.utils.icons").get("ui"),
}

require("modules.utils").load_plugin("todo-comments", {
signs = false, -- show icons in the signs column
keywords = {
FIX = {
icon = icons.ui.Bug,
color = "error",
alt = { "FIXME", "BUG", "FIXIT", "ISSUE" },
},
TODO = { icon = icons.ui.Accepted, color = "info" },
-- HACK = { icon = icons.ui.Fire, color = "warning" },
WARN = { icon = icons.diagnostics.Warning, color = "warning", alt = { "WARNING", "XXX" } },
PERF = { icon = icons.ui.Perf, alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } },
NOTE = { icon = icons.ui.Note, color = "hint", alt = { "INFO" } },
},
gui_style = {
fg = "NONE",
bg = "BOLD",
},
merge_keywords = true,
highlight = {
multiline = false,
keyword = "wide", -- "fg", "bg", "wide", "wide_bg", "wide_fg" or empty.
after = "",
comments_only = true,
max_line_len = 500,
exclude = { "big_file_disabled_ft" },
},
colors = {
error = { "DiagnosticError", "ErrorMsg", "#DC2626" },
warning = { "DiagnosticWarn", "WarningMsg", "#FBBF24" },
info = { "DiagnosticInfo", "#2563EB" },
hint = { "DiagnosticHint", "#F5C2E7" },
default = { "Conditional", "#7C3AED" },
},
})
end
2 changes: 1 addition & 1 deletion lua/modules/plugins/completion.lua
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ completion["hrsh7th/nvim-cmp"] = {
{ "f3fora/cmp-spell" },
{ "hrsh7th/cmp-buffer" },
{ "kdheepak/cmp-latex-symbols" },
{ "ray-x/cmp-treesitter" },
{ "ray-x/cmp-treesitter", commit = "c8e3a74" },
-- { "tzachar/cmp-tabnine", build = "./install.sh", config = require("completion.tabnine") },
-- {
-- "jcdickinson/codeium.nvim",
Expand Down
13 changes: 9 additions & 4 deletions lua/modules/plugins/editor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ editor["sindrets/diffview.nvim"] = {
config = require("editor.diffview"),
}
editor["echasnovski/mini.align"] = {
version = false,
config = require("editor.mini-align"),
lazy = true,
event = { "CursorHold", "CursorHoldI" },
config = require("editor.align"),
}
editor["smoka7/hop.nvim"] = {
lazy = true,
Expand All @@ -78,14 +79,18 @@ editor["tpope/vim-sleuth"] = {
lazy = true,
event = "BufReadPre",
}
editor["tpope/vim-sleuth"] = {
lazy = true,
event = { "BufNewFile", "BufReadPost", "BufFilePost" },
}
editor["nvim-pack/nvim-spectre"] = {
lazy = true,
cmd = { "Spectre" },
cmd = "Spectre",
}
editor["mrjones2014/smart-splits.nvim"] = {
lazy = true,
event = { "CursorHoldI", "CursorHold" },
config = require("editor.smart-splits"),
config = require("editor.splits"),
}

----------------------------------------------------------------------
Expand Down
5 changes: 3 additions & 2 deletions lua/modules/plugins/ui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ ui["folke/paint.nvim"] = {
}
ui["folke/todo-comments.nvim"] = {
lazy = true,
event = { "BufReadPost" },
opts = {},
event = { "CursorHold", "CursorHoldI" },
config = require("ui.todo"),
dependencies = { "nvim-lua/plenary.nvim" },
}
ui["dstein64/nvim-scrollview"] = {
lazy = true,
Expand Down