mirror of
https://github.com/preservim/vim-pencil.git
synced 2025-11-13 12:23:47 -05:00
Additional tips on formatting paragraphs
This commit is contained in:
@@ -271,17 +271,23 @@ Note that you need not rely on Vim’s autoformat exclusively and can
|
|||||||
manually reformat paragraphs with standard Vim commands:
|
manually reformat paragraphs with standard Vim commands:
|
||||||
|
|
||||||
* `gqip` or `gwip` - format current paragraph
|
* `gqip` or `gwip` - format current paragraph
|
||||||
* `vipJ` - unformat (i.e., join all lines with hard line breaks) in current paragraph
|
* `vapJgwip` - merge two paragraphs (current and next) and format
|
||||||
* `ggVGgq` or `:g/^/norm gqq` - format all paragraphs in buffer
|
* `ggVGgq` or `:g/^/norm gqq` - format all paragraphs in buffer
|
||||||
* `:%norm vipJ` - unformat all paragraphs in buffer
|
|
||||||
|
|
||||||
Optionally, you can map these operations to underutilized keys in your
|
Optionally, you can map these operations to underutilized keys in your
|
||||||
`.vimrc`:
|
`.vimrc`:
|
||||||
|
|
||||||
```vim
|
```vim
|
||||||
nnoremap <silent> Q gwip
|
nnoremap <silent> Q gwip
|
||||||
|
nnoremap <silent> <leader>Q vapJgwip
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Or you may wish to ‘unformat’, (i.e., remove hard line breaks) when using
|
||||||
|
soft line wrap.
|
||||||
|
|
||||||
|
* `vipJ` - join all lines in current paragraph
|
||||||
|
* `:%norm vipJ` - unformat all paragraphs in buffer
|
||||||
|
|
||||||
## Default textwidth
|
## Default textwidth
|
||||||
|
|
||||||
You can configure the textwidth to be used in **HardPencil** mode when no
|
You can configure the textwidth to be used in **HardPencil** mode when no
|
||||||
|
|||||||
Reference in New Issue
Block a user