refactor: replace deprecated API calls (#4568)

* chore: bump plugins version

* refactor: replace deprecated API calls

* chore(lsp): update skipped servers list

* ci: update workflows

* ci: update release names in installer script

* ci: use action-setup-vim
This commit is contained in:
kylo252 2024-05-28 13:46:11 +02:00 committed by GitHub
parent 64764a2656
commit 3715ae645d
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: B5690EEEBB952194
24 changed files with 91 additions and 115 deletions

View file

@ -17,7 +17,7 @@ jobs:
PR_NUMBER: ${{ github.event.pull_request.number }} PR_NUMBER: ${{ github.event.pull_request.number }}
PR_TITLE: ${{ github.event.pull_request.title }} PR_TITLE: ${{ github.event.pull_request.title }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: install commitlint - name: install commitlint
run: | run: |
npm install --save-dev @commitlint/cli npm install --save-dev @commitlint/cli

View file

@ -13,9 +13,9 @@ on:
jobs: jobs:
stylua-check: stylua-check:
name: "Formatting check with Stylua" name: "Formatting check with Stylua"
runs-on: ubuntu-20.04 runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Lint with stylua - name: Lint with stylua
uses: JohnnyMorganz/stylua-action@v2 uses: JohnnyMorganz/stylua-action@v2
@ -27,18 +27,18 @@ jobs:
shfmt-check: shfmt-check:
name: "Formatting check with shfmt" name: "Formatting check with shfmt"
runs-on: ubuntu-20.04 runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Setup Go - name: Setup Go
uses: actions/setup-go@v3 uses: actions/setup-go@v5
with: with:
go-version: "1.18" go-version: '^1.21'
- name: Use shfmt - name: Use shfmt
run: | run: |
go install mvdan.cc/sh/v3/cmd/shfmt@v3.6 go install mvdan.cc/sh/v3/cmd/shfmt@latest
# https://google.github.io/styleguide/shellguide.html # https://google.github.io/styleguide/shellguide.html
- name: Check formatting - name: Check formatting

View file

@ -21,10 +21,10 @@ jobs:
include: include:
- runner: ubuntu-latest - runner: ubuntu-latest
os: linux os: linux
neovim: v0.9.5 neovim: v0.10.0
- runner: macos-latest - runner: macos-latest
os: osx os: osx
neovim: v0.9.5 neovim: v0.10.0
- runner: ubuntu-22.04 - runner: ubuntu-22.04
os: linux os: linux
neovim: nightly neovim: nightly
@ -33,14 +33,13 @@ jobs:
neovim: nightly neovim: nightly
runs-on: ${{ matrix.runner }} runs-on: ${{ matrix.runner }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Install neovim binary from release - name: Install neovim binary
env: uses: rhysd/action-setup-vim@v1
RELEASE_VER: ${{ matrix.neovim }} with:
run: | neovim: true
echo "$HOME/.local/bin" >> "$GITHUB_PATH" version: ${{ matrix.neovim }}
bash ./utils/installer/install-neovim-from-release
- name: Install LunarVim - name: Install LunarVim
timeout-minutes: 4 timeout-minutes: 4
@ -72,13 +71,13 @@ jobs:
shell: pwsh shell: pwsh
steps: steps:
# it's not currently possbile to run tests on windows, see nvim-lua/plenary.nvim#255 # it's not currently possbile to run tests on windows, see nvim-lua/plenary.nvim#255
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Install neovim binary - name: Install neovim binary
uses: rhysd/action-setup-vim@v1 uses: rhysd/action-setup-vim@v1
with: with:
neovim: true neovim: true
version: v0.9.1 version: v0.10.0
- name: Install LunarVim - name: Install LunarVim
timeout-minutes: 4 timeout-minutes: 4

View file

@ -13,9 +13,9 @@ on:
jobs: jobs:
lua-linter: lua-linter:
name: "Linting with luacheck" name: "Linting with luacheck"
runs-on: ubuntu-20.04 runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: leafo/gh-actions-lua@v8 - uses: leafo/gh-actions-lua@v8
- uses: leafo/gh-actions-luarocks@v4 - uses: leafo/gh-actions-luarocks@v4
@ -30,7 +30,7 @@ jobs:
name: Shellcheck name: Shellcheck
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Run ShellCheck - name: Run ShellCheck
uses: ludeeus/action-shellcheck@master uses: ludeeus/action-shellcheck@master
with: with:

View file

@ -26,7 +26,7 @@ jobs:
contents: write contents: write
pull-requests: write pull-requests: write
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Install neovim binary - name: Install neovim binary
uses: rhysd/action-setup-vim@v1 uses: rhysd/action-setup-vim@v1

View file

@ -1,7 +1,7 @@
local M = {} local M = {}
if vim.fn.has "nvim-0.9" ~= 1 then if vim.fn.has "nvim-0.10" ~= 1 then
vim.notify("Please upgrade your Neovim base installation. Lunarvim requires v0.9+", vim.log.levels.WARN) vim.notify("Please upgrade your Neovim base installation. Lunarvim requires v0.10+", vim.log.levels.WARN)
vim.wait(5000, function() vim.wait(5000, function()
---@diagnostic disable-next-line: redundant-return-value ---@diagnostic disable-next-line: redundant-return-value
return false return false

View file

@ -89,7 +89,7 @@ function M.get_sections()
val = function() val = function()
local alpha_wins = vim.tbl_filter(function(win) local alpha_wins = vim.tbl_filter(function(win)
local buf = vim.api.nvim_win_get_buf(win) local buf = vim.api.nvim_win_get_buf(win)
return vim.api.nvim_buf_get_option(buf, "filetype") == "alpha" return vim.api.nvim_get_option_value("filetype", { buf = buf }) == "alpha"
end, vim.api.nvim_list_wins()) end, vim.api.nvim_list_wins())
if vim.api.nvim_win_get_height(alpha_wins[#alpha_wins]) < 36 then if vim.api.nvim_win_get_height(alpha_wins[#alpha_wins]) < 36 then

View file

@ -105,17 +105,17 @@ function M.load_defaults()
if lvim.builtin.breadcrumbs.active then if lvim.builtin.breadcrumbs.active then
require("lvim.core.breadcrumbs").get_winbar() require("lvim.core.breadcrumbs").get_winbar()
end end
local statusline_hl = vim.api.nvim_get_hl_by_name("StatusLine", true) local statusline_hl = vim.api.nvim_get_hl(0, { name = "StatusLine" })
local cursorline_hl = vim.api.nvim_get_hl_by_name("CursorLine", true) local cursorline_hl = vim.api.nvim_get_hl(0, { name = "CursorLine" })
local normal_hl = vim.api.nvim_get_hl_by_name("Normal", true) local normal_hl = vim.api.nvim_get_hl(0, { name = "Normal" })
vim.api.nvim_set_hl(0, "CmpItemKindCopilot", { fg = "#6CC644" }) vim.api.nvim_set_hl(0, "CmpItemKindCopilot", { fg = "#6CC644" })
vim.api.nvim_set_hl(0, "CmpItemKindTabnine", { fg = "#CA42F0" }) vim.api.nvim_set_hl(0, "CmpItemKindTabnine", { fg = "#CA42F0" })
vim.api.nvim_set_hl(0, "CmpItemKindCrate", { fg = "#F64D00" }) vim.api.nvim_set_hl(0, "CmpItemKindCrate", { fg = "#F64D00" })
vim.api.nvim_set_hl(0, "CmpItemKindEmoji", { fg = "#FDE030" }) vim.api.nvim_set_hl(0, "CmpItemKindEmoji", { fg = "#FDE030" })
vim.api.nvim_set_hl(0, "SLCopilot", { fg = "#6CC644", bg = statusline_hl.background }) vim.api.nvim_set_hl(0, "SLCopilot", { fg = "#6CC644", bg = statusline_hl.bg })
vim.api.nvim_set_hl(0, "SLGitIcon", { fg = "#E8AB53", bg = cursorline_hl.background }) vim.api.nvim_set_hl(0, "SLGitIcon", { fg = "#E8AB53", bg = cursorline_hl.bg })
vim.api.nvim_set_hl(0, "SLBranchName", { fg = normal_hl.foreground, bg = cursorline_hl.background }) vim.api.nvim_set_hl(0, "SLBranchName", { fg = normal_hl.fg, bg = cursorline_hl.bg })
vim.api.nvim_set_hl(0, "SLSeparator", { fg = cursorline_hl.background, bg = statusline_hl.background }) vim.api.nvim_set_hl(0, "SLSeparator", { fg = cursorline_hl.fg, bg = statusline_hl.bg })
end, end,
}, },
}, },

View file

@ -1,7 +1,6 @@
local M = {} local M = {}
-- local Log = require "lvim.core.log" -- local Log = require "lvim.core.log"
local icons = lvim.icons.kind local icons = lvim.icons.kind
M.config = function() M.config = function()
@ -94,18 +93,21 @@ M.setup = function()
end end
end end
local function isempty(s)
return s == nil or s == ""
end
M.get_filename = function() M.get_filename = function()
local filename = vim.fn.expand "%:t" local filename = vim.fn.expand "%:t"
local extension = vim.fn.expand "%:e" local extension = vim.fn.expand "%:e"
local f = require "lvim.utils.functions"
if not f.isempty(filename) then if not isempty(filename) then
local file_icon, hl_group local file_icon, hl_group
local devicons_ok, devicons = pcall(require, "nvim-web-devicons") local devicons_ok, devicons = pcall(require, "nvim-web-devicons")
if lvim.use_icons and devicons_ok then if lvim.use_icons and devicons_ok then
file_icon, hl_group = devicons.get_icon(filename, extension, { default = true }) file_icon, hl_group = devicons.get_icon(filename, extension, { default = true })
if f.isempty(file_icon) then if isempty(file_icon) then
file_icon = lvim.icons.kind.File file_icon = lvim.icons.kind.File
end end
else else
@ -135,8 +137,8 @@ M.get_filename = function()
-- file_icon = lvim.icons.ui.DebugConsole -- file_icon = lvim.icons.ui.DebugConsole
-- end -- end
local navic_text = vim.api.nvim_get_hl_by_name("Normal", true) local navic_text_hl = vim.api.nvim_get_hl(0, { name = "Normal" })
vim.api.nvim_set_hl(0, "Winbar", { fg = navic_text.foreground }) vim.api.nvim_set_hl(0, "Winbar", { fg = navic_text_hl.fg })
return " " .. "%#" .. hl_group .. "#" .. file_icon .. "%*" .. " " .. "%#Winbar#" .. filename .. "%*" return " " .. "%#" .. hl_group .. "#" .. file_icon .. "%*" .. " " .. "%#Winbar#" .. filename .. "%*"
end end
@ -157,7 +159,7 @@ local get_gps = function()
return "" return ""
end end
if not require("lvim.utils.functions").isempty(gps_location) then if not isempty(gps_location) then
return "%#NavicSeparator#" .. lvim.icons.ui.ChevronRight .. "%* " .. gps_location return "%#NavicSeparator#" .. lvim.icons.ui.ChevronRight .. "%* " .. gps_location
else else
return "" return ""
@ -172,19 +174,18 @@ M.get_winbar = function()
if excludes() then if excludes() then
return return
end end
local f = require "lvim.utils.functions"
local value = M.get_filename() local value = M.get_filename()
local gps_added = false local gps_added = false
if not f.isempty(value) then if not isempty(value) then
local gps_value = get_gps() local gps_value = get_gps()
value = value .. " " .. gps_value value = value .. " " .. gps_value
if not f.isempty(gps_value) then if not isempty(gps_value) then
gps_added = true gps_added = true
end end
end end
if not f.isempty(value) and f.get_buf_option "mod" then if not isempty(value) and vim.api.nvim_get_option_value("mod", { buf = 0 }) then
-- TODO: replace with circle -- TODO: replace with circle
local mod = "%#LspCodeLens#" .. lvim.icons.ui.Circle .. "%*" local mod = "%#LspCodeLens#" .. lvim.icons.ui.Circle .. "%*"
if gps_added then if gps_added then
@ -196,7 +197,7 @@ M.get_winbar = function()
local num_tabs = #vim.api.nvim_list_tabpages() local num_tabs = #vim.api.nvim_list_tabpages()
if num_tabs > 1 and not f.isempty(value) then if num_tabs > 1 and not isempty(value) then
local tabpage_number = tostring(vim.api.nvim_tabpage_get_number(0)) local tabpage_number = tostring(vim.api.nvim_tabpage_get_number(0))
value = value .. "%=" .. tabpage_number .. "/" .. tostring(num_tabs) value = value .. "%=" .. tabpage_number .. "/" .. tostring(num_tabs)
end end

View file

@ -207,7 +207,7 @@ function M.buf_kill(kill_command, bufnr, force)
force = true force = true
else return else return
end end
elseif api.nvim_buf_get_option(bufnr, "buftype") == "terminal" then elseif api.nvim_get_option_value("buftype", { buf = 0 }) == "terminal" then
choice = fn.confirm(fmt([[Close "%s"?]], bufname), "&Yes\n&No\n&Cancel") choice = fn.confirm(fmt([[Close "%s"?]], bufname), "&Yes\n&No\n&Cancel")
if choice == 1 then if choice == 1 then
force = true force = true

View file

@ -134,7 +134,7 @@ M.config = function()
active = true, active = true,
on_config_done = nil, on_config_done = nil,
enabled = function() enabled = function()
local buftype = vim.api.nvim_buf_get_option(0, "buftype") local buftype = vim.api.nvim_get_option_value("buftype", { buf = 0 })
if buftype == "prompt" then if buftype == "prompt" then
return false return false
end end

View file

@ -148,7 +148,7 @@ M.setup_ui = function()
title = "dap-ui", title = "dap-ui",
icon = "", icon = "",
on_open = function(win) on_open = function(win)
vim.api.nvim_buf_set_option(vim.api.nvim_win_get_buf(win), "filetype", "markdown") vim.api.nvim_set_option_value("filetype", "markdown", { buf = vim.api.nvim_win_get_buf(win) })
end, end,
}) })

View file

@ -126,7 +126,7 @@ local function make_auto_lsp_info(ft)
end end
function M.toggle_popup(ft) function M.toggle_popup(ft)
local clients = vim.lsp.get_active_clients() local clients = vim.lsp.get_clients()
local client_names = {} local client_names = {}
local bufnr = vim.api.nvim_get_current_buf() local bufnr = vim.api.nvim_get_current_buf()
local ts_active_buffers = vim.tbl_keys(vim.treesitter.highlighter.active) local ts_active_buffers = vim.tbl_keys(vim.treesitter.highlighter.active)

View file

@ -81,19 +81,19 @@ function M.icon_setup()
end end
local function get_hl_by_name(name) local function get_hl_by_name(name)
local ret = vim.api.nvim_get_hl_by_name(name.group, true) local ret = vim.api.nvim_get_hl(0, { name = name.group })
return string.format("#%06x", ret[name.property]) return string.format("#%06x", ret[name.property])
end end
local found, icon_hl = pcall(get_hl_by_name, { group = "NvimTreeFolderIcon", property = "foreground" }) local found, icon_color = pcall(get_hl_by_name, { group = "NvimTreeFolderIcon", property = "fg" })
if not found then if not found then
icon_hl = "#42A5F5" icon_color = "#42A5F5"
end end
devicons.set_icon { devicons.set_icon {
lir_folder_icon = { lir_folder_icon = {
icon = lvim.builtin.lir.icon, icon = lvim.builtin.lir.icon,
color = icon_hl, color = icon_color,
name = "LirFolderNode", name = "LirFolderNode",
}, },
} }

View file

@ -93,7 +93,7 @@ return {
}, },
lsp = { lsp = {
function() function()
local buf_clients = vim.lsp.get_active_clients { bufnr = 0 } local buf_clients = vim.lsp.get_clients { bufnr = 0 }
if #buf_clients == 0 then if #buf_clients == 0 then
return "LSP Inactive" return "LSP Inactive"
end end
@ -146,7 +146,7 @@ return {
spaces = { spaces = {
function() function()
local shiftwidth = vim.api.nvim_buf_get_option(0, "shiftwidth") local shiftwidth = vim.api.nvim_get_option_value("shiftwidth", { buf = 0 })
return lvim.icons.ui.Tab .. " " .. shiftwidth return lvim.icons.ui.Tab .. " " .. shiftwidth
end, end,
padding = 1, padding = 1,

View file

@ -52,12 +52,12 @@ function Popup:display(content_provider)
-- window options -- window options
for key, value in pairs(self.win_opts) do for key, value in pairs(self.win_opts) do
vim.api.nvim_win_set_option(self.win_id or 0, key, value) vim.api.nvim_set_option_value(key, value, { win = self.win_id or 0, scope = "local" })
end end
-- buffer options -- buffer options
for key, value in pairs(self.buf_opts) do for key, value in pairs(self.buf_opts) do
vim.api.nvim_buf_set_option(self.buffer, key, value) vim.api.nvim_set_option_value(key, value, { buf = self.buffer })
end end
end end

View file

@ -6,7 +6,9 @@ local skipped_servers = {
"azure_pipelines_ls", "azure_pipelines_ls",
"basedpyright", "basedpyright",
"biome", "biome",
"bzl",
"ccls", "ccls",
"css_variables",
"cssmodules_ls", "cssmodules_ls",
"custom_elements_ls", "custom_elements_ls",
"denols", "denols",
@ -25,6 +27,7 @@ local skipped_servers = {
"golangci_lint_ls", "golangci_lint_ls",
"gradle_ls", "gradle_ls",
"graphql", "graphql",
"harper_ls",
"hdl_checker", "hdl_checker",
"hydra_lsp", "hydra_lsp",
"htmx", "htmx",
@ -71,7 +74,9 @@ local skipped_servers = {
"swift_mesonls", "swift_mesonls",
"templ", "templ",
"tflint", "tflint",
"tinymist",
"unocss", "unocss",
"vale_ls",
"vacuum", "vacuum",
"verible", "verible",
"v_analyzer", "v_analyzer",

View file

@ -5,7 +5,7 @@ local autocmds = require "lvim.core.autocmds"
local function add_lsp_buffer_options(bufnr) local function add_lsp_buffer_options(bufnr)
for k, v in pairs(lvim.lsp.buffer_options) do for k, v in pairs(lvim.lsp.buffer_options) do
vim.api.nvim_buf_set_option(bufnr, k, v) vim.api.nvim_set_option_value(k, v, { buf = bufnr })
end end
end end

View file

@ -4,7 +4,7 @@ local tbl = require "lvim.utils.table"
local Log = require "lvim.core.log" local Log = require "lvim.core.log"
function M.is_client_active(name) function M.is_client_active(name)
local clients = vim.lsp.get_active_clients() local clients = vim.lsp.get_clients()
return tbl.find_first(clients, function(client) return tbl.find_first(clients, function(client)
return client.name == name return client.name == name
end) end)
@ -12,7 +12,7 @@ end
function M.get_active_clients_by_ft(filetype) function M.get_active_clients_by_ft(filetype)
local matches = {} local matches = {}
local clients = vim.lsp.get_active_clients() local clients = vim.lsp.get_clients()
for _, client in pairs(clients) do for _, client in pairs(clients) do
local supported_filetypes = client.config.filetypes or {} local supported_filetypes = client.config.filetypes or {}
if client.name ~= "null-ls" and vim.tbl_contains(supported_filetypes, filetype) then if client.name ~= "null-ls" and vim.tbl_contains(supported_filetypes, filetype) then

View file

@ -1,16 +0,0 @@
local M = {}
function M.isempty(s)
return s == nil or s == ""
end
function M.get_buf_option(opt)
local status_ok, buf_option = pcall(vim.api.nvim_buf_get_option, 0, opt)
if not status_ok then
return nil
else
return buf_option
end
end
return M

View file

@ -12,7 +12,7 @@
"commit": "33eb067" "commit": "33eb067"
}, },
"bufferline.nvim": { "bufferline.nvim": {
"commit": "73540cb" "commit": "73edc1f"
}, },
"cmp-buffer": { "cmp-buffer": {
"commit": "3022dbc" "commit": "3022dbc"
@ -21,7 +21,7 @@
"commit": "d250c63" "commit": "d250c63"
}, },
"cmp-nvim-lsp": { "cmp-nvim-lsp": {
"commit": "5af77f5" "commit": "39e2eda"
}, },
"cmp-path": { "cmp-path": {
"commit": "91ff86c" "commit": "91ff86c"
@ -30,7 +30,7 @@
"commit": "05a9ab2" "commit": "05a9ab2"
}, },
"friendly-snippets": { "friendly-snippets": {
"commit": "3e9a3f5" "commit": "dd2fd12"
}, },
"gitsigns.nvim": { "gitsigns.nvim": {
"commit": "805610a" "commit": "805610a"
@ -39,7 +39,7 @@
"commit": "9637670" "commit": "9637670"
}, },
"lazy.nvim": { "lazy.nvim": {
"commit": "bef521a" "commit": "8f19915"
}, },
"lir.nvim": { "lir.nvim": {
"commit": "7a9d45d" "commit": "7a9d45d"
@ -51,61 +51,61 @@
"commit": "08bbc93" "commit": "08bbc93"
}, },
"mason-lspconfig.nvim": { "mason-lspconfig.nvim": {
"commit": "273fdde" "commit": "a4caa0d"
}, },
"mason.nvim": { "mason.nvim": {
"commit": "751b1fc" "commit": "49ff59a"
}, },
"neodev.nvim": { "neodev.nvim": {
"commit": "ce9a2e8" "commit": "ce9a2e8"
}, },
"nlsp-settings.nvim": { "nlsp-settings.nvim": {
"commit": "707b431" "commit": "d92035e"
}, },
"none-ls.nvim": { "none-ls.nvim": {
"commit": "3a48266" "commit": "3a48266"
}, },
"nvim-autopairs": { "nvim-autopairs": {
"commit": "14e9737" "commit": "c15de7e"
}, },
"nvim-cmp": { "nvim-cmp": {
"commit": "cd2cf0c" "commit": "5260e5e"
}, },
"nvim-dap": { "nvim-dap": {
"commit": "13ce59d" "commit": "5a2f712"
}, },
"nvim-dap-ui": { "nvim-dap-ui": {
"commit": "34160a7" "commit": "34160a7"
}, },
"nvim-lspconfig": { "nvim-lspconfig": {
"commit": "aa5f4f4" "commit": "eadcee1"
}, },
"nvim-navic": { "nvim-navic": {
"commit": "8649f69" "commit": "8649f69"
}, },
"nvim-tree.lua": { "nvim-tree.lua": {
"commit": "64f61e4" "commit": "2bc725a"
}, },
"nvim-treesitter": { "nvim-treesitter": {
"commit": "d5a1c2b" "commit": "30de5e7"
}, },
"nvim-ts-context-commentstring": { "nvim-ts-context-commentstring": {
"commit": "0bdccb9" "commit": "cb06438"
}, },
"nvim-web-devicons": { "nvim-web-devicons": {
"commit": "5b90678" "commit": "e37bb1f"
}, },
"onedarker.nvim": { "onedarker.nvim": {
"commit": "b00dd21" "commit": "b00dd21"
}, },
"plenary.nvim": { "plenary.nvim": {
"commit": "08e3019" "commit": "a3e3bc8"
}, },
"project.nvim": { "project.nvim": {
"commit": "8c6bad7" "commit": "8c6bad7"
}, },
"schemastore.nvim": { "schemastore.nvim": {
"commit": "8c46453" "commit": "9a5992a"
}, },
"structlog.nvim": { "structlog.nvim": {
"commit": "45b26a2" "commit": "45b26a2"
@ -114,16 +114,16 @@
"commit": "9ef21b2" "commit": "9ef21b2"
}, },
"telescope.nvim": { "telescope.nvim": {
"commit": "6312868" "commit": "d829aa6"
}, },
"toggleterm.nvim": { "toggleterm.nvim": {
"commit": "066cccf" "commit": "fee58a0"
}, },
"tokyonight.nvim": { "tokyonight.nvim": {
"commit": "67afeaf" "commit": "b9b494f"
}, },
"vim-illuminate": { "vim-illuminate": {
"commit": "e522e0d" "commit": "5eeb795"
}, },
"which-key.nvim": { "which-key.nvim": {
"commit": "4433e5e" "commit": "4433e5e"

View file

@ -41,8 +41,8 @@ _G.load_config = function()
require("vim.lsp.log").set_format_func(vim.inspect) require("vim.lsp.log").set_format_func(vim.inspect)
local nvim_lsp = require "lspconfig" local nvim_lsp = require "lspconfig"
local on_attach = function(_, bufnr) local on_attach = function(_, bufnr)
local function buf_set_option(...) local function buf_set_option(k, v)
vim.api.nvim_buf_set_option(bufnr, ...) vim.api.nvim_set_option_value(k, v, { buf = bufnr })
end end
buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc") buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc")

View file

@ -11,7 +11,7 @@ mkdir -p "${SNAPSHOT_DIR}"
export SNAPSHOT_PATH="${REPO_DIR}/snapshots/${SNAPSHOT_NAME}" export SNAPSHOT_PATH="${REPO_DIR}/snapshots/${SNAPSHOT_NAME}"
time lvim --headless \ time lvim --headless \
-c "luafile ./utils/ci/generate_new_lockfile.lua" -c "source ./utils/ci/generate_new_lockfile.lua"
temp=$(mktemp) temp=$(mktemp)

View file

@ -6,23 +6,14 @@ declare -r LV_INSTALL_PREFIX="${INSTALL_PREFIX:-"$HOME/.local"}"
declare -r RELEASE_VER="${RELEASE_VER:-latest}" # can be set to nightly declare -r RELEASE_VER="${RELEASE_VER:-latest}" # can be set to nightly
declare ARCHIVE_NAME declare ARCHIVE_NAME
declare RELEASE_NAME
declare OS declare OS
OS="$(uname -s)" OS="$(uname -s)"
if [ "$OS" == "Linux" ]; then if [ "$OS" == "Linux" ]; then
ARCHIVE_NAME="nvim-linux64" ARCHIVE_NAME="nvim-linux64"
RELEASE_NAME="nvim-linux64"
elif [ "$OS" == "Darwin" ]; then elif [ "$OS" == "Darwin" ]; then
if [ "$RELEASE_VER" == "nightly" ]; then ARCHIVE_NAME="nvim-macos-x86_64"
ARCHIVE_NAME="nvim-macos-x86_64"
RELEASE_NAME="nvim-macos-x86_64"
else
ARCHIVE_NAME="nvim-macos"
# for some reason the archive has a different name
RELEASE_NAME="nvim-osx64"
fi
else else
echo "$OS platform is not supported currently" echo "$OS platform is not supported currently"
exit 1 exit 1
@ -77,12 +68,8 @@ function install_neovim() {
pushd "$DOWNLOAD_DIR" pushd "$DOWNLOAD_DIR"
tar -xzf "$DOWNLOAD_DIR/$ARCHIVE_NAME.tar.gz" tar -xzf "$DOWNLOAD_DIR/$ARCHIVE_NAME.tar.gz"
popd popd
if [ ! -d "$DOWNLOAD_DIR/$RELEASE_NAME" ]; then
# fallback to archive name
RELEASE_NAME="$ARCHIVE_NAME"
fi
# https://dev.to/ackshaey/macos-vs-linux-the-cp-command-will-trip-you-up-2p00 # https://dev.to/ackshaey/macos-vs-linux-the-cp-command-will-trip-you-up-2p00
cp -r "$DOWNLOAD_DIR/$RELEASE_NAME/." "$LV_INSTALL_PREFIX" cp -r "$DOWNLOAD_DIR/$ARCHIVE_NAME/." "$LV_INSTALL_PREFIX"
echo "Installation complete!" echo "Installation complete!"
echo "Now you can run $LV_INSTALL_PREFIX/bin/nvim" echo "Now you can run $LV_INSTALL_PREFIX/bin/nvim"
} }