diff options
| author | steven-na <noreply.github@stvnc.dev> | 2026-04-29 02:38:22 -0700 |
|---|---|---|
| committer | steven-na <noreply.github@stvnc.dev> | 2026-04-29 02:38:22 -0700 |
| commit | c13c18d60b2e3d1870b3cd592c4391942d8a315b (patch) | |
| tree | c5eb1b388bbec5cde751e9426b954003b9947738 /arch/nvim | |
| parent | bab234423fffaf492f6617b53c11d865b8a21815 (diff) | |
fixes/better nvim
Diffstat (limited to 'arch/nvim')
| -rw-r--r-- | arch/nvim/.config/nvim/lazy-lock.json | 1 | ||||
| -rw-r--r-- | arch/nvim/.config/nvim/lua/plugins/completion.lua | 31 | ||||
| -rw-r--r-- | arch/nvim/.config/nvim/lua/plugins/extras.lua | 70 | ||||
| -rw-r--r-- | arch/nvim/.config/nvim/lua/plugins/formatting.lua | 27 |
4 files changed, 75 insertions, 54 deletions
diff --git a/arch/nvim/.config/nvim/lazy-lock.json b/arch/nvim/.config/nvim/lazy-lock.json index 3480e8d..435605d 100644 --- a/arch/nvim/.config/nvim/lazy-lock.json +++ b/arch/nvim/.config/nvim/lazy-lock.json @@ -7,6 +7,7 @@ "friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" }, "fzf-lua": { "branch": "main", "commit": "1ae863c83e0823225b4e041845f10c918d5fb882" }, "gitsigns.nvim": { "branch": "main", "commit": "6d808f99bd63303646794406e270bd553ad7792e" }, + "go-up.nvim": { "branch": "main", "commit": "0151656d66cdad1a696ac10169b2400628c7b451" }, "hardtime.nvim": { "branch": "main", "commit": "b4e431934af1fe224a3a801f632c008278cb7628" }, "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, "lazydev.nvim": { "branch": "main", "commit": "ff2cbcba459b637ec3fd165a2be59b7bbaeedf0d" }, diff --git a/arch/nvim/.config/nvim/lua/plugins/completion.lua b/arch/nvim/.config/nvim/lua/plugins/completion.lua index 26ab3b6..c7b5652 100644 --- a/arch/nvim/.config/nvim/lua/plugins/completion.lua +++ b/arch/nvim/.config/nvim/lua/plugins/completion.lua @@ -7,14 +7,16 @@ return { keymap = { preset = "none", ["<C-Space>"] = { "show", "show_documentation", "hide_documentation" }, - ["<C-e>"] = { "hide" }, - ["<CR>"] = { "accept", "fallback" }, - ["<Tab>"] = { "select_next", "snippet_forward", "fallback" }, - ["<S-Tab>"] = { "select_prev", "snippet_backward", "fallback" }, - ["<C-b>"] = { "scroll_documentation_up", "fallback" }, - ["<C-f>"] = { "scroll_documentation_down", "fallback" }, - ["<C-n>"] = { "select_next", "fallback" }, - ["<C-p>"] = { "select_prev", "fallback" }, + ["<C-e>"] = { "hide" }, + ["<CR>"] = { "accept", "fallback" }, + ["<Tab>"] = { "show", "select_next", "fallback" }, + ["<S-Tab>"] = { "select_prev", "fallback" }, + ["<C-b>"] = { "scroll_documentation_up", "fallback" }, + ["<C-f>"] = { "scroll_documentation_down", "fallback" }, + ["<C-n>"] = { "select_next", "fallback" }, + ["<C-p>"] = { "select_prev", "fallback" }, + ["<C-k>"] = { "snippet_forward", "fallback" }, + ["<C-j>"] = { "snippet_backward", "fallback" }, }, appearance = { nerd_font_variant = "mono" }, sources = { @@ -23,10 +25,9 @@ return { snippets = { preset = "luasnip" }, completion = { documentation = { auto_show = true, auto_show_delay_ms = 200 }, - ghost_text = { enabled = true }, - menu = { border = "single" }, + ghost_text = { enabled = false }, + menu = { auto_show = false }, }, - signature = { enabled = true, window = { border = "single" } }, }, }, { @@ -37,4 +38,12 @@ return { require("luasnip.loaders.from_vscode").lazy_load() end, }, + { + "nullromo/go-up.nvim", + opts = {}, -- specify options here + config = function(_, opts) + local goUp = require("go-up") + goUp.setup(opts) + end, + }, } diff --git a/arch/nvim/.config/nvim/lua/plugins/extras.lua b/arch/nvim/.config/nvim/lua/plugins/extras.lua index 95366ed..0dd2d01 100644 --- a/arch/nvim/.config/nvim/lua/plugins/extras.lua +++ b/arch/nvim/.config/nvim/lua/plugins/extras.lua @@ -1,37 +1,37 @@ return { - -- Splash screen / dashboard - { - "folke/snacks.nvim", - priority = 1000, - lazy = false, - opts = { - dashboard = { - sections = { - { section = "header" }, - { section = "keys", gap = 1, padding = 1 }, - { section = "startup" }, - }, - }, - }, - }, - -- Undo history tree - { - "mbbill/undotree", - keys = { - { "<leader>u", "<cmd>UndotreeToggle<CR>", desc = "Undo tree" }, - }, - }, - -- Buffer-based file explorer - { - "stevearc/oil.nvim", - lazy = false, - keys = { - { "<leader>e", "<cmd>Oil<CR>", desc = "File explorer" }, - { "-", "<cmd>Oil<CR>", desc = "Open parent dir" }, - }, - opts = { - default_file_explorer = true, - view_options = { show_hidden = true }, - }, - }, + -- Splash screen / dashboard + { + "folke/snacks.nvim", + priority = 1000, + lazy = false, + opts = { + dashboard = { + sections = { + { section = "header" }, + { section = "keys", gap = 1, padding = 1 }, + { section = "startup" }, + }, + }, + }, + }, + -- Undo history tree + { + "mbbill/undotree", + keys = { + { "<leader>u", "<cmd>UndotreeToggle<CR>", desc = "Undo tree" }, + }, + }, + -- Buffer-based file explorer + { + "stevearc/oil.nvim", + lazy = false, + keys = { + { "<leader>e", "<cmd>Oil<CR>", desc = "File explorer" }, + { "-", "<cmd>Oil<CR>", desc = "Open parent dir" }, + }, + opts = { + default_file_explorer = true, + view_options = { show_hidden = true }, + }, + }, } diff --git a/arch/nvim/.config/nvim/lua/plugins/formatting.lua b/arch/nvim/.config/nvim/lua/plugins/formatting.lua index 912a6a8..39e02d9 100644 --- a/arch/nvim/.config/nvim/lua/plugins/formatting.lua +++ b/arch/nvim/.config/nvim/lua/plugins/formatting.lua @@ -1,8 +1,8 @@ return { "stevearc/conform.nvim", event = "BufWritePre", - cmd = { "ConformInfo", "FormatToggle" }, - keys = { + cmd = { "ConformInfo", "FormatToggle" }, + keys = { { "<leader>cF", function() @@ -17,7 +17,9 @@ return { }, { "<leader>cf", - function() require("conform").format({ async = true, lsp_fallback = true }) end, + function() + require("conform").format({ async = true, lsp_fallback = true }) + end, desc = "Format buffer", }, }, @@ -26,19 +28,28 @@ return { require("conform").setup({ formatters_by_ft = { - c = { "clang_format" }, - cpp = { "clang_format" }, + c = { "clang_format" }, + cpp = { "clang_format" }, python = { "isort", "black" }, - lua = { "stylua" }, + lua = { "stylua" }, haskell = { "ormolu" }, }, + format_on_save = function(bufnr) - if not vim.g.format_on_save then return end - if vim.g.disable_autoformat_buf and vim.g.disable_autoformat_buf[bufnr] then return end + if not vim.g.format_on_save then + return + end + if vim.g.disable_autoformat_buf and vim.g.disable_autoformat_buf[bufnr] then + return + end return { timeout_ms = 500, lsp_fallback = true } end, }) + require("conform").formatters.clang_format = { + prepend_args = { "--style={IndentWidth: 4, TabWidth: 4, UseTab: Never}" }, + } + vim.api.nvim_create_user_command("FormatToggle", function() vim.g.format_on_save = not vim.g.format_on_save vim.notify("Format on save: " .. (vim.g.format_on_save and "on" or "off")) |