Skip to content

πŸŒ€ Get to "no-vim" with these fundamental shortcuts.

Notifications You must be signed in to change notification settings

zarifpour/no-vim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 

Repository files navigation

β–ˆβ–ˆβ–ˆβ•—   β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—       β–ˆβ–ˆβ•—   β–ˆβ–ˆβ•—β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ•—   β–ˆβ–ˆβ–ˆβ•—
β–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•—      β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ•‘
β–ˆβ–ˆβ•”β–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β–ˆβ–ˆβ–ˆβ–ˆβ•”β–ˆβ–ˆβ•‘
β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β•šβ•β•β•β•β•β•šβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘
β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•       β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β•šβ•β• β–ˆβ–ˆβ•‘
β•šβ•β•  β•šβ•β•β•β• β•šβ•β•β•β•β•β•         β•šβ•β•β•β•  β•šβ•β•β•šβ•β•     β•šβ•β•

/noʊ.vΙͺm/


Get to "no-vim" with these fundamental shortcuts: explore swift navigation, precise content modification, and master command count motions, such as 2w to leap forward two words, boosting your document handling efficiency. This manual aims to transform you into a proficient and quick editor, adept at facing any text editing challenge.

Definitions

πŸ‹οΈ What is a motion? A motion is a command that moves the cursor to a new position in the text according to a specific pattern or direction.
πŸ“― What is a command? A command is an instruction that performs a specific action, such as editing text, changing configuration, or navigating through the document.
πŸ”‘ What is a word? A word is defined as a sequence of letters, digits, or underscores, or a sequence of other non-blank characters, separated by whitespace.
πŸ”  What is a WORD? A WORD is defined as a sequence of non-blank characters, separated by whitespace.

πŸ‹οΈ Motions

Motions are shortcuts that relocate the cursor within the text, ranging from simple one-character moves to complex jumps like starting the next word or reaching document's end. They are essential for efficient navigation and editing, enabling quick cursor movement without hand repositioning from the keyboard.

↔️ Horizontal

  • 0 - go to the beginning
  • $ - go to the end
  • _ or ^ - go to the first non-blank character
  • g_ - go to the last non-blank character in the line

↕️ Vertical

  • gg - go to the first line
  • G - go to the last line
  • { - go to the beginning of the previous paragraph
  • } - go to the beginning of the next paragraph
  • Ctrl-u - move half a page up
  • Ctrl-d - move half a page down
  • zz - center the line on the screen
  • zt - move the line to the top of the screen
  • zb - move the line to the bottom of the screen
  • * - go to the next occurrence of the word under the cursor
  • # - go to the previous occurrence of the word under the cursor

πŸ“― Commands

Commands are instructions for performing actions such as editing text, changing settings, or manipulating the editor's state. They vary in function and can be executed in different modes, providing a wide range of text manipulation and customization options.

πŸ”€ Word

  • w - go to the beginning of the next word
  • W - go to the beginning of the next WORD
  • e - go to the end of the next word
  • b - go to the beginning of the previous word
  • ge - go to the end of the previous word
  • gE - go to the end of the previous WORD

πŸ”Ž Find

  • f<char> - find the next occurrence of a character
  • F<char> - find the previous occurrence of a character
  • t<char> - till the next occurrence of a character (moves the cursor to one character before the character you want to find)
  • T<char> - till the previous occurrence of a character (moves the cursor to one character after the character you want to find)

πŸŽ›οΈ Modes

Visual Block Mode

Visual Block Mode is a versatile feature in Vim that allows you to select and manipulate columns of text simultaneously. This mode is incredibly useful for making the same change across multiple lines, adding a structured approach to bulk editing tasks.

Key Features of Visual Block Mode

  1. Columnar Text Selection: By entering Visual Block Mode, you can select text in a columnar fashion rather than by conventional linear selection. This is ideal for editing tables, aligning text, or formatting code blocks.

  2. Uniform Text Insertion/Deletion: Easily insert or delete text across multiple lines at the exact same position, ensuring uniformity with minimal effort.

  3. Adding Comments or Prefixes:

    • Example: Quickly prepend multiple lines with comments (e.g., // TODO:) to mark areas needing attention.
    • How to Use:
      • Move the cursor to the beginning of the first line where the comment is needed.
      • Press Ctrl-v to enter Visual Block Mode.
      • Use j or k to extend the selection to cover all relevant lines.
      • Press I to insert text at the start of each line, type // TODO: , and press Esc. The comment will appear at the beginning of each selected line.
  4. Efficient Text Appending: Append text at the end of each line in the block selection by selecting the lines in Visual Block Mode, moving the cursor to the end using $, and pressing A to append.

  5. Flexible Rectangular Edits: Perform more complex edits like changing numbers or codes in a structured data block, where line-by-line editing would be cumbersome.

Practical Applications

  • Code Refactoring: Quickly refactor variable names or add syntax to multiple lines of code simultaneously.
  • Data Formatting: Align data in rows and columns when preparing reports or configuring settings in configuration files.
  • Bulk Commenting/Uncommenting: Toggle comments on multiple lines at once to enable or disable sections of code efficiently.

About

πŸŒ€ Get to "no-vim" with these fundamental shortcuts.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published