Fix | Update telescope integration for zk

This commit is contained in:
juan 2022-08-07 15:43:53 +08:00
parent 5e51f8ed36
commit 51c8fa7853
Signed by: juan
GPG Key ID: 5C1E5093C74F1DC7
3 changed files with 21 additions and 43 deletions

View File

@ -120,7 +120,7 @@ return require('packer').startup(function(use)
'nvim-telescope/telescope.nvim', 'nvim-telescope/telescope.nvim',
requires = {{'nvim-lua/plenary.nvim'}}, requires = {{'nvim-lua/plenary.nvim'}},
config = function() require "plugins.telescope" end, config = function() require "plugins.telescope" end,
cmd = 'Telescope' event = "UIEnter"
} }
use {'preservim/tagbar', cmd = 'TagbarToggle'} use {'preservim/tagbar', cmd = 'TagbarToggle'}
use { use {
@ -185,7 +185,9 @@ return require('packer').startup(function(use)
use {"tpope/vim-fugitive", cmd = "G"} use {"tpope/vim-fugitive", cmd = "G"}
use { use {
"mickael-menu/zk-nvim", "mickael-menu/zk-nvim",
filetypes = {'markdown'}, requires = {"nvim-telescope/telescope.nvim"},
after = {"nvim-telescope/telescope.nvim"},
ft = {'markdown'},
config = function() require "plugins.zk" end config = function() require "plugins.zk" end
} }

View File

@ -1,27 +1,6 @@
require('telescope').setup { require('telescope').setup {
defaults = { defaults = {layout_strategy = 'vertical', layout_config = {height = 0.95}},
-- Default configuration for telescope goes here: pickers = {},
-- config_key = value, extensions = {}
-- ..
layout_strategy = 'vertical',
layout_config = {height = 0.95}
},
pickers = {
-- Default configuration for builtin pickers goes here:
-- picker_name = {
-- picker_config_key = value,
-- ...
-- }
-- Now the picker_config_key will be applied every time you call this
-- builtin picker
},
extensions = {
-- Your extension configuration goes here:
-- extension_name = {
-- extension_config_key = value,
-- }
-- please take a look at the readme of the extension you want to configure
}
} }

View File

@ -1,21 +1,18 @@
require("zk").setup({ require("zk").setup({
-- can be "telescope", "fzf" or "select" (`vim.ui.select`) -- can be "telescope", "fzf" or "select" (`vim.ui.select`)
-- it's recommended to use "telescope" or "fzf" -- it's recommended to use "telescope" or "fzf"
picker = "telescope", picker = "telescope",
lsp = { lsp = {
-- `config` is passed to `vim.lsp.start_client(config)` -- `config` is passed to `vim.lsp.start_client(config)`
config = { config = {
cmd = { "zk", "lsp" }, cmd = {"zk", "lsp"},
name = "zk", name = "zk"
-- on_attach = ... -- on_attach = ...
-- etc, see `:h vim.lsp.start_client()` -- etc, see `:h vim.lsp.start_client()`
}, },
-- automatically attach buffers in a zk notebook that match the given filetypes -- automatically attach buffers in a zk notebook that match the given filetypes
auto_attach = { auto_attach = {enabled = true, filetypes = {"markdown"}}
enabled = true, }
filetypes = { "markdown" },
},
},
}) })