Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Install stylua
run: |
curl -L https://github.com/JohnnyMorganz/StyLua/releases/download/v2.3.1/stylua-linux-x86_64.zip -o stylua.zip
unzip -q stylua.zip
sudo mv stylua /usr/local/bin/
sudo chmod +x /usr/local/bin/stylua

- name: Run stylua (Lua formatter check)
run: |
stylua --check lua/
# - name: Install stylua
# run: |
# curl -L https://github.com/JohnnyMorganz/StyLua/releases/download/v2.3.1/stylua-linux-x86_64.zip -o stylua.zip
# unzip -q stylua.zip
# sudo mv stylua /usr/local/bin/
# sudo chmod +x /usr/local/bin/stylua
#
# - name: Run stylua (Lua formatter check)
# run: |
# stylua --check lua/

startup:
name: Test Config Startup
Expand Down
1 change: 1 addition & 0 deletions KEYMAPS.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@
| `<leader>ca` | Normal, Visual | Code action |
| `<leader>cf` | Normal, Visual, Select | Format buffer |
| `<leader>\H` | Normal | Toggle inlay hints |
| `<leader>uv` | Normal | Toggle virtual text diagnostics |

## Treesitter

Expand Down
4 changes: 2 additions & 2 deletions lazy-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"amp.nvim": { "branch": "main", "commit": "3b9ad5ef0328de1b35cc9bfa723a37db5daf9434" },
"blink-ripgrep.nvim": { "branch": "main", "commit": "5686ced9e854b607e3c9345a1b64c76621b1963e" },
"blink.cmp": { "branch": "main", "commit": "b19413d214068f316c78978b08264ed1c41830ec" },
"conform.nvim": { "branch": "master", "commit": "94e6811242a3a2cbf4459863cc4ef4cfe9fa6aaf" },
"conform.nvim": { "branch": "master", "commit": "a7c61e7dd94170f9dd84f5b5546b874f98c7d5bd" },
"flash.nvim": { "branch": "main", "commit": "fcea7ff883235d9024dc41e638f164a450c14ca2" },
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
"grug-far.nvim": { "branch": "main", "commit": "bc589a1ba340a00ae40bf1436401eac5b1454687" },
Expand All @@ -17,7 +17,7 @@
"mini.nvim": { "branch": "main", "commit": "6acb62618e2e7f1bf4f2e96e77a562ec80696f5e" },
"nvim-dap": { "branch": "master", "commit": "5860c7c501eb428d3137ee22c522828d20cca0b3" },
"nvim-dap-ui": { "branch": "master", "commit": "cf91d5e2d07c72903d052f5207511bf7ecdb7122" },
"nvim-lspconfig": { "branch": "master", "commit": "c4f67bf85b01a57e3c130352c0a0e453ab8cd5b9" },
"nvim-lspconfig": { "branch": "master", "commit": "01304066f1390a5478c143a39e9aedaed6a4f209" },
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
"nvim-treesitter": { "branch": "main", "commit": "8cdffc6d334731ce3703b6d870a5a34fd878208a" },
"nvim-treesitter-context": { "branch": "master", "commit": "64dd4cf3f6fd0ab17622c5ce15c91fc539c3f24a" },
Expand Down
16 changes: 16 additions & 0 deletions lua/config/keymaps.lua
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,22 @@ map('x', '>', '>gv')
map('n', '<leader>nl', '<cmd>Lazy<cr>', { desc = '[L]azy' })
-- stylua: ignore end

-- =============================================================================
-- DIAGNOSTICS TOGGLE
-- =============================================================================
-- WHAT: Toggle virtual text diagnostics on/off
-- WHY: Reduces visual clutter when you need focus or enables diagnostics when needed
-- HOW: Uses vim.diagnostic.config to toggle virtual_text on current buffer
-- =============================================================================
map('n', '<leader>uv', function()
local config = vim.diagnostic.config()
local vtext = config.virtual_text
-- Toggle: if enabled, disable; if disabled, enable with default settings
vim.diagnostic.config({ virtual_text = not vtext })
local status = not vtext and 'enabled' or 'disabled'
Snacks.notify.info('Virtual text diagnostics ' .. status)
end, { desc = 'Toggle [V]irtual Text Diagnostics' })
Comment thread
TheOnliestMattastic marked this conversation as resolved.

-- =============================================================================
-- APPLICATION MANAGEMENT
-- =============================================================================
Expand Down
7 changes: 7 additions & 0 deletions lua/plugins/blink-cmp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ return {
completion = {
-- Disable auto-show docs to reduce visual noise (user can view with C-y)
documentation = { auto_show = false, auto_show_delay_ms = 500 },
-- Auto-select and auto-insert first completion match (faster workflow)
list = {
selection = {
preselect = true, -- Automatically select first item
auto_insert = true, -- Automatically insert selected item
},
},
},
sources = {
default = { 'buffer', 'lsp', 'path', 'snippets', 'lazydev', 'ripgrep' },
Expand Down
42 changes: 37 additions & 5 deletions lua/plugins/conform.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
-- REFERENCE: https://github.com/stevearc/conform.nvim
-- RELATED: lua/config/options.lua (formatoptions), lua/plugins/lsp.lua
-- =============================================================================

return {
'stevearc/conform.nvim',
lazy = true,
Expand All @@ -28,10 +27,43 @@ return {
},
opts = {
notify_on_error = true,
-- Per-filetype formatter configuration
formatters_by_ft = {
lua = { 'stylua' }, -- Lua: stylua formatter
markdown = { 'prettier' }, -- Markdown: prettier formatter
},
-- stylua: ignore start
lua = { 'stylua' },

-- Web & Markup
markdown = { 'prettier' },
json = { 'prettier' },
jsonc = { 'prettier' },
yaml = { 'prettier' },
html = { 'prettier' },
css = { 'prettier' },
scss = { 'prettier' },
less = { 'prettier' },

-- JavaScript/TypeScript
javascript = { 'prettier' },
typescript = { 'prettier' },
javascriptreact = { 'prettier' },
typescriptreact = { 'prettier' },

-- Shell
bash = { 'shfmt' },
sh = { 'shfmt' },
zsh = { 'shfmt' },

-- Python
python = { 'black' },

-- Go
go = { 'gofmt' },

-- C/C++
c = { 'clang_format' },
cpp = { 'clang_format' },
Comment thread
TheOnliestMattastic marked this conversation as resolved.

-- Rust
rust = { 'rustfmt' },
}, -- stylua: ignore end
},
}
50 changes: 35 additions & 15 deletions lua/plugins/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -62,21 +62,30 @@ return {
})

vim.api.nvim_create_autocmd('LspDetach', {
group = vim.api.nvim_create_augroup(
'hyperfix-lsp-detach',
{ clear = true }
),
callback = function(event2)
vim.lsp.buf.clear_references()
vim.api.nvim_clear_autocmds({
group = 'hyperfix-lsp-highlight',
buffer = event2.buf,
})
end,
group = vim.api.nvim_create_augroup(
'hyperfix-lsp-detach',
{ clear = true }
),
callback = function(event2)
vim.lsp.buf.clear_references()
vim.api.nvim_clear_autocmds({
group = 'hyperfix-lsp-highlight',
buffer = event2.buf,
})
end,
})
end

-- Enable inlay hints (function parameters, types)
if client_supports_method(
client,
vim.lsp.protocol.Methods.textDocument_inlayHint,
event.buf
) then
vim.lsp.inlay_hint.enable(true, { bufnr = event.buf })
end
end,
})
end
end,
})

-- =======================================================================
-- Diagnostic Config: error display, signs, and inline messages
Expand Down Expand Up @@ -127,12 +136,23 @@ return {
},
},
},
clangd = {
init_options = {
clangdSettings = {
InlayHints = { Enabled = true }, -- Enable parameter/type hints
},
},
},
}

-- Extract server names and add formatters (tools, not LSPs)
local ensure_installed = vim.tbl_keys(servers or {})
vim.list_extend(ensure_installed, {
'stylua', -- Lua formatter (managed by mason-tool-installer)
'stylua', -- Lua formatter
'prettier', -- Web/Markdown formatter
'black', -- Python formatter
'shfmt', -- Shell formatter
'clang-format', -- C/C++ formatter
})
Comment thread
TheOnliestMattastic marked this conversation as resolved.
require('mason-tool-installer').setup({
ensure_installed = ensure_installed, -- Auto-install tools
Expand Down