Compare commits

..
Author SHA1 Message Date
Dzuchun
36e297e012 makefile: add update target
- updates Lazy plugins
- updates Mason registry
- install all the Mason stuff
- included in `install`
2025-12-25 18:43:14 +00:00
Dzuchun
f8a497b9af ignore: htmlhint config
used to check if htmlhint correctly reacts to it's config. no point to
keep it in this repo
2025-12-25 18:42:15 +00:00
Dzuchun
e0fac2c5a1 ignore local XDG config
is appeared here, while I was running nvim locally
2025-12-25 18:41:40 +00:00
Dzuchun
84cf9c9262 fmt 2025-12-25 18:41:12 +00:00
Dzuchun
406f21bc01 fix: bring clangd back into cutom configs 2025-12-25 18:40:03 +00:00
Dzuchun
a4c83b8e85 fix: remove nil_ls from the lsp config
as it requires nix to be built
2025-12-25 18:39:11 +00:00
Dzuchun
0e9b9149dc fix: load everything with mason-tools
this way, I can finally ensure that all the LSPs are properly installed
on editor boot
2025-12-25 18:35:18 +00:00
Dzuchun
0ab6b09300 fix: "couldn't load tree-sitter"
the setup code was incorrect. no idea where it came from :/
2025-12-25 18:33:15 +00:00
Dzuchun
92ceeb006e ench: explicit line wrapping on by default 2025-12-25 18:26:52 +00:00
Dzuchun
5bc731de3e disable automatic line breaking 2025-12-25 18:26:28 +00:00
Dzuchun
92e63a74c4 ench: hide mouse even more 2025-12-25 18:22:38 +00:00
Dzuchun
c2926c1e3a ench: remove folding 2025-12-25 18:19:20 +00:00
Dzuchun
1b913c19cb ench: unfold everything in diffview by default 2025-12-25 18:17:37 +00:00
Dzuchun
d48f805b70 feat(lua_ls): use spaces instead of tabs 2025-12-25 18:13:17 +00:00
Dzuchun
a874867e97 line wrapping toggle 2025-12-25 13:50:07 +00:00
12 changed files with 125 additions and 81 deletions

6
.gitignore vendored
View file

@ -12,3 +12,9 @@ package-lock.json
# stt model # stt model
ggml-*.bin ggml-*.bin
# xdg config, only useful for test runs
mimeapps.list
# htmlhint config, not a part of nvim config
.htmlhintrc

View file

@ -49,8 +49,11 @@ remove_cfg:
rm $(CONFIG_FILES_FILE); \ rm $(CONFIG_FILES_FILE); \
fi fi
update:
@ndzu --headless '+Lazy! update' '+Lazy! sync' '+MasonToolsUpdateSync' +qa
# PACMAN_DEPS: deno tree-sitter-cli nix luarocks jdk21-openjdk # PACMAN_DEPS: deno tree-sitter-cli nix luarocks jdk21-openjdk
# CARGO_BINS: nu nu_plugin_polars # CARGO_BINS: nu nu_plugin_polars
install: install_bin install_cfg install: install_bin install_cfg update
remove: remove_bin remove_cfg remove: remove_bin remove_cfg

View file

@ -49,6 +49,9 @@ keymap(vm, "p", '"_dP', opts)
keymap(nm, "s", "<Nop>", opts) keymap(nm, "s", "<Nop>", opts)
keymap(nm, "sw", ":lua require('dzu.macro').toggle_whitespace_helpers()<CR>", opts) keymap(nm, "sw", ":lua require('dzu.macro').toggle_whitespace_helpers()<CR>", opts)
-- toggle line wrapping
keymap(nm, '<leader>w', ":lua require('dzu.macro').toggle_wrapping()<CR>", opts)
-- open file browser -- open file browser
keymap(nm, '<leader>a', ':NvimTreeToggle<CR>', opts) -- open file explorer in the current folder, shirnk it a bit, and move to the left-most keymap(nm, '<leader>a', ':NvimTreeToggle<CR>', opts) -- open file explorer in the current folder, shirnk it a bit, and move to the left-most

View file

@ -17,6 +17,13 @@ return {
telemetry = { telemetry = {
enable = false, enable = false,
}, },
} format = {
} enable = true,
defaultConfig = {
indent_style = "space",
indent_size = "4",
},
},
},
},
} }

View file

@ -14,30 +14,38 @@ require("mason").setup(settings)
local servers = { local servers = {
{ "rust_analyzer", "rust_analyzer" }, { "rust_analyzer", "rust_analyzer" },
{ "pyright", "pyright", }, { "pyright", "pyright" },
{ "ts_ls", nil }, { "ts_ls", nil },
{ "biome", nil }, { "biome", nil },
{ "clangd", nil }, { "clangd", "clangd" },
{ "lua_ls", "lua_ls" }, { "lua_ls", "lua_ls" },
-- { "hls", "hls" },
{ "nil_ls", nil },
{ "tinymist", "tinymist" }, { "tinymist", "tinymist" },
{ "jdtls", nil }, { "jdtls", nil },
-- { "nushell", nil }, -- TODO what IS the lspconfig name?
{ "html", nil }, { "html", nil },
{ "dockerls", nil }, { "dockerls", nil },
} }
local lspconfig_servers = {} local ensure_installed = {}
local i = 1
for _, s in pairs(servers) do for _, s in pairs(servers) do
local s0 = s[1] local s0 = s[1]
if s0 ~= nil then if s0 ~= nil then
table.insert(lspconfig_servers, s0) table.insert(ensure_installed, i, s0)
i = i + 1
vim.lsp.enable(s0, true) vim.lsp.enable(s0, true)
end end
end end
for tool, _ in pairs(ADDITIONAL_MASON_TOOLS) do
table.insert(ensure_installed, i, tool)
i = i + 1
end
require("mason-tool-installer").setup({
ensure_installed = ensure_installed,
auto_update = true,
run_on_start = true,
})
require("mason-lspconfig").setup({ require("mason-lspconfig").setup({
ensure_installed = lspconfig_servers,
automatic_enable = true, automatic_enable = true,
automatic_installation = true, automatic_installation = true,
}) })
@ -50,7 +58,6 @@ for _, s in pairs(servers) do
end end
end end
local is_ok, handlers = pcall(require, "dzu.lsp.handlers") local is_ok, handlers = pcall(require, "dzu.lsp.handlers")
if not is_ok then if not is_ok then
vim.notify("failed to initialize LSP handlers") vim.notify("failed to initialize LSP handlers")

View file

@ -14,6 +14,12 @@ function M.toggle_whitespace_helpers()
end end
end end
-- add wrapping toggle
function M.toggle_wrapping()
local wrap = vim.opt.wrap._value
vim.opt.wrap = not wrap
end
-- limiting line must be disable in readonly windows -- limiting line must be disable in readonly windows
vim.api.nvim_create_autocmd("BufEnter", { vim.api.nvim_create_autocmd("BufEnter", {
callback = function(event_data) callback = function(event_data)

View file

@ -16,13 +16,8 @@ local options = {
}, },
-- visualbell = true, -- FLASHES THE SCREEN -- visualbell = true, -- FLASHES THE SCREEN
-- binary - check out binary file viewing and editing -- binary - check out binary file viewing and editing
linebreak = true, linebreak = false,
breakat = " ^I!@*-+;:,./?", -- where line breaks are allowed wrap = true,
-- breakindent = true, -- line breaks continue where the line starts
breakindentopt = {
'shift:0', -- indent by no char
'sbr', -- show line break symbol
},
showbreak = '↪ ', -- line break symbol itself showbreak = '↪ ', -- line break symbol itself
cdhome = false, -- do not cd to home on :cd (won't work?) cdhome = false, -- do not cd to home on :cd (won't work?)
cedit = '', -- no kinding to open CL window (?) cedit = '', -- no kinding to open CL window (?)
@ -42,15 +37,11 @@ local options = {
errorbells = true, -- sound on errors errorbells = true, -- sound on errors
exrc = true, -- execute possible local config exrc = true, -- execute possible local config
fillchars = 'diff:<', fillchars = 'diff:<',
foldlevelstart = 0, -- at start, close all folds...
foldminlines = 50, -- but only fold really large things...
foldmethod = 'indent', -- and identify them by indent
-- look into lang* (langmenu) -- look into lang* (langmenu)
lazyredraw = true, -- might be a bad idea, IDK lazyredraw = true, -- might be a bad idea, IDK
mouse = 'nvi', -- enable mouse at insert and visual mouse = '',
mousehide = true, -- hide mouse when something is being typed mousehide = true,
-- mousefocus = true, -- focus on window where mouse is mousescroll = 'ver:0,hor:0',
mousescroll = 'ver:2,hor:3',
-- mouses = 'n:arrow,v:crosshair,i:beam', -- how mouse looks like in different modes -- mouses = 'n:arrow,v:crosshair,i:beam', -- how mouse looks like in different modes
number = true, -- print numbers at the start number = true, -- print numbers at the start
ruler = true, -- show row&column ruler = true, -- show row&column

View file

@ -89,7 +89,11 @@ local function config()
DiffviewOpen = {}, DiffviewOpen = {},
DiffviewFileHistory = {}, DiffviewFileHistory = {},
}, },
hooks = {}, -- See |diffview-config-hooks| hooks = {
diff_buf_win_enter = function()
vim.opt_local.foldenable = false
end,
}, -- See |diffview-config-hooks|
keymaps = { keymaps = {
disable_defaults = false, -- Disable the default keymaps disable_defaults = false, -- Disable the default keymaps
view = { view = {

View file

@ -6,9 +6,8 @@ local function config()
end end
-- js/ts fomatters -- js/ts fomatters
local web_fmt = { "biome" }; local web_fmt = { "biome" }
local fomatters_by_ft = { local fomatters_by_ft = {
lua = { "stylua" },
python = { "black" }, python = { "black" },
javascript = web_fmt, javascript = web_fmt,
javascriptreact = web_fmt, javascriptreact = web_fmt,

View file

@ -1,20 +1,10 @@
local function config()
local is_ok, _ = pcall(require, 'dzu.lsp')
if not is_ok then
vim.notify("failed to setup lsp")
return
end
end
return { return {
"mason-org/mason-lspconfig.nvim", "mason-org/mason-lspconfig.nvim",
opts = {},
dependencies = { dependencies = {
"mason-org/mason.nvim", "mason-org/mason.nvim",
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
-- lsp completions -- lsp completions
"hrsh7th/cmp-nvim-lsp", "hrsh7th/cmp-nvim-lsp",
}, },
config = config,
lazy = false, lazy = false,
} }

View file

@ -0,0 +1,29 @@
local function config()
local is_ok, _ = pcall(require, "mason-tool-installer")
if not is_ok then
vim.notify("Failed to setup mason tools")
return
end
local is_ok, _ = pcall(require, "dzu.lsp")
if not is_ok then
vim.notify("failed to setup lsp")
return
end
end
return {
"WhoIsSethDaniel/mason-tool-installer.nvim",
dependencies = {
"mason-org/mason-lspconfig.nvim",
},
config = config,
lazy = false,
opts = {
integrations = {
["mason-lspconfig"] = true,
["mason-null-ls"] = false,
["mason-nvim-dap"] = false,
},
},
}

View file

@ -1,49 +1,48 @@
local function config() local function config()
local is_ok, configs = pcall(require, "nvim-treesitter.configs") local is_ok, tree_sitter = pcall(require, "nvim-treesitter")
if not is_ok then if not is_ok then
vim.notify("couldn't find tree sitter config") vim.notify("couldn't find tree sitter")
return return
end end
local config_opts = { local langs = {
ensure_installed = { "bash",
"bash", "c",
"c", "comment",
"comment", "cpp",
"cpp", "csv",
"csv", "djot",
-- "cuda", -- not yet; might enable in the future "dockerfile",
"djot", "fish",
"dockerfile", -- oh yeah. I should probably figure docker out... "gitignore",
"fish", "diff",
"gitignore", "git_rebase",
"diff", "gitcommit",
"git_rebase", "haskell",
"gitcommit", "html",
"haskell", "javascript",
"html", "typescript",
"javascript", "tsx",
"typescript", "json",
-- "jsx", "latex",
"tsx", "lua",
"json", "luadoc",
"latex", "make",
"lua", "markdown",
"luadoc", "markdown_inline",
"make", "python",
"markdown", "rust",
"markdown_inline", "sql",
"python", "toml",
"rust", "vim",
"sql", "vimdoc",
"toml", "xml",
"vim", "nu",
"vimdoc", "java",
"xml", }
"nu", local opts = {
"java", ensure_installed = langs,
}, sync_install = true,
sync_install = false,
ignore_install = {}, -- List of parsers to ignore installing ignore_install = {}, -- List of parsers to ignore installing
highlight = { highlight = {
enable = true, -- false will disable the whole extension enable = true, -- false will disable the whole extension
@ -53,7 +52,7 @@ local function config()
}, },
indent = { enable = true, disable = {} }, indent = { enable = true, disable = {} },
} }
configs.setup(config_opts) tree_sitter.setup(opts)
vim.cmd.TSUpdate() vim.cmd.TSUpdate()
end end