This repository contains my personal Neovim configuration files, built with Lua and optimized for development workflows on Linux (specifically tested on Fedora with Sway/Foot). It aims for a balance between features, performance, and maintainability using modern Neovim plugins and practices, including configuration for molten-nvim to enable direct interaction with Jupyter kernels and .ipynb files within Neovim.
- π Fast Startup: Utilizes
folke/lazy.nvimfor plugin management and lazy loading. - π» LSP Integration: Out-of-the-box support for Lua, Python, TypeScript/JavaScript via
nvim-lspconfigandmason.nvim. - π
Formatting: Consistent code formatting via
stevearc/conform.nvimusing standard tools (Ruff, Black, Prettier, Stylua, etc.). Format on save enabled. - π€ Completion: Smooth completion experience powered by
nvim-cmpandLuaSnip. - π³ File Explorer: Integrated file tree using
nvim-tree.lua. - π Fuzzy Finding: Powerful fuzzy finding capabilities with
telescope.nvim. - π¨ Colorscheme: Uses
olimorris/onedarkpro.nvim. - π‘ Syntax Highlighting: Enhanced syntax highlighting via
nvim-treesitter. - β¨οΈ Keymap Guide:
folke/which-key.nvimprovides helpful keybinding popups. - π Jupyter Integration: Interact with Jupyter kernels and
.ipynbfiles directly within Neovim usingbenlubas/molten-nvim. Supports connecting to kernels, viewing outputs, and executing code line-by-line or by selection from the raw.ipynbJSON view. - π§ Well-structured: Modular configuration organized into logical directories (
core,plugins). - βοΈ Sensible Defaults: Optimized core Neovim settings for a better editing experience.
- π Python Ready: Configured for Neovim's Python provider and
pyrightLSP.
Prerequisites:
- Neovim v0.11.0+
- Git
- Make (for building
telescope-fzf-native) - A Nerd Font installed and configured in your terminal (for icons)
- Python 3 & Environment Setup:
- For Neovim Host: Ensure
pipis available for the Python Neovim uses (check:checkhealth provider). Install the required host packages:# Example using system python identified by checkhealth: /usr/bin/python3 -m pip install --user pynvim # OR (if using a dedicated venv for nvim host): # /path/to/nvim_host_venv/bin/python -m pip install pynvim
- For Jupyter/Molten Host Features: Install these packages using the same Neovim host Python:
(Note: On systems like Fedora, installing
# Example using system python: sudo /usr/bin/python3 -m pip install jupyter_client nbformat # OR (if using pip install --user): # /usr/bin/python3 -m pip install --user jupyter_client nbformat # OR (if using dedicated venv): # /path/to/nvim_host_venv/bin/python -m pip install jupyter_client nbformat
python3-neovim,python3-jupyter-client,python3-nbformatviadnfmight achieve the same result for the system Python). - For Kernel Environment: Ensure
ipykernelandnotebook(orjupyterlab) are installed in the Python virtual environment(s) you intend to run your Jupyter kernels from.# Example within your project venv: # pip install ipykernel notebook
- For Neovim Host: Ensure
- (Recommended)
ripgrep(for Telescope live grep),fd(for Telescope find files performance). - (Recommended) Node.js/npm (for some LSPs/formatters installed via Mason like
pyright,typescript-language-server,prettierd).
Steps:
-
Backup your existing Neovim configuration (if any):
# Backup config mv ~/.config/nvim ~/.config/nvim.bak # Optional: Backup data/state/cache # mv ~/.local/share/nvim ~/.local/share/nvim.bak # mv ~/.local/state/nvim ~/.local/state/nvim.bak # mv ~/.cache/nvim ~/.cache/nvim.bak
-
Clone this repository:
git clone https://github.com/bengtfrost/nvim-config ~/.config/nvim -
Start Neovim:
nvim
lazy.nvimwill automatically bootstrap itself and install/update all the configured plugins on the first run. Make sure you restart Neovim after the plugin updates are complete.- Molten Requirement: After the first install of
molten-nvim(or after updates), run:UpdateRemotePluginsinside Neovim and then restart Neovim. - Mason: Mason will attempt to install LSPs and Formatters. If any fail, run
:Masonafter startup to manage them.
This configuration follows a modular structure:
init.lua: Main entry point.assets/: Static assets.lua/core/: Base Neovim settings (options.lua,keymaps.lua).lua/plugins/: Plugin configurations managed bylazy.nvim.colorscheme.lua: Theme (onedarkpro.nvim).comment.lua: Commenting (Comment.nvim).completion.lua: Completion (nvim-cmp,LuaSnip).formatter.lua: Formatting (conform.nvim).lsp.lua: LSP setup (nvim-lspconfig,mason.nvim).molten.lua: Jupyter integration (molten-nvim).telescope.lua: Fuzzy finder (telescope.nvim).treesitter.lua: Syntax engine (nvim-treesitter).ui.lua: File explorer (nvim-tree.lua).utils.lua: Utility plugins (which-key.nvim,mini.icons).
- Leader Key:
<Space> - Press
<Space>in Normal Mode and wait briefly to see available mappings via Which-Key. Specific groups exist for Telescope (<leader>f), LSP (<leader>l,<leader>c,<leader>w), Molten (<leader>j), etc. - Primary format command:
<leader>fd(usesconform.nvim). - Refer to the Keymap Summary for a detailed list of all mappings. (Remember to resolve the
<leader>fdoverlap between Conform and Telescope Diagnostics if desired)
This is a personal configuration, but suggestions or improvements are welcome via issues or pull requests.
Distributed under the MIT License. See LICENSE for more information.


