Skip to content

muhbrohim/nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Neovim Config

Note: This repository is a published snapshot of my personal Neovim config. Day-to-day editing happens in a private dotfiles repo; this public copy may be updated occasionally but is not actively synced. The local slicer.nvim plugin will be a dead reference unless you also have a ~/personal/slicer/ tree of your own.

Barebones, hand-rolled Neovim setup. No distribution layer — lazy.nvim directly. Every file is small and does one thing.

Layout

nvim/
├── init.lua                  # Bootstrap: leaders + require config modules
├── lua/
│   ├── config/
│   │   ├── options.lua       # vim.opt.*
│   │   ├── filetypes.lua     # vim.filetype.add (COBOL extensions)
│   │   ├── autocmds.lua      # autocmds (COBOL ft, yank highlight, neo-tree, trim ws)
│   │   ├── commands.lua      # all :User commands (COBOL helpers, SQL, JSON, etc.)
│   │   ├── keymaps.lua       # global keymaps
│   │   └── lazy.lua          # lazy.nvim bootstrap
│   └── plugins/
│       ├── colorscheme.lua   # tokyonight (default) + catppuccin (toggle via <leader>ui)
│       ├── treesitter.lua    # nvim-treesitter + parsers
│       ├── telescope.lua     # fuzzy finder
│       ├── neotree.lua       # file explorer
│       ├── gitsigns.lua      # git gutter + hunk actions
│       ├── statusline.lua    # lualine
│       ├── which-key.lua     # keymap hints
│       ├── autopairs.lua     # nvim-autopairs
│       ├── lsp.lua           # mason + mason-lspconfig + nvim-lspconfig
│       ├── completion.lua    # blink.cmp + LuaSnip
│       ├── conform.lua       # formatters + format-on-save
│       ├── codediff.lua      # esmuellert/codediff.nvim
│       ├── venn.lua          # ASCII box drawing
│       └── slicer.lua        # local plugin (personal/slicer/nvim)
└── README.md

Leaders

  • <leader> = Space
  • <localleader> = ,

Plugins

Plugin Purpose
folke/lazy.nvim Plugin manager
catppuccin/nvim Colorscheme (toggle via ui)
folke/tokyonight.nvim Colorscheme (default, night)
nvim-treesitter Syntax + indent
nvim-treesitter-textobjects Textobjects + function/class movement
nvim-telescope/telescope.nvim Fuzzy finder
nvim-neo-tree/neo-tree.nvim File explorer
lewis6991/gitsigns.nvim Git gutter + actions
nvim-lualine/lualine.nvim Statusline
folke/which-key.nvim Keymap hints
windwp/nvim-autopairs Auto pairs
mason.nvim+mason-lspconfig LSP installer
neovim/nvim-lspconfig LSP client configs
saghen/blink.cmp + LuaSnip Completion + snippets
stevearc/conform.nvim Formatter (format-on-save)
tree-sitter-cobol (via treesitter) COBOL syntax + folding
esmuellert/codediff.nvim VSCode-style diff view
jbyuki/venn.nvim ASCII box drawing
slicer.nvim (local) Personal slicer tool

LSP / Formatters (installed via :Mason)

LSPs: lua_ls, basedpyright, ruff, jsonls, yamlls, bashls, marksman

Formatters: stylua, ruff_format, prettier, shfmt, sqlfluff

Format-on-save is enabled for all configured filetypes except cobol (COBOL has rigid column layouts you wouldn't want a formatter to touch).

User Commands

Buffer

Command Description
:All Select entire buffer
:Space Replace &nbsp; with literal spaces
:RmMark Remove ``` and ```plaintext lines

Diff

Command Description
:Diff <file1> <file2> Open VSCode-style diff view between two files

Inside the diff view: q quit, <leader>b toggle file explorer, ]c/[c next/prev hunk, ]f/[f next/prev file. In the explorer: <CR> select, K hover, R refresh.

SQL helpers

Command Description
:Quote Wrap each line in single quotes with trailing comma
:In Wrap lines as a SQL IN (...) clause

JSON transforms

Command Description
:Vinsim Convert JSON digit keys to key=value
:Sim Convert "field": {...} block keys to key=value

IBM i / COBOL spool cleanup

Command Description
:Clean Blank cols 1-6, cut after col 72
:Format Strip AS400 CBL/CBLLE/DDS compile headers
:CLP Strip AS400 CLP compile headers
:Trim Trim every line to 72 characters
:Seq Add 1212NN sequence prefix every 18 lines

Keymaps

Global

Keys Mode Action
<leader>? n Which-key: buffer keymaps
]b / [b n Next / previous buffer

Treesitter

Keys Mode Action
<C-Space> n / x Start / expand incremental selection (node)
<BS> x Shrink selection
af / if o / x Around / inside function (COBOL: paragraph)
ac / ic o / x Around / inside class (COBOL: section / division)
]m / [m n Next / previous function start
]M / [M n Next / previous function end
]] / [[ n Next / previous class start
][ / [] n Next / previous class end

Find — <leader>f*

Keys Action
<leader>ff Files
<leader>fg Live grep
<leader>fb Buffers
<leader>fh Help tags
<leader>fr Recent files
<leader>fk Keymaps
<leader>fc Commands
<leader>fd Diagnostics
<leader>fs Document symbols
<leader>fp Registers (clipboard history)

Buffer — <leader>b*

Keys Action
<leader>bd Close buffer (Telescope picker; <CR> deletes)

Explorer

Keys Action
<leader>e Toggle Neo-tree
<leader>o Focus Neo-tree

Inside Neo-tree: <Right> expand, <Left> collapse, <CR> open.

Window — <leader>w*

Keys Mode Action
<leader>wh n Move to left pane
<leader>wl n Move to right pane
<leader>wH n Decrease pane width
<leader>wL n Increase pane width
<leader>w= n Equal pane size
<leader>ws v Replace selection with spaces

View — <leader>v*

Keys Action
<leader>vc Toggle cursor column
<leader>vv Toggle Venn (ASCII box drawing)

Inside Venn mode: H/J/K/L draw box edges; visual f draws box around selection.

UI — <leader>u*

Keys Action
<leader>ui Toggle colorscheme: tokyonight-night ↔ catppuccin

Date / Time

Keys Mode Action
<leader>d n Insert date YYYY-MM-DD
<leader>t n Insert time HH:MM:SS
<C-d> i Insert date YYYY-MM-DD
<C-t> i Insert time HH:MM:SS
<C-s> i Insert daily schedule template

Git — <leader>g* (buffer-local, when gitsigns attaches)

Keys Action
]c / [c Next / previous hunk
<leader>gp Preview hunk
<leader>gs Stage hunk
<leader>gr Reset hunk
<leader>gS Stage buffer
<leader>gR Reset buffer
<leader>gb Blame line (full)
<leader>gd Diff this
ih Hunk text object (operator/visual)

LSP — <leader>l* and g* (buffer-local, when LSP attaches)

Keys Action
gd Go to definition
gD Go to declaration
gr References
gi Implementation
gy Type definition
K Hover
<C-h> (i) Signature help
<leader>la Code action
<leader>lr Rename
<leader>lf Format buffer (also via conform)
<leader>ld Show line diagnostics
[d / ]d Previous / next diagnostic

Slicer — <leader>s* (modes n + x)

Keys Action
<leader>ss Slice (table)
<leader>sb Slice (table + offsets)
<leader>sj Slice (JSON)
<leader>sr Slice (raw)
<leader>sS Open spec under cursor

COBOL — <leader>c* (visual mode)

Listing cleanup:

Keys Action
<leader>cc Strip spool nums + trailing seq
<leader>cm Strip spool + add LHB001 prefix
<leader>cC Clean field line
<leader>c_ Replace - with _
<leader>c- Replace _ with -

Cols 1-6 (sequence area):

Keys Replaces cols 1-6 with
<leader>cd (delete cols)
<leader>ci blanks (insert at start)
<leader>cn 000001
<leader>cl LHB001
<leader>cb blanks
<leader>co IBR00X
<leader>ch BRH00X

Filetypes

COBOL is detected for extensions: cob, cbl, cpy, pco, sqb, plus uppercase COB, CBL, CPY, CLP. On entering a COBOL buffer: colorcolumn=7,72, tabstop=4, shiftwidth=4, expandtab, treesitter-based folding (foldmethod=expr, starts unfolded — zM to fold all), and cols 1-6 (sequence area) dimmed with Comment highlight.

Migration Notes

This config replaced a previous AstroNvim v5 setup. Differences:

  • No distribution layer (AstroCore/AstroLSP/AstroUI are gone).
  • Visual <leader>c renamed to <leader>cC (freed the COBOL group prefix).
  • <leader>cs removed (was a duplicate of <leader>cb).
  • <leader>bd is now a Telescope picker (replaces heirline buffer picker).
  • none-ls removed; conform.nvim handles all formatting.
  • Jorenar/COBOL.vim removed; COBOL syntax + folding now handled by nvim-treesitter with the community yutaro-sakamoto/tree-sitter-cobol parser.

The old config is preserved at:

  • Filesystem: winfiles/nvim.astro-backup/
  • Git: branch backup/pre-rebuild-astronvim, tag pre-nvim-rebuild-2026-05-20
  • Plugin data: %LOCALAPPDATA%/nvim-data.astro-backup/

First-time setup

After cloning fresh:

nvim
:Lazy sync
:Mason
:checkhealth

Mason will install all LSPs and formatters listed above.

About

Personal neovim config

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages