Skip to content

nishu-murmu/nvim

Repository files navigation

My Neovim Config

Linux Windows Neovim minimum version

Top languages License

Introduction

This is my custom neovim configuration, for platforms windows and linux.

Installation and Setup

Just clone the repository and run the install_script.sh file

Features

Mappings

Here is the documentation for your Neovim key mappings presented in MDX format:


Neovim Key Mappings

Mode Key(s) Mapping/Command Description
i jk <Esc> Exit insert mode using jk.
i kj <Esc> Exit insert mode using kj.
v J :m '>+1<CR>gv=gv Move selected text down.
v K :m '<-2<CR>gv=gv Move selected text up.
n n nzzzv Center cursor after searching forward.
n N Nzzzv Center cursor after searching backward.
n <C-d> <C-d>zz Half-page down and center cursor.
n <C-u> <C-u>zz Half-page up and center cursor.
n <leader>q :wq!<CR> Save and quit file.
n <leader>w :w<CR> Save current file.
n <leader>we :w<CR>:source %<CR> Save and source current file.
n <Tab> :bnext<CR> Go to next buffer.
n <S-Tab> :bprevious<CR> Go to previous buffer.
n <leader>b :bw<CR> Close current buffer.
n <leader>p "_dP Paste over without yanking.
v < <gv Indent left and reselect text.
v > >gv Indent right and reselect text.
n <C-h> <C-w>h Move to left window.
n <C-j> <C-w>j Move to window below.
n <C-k> <C-w>k Move to window above.
n <C-l> <C-w>l Move to right window.
n <C-b> <C-w>b Move to bottom window.
n <C-t> <C-w>t Move to top window.
n <leader>f <cmd>Telescope find_files<CR> Find files using Telescope.
n <leader>sg <cmd>Telescope live_grep<CR> Live grep with Telescope.
n <leader>b <cmd>Telescope buffers<CR> List buffers with Telescope.
n <leader>th <cmd>Telescope help_tags<CR> Search help tags with Telescope.
n <leader>tl <cmd>Telescope git_files<CR> Find Git files with Telescope.
n <leader>tt :Lexplore<CR> Toggle file explorer.
n <leader>o :lua vim.lsp.buf.format()<CR> Format code using LSP.
n <leader>u :UndotreeToggle<CR> Toggle the undo tree panel.

Notes:

  • <leader> is a placeholder for your leader key, which is usually set to \ or , by default.
  • The mappings for <leader>b are assigned twice:
    • :bw<CR> to close the current buffer.
    • <cmd>Telescope buffers<CR> to list buffers with Telescope.
  • Adjust one of the <leader>b mappings to prevent conflicts.

Descriptions:

  • Exit Insert Mode Quickly: Use jk or kj in insert mode to exit to normal mode without reaching for the <Esc> key.
  • Move Selected Text: In visual mode, J moves the selected block down, and K moves it up, allowing quick text rearrangement.
  • Center Cursor After Search: After using n or N to navigate search results, the cursor will center in the window for better visibility.
  • Smooth Scrolling: <C-d> and <C-u> scroll half a page down or up and center the cursor to maintain context.
  • Window Navigation: Use <C-h>, <C-j>, <C-k>, and <C-l> to navigate between split windows efficiently.
  • Buffer Management: Navigate buffers using <Tab> and <S-Tab>, close buffers with <leader>b, and list buffers with Telescope.
  • Indentation in Visual Mode: < and > indent selected text and keep it selected for further indentation if needed.
  • File Operations: Save files with <leader>w, save and quit with <leader>q, and save and source with <leader>we.
  • Telescope Integrations: Quickly access file searching, live grep, buffers, and help tags using Telescope commands.
  • Formatting and Undo Tree: Format code with <leader>o and toggle the undo tree visualization with <leader>u.

Feel free to adjust the mappings or descriptions according to your specific configuration or preferences.

Screenshots

Lazy.nvim

WindowsTerminal_NVbxy37idi

Telescope

WindowsTerminal_hiSVWQlvc3

Fugitive

WindowsTerminal_O1iyb1JZlZ

Playground

WindowsTerminal_KjWzrIuAAO

Inspirations

  1. ThePrimeagen
  2. jdhao