Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
6f12a7d
feat(cmp): more completion candidates from opened buffers. (#1219)
mvmx3 Apr 6, 2024
a9c0292
chore(lockfile): auto update lazy-lock.json
github-actions[bot] Apr 7, 2024
276e3d8
chore(plugins): tidying up (#1221)
Jint-lzxy Apr 8, 2024
e5224c4
fix(plugins): remove duplicate specifications
Jint-lzxy Apr 8, 2024
7e6ae27
fix: use `init` for vim plugins (#1222)
ayamir Apr 9, 2024
a168b1f
chore(lockfile): auto update lazy-lock.json
github-actions[bot] Apr 10, 2024
b56c207
docs: mention the experimental nature of the 0.10 branch (#1215)
ayamir Apr 10, 2024
0dc481e
fix(ISSUE_TEMPLATE): format code
Jint-lzxy Apr 10, 2024
3bc540e
fix(README): misplaced content
Jint-lzxy Apr 10, 2024
d8e1262
fix(todo-comment): add missing keywords (#1225)
charliie-dev Apr 10, 2024
12ac43c
chore(lockfile): auto update lazy-lock.json
github-actions[bot] Apr 11, 2024
62cbc02
fix(options): remove options managed by `vim-sleuth` (#1229)
Jint-lzxy Apr 11, 2024
6883089
chore(lockfile): auto update lazy-lock.json
github-actions[bot] Apr 12, 2024
54f0997
fix(rustaceanvim): use `init` for its config (#1231)
Jint-lzxy Apr 17, 2024
c0a47f9
chore(lockfile): auto update lazy-lock.json
github-actions[bot] Apr 18, 2024
d49179a
feat!: improve go development experience (#1226)
ayamir Apr 19, 2024
fc04699
feat!: add `advanced-git-search.nvim`
charliie-dev Apr 19, 2024
64a99ea
feat!: add `search.nvim` to enhance `telescope`.
charliie-dev Apr 19, 2024
c7767fa
feat: reorganize keymaps for telescope search collections.
ayamir Apr 20, 2024
b8e798d
fixup: update descriptions for modified keymaps.
ayamir Apr 20, 2024
3607879
chore: remove single diagnostic disable for undefined-field.
ayamir Apr 20, 2024
cde6c9c
chore: remove diagnostic disable for undefined-field.
ayamir Apr 20, 2024
14aad3f
feat!: replace `colorizer.lua` with `nvim-highlight-colors`
charliie-dev Apr 28, 2024
d29214a
Merge branch '0.10' into new-plugins
charliie-dev Jun 7, 2024
8024cc7
fix: invoke `utils.load_plugin`
Jint-lzxy Jun 11, 2024
e62e504
chore(advanced-git-search): remove unused options
Jint-lzxy Jun 11, 2024
400e77d
feat(telescope): add collection panel for `search.nvim`
charliie-dev Jun 13, 2024
821da34
chore: typo
charliie-dev Jun 17, 2024
f70e685
feat: more documentation
Jint-lzxy Jun 17, 2024
8957c58
chore: clean up
charliie-dev Jun 17, 2024
3d77f4a
feat: don't hard-code collection names
charliie-dev Jun 17, 2024
6ea599b
chore: use custom loader
charliie-dev Jun 18, 2024
cfa9b94
fix: disable warning
charliie-dev Jun 18, 2024
2e80eb8
fix: CI & cleanup
Jint-lzxy Jun 18, 2024
c659de9
Revert `lazy-lock.json`
Jint-lzxy Jun 18, 2024
d5d6d44
fix: make luaJIT happy
Jint-lzxy Jun 18, 2024
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
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 @@ -89,50 +89,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 @@ -78,18 +78,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