Skip to content

Commit 3309bef

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

File tree

15 files changed

+109
-351
lines changed

15 files changed

+109
-351
lines changed

.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: 6 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" },
@@ -83,7 +84,6 @@ local plugins = {
8384
-- { import = "plugins.tiny_inline_diagnostic" },
8485
{
8586
"neovim/nvim-lspconfig",
86-
cmd = { "LspInfo", "LspInstall", "LspStart", "LspRestart" },
8787
event = { "BufReadPre", "BufNewFile" },
8888
config = require("config.lsp").setup,
8989
dependencies = {
@@ -95,6 +95,10 @@ local plugins = {
9595
-- lazy config {{{
9696
require("lazy").setup(plugins, {
9797
root = g.plug_dir,
98+
rocks = {
99+
enabled = false,
100+
hererocks = false,
101+
},
98102
checker = {
99103
enabled = false,
100104
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/plugins/just.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ set export
4242
set shell := ["nu", "-c"]
4343
set script-interpreter := ["nu"]
4444
45+
[private]
4546
[script]
4647
default:
4748
just --list

lua/plugins/snacks.lua

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@ local dashboard_opts = {
2020
action = require("util").grep,
2121
},
2222
{ icon = "", key = "m", desc = "Recent Files", action = function() Snacks.picker.recent() end },
23-
{ icon = "", key = "c", desc = "Config", action = ":lua Snacks.dashboard.pick('files', {cwd = vim.fn.stdpath('config')})" },
23+
{
24+
icon = "",
25+
key = "c",
26+
desc = "Config",
27+
action = function() Snacks.dashboard.pick("files", { cwd = vim.g.config_dir }) end,
28+
},
2429
{ icon = "", key = "s", desc = "Restore Session", section = "session" },
2530
{ icon = "󰒲 ", key = "l", desc = "Lazy", action = ":Lazy", enabled = package.loaded.lazy ~= nil },
2631
{ icon = "", key = "q", desc = "Quit", action = ":qa" },
@@ -161,8 +166,11 @@ M.setup = { --{{{
161166
---@param ctx {buf: number, ft:string}
162167
setup = function(ctx)
163168
vim.b.minianimate_disable = true
169+
vim.b.minihipatterns_disable = true
164170
vim.schedule(function()
165-
vim.bo[ctx.buf].syntax = ctx.ft
171+
if vim.api.nvim_buf_is_valid(ctx.buf) then
172+
vim.bo[ctx.buf].syntax = ctx.ft
173+
end
166174
end)
167175
end,
168176
},
@@ -210,8 +218,13 @@ M.setup = { --{{{
210218
}
211219
}
212220
},
213-
dashboard_opts,
221+
dashboard = dashboard_opts,
214222
},
223+
config = function(_, opts)
224+
require("snacks").setup(opts)
225+
vim.ui.input = Snacks.input.input
226+
vim.ui.select = Snacks.picker.select
227+
end,
215228
init = function()
216229
vim.api.nvim_create_autocmd("User", {
217230
pattern = "VeryLazy",

0 commit comments

Comments
 (0)