Skip to content

Commit

Permalink
feat: include several new plugins (#1235)
Browse files Browse the repository at this point in the history
* feat(cmp): more completion candidates from opened buffers. (#1219)

* buffer completion config

* opts -> option

* chore(lockfile): auto update lazy-lock.json

* chore(plugins): tidying up (#1221)

This commit mainly tweaks the loading events of some plugins to align with
upstream specifications. Additionally, there have been enhancements made to
certain documentation.

Signed-off-by: Jint-lzxy <[email protected]>

* fix(plugins): remove duplicate specifications

Signed-off-by: Jint-lzxy <[email protected]>

* fix: use `init` for vim plugins (#1222)

Signed-off-by: ayamir <[email protected]>

* chore(lockfile): auto update lazy-lock.json

* docs: mention the experimental nature of the 0.10 branch (#1215)

* docs: add note for 0.10 nightly branch in readme.

Signed-off-by: ayamir <[email protected]>

* chore(issue_template): add nightly warning

Signed-off-by: Charles Chiu <[email protected]>

* chore(issue_tempate): linting

Signed-off-by: Charles Chiu <[email protected]>

* docs: update readme for 0.10 branch.

Co-authored-by: Jint-lzxy <[email protected]>
Signed-off-by: Mohu <[email protected]>

* chore(issue_template): add nightly warning

Signed-off-by: Charles Chiu <[email protected]>

* chore(issue_template): add nightly warning

Signed-off-by: Charles Chiu <[email protected]>

---------

Signed-off-by: ayamir <[email protected]>
Signed-off-by: Charles Chiu <[email protected]>
Signed-off-by: Mohu <[email protected]>
Signed-off-by: Jint-lzxy <[email protected]>
Co-authored-by: Charles Chiu <[email protected]>
Co-authored-by: Jint-lzxy <[email protected]>

* fix(ISSUE_TEMPLATE): format code

Signed-off-by: Jint-lzxy <[email protected]>

* fix(README): misplaced content

Signed-off-by: Jint-lzxy <[email protected]>

* fix(todo-comment): add missing keywords (#1225)

Signed-off-by: Charles Chiu <[email protected]>

* chore(lockfile): auto update lazy-lock.json

* fix(options): remove options managed by `vim-sleuth` (#1229)

Since all tab-related stuff is now managed by `vim-sleuth`, I think
it is better to remove the relevant options to avoid confusion.

Signed-off-by: Jint-lzxy <[email protected]>

* chore(lockfile): auto update lazy-lock.json

* fix(rustaceanvim): use `init` for its config (#1231)

Signed-off-by: Jint-lzxy <[email protected]>

* chore(lockfile): auto update lazy-lock.json

* feat!: improve go development experience (#1226)

* chore(go): replace vim-go with go.nvim.

Signed-off-by: ayamir <[email protected]>

* fix: install gopls by mason by default.

Signed-off-by: ayamir <[email protected]>

* feat(keymap): set `n|gi` to goto implementation.

Signed-off-by: ayamir <[email protected]>

* chore(keymap): use `gm` to jump to lsp implementations

Co-authored-by: 冷酔閑吟 <[email protected]>
Signed-off-by: Mohu <[email protected]>

* fixup: remove unused `map_cu`.

* chore: use gopls instead of null-ls to format.

Signed-off-by: ayamir <[email protected]>

* chore: add notes for config options.

Signed-off-by: ayamir <[email protected]>

* fixup: tidy settings for go.nvim and gopls.

* docs: update more notes for how to config go.nvim.

* chore: cleanup

Signed-off-by: Jint-lzxy <[email protected]>

* fix: enable only the options that are truly necessary

Signed-off-by: Jint-lzxy <[email protected]>

* fixup! chore: cleanup

* fix(gopls): invalid config entry

Signed-off-by: Jint-lzxy <[email protected]>

---------

Signed-off-by: ayamir <[email protected]>
Signed-off-by: Mohu <[email protected]>
Signed-off-by: Jint-lzxy <[email protected]>
Co-authored-by: 冷酔閑吟 <[email protected]>
Co-authored-by: neogtliu <[email protected]>

* feat!: add `advanced-git-search.nvim`

* feat!: add `search.nvim` to enhance `telescope`.

* feat: reorganize keymaps for telescope search collections.

Signed-off-by: ayamir <[email protected]>

* fixup: update descriptions for modified keymaps.

* chore: remove single diagnostic disable for undefined-field.

Co-authored-by: jint_lzxy_ <[email protected]>
Signed-off-by: Mohu <[email protected]>

* chore: remove diagnostic disable for undefined-field.

* feat!: replace `colorizer.lua` with `nvim-highlight-colors`

* fix: invoke `utils.load_plugin`

Signed-off-by: Jint-lzxy <[email protected]>

* chore(advanced-git-search): remove unused options

Signed-off-by: Jint-lzxy <[email protected]>

* feat(telescope): add collection panel for `search.nvim`

* chore: typo

* feat: more documentation

Signed-off-by: Jint-lzxy <[email protected]>

* chore: clean up

* feat: don't hard-code collection names

* chore: use custom loader

* fix: disable warning

* fix: CI & cleanup

Signed-off-by: Jint-lzxy <[email protected]>

* Revert `lazy-lock.json`

Signed-off-by: Jint-lzxy <[email protected]>

* fix: make luaJIT happy

Signed-off-by: Jint-lzxy <[email protected]>

---------

Signed-off-by: Jint-lzxy <[email protected]>
Signed-off-by: ayamir <[email protected]>
Signed-off-by: Charles Chiu <[email protected]>
Signed-off-by: Mohu <[email protected]>
Co-authored-by: mjkx <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: 冷酔閑吟 <[email protected]>
Co-authored-by: Mohu <[email protected]>
Co-authored-by: neogtliu <[email protected]>
  • Loading branch information
6 people authored Jun 18, 2024
1 parent 9937d58 commit 80cda84
Show file tree
Hide file tree
Showing 10 changed files with 224 additions and 61 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint_code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ jobs:
- uses: actions/checkout@v4
- uses: lunarmodules/luacheck@v1
with:
args: . --std luajit --globals vim _toggle_lazygit _buf_vtext _command_panel _flash_esc_or_noh _debugging --max-line-length 150 --no-config
args: . --std luajit --globals vim _debugging _command_panel _flash_esc_or_noh _telescope_collections _toggle_lazygit --max-line-length 150 --no-config
1 change: 1 addition & 0 deletions lua/core/mapping.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ local core_map = {
["n|<C-q>"] = map_cr("wq"):with_desc("edit: Save file and quit"),
["n|<A-S-q>"] = map_cr("q!"):with_desc("edit: Force quit"),
["n|<leader>o"] = map_cr("setlocal spell! spelllang=en_us"):with_desc("edit: Toggle spell check"),
["n|<leader>bn"] = map_cu("enew"):with_noremap():with_silent():with_desc("buffer: New"),
["n|tn"] = map_cr("tabnew"):with_noremap():with_silent():with_desc("tab: Create a new tab"),
["n|tk"] = map_cr("tabnext"):with_noremap():with_silent():with_desc("tab: Move to next tab"),
["n|tj"] = map_cr("tabprevious"):with_noremap():with_silent():with_desc("tab: Move to previous tab"),
Expand Down
27 changes: 27 additions & 0 deletions lua/keymap/helpers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,33 @@ _G._command_panel = function()
})
end

_G._telescope_collections = function(picker_type)
local actions = require("telescope.actions")
local action_state = require("telescope.actions.state")
local conf = require("telescope.config").values
local finder = require("telescope.finders")
local pickers = require("telescope.pickers")
picker_type = picker_type or {}

local collections = vim.tbl_keys(require("search.tabs").collections)
pickers
.new(picker_type, {
prompt_title = "Telescope Collections",
finder = finder.new_table({ results = collections }),
sorter = conf.generic_sorter(picker_type),
attach_mappings = function(bufnr)
actions.select_default:replace(function()
actions.close(bufnr)
local selection = action_state.get_selected_entry()
require("search").open({ collection = selection[1] })
end)

return true
end,
})
:find()
end

_G._flash_esc_or_noh = function()
local flash_active, state = pcall(function()
return require("flash.plugins.char").state
Expand Down
44 changes: 3 additions & 41 deletions lua/keymap/tool.lua
Original file line number Diff line number Diff line change
Expand Up @@ -84,50 +84,12 @@ local plug_map = {
:with_noremap()
:with_silent()
:with_desc("tool: Toggle command panel"),
["n|<leader>u"] = map_callback(function()
require("telescope").extensions.undo.undo()
["n|<leader>f"] = map_callback(function()
_telescope_collections(require("telescope.themes").get_dropdown())
end)
:with_noremap()
:with_silent()
:with_desc("edit: Show undo history"),
["n|<leader>fp"] = map_callback(function()
require("telescope").extensions.projects.projects({})
end)
:with_noremap()
:with_silent()
:with_desc("find: Project"),
["n|<leader>fr"] = map_callback(function()
require("telescope").extensions.frecency.frecency({})
end)
:with_noremap()
:with_silent()
:with_desc("find: File by frecency"),
["n|<leader>fw"] = map_callback(function()
require("telescope").extensions.live_grep_args.live_grep_args()
end)
:with_noremap()
:with_silent()
:with_desc("find: Word in project"),
["n|<leader>fe"] = map_cu("Telescope oldfiles"):with_noremap():with_silent():with_desc("find: File by history"),
["n|<leader>ff"] = map_cu("Telescope find_files"):with_noremap():with_silent():with_desc("find: File in project"),
["n|<leader>fc"] = map_callback(function()
require("telescope.builtin").colorscheme({ enable_preview = true })
end)
:with_noremap()
:with_silent()
:with_desc("ui: Change colorscheme for current session"),
["n|<leader>bn"] = map_cu(":enew"):with_noremap():with_silent():with_desc("buffer: New"),
["n|<leader>fg"] = map_cu("Telescope git_files")
:with_noremap()
:with_silent()
:with_desc("find: file in git project"),
["n|<leader>fz"] = map_cu("Telescope zoxide list")
:with_noremap()
:with_silent()
:with_desc("edit: Change current directory by zoxide"),
["n|<leader>fb"] = map_cu("Telescope buffers"):with_noremap():with_silent():with_desc("find: Buffer opened"),
["nv|<leader>fs"] = map_cu("Telescope grep_string"):with_noremap():with_silent():with_desc("find: Current word"),
["n|<leader>fd"] = map_cu("Telescope persisted"):with_noremap():with_silent():with_desc("find: Session"),
:with_desc("tool: Open Telescope"),

-- Plugin: dap
["n|<F6>"] = map_callback(function()
Expand Down
3 changes: 0 additions & 3 deletions lua/modules/configs/editor/colorizer.lua

This file was deleted.

31 changes: 31 additions & 0 deletions lua/modules/configs/editor/highlight-colors.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
return function()
require("modules.utils").load_plugin("nvim-highlight-colors", {
render = "background",
enable_hex = true,
enable_short_hex = true,
enable_rgb = true,
enable_hsl = true,
enable_var_usage = true,
enable_named_colors = false,
enable_tailwind = false,
-- Exclude filetypes or buftypes from highlighting
exclude_filetypes = {
"alpha",
"bigfile",
"dap-repl",
"fugitive",
"git",
"notify",
"NvimTree",
"Outline",
"TelescopePrompt",
"toggleterm",
"undotree",
},
exclude_buftypes = {
"nofile",
"prompt",
"terminal",
},
})
end
130 changes: 130 additions & 0 deletions lua/modules/configs/tool/search.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
return function()
local builtin = require("telescope.builtin")
local extensions = require("telescope").extensions

require("modules.utils").load_plugin("search", {
collections = {
file = {
initial_tab = 1,
tabs = {
{
name = "Files",
tele_func = function(opts)
opts = opts or {}
if vim.fn.isdirectory(".git") == 1 then
builtin.git_files(opts)
else
builtin.find_files(opts)
end
end,
},
{
name = "Frecency",
tele_func = function()
extensions.frecency.frecency()
end,
},
{
name = "Oldfiles",
tele_func = function()
builtin.oldfiles()
end,
},
},
},
live_grep = {
initial_tab = 1,
tabs = {
{
name = "Word in project",
tele_func = function()
extensions.live_grep_args.live_grep_args()
end,
},
{
name = "Word under cursor",
tele_func = function(opts)
opts = opts or {}
builtin.grep_string(opts)
end,
},
},
},
git = {
initial_tab = 1,
tabs = {
{
name = "Branches",
tele_func = function()
builtin.git_branches()
end,
},
{
name = "Commits",
tele_func = function()
builtin.git_commits()
end,
},
{
name = "Commit content",
tele_func = function()
extensions.advanced_git_search.search_log_content()
end,
},
{
name = "Diff current file with commit",
tele_func = function()
extensions.advanced_git_search.diff_commit_file()
end,
},
},
},
workspace = {
initial_tab = 1,
tabs = {
{
name = "Buffers",
tele_func = function()
builtin.buffers()
end,
},
{
name = "Sessions",
tele_func = function()
extensions.persisted.persisted()
end,
},
{
name = "Projects",
tele_func = function()
extensions.projects.projects({})
end,
},
{
name = "Zoxide",
tele_func = function()
extensions.zoxide.list()
end,
},
},
},
misc = {
initial_tab = 1,
tabs = {
{
name = "Colorschemes",
tele_func = function()
builtin.colorscheme({ enable_preview = true })
end,
},
{
name = "Undo History",
tele_func = function()
extensions.undo.undo()
end,
},
},
},
},
})
end
13 changes: 7 additions & 6 deletions lua/modules/configs/tool/telescope.lua
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ return function()
},
live_grep_args = {
auto_quoting = true, -- enable/disable auto-quoting
-- define mappings, e.g.
mappings = { -- extend mappings
i = {
["<C-k>"] = lga_actions.quote_prompt(),
Expand All @@ -74,18 +73,19 @@ return function()
},
undo = {
side_by_side = true,
mappings = { -- this whole table is the default
mappings = {
i = {
-- IMPORTANT: Note that telescope-undo must be available when telescope is configured if
-- you want to use the following actions. This means installing as a dependency of
-- telescope in it's `requirements` and loading this extension from there instead of
-- having the separate plugin definition as outlined above. See issue #6.
["<cr>"] = require("telescope-undo.actions").yank_additions,
["<S-cr>"] = require("telescope-undo.actions").yank_deletions,
["<C-cr>"] = require("telescope-undo.actions").restore,
},
},
},
advanced_git_search = {
diff_plugin = "diffview",
git_flags = { "-c", "delta.side-by-side=true" },
entry_default_author_or_date = "author", -- one of "author" or "date"
},
},
})

Expand All @@ -98,4 +98,5 @@ return function()
require("telescope").load_extension("zoxide")
require("telescope").load_extension("persisted")
require("telescope").load_extension("aerial")
require("telescope").load_extension("advanced_git_search")
end
11 changes: 6 additions & 5 deletions lua/modules/plugins/editor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,14 @@ editor["smoka7/hop.nvim"] = {
}
editor["tzachar/local-highlight.nvim"] = {
lazy = true,
event = { "CursorHold", "CursorHoldI" },
event = { "BufReadPost", "BufAdd", "BufNewFile" },
config = require("editor.local-highlight"),
}
editor["brenoprata10/nvim-highlight-colors"] = {
lazy = true,
event = { "CursorHold", "CursorHoldI" },
config = require("editor.highlight-colors"),
}
editor["romainl/vim-cool"] = {
lazy = true,
event = { "CursorMoved", "InsertEnter" },
Expand Down Expand Up @@ -109,10 +114,6 @@ editor["nvim-treesitter/nvim-treesitter"] = {
"windwp/nvim-ts-autotag",
config = require("editor.autotag"),
},
{
"NvChad/nvim-colorizer.lua",
config = require("editor.colorizer"),
},
{
"hiphish/rainbow-delimiters.nvim",
config = require("editor.rainbow_delims"),
Expand Down
23 changes: 18 additions & 5 deletions lua/modules/plugins/tool.lua
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,31 @@ tool["nvim-telescope/telescope.nvim"] = {
cmd = "Telescope",
config = require("tool.telescope"),
dependencies = {
{ "nvim-tree/nvim-web-devicons" },
{ "nvim-lua/plenary.nvim" },
{ "nvim-tree/nvim-web-devicons" },
{ "jvgrootveld/telescope-zoxide" },
{ "debugloop/telescope-undo.nvim" },
{ "nvim-telescope/telescope-frecency.nvim" },
{ "nvim-telescope/telescope-live-grep-args.nvim" },
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
{
"FabianWirth/search.nvim",
config = require("tool.search"),
},
{
"ahmedkhalf/project.nvim",
event = { "CursorHold", "CursorHoldI" },
config = require("tool.project"),
},
{ "jvgrootveld/telescope-zoxide" },
{ "nvim-telescope/telescope-frecency.nvim" },
{ "nvim-telescope/telescope-live-grep-args.nvim" },
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
{
"aaronhallaert/advanced-git-search.nvim",
cmd = { "AdvancedGitSearch" },
dependencies = {
"tpope/vim-rhubarb",
"tpope/vim-fugitive",
"sindrets/diffview.nvim",
},
},
},
}

Expand Down

0 comments on commit 80cda84

Please sign in to comment.