dope icon indicating copy to clipboard operation
dope copied to clipboard

`Telescope app` and `Telescope dotfiles`

Open WindyValley opened this issue 2 years ago • 4 comments

Telescope appTelescope dotfiles 这两个是在你自己的配置里写的Telescope自定义扩展,在dope里没有,而且似乎不是很通用,是否考虑在dashboard的配置里移除?或者如果能换个更通用的模板的话就更好了。

WindyValley avatar Sep 08 '23 14:09 WindyValley

我参考你的dotfiles写了一个搜索nvim配置文件的

local telescope = require('telescope')
local finders = require('telescope.finders')
local pickers = require('telescope.pickers')
local make_entry = require('telescope.make_entry')
local conf = require('telescope.config').values

local config_path = vim.fn.stdpath('config')

local config_file_list = function()
  local list = {}
  local p = io.popen('rg --files --ignore .git ' .. config_path)
  for file in p:lines() do
    table.insert(list, file)
  end
  return list
end

local nvim_user_config = function(opts)
  opts = opts or {}
  local results = config_file_list()

  pickers
    .new(opts, {
      prompt_title = 'find in nvim user config files',
      results_title = 'Nvim User Configs',
      finder = finders.new_table({
        results = results,
        entry_maker = make_entry.gen_from_file(opts),
      }),
      previewer = conf.file_previewer(opts),
      sorter = conf.file_sorter(opts),
    })
    :find()
end

return telescope.register_extension({ exports = { nvim_user_config = nvim_user_config } })

WindyValley avatar Sep 08 '23 14:09 WindyValley

看起来是 #41 合进来的,最开始还没有😂

WindyValley avatar Sep 08 '23 14:09 WindyValley

https://github.com/nvimdev/dope/blob/608e5fe36311e3800c6b271cad8140bfb7617d6d/lua/keymap/init.lua#L20-L22 因为Dashboard更新,上面三个也不能用了 DashboardNewFile可以换成:

  { '<Leader>n', cmd('lua require(\'dashboard\'):new_file()'), opts(noremap, silent) },

另外两个需要引入dbsession.nvim,看你的文档,这个插件从dashboard-nvim剥离出来是因为速度原因,我不确定把dbsession.nvim引进来是不是合适的,如果没问题的话我就在 #50 上改了

WindyValley avatar Sep 09 '23 06:09 WindyValley

好久没更新dope 了 很多都变了。 session可以lazyload

glepnir avatar Sep 09 '23 06:09 glepnir