From 6fdb0f9c198459cc411bb7240951021954f5b158 Mon Sep 17 00:00:00 2001 From: spike Date: Tue, 27 Sep 2022 00:17:12 +0200 Subject: [PATCH] WIP: per project lsp settings --- TODO | 1 + after/plugin/lspAutostart.lua | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 after/plugin/lspAutostart.lua diff --git a/TODO b/TODO index 2c3856d..9e5204f 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,4 @@ +-WARN: finish after/plugin/lspAutostart.lua : read per project lsp settings -INFO:using extranl ui process in neovim: check fzflua,iron.nvim - add tag="*" to plugins that use tags - use libmodal + whichkey ? diff --git a/after/plugin/lspAutostart.lua b/after/plugin/lspAutostart.lua new file mode 100644 index 0000000..17037d5 --- /dev/null +++ b/after/plugin/lspAutostart.lua @@ -0,0 +1,30 @@ +-- helper module for setting custom lsp settings per project +-- will be used for setting autostart of lspclient per projects + +local autocmd = vim.api.nvim_create_autocmd +local augroup = vim.api.nvim_create_augroup + +local augroup_name = "spike_lsp" + +local function per_project_file() + local cwd = vim.fn.getcwd() + -- TODO: + -- check if there is a custom .nvim-lsp file in dir + -- read custom lsp config from file in table format + -- clean merge it ? with local template config to avoid random vars + -- setup local callback functions automatically called if certain settings + -- are present. +end + + +augroup( augroup_name ,{}) +autocmd({"BufReadPre"},{ + group = augroup_name, + pattern = "*", + callback = per_project_file, +}) +autocmd({"DirChanged"},{ + group = augroup_name, + pattern = "window", + callback = per_project_file +})