Posts about programming - Phelipe Teles · Sep 29, 2022
Ergonomic mappings for code formatting in Vim
0Sign in to vote or save
This page did not load. You can still read it on the original site — the toolbar below keeps your place in the directory.
Vim allows you to format text with an arbitrary external program with the :h gq operator. For example, say you want to format with prettier, you just need to set :h 'formatprg' option to npx prettier --stdin-filepath %, and gqip will format the paragraph with it (it also works if you select the text first and then use gq — vipgq).
Comments
Nothing yet. Say the first thing.
Sign in to join the conversation.