Essential Vim command - VLSI Expert

Essential Vim command - VLSI Expert

Essential Vim command


Basic Navigation & Editing

  • i → Enter insert mode before the cursor.

  • I → Enter insert mode at the beginning of the line.

  • a → Enter insert mode after the cursor.

  • A → Enter insert mode at the end of the line.

  • o → Open a new line below the current line.

  • O → Open a new line above the current line.

Copying & Deleting

  • yy → Copy (yank) the current line.

  • dd → Delete the current line.

  • D → Delete from the cursor position to the end of the line.

  • x → Delete the character under the cursor.

Pasting

  • p → Paste the content after the cursor.

  • P → Paste the content before the cursor.

Undo & Redo

  • u → Undo the last change.

  • Ctrl + r → Redo the last undone change.

Saving & Exiting

  • :w → Save the current file.

  • :q → Quit Vim (close current file).

  • :q! → Quit Vim without saving changes.

  • :wq → Save and quit.

File Operations

  • :e <filename> → Open a new file.

  • :bnext (:bn) → Switch to the next buffer.

  • :bprev (:bp) → Switch to the previous buffer.

  • :bd → Close the current buffer.

Splitting Windows

  • :vsp <filename> → Open a file in a vertical split.

  • :sp <filename> → Open a file in a horizontal split.

  • Ctrl + w + hjkl → Move between split windows.

  • gg → Move to the beginning of the file.

  • G → Move to the end of the file.

Display & Appearance

  • :set number → Show line numbers.

  • :set nonumber → Hide line numbers.

  • /pattern → Search forward for the specified pattern.

  • ?pattern → Search backward for the specified pattern.

  • n → Move to the next search result.

  • N → Move to the previous search result.

  • * or # → Search for the word under the cursor (forward/backward).

Find & Replace

  • :s/pattern/replace/g → Replace all occurrences of a pattern.

  • :s/pattern/replace/gc → Replace with confirmation.

  • :%s/foo/bar/g → Replace all occurrences in the entire file.

Code Navigation (Tags)

  • Ctrl + ] → Jump to the definition of a function (using tags).

  • Ctrl + t → Jump back from the definition.

Working with External Files

  • :r <filename> → Read the content of a file and insert it.

Indentation & Formatting

  • :set ts=4 → Set tab stop to 4 spaces.

  • :set expandtab → Use spaces instead of tabs.

Line Wrapping

  • :set nowrap → Disable line wrapping.

  • :set wrap → Enable line wrapping.



    • Related Articles

    • List of Essential Linux commands - VLSI Expert

      List of Essential Linux commands Basic Commands pwd → Print working directory. ls → List files and directories. cd directory_name → Change directory. mkdir new_directory → Create a new directory. rmdir empty_directory → Remove an empty directory. cp ...
    • UserLoginSetup-VLSI EXPERT

      Setting up access to VLSI EXPERT machine Using Command Prompt to launch the TigerVNC viewer Step 1: Launch command terminal & setup connection Window users, a) Launch command terminal using “cmd” and run below command (highlighted in yellow) ###Note: ...
    • Setting-up Putty Environment at VLSI EXPERT - Window User

      For Windows users: Step 1: Download Putty Click on the link Download PuTTY -Download PuTTY - a free SSH and telnet client for Windows And if you don’t know your computer architecture then please, first check the architecture. Window -> System -> ...
    • How to Open Command Prompt/cmd for All Windows versions

      How to Open Command Prompt/cmd for All Windows versions Command Prompt is a powerful command-line tool in Windows that allows users to execute various commands for troubleshooting, automation, and system management. Here we use it to launch our ssh ...
    • Command to Run VCS-Verdi

      While running the VCS command, enable a new switch -kdb (Knowledge Database) to enable Verdi GUI. Before running the simulation and view waveforms, user need to create *.fsdb file. This file contains the simulation data in it. This is created using ...