Skip to content

Commit

Permalink
Neovim: updated comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Bryce Kellogg committed Jan 28, 2025
1 parent 85386a0 commit 71322ab
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions private_dot_config/nvim/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -189,16 +189,14 @@ end
vim.keymap.set({'n'}, '<C-Del>', killWindow)


-- Helper function for a smarter <Home> key
--
-- This function compares the current cursor column
-- with the column of the first non-whitespace text.
-- If the cursor is to the right of the first non-
-- whitespace text, <Home> moves the cursor to the
-- location of the first non-whitespace text. If the
-- cursor is on or to the left of the first non-
-- whitespace text, <Home> moves the cursot to the
-- start of the line.
-- Map <Home> key to a function that provides a "smart home" implementation.
--
-- This function compares the current cursor column with the column of the first
-- non-whitespace text. If the cursor is to the right of the first non-whitespace
-- text, <Home> moves the cursor to the location of the first non-whitespace text.
-- If the cursor is on or to the left of the first non-whitespace text, <Home>
-- moves the cursot to the start of the line. If the cursor is already on the
-- start of the line, it will be moved to the first non-whitespace text.
vim.keymap.set({'n', 'i', 'v'}, '<Home>',
function()
local srcRow, srcCol = (table.unpack or unpack)(vim.api.nvim_win_get_cursor(0))
Expand Down

0 comments on commit 71322ab

Please sign in to comment.