Lazy-load telescope

This commit is contained in:
elkowar 2021-05-06 20:54:55 +02:00
parent 945eddd33e
commit d2d7afd367
No known key found for this signature in database
GPG key ID: E321AD71B1D1F27F
4 changed files with 32 additions and 13 deletions

View file

@ -9,11 +9,17 @@
(macro make-errors-epic [f] (macro make-errors-epic [f]
`(xpcall #,f #(a.println (fennel.traceback $1)))) `(xpcall #,f #(a.println (fennel.traceback $1))))
(make-errors-epic (require "plugins.lsp")) (make-errors-epic (require "plugins.lsp"))
(make-errors-epic (require "keybinds")) (make-errors-epic (require "keybinds"))
(pkg telescope.nvim []
(make-errors-epic (require "plugins.telescope"))) ; called from packer config
(fn _G.load_telescope []
(require "plugins.telescope"))
;(pkg telescope.nvim []
;(make-errors-epic (require "plugins.telescope"))))
(pkg galaxyline.nvim [] (pkg galaxyline.nvim []
(make-errors-epic (require "plugins.galaxyline"))) (make-errors-epic (require "plugins.galaxyline")))
(pkg nvim-bufferline.lua [] (pkg nvim-bufferline.lua []

View file

@ -13,6 +13,8 @@
(utils.keymap :i :<esc> "compe#close('<esc>')" {:expr true}) (utils.keymap :i :<esc> "compe#close('<esc>')" {:expr true})
(utils.keymap :n :<C-p> "<cmd>Telescope find_files<cr>")
(fn cmd [s desc] [(.. "<cmd>" s "<cr>") desc]) (fn cmd [s desc] [(.. "<cmd>" s "<cr>") desc])

View file

@ -48,16 +48,23 @@
((. lsp lsp-name :setup) merged-opts))) ((. lsp lsp-name :setup) merged-opts)))
(let [capabilities (vim.lsp.protocol.make_client_capabilities)] (let [capabilities (vim.lsp.protocol.make_client_capabilities)]
(set capabilities.textDocument.completion.completionItem.snippetSupport true) (set capabilities.textDocument.completion.completionItem.snippetSupport true)
(set capabilities.textDocument.completion.completionItem.resolveSupport (set capabilities.textDocument.completion.completionItem.resolveSupport
{ :properties ["documentation" "detail" "additionalTextEdits"]}) {:properties ["documentation" "detail" "additionalTextEdits"]})
(init-lsp :rust_analyzer { :capabilities capabilities})) (lsp.rust_analyzer.setup
{:capabilities capabilities
:on_attach (fn [...]
(on_attach ...)
(pkg rust-tools.nvim [rust-tools (require "rust-tools")]
(rust-tools.setup { :tools { :inlay_hints { :show_parameter_hints false}}})))}))
(init-lsp :tsserver { :root_dir (lsp.util.root_pattern "package.json")}) (init-lsp :tsserver {:root_dir (lsp.util.root_pattern "package.json")})
(init-lsp :jsonls { :commands { :Format [ #(vim.lsp.buf.range_formatting [] [0 0] [(vim.fn.line "$") 0])]}}) (init-lsp :jsonls {:commands {:Format [ #(vim.lsp.buf.range_formatting [] [0 0] [(vim.fn.line "$") 0])]}})
(init-lsp :denols { :root_dir (better_root_pattern [".git"] ["package.json"])}) (init-lsp :denols {:root_dir (better_root_pattern [".git"] ["package.json"])})
(init-lsp :hls { :settings { :languageServerHaskell { :formattingProvider "stylish-haskell"}}}) (init-lsp :hls {:settings {:languageServerHaskell {:formattingProvider "stylish-haskell"}}})
(init-lsp :ocamllsp) (init-lsp :ocamllsp)
(init-lsp :vimls) (init-lsp :vimls)
(init-lsp :bashls) (init-lsp :bashls)
@ -170,9 +177,6 @@
; >>>>> ; >>>>>
(pkg rust-tools.nvim [rust-tools (require "rust-tools")]
(rust-tools.setup { :tools { :inlay_hints { :show_parameter_hints false}}}))
(set vim.o.signcolumn "yes") (set vim.o.signcolumn "yes")

View file

@ -50,7 +50,7 @@ require("packer").startup(function(use)
use { use {
"Olical/aniseed", "Olical/aniseed",
tag = "v3.16.0" --tag = "v3.16.0"
} }
-- general purpose lua wrappers for nvim stuff -- general purpose lua wrappers for nvim stuff
@ -151,7 +151,14 @@ require("packer").startup(function(use)
use "nvim-lua/popup.nvim" use "nvim-lua/popup.nvim"
use "nvim-lua/plenary.nvim" use "nvim-lua/plenary.nvim"
use "nvim-telescope/telescope.nvim"
use {
"nvim-telescope/telescope.nvim",
cmd = { "Telescope" },
config = function()
_G.load_telescope()
end
}
--use "RishabhRD/popfix" --use "RishabhRD/popfix"
--use "RishabhRD/nvim-lsputils" --use "RishabhRD/nvim-lsputils"