diff --git a/neovim/lua/plugins.lua b/neovim/lua/plugins.lua index 9d9595c..9046b3a 100644 --- a/neovim/lua/plugins.lua +++ b/neovim/lua/plugins.lua @@ -16,6 +16,16 @@ local function config_dark_notify() } end +-- Pin version dependent packages +pinned_commits = {} +if vim.fn.has('nvim-0.6.0') ~= 1 then + if vim.fn.has "nvim-0.5.1" == 1 then + pinned_commits["telescope"] = "80cdb00b221f69348afc4fb4b701f51eb8dd3120" + elseif vim.fn.has "nvim-0.5.0" == 1 then + pinned_commits["telescope"] = "587a10d1494d8ffa1229246228f0655db2f0a48a" + end +end + return require('packer').startup(function(use) -- Load things faster! use {'lewis6991/impatient.nvim', config = [[require('impatient')]]} @@ -237,6 +247,7 @@ return require('packer').startup(function(use) "nvim-lua/plenary.nvim", "nvim-lua/popup.nvim", }, + commit = pinned_commits["telescope"], config = function() require("plugins.telescope") end, } --[[ diff --git a/neovim/lua/plugins/lualine.lua b/neovim/lua/plugins/lualine.lua index 0cb762d..e1e22c4 100644 --- a/neovim/lua/plugins/lualine.lua +++ b/neovim/lua/plugins/lualine.lua @@ -60,6 +60,11 @@ function M.config_lualine(theme_name) } end + local diagnostic_plugin = "nvim_diagnostic" + if vim.fn.has('nvim-0.6.0') ~= 1 then + diagnostic_plugin = "nvim_lsp" + end + require("lualine").setup { options = { theme = theme_name, @@ -68,15 +73,15 @@ function M.config_lualine(theme_name) section_separators = {left = "", right = ""}, }, sections = { - lualine_a = {{"mode", fmt = function(str) return str:sub(1, 1) end}}, - lualine_b = {"FugitiveHead", "diff"}, - lualine_c = {"filename", { gps.get_location, cond = gps.is_available }}, - lualine_x = {M.custom_ffenc, "filetype"}, - lualine_y = {"progress", "location"}, + lualine_a = {{ "mode", fmt = function(str) return str:sub(1, 1) end }}, + lualine_b = { "FugitiveHead", "diff" }, + lualine_c = { "filename", { gps.get_location, cond = gps.is_available } }, + lualine_x = { M.custom_ffenc, "filetype" }, + lualine_y = { "progress", "location" }, lualine_z = { - {"diagnostics", sources = {"nvim_diagnostic"}}, - {M.mixed_indent, color = {bg = "#de4f1f"}}, - {M.trailing_whitespace, color = {bg = "#de4f1f"}}, + { "diagnostics", sources = { diagnostic_plugin } }, + { M.mixed_indent, color = { bg = "#de4f1f" } }, + { M.trailing_whitespace, color = { bg = "#de4f1f" } }, }, }, }