Skip to content

pykeras/neovim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Neovim Configuration Guide

If you are updating from previous versions, please make sure to run :Lazy sync and :Mason and update everything.

Update: Sep 8, 2025 🎉

  • New: auto formatting TOML files on save.
  • Fix: diagnostics float will auto close on buffer switch, to copy the diagnostic content use <leader>cd
  • New: bh, bl to move buffer around (h for moving left, l for moving right) also support <n>bh or <n>bl to repeat moving around.

Update: August 28, 2025 🚀

  • The neo-tree will now automatically update the Git and file system state upon focus change.
  • The Venv selector config has been updated to support the latest Git changes.

This is a starter configuration for Neovim, featuring a curated selection of the most useful plugins for Python, Rust and JavaScript development. It's lightweight and highly customizable, suitable for both beginners and advanced users.

main environment

rust coding

A basic set of key mappings is included and located in lua/keymaps.lua. You can review and customize these mappings to align with your personal preferences.

Prerequisites

Before proceeding, ensure you meet the following requirements:

Neovim Version: v0.11.0 - v.11.3
Operating System: Rocky Linux 9.4, PopOS 22.04, Debian 12.9, Android with termux

Dependencies:

Ensure the following dependencies are installed for a seamless experience:

  • Ripgrep (for Telescope):

    sudo dnf install ripgrep
  • Python venv (for Python-based plugins):
    Replace <minor> with your Python minor version:

    sudo dnf install python3.<minor>-venv
  • Clipboard provider (e.g., xclip):

    sudo dnf install xclip
  • Node.js & npm (for LSP support via nvm):
    Install nvm from GitHub.

  • Prettier (for yaml,js,... formatting)

    npm install -g prettier

How to install:

$ cd ~/.config/nvim
$ git clone git@github.com:pykeras/neovim.git .
$ nvim

Useful Commands

  • Check Telescope health:

    :checkhealth telescope
  • Save without formatting:

    :noautocmd write
  • Install formatters, debuggers, etc. (via Mason):

    :Mason

Key Bindings

Leader Key <leader>: The leader key is mapped to the spacebar ().

General

  • Which Key (Help Menu): Press <leader> to see available shortcuts.
  • Copy to clipboard: <leader>y
  • Paste from clipboard: <leader>p
  • Easier switching between splits:
    • Move to the left split: <C-h>
    • Move to the right split: <C-l>
    • Move to the upper split: <C-k>
    • Move to the lower split: <C-j>
  • Toggle relative line numbers: <leader>rl
  • Reload all open files: <leader>re
  • Clear search highlights: Esc
  • Escape insert mode: jj
  • Close all splits except current: <leader>qo

Theme selection

The default theme is set to kanagawa-wave; feel free to change it.

  • Theme switcher menu: tsm
  • Next theme: tn
  • Previous theme: tp

Virtual Environment Selector (Python)

By default if you have .venv in project directory this setup will use that otherwise:

  • Open selector: <leader>vs
  • Select cached venv: <leader>vc

Debugging

For python make sure you run pip install debugpy in the virtualenv detected/selected.

  • Step into: <F2>
  • Step over: <F3>
  • Step out: <F4>
  • Continue/Start debugging: <F5>
  • Toggle breakpoint: <Leader>b
  • Set conditional breakpoint: <F6>
  • Terminate debugger: <F7>
  • Run last debugging session: <F8>

Flash (Navigation)

  • Flash jump (normal/visual/operator): s
  • Flash Treesitter jump (normal/visual/operator): S
  • Remote Flash (operator mode): r
  • Treesitter search (operator/visual mode): R
  • Toggle Flash search (command-line mode): <C-s>

Rustaceanvim

  • Show testable functions: <leader>rdt

Telescope

  • Search files: <leader>ff
  • Live grep files: <leader>fg
  • Show TODOs (Telescope): <leader>tt
  • Show TODOs (loclist): <leader>tl

NeoTree (File Explorer)

  • Open/Close NeoTree: <leader>e
  • Reveal file in NeoTree: <leader>E
  • NeoTree filesystem: <leader>nf
  • Git status NeoTree: <leader>gs

LSP Configuration

  • Hover documentation: K
  • Go to definition: gd
  • Go to definition (vertical split): <leader>gdv
  • Go to definition (horizontal split): <leader>gds
  • Peek definition: <leader>gdp
  • Code actions: <leader>ca
  • Show method signature (Insert mode): <C-k>
  • Copy diagnostic message to clipboard: <leader>cd

None-ls (Formatting)

  • File global formatting: <leader>gf

Bufferline (Tabs)

  • Select buffer: <leader>bs
  • Cycle next buffer: <Tab>
  • Cycle previous buffer: <S-Tab>
  • Move buffer left: 3bh move buffer left 3 times.
  • Move buffer right: 3bl move buffer right 5 times.
  • Close buffer: <leader>bx
  • Close all other buffers: <leader>bxa
  • Jump to buffer based on position number: <leader>num number can be 1 to 9

Commenting

  • Single line comment: ctrl+/
  • Multi-line comment (visual selection): ctrl+/

Git Integration

  • Preview hunk (change): <leader>gp
  • Git blame: <leader>gb
  • Git log (oneline graph, custom): <leader>gl
  • Git difference (file): <leader>gfd

Undo Tree

  • Open/Close undo tree: <leader>u

Session Management (Persisted)

  • Save session: <leader>ss
  • List sessions: <leader>sl
  • Delete session: <leader>sd

CodeSnap

  • Save to clipboard: <leader>cc
  • Save to ~/Pictures: <leader>cs

ToggleTerminal

  • Open/Close terminal: ctrl+\
  • Open terminal below: <leader>th
  • Open floating terminal: <leader>tf
  • Send current line to terminal (run command from docs): <leader>tst

UFO (Folding)

  • Fold all: zR
  • Unfold all: zM
  • Toggle fold under cursor: za

Spelling

  • Display suggestions: z=
  • Add word to dictionary: zg

Noice (Message Management)

  • Dismiss message: <leader>nd
  • List messages: <leader>nl

Tabular (CSV/TSV View)

  • View CSV as table: <leader>csv
  • View TSV as table: <leader>tsv

Optional Features

AI Integration (Avante)

  • Ensure LuaJIT is installed.
  • Rename ~/.config/nvim/lua/plugins/avante to avante.lua for Ollama.

About

Basic Neovim setup with useful plugins for Python, Rust and JavaScript

Topics

Resources

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages