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
33 changes: 9 additions & 24 deletions KEYMAPS.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,6 @@

## Text Editing

### Undo Break-points (Insert Mode)

| Keymap | Mode | Action |
| ------ | ------ | ---------------------------- |
| `,` | Insert | Comma + undo break-point |
| `.` | Insert | Period + undo break-point |
| `;` | Insert | Semicolon + undo break-point |

### Smart Closing Punctuation Skip (Insert Mode)

| Keymap | Mode | Action |
Expand Down Expand Up @@ -115,9 +107,9 @@

## Flash (Smart Navigation)

| Keymap | Mode | Action |
| ------ | ------------------------ | ------------------------------- |
| `s` | Normal, Visual, Operator | Flash search (jump to location) |
| Keymap | Mode | Action |
| ----------- | ------------------------ | ------------------------------- |
| `<leader>/` | Normal, Visual, Operator | Flash search (jump to location) |

## Grug-far (Search & Replace)

Expand Down Expand Up @@ -147,12 +139,11 @@

### LSP Code Actions & Formatting

| Keymap | Mode | Action |
| ------------ | ---------------------- | ------------------ |
| `<leader>cr` | Normal | Rename symbol |
| `<leader>ca` | Normal, Visual | Code action |
| `<leader>cf` | Normal, Visual, Select | Format buffer |
| `<leader>\H` | Normal | Toggle inlay hints |
| Keymap | Mode | Action |
| ------------ | ---------------------- | ------------------------------- |
| `<leader>cr` | Normal | Rename symbol |
| `<leader>ca` | Normal, Visual | Code action |
| `<leader>cf` | Normal, Visual, Select | Format buffer |
| `<leader>uv` | Normal | Toggle virtual text diagnostics |

## Treesitter
Expand All @@ -166,12 +157,6 @@
| `gvs` | Normal | Expand to scope |
| `gvp` | Normal | Shrink to previous node |

### Treesitter Context

| Keymap | Mode | Action |
| ------ | ------ | ------------------------------- |
| `\t` | Normal | Toggle treesitter context panel |

## Mini.nvim

### Mini.files (File Navigator)
Expand Down Expand Up @@ -251,7 +236,6 @@
| Keymap | Mode | Action |
| ----------------- | ------ | -------------------------------- |
| `<leader><space>` | Normal | Smart find (auto-detect context) |
| `<leader>/` | Normal | Grep search |
| `<leader>:` | Normal | Command history |
| `<leader>.` | Normal | Scratch buffer selector |

Expand Down Expand Up @@ -311,6 +295,7 @@
| `<leader>sc` | Normal | Commands |
| `<leader>sd` | Normal | Diagnostics |
| `<leader>sD` | Normal | Buffer diagnostics |
| `<leader>sg` | Normal | Grep |
| `<leader>sh` | Normal | Search history |
| `<leader>sH` | Normal | Highlights |
| `<leader>si` | Normal | Icons |
Expand Down
13 changes: 1 addition & 12 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,20 @@
█ █ █ █ ██████ ▀██▀ ██▄▄█▀ ██▄▄ ██▄▄██▄ ██▄▄ ██ ▀█▄█▀
█ ▄▄▄▄▄ █ █ ▄▄▄▄▄ █ ██ ██ ██ ██ ██▄▄▄▄ ██ ██ ██ ██ ██ ██
========================================================================== --]]

-- WHAT: HYPERfix.nvim entry point - loads configuration in order
-- WHY: Ensures predictable startup: options, plugins, keymaps
-- HOW: Requires Lua modules in dependency order
-- NOTE: Colorscheme set before lazy.nvim to avoid initial flash
-- REFERENCE: See README.md for quick start and philosophy
-- See KEYMAPS.md for complete keymap reference

-- ============================================================================
-- Load core editor options and settings
-- ----------------------------------------------------------------------------
-- Load core editor options and settings
require("config.options")

-- ============================================================================
-- Colorschemes
-- ----------------------------------------------------------------------------
-- local colorschemes = require("colorschemes")
-- colorschemes.kakariko.setup()

-- Alternative colorscheme generated with mini.hues and mini.colors
vim.cmd.colorscheme("kokiri")

-- ============================================================================
-- Load plugin manager and remaining configurations
-- ----------------------------------------------------------------------------
require("config.lazy")
require("config.keymaps")
require("config.autocmds")
4 changes: 2 additions & 2 deletions lazy-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
"mason-nvim-dap.nvim": { "branch": "main", "commit": "9a10e096703966335bd5c46c8c875d5b0690dade" },
"mason-tool-installer.nvim": { "branch": "main", "commit": "517ef5994ef9d6b738322664d5fdd948f0fdeb46" },
"mason.nvim": { "branch": "main", "commit": "57e5a8addb8c71fb063ee4acda466c7cf6ad2800" },
"mini.nvim": { "branch": "main", "commit": "e7a8e5a0920df1435172d42fb32e474bbb30d021" },
"mini.nvim": { "branch": "main", "commit": "43ec25063430196d36f5fff5758c9101775f3d57" },
"nvim-dap": { "branch": "master", "commit": "818cd8787a77a97703eb1d9090543a374f79a9ac" },
"nvim-dap-ui": { "branch": "master", "commit": "cf91d5e2d07c72903d052f5207511bf7ecdb7122" },
"nvim-lint": { "branch": "master", "commit": "1f19dacd945a7b1a57f29f32b2d7168384df3d36" },
"nvim-lspconfig": { "branch": "master", "commit": "d696e36d5792daf828f8c8e8d4b9aa90c1a10c2a" },
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
"nvim-treesitter": { "branch": "main", "commit": "36fcb4a4238928f0b627e1ab84ade0acc1facc2c" },
"nvim-treesitter": { "branch": "main", "commit": "7efc1b58a8061d29786860006c7257c90a5196dc" },
"nvim-treesitter-context": { "branch": "master", "commit": "64dd4cf3f6fd0ab17622c5ce15c91fc539c3f24a" },
"nvim-treesitter-textobjects": { "branch": "main", "commit": "ecd03f5811eb5c66d2fa420b79121b866feecd82" },
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
Expand Down
51 changes: 32 additions & 19 deletions lua/config/autocmds.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-- =============================================================================
-- AUTOCOMMANDS
-- =============================================================================
-- -----------------------------------------------------------------------------
-- WHAT: Autocommands automatically trigger actions in response to events
-- (e.g., when you open a file, save it, switch focus, resize window)
--
Expand All @@ -17,22 +17,27 @@
-- - callback: function to execute when event fires
--
-- REFERENCE: https://neovim.io/doc/user/autocmd.html
-- =============================================================================
-- -----------------------------------------------------------------------------

local function augroup(name)
return vim.api.nvim_create_augroup("hyperfix_" .. name, { clear = true })
end

-- =============================================================================
-- Checktime: Reload File on External Changes
-- =============================================================================
-- -----------------------------------------------------------------------------
-- WHAT: Detects when a file changes on disk and reloads it in your buffer
-- WHY: Keeps your buffer in sync if another process modifies the file
-- (prevents "file changed" conflicts)
-- HOW: Triggers on FocusGained (window refocuses), TermClose, TermLeave
-- and runs :checktime to reload if needed
-- =============================================================================
vim.api.nvim_create_autocmd({ "FocusGained", "TermClose", "TermLeave" }, {
-- -----------------------------------------------------------------------------

vim.api.nvim_create_autocmd({
"FocusGained",
"TermClose",
"TermLeave",
}, {
group = augroup("checktime"),
callback = function()
if vim.o.buftype ~= "nofile" then vim.cmd("checktime") end
Expand All @@ -41,23 +46,25 @@ vim.api.nvim_create_autocmd({ "FocusGained", "TermClose", "TermLeave" }, {

-- =============================================================================
-- Highlight on Yank: Visual Feedback When Copying
-- =============================================================================
-- -----------------------------------------------------------------------------
-- WHAT: Briefly highlights text you just yanked (copied)
-- WHY: Provides visual feedback so you know the selection worked
-- HOW: Triggers on TextYankPost and calls vim's built-in highlight.on_yank()
-- =============================================================================
-- -----------------------------------------------------------------------------

vim.api.nvim_create_autocmd("TextYankPost", {
group = augroup("highlight_yank"),
callback = function() (vim.hl or vim.highlight).on_yank() end,
})

-- =============================================================================
-- Resize Splits: Auto-Balance Window Layout
-- =============================================================================
-- -----------------------------------------------------------------------------
-- WHAT: Automatically resizes splits when the Neovim window is resized
-- WHY: Keeps your window layout proportional and balanced after resizing
-- HOW: Triggers on VimResized and runs wincmd = (equal width/height)
-- =============================================================================
-- -----------------------------------------------------------------------------

vim.api.nvim_create_autocmd({ "VimResized" }, {
group = augroup("resize_splits"),
callback = function()
Expand All @@ -69,13 +76,14 @@ vim.api.nvim_create_autocmd({ "VimResized" }, {

-- =============================================================================
-- Last Location: Jump to Where You Left Off
-- =============================================================================
-- -----------------------------------------------------------------------------
-- WHAT: Reopens a file at the cursor position where you last closed it
-- WHY: Speeds up workflow by skipping manual navigation back to where
-- you were working
-- HOW: Triggers on BufReadPost, restores the " mark (last position)
-- if it's valid (excluding git commits and other special files)
-- =============================================================================
-- -----------------------------------------------------------------------------

vim.api.nvim_create_autocmd("BufReadPost", {
group = augroup("last_loc"),
callback = function(event)
Expand All @@ -98,14 +106,15 @@ vim.api.nvim_create_autocmd("BufReadPost", {

-- =============================================================================
-- Close With 'q': Quick Exit for Help/Info/Output Buffers
-- =============================================================================
-- -----------------------------------------------------------------------------
-- WHAT: Maps 'q' key to close help, info panels, and output windows
-- WHY: Provides a consistent, intuitive way to exit read-only buffers
-- (easier than remembering :close or :quit)
-- HOW: Triggers on FileType for specific filetypes (help, lspinfo, etc.)
-- and maps 'q' to close + delete the buffer
-- NOTE: Marks these buffers as unlisted so they don't clutter buffer list
-- =============================================================================
-- -----------------------------------------------------------------------------

vim.api.nvim_create_autocmd("FileType", {
group = augroup("close_with_q"),
pattern = {
Expand Down Expand Up @@ -142,11 +151,12 @@ vim.api.nvim_create_autocmd("FileType", {

-- =============================================================================
-- Man Unlisted: Hide Man Pages from Buffer List
-- =============================================================================
-- -----------------------------------------------------------------------------
-- WHAT: Hides man page buffers from the buffer list
-- WHY: Keeps your buffer list clean when viewing man pages inline
-- HOW: Triggers on FileType "man" and sets buflisted = false
-- =============================================================================
-- -----------------------------------------------------------------------------

vim.api.nvim_create_autocmd("FileType", {
group = augroup("man_unlisted"),
pattern = { "man" },
Expand All @@ -156,6 +166,7 @@ vim.api.nvim_create_autocmd("FileType", {
-- =============================================================================
-- Disable colorcolumn when wrap is on
-- ----------------------------------------------------------------------------

vim.api.nvim_create_autocmd("OptionSet", {
group = augroup("wrap_colorcolumn"),
pattern = "wrap",
Expand All @@ -170,12 +181,13 @@ vim.api.nvim_create_autocmd("OptionSet", {

-- =============================================================================
-- JSON Conceal: Show All JSON Content
-- =============================================================================
-- -----------------------------------------------------------------------------
-- WHAT: Disables concealing for JSON files so nothing is hidden
-- WHY: JSON files should always show all content (no hidden characters)
-- Default conceallevel would hide quotes/brackets
-- HOW: Triggers on FileType for json/jsonc/json5 and sets conceallevel = 0
-- =============================================================================
-- -----------------------------------------------------------------------------

vim.api.nvim_create_autocmd({ "FileType" }, {
group = augroup("json_conceal"),
pattern = { "json", "jsonc", "json5" },
Expand All @@ -184,13 +196,14 @@ vim.api.nvim_create_autocmd({ "FileType" }, {

-- =============================================================================
-- Auto Create Directory: Create Parent Dirs on Save
-- =============================================================================
-- -----------------------------------------------------------------------------
-- WHAT: Automatically creates parent directories when saving a file
-- WHY: Prevents "parent directory doesn't exist" errors when saving
-- to a path with missing intermediate directories
-- HOW: Triggers on BufWritePre and creates directory structure with mkdir
-- NOTE: Skips remote files (ssh://, http://, etc.)
-- =============================================================================
-- -----------------------------------------------------------------------------

vim.api.nvim_create_autocmd({ "BufWritePre" }, {
group = augroup("auto_create_dir"),
callback = function(event)
Expand Down
Loading