diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml index 4e4941a465..9106a3ad8b 100644 --- a/.github/workflows/commitlint.yml +++ b/.github/workflows/commitlint.yml @@ -17,7 +17,7 @@ jobs: PR_NUMBER: ${{ github.event.pull_request.number }} PR_TITLE: ${{ github.event.pull_request.title }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: install commitlint run: | npm install --save-dev @commitlint/cli diff --git a/.github/workflows/format.yaml b/.github/workflows/format.yaml index 576b9a5eee..31a88a7cb8 100644 --- a/.github/workflows/format.yaml +++ b/.github/workflows/format.yaml @@ -13,9 +13,9 @@ on: jobs: stylua-check: name: "Formatting check with Stylua" - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Lint with stylua uses: JohnnyMorganz/stylua-action@v2 @@ -27,18 +27,18 @@ jobs: shfmt-check: name: "Formatting check with shfmt" - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: - go-version: "1.18" + go-version: '^1.21' - name: Use shfmt 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 - name: Check formatting diff --git a/.github/workflows/install.yaml b/.github/workflows/install.yaml index 60c8890ae6..1e1100e56e 100644 --- a/.github/workflows/install.yaml +++ b/.github/workflows/install.yaml @@ -21,10 +21,10 @@ jobs: include: - runner: ubuntu-latest os: linux - neovim: v0.9.1 + neovim: v0.10.0 - runner: macos-latest os: osx - neovim: v0.9.1 + neovim: v0.10.0 - runner: ubuntu-22.04 os: linux neovim: nightly @@ -33,14 +33,13 @@ jobs: neovim: nightly runs-on: ${{ matrix.runner }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - name: Install neovim binary from release - env: - RELEASE_VER: ${{ matrix.neovim }} - run: | - echo "$HOME/.local/bin" >> "$GITHUB_PATH" - bash ./utils/installer/install-neovim-from-release + - name: Install neovim binary + uses: rhysd/action-setup-vim@v1 + with: + neovim: true + version: ${{ matrix.neovim }} - name: Install LunarVim timeout-minutes: 4 @@ -72,13 +71,13 @@ jobs: shell: pwsh steps: # 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 uses: rhysd/action-setup-vim@v1 with: neovim: true - version: v0.9.1 + version: v0.10.0 - name: Install LunarVim timeout-minutes: 4 diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index f136d442bb..272db252f6 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -13,9 +13,9 @@ on: jobs: lua-linter: name: "Linting with luacheck" - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: leafo/gh-actions-lua@v8 - uses: leafo/gh-actions-luarocks@v4 @@ -30,7 +30,7 @@ jobs: name: Shellcheck runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Run ShellCheck uses: ludeeus/action-shellcheck@master with: diff --git a/.github/workflows/plugins.yml b/.github/workflows/plugins.yml index 4d3d1eb6cc..d9b396d88f 100644 --- a/.github/workflows/plugins.yml +++ b/.github/workflows/plugins.yml @@ -26,7 +26,7 @@ jobs: contents: write pull-requests: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install neovim binary uses: rhysd/action-setup-vim@v1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 35e6a74823..48180c7a5e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,72 @@ All notable changes to this project will be documented in this file. -## [unreleased] +## [1.4.0] + +### Features + +- _(installer)_ added bun as a js package manager ([#4362](https://github.com/lunarvim/lunarvim/pull/4362)) +- _(lspconfig)_ add rounded borders to :LspInfo window ([#4208](https://github.com/lunarvim/lunarvim/pull/4208)) +- _(nvimtree)_ centralize selection ([#4160](https://github.com/lunarvim/lunarvim/pull/4160)) +- _(plugins)_ migrate from `null-ls` to `none-ls` ([#4392](https://github.com/lunarvim/lunarvim/pull/4392)) +- simplify example config, add links for user instead ([#4128](https://github.com/lunarvim/lunarvim/pull/4128)) +- don't move config on install ([#4129](https://github.com/lunarvim/lunarvim/pull/4129)) +- rounded border for hover and signatureHelp ([#4131](https://github.com/lunarvim/lunarvim/pull/4131)) +- lock new installations to nvim 0.9+ ([#3858](https://github.com/lunarvim/lunarvim/pull/3858)) +- use code chevrons ([#4184](https://github.com/lunarvim/lunarvim/pull/4184)) +- ignore missing keys for whichkey ([#4185](https://github.com/lunarvim/lunarvim/pull/4185)) +- [**breaking**] use prompts similar to `:confirm` in `buf_kill` ([#4186](https://github.com/lunarvim/lunarvim/pull/4186)) +- add starter.lvim link to config.example.lua ([#4200](https://github.com/lunarvim/lunarvim/pull/4200)) +- add example to the packer deprecation message ([#4201](https://github.com/lunarvim/lunarvim/pull/4201)) + +### Bugfix + +- _(alpha)_ account for different icon byte sizes ([#4130](https://github.com/lunarvim/lunarvim/pull/4130)) +- _(dap)_ ui opens when debugging ([#4116](https://github.com/lunarvim/lunarvim/pull/4116)) +- _(default-options)_ remove invalid guifont option ([#4447](https://github.com/lunarvim/lunarvim/pull/4447)) +- _(deprecation)_ only deprecate `tag == "*"` in lvim.plugins ([#4297](https://github.com/lunarvim/lunarvim/pull/4297)) +- _(icons)_ add some whitespace to the boolean icon ([#4163](https://github.com/lunarvim/lunarvim/pull/4163)) +- _(install)_ add newline after setup message ([#4533](https://github.com/lunarvim/lunarvim/pull/4533)) +- _(installer)_ dependency installation for Windows ([#4486](https://github.com/lunarvim/lunarvim/pull/4486)) +- _(lsp)_ add luv library by default to lua_ls ([#4067](https://github.com/lunarvim/lunarvim/pull/4067)) +- _(lsp)_ diagnostic codes already show by default ([#4070](https://github.com/lunarvim/lunarvim/pull/4070)) +- [**breaking**] _(lsp)_ switch to csharp_ls to avoid startup errors ([#4079](https://github.com/lunarvim/lunarvim/pull/4079)) +- _(lsp)_ lazy load mason on FileOpened ([#4100](https://github.com/lunarvim/lunarvim/pull/4100)) +- _(lsp)_ skip auto config server even if it's ensure installed ([#4243](https://github.com/lunarvim/lunarvim/pull/4243)) +- _(lsp)_ restore float border ([#4274](https://github.com/lunarvim/lunarvim/pull/4274)) +- _(lsp)_ adapt recent changes in `nvim-lspconfig` ([#4348](https://github.com/lunarvim/lunarvim/pull/4348)) +- _(lualine)_ use get_active_clients instead of deprecated function ([#4136](https://github.com/lunarvim/lunarvim/pull/4136)) +- _(nvim-tree)_ use local buffer keymaps ([#4090](https://github.com/lunarvim/lunarvim/pull/4090)) +- _(terminal)_ show lazygit bottom line ([#4548](https://github.com/lunarvim/lunarvim/pull/4548)) +- _(tests)_ set up lazy.nvim in the lsp test ([#4088](https://github.com/lunarvim/lunarvim/pull/4088)) +- _(treesitter)_ add a few parsers to `ensure_installed` ([#4121](https://github.com/lunarvim/lunarvim/pull/4121)) +- _(typo)_ `form` to `from` ([#4295](https://github.com/lunarvim/lunarvim/pull/4295)) +- _(user_command)_ update url in `LvimDocs` command ([#4081](https://github.com/lunarvim/lunarvim/pull/4081)) +- _(win)_ remove '-NoLogo' from vim.opt.shell ([#4232](https://github.com/lunarvim/lunarvim/pull/4232)) +- add missing LF to install script ([#4075](https://github.com/lunarvim/lunarvim/pull/4075)) +- replace obsolete icons ([#4111](https://github.com/lunarvim/lunarvim/pull/4111)) +- correct runtimepath order ([#4124](https://github.com/lunarvim/lunarvim/pull/4124)) +- support text if marksman lang server ([#4144](https://github.com/lunarvim/lunarvim/pull/4144)) +- circle icons was being cut off for some fonts +- handle context-commentstring setup ([#4451](https://github.com/lunarvim/lunarvim/pull/4451)) + +### Refactor + +- [**breaking**] _(lsp)_ deprecate `lvim.lsp.diagnostics` ([#3916](https://github.com/lunarvim/lunarvim/pull/3916)) +- _(lualine)_ use `string.format` to return unique names ([#4193](https://github.com/lunarvim/lunarvim/pull/4193)) + +### Documentation + +- add code_actions to example config ([#4029](https://github.com/lunarvim/lunarvim/pull/4029)) +- update broken links in example configs ([#4097](https://github.com/lunarvim/lunarvim/pull/4097)) +- use `master` instead of `rolling` in contributing.md ([#4115](https://github.com/lunarvim/lunarvim/pull/4115)) +- use `master` instead of `rolling` in contributing.md ([#4115](https://github.com/lunarvim/lunarvim/pull/4115)) + +### Performance + +- _(installer)_ use a shallow clone of lunarvim ([#4197](https://github.com/lunarvim/lunarvim/pull/4197)) + +## [1.3.0] ### Features diff --git a/lua/lvim/bootstrap.lua b/lua/lvim/bootstrap.lua index a5eb1c176a..2a2ac1d3e5 100644 --- a/lua/lvim/bootstrap.lua +++ b/lua/lvim/bootstrap.lua @@ -1,7 +1,7 @@ local M = {} -if vim.fn.has "nvim-0.9" ~= 1 then - vim.notify("Please upgrade your Neovim base installation. Lunarvim requires v0.9+", vim.log.levels.WARN) +if vim.fn.has "nvim-0.10" ~= 1 then + vim.notify("Please upgrade your Neovim base installation. Lunarvim requires v0.10+", vim.log.levels.WARN) vim.wait(5000, function() ---@diagnostic disable-next-line: redundant-return-value return false diff --git a/lua/lvim/core/alpha/dashboard.lua b/lua/lvim/core/alpha/dashboard.lua index 3dc8327872..1694789557 100644 --- a/lua/lvim/core/alpha/dashboard.lua +++ b/lua/lvim/core/alpha/dashboard.lua @@ -106,7 +106,7 @@ function M.get_sections() val = function() local alpha_wins = vim.tbl_filter(function(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()) if vim.api.nvim_win_get_height(alpha_wins[#alpha_wins]) < 36 then diff --git a/lua/lvim/core/autocmds.lua b/lua/lvim/core/autocmds.lua index 641198d723..64e9261502 100644 --- a/lua/lvim/core/autocmds.lua +++ b/lua/lvim/core/autocmds.lua @@ -105,17 +105,17 @@ function M.load_defaults() if lvim.builtin.breadcrumbs.active then require("lvim.core.breadcrumbs").get_winbar() end - local statusline_hl = vim.api.nvim_get_hl_by_name("StatusLine", true) - local cursorline_hl = vim.api.nvim_get_hl_by_name("CursorLine", true) - local normal_hl = vim.api.nvim_get_hl_by_name("Normal", true) + local statusline_hl = vim.api.nvim_get_hl(0, { name = "StatusLine" }) + local cursorline_hl = vim.api.nvim_get_hl(0, { name = "CursorLine" }) + 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, "CmpItemKindTabnine", { fg = "#CA42F0" }) vim.api.nvim_set_hl(0, "CmpItemKindCrate", { fg = "#F64D00" }) 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, "SLGitIcon", { fg = "#E8AB53", bg = cursorline_hl.background }) - vim.api.nvim_set_hl(0, "SLBranchName", { fg = normal_hl.foreground, bg = cursorline_hl.background }) - vim.api.nvim_set_hl(0, "SLSeparator", { fg = cursorline_hl.background, 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.bg }) + 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.fg, bg = statusline_hl.bg }) end, }, }, diff --git a/lua/lvim/core/autopairs.lua b/lua/lvim/core/autopairs.lua index a3e0d5947a..439de09622 100644 --- a/lua/lvim/core/autopairs.lua +++ b/lua/lvim/core/autopairs.lua @@ -19,18 +19,26 @@ function M.config() java = false, }, disable_filetype = { "TelescopePrompt", "spectre_panel" }, - ignored_next_char = string.gsub([[ [%w%%%'%[%"%.] ]], "%s+", ""), - enable_moveright = true, ---@usage disable when recording or executing a macro disable_in_macro = false, + ---@usage disable when insert after visual block mode + disable_in_visualblock = false, + disable_in_replace_mode = true, + ignored_next_char = string.gsub([[ [%w%%%'%[%"%.] ]], "%s+", ""), + enable_moveright = true, ---@usage add bracket pairs after quote enable_afterquote = true, + ---@usage trigger abbreviation + enable_abbr = false, + ---@usage switch for basic rule break undo sequence + break_undo = true, + map_cr = true, ---@usage map the key map_bs = true, ---@usage map to delete a pair if possible map_c_w = false, - ---@usage disable when insert after visual block mode - disable_in_visualblock = false, + ---@usage Map the key to delete a pair + map_c_h = false, ---@usage change default fast_wrap fast_wrap = { map = "", diff --git a/lua/lvim/core/breadcrumbs.lua b/lua/lvim/core/breadcrumbs.lua index 3ede0fca04..485458fbdf 100644 --- a/lua/lvim/core/breadcrumbs.lua +++ b/lua/lvim/core/breadcrumbs.lua @@ -1,7 +1,6 @@ local M = {} -- local Log = require "lvim.core.log" - local icons = lvim.icons.kind M.config = function() @@ -94,18 +93,21 @@ M.setup = function() end end +local function isempty(s) + return s == nil or s == "" +end + M.get_filename = function() local filename = vim.fn.expand "%:t" 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 devicons_ok, devicons = pcall(require, "nvim-web-devicons") if lvim.use_icons and devicons_ok then 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 end else @@ -135,8 +137,8 @@ M.get_filename = function() -- file_icon = lvim.icons.ui.DebugConsole -- end - local navic_text = vim.api.nvim_get_hl_by_name("Normal", true) - vim.api.nvim_set_hl(0, "Winbar", { fg = navic_text.foreground }) + local navic_text_hl = vim.api.nvim_get_hl(0, { name = "Normal" }) + vim.api.nvim_set_hl(0, "Winbar", { fg = navic_text_hl.fg }) return " " .. "%#" .. hl_group .. "#" .. file_icon .. "%*" .. " " .. "%#Winbar#" .. filename .. "%*" end @@ -157,7 +159,7 @@ local get_gps = function() return "" 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 else return "" @@ -172,19 +174,18 @@ M.get_winbar = function() if excludes() then return end - local f = require "lvim.utils.functions" local value = M.get_filename() local gps_added = false - if not f.isempty(value) then + if not isempty(value) then local gps_value = get_gps() value = value .. " " .. gps_value - if not f.isempty(gps_value) then + if not isempty(gps_value) then gps_added = true 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 local mod = "%#LspCodeLens#" .. lvim.icons.ui.Circle .. "%*" if gps_added then @@ -196,7 +197,7 @@ M.get_winbar = function() 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)) value = value .. "%=" .. tabpage_number .. "/" .. tostring(num_tabs) end diff --git a/lua/lvim/core/bufferline.lua b/lua/lvim/core/bufferline.lua index fba3e84a6e..057e7ca52a 100644 --- a/lua/lvim/core/bufferline.lua +++ b/lua/lvim/core/bufferline.lua @@ -56,6 +56,14 @@ M.config = function() }, }, options = { + themable = true, -- whether or not bufferline highlights can be overridden externally + -- style_preset = preset, + get_element_icon = nil, + show_duplicate_prefix = true, + duplicates_across_groups = true, + auto_toggle_bufferline = true, + move_wraps_at_ends = false, + groups = { items = {}, options = { toggle_hidden_on_enter = true } }, mode = "buffers", -- set to "tabs" to only show tabpages instead numbers = "none", -- can be "none" | "ordinal" | "buffer_id" | "both" | function close_command = function(bufnr) -- can be a string | function, see "Mouse actions" @@ -140,6 +148,7 @@ M.config = function() reveal = { "close" }, }, sort_by = "id", + debug = { logging = false }, }, } end @@ -198,7 +207,7 @@ function M.buf_kill(kill_command, bufnr, force) force = true else return 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") if choice == 1 then force = true diff --git a/lua/lvim/core/cmp.lua b/lua/lvim/core/cmp.lua index cd79609026..ea1b443034 100644 --- a/lua/lvim/core/cmp.lua +++ b/lua/lvim/core/cmp.lua @@ -134,7 +134,7 @@ M.config = function() active = true, on_config_done = nil, 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 return false end diff --git a/lua/lvim/core/dap.lua b/lua/lvim/core/dap.lua index cdb9b574aa..1c563e39d9 100644 --- a/lua/lvim/core/dap.lua +++ b/lua/lvim/core/dap.lua @@ -148,7 +148,7 @@ M.setup_ui = function() title = "dap-ui", icon = "", 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, }) diff --git a/lua/lvim/core/info.lua b/lua/lvim/core/info.lua index c413f0f171..c12edc302e 100644 --- a/lua/lvim/core/info.lua +++ b/lua/lvim/core/info.lua @@ -126,7 +126,7 @@ local function make_auto_lsp_info(ft) end function M.toggle_popup(ft) - local clients = vim.lsp.get_active_clients() + local clients = vim.lsp.get_clients() local client_names = {} local bufnr = vim.api.nvim_get_current_buf() local ts_active_buffers = vim.tbl_keys(vim.treesitter.highlighter.active) diff --git a/lua/lvim/core/lir.lua b/lua/lvim/core/lir.lua index 8eab024c8b..a8ed42c469 100644 --- a/lua/lvim/core/lir.lua +++ b/lua/lvim/core/lir.lua @@ -81,19 +81,19 @@ function M.icon_setup() end 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]) 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 - icon_hl = "#42A5F5" + icon_color = "#42A5F5" end devicons.set_icon { lir_folder_icon = { icon = lvim.builtin.lir.icon, - color = icon_hl, + color = icon_color, name = "LirFolderNode", }, } diff --git a/lua/lvim/core/log.lua b/lua/lvim/core/log.lua index 5bb2e390da..ba92462dfa 100644 --- a/lua/lvim/core/log.lua +++ b/lua/lvim/core/log.lua @@ -7,7 +7,6 @@ Log.levels = { WARN = 4, ERROR = 5, } -vim.tbl_add_reverse_lookup(Log.levels) local notify_opts = {} local log_notify_as_notification = false diff --git a/lua/lvim/core/lualine/components.lua b/lua/lvim/core/lualine/components.lua index a6593619ba..afcce6b0e4 100644 --- a/lua/lvim/core/lualine/components.lua +++ b/lua/lvim/core/lualine/components.lua @@ -93,7 +93,7 @@ return { }, lsp = { 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 return "LSP Inactive" end @@ -146,7 +146,7 @@ return { spaces = { 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 end, padding = 1, diff --git a/lua/lvim/core/nvimtree.lua b/lua/lvim/core/nvimtree.lua index a12a2b399f..8806c00c62 100644 --- a/lua/lvim/core/nvimtree.lua +++ b/lua/lvim/core/nvimtree.lua @@ -6,12 +6,17 @@ function M.config() active = true, on_config_done = nil, setup = { + experimental = {}, auto_reload_on_write = false, disable_netrw = false, hijack_cursor = false, hijack_netrw = true, hijack_unnamed_buffer_when_opening = false, - sort_by = "name", + sort = { + sorter = "name", + folders_first = true, + files_first = false, + }, root_dirs = {}, prefer_startup_root = false, sync_root_with_cwd = true, @@ -23,6 +28,8 @@ function M.config() adaptive_size = false, centralize_selection = true, width = 30, + cursorline = true, + debounce_delay = 15, side = "left", preserve_window_proportions = false, number = false, @@ -44,11 +51,17 @@ function M.config() renderer = { add_trailing = false, group_empty = false, - highlight_git = true, - full_name = false, + highlight_git = "name", highlight_opened_files = "none", root_folder_label = ":t", + full_name = false, indent_width = 2, + special_files = { "Cargo.toml", "Makefile", "README.md", "readme.md" }, + symlink_destination = true, + highlight_diagnostics = "none", + highlight_modified = "none", + highlight_bookmarks = "none", + highlight_clipboard = "name", indent_markers = { enable = false, inline_arrows = true, @@ -56,24 +69,43 @@ function M.config() corner = "└", edge = "│", item = "│", + bottom = "─", none = " ", }, }, icons = { webdev_colors = lvim.use_icons, + + web_devicons = { + file = { + enable = lvim.use_icons, + color = lvim.use_icons, + }, + folder = { + enable = false, + color = lvim.use_icons, + }, + }, git_placement = "before", padding = " ", symlink_arrow = " ➛ ", + modified_placement = "after", + diagnostics_placement = "signcolumn", + bookmarks_placement = "signcolumn", show = { file = lvim.use_icons, folder = lvim.use_icons, folder_arrow = lvim.use_icons, git = lvim.use_icons, + modified = lvim.use_icons, + diagnostics = lvim.use_icons, + bookmarks = lvim.use_icons, }, glyphs = { default = lvim.icons.ui.Text, symlink = lvim.icons.ui.FileSymlink, bookmark = lvim.icons.ui.BookMark, + modified = lvim.icons.ui.Circle, folder = { arrow_closed = lvim.icons.ui.TriangleShortArrowRight, arrow_open = lvim.icons.ui.TriangleShortArrowDown, @@ -95,8 +127,6 @@ function M.config() }, }, }, - special_files = { "Cargo.toml", "Makefile", "README.md", "readme.md" }, - symlink_destination = true, }, hijack_directories = { enable = false, @@ -104,9 +134,11 @@ function M.config() }, update_focused_file = { enable = true, - debounce_delay = 15, - update_root = true, - ignore_list = {}, + update_root = { + enable = true, + ignore_list = {}, + }, + exclude = false, }, diagnostics = { enable = lvim.use_icons, @@ -125,8 +157,11 @@ function M.config() }, }, filters = { + enable = true, dotfiles = false, git_clean = false, + git_ignored = false, + no_bookmark = false, no_buffer = false, custom = { "node_modules", "\\.cache", ".DS_Store", ".git" }, exclude = { ".env" } @@ -138,10 +173,11 @@ function M.config() }, git = { enable = true, - ignore = false, show_on_dirs = true, show_on_open_dirs = true, - timeout = 200, + disable_for_dirs = {}, + timeout = 400, + cygwin_support = false, }, actions = { use_system_clipboard = true, @@ -166,6 +202,7 @@ function M.config() open_file = { quit_on_open = false, resize_window = true, + eject = true, window_picker = { enable = true, picker = "default", @@ -181,8 +218,7 @@ function M.config() }, }, trash = { - cmd = "trash", - require_confirm = true, + cmd = "gio trash", }, live_filter = { prefix = "[FILTER]: ", @@ -197,6 +233,22 @@ function M.config() }, notify = { threshold = vim.log.levels.INFO, + absolute_path = true, + }, + ui = { + confirm = { + remove = true, + trash = true, + default_yes = false, + }, + }, + modified = { + enable = false, + show_on_dirs = true, + show_on_open_dirs = true, + }, + help = { + sort_by = "key", }, log = { enable = false, diff --git a/lua/lvim/core/terminal.lua b/lua/lvim/core/terminal.lua index 6e0cb58226..5270ddaea8 100644 --- a/lua/lvim/core/terminal.lua +++ b/lua/lvim/core/terminal.lua @@ -18,6 +18,7 @@ M.config = function() -- direction = 'vertical' | 'horizontal' | 'window' | 'float', direction = "float", close_on_exit = true, -- close the terminal window when the process exits + auto_scroll = true, -- automatically scroll to the bottom on terminal output shell = nil, -- change the default shell -- This field is only relevant if direction is set to 'float' float_opts = { @@ -35,6 +36,9 @@ M.config = function() background = "Normal", }, }, + winbar = { + enabled = false, + }, -- Add executables on the config.lua -- { cmd, keymap, description, direction, size } -- lvim.builtin.terminal.execs = {...} to overwrite @@ -156,6 +160,7 @@ M.lazygit_toggle = function() border = "none", width = 100000, height = 100000, + zindex = 200, }, on_open = function(_) vim.cmd "startinsert!" diff --git a/lua/lvim/core/treesitter.lua b/lua/lvim/core/treesitter.lua index 59a16279a6..bdb127c022 100644 --- a/lua/lvim/core/treesitter.lua +++ b/lua/lvim/core/treesitter.lua @@ -102,14 +102,24 @@ function M.setup() return end - local status_ok, treesitter_configs = pcall(require, "nvim-treesitter.configs") - if not status_ok then + local ts_status_ok, treesitter_configs = pcall(require, "nvim-treesitter.configs") + if not ts_status_ok then Log:error "Failed to load nvim-treesitter.configs" return end + local status_ok, ts_context_commentstring = pcall(require, "ts_context_commentstring") + if not status_ok then + Log:error "Failed to load ts_context_commentstring" + return + end + local opts = vim.deepcopy(lvim.builtin.treesitter) + -- handle deprecated API, https://github.com/JoosepAlviste/nvim-ts-context-commentstring/issues/82 + ts_context_commentstring.setup(opts.context_commentstring) + opts.context_commentstring = nil + treesitter_configs.setup(opts) if lvim.builtin.treesitter.on_config_done then diff --git a/lua/lvim/core/which-key.lua b/lua/lvim/core/which-key.lua index cee374d13c..de087ce6cf 100644 --- a/lua/lvim/core/which-key.lua +++ b/lua/lvim/core/which-key.lua @@ -101,6 +101,11 @@ M.config = function() name = "LSP", a = { "lua vim.lsp.buf.code_action()", "Code Action" }, }, + g = { + name = "Git", + r = { "Gitsigns reset_hunk", "Reset Hunk" }, + s = { "Gitsigns stage_hunk", "Stage Hunk" }, + }, }, mappings = { [":"] = { "Alpha", "Dashboard" }, @@ -181,9 +186,10 @@ M.config = function() g = { name = "Git", g = { "lua require 'lvim.core.terminal'.lazygit_toggle()", "Lazygit" }, - j = { "lua require 'gitsigns'.next_hunk({navigation_message = false})", "Next Hunk" }, - k = { "lua require 'gitsigns'.prev_hunk({navigation_message = false})", "Prev Hunk" }, + j = { "lua require 'gitsigns'.nav_hunk('next', {navigation_message = false})", "Next Hunk" }, + k = { "lua require 'gitsigns'.nav_hunk('prev', {navigation_message = false})", "Prev Hunk" }, l = { "lua require 'gitsigns'.blame_line()", "Blame" }, + L = { "lua require 'gitsigns'.blame_line({full=true})", "Blame Line (full)" }, p = { "lua require 'gitsigns'.preview_hunk()", "Preview Hunk" }, r = { "lua require 'gitsigns'.reset_hunk()", "Reset Hunk" }, R = { "lua require 'gitsigns'.reset_buffer()", "Reset Buffer" }, diff --git a/lua/lvim/interface/popup.lua b/lua/lvim/interface/popup.lua index b767f60971..84a27e102b 100644 --- a/lua/lvim/interface/popup.lua +++ b/lua/lvim/interface/popup.lua @@ -52,12 +52,12 @@ function Popup:display(content_provider) -- window options 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 -- buffer options 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 diff --git a/lua/lvim/lsp/config.lua b/lua/lvim/lsp/config.lua index 87b996cb64..55f7d64d41 100644 --- a/lua/lvim/lsp/config.lua +++ b/lua/lvim/lsp/config.lua @@ -4,26 +4,38 @@ local skipped_servers = { "antlersls", "ast_grep", "azure_pipelines_ls", + "basedpyright", "biome", + "bzl", "ccls", + "css_variables", "cssmodules_ls", "custom_elements_ls", "denols", "docker_compose_language_service", + "dprint", "elp", "ember", "emmet_language_server", "emmet_ls", "eslint", "eslintls", + "fennel_language_server", + "gitlab_ci_ls", "glint", + "glslls", "golangci_lint_ls", "gradle_ls", "graphql", + "harper_ls", + "hdl_checker", + "hydra_lsp", "htmx", "java_language_server", "jedi_language_server", + "lexical", "ltex", + "lwc_ls", "mdx_analyzer", "neocmake", "nim_langserver", @@ -40,14 +52,17 @@ local skipped_servers = { "rome", "rubocop", "ruby_ls", + "ruby_lsp", "ruff_lsp", "scry", + "snyk_ls", "solang", "solc", "solidity_ls", "solidity_ls_nomicfoundation", "sorbet", "sourcekit", + "somesass_ls", "sourcery", "spectral", "sqlls", @@ -56,8 +71,13 @@ local skipped_servers = { "stimulus_ls", "stylelint_lsp", "svlangserver", + "swift_mesonls", + "templ", "tflint", + "tinymist", "unocss", + "vale_ls", + "vacuum", "verible", "v_analyzer", "vtsls", diff --git a/lua/lvim/lsp/init.lua b/lua/lvim/lsp/init.lua index a6dce4fbd8..d59b29a9ce 100644 --- a/lua/lvim/lsp/init.lua +++ b/lua/lvim/lsp/init.lua @@ -5,7 +5,7 @@ local autocmds = require "lvim.core.autocmds" local function add_lsp_buffer_options(bufnr) 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 diff --git a/lua/lvim/lsp/templates.lua b/lua/lvim/lsp/templates.lua index 681e48e0dd..4a65facb09 100644 --- a/lua/lvim/lsp/templates.lua +++ b/lua/lvim/lsp/templates.lua @@ -12,6 +12,7 @@ function M.remove_template_files() -- remove any outdated files for _, file in ipairs(vim.fn.glob(ftplugin_dir .. "/*.lua", 1, 1)) do vim.fn.delete(file) + vim.wait(10) end end diff --git a/lua/lvim/lsp/utils.lua b/lua/lvim/lsp/utils.lua index 95169b3405..0d9bcd7fd2 100644 --- a/lua/lvim/lsp/utils.lua +++ b/lua/lvim/lsp/utils.lua @@ -4,7 +4,7 @@ local tbl = require "lvim.utils.table" local Log = require "lvim.core.log" 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 client.name == name end) @@ -12,7 +12,7 @@ end function M.get_active_clients_by_ft(filetype) local matches = {} - local clients = vim.lsp.get_active_clients() + local clients = vim.lsp.get_clients() for _, client in pairs(clients) do local supported_filetypes = client.config.filetypes or {} if client.name ~= "null-ls" and vim.tbl_contains(supported_filetypes, filetype) then @@ -147,7 +147,9 @@ function M.setup_codelens_refresh(client, bufnr) vim.api.nvim_create_autocmd(cl_events, { group = group, buffer = bufnr, - callback = vim.lsp.codelens.refresh, + callback = function() + vim.lsp.codelens.refresh { bufnr = bufnr } + end, }) end diff --git a/lua/lvim/plugins.lua b/lua/lvim/plugins.lua index ac45a76d71..4f76399a0c 100644 --- a/lua/lvim/plugins.lua +++ b/lua/lvim/plugins.lua @@ -350,10 +350,11 @@ local core_plugins = { "lunarvim/bigfile.nvim", config = function() pcall(function() - require("bigfile").config(lvim.builtin.bigfile.config) + require("bigfile").setup(lvim.builtin.bigfile.config) end) end, enabled = lvim.builtin.bigfile.active, + dependencies = { "nvim-treesitter/nvim-treesitter" }, event = { "FileReadPre", "BufReadPre", "User FileOpened" }, }, } diff --git a/lua/lvim/utils/functions.lua b/lua/lvim/utils/functions.lua deleted file mode 100644 index b2b194edaf..0000000000 --- a/lua/lvim/utils/functions.lua +++ /dev/null @@ -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 diff --git a/snapshots/default.json b/snapshots/default.json index d9c76af334..821f3836ef 100644 --- a/snapshots/default.json +++ b/snapshots/default.json @@ -12,16 +12,16 @@ "commit": "33eb067" }, "bufferline.nvim": { - "commit": "1a33975" + "commit": "73edc1f" }, "cmp-buffer": { "commit": "3022dbc" }, "cmp-cmdline": { - "commit": "8ee981b" + "commit": "d250c63" }, "cmp-nvim-lsp": { - "commit": "44b16d1" + "commit": "39e2eda" }, "cmp-path": { "commit": "91ff86c" @@ -30,100 +30,100 @@ "commit": "05a9ab2" }, "friendly-snippets": { - "commit": "53d3df2" + "commit": "dd2fd12" }, "gitsigns.nvim": { - "commit": "6ef8c54" + "commit": "805610a" }, "indent-blankline.nvim": { "commit": "9637670" }, "lazy.nvim": { - "commit": "9658486" + "commit": "8f19915" }, "lir.nvim": { - "commit": "969e95b" + "commit": "7a9d45d" }, "lualine.nvim": { - "commit": "2248ef2" + "commit": "0a5a668" }, "lunar.nvim": { "commit": "08bbc93" }, "mason-lspconfig.nvim": { - "commit": "41674c9" + "commit": "a4caa0d" }, "mason.nvim": { - "commit": "41e75af" + "commit": "49ff59a" }, "neodev.nvim": { - "commit": "1676d2c" + "commit": "ce9a2e8" }, "nlsp-settings.nvim": { - "commit": "2a52e79" + "commit": "d92035e" }, "none-ls.nvim": { "commit": "3a48266" }, "nvim-autopairs": { - "commit": "0f04d78" + "commit": "c15de7e" }, "nvim-cmp": { - "commit": "0b751f6" + "commit": "5260e5e" }, "nvim-dap": { - "commit": "13ce59d" + "commit": "5a2f712" }, "nvim-dap-ui": { "commit": "34160a7" }, "nvim-lspconfig": { - "commit": "fcf153f" + "commit": "eadcee1" }, "nvim-navic": { "commit": "8649f69" }, "nvim-tree.lua": { - "commit": "05f55c1" + "commit": "2bc725a" }, "nvim-treesitter": { - "commit": "1e64838" + "commit": "30de5e7" }, "nvim-ts-context-commentstring": { - "commit": "b8ff464" + "commit": "cb06438" }, "nvim-web-devicons": { - "commit": "5efb8bd" + "commit": "e37bb1f" }, "onedarker.nvim": { "commit": "b4f92f0" }, "plenary.nvim": { - "commit": "55d9fe8" + "commit": "a3e3bc8" }, "project.nvim": { "commit": "8c6bad7" }, "schemastore.nvim": { - "commit": "5bfeb36" + "commit": "9a5992a" }, "structlog.nvim": { "commit": "45b26a2" }, "telescope-fzf-native.nvim": { - "commit": "6c921ca" + "commit": "9ef21b2" }, "telescope.nvim": { - "commit": "d909568" + "commit": "d829aa6" }, "toggleterm.nvim": { - "commit": "6b334b9" + "commit": "fee58a0" }, "tokyonight.nvim": { - "commit": "f247ee7" + "commit": "b9b494f" }, "vim-illuminate": { - "commit": "3bd2ab6" + "commit": "5eeb795" }, "which-key.nvim": { "commit": "4433e5e" diff --git a/tests/minimal_lsp.lua b/tests/minimal_lsp.lua index dd4c666d66..46f5c0e18d 100644 --- a/tests/minimal_lsp.lua +++ b/tests/minimal_lsp.lua @@ -41,8 +41,8 @@ _G.load_config = function() require("vim.lsp.log").set_format_func(vim.inspect) local nvim_lsp = require "lspconfig" local on_attach = function(_, bufnr) - local function buf_set_option(...) - vim.api.nvim_buf_set_option(bufnr, ...) + local function buf_set_option(k, v) + vim.api.nvim_set_option_value(k, v, { buf = bufnr }) end buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc") diff --git a/tests/specs/lsp_spec.lua b/tests/specs/lsp_spec.lua index fd45b2320e..3f81405800 100644 --- a/tests/specs/lsp_spec.lua +++ b/tests/specs/lsp_spec.lua @@ -29,14 +29,16 @@ describe("lsp workflow", function() it("should be able to delete ftplugin templates", function() if utils.is_directory(lvim.lsp.templates_dir) then - assert.equal(vim.fn.delete(lvim.lsp.templates_dir, "rf"), 0) + vim.fn.delete(lvim.lsp.templates_dir, "rf") + vim.wait(100) end assert.False(utils.is_directory(lvim.lsp.templates_dir)) end) it("should be able to generate ftplugin templates", function() if utils.is_directory(lvim.lsp.templates_dir) then - assert.equal(vim.fn.delete(lvim.lsp.templates_dir, "rf"), 0) + vim.fn.delete(lvim.lsp.templates_dir, "rf") + vim.wait(100) end require("lvim.lsp").setup() @@ -60,7 +62,7 @@ describe("lsp workflow", function() require("lvim.lsp").setup() vim.wait(500) - local allowed_dupes = { "tailwindcss" } + local allowed_dupes = { "tailwindcss", "ruff" } local template_files = vim.fn.glob(lvim.lsp.templates_dir .. "/*.lua", 1, 1) for _, file in ipairs(template_files) do local content = {} diff --git a/utils/ci/generate_new_lockfile.sh b/utils/ci/generate_new_lockfile.sh index 077df41f4d..ebd71b3abd 100644 --- a/utils/ci/generate_new_lockfile.sh +++ b/utils/ci/generate_new_lockfile.sh @@ -11,7 +11,7 @@ mkdir -p "${SNAPSHOT_DIR}" export SNAPSHOT_PATH="${REPO_DIR}/snapshots/${SNAPSHOT_NAME}" time lvim --headless \ - -c "luafile ./utils/ci/generate_new_lockfile.lua" + -c "source ./utils/ci/generate_new_lockfile.lua" temp=$(mktemp) diff --git a/utils/installer/install-neovim-from-release b/utils/installer/install-neovim-from-release index 076ac46d13..f041f7725b 100755 --- a/utils/installer/install-neovim-from-release +++ b/utils/installer/install-neovim-from-release @@ -6,18 +6,14 @@ declare -r LV_INSTALL_PREFIX="${INSTALL_PREFIX:-"$HOME/.local"}" declare -r RELEASE_VER="${RELEASE_VER:-latest}" # can be set to nightly declare ARCHIVE_NAME -declare RELEASE_NAME declare OS OS="$(uname -s)" if [ "$OS" == "Linux" ]; then ARCHIVE_NAME="nvim-linux64" - RELEASE_NAME="nvim-linux64" elif [ "$OS" == "Darwin" ]; then - ARCHIVE_NAME="nvim-macos" - # for some reason the archive has a different name - RELEASE_NAME="nvim-osx64" + ARCHIVE_NAME="nvim-macos-x86_64" else echo "$OS platform is not supported currently" exit 1 @@ -72,12 +68,8 @@ function install_neovim() { pushd "$DOWNLOAD_DIR" tar -xzf "$DOWNLOAD_DIR/$ARCHIVE_NAME.tar.gz" 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 - cp -r "$DOWNLOAD_DIR/$RELEASE_NAME/." "$LV_INSTALL_PREFIX" + cp -r "$DOWNLOAD_DIR/$ARCHIVE_NAME/." "$LV_INSTALL_PREFIX" echo "Installation complete!" echo "Now you can run $LV_INSTALL_PREFIX/bin/nvim" } diff --git a/utils/installer/install.sh b/utils/installer/install.sh index 98c71c8e54..0fd09bccdc 100755 --- a/utils/installer/install.sh +++ b/utils/installer/install.sh @@ -46,10 +46,6 @@ if ! command -v tree-sitter &>/dev/null; then __npm_deps+=("tree-sitter-cli") fi -declare -a __pip_deps=( - "pynvim" -) - declare -a __rust_deps=( "fd::fd-find" "rg::ripgrep" @@ -138,15 +134,11 @@ function main() { if confirm "Would you like to install LunarVim's NodeJS/BunJS dependencies: $(stringify_array "${__npm_deps[@]}")?"; then install_nodejs_deps fi - if confirm "Would you like to install LunarVim's Python dependencies: $(stringify_array "${__pip_deps[@]}")?"; then - install_python_deps - fi if confirm "Would you like to install LunarVim's Rust dependencies: $(stringify_array "${__rust_deps[@]}")?"; then install_rust_deps fi else install_nodejs_deps - install_python_deps install_rust_deps fi fi @@ -329,21 +321,6 @@ function install_nodejs_deps() { echo "check how to solve it: https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally" } -function install_python_deps() { - echo "Verifying that pip is available.." - if ! python3 -m ensurepip >/dev/null; then - if ! python3 -m pip --version &>/dev/null; then - echo "[WARN]: skipping installing optional python dependencies" - return 1 - fi - fi - echo "Installing with pip.." - for dep in "${__pip_deps[@]}"; do - python3 -m pip install --user "$dep" || return 1 - done - echo "All Python dependencies are successfully installed" -} - function __attempt_to_install_with_cargo() { if command -v cargo &>/dev/null; then echo "Installing missing Rust dependency with cargo" @@ -447,7 +424,7 @@ function setup_lvim() { "$INSTALL_PREFIX/bin/$NVIM_APPNAME" --headless -c 'quitall' - printf "\nLazy setup complete" + printf "\nLazy setup complete\n" verify_core_plugins } diff --git a/utils/installer/uninstall.sh b/utils/installer/uninstall.sh index 5a7e6897ec..9b2626318e 100755 --- a/utils/installer/uninstall.sh +++ b/utils/installer/uninstall.sh @@ -51,7 +51,7 @@ function parse_arguments() { function remove_lvim_dirs() { if [ "$ARGS_REMOVE_CONFIG" -eq 1 ]; then - __lvim_dirs+=($__lvim_config_dir) + __lvim_dirs+=("$__lvim_config_dir") fi for dir in "${__lvim_dirs[@]}"; do rm -rf "$dir"