summaryrefslogtreecommitdiff
path: root/public/articals/neovim/3Basic.html
blob: a185cb664f103ea700711fa4962e9bf2a523422e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<!DOCTYPE html>
<html lang="en-GB">
  <head>
    <meta charset="UTF-8">
    <meta name="author" content="Shipwreckt">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Basic commands</title>
    <link rel="stylesheet" href="../../styles.css">
    <link rel="icon" href="../../Images/favi.png" type="image/x-icon">
  </head>
  <body>
    <header>
      <nav>
        <ul>
          <li><a href="../../index.html">Home</a></li>
          <li><a href="../../links.html">Links</a></li>
          <li><a href="../../projects.html">Projects</a></li>
          <li><a href="../../contact.html">Contact</a></li>
        </ul>
      </nav>
    </header>
    <main>

      <h1>Basic Commands</h1><hr>

      <p>There are over 100 commands in Neovim, and thankfully, you don't need to know all of them to use the text editor—just a few basic commands are enough.</p><hr>

      <h3>Copy and Paste in Neovim</h3>
      <p>Instead of using <kbd>Ctrl</kbd> + <kbd>C</kbd> and <kbd>Ctrl</kbd> + <kbd>V</kbd>, Neovim uses <kbd>y</kbd> and <kbd>p</kbd> for copying and pasting lines:</p>
      <ul>
        <li><kbd>yy</kbd> - Copies an entire line in normal mode</li>
        <li><kbd>y3</kbd> - Copies 3 lines in normal mode</li>
        <li><kbd>y</kbd> - Copies selected text in visual mode</li>
      </ul>
      <hr>

      <h3>Deleting Lines</h3>
      <ul>
        <li><kbd>dd</kbd> - Deletes a single line in normal mode</li>
        <li><kbd>d3</kbd> - Deletes 3 lines in normal mode</li>
        <li><kbd>d</kbd> - Deletes selected text in visual mode</li>
      </ul>
      <hr>

      <h3>Undo and Redo</h3>
      <ul>
        <li><kbd>u</kbd> - Undo the last change</li>
        <li><kbd>Ctrl</kbd> + <kbd>r</kbd> - Redo the undone change</li>
      </ul>
      <hr>

      <h3>Saving and Quitting</h3>
      <ul>
        <li><kbd>:w</kbd> - Save the current file</li>
        <li><kbd>:wq</kbd> or <kbd>ZZ</kbd> - Save and quit</li>
        <li><kbd>:q</kbd> - Quit (only if no unsaved changes)</li>
        <li><kbd>:q!</kbd> or <kbd>ZQ</kbd> - Quit without saving changes</li>
      </ul>
      <hr>

      <h3>Searching</h3>
      <ul>
        <li><kbd>/Linux</kbd> - Search for 'Linux' (case-sensitive)</li>
        <li><kbd>n</kbd> - Go to the next found 'Linux'</li>
        <li><kbd>N</kbd> - Go to the previous 'Linux'</li>
      </ul>
      <hr>

      <pre style="text-align: center;"><a href="../neovimlist.html">Back</a></pre>
    </main>
  </body>
</html>