Skip to content

drone076/tinynvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

20 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Neovim 0.12+ Config (by drone)

A minimal, single-file init.lua setup for Neovim 0.12+, leveraging native package management (vim.pack) and a curated suite of modern plugins.

Neovim License


πŸ“‹ Requirements

  • Neovim 0.12 or newer (required for vim.pack API)
  • git installed and available in your PATH
  • Nerd Font β€” for icons in lualine, oil.nvim, telescope
  • ripgrep (rg) β€” for telescope live_grep functionality
  • Node.js β€” for installing formatters (prettier, eslint) via Mason

✨ Configuration Highlights

πŸ—‚ Architecture

Feature Description
Native vim.pack No external plugin managers (lazy/packer). Plugins registered via vim.pack.add() and auto-loaded
Single-file setup Entire config lives in init.lua β€” easy to copy, version, and port
Deferred initialization Heavy plugins (LSP, UI) initialize on VimEnter event for faster startup
Safe loading pcall() guards for optional plugins (e.g., conform.nvim)
TypeScript/JS-first Priority support for TS/JS/React via treesitter, LSP, and Prettier

βš™οΈ Behavior & Interface

-- Leader key: space
-- Arrow keys disabled in normal mode (encourages hjkl navigation)
-- relative number + cursorline for better navigation
-- Auto-write on focus loss (autowrite)
-- Color column at 80 characters
-- Tabs = 2 spaces, always expanded to spaces
-- True color support in terminal (termguicolors)

🎨 Visual Enhancements

  • Gruvbox theme with transparent background (transparent_mode = true)
  • Indent-blankline with β”‚ character for visual indentation guides
  • NoNeckPain β€” centers the editor (width: 160), reduces eye strain
  • Lualine β€” minimal statusline showing current file path
  • Treesitter-context β€” displays function/class context in top line

πŸ”Œ Plugins Overview

🎨 UI / Navigation

Plugin Purpose Keybinding / Note
nvim-web-devicons Filetype icons Dependency for lualine/oil
lualine.nvim Statusline Auto-loaded after VimEnter
oil.nvim File explorer (vim-style) - β€” open current directory
no-neck-pain.nvim Editor centering <c-_> β€” toggle
indent-blankline.nvim Indentation guides Auto-configured via ibl
undotree Undo history visualization <leader>u β€” toggle
trouble.nvim Diagnostics/errors list <leader>d β€” show float diagnostic

πŸ”€ Git

Plugin Purpose
vim-fugitive Full Git integration: :G, :Git, :Gdiff, etc.

🧠 Completion & LSP Stack

Plugin Purpose
nvim-cmp Completion engine
cmp-nvim-lsp LSP source for cmp
mason.nvim Package manager for LSP servers & tools
mason-lspconfig.nvim Bridge between Mason and nvim-lspconfig
nvim-lspconfig LSP client configurations
conform.nvim Code formatting (Prettier, stylua)

Supported LSP servers (auto-installed via Mason):

lua_ls, basedpyright, rust_analyzer, emmet_ls, 
eslint, ts_ls, tailwindcss, gopls

Formatting rules (conform.nvim):

-- Auto-format on save + manual via <space>f
javascript, typescript, jsx, tsx β†’ prettier
css, html, json, yaml, markdown    β†’ prettier
lua                               β†’ stylua (if installed)

πŸ” Search & Navigation

Plugin Purpose Keybindings
telescope.nvim + plenary Fuzzy finder for files, text, help <Space><Space> β€” recent files
<Space>ff β€” find files
<Space>fg β€” live grep
<Space>fh β€” help tags
harpoon (v2) Quick bookmarks for 4 files <leader>a β€” add file
<C-e> β€” toggle menu
<C-h/j/k/l> β€” jump to slot 1/2/3/4
<C-S-P>/<C-S-N> β€” prev/next

🌳 Syntax & Parsing

Plugin Purpose
nvim-treesitter Syntax highlighting, auto-install parsers
nvim-treesitter-context Show function/class context in top line

Auto-installed language parsers:

javascript, typescript, python, c, lua, vim, vimdoc, query, go

⌨️ Keybindings Reference

Navigation & Windows

<C-h/j/k/l>  β€” navigate between windows (splits)
<leader>a    β€” add file to Harpoon
<C-e>        β€” open Harpoon menu
<C-h/j/k/l>  β€” jump to Harpoon slot 1/2/3/4
<Space><Space> β€” recent files (Telescope)
<Space>ff    β€” find file
<Space>fg    β€” live grep content
-            β€” open oil.nvim (file explorer)

Editing & Search

<leader>h    β€” clear search highlight
n/N          β€” next/prev search result (centered)
<C-d>/<C-u>  β€” half-page down/up (centered)
<leader>s    β€” substitute word under cursor in file
<leader>x    β€” make file executable (!chmod +x %)
<Space>f     β€” format file (conform + lsp fallback)

LSP & Diagnostics

gd           β€” go to definition
gr           β€” find references
<leader>y    β€” show diagnostic in float window

Buffer & Selection

<C-c> (insert)  β€” exit to normal mode
<leader>p (visual) β€” paste without yanking to register
<leader>d (n/v)  β€” delete to black hole (don't pollute register)
<space>y - copy selection to system clipboard (middle mouse button to paste)
<space>Y - copy whole file to system clipboard (middle mouse button to paste)

Utilities

<leader>u    β€” toggle Undotree
<Space>fh    β€” search help tags

πŸš€ Installation & First Run

  1. Clone or create config:

    mkdir -p ~/.config/nvim
    cp init.lua ~/.config/nvim/
  2. Launch Neovim:

    nvim
  3. Wait for auto-install: Plugins clone to ~/.local/share/nvim/site/pack/ on first run

  4. Install LSP servers & formatters via Mason:

    :MasonInstall lua_ls basedpyright gopls prettier stylua
  5. Install Treesitter parsers:

    :TSInstall javascript typescript lua go python

πŸ’‘ Tip: If plugins fail to load, verify git is in PATH and you have internet access on first launch.


πŸ”§ Customization Guide

Add a new plugin

vim.pack.add({
  { src = "https://github.com/username/plugin.nvim", main = "plugin" },
})

Modify LSP settings

Find the mason-lspconfig block inside VimEnter and extend:

gopls = function()
  vim.lsp.config("gopls", {
    capabilities = capabilities,
    settings = {
      gopls = {
        analyses = { unusedparams = true },
      },
    },
  })
end,

Disable auto-format on save

format_on_save = false,  -- in conform.setup()

Change colorscheme

Replace gruvbox with any other theme:

require("other_theme").setup()
vim.cmd("colorscheme other_theme")

πŸ› Troubleshooting

Issue Solution
Plugins not loading Check git --version and internet connectivity
Missing icons in statusline Install & configure a Nerd Font in your terminal
LSP not working Run :MasonInstall <server> and restart Neovim
Prettier not formatting Ensure Prettier is globally installed: npm install -g prettier
Telescope can't find files Install ripgrep: brew install ripgrep / sudo apt install ripgrep
Slow startup Consider lazy-loading heavy plugins or reducing ensure_installed lists

πŸ“¦ Directory Structure (after first run)

~/.local/share/nvim/site/pack/
β”œβ”€β”€ opt/          β†’ plugins installed via vim.pack
└── start/        β†’ auto-loaded plugins (if any)

~/.cache/nvim/    β†’ treesitter cache, lsp logs
~/.state/nvim/    β†’ session state, harpoon markers

🧭 Philosophy

Minimalism. Control. Speed.

No heavy frameworks β€” only what you need, loaded only when you need it.


🀝 Contributing

Found a bug? Have a suggestion? Feel free to open an issue or PR.


πŸ“„ License

MIT β€” feel free to use, modify, and distribute.


πŸ’‘ Pro tip: Run :checkhealth and :messages for debugging.
This config requires Neovim 0.12+ β€” vim.pack is not available in earlier versions.

About

This is a minimal, single-file init.lua setup for Neovim 0.12+

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages