Skip to content

Suryansh-Dey/neovim-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

169 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

image

A dead minimal (by look) but extremely powerful configuration, helping you at work instead of distracting you from work.

Supported languages

Python HTML CSS Tailwindcss TypeScript JavaScript C++ The Rust Programming Language: A language empowering everyone to build reliable and efficient software Rust Java Lua React C

Markdown (with preview), JSON

Features

Core Features

  • Blazingly fast: Use nvim-treesitter new main branch which uses built in treesitter from nvim core. Making it fastest!
  • LSP Support: Full language server protocol support with auto-installation via Mason
  • Treesitter: Advanced syntax highlighting and text objects
  • Auto-session: Automatically saves and restores your editing sessions
  • Flash.nvim: Smart cursor jumping for fast navigation
  • Blink.cmp: Fast and intelligent code completion
  • Neo-tree: Modern file explorer with git integration
  • Telescope: Powerful fuzzy finder for files, buffers, grep, and more
  • Git Integration: Gitsigns for inline git diff indicators and git operations
  • Terminal Integration: Nvterm with toggleable vertical/horizontal/floating terminals
  • Multi-cursor: Efficient multi-cursor editing support
  • Auto-pairs: Automatic bracket/parenthesis pairing
  • Comment Toggle: Easy commenting with context-aware comment strings
  • Tokyo Night Theme: Beautiful color scheme with custom highlights
  • Lualine: Minimal and fast statusline

Code Execution

Built-in executors for quick code execution:

  • Python: python <file>
  • JavaScript/TypeScript: node <file>
  • C++: Compiles with debug flags and runs (supports input.txt/output.txt)
  • C: Compiles and runs
  • Rust: cargo run and cargo test
  • HTML: Live server
  • Java: Direct execution

Use <leader>Xi, <leader>Xv, or <leader>Xh to execute in floating, vertical, or horizontal terminal respectively. Use <leader>xi, <leader>xv, or <leader>xh for test execution (where applicable).

Pre-requisites

  • gcc/g++: For C/C++ compilation
  • npm: For markdown-preview plugin and other Node.js tools
  • cargo: For Rust development (optional, if using Rust)
  • live-server: For HTML live preview (optional, install via npm: npm install -g live-server)

Installation

Run the following command in your terminal

Linux
Clean cache of old setup
rm -rf ~/.local/state/nvim
rm -rf ~/.local/share/nvim
mv ~/.config/nvim ~/.config/nvim-backup
mv ~/.local/share/nvim ~/.local/share/nvim-backup
git clone https://github.com/Suryansh-Dey/neovim-config.git ~/.config/nvim && nvim
Windows In powershell
Clean cache of old setup
rm -Force $HOME\AppData\Local\nvim-data
mv $HOME/AppData/Local/nvim $HOME/AppData/Local/nvim-backup
mv $HOME/AppData/Local/nvim-data $HOME/AppData/Local/nvim-data-backup
git clone https://github.com/Suryansh-Dey/neovim-config.git $HOME/AppData/Local/nvim && nvim

mv commands might raise error if no nvim config file is already there but ignore that. Following command will still do the job!

After installation, run :MasonToolsInstall command in neovim to install LSP and tools.
Then run TSInstallAll to install treesitter parser.

All done!! Refer troubleshooting for help.

Configuration Details

  • Leader Key: <Space> (spacebar)
  • Lazy Loading: Plugins are loaded on-demand for optimal performance
  • Session Management: Auto-session saves your workspace automatically (excludes home, Projects, Downloads directories)
  • Snippets: Custom snippets available for C++, JavaScript, and TypeScript (located in ~/.config/nvim/snippets/ directory)

Tip to find a keybinding

Go to ~/.config/nvim/lua/mappings.lua, and search for the action. You will probably get it's corresponding keybinding here.

  • desc tells what this key binding does so you can search using / to get related keybinding.
  • The second argument of map represents the key stoke needed for the action.

If you need some feature which is not available in config already, just open an GitHub issue! I love configuring neovim and maintaining this repository.

Default keymap changes

  1. The s motion is remapped to flash-jump (smart cursor jumping).
  2. The J key is remapped to Ctrl-e (scroll to down).
  3. The K key is remapped to Ctrl-y (scroll to up).
  4. The H key is remapped to K (shows documentation).
  5. The L key is remapped to J (concatenate lines).
  6. The U key is remapped to Ctrl-r (redo).
  7. Use <leader>m for setting marks (since m is used for surround).
  8. ; always moves right or down and , always moves left or up.

Blink.cmp remaps

  • <Tab> -> opens and cycles through completion menu
  • <CR> -> accepts completion (with smart handling for ambiguous completions)
    To keep completion menu always open go to ./lua/plugins/blink.lua update line 47 to menu = { auto_show = true }

nvim-surround remaps

Since s is used for flash-jump, following remaps were done:

{
normal = "m",        -- Add surround (original: "ys")
normal_cur = "mm",     -- Add surround to current line (original: "yss")
visual = "m",         -- Add surround in visual mode
visual_line = "mm",    -- Add surround in visual line mode
delete = "md",        -- Delete surround (original: "ds")
change = "mc",        -- Change surround (original: "cs")
}

neo-tree remaps

  • s -> triggers flash-jump (since s is used for flash-jump globally)
  • <leader>s -> system open (open file with system default application)

Common Keybindings

Navigation

  • <leader>ff - Find files
  • <leader>fa - Find all files (including hidden)
  • <leader>fw - Live grep (search in files)
  • <leader>fb - Find buffers
  • <leader>fo - Find oldfiles
  • <leader>fz - Fuzzy find in current buffer
  • s - Flash jump (smart cursor jumping)
  • <C-h/j/k/l> - Navigate between windows
  • <Tab> / <S-Tab> - Cycle through buffers

File Management

  • <A-f> - Toggle file tree (neo-tree)
  • <leader>e - Focus file tree
  • <leader>b - New buffer
  • <M-x> - Close buffer
  • <leader>a - Switch to previous buffer
  • <leader>1-9 - Jump to buffer by number

Git

  • ]g / [g - Jump to next/prev git hunk
  • <leader>gs - Stage hunk
  • <leader>gr - Reset hunk
  • <leader>gd - Preview hunk
  • <leader>gb - Blame line
  • <leader>gc - Git commits
  • <leader>gt - Git status

Code Actions

  • <leader>/ - Toggle comment
  • <C-s> - Format and save
  • <leader>ct - Set filetype for LSP
  • gcc - Toggle comment on current line
  • gbc - Toggle block comment

Terminal

  • <A-v> - Toggle vertical terminal
  • <A-h> - Toggle horizontal terminal
  • <A-i> - Toggle floating terminal
  • <leader>v - New vertical terminal
  • <leader>h - New horizontal terminal
  • <C-x> - Exit terminal mode

Other

  • <leader>y - Clipboard history
  • <leader>Y - Clipboard history (system clipboard)
  • <leader>wK - Show all keybindings (which-key)
  • <Esc> - Clear search highlights

Daily usage

Refer to the wiki tab to know how I use it to be blazingly fast!

About

Neovim config with Modern UI and web dev, python, C++, Rust etc. support

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages