diff options
| author | Thomas Vanbesien <tvanbesi@proton.me> | 2026-06-12 17:02:54 +0200 |
|---|---|---|
| committer | Thomas Vanbesien <tvanbesi@proton.me> | 2026-06-12 22:57:34 +0200 |
| commit | 1734929edd6ceb47fcee53cb9d0a408b41dea14a (patch) | |
| tree | 2bd06885ddd5f91656dfb7851ddb3446e6a2ca74 /.config/nvim/plugin | |
| parent | c3c0fe51524d0e7bbc2d93fb9ee0127db691287a (diff) | |
| download | dotfiles-1734929edd6ceb47fcee53cb9d0a408b41dea14a.tar.gz dotfiles-1734929edd6ceb47fcee53cb9d0a408b41dea14a.zip | |
misc(nvim): reformat lua files to 100 char line width
Diffstat (limited to '.config/nvim/plugin')
| -rw-r--r-- | .config/nvim/plugin/00-plugin.lua | 26 | ||||
| -rw-r--r-- | .config/nvim/plugin/50-completion.lua | 5 | ||||
| -rw-r--r-- | .config/nvim/plugin/50-git.lua | 6 | ||||
| -rw-r--r-- | .config/nvim/plugin/50-lsp.lua | 10 | ||||
| -rw-r--r-- | .config/nvim/plugin/50-markdown.lua | 7 | ||||
| -rw-r--r-- | .config/nvim/plugin/50-netrw.lua | 6 | ||||
| -rw-r--r-- | .config/nvim/plugin/50-notes.lua | 59 | ||||
| -rw-r--r-- | .config/nvim/plugin/50-session.lua | 3 | ||||
| -rw-r--r-- | .config/nvim/plugin/50-spell.lua | 12 | ||||
| -rw-r--r-- | .config/nvim/plugin/50-tabline.lua | 15 | ||||
| -rw-r--r-- | .config/nvim/plugin/50-transform_text.lua | 8 |
11 files changed, 117 insertions, 40 deletions
diff --git a/.config/nvim/plugin/00-plugin.lua b/.config/nvim/plugin/00-plugin.lua index 55e5a1c..584fe8e 100644 --- a/.config/nvim/plugin/00-plugin.lua +++ b/.config/nvim/plugin/00-plugin.lua @@ -5,17 +5,17 @@ -- vim.pack.add({ - "https://github.com/airblade/vim-gitgutter", -- Show git status in the gutter - "https://github.com/ibhagwan/fzf-lua", -- Fuzzy finder - "https://github.com/jbyuki/one-small-step-for-vimkind", -- DAP adapter for Neovim Lua - "https://github.com/maxmx03/solarized.nvim", -- Solarized color scheme - "https://github.com/MeanderingProgrammer/render-markdown.nvim", -- Markdown rendering - "https://github.com/mfussenegger/nvim-dap", -- DAP (Debug Adapter Protocol) client - "https://github.com/neovim/nvim-lspconfig", -- LSP server configurations - "https://github.com/nvim-lualine/lualine.nvim", -- Status line - "https://github.com/nvim-tree/nvim-web-devicons", -- File-type icons (lualine, fzf-lua, render-markdown) - "https://github.com/nvim-treesitter/nvim-treesitter", -- Parsers, highlighting (treesitter, markdown) - "https://github.com/qadzek/link.vim", -- Tidy URLs into a dedicated section (markdown) - "https://github.com/tpope/vim-surround", -- Manipulate delimiters - "https://github.com/windwp/nvim-autopairs", -- Insert matching delimiters + "https://github.com/airblade/vim-gitgutter", + "https://github.com/ibhagwan/fzf-lua", + "https://github.com/jbyuki/one-small-step-for-vimkind", + "https://github.com/maxmx03/solarized.nvim", + "https://github.com/MeanderingProgrammer/render-markdown.nvim", + "https://github.com/mfussenegger/nvim-dap", + "https://github.com/neovim/nvim-lspconfig", + "https://github.com/nvim-lualine/lualine.nvim", + "https://github.com/nvim-tree/nvim-web-devicons", + "https://github.com/nvim-treesitter/nvim-treesitter", + "https://github.com/qadzek/link.vim", + "https://github.com/tpope/vim-surround", + "https://github.com/windwp/nvim-autopairs", }) diff --git a/.config/nvim/plugin/50-completion.lua b/.config/nvim/plugin/50-completion.lua index f21b1f4..620d9bd 100644 --- a/.config/nvim/plugin/50-completion.lua +++ b/.config/nvim/plugin/50-completion.lua @@ -87,7 +87,10 @@ snippet.expand = function(input) local ok = pcall(orig_expand, input) if not ok then insert_plain(strip_snippet(input)) - vim.notify("Snippet parse failed, inserted as plain text: " .. vim.inspect(input), vim.log.levels.WARN) + vim.notify( + "Snippet parse failed, inserted as plain text: " .. vim.inspect(input), + vim.log.levels.WARN + ) end end diff --git a/.config/nvim/plugin/50-git.lua b/.config/nvim/plugin/50-git.lua index 513074f..8bebef1 100644 --- a/.config/nvim/plugin/50-git.lua +++ b/.config/nvim/plugin/50-git.lua @@ -70,7 +70,11 @@ local git_blame_toggle = (function() end end)() -vim.api.nvim_create_user_command("GitBlame", git_blame_toggle, { desc = "Open/enter git blame window" }) +vim.api.nvim_create_user_command( + "GitBlame", + git_blame_toggle, + { desc = "Open/enter git blame window" } +) -- The original mappings from the plugin are broken vim.keymap.set("n", "]c", "<Cmd>GitGutterNextHunk<CR>", { desc = "Next git hunk" }) diff --git a/.config/nvim/plugin/50-lsp.lua b/.config/nvim/plugin/50-lsp.lua index 215dfcb..41229e5 100644 --- a/.config/nvim/plugin/50-lsp.lua +++ b/.config/nvim/plugin/50-lsp.lua @@ -22,12 +22,18 @@ vim.api.nvim_create_autocmd("LspAttach", { if client:supports_method("textDocument/completion") then vim.lsp.completion.enable(true, client.id, ev.buf, { autotrigger = true }) else - vim.notify("Client " .. client.name .. " does not support completion", vim.log.levels.WARN) + vim.notify( + "Client " .. client.name .. " does not support completion", + vim.log.levels.WARN + ) end if client:supports_method("textDocument/inlayHint") then vim.lsp.inlay_hint.enable(true, { bufnr = 0 }) else - vim.notify("Client " .. client.name .. " does not support inlay hints", vim.log.levels.WARN) + vim.notify( + "Client " .. client.name .. " does not support inlay hints", + vim.log.levels.WARN + ) end end, }) diff --git a/.config/nvim/plugin/50-markdown.lua b/.config/nvim/plugin/50-markdown.lua index a785aaa..cc415f4 100644 --- a/.config/nvim/plugin/50-markdown.lua +++ b/.config/nvim/plugin/50-markdown.lua @@ -14,7 +14,12 @@ require("nvim-treesitter").install({ local markdown_textwidth = vim.g.dotfiles.textwidth.markdown require("render-markdown").setup({ heading = { width = "block", min_width = markdown_textwidth }, - code = { position = "center", sign = false, width = "block", min_width = markdown_textwidth / 2 }, + code = { + position = "center", + sign = false, + width = "block", + min_width = markdown_textwidth / 2, + }, dash = { width = markdown_textwidth }, win_options = { conceallevel = { rendered = 2 } }, }) diff --git a/.config/nvim/plugin/50-netrw.lua b/.config/nvim/plugin/50-netrw.lua index f4787cd..7a5e090 100644 --- a/.config/nvim/plugin/50-netrw.lua +++ b/.config/nvim/plugin/50-netrw.lua @@ -22,4 +22,8 @@ vim.g.netrw_liststyle = 3 -- 3: list style vim.g.netrw_winsize = -30 -- 30 columns wide vim.g.netrw_banner = 0 -- No banner -vim.api.nvim_create_user_command("GotoExplorer", explore, { desc = "Open/close/focus netrw window" }) +vim.api.nvim_create_user_command( + "GotoExplorer", + explore, + { desc = "Open/close/focus netrw window" } +) diff --git a/.config/nvim/plugin/50-notes.lua b/.config/nvim/plugin/50-notes.lua index 907a2bf..4dda9f4 100644 --- a/.config/nvim/plugin/50-notes.lua +++ b/.config/nvim/plugin/50-notes.lua @@ -2,13 +2,22 @@ if vim.env.NOTES_DIR == nil then vim.notify("NOTES_DIR is not set", vim.log.levels.ERROR) return end -vim.g.notes_dir = vim.env.NOTES_DIR:sub(-1) == "/" and vim.env.NOTES_DIR:sub(1, -2) or vim.env.NOTES_DIR +vim.g.notes_dir = vim.env.NOTES_DIR:sub(-1) == "/" and vim.env.NOTES_DIR:sub(1, -2) + or vim.env.NOTES_DIR local notes_dir = vim.g.notes_dir local tagfile = vim.fs.joinpath(vim.fn.stdpath("state"), "notes-tags") local function generate_tags() - vim.system({ "ctags", "--languages=Markdown", "--tag-relative=no", "--recurse", "-f", tagfile, notes_dir }) + vim.system({ + "ctags", + "--languages=Markdown", + "--tag-relative=no", + "--recurse", + "-f", + tagfile, + notes_dir, + }) end -- Completion of all `*.md` note names (relative to the notes dir, extension stripped). @@ -171,7 +180,13 @@ local function update_all_notes(rewriter) local new_text new_text, n = rewriter(text) if n > 0 then - vim.api.nvim_buf_set_lines(b, 0, -1, false, vim.split(new_text, "\n", { plain = true })) + vim.api.nvim_buf_set_lines( + b, + 0, + -1, + false, + vim.split(new_text, "\n", { plain = true }) + ) if not was_modified then -- buffer matched disk; keep it that way vim.api.nvim_buf_call(b, function() vim.cmd("silent! write!") @@ -248,18 +263,28 @@ local function rename_current_note(new_rel) end) generate_tags() - vim.notify(string.format("Renamed to %s — updated %d link(s) in %d file(s)", new_rel, link_count, file_count)) + vim.notify( + string.format( + "Renamed to %s — updated %d link(s) in %d file(s)", + new_rel, + link_count, + file_count + ) + ) end vim.api.nvim_create_user_command("NotesRename", function(opts) if opts.args ~= "" then rename_current_note(opts.args) else - vim.ui.input({ prompt = "Rename note to: ", default = note_name(vim.api.nvim_buf_get_name(0)) }, function(input) - if input and input ~= "" then - rename_current_note(input) + vim.ui.input( + { prompt = "Rename note to: ", default = note_name(vim.api.nvim_buf_get_name(0)) }, + function(input) + if input and input ~= "" then + rename_current_note(input) + end end - end) + ) end end, { nargs = "?", desc = "Rename current note and update wiki-links" }) @@ -320,7 +345,12 @@ local function rename_current_section(new_head) generate_tags() vim.notify( - string.format("Renamed section to %s — updated %d link(s) in %d file(s)", new_head, link_count, file_count) + string.format( + "Renamed section to %s — updated %d link(s) in %d file(s)", + new_head, + link_count, + file_count + ) ) end @@ -329,11 +359,14 @@ vim.api.nvim_create_user_command("NotesRenameSection", function(opts) rename_current_section(opts.args) else local heading = heading_at_cursor(vim.api.nvim_get_current_buf()) - vim.ui.input({ prompt = "Rename section to: ", default = heading and heading.text }, function(input) - if input and input ~= "" then - rename_current_section(input) + vim.ui.input( + { prompt = "Rename section to: ", default = heading and heading.text }, + function(input) + if input and input ~= "" then + rename_current_section(input) + end end - end) + ) end end, { nargs = "*", desc = "Rename the heading at the cursor and update wiki-links" }) diff --git a/.config/nvim/plugin/50-session.lua b/.config/nvim/plugin/50-session.lua index 39b4c09..a297504 100644 --- a/.config/nvim/plugin/50-session.lua +++ b/.config/nvim/plugin/50-session.lua @@ -96,7 +96,8 @@ local function restore_man_windows(manpages) vim.cmd.edit({ args = { info.name } }) end) local buf = vim.api.nvim_win_get_buf(win) - local line = math.max(1, math.min(info.line or 1, vim.api.nvim_buf_line_count(buf))) + local line = + math.max(1, math.min(info.line or 1, vim.api.nvim_buf_line_count(buf))) vim.api.nvim_win_set_cursor(win, { line, 0 }) end end diff --git a/.config/nvim/plugin/50-spell.lua b/.config/nvim/plugin/50-spell.lua index 59bcc92..a25bcff 100644 --- a/.config/nvim/plugin/50-spell.lua +++ b/.config/nvim/plugin/50-spell.lua @@ -25,8 +25,16 @@ vim.opt.spellfile = { -- Spellfiles for zg, zw, z=, etc } vim.api.nvim_create_user_command("SpellToggle", toggle_spell, { desc = "Toggle spell checking" }) -vim.api.nvim_create_user_command("SpellSetEn", set_spell_en, { desc = "Set spell language to English" }) -vim.api.nvim_create_user_command("SpellSetFr", set_spell_fr, { desc = "Set spell language to French" }) +vim.api.nvim_create_user_command( + "SpellSetEn", + set_spell_en, + { desc = "Set spell language to English" } +) +vim.api.nvim_create_user_command( + "SpellSetFr", + set_spell_fr, + { desc = "Set spell language to French" } +) vim.api.nvim_create_user_command( "SpellSetEnFr", set_spell_en_fr, diff --git a/.config/nvim/plugin/50-tabline.lua b/.config/nvim/plugin/50-tabline.lua index b2f2488..a784c72 100644 --- a/.config/nvim/plugin/50-tabline.lua +++ b/.config/nvim/plugin/50-tabline.lua @@ -6,8 +6,16 @@ local function set_wincount_hl() local title = vim.api.nvim_get_hl(0, { name = "Title", link = false }) local tabline = vim.api.nvim_get_hl(0, { name = "TabLine", link = false }) local tablinesel = vim.api.nvim_get_hl(0, { name = "TabLineSel", link = false }) - vim.api.nvim_set_hl(0, "dotfiles.TabLineSelIcon", { fg = tabline.fg, bg = tablinesel.bg, bold = true }) - vim.api.nvim_set_hl(0, "dotfiles.TabLineWinCount", { fg = title.fg, bg = tabline.bg, bold = true, italic = true }) + vim.api.nvim_set_hl( + 0, + "dotfiles.TabLineSelIcon", + { fg = tabline.fg, bg = tablinesel.bg, bold = true } + ) + vim.api.nvim_set_hl( + 0, + "dotfiles.TabLineWinCount", + { fg = title.fg, bg = tabline.bg, bold = true, italic = true } + ) vim.api.nvim_set_hl( 0, "dotfiles.TabLineSelWinCount", @@ -40,7 +48,8 @@ function GetTabLine() local selected_label, modified_label = "▶ ", "[+] " local win_info = ( - is_current and "%#dotfiles.TabLineSelIcon# " .. selected_label or "%#dotfiles.TabLineWinCount# " + is_current and "%#dotfiles.TabLineSelIcon# " .. selected_label + or "%#dotfiles.TabLineWinCount# " ) .. (is_current and "%#dotfiles.TabLineSelWinCount#" or "%#dotfiles.TabLineWinCount#") .. (#wins >= 10 and ">9" or tostring(#wins)) diff --git a/.config/nvim/plugin/50-transform_text.lua b/.config/nvim/plugin/50-transform_text.lua index 9ec74d5..6786ba2 100644 --- a/.config/nvim/plugin/50-transform_text.lua +++ b/.config/nvim/plugin/50-transform_text.lua @@ -1,5 +1,8 @@ local function get_visual_selection_text() - return table.concat(vim.fn.getregion(vim.fn.getpos("v"), vim.fn.getpos("."), { type = vim.fn.mode() }), "\n") + return table.concat( + vim.fn.getregion(vim.fn.getpos("v"), vim.fn.getpos("."), { type = vim.fn.mode() }), + "\n" + ) end local function delete_visual_selection() @@ -7,7 +10,8 @@ local function delete_visual_selection() local eovisual_pos, cur_pos = vim.fn.getpos("v"), vim.fn.getpos(".") local region = vim.fn.getregionpos(eovisual_pos, cur_pos, { type = mode })[1] local start_row, start_col = unpack(region[1], 2, 3) - local end_row, end_col = mode == "v" and region[2][2] or math.max(eovisual_pos[2], cur_pos[2]), region[2][3] + local end_row, end_col = + mode == "v" and region[2][2] or math.max(eovisual_pos[2], cur_pos[2]), region[2][3] vim.api.nvim_buf_set_text(0, start_row - 1, start_col - 1, end_row - 1, end_col, {}) end |
