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

Revert "Feat/telescope collections keymaps" #1302

Merged
merged 1 commit into from
Jun 20, 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
38 changes: 2 additions & 36 deletions lua/keymap/tool.lua
Original file line number Diff line number Diff line change
Expand Up @@ -84,46 +84,12 @@ local plug_map = {
:with_noremap()
:with_silent()
:with_desc("tool: Toggle command panel"),
["n|<leader>fc"] = map_callback(function()
["n|<leader>f"] = map_callback(function()
_telescope_collections(require("telescope.themes").get_dropdown())
end)
:with_noremap()
:with_silent()
:with_desc("tool: Open Telescope (collections)"),
["n|<leader>ff"] = map_callback(function()
require("search").open({ collection = "file" })
end)
:with_noremap()
:with_silent()
:with_desc("tool: Open Telescope (file)"),
["n|<leader>fw"] = map_callback(function()
require("search").open({ collection = "word" })
end)
:with_noremap()
:with_silent()
:with_desc("tool: Open Telescope (word)"),
["v|<leader>fs"] = map_cu("Telescope grep_string")
:with_noremap()
:with_silent()
:with_desc("tool: Open Telescope (selected)"),
["n|<leader>fg"] = map_callback(function()
require("search").open({ collection = "git" })
end)
:with_noremap()
:with_silent()
:with_desc("tool: Open Telescope (git)"),
["n|<leader>fr"] = map_callback(function()
require("search").open({ collection = "rootdir" })
end)
:with_noremap()
:with_silent()
:with_desc("tool: Open Telescope (rootdir)"),
["n|<leader>fm"] = map_callback(function()
require("search").open({ collection = "misc" })
end)
:with_noremap()
:with_silent()
:with_desc("tool: Open Telescope (misc)"),
:with_desc("tool: Open Telescope"),

-- Plugin: dap
["n|<F6>"] = map_callback(function()
Expand Down
35 changes: 20 additions & 15 deletions lua/modules/configs/completion/cmp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -162,23 +162,28 @@ return function()
{ name = "nvim_lsp", max_item_count = 350 },
{ name = "nvim_lua" },
{ name = "luasnip" },
-- { name = "path" },
-- { name = "treesitter" },
-- { name = "spell" },
-- { name = "tmux" },
-- { name = "orgmode" },
-- {
-- name = "buffer",
-- option = {
-- get_bufnrs = function()
-- return vim.api.nvim_list_bufs()
-- end,
-- },
-- },
-- { name = "latex_symbols" },
-- { name = "copilot" },
{ name = "path" },
{ name = "treesitter" },
{ name = "spell" },
{ name = "tmux" },
{ name = "orgmode" },
{
name = "buffer",
option = {
get_bufnrs = function()
return vim.api.nvim_list_bufs()
end,
},
},
{ name = "latex_symbols" },
{ name = "copilot" },
-- { name = "codeium" },
-- { name = "cmp_tabnine" },
},
experimental = {
ghost_text = {
hl_group = "Whitespace",
},
},
})
end
26 changes: 8 additions & 18 deletions lua/modules/configs/tool/search.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ return function()

require("modules.utils").load_plugin("search", {
collections = {
-- Search by file name
file = {
initial_tab = 1,
tabs = {
Expand All @@ -31,16 +30,9 @@ return function()
builtin.oldfiles()
end,
},
{
name = "Buffers",
tele_func = function()
builtin.buffers()
end,
},
},
},
-- Search by word
word = {
live_grep = {
initial_tab = 1,
tabs = {
{
Expand All @@ -58,7 +50,6 @@ return function()
},
},
},
-- Search by git (branches, commits)
git = {
initial_tab = 1,
tabs = {
Expand Down Expand Up @@ -88,10 +79,15 @@ return function()
},
},
},
-- Search by rootdir name
rootdir = {
workspace = {
initial_tab = 1,
tabs = {
{
name = "Buffers",
tele_func = function()
builtin.buffers()
end,
},
{
name = "Sessions",
tele_func = function()
Expand Down Expand Up @@ -121,12 +117,6 @@ return function()
builtin.colorscheme({ enable_preview = true })
end,
},
{
name = "Notify",
tele_func = function()
extensions.notify.notify()
end,
},
{
name = "Undo History",
tele_func = function()
Expand Down
97 changes: 48 additions & 49 deletions lua/modules/configs/ui/alpha.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,56 +39,55 @@ return function()
end

local leader = " "
local icons = {
documents = require("modules.utils.icons").get("documents", true),
git = require("modules.utils.icons").get("git", true),
ui = require("modules.utils.icons").get("ui", true),
misc = require("modules.utils.icons").get("misc", true),
}

dashboard.section.buttons.val = {
button(
"space f c",
icons.misc.Neovim .. "Telescope collections",
leader,
nil,
{ noremap = true, silent = true, nowait = true }
),
button(
"space f g",
icons.git.Git .. "Telescope git",
leader,
nil,
{ noremap = true, silent = true, nowait = true }
),
button(
"space f w",
icons.ui.FolderWithHeart .. "Telescope workspace",
leader,
nil,
{ noremap = true, silent = true, nowait = true }
),
button(
"space f f",
icons.documents.FileFind .. "Telescope file",
leader,
nil,
{ noremap = true, silent = true, nowait = true }
),
button(
"space f l",
icons.documents.Word .. "Telescope live_grep",
leader,
nil,
{ noremap = true, silent = true, nowait = true }
),
button(
"space f m",
icons.misc.Ghost .. "Telescope misc",
leader,
nil,
{ noremap = true, silent = true, nowait = true }
),
button("space f c", " Scheme change", leader, nil, {
noremap = true,
silent = true,
nowait = true,
callback = function()
require("telescope.builtin").colorscheme()
end,
}),
button("space f r", " File frecency", leader, nil, {
noremap = true,
silent = true,
nowait = true,
callback = function()
require("telescope").extensions.frecency.frecency({})
end,
}),
button("space f e", "󰋚 File history", leader, nil, {
noremap = true,
silent = true,
nowait = true,
callback = function()
require("telescope.builtin").oldfiles()
end,
}),
button("space f p", " Project find", leader, nil, {
noremap = true,
silent = true,
nowait = true,
callback = function()
require("telescope").extensions.projects.projects({})
end,
}),
button("space f f", "󰈞 File find", leader, nil, {
noremap = true,
silent = true,
nowait = true,
callback = function()
require("telescope.builtin").find_files()
end,
}),
button("space f w", " Word find", leader, nil, {
noremap = true,
silent = true,
nowait = true,
callback = function()
require("telescope.builtin").live_grep()
end,
}),
}
dashboard.section.buttons.opts.hl = "AlphaButtons"

Expand Down
2 changes: 0 additions & 2 deletions lua/modules/utils/icons.lua
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ local data = {
File = "",
Files = "",
FileTree = "󰙅",
FileFind = "󰈞",
Word = "",
Import = "",
Symlink = "",
},
Expand Down