Skip to content

Commit

Permalink
feat: remove unused telescope plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
willruggiano committed Jul 6, 2023
1 parent 6754438 commit 46cfede
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 67 deletions.
4 changes: 2 additions & 2 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ tasks:
- install
build:
cmds:
- nix build
- nix build |& nom
aliases:
- b
install:
cmds:
- nix profile upgrade --impure 0
- nix profile upgrade --impure 0 |& nom
aliases:
- i
run:
Expand Down
13 changes: 0 additions & 13 deletions nix/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -485,25 +485,12 @@
"rev": "580b6c48651cabb63455e97d7e131ed557b8c7e2",
"type": "git"
},
"telescope-fzy-native.nvim": {
"branch": "master",
"repo": "git@github.com:nvim-telescope/telescope-fzy-native.nvim",
"rev": "282f069504515eec762ab6d6c89903377252bf5b",
"submodules": true,
"type": "git"
},
"telescope-github.nvim": {
"branch": "master",
"repo": "git@github.com:willruggiano/telescope-github.nvim",
"rev": "476952cf96e60efca4c230e86cf866835dfef236",
"type": "git"
},
"telescope-project.nvim": {
"branch": "master",
"repo": "git@github.com:nvim-telescope/telescope-project.nvim",
"rev": "fa081e35ba7397e5147a51ece693aa3afda167fc",
"type": "git"
},
"telescope-symbols.nvim": {
"branch": "master",
"repo": "git@github.com:nvim-telescope/telescope-symbols.nvim",
Expand Down
9 changes: 0 additions & 9 deletions plugins/spec.nix
Original file line number Diff line number Diff line change
Expand Up @@ -570,15 +570,6 @@ in rec {
buildPhase = "";
};
};
telescope-fzy-native = {
src = sources."telescope-fzy-native.nvim";
dependencies = {
inherit fzy-lua-native;
};
};
telescope-project = {
src = sources."telescope-project.nvim";
};
telescope-symbols = {
src = sources."telescope-symbols.nvim";
};
Expand Down
49 changes: 7 additions & 42 deletions plugins/telescope.lua
Original file line number Diff line number Diff line change
@@ -1,32 +1,8 @@
return function()
local telescope = require "telescope"
local actions = require "telescope.actions"
local action_state = require "telescope.actions.state"
local themes = require "telescope.themes"

local set_prompt_to_entry_value = function(prompt_bufnr)
local entry = action_state.get_selected_entry()
if not entry or not type(entry) == "table" then
return
end

action_state.get_current_picker(prompt_bufnr):reset_prompt(entry.ordinal)
end

local common_dirs = {
["~/dev"] = "dev",
["~/notes"] = "notes",
["~/src"] = "src",
}
local project_dirs = {}
for dir, _ in pairs(common_dirs) do
---@diagnostic disable-next-line: missing-parameter
dir = vim.fn.expand(dir)
if vim.fn.isdirectory(dir) == 1 then
table.insert(project_dirs, dir)
end
end

local default_theme = themes.get_ivy {
color_devicons = true,
layout_config = { preview_cutoff = 150 },
Expand All @@ -41,9 +17,13 @@ return function()
defaults = vim.tbl_deep_extend("force", default_theme, {
mappings = {
i = {
["<C-c>"] = actions.close,
["<C-j>"] = actions.move_selection_next,
["<C-k>"] = actions.move_selection_previous,
["<C-n>"] = false,
["<C-p>"] = false,
["<C-s>"] = actions.select_horizontal,
["<C-x>"] = false,
["<C-y>"] = set_prompt_to_entry_value,
},
},

Expand All @@ -59,16 +39,14 @@ return function()
typescript = { "javascript", "typescript" },
},
},

fzf = {
fuzzy = true,
override_generic_sorter = true,
override_file_sorter = true,
case_mode = "smart_case",
},

project = {
base_dirs = project_dirs,
smart_open = {
match_algorithm = "fzf",
},
},

Expand All @@ -85,7 +63,6 @@ return function()

telescope.load_extension "docsets"
telescope.load_extension "fzf"
telescope.load_extension "project"
telescope.load_extension "smart_open"
telescope.load_extension "ui-select"

Expand All @@ -103,24 +80,12 @@ return function()
end,
{ desc = "Buffers" },
},
["<space>e"] = {
function()
require("telescope.builtin").git_files()
end,
{ desc = "Git files" },
},
["<space>o"] = {
function()
require("telescope").extensions.smart_open.smart_open()
end,
{ desc = "Open Anything™" },
},
["<space>p"] = {
function()
require("telescope").extensions.project.project {}
end,
{ desc = "Projects" },
},
["<space>k"] = {
function()
vim.ui.input({ prompt = "Query > " }, function(pattern)
Expand Down
2 changes: 1 addition & 1 deletion plugins/toggleterm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ return function()
local nnoremap = require("bombadil.lib.keymap").nnoremap

nnoremap("<space><space>", function()
toggleterm.toggle_command("size=20", vim.api.nvim_get_current_win())
toggleterm.toggle_command("size=20", vim.api.nvim_get_current_tabpage())
end, { desc = "Toggle terminal" })
end

0 comments on commit 46cfede

Please sign in to comment.