Skip to content

My personal Neovim config in Lua πŸš€ | Fast startup with Lazy.nvim | LSP (Pyright, LuaLS, TSServer), Completion (Cmp+LuaSnip), Telescope, Treesitter, NvimTree | Nightfox Theme | Tested on Fedora/Sway/Foot

License

Notifications You must be signed in to change notification settings

bengtfrost/nvim-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

31 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

My Neovim Configuration

Lua Neovim License: MIT

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.

✨ Features

  • πŸš€ Fast Startup: Utilizes folke/lazy.nvim for plugin management and lazy loading.
  • πŸ’» LSP Integration: Out-of-the-box support for Lua, Python, TypeScript/JavaScript via nvim-lspconfig and mason.nvim.
  • πŸ’… Formatting: Consistent code formatting via stevearc/conform.nvim using standard tools (Ruff, Black, Prettier, Stylua, etc.). Format on save enabled.
  • πŸ€– Completion: Smooth completion experience powered by nvim-cmp and LuaSnip.
  • 🌳 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.nvim provides helpful keybinding popups.
  • πŸ““ Jupyter Integration: Interact with Jupyter kernels and .ipynb files directly within Neovim using benlubas/molten-nvim. Supports connecting to kernels, viewing outputs, and executing code line-by-line or by selection from the raw .ipynb JSON 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 pyright LSP.

πŸ“Έ Screenshots

(NvimTree View) NvimTree Example

(NvimTree View with Aider AI) NvimTree Example with Aider

(Telescope FZF View) Telescope Example

πŸ’Ύ Installation

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 pip is 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:
      # 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
      (Note: On systems like Fedora, installing python3-neovim, python3-jupyter-client, python3-nbformat via dnf might achieve the same result for the system Python).
    • For Kernel Environment: Ensure ipykernel and notebook (or jupyterlab) 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
  • (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:

  1. 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
  2. Clone this repository:

    git clone https://github.com/bengtfrost/nvim-config ~/.config/nvim
  3. Start Neovim:

    nvim
    • lazy.nvim will 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 :UpdateRemotePlugins inside Neovim and then restart Neovim.
    • Mason: Mason will attempt to install LSPs and Formatters. If any fail, run :Mason after startup to manage them.

βš™οΈ Configuration Structure

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 by lazy.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).

⌨️ Keybindings

  • 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 (uses conform.nvim).
  • Refer to the Keymap Summary for a detailed list of all mappings. (Remember to resolve the <leader>fd overlap between Conform and Telescope Diagnostics if desired)

🀝 Contributing

This is a personal configuration, but suggestions or improvements are welcome via issues or pull requests.

πŸ“œ License

Distributed under the MIT License. See LICENSE for more information.

About

My personal Neovim config in Lua πŸš€ | Fast startup with Lazy.nvim | LSP (Pyright, LuaLS, TSServer), Completion (Cmp+LuaSnip), Telescope, Treesitter, NvimTree | Nightfox Theme | Tested on Fedora/Sway/Foot

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages