nvimdev/dope

`Telescope app` and `Telescope dotfiles`

Opened this issue · 4 comments

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

我参考你的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 } })

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

dope/lua/keymap/init.lua

Lines 20 to 22 in 608e5fe

{'n','<Leader>n',cmd('DashboardNewFile'),opts(noremap,silent)},
{'n','<Leader>ss',cmd('SessionSave'),opts(noremap,silent)},
{'n','<Leader>sl',cmd('SessionLoad'),opts(noremap,silent)},

因为Dashboard更新,上面三个也不能用了
DashboardNewFile可以换成:

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

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

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