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:
1
2
sudo dnf install npm-y
npm install-gprettier
Install vim-prettier Plugin To use Prettier inside Vim, install the vim-prettier plugin. Clone […]
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.
To create indents with 4 space characters which are entered by pressing the TAB key:
1
set tabstop=8softtabstop=0expandtab shiftwidth=4smarttab
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 […]
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
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 […]