Skip to content

JKleinne/nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Neovim License

My personal Neovim configuration setup for DevOps & Coding

Table of Contents

Features

  • Easily Extendable and Configurable: Modular and simple directory structure
  • Intelligent Autocompletion: Powered by nvim-cmp
  • Git Integration: Visualize git changes with gitsigns and TUI with lazygit
  • Language Support: LSP configuration with mason and nvim-lspconfig
  • File Management: Neo-tree as the file explorer and window-picker for easier navigation
  • Syntax Highlighting: Treesitter integration for better syntax awareness
  • Additional Utilities: Autopairs, indent guides, and more

Installation

Prerequisites

  • Neovim (version 0.10 or higher)
    • nvim-install.sh installs the latest Neovim version
  • Git

Steps

  1. Clone the Repository

    git clone https://github.com/jkleinne/nvim
  2. Run the installation script

    cd nvim
    . nvim-install.sh (source nvim-install.sh)
  3. Setup Language Servers

    Depending on the languages you use, you might need to install specific language servers. Refer to the LSP Installation Guide and Mason for more details

Requirements

Run :checkhealth to see what is missing if you get any errors/warnings when opening neovim

Usage

After installation, simply open Neovim:

nvim

Plugins

Here is a list of some of the key plugins included in this configuration:

For a complete list, refer to the lua/plugins folder in the repository.

Configuration

The configuration files are organized as follows:

~/.config/nvim/
├── lua/                   # Lua configuration directory
│   ├── plugins/           # Individual plugin configurations
│   │   ├── alpha.lua
│   │   ├── autopairs.lua
│   │   ├── bufferline.lua
│   │   ├── ... (additional plugins)
│   ├── mappings.lua        # Key mappings and shortcuts
│   ├── settings.lua        # General settings and options
├── init.lua                # Main entry point for the Neovim configuration
├── lazy-lock.json          # Lock file for lazy.nvim (plugin management state)
├── nvim-install.sh         # Installation script for setting up Neovim
└── ... (etc)

Example: settings.lua

-- General Settings
vim.opt.number = true
vim.opt.expandtab = true
vim.opt.smartindent = true
vim.opt.tabstop = 2
vim.opt.shiftwidth = 2
vim.opt.termguicolors = true

Example: mappings.lua

-- Keybindings for Telescope fuzzy finder
map('n', '<leader>tf', '<cmd>Telescope find_files cwd=' .. initial_cwd .. '<cr>', default_opts)
map('n', '<leader>tg', '<cmd>Telescope live_grep  cwd=' .. initial_cwd .. '<cr>', default_opts)
map('n', '<leader>tb', '<cmd>Telescope buffers<cr>', default_opts)
map('n', '<leader>th', '<cmd>Telescope help_tags<cr>', default_opts)
map('n', '<leader>ts', '<cmd>Telescope luasnip<cr>', default_opts)

-- Neotree keybindings
map('n', '<C-e>', ':Neotree toggle reveal=true reveal_force_cwd=true<CR>', default_opts)

-- Bufferline mappings
map('n', '<TAB>', ':BufferLineCycleNext<CR>', default_opts)
map('n', '<S-TAB>', ':BufferLineCyclePrev<CR>', default_opts)

-- Scope mappings / tab management
map('n', '<C-w>t', ':tabnew<CR>', default_opts)

-- Terminal splits mappings
map('n', '<leader>h', ':belowright 20split | terminal<CR>', default_opts)
map('n', '<leader>v', ':vsplit | wincmd l | terminal<CR>', default_opts)

Customization

  • Themes: Change the colorscheme by modifying the colorscheme.lua file
  • Keybindings: Update or add new keybindings in the mappings.lua file
  • Plugins: Add or remove plugins in the lua/plugins/ folder to install with lazy.nvim
  • Language Servers: Configure additional language servers in the lsp.lua file or install with :Mason

License

This project is licensed under the MIT License