Skip to content

Thomashighbaugh/nvim-forge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Neovim Forge

My Winchester Mystery Neovim Configuration, using lazy.nvim for plugin management and Lua as its configuration language. My Personal Development Environment (PDE) and the core tool used in cultivating my Personal Knowledge Base (PKB).

Warning This is my personal configuration, subject to experimentation and radical rewrites periodically, rebases or substantially modifications without prior warning and other things that may make this unstable for you to use as it is presented.

With this in mind, feel free to take from it as you please, use pieces of it or the whole thing as a basis for your own, and you are more than welcome to submit pull requests if it so pleases you, that's why its on GitHub |wink|

Installation

To use this configuration, clone or copy it directly into your ~/.config/nvim directory.

# Back up your old configuration if present
mv ~/.config/nim ~/.config/nvim.bak

# Now clone this one
git clone https://github.com/Thomashighbaugh/nvim-forge ~/.config/nvim

And that should be it, if you have the prerequisites installed it should run through the lazy.nvim installation process and handle setting up everything in the process from Treesitter grammars to Mason dependencies, it might just take a few minutes so be patient.

Configuration Structure

This configuration roughly follows that of LazyVim, with some minor changes that are mostly due to personal taste, which while arbitrary is much easier to quickly locate various things when they are arranged in the way one prefers and not an artificially imposed standard. The lion's share of the configuration exists within the lua/ subdirectory as is the convention of Lua-based NeoVim configurations.

Unlike many other highly customized NeoVim configurations, as well as most major configuration frameworks, the configuration is not nested within a subdirectory of the Lua subdirectory named after the author, plugin or configuration, I find no need to brand this configuration in a way that makes using its parts elsewhere highly onerous and introduces a needless source of potential errors for me to deal with instead of working on code like I intend to be.

Below is a representation of the structure of the configuration in tree format

ξ—Ώ . β”œβ”€β”€  Dockerfile β”œβ”€β”€ ξ—Ώ ftplugin β”‚ └──  java.lua β”œβ”€β”€  init.lua β”œβ”€β”€ ξ˜‹ lazy-lock.json β”œβ”€β”€ ξ—Ώ lua β”‚ β”œβ”€β”€  code_action_utils.lua β”‚ β”œβ”€β”€ ξ—Ώ core β”‚ β”‚ β”œβ”€β”€  autocommands.lua β”‚ β”‚ β”œβ”€β”€  keymaps.lua β”‚ β”‚ β”œβ”€β”€  options.lua β”‚ β”‚ β”œβ”€β”€  usercommands.lua β”‚ β”‚ └──  utils.lua β”‚ └── ξ—Ώ plugins β”‚ β”œβ”€β”€  aisync.lua β”‚ β”œβ”€β”€  bufferline.lua β”‚ β”œβ”€β”€  cmp.lua β”‚ β”œβ”€β”€  codesnap.lua β”‚ β”œβ”€β”€  comments.lua β”‚ β”œβ”€β”€  conform.lua β”‚ β”œβ”€β”€ ξ—Ώ dap β”‚ β”‚ └──  debug_adapter.lua β”‚ β”œβ”€β”€  dashboard.lua β”‚ β”œβ”€β”€  devdocs.lua β”‚ β”œβ”€β”€  dressing.lua β”‚ β”œβ”€β”€  flash.lua β”‚ β”œβ”€β”€  focus.lua β”‚ β”œβ”€β”€  git.lua β”‚ β”œβ”€β”€  image_preview.lua β”‚ β”œβ”€β”€  inc_rename.lua β”‚ β”œβ”€β”€  indent-blankline.lua β”‚ β”œβ”€β”€  init.lua β”‚ β”œβ”€β”€ ξ—Ώ lsp β”‚ β”‚ β”œβ”€β”€  aerial.lua β”‚ β”‚ β”œβ”€β”€  glance.lua β”‚ β”‚ β”œβ”€β”€  lazydev.lua β”‚ β”‚ β”œβ”€β”€  lsp-config.lua β”‚ β”‚ β”œβ”€β”€  mason.lua β”‚ β”‚ β”œβ”€β”€  nvim-navic.lua β”‚ β”‚ β”œβ”€β”€  outline.lua β”‚ β”‚ └──  trouble.lua β”‚ β”œβ”€β”€  lualine.lua β”‚ β”œβ”€β”€  luasnip.lua β”‚ β”œβ”€β”€  mini-align.lua β”‚ β”œβ”€β”€  mini-indentscope.lua β”‚ β”œβ”€β”€  neo-tree.lua β”‚ β”œβ”€β”€  noice.lua β”‚ β”œβ”€β”€  nvim-autopairs.lua β”‚ β”œβ”€β”€  nvim-lint.lua β”‚ β”œβ”€β”€  nvim-notify.lua β”‚ β”œβ”€β”€  nvim-surround.lua β”‚ β”œβ”€β”€  nvim-tree.lua β”‚ β”œβ”€β”€  oil.lua β”‚ β”œβ”€β”€  ollama.lua β”‚ β”œβ”€β”€  rainbow-delimiters.lua β”‚ β”œβ”€β”€  rest.lua β”‚ β”œβ”€β”€  snipe.lua β”‚ β”œβ”€β”€  ssr.lua β”‚ β”œβ”€β”€  statuscol.lua β”‚ β”œβ”€β”€  symbols.lua β”‚ β”œβ”€β”€  telescope.lua β”‚ β”œβ”€β”€  toggleterm.lua β”‚ β”œβ”€β”€  treesitter.lua β”‚ β”œβ”€β”€  web_devicons.lua β”‚ β”œβ”€β”€  which-key.lua β”‚ └──  yanky.lua β”œβ”€β”€ σ°‚Ί README.md β†’ .github/README.md β”œβ”€β”€ ξ—Ώ snippets β”‚ β”œβ”€β”€  all.lua β”‚ β”œβ”€β”€ ο…› java.snippets β”‚ β”œβ”€β”€  javascript.lua β”‚ β”œβ”€β”€  lua.lua β”‚ β”œβ”€β”€  markdown.lua β”‚ β”œβ”€β”€  package.json β”‚ β”œβ”€β”€ ξ—Ώ vscode β”‚ β”‚ β”œβ”€β”€ ξ˜‹ c.json β”‚ β”‚ β”œβ”€β”€ ξ˜‹ cpp.json β”‚ β”‚ β”œβ”€β”€ ξ˜‹ css.json β”‚ β”‚ β”œβ”€β”€ ξ—Ώ frameworks β”‚ β”‚ β”‚ β”œβ”€β”€ ξ˜‹ ejs.json β”‚ β”‚ β”‚ β”œβ”€β”€ ξ˜‹ flutter.json β”‚ β”‚ β”‚ β”œβ”€β”€ ξ˜‹ jekyll.json β”‚ β”‚ β”‚ └── ξ—Ώ vue β”‚ β”‚ β”‚ β”œβ”€β”€ ξ˜‹ html.json β”‚ β”‚ β”‚ β”œβ”€β”€ ξ˜‹ javascript.json β”‚ β”‚ β”‚ β”œβ”€β”€ ξ˜‹ pug.json β”‚ β”‚ β”‚ └── ξ˜‹ vue.json β”‚ β”‚ β”œβ”€β”€ ξ˜‹ gdscript.json β”‚ β”‚ β”œβ”€β”€ ξ˜‹ gitcommit.json β”‚ β”‚ β”œβ”€β”€ ξ˜‹ global.json β”‚ β”‚ β”œβ”€β”€ ξ˜‹ glsl.json β”‚ β”‚ β”œβ”€β”€ ξ˜‹ go.json β”‚ β”‚ β”œβ”€β”€ ξ˜‹ haskell.json β”‚ β”‚ β”œβ”€β”€ ξ˜‹ html.json β”‚ β”‚ β”œβ”€β”€ ξ˜‹ java.json β”‚ β”‚ β”œβ”€β”€ ξ—Ώ javascript β”‚ β”‚ β”‚ β”œβ”€β”€ ξ˜‹ javascript.json β”‚ β”‚ β”‚ β”œβ”€β”€ ξ˜‹ react-native-ts.json β”‚ β”‚ β”‚ β”œβ”€β”€ ξ˜‹ react-native.json β”‚ β”‚ β”‚ β”œβ”€β”€ ξ˜‹ react-ts.json β”‚ β”‚ β”‚ β”œβ”€β”€ ξ˜‹ react.json β”‚ β”‚ β”‚ └── ξ˜‹ typescript.json β”‚ β”‚ β”œβ”€β”€ ξ˜‹ kotlin.json β”‚ β”‚ β”œβ”€β”€ ξ˜‹ kubernetes.json β”‚ β”‚ β”œβ”€β”€ ξ—Ώ latex β”‚ β”‚ β”‚ β”œβ”€β”€ ξ˜‹ latex-snippets.json β”‚ β”‚ β”‚ └── ξ˜‹ vscode-latex-snippets.json β”‚ β”‚ β”œβ”€β”€ ξ˜‹ latex.json β”‚ β”‚ β”œβ”€β”€ ξ˜‹ lua.json β”‚ β”‚ β”œβ”€β”€ ξ˜‹ markdown.json β”‚ β”‚ β”œβ”€β”€ ξ˜‹ meson.json β”‚ β”‚ β”œβ”€β”€ ξ˜‹ norg.json β”‚ β”‚ β”œβ”€β”€ ξ˜‹ org.json β”‚ β”‚ β”œβ”€β”€  package-lock.json β”‚ β”‚ β”œβ”€β”€  package.json β”‚ β”‚ β”œβ”€β”€ ξ—Ώ python β”‚ β”‚ β”‚ β”œβ”€β”€ ξ˜‹ base.json β”‚ β”‚ β”‚ β”œβ”€β”€ ξ˜‹ comprehension.json β”‚ β”‚ β”‚ β”œβ”€β”€ ξ˜‹ debug.json β”‚ β”‚ β”‚ β”œβ”€β”€ ξ˜‹ python.json β”‚ β”‚ β”‚ └── ξ˜‹ unittest.json β”‚ β”‚ β”œβ”€β”€ ξ˜‹ rust.json β”‚ β”‚ β”œβ”€β”€ ξ˜‹ scala.json β”‚ β”‚ β”œβ”€β”€ ξ˜‹ shell.json β”‚ β”‚ └── ξ˜‹ sql.json β”‚ └──  yaml.lua └── ξ—Ώ spell β”œβ”€β”€ ο…› en.dict β”œβ”€β”€ ο…› en.utf-8.add └── ο…› en.utf-8.add.spl

Keybindings

Below are the keybind mappings used in this configuration, they are subject to change and are not exhaustive, but they should give you a good idea of how the configuration is set up and how to use it.

General Keybindings

[!] Note:

  • means press both keys at the same time
    
    β†’ means first the key on the left then the key on the right

Basic Navigation and Editing

Keys Mode Description
j/k Normal/Visual Better Up/Down
/ Normal Search
g, Normal Go to the newest change
g; Normal Go to last change
i Normal Better Insert
, β†’ w Normal Save
Alt + Enter Normal List suggested code actions

Text Manipulation

Keys Mode Description
Ctrl + k Normal Move line up
Ctrl + j Normal Move line down
Ctrl + k Visual Move line up visual
Ctrl + j Visual Move line down visual
< Visual Unindent lines in visual selection
> Visual Indent lines in visual selection
p Visual Paste without yanking
p Select(x) Paste without yanking
c Normal/Visual Change without yanking
C Normal Change line without yanking
Space + Up Normal Add blank line below
Space + Down Normal Add blank line below
Ctrl + , Insert Add comma after character
Ctrl + b Insert Add curly with comma {},
i + q Operator/Visual Inner Single Quotes
i + Q Operator/Visual Inner Double Quotes
a + q Operator/Visual Around Single Quotes
a + Q Operator/Visual Around Double Quotes
a + ' Operator/Visual Around Single Quotes
a + " Operator/Visual Around Double Quotes
i + r Operator/Visual Inner Brackets
a + r Operator/Visual Inner Brackets

Buffer Management

Keys Mode Description
, β†’ b β†’ d Normal Delete Buffer
Leader β†’ f β†’ n Normal New File
Shift + Left Normal Buffer Previous
Shift + Right Normal Buffer Next
Space β†’ b β†’ p Normal Pin Buffer
Space β†’ b β†’ k Normal Pick Buffer
Space β†’ b β†’ o Normal Close Other Buffers
Space β†’ b β†’ Left Normal Move Buffer to Left
Space β†’ b β†’ Right Normal Move Buffer to Right
Space β†’ b β†’ 1 Normal Go to Buffer 1
Space β†’ b β†’ 2 Normal Go to Buffer 2
Space β†’ b β†’ 3 Normal Go to Buffer 3
Space β†’ b β†’ 4 Normal Go to Buffer 4
Space β†’ b β†’ 5 Normal Go to Buffer 5
Space β†’ b β†’ 6 Normal Go to Buffer 6
Space β†’ b β†’ 7 Normal Go to Buffer 7
Space β†’ b β†’ 8 Normal Go to Buffer 8
Space β†’ b β†’ 9 Normal Go to Buffer 9

Window Management

Keys Mode Description
Space β†’ \ Normal Split Window Vertically
Space β†’ / Normal Split Window Vertically
Space β†’ h/l/k/j Normal Move split panes Left/Right/Up/Down
Space β†’ m Normal Equalize split panes
Alt + Up Normal Resize pane up
Alt + Down Normal Resize pane down
Alt + Left Normal Resize pane left
Alt + Right Normal Resize pane right

Search and Replace

Keys Mode Description
, β†’ R Normal Search and Replace the word under cursor
, β†’ r Normal Search and replace in visual selection

Selection and Deletion

Keys Mode Description
Control + a Normal Select All
d + D Normal Delete current line without yanking
d + d Normal Yank non-empty lines

Insert Mode

Keys Mode Description
Escape Insert Exit Insert Mode
Control + l Insert Correct Word
Alt + i Insert Jump to Beginn of Line in insert mode
Alt + a Insert Jump to End of Line in insert mode
Ctrl + b Insert Add curly with comma {},

Editor Functionality

Keys Mode Description
Escape Insert/Normal Escape and clear highlighted search
z β†’ . Normal 󰓆 Fix Spelling
z β†’ = Normal Spelling suggestions
Leader β†’ m β†’ m Normal File Changes (Messages)
Leader β†’ c β†’ t Normal Toggle TS Context

Plugin Management (Lazy)

Keys Mode Description
Leader β†’ l β†’ a Normal Open Lazy
Leader β†’ l β†’ c Normal Check Lazy Plugins
Leader β†’ l β†’ s Normal Sync Lazy Plugins

Debugging

Keys Mode Description
Leader β†’ d β†’ B Normal Add Conditional Breakpoint
Leader β†’ d β†’ c Normal Dap Continue
Leader β†’ d β†’ s β†’ i Normal Dap Step Into
Leader β†’ d β†’ s β†’ o Normal Dap Step Over
Leader β†’ d β†’ s β†’ t Normal Dap Step Out
Leader β†’ d β†’ t Normal Dap Terminate
Leader β†’ d β†’ l Normal Dap Show Log
Leader β†’ d β†’ r Normal Dap Toggle Repl

Diff View

Keys Mode Description
Leader β†’ d β†’ v Normal Diffview Toggle

Noice

Keys Mode Description
Space β†’ n β†’ n Normal Noice Messages
Space β†’ n β†’ a Normal Noice All Messages
Space β†’ n β†’ l Normal Noice Last
Space β†’ n β†’ t Normal Noice Telescope
Space β†’ n β†’ e Normal Noice Errors
Space β†’ n β†’ s Normal Noice Notifications

Terminal Bindings

Keys Mode Description
Escape Terminal Exit Terminal Mode
k β†’ j Terminal Exit Terminal Mode
Ctrl + h Terminal Window Left
Ctrl + j Terminal Window Down
Ctrl + k Terminal Window Up
Ctrl + l Terminal Window Right
Ctrl + w Terminal Window

Java Development Tools

Keys Mode Description
Alt + o Normal Organize Imports
c β†’ r β†’ v Normal/Visual Extract Variable
c β†’ r β†’ c Normal/Visual Extract Constant
c β†’ r β†’ m Visual Extract Method
Leader β†’ d β†’ f Normal Test Class
Leader β†’ d β†’ n Normal Test Nearest Method

LuaSnip

Keys Mode Description
Ctrl + i Insert/Select
Ctrl + l Insert/Select
Ctrl + h Insert/Select
Ctrl + Shift + o Insert/Select
Ctrl + Shift + a Insert/Select

Nvim-Toggler

Keys Mode Description
Leader β†’ w Normal/Visual Toggle a Value

Nvim-Tree

Keys Mode Description
Ctrl + t Normal Up Change Directory
Ctrl + d Normal Change Root Directory
? Normal Help

LSP (Language Server Protocol)

Keys Mode Description
Space β†’ d Normal Open Diagnostic Window
Space β†’ Left Normal
Space β†’ Right Normal
Space β†’ q Normal Send Diagnostic to Locallist
K Normal Hover
g β†’ r β†’ a Normal/Visual LSP Code Action
Alt + Enter Normal/Visual LSP Code Action
g β†’ r β†’ n Normal LSP Rename
g β†’ r β†’ r Normal LSP References
g β†’ r β†’ d Normal LSP Go to Definition
g β†’ r β†’ D Normal LSP Go to Declaration
g β†’ r β†’ i Normal LSP Go to Implementation
g β†’ r β†’ f Normal
g β†’ r β†’ k Normal LSP Signature Help
g β†’ r β†’ s Normal LSP Document Symbols
g β†’ r β†’ t Normal LSP Type Definition
g β†’ r β†’ w β†’ a Normal LSP Add Workspace Folder
g β†’ r β†’ w β†’ r Normal LSP Remove Workspace Folder
g β†’ r β†’ w β†’ l Normal List Workplace Folder
Space β†’ i β†’ h Normal Inlay Hints

Treesitter

Keys Mode Description
m Visual/Operator Treesitter Nodes

Inspiration

The following projects were instrumental in the crafting of this environment