A Neovim plugin that snaps the cursor to column 0 when moving vertically, except for the last line that had horizontal movement.
Designed to be:
- buffer-local
- Kickstart.nvim–friendly
- Lazy.nvim–ready
j/k/gg/Galways move to absolute column 0- Explicit horizontal movement (
h,l,w,$, etc.) updates internal cursor column memory for that line. Only the last line with horizontal movement is stored at a time. - Toggle per buffer with
:SnapColToggle
When reading or scanning code top-to-bottom, I find it more useful for vertical movement to:
- align to the start of the line
- avoid inheriting arbitrary cursor columns
- behave consistently across lines visually
{
'flayshon/snapcol.nvim',
opts = {
filetypes = nil -- auto enables for every filetype
},
}- auto-enables for all normal, local buffers
- Special buffers (help, prompt, etc.) are ignored
- You can toggle it per buffer at any time with
:SnapColToggle
If you only want it for certain languages:
opts = {
filetypes = { 'go', 'lua', 'python', 'rust', 'typescript' },
}With this configuration, other buffers behave normally unless toggled manually.