How To Prettify Using Vim and Prettier

Author: , March 7th, 2025

If you’re a Vim user and want to integrate Prettier for automatic code formatting, follow these steps to set it up on your system. Install Prettier Globally Before installing the Vim plugin, you need to have Prettier installed globally via npm:

Install vim-prettier Plugin To use Prettier inside Vim, install the vim-prettier plugin. Clone […]

How To Diff Two Files In Vim

Author: , February 5th, 2024

shell> vimdiff file1 file2 ~OR~ shell> vim file1 file2 Create a vertical split window: Control-w v Enable visual diff on the left side: :diffthis Move the cursor to the right side buffer: Control-w Right-arrow Enable visual diff on the left side: :diffthis You should now see the differences highlighted on both sides.

How To Disable VIM Mouse Automatic Visual Mode

Author: , July 27th, 2021

Current Session:

All Sessions: Add the following to your ~/.vimrc file:

How To Disable Automatic Comment Insertion In VIM

Author: , August 6th, 2020

Disable NOW in vim:

To disable auto-comments permanently, add the following line to ~/.vimrc:

To see the current settings:

Visit https://vim.fandom.com/wiki/Disable_automatic_comment_insertion for more information!

How To Force vim to Convert Tabs to Spaces

Author: , November 26th, 2019

To create indents with 4 space characters which are entered by pressing the TAB key:

To make the above settings permanent add to your ~/.vimrc file. For more details on any of these see :help ‘optionname’ in vim (e.g. :help ‘tabstop’) tabstop The width of a hard tabstop measured in “spaces” — effectively the […]

How To Prevent Vim From Auto-Commenting New Lines

Author: , August 4th, 2019

To prevent vim from added net comments, edit the .vimrc file in your home directory, and add:

How To Reformat or Re-indent Files in VIM

Author: , January 11th, 2019

UPDATE 07-March-2025 Please visit: How To Prettify Using Vim and Prettier In the normal vim mode, typing gg=G will reindent the entire file. == will re-indent just the current line. http://vim.wikia.com/wiki/Fix_indentation

How To Move in vim Using the Keyboard

Author: , March 21st, 2018

h move one character left j move one row down k move one row up l move one character right w move to beginning of next word b move to previous beginning of word e move to end of word W move to beginning of next word after a whitespace B move to beginning of […]

How To Find Non-ASCII Characters in Vi

Author: , July 7th, 2015

To search for non-ASCII characters: /[^\d0-\d127] Use the substitute function to clean them up: :%s/[^\d0-\d127]/ /g

How To Diff Two Files With SSH/SCP Using VimDiff

Author: , February 3rd, 2015

vimdiff /path/to/file.css scp://yourHost.com//path/to/file.css