Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: nvim v0.10 support #1260

Merged
merged 86 commits into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
b434c79
feat: implement inlay virtual text for rust and go (#759)
ClSlaid May 23, 2023
af9a16c
merge main to 0.10.
ayamir Jun 19, 2023
ad57d95
workaroud for watchfile problem (#871)
fecet Jul 17, 2023
41c2f00
Merge branch 'main'
Jint-lzxy Jul 17, 2023
eac349e
Merge branch 'main' into 0.10
Jint-lzxy Jul 23, 2023
00b6393
Merge branch 'main' into 0.10
ayamir Jul 31, 2023
c80f9d0
Merge branch 'main' into 0.10
ayamir Jan 8, 2024
2e183e8
chore(neodim): remove pin commit (#1142)
CharlesChiuGit Jan 9, 2024
9bf2c26
fix: remove `specs.nvim` due to long time no update.
ayamir Feb 9, 2024
089cc46
Merge branch 'main' into 0.10
ayamir Feb 9, 2024
2dfc8ea
refactor: use neovim native inlay-hint.
ayamir Feb 9, 2024
e8a156c
Merge branch 'main' of https:/ayamir/nvimdots into 0.10
ayamir Feb 15, 2024
af582ae
Merge branch 'main' of https:/ayamir/nvimdots into 0.10
ayamir Feb 22, 2024
0c48d53
Merge branch 'main' into 0.10
ayamir Mar 10, 2024
f31f428
Merge branch 'main' into 0.10
ayamir Mar 23, 2024
9015a87
fix(lsp): adapt to upstream API, eliminate warning.
ayamir Mar 23, 2024
edb72a9
fix(plugins): add nvim-bqf.
ayamir Mar 23, 2024
968ae88
fix(go.nvim): adapt upstream api.
ayamir Mar 25, 2024
2aa73f8
Merge branch 'main' into 0.10
ayamir Mar 29, 2024
698e8c9
feat(plugins): add dropbar.nvim for winbar.
ayamir Mar 29, 2024
f30e5b9
feat(settings): make enable_inlayhint configurable.
ayamir Mar 30, 2024
4d6c753
fixup: check user input, improve robustness.
ayamir Mar 30, 2024
4574a97
fix(clangd): disable clangd for proto.
ayamir Mar 30, 2024
8319235
fixup: clean redundant config files.
ayamir Mar 30, 2024
28f6de3
fix(gopls): unify gopls config, allow user overrides.
ayamir Mar 30, 2024
d951f77
fixup: clean code.
ayamir Mar 30, 2024
48905de
feat(clang_format): enable clang_format for cuda and protobuf.
ayamir Mar 30, 2024
4db4144
Merge branch 'main' into 0.10
ayamir Apr 6, 2024
9e3beb2
fix: inlay_hint error (#1236)
Mythos-404 Apr 20, 2024
ce8c31e
Merge remote-tracking branch 'origin' into 0.10
ayamir May 20, 2024
c04ee29
Merge remote-tracking branch 'origin' into 0.10
ayamir May 20, 2024
8ba62c6
fix: lua_ls workspace settings.
ayamir May 20, 2024
46380cd
chore: upgrade to new api to judge if is a list.
ayamir May 20, 2024
f4d848a
chore: use builtin grep_string to search selection.
ayamir May 20, 2024
b5dd44d
Merge branch 'main' into 0.10
Jint-lzxy May 22, 2024
66d6fe1
chore: general cleanup
Jint-lzxy May 22, 2024
4b0b06e
fix: `inlayhint` -> `inlayhints`
Jint-lzxy May 22, 2024
3b323fb
fix(ts-autotag): update config format
CharlesChiuGit May 24, 2024
2769274
chore: use vim.uv in place of vim.loop.
ayamir May 26, 2024
f46800d
Merge remote-tracking branch 'refs/remotes/origin/0.10' into 0.10
ayamir May 26, 2024
cee6354
chore: use vim.iter():flattern in place of vim.tbl_flattern.
ayamir May 26, 2024
69e2015
chore: update install scripts for nvim 0.10 stable. (#1271)
ayamir May 26, 2024
13df6c3
chore: replace deprecated apis (#1266)
ayamir Jun 2, 2024
04543b5
fix(toggleterm): use `""` instead of `nil` to fix auto-exit on Window…
CharlesChiuGit Jun 2, 2024
a7c136a
fix: utilize `ts-context` in `glance` preview window (#1265)
mjkx5 Jun 2, 2024
a27f8f1
chore: use vim.o in place of vim.api.nvim_get_option_value. (#1269)
ayamir Jun 6, 2024
0278b2d
fix(0.10): minor cleanup (#1276)
Jint-lzxy Jun 7, 2024
d249c86
feat(scripts): update frequently used functions (#1277)
Jint-lzxy Jun 7, 2024
fd46426
feat(docs): support v0.10 (#1278)
Jint-lzxy Jun 7, 2024
f286380
fix(scripts): typo
Jint-lzxy Jun 7, 2024
f8bc12b
fixup! fix(scripts): typo
Jint-lzxy Jun 7, 2024
59bc46b
feat(README): supports `0.9` -> `0.10`
Jint-lzxy Jun 7, 2024
0322c31
chore: cleanup
Jint-lzxy Jun 7, 2024
9be7ffe
fix(lualine): ensure all components are properly aligned
Jint-lzxy Jun 7, 2024
f6ebc05
unlock rustaceanvim
Jint-lzxy Jun 9, 2024
9e6cf9e
Merge branch 'main' into 0.10
Jint-lzxy Jun 9, 2024
593c906
feat(lsp): be protective
Jint-lzxy Jun 9, 2024
a50a90e
fix: `neovim` -> `Neovim`
Jint-lzxy Jun 9, 2024
a55678e
Revert "fix(lualine): ensure all components are properly aligned"
Jint-lzxy Jun 9, 2024
e11310b
feat: support new options (#1279)
Jint-lzxy Jun 10, 2024
e8976c8
feat(trouble)!: v3 support (#1281)
Jint-lzxy Jun 10, 2024
b74c753
refactor: overhaul the icon library (#1282)
Jint-lzxy Jun 10, 2024
f639f87
feat(lsp): correctly configure diagnostic-signs (#1280)
Jint-lzxy Jun 10, 2024
2da7aed
feat: disable more plugins for RO (buf|file)types (#1284)
Jint-lzxy Jun 11, 2024
281930a
fix(alpha): cannot cast `string` to `integer` for winheight (#1285)
Jint-lzxy Jun 11, 2024
2e84827
feat(ibl): support per-language indent config (#1287)
Jint-lzxy Jun 12, 2024
086bb81
feat(ibl): more language nodes (#1288)
Jint-lzxy Jun 13, 2024
2fedc08
feat(luasnip): support ECMAScript regexes (#1291)
Jint-lzxy Jun 16, 2024
9937d58
feat(core): use the lua API to set options (#1292)
Jint-lzxy Jun 17, 2024
80cda84
feat: include several new plugins (#1235)
CharlesChiuGit Jun 18, 2024
3166eef
feat: better way to check if the (T|G)UI is running (#1297)
Jint-lzxy Jun 18, 2024
7e11cdc
chore(global): cleanup legacy code (#1296)
Jint-lzxy Jun 18, 2024
4d76779
feat: reduce the use of direct syscalls (#1294)
Jint-lzxy Jun 18, 2024
4e614a3
fix(events): avoid name clashes (#1295)
Jint-lzxy Jun 18, 2024
93c06cd
Feat/telescope collections keymaps (#1299)
CharlesChiuGit Jun 20, 2024
64e85d1
fix(gitsigns): upstream breaking changes (#1300)
Jint-lzxy Jun 20, 2024
c42151f
fix(core): missing leading path separator (#1301)
Jint-lzxy Jun 20, 2024
3bf00f0
Revert "Feat/telescope collections keymaps (#1299)" (#1302)
ayamir Jun 20, 2024
6c59c16
Feat/telescope collections keymaps (#1303)
ayamir Jun 21, 2024
a6a3356
feat(treesitter): lessened performance restrictions (#1305)
Jint-lzxy Jun 24, 2024
57f647e
chore: update plugin author's name
CharlesChiuGit Jun 25, 2024
07a165b
feat(nixos): add `mergeLazyLock` option (#1310)
misumisumi Jun 30, 2024
b1406ca
fix: cmp snippets source selecting issue (#1309)
CharlesChiuGit Jul 1, 2024
757a36e
fix(cmp): occasional inability to select completion items (#1315)
Jint-lzxy Jul 1, 2024
f0369f5
feat: credit all collaborators as copyright holders (#1316)
Jint-lzxy Jul 1, 2024
8f30bae
feat: make format timeout configurable (#1275)
ayamir Jul 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lazy-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@
"toggleterm.nvim": { "branch": "main", "commit": "066cccf48a43553a80a210eb3be89a15d789d6e6" },
"trouble.nvim": { "branch": "main", "commit": "b9cf677f20bb2faa2dacfa870b084e568dca9572" },
"vim-cool": { "branch": "master", "commit": "662e7b11064cbeedad17c45d2fe926e78d3cd0b6" },
"vim-fugitive": { "branch": "master", "commit": "ce882460cf3db12e99f8bf579cbf99e331f6dd4f" },
"vim-fugitive": { "branch": "master", "commit": "c0b03f1cac242d96837326d300f42a660306fc1a" },
"vim-matchup": { "branch": "master", "commit": "2d660e4aa7c566014c667af2cda0458043527902" },
"vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" },
"which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" },
"wilder.nvim": { "branch": "master", "commit": "679f348dc90d80ff9ba0e7c470c40a4d038dcecf" }
}
}
15 changes: 13 additions & 2 deletions lua/core/event.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,19 @@ local mapping = require("keymap.completion")
vim.api.nvim_create_autocmd("LspAttach", {
group = vim.api.nvim_create_augroup("LspKeymapLoader", { clear = true }),
callback = function(event)
if not _G._debugging then
mapping.lsp(event.buf)
if _G._debugging then
return
end

mapping.lsp(event.buf)
local enable_inlayhint = require("core.settings").enable_inlayhint
local client = vim.lsp.get_client_by_id(event.data.client_id)
if
client ~= nil
and client.server_capabilities.inlayHintProvider ~= nil
and type(enable_inlayhint) == "boolean"
then
vim.lsp.inlay_hint.enable(enable_inlayhint, { bufnr = event.buf })
end
end,
})
Expand Down
11 changes: 11 additions & 0 deletions lua/core/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,16 @@ You're recommended to install PowerShell for better experience.]],
end
end

local _v0_10_workarounds = function()
local ok, watchfile = pcall(require, "vim.lsp._watchfiles")
if ok then
-- Disable lsp watcher
watchfile._watchfunc = function()
return function() end
end
end
end
Jint-lzxy marked this conversation as resolved.
Show resolved Hide resolved

local load_core = function()
createdir()
disable_distribution_plugins()
Expand All @@ -153,6 +163,7 @@ local load_core = function()
neovide_config()
clipboard_config()
shell_config()
_v0_10_workarounds()

require("core.options")
require("core.mapping")
Expand Down
4 changes: 4 additions & 0 deletions lua/core/settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -214,4 +214,8 @@ settings["dashboard_image"] = {
[[⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠉⠛⢿⣿⣿⠂⠀⠀⠀⠀⠀⢀⣽⣿⣿⣿⣿⣿⣿⣿⣍⠛⠿⣿⣿⣿⣿⣿⣿]],
}

-- Set it to false if you don't want to show inlay hint
---@type boolean
settings["enable_inlayhint"] = true

return require("modules.utils").extend_config(settings, "user.settings")
13 changes: 0 additions & 13 deletions lua/keymap/helpers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,3 @@ _G._toggle_lazygit = function()
vim.notify("Command [lazygit] not found!", vim.log.levels.ERROR, { title = "toggleterm.nvim" })
end
end

-- TODO: Update this function to use `vim.getregion()` when v0.10 is released.
_G._buf_vtext = function()
local a_orig = vim.fn.getreg("a")
local mode = vim.fn.mode()
if mode ~= "v" and mode ~= "V" then
vim.cmd([[normal! gv]])
end
vim.cmd([[silent! normal! "aygv]])
local text = vim.fn.getreg("a")
vim.fn.setreg("a", a_orig)
return text
end
8 changes: 1 addition & 7 deletions lua/keymap/tool.lua
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,7 @@ local plug_map = {
:with_silent()
:with_desc("edit: Change current directory by zoxide"),
["n|<leader>fb"] = map_cu("Telescope buffers"):with_noremap():with_silent():with_desc("find: Buffer opened"),
["n|<leader>fs"] = map_cu("Telescope grep_string"):with_noremap():with_silent():with_desc("find: Current word"),
["v|<leader>fs"] = map_callback(function()
require("telescope.builtin").grep_string({ search = _buf_vtext() })
end)
:with_noremap()
:with_silent()
:with_desc("find: Selection text"),
["nv|<leader>fs"] = map_cu("Telescope grep_string"):with_noremap():with_silent():with_desc("find: Current word"),
["n|<leader>fd"] = map_cu("Telescope persisted"):with_noremap():with_silent():with_desc("find: Session"),

-- Plugin: dap
Expand Down
2 changes: 1 addition & 1 deletion lua/modules/configs/completion/lspsaga.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ return function()
require("modules.utils").load_plugin("lspsaga", {
-- Breadcrumbs: https://nvimdev.github.io/lspsaga/breadcrumbs/
symbol_in_winbar = {
enable = true,
enable = false,
separator = " " .. icons.ui.Separator,
hide_keyword = false,
show_file = false,
Expand Down
11 changes: 10 additions & 1 deletion lua/modules/configs/completion/mason-lspconfig.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
local M = {}

local severity_map = {
["Error"] = vim.diagnostic.severity.ERROR,
["Warning"] = vim.diagnostic.severity.WARN,
["Information"] = vim.diagnostic.severity.INFO,
["Hint"] = vim.diagnostic.severity.HINT,
}

M.setup = function()
local diagnostics_virtual_text = require("core.settings").diagnostics_virtual_text
local diagnostics_level = require("core.settings").diagnostics_level
Expand All @@ -16,7 +23,9 @@ M.setup = function()
signs = true,
underline = true,
virtual_text = diagnostics_virtual_text and {
severity_limit = diagnostics_level,
severity = {
min = severity_map[diagnostics_level],
},
} or false,
-- set update_in_insert to false because it was enabled by lspsaga
update_in_insert = false,
Expand Down
2 changes: 1 addition & 1 deletion lua/modules/configs/completion/null-ls.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ return function()
-- Don't specify any config here if you are using the default one.
local sources = {
btns.formatting.clang_format.with({
filetypes = { "c", "cpp" },
filetypes = { "c", "cpp", "cuda", "proto" },
extra_args = formatter_args("clang_format"),
}),
btns.formatting.prettier.with({
Expand Down
1 change: 1 addition & 0 deletions lua/modules/configs/completion/servers/clangd.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ return function(options)
on_attach = options.on_attach,
capabilities = vim.tbl_deep_extend("keep", { offsetEncoding = { "utf-16", "utf-8" } }, options.capabilities),
single_file_support = true,
filetypes = { "c", "cpp", "objc", "objcpp", "cuda" },
cmd = {
"clangd",
"-j=12",
Expand Down
8 changes: 6 additions & 2 deletions lua/modules/configs/completion/servers/lua_ls.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,22 @@
return {
settings = {
Lua = {
runtime = {
version = "LuaJIT",
},
diagnostics = {
globals = { "vim" },
disable = { "different-requires", "undefined-field" },
},
workspace = {
library = {
[vim.fn.expand("$VIMRUNTIME/lua")] = true,
[vim.fn.expand("$VIMRUNTIME/lua/vim/lsp")] = true,
vim.fn.expand("$VIMRUNTIME/lua"),
vim.fn.expand("$VIMRUNTIME/lua/vim/lsp"),
},
maxPreload = 100000,
preloadFileSize = 10000,
},
hint = { enable = true, setType = true },
format = { enable = false },
telemetry = { enable = false },
-- Do not override treesitter lua highlighting with lua_ls's highlighting
Expand Down
41 changes: 22 additions & 19 deletions lua/modules/configs/lang/crates-keymap.lua
Original file line number Diff line number Diff line change
@@ -1,120 +1,123 @@
---@diagnostic disable: undefined-field
local bind = require("keymap.bind")
local map_callback = bind.map_callback

local crates = require("crates")

local crates_keymap = {
["n|<leader>ct"] = map_callback(function()
require("crates").toggle()
crates.toggle()
end)
:with_noremap()
:with_silent()
:with_buffer(0)
:with_desc("crates: Toggle spec activities"),
["n|<leader>cr"] = map_callback(function()
require("crates").reload()
crates.reload()
end)
:with_noremap()
:with_silent()
:with_buffer(0)
:with_desc("crates: Reload crate specs"),

["n|<leader>cs"] = map_callback(function()
require("crates").show_popup()
crates.show_popup()
end)
:with_noremap()
:with_silent()
:with_buffer(0)
:with_desc("crates: Toggle pop-up window"),
["n|<leader>cv"] = map_callback(function()
require("crates").show_versions_popup()
require("crates").show_popup()
crates.show_versions_popup()
crates.show_popup()
end)
:with_noremap()
:with_silent()
:with_buffer(0)
:with_desc("crates: Select spec versions"),
["n|<leader>cf"] = map_callback(function()
require("crates").show_features_popup()
require("crates").show_popup()
crates.show_features_popup()
crates.show_popup()
end)
:with_noremap()
:with_silent()
:with_buffer(0)
:with_desc("crates: Select spec features"),
["n|<leader>cd"] = map_callback(function()
require("crates").show_dependencies_popup()
require("crates").show_popup()
crates.show_dependencies_popup()
crates.show_popup()
end)
:with_noremap()
:with_silent()
:with_buffer(0)
:with_desc("crates: Show project dependencies"),

["n|<leader>cu"] = map_callback(function()
require("crates").update_crate()
crates.update_crate()
end)
:with_noremap()
:with_silent()
:with_buffer(0)
:with_desc("crates: Update current crate's spec"),
["v|<leader>cu"] = map_callback(function()
require("crates").update_crates()
crates.update_crates()
end)
:with_noremap()
:with_silent()
:with_buffer(0)
:with_desc("crates: Update selected crate's spec"),
["n|<leader>ca"] = map_callback(function()
require("crates").update_all_crates()
crates.update_all_crates()
end)
:with_noremap()
:with_silent()
:with_buffer(0)
:with_desc("crates: Update all crates' specs"),
["n|<leader>cU"] = map_callback(function()
require("crates").upgrade_crate()
crates.upgrade_crate()
end)
:with_noremap()
:with_silent()
:with_buffer(0)
:with_desc("crates: Upgrade current crate"),
["v|<leader>cU"] = map_callback(function()
require("crates").upgrade_crates()
crates.upgrade_crates()
end)
:with_noremap()
:with_silent()
:with_buffer(0)
:with_desc("crates: Upgrade selected crates"),
["n|<leader>cA"] = map_callback(function()
require("crates").upgrade_all_crates()
crates.upgrade_all_crates()
end)
:with_noremap()
:with_silent()
:with_buffer(0)
:with_desc("crates: Upgrade all crates"),

["n|<leader>cH"] = map_callback(function()
require("crates").open_homepage()
crates.open_homepage()
end)
:with_noremap()
:with_silent()
:with_buffer(0)
:with_desc("crates: Open current crate's homepage"),
["n|<leader>cR"] = map_callback(function()
require("crates").open_repository()
crates.open_repository()
end)
:with_noremap()
:with_silent()
:with_buffer(0)
:with_desc("crates: Open current crate's repository"),
["n|<leader>cD"] = map_callback(function()
require("crates").open_documentation()
crates.open_documentation()
end)
:with_noremap()
:with_silent()
:with_buffer(0)
:with_desc("crates: Open current crate's documentation"),
["n|<leader>cC"] = map_callback(function()
require("crates").open_crates_io()
crates.open_crates_io()
end)
:with_noremap()
:with_silent()
Expand Down
15 changes: 15 additions & 0 deletions lua/modules/configs/lang/go-nvim.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
return function()
require("modules.utils").load_plugin("go", {
lsp_keymaps = false,
dap_debug_keymap = false,
icons = false,
gofmt = "gopls",
goimports = "gopls",
lsp_gofumpt = "true",
lsp_inlay_hints = { enable = false },
run_in_floaterm = true,
trouble = true,
lsp_codelens = false,
lsp_cfg = require("modules.configs.completion.servers.gopls"),
})
end
6 changes: 6 additions & 0 deletions lua/modules/plugins/tool.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ tool["tpope/vim-fugitive"] = {
-- cond = vim.fn.executable("fcitx5-remote") == 1,
-- config = require("tool.fcitx5"),
-- }
tool["Bekaboo/dropbar.nvim"] = {
lazy = false,
dependencies = {
"nvim-telescope/telescope-fzf-native.nvim",
},
}
tool["nvim-tree/nvim-tree.lua"] = {
lazy = true,
cmd = {
Expand Down
1 change: 0 additions & 1 deletion lua/modules/plugins/ui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ ui["nvim-lualine/lualine.nvim"] = {
}
ui["zbirenbaum/neodim"] = {
lazy = true,
commit = "9477da0",
event = "LspAttach",
config = require("ui.neodim"),
}
Expand Down
4 changes: 2 additions & 2 deletions lua/modules/utils/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,9 @@ local function tbl_recursive_merge(dst, src)
for key, value in pairs(src) do
if type(dst[key]) == "table" and type(value) == "function" then
dst[key] = value(dst[key])
elseif type(dst[key]) == "table" and vim.tbl_islist(dst[key]) and key ~= "dashboard_image" then
elseif type(dst[key]) == "table" and vim.islist(dst[key]) and key ~= "dashboard_image" then
vim.list_extend(dst[key], value)
elseif type(dst[key]) == "table" and type(value) == "table" and not vim.tbl_islist(dst[key]) then
elseif type(dst[key]) == "table" and type(value) == "table" and not vim.islist(dst[key]) then
tbl_recursive_merge(dst[key], value)
else
dst[key] = value
Expand Down