In Vim, enter :set number to show absolute line numbers or :set nonumber to hide them. These settings change only what you see in the editor; they do not add numbers to the file. Vim also supports relative and hybrid numbering.
Show or hide line numbers in Vim
- Press
Escto make sure Vim is in Normal mode. - Type
:set numberand pressEnterto show absolute line numbers. To hide them, type:set nonumberand pressEnter.
The commands begin with a colon because they are entered on Vim’s command line. The no prefix turns off a Boolean option, as described in the Vim user manual.
Choose absolute, relative, or hybrid numbering
Vim’s number and relativenumber options control the number column independently. The Vim options reference documents these window-local Boolean options and their combinations.
| Display | Command | What the number column shows |
|---|---|---|
| Absolute | :set number |
Each line’s position in the file. |
| Hidden | :set nonumber norelativenumber |
No line numbers. |
| Relative | :set relativenumber |
Distance from the cursor line; the cursor line is shown as 0. |
| Hybrid | :set number relativenumber |
The cursor line’s absolute number and other lines’ distances from it. |
Relative numbers can help when using counted vertical movement commands; absolute numbers make it easier to refer to a line by its position in the file. The Vim Reference Guide documents the relative-number behavior and toggle forms.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →#1 Best Overall
- VI VIM EDITOR KEYBOARD STICKER
- VI VIM EDITOR KEYBOARD SHORTCUT
- Hight quality keyboard sticker!
- Keyboard Stickers are made with typographical method on high-quality Matt Vinyl
- Size of individual small sticker is 11/5 x 13 mm
Toggle numbering instead of setting a fixed state
Use :set number! to reverse the current absolute-number setting, or :set relativenumber! to reverse the relative-number setting. A toggle changes the option from its current state, so use :set number or :set nonumber when you specifically want numbering on or off.
Keep the setting for future Vim sessions
To make a choice persistent, add its corresponding set command to the Vim startup configuration used by your installation—for example, set number or set nonumber. The appropriate configuration-file path varies by system and installation, so there is no single path to give for every Vim setup.
Rank #2
- 【Large Mouse Pad】Our extra-large mouse pad 31.4×11.8×0.07 inch(800×300×2 mm) is perfect for use as a desk mat, keyboard and mouse pad, or keyboard mat, offering you unparalleled comfort and support during long gaming sessions or work days.
- 【Shortcut Rference to VIM】Extensive compilation of commonly used command lines for VIM.This quick reference guide is designed to reduce programming time on VIM.Perfect for beginners and experienced programmer.
- 【Highly durable design】-The small office&gaming mouse pad is designed with high stretch silk precision locking edges to avoid loose threads on the cloth. Ensure Prolonged Use Without Deformation And Degumming.
- 【 Non-slip Rubber Base】-Dense shading and anti-slip natural rubber base can firmly grip the desktop. Premium soft material for your comfort and mouse-control.
- 【Ultra Smooth Surface】 Mouse Pad Designed With Superfine Fiber Braided Material, Smooth Surface Will Provide Smooth Mouse Control And Pinpoint Accuracy. Optimized For Fast Movement While Maintaining Excellent Speed And Control During Your Work Or Game.
Does this work in every vi editor?
The commands above are documented for Vim. A program named vi may be a different implementation, and Vim’s stated aim of providing a mostly POSIX-compatible vi implementation does not establish that every vi program supports Vim options such as relativenumber. See the Vim project README for its compatibility description.
Quick Recap
Best Value
- Cherry profile keycaps offer a sculpted shape that conforms to finger contours, providing a comfortable and familiar typing angle favored by many enthusiasts.
- The dye-sublimation printing technique infuses legends directly into the PBT material, creating sharp, long-lasting markings that resist wear from frequent use.
- Features a VIM editor-inspired theme with distinct color accents and text legends, appealing to programmers and users familiar with this popular coding environment.
- Made from white PBT plastic that offers a textured feel and maintains its color over time, resisting the shiny appearance that can develop on other materials.
- This comprehensive 131-key set includes specialized keys like 1.75U and 2U shifts, ensuring compatibility with a wide range of keyboard layouts from full-size to compact designs.
Rank #4
- Multi-Device Connectivity: Effortlessly connect and switch between up to 3 devices (Android, iOS, Windows) with ease, perfect for multitaskers who need to move between devices quickly for seamless workflow and productivity
- Comfortable and Responsive Typing: Features 12 customizable shortcut keys and a 1.3mm low travel distance to provide a comfortable, quiet, and responsive typing experience, making it ideal for both casual use and long work sessions
- Ultra-Slim and Lightweight Design: With a slim profile and a lightweight design of just 180g, this keyboard is perfect for on-the-go professionals or those who need a portable keyboard for their tablet, laptop, or mobile device
- Long Battery Life: Enjoy up to 60 hours of continuous use on a single charge with the rechargeable battery, allowing you to work, create, and type for extended periods without the need for constant recharging or battery swaps
- Flexible Connectivity Options: Choose between Bluetooth or USB-C for secure, reliable, and quick connectivity with your devices, ensuring you have the flexibility to use it in any workspace, whether at home, in the office, or on the go
Rank #3
- Large Size: 800 x 300 mm + 2mm thickness adapt to all surfaces
- Non-Slip Base: The mouse pad has a non-slip base to ensure it stays in place on your desk, preventing it from sliding during use.
- Durable Stitched Edge: The circle edge stitching prevents the top layer from fraying and ensures the mousepad for long time use.
- Versatile Use: Not only suitable for office and everyday use, but also perfect for gamers and designers alike. It can also be a special gift for your family and friends.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
Free tools Windows power users keep installed
One-click scans. No signup required.

