Neovim चीटशीट

0.10

ज़रूरी Neovim shortcuts और commands जो आप वाकई इस्तेमाल करेंगे

हिन्दी: 2026-03-29

Neovim एक modern, extensible text editor है जो Vim की बुनियाद पर बना है। अगर आपने कभी किसी को बिना mouse छुए code में तेज़ी से उड़ते देखा है और सोचा "मुझे भी यह चाहिए," तो आप सही जगह हैं। Neovim वह सब कुछ रखता है जिसने Vim को legendary बनाया — modal editing, composable commands, text manipulate करने की एक language — और first-class Lua scripting, built-in LSP support, और plugins का ऐसा ecosystem जोड़ता है जो इसे full IDE जैसा feel कराता है।

Learning curve असली है। इससे बचने का कोई तरीका नहीं है। आपका पहला हफ्ता उस editor से धीमा लगेगा जहाँ से आप आए हैं, और शायद आप कम से कम एक बार VS Code वापस जाएंगे। यह normal है। Key insight यह है कि Neovim सैकड़ों shortcuts याद करने के बारे में नहीं है — यह motions और operators की एक छोटी grammar सीखने के बारे में है जो एक साथ combine होती हैं। एक बार d (delete) + w (word) "delete word" के रूप में click हो जाए, तो आप realize करेंगे कि c (change) + w भी काम करता है, और y (yank) + w, और अचानक आप shortcuts याद नहीं कर रहे। आप एक language बोल रहे हैं।

यह cheatsheet वह cover करती है जो आप रोज़ाना इस्तेमाल करेंगे। यह exhaustive नहीं है — official docs असली reference हैं — लेकिन यह आपको productive बनाने और वह muscle memory build करने में मदद करेगी जो Neovim को worth it बनाती है। हमने common LSP और Telescope bindings शामिल की हैं क्योंकि ज़्यादातर modern Neovim setups इन्हें इस्तेमाल करते हैं, लेकिन आपके specific keymaps config के अनुसार भिन्न हो सकते हैं। Doubt हो तो :map दिखाता है कि कहाँ क्या bound है।

Modes

Neovim की power उसकी modal design से आती है। आप हमेशा इनमें से किसी एक mode में होते हैं, और इनके बीच move करना जानना बाकी सब की बुनियाद है।

Switching Modes
Esc
किसी भी mode से Normal mode में वापस आएँ
i
Cursor से पहले insert करें
a
Cursor के बाद insert करें (append)
I
Line की शुरुआत में insert करें
A
Line के अंत में insert करें
o
नीचे नई line खोलें और Insert mode में जाएँ
O
ऊपर नई line खोलें और Insert mode में जाएँ
v
Visual mode में जाएँ (character selection)
V
Visual Line mode में जाएँ (पूरी lines select करें)
Ctrl-v
Visual Block mode में जाएँ (column selection)
:
Command-line mode में जाएँ
R
Replace mode में जाएँ (characters overwrite करें)

अगर आप Esc दबाते रहें और कुछ न हो, तो शायद आप terminal buffer में हैं। Normal mode में वापस आने के लिए Ctrl-\ फिर Ctrl-n try करें।

Navigation और Motions

Motions Neovim की composable grammar का आधा हिस्सा हैं। इन्हें सीखें और आप इन्हें किसी भी operator के साथ combine कर सकते हैं।

Basic Movement
hjkl
बाएँ / नीचे / ऊपर / दाएँ
w
अगले word की शुरुआत पर jump करें
b
पिछले word की शुरुआत पर jump करें
e
Current/अगले word के अंत पर jump करें
WBE
w/b/e जैसा ही लेकिन punctuation skip करें (WORD-wise)
Line Movement
0
Line की शुरुआत पर jump करें
^
पहले non-blank character पर jump करें
$
Line के अंत पर jump करें
f{char}
Current line पर {char} पर आगे jump करें
F{char}
Current line पर {char} पर पीछे jump करें
t{char}
आगे {char} से ठीक पहले jump करें
T{char}
पीछे {char} के ठीक बाद jump करें
;
आखिरी f/F/t/T आगे repeat करें
,
आखिरी f/F/t/T पीछे repeat करें
File और Screen Movement
gg
File की पहली line पर जाएँ
G
File की आखिरी line पर जाएँ
{number}G
Line {number} पर जाएँ
%
Matching bracket पर jump करें
Ctrl-d
आधा page नीचे scroll करें
Ctrl-u
आधा page ऊपर scroll करें
Ctrl-f
पूरा page नीचे scroll करें
Ctrl-b
पूरा page ऊपर scroll करें
zz
Current line screen पर center करें
zt
Current line screen के top पर ले जाएँ
zb
Current line screen के bottom पर ले जाएँ
{
पिछली blank line पर jump करें (paragraph up)
}
अगली blank line पर jump करें (paragraph down)

f और t sleeper hits हैं। w पाँच बार press करने के बजाय, अगले parenthesis पर सीधे jump करने के लिए f( try करें। एक बार यह click हो जाए, तो सोचेंगे इसके बिना कैसे काम करते थे।

Editing Operators

Operators motions के साथ combine होकर commands बनाते हैं। यही असली superpower है: कुछ operators और कुछ motions सीखें, और आप दर्जनों चीज़ें कर सकते हैं।

Core Operators
d{motion}
Motion द्वारा covered text delete (cut) करें
c{motion}
Change — text delete करें और Insert mode में जाएँ
y{motion}
Motion द्वारा covered text yank (copy) करें
>{motion}
दाएँ indent करें
<{motion}
बाएँ indent करें
={motion}
Auto-indent / reformat करें
gu{motion}
Text lowercase करें
gU{motion}
Text uppercase करें
Common Combos
dd
पूरी line delete करें
cc
पूरी line change करें
yy
पूरी line yank करें
D
Cursor से line के अंत तक delete करें
C
Cursor से line के अंत तक change करें
x
Cursor के नीचे character delete करें
s
Character delete करें और Insert mode में जाएँ
r{char}
Cursor के नीचे character को {char} से replace करें
J
Current line को नीचे वाली line से join करें
~
Cursor के नीचे character का case toggle करें
Text Objects (operators के साथ इस्तेमाल करें)
iw
Inner word (सिर्फ word, surrounding space नहीं)
aw
A word (word plus surrounding space)
i"
Double quotes के अंदर
i'
Single quotes के अंदर
i)
Parentheses के अंदर
i}
Curly braces के अंदर
i]
Square brackets के अंदर
it
HTML/XML tag के अंदर
ip
Inner paragraph

ci" (change inside quotes) शायद वह combo है जो आप सबसे ज़्यादा इस्तेमाल करेंगे। Cursor quoted string के अंदर कहीं भी हो? ci" contents clear करके Insert mode में ले जाता है। Parentheses (ci(), braces (ci{), brackets (ci[), और tags (cit) के साथ भी काम करता है।

Undo, Redo और Registers

Undo और Repeat
u
आखिरी change undo करें
Ctrl-r
Redo करें
.
आखिरी change repeat करें — incredibly powerful
Registers और Clipboard
p
Cursor के बाद paste करें
P
Cursor से पहले paste करें
"{reg}y{motion}
Register {reg} में yank करें
"{reg}p
Register {reg} से paste करें
"+y{motion}
System clipboard पर yank करें
"+p
System clipboard से paste करें
:reg
सभी registers का content दिखाएँ

. (dot) command आपका आखिरी change repeat करता है। एक बार edit करें, फिर अगली जगह पर जाएँ और . hit करके फिर apply करें। यह Vim के सबसे underappreciated features में से एक है और repetitive edits लगभग effortless बना देता है।

Search और Replace

Search
/{pattern}
आगे search करें
?{pattern}
पीछे search करें
n
अगले match पर jump करें
N
पिछले match पर jump करें
*
Cursor के नीचे word आगे search करें
#
Cursor के नीचे word पीछे search करें
:noh
Search highlighting clear करें
Substitution (Find और Replace)
:s/old/new/
Current line पर पहली occurrence replace करें
:s/old/new/g
Current line पर सभी occurrences replace करें
:%s/old/new/g
File में सभी occurrences replace करें
:%s/old/new/gc
Confirmation के साथ file में सभी replace करें
:'<,'>s/old/new/g
Visual selection में replace करें

Windows और Splits

Creating Splits
Ctrl-wv
Window vertically split करें
Ctrl-ws
Window horizontally split करें
:vsp {file}
Vertical split और file खोलें
:sp {file}
Horizontal split और file खोलें
Navigating Splits
Ctrl-wh
बाएँ split पर जाएँ
Ctrl-wj
नीचे split पर जाएँ
Ctrl-wk
ऊपर split पर जाएँ
Ctrl-wl
दाएँ split पर जाएँ
Ctrl-ww
Splits में cycle करें
Splits Resize और Manage करना
Ctrl-w=
सभी splits बराबर size करें
Ctrl-w_
Current split height maximize करें
Ctrl-w|
Current split width maximize करें
Ctrl-wo
Current के अलावा सभी splits बंद करें
Ctrl-wq
Current split बंद करें
Ctrl-wT
Current split नए tab में ले जाएँ

Buffers और Tabs

Buffers Neovim का तरीका है open files track करने का। आप जो भी file खोलते हैं वह buffer है, भले ही दिखाई न दे। Neovim में Tabs browser tabs से ज़्यादा "layouts" जैसे हैं — हर tab अपने splits का arrangement रख सकता है।

Buffers
:ls
Open buffers list करें
:b {name}
Partial name से buffer पर switch करें (tab-complete काम करता है)
:b {number}
Number से buffer पर switch करें
:bn
अगला buffer
:bp
पिछला buffer
:bd
Current buffer बंद करें
:e {file}
File नए buffer में खोलें
Tabs
:tabnew
नया tab खोलें
:tabnew {file}
File नए tab में खोलें
gt
अगले tab पर जाएँ
gT
पिछले tab पर जाएँ
{number}gt
Tab {number} पर जाएँ
:tabclose
Current tab बंद करें

Marks और Jumps

Marks आपको file में positions bookmark करने और वापस jump करने देते हैं। Lowercase marks एक file तक सीमित हैं, uppercase marks files के across काम करते हैं।

Marks
m{a-z}
Local mark set करें
m{A-Z}
Global mark set करें (files के across काम करता है)
'{a-z}
Mark की line पर jump करें
`{a-z}
Mark की exact position पर jump करें
:marks
सभी marks list करें
Jump List
Ctrl-o
Jump list में पिछली position पर jump करें
Ctrl-i
Jump list में अगली position पर jump करें
gd
Cursor के नीचे word की local definition पर जाएँ
gD
Cursor के नीचे word की global definition पर जाएँ
gf
Cursor के नीचे file पर जाएँ
:jumps
Jump list दिखाएँ

Ctrl-o आपका "back button" है। हर बार जब आप कहीं jump करते हैं — search, goto definition, files switch करना — Neovim याद रखता है आप कहाँ थे। अपने कदम वापस trace करने के लिए Ctrl-o hit करें। यह files के across काम करता है। सिर्फ यह ही आपको खो जाने से बचाएगा।

Macros

Macros keystrokes का sequence record करते हैं और replay करते हैं। वे repetitive edits के लिए perfect हैं जो . के लिए बहुत complex हैं लेकिन script लिखने लायक नहीं।

Macros Record और Play करना
q{a-z}
Register {a-z} में macro record करना शुरू करें
q
Recording रोकें (recording के दौरान press करें)
@{a-z}
Register से macro play करें
@@
आखिरी बार play किया macro replay करें
{n}@{a-z}
Macro {n} बार play करें

Macro record करते समय, line पर consistent position पर जाने के लिए 0 या ^ से शुरू करें, और नीचे जाने के लिए j से खत्म करें। इस तरह आप इसे 10@q जैसे कुछ से कई lines पर चला सकते हैं और यह reliably काम करेगा।

LSP (Language Server Protocol)

Neovim में version 0.5 से built-in LSP support है। ये common default bindings हैं, लेकिन आपकी specific config इन्हें remap कर सकती है। :map से check करें या अपना lspconfig setup देखें।

LSP Navigation
gd
Definition पर जाएँ
gD
Declaration पर जाएँ
gr
References दिखाएँ
gi
Implementation पर जाएँ
K
Hover documentation
Ctrl-k
Signature help (Insert mode में)
LSP Actions
<leader>rn
Cursor के नीचे symbol rename करें
<leader>ca
Code action (quick fixes, refactors)
<leader>f
Buffer format करें
]d
अगले diagnostic पर जाएँ
[d
पिछले diagnostic पर जाएँ
<leader>e
Diagnostic float दिखाएँ
<leader>q
Diagnostics location list में भेजें

Telescope

Telescope वह fuzzy finder है जिस पर ज़्यादातर modern Neovim setups निर्भर करते हैं। ये typical <leader> bindings हैं — config के अनुसार आपकी भिन्न हो सकती हैं। अगर आप अभी Telescope इस्तेमाल नहीं कर रहे, तो यह install करने लायक सबसे ज़रूरी plugin है।

चीज़ें ढूंढना
<leader>ff
नाम से files ढूंढें
<leader>fg
Live grep (file contents search करें)
<leader>fb
Open buffers browse करें
<leader>fh
Help tags search करें
<leader>fo
हाल में खोली गई files
<leader>fw
Cursor के नीचे word search करें
Telescope के अंदर
Ctrl-nCtrl-p
Results में ऊपर/नीचे जाएँ (या arrow keys)
Enter
Selected result खोलें
Ctrl-x
Horizontal split में खोलें
Ctrl-v
Vertical split में खोलें
Ctrl-t
नए tab में खोलें
Esc
Telescope बंद करें

ज़रूरी Commands

File Operations
:w
File save करें
:q
Quit करें (unsaved changes हों तो fail)
:wq
Save करें और quit करें
:q!
बिना save किए quit करें
:wa
सभी open buffers save करें
:qa
सब quit करें
ZZ
Save करें और quit करें (Normal mode shortcut)
ZQ
बिना save किए quit करें (Normal mode shortcut)
उपयोगी Commands
:set number
Line numbers दिखाएँ
:set relativenumber
Relative line numbers दिखाएँ
:!{cmd}
Shell command चलाएँ
:r !{cmd}
Shell command का output buffer में insert करें
:map
सभी key mappings दिखाएँ
:checkhealth
अपना Neovim setup diagnose करें

Tips और Tricks

Relative line numbers (set relativenumber) vertical motions के लिए game-changer हैं। "वो 15 lines नीचे है?" अंदाज़ा लगाने के बजाय, number वहीं दिखता है और आप 15j type कर सकते हैं। ज़्यादातर लोग number और relativenumber दोनों set करते हैं ताकि current line अपना absolute number दिखाए जबकि बाकी सब relative हो।

Visual Block mode (Ctrl-v) columns edit करने देता है। Vertical column select करें, I press करें, text type करें, और Esc hit करें — text हर selected line पर appear होता है। Prefixes जोड़ने, code align करने, या structured text edit करने के लिए incredibly handy।

इस page पर हर shortcut याद करने की ज़रूरत नहीं। hjkl, w/b, dd, yy, p, i, Esc, और :wq से शुरू करें। एक हफ्ते तक इन्हें इस्तेमाल करें। फिर ciw, f{char}, और Ctrl-d/Ctrl-u जोड़ें। धीरे-धीरे build करें — Vim में अच्छे हर व्यक्ति ने वाकई ऐसे ही सीखा।

Config setup करने के बाद :checkhealth चलाएँ। यह बताता है कि exactly क्या काम कर रहा है, क्या टूटा है, और क्या missing है। जब कुछ ठीक न लगे तो चलाने वाला पहला command यही है।

Normal mode में gx command cursor के नीचे URL को browser में खोलता है। Comments में links वाला code पढ़ते समय काम आता है।

Neovim Configure करें

अपना init.lua समझना और customize करना चाहते हैं? interactive config editor try करें — अपना config upload करें, देखें हर option क्या करता है, और visually tweak करें।

Related Tools