Skip to content

Neovim configuration for C/C++ development written in Lua

Notifications You must be signed in to change notification settings

LeonWandruschka/nvim-lua-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Neovim Configuration in Lua

This guide provides the steps to install and configure Neovim using Lua, enhancing your development environment with efficient plugins and keybindings.

Installation

Clone the Neovim configuration repository to your .config/nvim directory:

git clone https://github.com/LeonWandruschka/nvim-lua-config.git ~/.config/nvim

Prerequisites

Ensure the following dependencies are installed on your system:

  • Vim: Required for backward compatibility with Vimscript configurations.
  • Neovim: Version 0.7.5 or higher.
  • Exuberant Ctags: Needed for tag generation in various plugins.
  • Jetbrains Nerdfont can be installed here: Nerdfont.com
  • ccls: Required for C/C++ language server support.

Featured Plugins

This configuration includes a variety of plugins to enhance functionality:

  • alpha-nvim: A customizable dashboard for Neovim
  • autopairs: Automatically pairs brackets and quotes.
  • colorscheme: Enables custom color schemes for the editor.
  • completion: Provides code completion features.
  • lazygit: Integrates the lazygit terminal tool.
  • lsp-config: Configures the Language Server Protocol for languages like Lua, C/C++, CMake, and Markdown.
  • lualine: A status line plugin for Neovim.
  • neogen: For doxygen comments.
  • none-ls: A lightweight LSP alternative.
  • nvim-tree: A file explorer plugin.
  • treesitter: Improves syntax highlighting and parsing.
  • telescope: Offers fuzzy file finding, picking, previewing, and more.
  • tagbar: Displays tags in a sidebar for easy navigation.
  • todo-comments: Highlights TODO, FIXME, and other annotations within code.

Keybindings

Customize your workflow with these keybindings:

  • Leader Key: , (Customizable in lua/core/keybindings.lua)
  • Hover for Function Info: I (Normal mode)
  • Go to Definition: <leader>gd (Normal mode)
  • Code Action: <leader>ca (Normal and Visual mode)
  • Format Code: <leader>cf (Normal mode)
  • Lazygit: <leader>lg (Normal mode)
  • Doxygen Comments: <leader>nd (Normal mode)
  • Code Formatting: <leader>cf (Normal mode)
  • Toggle NvimTree: <C-b> (Normal, Insert, and Visual mode)
  • Toggle Tagbar: <leader>tb (Normal mode)
  • Close Tagbar: <leader>tc (Normal mode)
  • Search Files: <C-p> (Normal mode)
  • Search Text in Files: <leader>g (Normal mode)
  • Move in Insert Mode: <C-h>, <C-j>, <C-k>, <C-l> (Insert mode)

Directory Structure

Understand the filetree for easier customization:

.
├── Dockerfile
├── README.md
├── init.lua
└── lua
    ├── core
    │   ├── colorscheme.lua
    │   ├── commands.lua
    │   ├── keymaps.lua
    │   └── options.lua
    └── plugins
        ├── alpha-nvim.lua
        ├── autopairs.lua
        ├── colorscheme.lua
        ├── completion.lua
        ├── lazygit.lua
        ├── lsp-config.lua
        ├── lualine.lua
        ├── neogen.lua
        ├── none-ls.lua
        ├── nvimtree.lua
        ├── tagbar.lua
        ├── telescope.lua
        ├── todo_comments.lua
        └── treesitter.lua

Try it with Docker

clone the repository and run the following command:

docker build -t neovim-config-test .

Now that the dockercontainer is built, you can run the following command to start the container:

docker run --rm -it neovim-config-test

To remove the image afterwards, run the following command:

docker rmi neovim-config-test

About

Neovim configuration for C/C++ development written in Lua

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published