Skip to content

Commit 990ed2b

Browse files
committed
update config for nvim 0.12, switch treesitter to main
1 parent 17bb2b6 commit 990ed2b

18 files changed

Lines changed: 476 additions & 390 deletions

.github/workflows/release.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
schedule:
55
- cron: '0 20 * * *'
66
push:
7-
branches: [ master, test ]
7+
branches: [ main, test ]
88
workflow_dispatch:
99

1010
defaults:
@@ -36,10 +36,7 @@ jobs:
3636
cd ~/.config
3737
3838
echo "install plugins===================="
39-
# set treesitter ensure_install sync install
40-
# sed 's|sync_install = false|sync_install = true|' -i ~/.config/nvim/lua/plugins/treesitter.lua
4139
nvim --headless "+Lazy! sync" +qa
42-
# sed 's|sync_install = true|sync_install = false|' -i ~/.config/nvim/lua/plugins/treesitter.lua
4340
4441
XZ_OPT=-9 tar cJf nvim_config.txz --exclude .git nvim
4542
mv ./*.txz ~/publish
@@ -48,6 +45,7 @@ jobs:
4845
run: |
4946
cd ~/.config
5047
echo "install vendor===================="
48+
nvim --headless -c 'MasonInstall --sync tree-sitter-cli' -c qall
5149
nvim --headless -c 'MasonInstall --sync lua-language-server' -c qall
5250
nvim --headless -c 'MasonInstall --sync clangd' -c qall
5351

.github/workflows/workflow_run_pruner.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
# schedule:
55
# - cron: '15 19 1 * *'
66
#push:
7-
# branches: [ master ]
7+
# branches: [ main ]
88
workflow_dispatch:
99

1010
jobs:

build/vim_build.sh

Lines changed: 0 additions & 172 deletions
This file was deleted.

etc/git.zsh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ compdef _gar gar
7474
alias gb='git branch'
7575
alias gba='git branch -a'
7676
alias gbd='git branch -d'
77-
alias gbda='git branch --no-color --merged | command grep -vE "^(\*|\s*(master|develop|dev)\s*$)" | command xargs -n 1 git branch -d'
78-
alias gbDa='git branch --no-color | command grep -vE "^(\*|\s*(master|develop|dev)\s*$)" | command xargs -n 1 git branch -D'
77+
alias gbda='git branch --no-color --merged | command grep -vE "^(\*|\s*(master|main|dev)\s*$)" | command xargs -n 1 git branch -d'
78+
alias gbDa='git branch --no-color | command grep -vE "^(\*|\s*(master|main|dev)\s*$)" | command xargs -n 1 git branch -D'
7979
alias gbD='git branch -D'
8080
alias gbl='git blame -b -w'
8181
alias gbnm='git branch --no-merged'
@@ -100,7 +100,7 @@ alias gcf='git config --list'
100100
alias gcl='git clone --recurse-submodules'
101101
alias gclean='git clean -fd'
102102
alias gpristine='git reset --hard && git clean -dfx'
103-
alias gcm='git checkout master'
103+
alias gcm='git checkout main'
104104
alias gcd='git checkout develop'
105105
alias gcmsg='git commit -m'
106106
alias gco='git checkout'
@@ -232,10 +232,10 @@ alias glS='git log --source -S'
232232
compdef _git glp=git-log
233233

234234
alias gm='git merge'
235-
alias gmom='git merge origin/master'
235+
alias gmom='git merge origin/main'
236236
alias gmt='git mergetool --no-prompt'
237237
alias gmtvim='git mergetool --no-prompt --tool=vimdiff'
238-
alias gmum='git merge upstream/master'
238+
alias gmum='git merge upstream/main'
239239
alias gma='git merge --abort'
240240

241241
alias gp='git push'
@@ -254,7 +254,7 @@ alias grba='git rebase --abort'
254254
alias grbc='git rebase --continue'
255255
alias grbd='git rebase develop'
256256
alias grbi='git rebase -i'
257-
alias grbm='git rebase master'
257+
alias grbm='git rebase main'
258258
alias grbs='git rebase --skip'
259259
alias grh='git reset'
260260
alias grhh='git reset --hard'
@@ -295,7 +295,7 @@ alias gup='git pull --rebase'
295295
alias gupv='git pull --rebase -v'
296296
alias gupa='git pull --rebase --autostash'
297297
alias gupav='git pull --rebase --autostash -v'
298-
alias glum='git pull upstream master'
298+
alias glum='git pull upstream main'
299299

300300
alias gwch='git whatchanged -p --abbrev-commit --pretty=medium'
301301
alias gwip='git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit --no-verify -m "--wip-- [skip ci]"'

lua/config/keymap.lua

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,5 @@ vim.api.nvim_create_autocmd("FileType", {
185185

186186
-- RemoveLsplog {{{
187187
vim.api.nvim_create_user_command("RemoveLsplog", function()
188-
vim.fn.writefile({}, vim.lsp.get_log_path())
188+
vim.fn.writefile({}, vim.lsp.log.get_filename())
189189
end, {})
190-
191-
vim.cmd([[ autocmd FileType qf wincmd J ]])

lua/config/lazy.lua

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ local plugins = {
2222

2323
-- editor {{{
2424
{ import = "plugins.sleuth" },
25-
{ import = "plugins.comment" },
25+
-- { import = "plugins.comment" },
26+
{ import = "plugins.ts_comments" },
2627
{ import = "plugins.window_picker" },
2728
-- { import = "plugins.incline" },
2829
-- { import = "plugins.tagbar" },
@@ -44,6 +45,7 @@ local plugins = {
4445
require("plugins.telescope").setup,
4546
require("plugins.snacks").setup,
4647
{ import = "plugins.action_preview" },
48+
{ import = "plugins.atone" },
4749
-- { import = "plugins.opencode" },
4850
-- { "Yggdroot/LeaderF", cmd = { "Leaderf" }, build = ":LeaderfInstallCExtension" },
4951
{ "chrisbra/Colorizer", cmd = { "ColorToggle" } },
@@ -83,7 +85,6 @@ local plugins = {
8385
-- { import = "plugins.tiny_inline_diagnostic" },
8486
{
8587
"neovim/nvim-lspconfig",
86-
cmd = { "LspInfo", "LspInstall", "LspStart", "LspRestart" },
8788
event = { "BufReadPre", "BufNewFile" },
8889
config = require("config.lsp").setup,
8990
dependencies = {
@@ -95,6 +96,10 @@ local plugins = {
9596
-- lazy config {{{
9697
require("lazy").setup(plugins, {
9798
root = g.plug_dir,
99+
rocks = {
100+
enabled = false,
101+
hererocks = false,
102+
},
98103
checker = {
99104
enabled = false,
100105
notify = true,

lua/config/lsp.lua

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -165,18 +165,18 @@ function configs.lua()
165165
-- :lua vim.print(vim.lsp.get_clients({ name = "lua_ls" })[1].config.settings.Lua)
166166
-- vim.g.lazydev_enabled = false
167167
local opts = {
168+
root_markers = {
169+
".root",
170+
".luarc.json",
171+
".luarc.jsonc",
172+
".luacheckrc",
173+
".stylua.toml",
174+
"stylua.toml",
175+
"selene.toml",
176+
"selene.yml",
177+
".git",
178+
},
168179
settings = {
169-
root_markers = {
170-
".root",
171-
".luarc.json",
172-
".luarc.jsonc",
173-
".luacheckrc",
174-
".stylua.toml",
175-
"stylua.toml",
176-
"selene.toml",
177-
"selene.yml",
178-
".git",
179-
},
180180
Lua = {
181181
semantic = {
182182
enable = true,
@@ -248,6 +248,13 @@ end
248248
function M.setup()
249249
-- lsp.set_log_level('debug')
250250

251+
vim.api.nvim_create_user_command("LspRestart", function()
252+
util.lspRestart();
253+
end, { desc = "Restart LSP clients" })
254+
vim.api.nvim_create_user_command("LspInfo", function()
255+
vim.cmd("checkhealth lsp")
256+
end, { desc = "Alias for checkhealth lsp" })
257+
251258
vim.api.nvim_create_autocmd("LspAttach", {
252259
callback = lspAttch
253260
})

lua/config/statusline.lua

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -41,38 +41,6 @@ function M.indent()
4141
return ret
4242
end
4343

44-
function M.lsp_progress()
45-
--local msg = vim.lsp.util.get_progress_messages()
46-
local msg = {}
47-
for _, client in ipairs(vim.lsp.get_clients()) do
48-
for progress in client.progress do
49-
local value = progress.value
50-
if type(value) == "table" and value.kind then
51-
msg.name = client.name
52-
msg.message = value.message
53-
msg.title = value.title
54-
msg.kind = value.kind
55-
if value.kind == "end" then
56-
msg.percentage = 100
57-
else
58-
msg.percentage = value.percentage
59-
end
60-
end
61-
end
62-
end
63-
64-
if vim.tbl_count(msg) > 0 then
65-
--vim.print(msg)
66-
67-
return (msg.name or "")
68-
.. (msg.title and (" " .. msg.title) or "")
69-
.. (msg.message and (" " .. msg.message) or "")
70-
.. (msg.percentage and (" " .. msg.percentage .. "%%") or "")
71-
end
72-
73-
return ""
74-
end
75-
7644
function M.search()
7745
if vim.v.hlsearch == 1 then
7846
local ok, searchcount = pcall(vim.fn.searchcount)

lua/plugins/atone.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
return {
2+
"XXiaoA/atone.nvim",
3+
cmd = "Atone",
4+
---@module "atone"
5+
---@type AtoneConfig
6+
opts = {},
7+
}

0 commit comments

Comments
 (0)