diff options
Diffstat (limited to 'hm/soispha/conf/nvim/plugins/telescope')
10 files changed, 0 insertions, 239 deletions
diff --git a/hm/soispha/conf/nvim/plugins/telescope/default.nix b/hm/soispha/conf/nvim/plugins/telescope/default.nix deleted file mode 100644 index b5054ed0..00000000 --- a/hm/soispha/conf/nvim/plugins/telescope/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{...}: { - imports = [ - ./defaults - ./keymaps - ./extensions - ]; - programs.nixvim.plugins.telescope = { - enable = true; - }; -} diff --git a/hm/soispha/conf/nvim/plugins/telescope/defaults/default.nix b/hm/soispha/conf/nvim/plugins/telescope/defaults/default.nix deleted file mode 100644 index 1d88aad8..00000000 --- a/hm/soispha/conf/nvim/plugins/telescope/defaults/default.nix +++ /dev/null @@ -1,30 +0,0 @@ -{...}: { - programs.nixvim.plugins.telescope.defaults = { - mappings = let - insert_and_normal_mappings = { - # map actions.which_key to <c-h> (default: <c-/>) - # actions.which_key shows the mappings for your picker, - # e.g. git_{create, delete, ...}_branch for the git_branches picker - "<C-h>" = "which_key"; - }; - in { - i = - insert_and_normal_mappings; - n = - { - "t" = "move_selection_next"; - "n" = "move_selection_previous"; - "<Space>" = "toggle_all"; - - "<C-d>" = "preview_scrolling_up"; - "<C-u>" = "preview_scrolling_down"; - "<Left>" = "preview_scrolling_left"; - "<Right>" = "preview_scrolling_right"; - - "<Esc>" = "close"; - "q" = "close"; - } - // insert_and_normal_mappings; - }; - }; -} diff --git a/hm/soispha/conf/nvim/plugins/telescope/extensions/bibtex/default.nix b/hm/soispha/conf/nvim/plugins/telescope/extensions/bibtex/default.nix deleted file mode 100644 index 12c9736c..00000000 --- a/hm/soispha/conf/nvim/plugins/telescope/extensions/bibtex/default.nix +++ /dev/null @@ -1,13 +0,0 @@ -{pkgs, ...}: { - # WARNING: This is only activated in tex files via the ftplugin. - programs.nixvim = { - extraPlugins = [ - pkgs.vimExtraPlugins.telescope-bibtex-nvim - ]; - maps.normal = { - "<space>ib" = { - desc = "[i]nsert a [b]atex citation"; - }; - }; - }; -} diff --git a/hm/soispha/conf/nvim/plugins/telescope/extensions/default.nix b/hm/soispha/conf/nvim/plugins/telescope/extensions/default.nix deleted file mode 100644 index 0b1e033a..00000000 --- a/hm/soispha/conf/nvim/plugins/telescope/extensions/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{...}: { - imports = [ - ./bibtex - ./frecency - ./fzy-native - ./rooter - ./symbols - ]; -} diff --git a/hm/soispha/conf/nvim/plugins/telescope/extensions/frecency/default.nix b/hm/soispha/conf/nvim/plugins/telescope/extensions/frecency/default.nix deleted file mode 100644 index 4a4c22be..00000000 --- a/hm/soispha/conf/nvim/plugins/telescope/extensions/frecency/default.nix +++ /dev/null @@ -1,22 +0,0 @@ -{...}: { - programs.nixvim = { - maps = { - normal = { - "gff" = { - action = "function() require('telescope').extensions.frecency.frecency() end"; - lua = true; - desc = "activate the frecency file selection"; - }; - }; - }; - plugins.telescope = { - extensions.frecency = { - enable = true; - showUnindexed = true; - showScores = true; - # TODO: add this: - #db_safe_mode = true; - }; - }; - }; -} diff --git a/hm/soispha/conf/nvim/plugins/telescope/extensions/fzy-native/default.nix b/hm/soispha/conf/nvim/plugins/telescope/extensions/fzy-native/default.nix deleted file mode 100644 index ce0bdccc..00000000 --- a/hm/soispha/conf/nvim/plugins/telescope/extensions/fzy-native/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{...}: { - programs.nixvim.plugins.telescope.extensions.fzy-native = { - enable = true; - }; -} diff --git a/hm/soispha/conf/nvim/plugins/telescope/extensions/rooter/default.nix b/hm/soispha/conf/nvim/plugins/telescope/extensions/rooter/default.nix deleted file mode 100644 index 779448cc..00000000 --- a/hm/soispha/conf/nvim/plugins/telescope/extensions/rooter/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{lib, ...}: { - programs.nixvim = { - extraConfigLuaPost = '' - ${lib.strings.fileContents ./lua/rooter.lua} - ''; - }; -} diff --git a/hm/soispha/conf/nvim/plugins/telescope/extensions/rooter/lua/rooter.lua b/hm/soispha/conf/nvim/plugins/telescope/extensions/rooter/lua/rooter.lua deleted file mode 100644 index eaf68ecf..00000000 --- a/hm/soispha/conf/nvim/plugins/telescope/extensions/rooter/lua/rooter.lua +++ /dev/null @@ -1,84 +0,0 @@ --- Taken from: https://github.com/desdic/telescope-rooter.nvim/blob/69423216c75a5f1f1477bbf8faf6b0dc8af04099/lua/telescope/_extensions/rooter.lua -local has_telescope, telescope = pcall(require, "telescope") -if not has_telescope then - error("This extension requires telescope.nvim") - return -end - -local has_plenary, plenary = pcall(require, "plenary") -if not has_plenary then - error("This extension requires plenary") - return -end - -local log = plenary.log.new({ plugin = "telescope_rooter"; level = "info"; }) - --- TODO: expose this function -local toggle = function(_) - vim.g["Telescope#rooter#enabled"] = not vim.g["Telescope#rooter#enabled"] - print("Telescope#rooter#enabled=" .. vim.inspect(vim.g["Telescope#rooter#enabled"])) -end - -local config = { patterns = { ".git"; }; enable = true; debug = false; } - --- default enabled -vim.g["Telescope#rooter#enabled"] = vim.F.if_nil(config.enable, true) - --- redefine log if debug enabled -if vim.F.if_nil(config.debug, false) then - log = plenary.log.new({ plugin = "telescope_rooter"; level = "debug"; }) -end - -local group = vim.api.nvim_create_augroup("TelescopeRooter", { clear = true; }) - -vim.api.nvim_create_autocmd({ "DirChangedPre"; }, { - callback = function() - if vim.g["Telescope#rooter#enabled"] ~= true then - return - end - - if vim.g["Telescope#rooter#oldpwd"] == nil then - vim.g["Telescope#rooter#oldpwd"] = vim.loop.cwd() - log.debug("before " .. vim.inspect(vim.loop.cwd())) - end - end; - group = group; -}) - -vim.api.nvim_create_autocmd({ "BufEnter"; "BufWinEnter"; }, { - callback = function() - if vim.g["Telescope#rooter#enabled"] ~= true then - return - end - - vim.schedule(function() - if vim.bo.filetype == "TelescopePrompt" then - local rootdir = vim.fs.dirname(vim.fs.find(config.patterns, { upward = true; })[1]) - if rootdir ~= nil then - vim.api.nvim_set_current_dir(rootdir) - log.debug("changing dir to " .. rootdir) - end - end - end) - end; - group = group; -}) - -vim.api.nvim_create_autocmd({ "BufWinLeave"; }, { - callback = function() - if vim.g["Telescope#rooter#enabled"] ~= true then - return - end - - vim.schedule(function() - if vim.bo.filetype ~= "TelescopePrompt" then - if vim.g["Telescope#rooter#oldpwd"] ~= nil then - log.debug("restoring " .. vim.g["Telescope#rooter#oldpwd"]) - vim.api.nvim_set_current_dir(vim.g["Telescope#rooter#oldpwd"]) - vim.g["Telescope#rooter#oldpwd"] = nil - end - end - end) - end; - group = group; -}) diff --git a/hm/soispha/conf/nvim/plugins/telescope/extensions/symbols/default.nix b/hm/soispha/conf/nvim/plugins/telescope/extensions/symbols/default.nix deleted file mode 100644 index fe38f8c1..00000000 --- a/hm/soispha/conf/nvim/plugins/telescope/extensions/symbols/default.nix +++ /dev/null @@ -1,51 +0,0 @@ -{pkgs, ...}: { - programs.nixvim = { - extraPlugins = [ - # Source of symbols for telescope symbols - pkgs.vimPlugins.telescope-symbols-nvim - ]; - maps = { - normal = { - "<space>il" = { - action = '' - function() - require('telescope.builtin').symbols{ sources = { - 'latex' - }} - end - ''; - lua = true; - desc = "[i]nsert a [l]atex symbol"; - }; - "<space>ie" = { - action = '' - function() - require('telescope.builtin').symbols{ sources = { - 'emoji', - }} - end - ''; - lua = true; - desc = "[i]nsert a [e]moji"; - }; - "<space>is" = { - action = '' - function() - require('telescope.builtin').symbols{ sources = { - 'emoji', - 'gitmoji', - 'julia', - 'kaomoji', - 'latex', - 'math', - 'nerd', - }} - end - ''; - lua = true; - desc = "[i]nsert a [s]ymbol (like emojis)"; - }; - }; - }; - }; -} diff --git a/hm/soispha/conf/nvim/plugins/telescope/keymaps/default.nix b/hm/soispha/conf/nvim/plugins/telescope/keymaps/default.nix deleted file mode 100644 index f0745f73..00000000 --- a/hm/soispha/conf/nvim/plugins/telescope/keymaps/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{...}: { - programs.nixvim.plugins.telescope.keymaps = { - "<space>rg" = { - action = "live_grep"; - desc = "[rg] in a live session"; - }; - }; -} |