From 51c8fa78531108765a1dd3ea6781d442237e5cf1 Mon Sep 17 00:00:00 2001 From: juan Date: Sun, 7 Aug 2022 15:43:53 +0800 Subject: [PATCH] Fix | Update telescope integration for zk --- lua/pluginList.lua | 6 ++++-- lua/plugins/telescope.lua | 27 +++------------------------ lua/plugins/zk.lua | 31 ++++++++++++++----------------- 3 files changed, 21 insertions(+), 43 deletions(-) diff --git a/lua/pluginList.lua b/lua/pluginList.lua index 1571098..a8391ad 100644 --- a/lua/pluginList.lua +++ b/lua/pluginList.lua @@ -120,7 +120,7 @@ return require('packer').startup(function(use) 'nvim-telescope/telescope.nvim', requires = {{'nvim-lua/plenary.nvim'}}, config = function() require "plugins.telescope" end, - cmd = 'Telescope' + event = "UIEnter" } use {'preservim/tagbar', cmd = 'TagbarToggle'} use { @@ -185,7 +185,9 @@ return require('packer').startup(function(use) use {"tpope/vim-fugitive", cmd = "G"} use { "mickael-menu/zk-nvim", - filetypes = {'markdown'}, + requires = {"nvim-telescope/telescope.nvim"}, + after = {"nvim-telescope/telescope.nvim"}, + ft = {'markdown'}, config = function() require "plugins.zk" end } diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index 987a35e..07f55ed 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -1,27 +1,6 @@ require('telescope').setup { - defaults = { - -- Default configuration for telescope goes here: - -- config_key = value, - -- .. - 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 - } + defaults = {layout_strategy = 'vertical', layout_config = {height = 0.95}}, + pickers = {}, + extensions = {} } diff --git a/lua/plugins/zk.lua b/lua/plugins/zk.lua index 593ebc1..0429b87 100644 --- a/lua/plugins/zk.lua +++ b/lua/plugins/zk.lua @@ -1,21 +1,18 @@ require("zk").setup({ - -- can be "telescope", "fzf" or "select" (`vim.ui.select`) - -- it's recommended to use "telescope" or "fzf" - picker = "telescope", + -- can be "telescope", "fzf" or "select" (`vim.ui.select`) + -- it's recommended to use "telescope" or "fzf" + picker = "telescope", - lsp = { - -- `config` is passed to `vim.lsp.start_client(config)` - config = { - cmd = { "zk", "lsp" }, - name = "zk", - -- on_attach = ... - -- etc, see `:h vim.lsp.start_client()` - }, + lsp = { + -- `config` is passed to `vim.lsp.start_client(config)` + config = { + cmd = {"zk", "lsp"}, + name = "zk" + -- on_attach = ... + -- etc, see `:h vim.lsp.start_client()` + }, - -- automatically attach buffers in a zk notebook that match the given filetypes - auto_attach = { - enabled = true, - filetypes = { "markdown" }, - }, - }, + -- automatically attach buffers in a zk notebook that match the given filetypes + auto_attach = {enabled = true, filetypes = {"markdown"}} + } })