As of May 31, 2023, we have updated our Code of Conduct.
8 votes
Accepted

What does breakat&vim mean?

It resets the breakat option to the Vim default: ^I!@*-+;:,./?. Where ^I stands for the tab character. You get the corresponding help paragraph with the :help :set-default command. :se[t] {option}&...
Vivian De Smedt's user avatar
3 votes

how to delete every char except newline?

To remove all content of a line, you can use the :substitute command (see :help substitute) like this: :s/.*// It will substitute any character (.), repeated 0 or more times (*) with nothing. It will ...
Friedrich's user avatar
  • 522
3 votes
Accepted

Function for recursive linebreak

A solution to review the paragraph you are in is: gqip Where: gq reformat them according to textwidth ip current paragraph If you want that to be made for all paragraph while they are edited a ...
Vivian De Smedt's user avatar
2 votes

how to delete every char except newline?

I am not sure why you want to do it, but here we go: :%norm! D This keeps the newlines, but makes every line empty. Or if you want to delete the whole buffer completely, including the line breaks: :%...
Christian Brabandt's user avatar
2 votes

Function for recursive linebreak

I ended up making the following macros that are working well for me: function RecursiveLinebreak() call feedkeys("\gq") call feedkeys("\ip") endfunction autocmd FileType ...
Andrew Draganov's user avatar
1 vote

Any .vimrc hacks to make vim automatically start a new line when you exceed line length?

To have the desired behavior for the text file I would add the following line to ~/.vimfiles/ftplugin/text.vim or ~/.vimfiles/after/ftplugin/text.vim: :setlocal textwidth=80 :setlocal formatoptions+=t ...
Vivian De Smedt's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible