|
|
Nice.
I copied about 4000 lines of code and copied it back to my .cpp file.
I will try to see how my current messy " under construction " file looks now ,,,
I would probably do "CodeBeautifier" when my code gets too messy...
about hourly... just kidding
Thanks
|
|
|
|
|
If you're looking to reformat your code, you might want to take a look at ClangFormat — Clang 18.0.0git documentation Depending on which IDE you're using, you may find that others have already created plug-ins for it. A quick google around suggests that Visual Studio and QtCreator both have instructions on how to integerate.
"A little song, a little dance, a little seltzer down your pants"
Chuckles the clown
|
|
|
|
|
Looks like there are a couple extensions for VS Code that will do that.
|
|
|
|
|
For JavaScript and Typescript, use eslint to do that. You should be linting your projects anyway.
no-multiple-empty-lines | ESLint Stylistic
If you install the eslint plugin for VS Code, it'll do that every time you save a file. But, you don't need VS Code to use it.
Jeremy Falcon
|
|
|
|
|
notepad++
CI/CD = Continuous Impediment/Continuous Despair
|
|
|
|
|
Specifically, for most files replace '\r\n' with nothing, and select 'Extended' in the options
|
|
|
|
|
No, that'll collapse everything to a single line!
To remove blank lines, in Regular Expression mode replace \r\n(\r\n)+ with \r\n
That assumes that the blank lines don't have any whitespace.
If they might, then replace \r\n(\s*\r\n)+ with \r\n
"Fairy tales do not tell children the dragons exist. Children already know that dragons exist. Fairy tales tell children the dragons can be killed."
- G.K. Chesterton
|
|
|
|
|
Thanks! I was being brain dead. I have removed blank lines the way you showed before but dyslexia kicked in.
|
|
|
|
|
That's what I was thinking; you don't need a separate tool to remove blank lines; a regex search and replace ought to do it.
My real question (to the OP) is, does he want the editor to keep the blank lines but just not show them, or really remove them altogether?
|
|
|
|
|
Or 'Edit' -> 'Line Operations' -> 'Remove Empty Lines'
Regards
Nelviticus
|
|
|
|
|
Notepad++ -- Edit | Line Operations | Remove Empty Lines
Mike
|
|
|
|
|
Look at sed if you have a Linux box
In a closed society where everybody's guilty, the only crime is getting caught. In a world of thieves, the only final sin is stupidity. - Hunter S Thompson - RIP
|
|
|
|
|
VIM or NeoVim can do this.
https://stackoverflow.com/questions/706076/vim-delete-blank-lines#706083
When I first started with VI I hated it. The more I learn though, the better it is. It's my editor of choice now, but I confess I don't use it enough to keep all the goodness in my head, and I often need a few moments to get into the VIM headspace when I start.
|
|
|
|
|
^\x0a|^\x0d|^[\s]+.$ seems to work . "Buyer Beware"
|
|
|
|
|
I have a little note for that for VS Code:
vscode: ^$\n (to remove empty lines)
And I don't believe it was with any particular extension.
|
|
|
|
|
|
Don't know (and IDC) about plugin into any development system, but for years, I am using PsPad as my go-to plain text editor on Windows, and it has a function to remove blanks lines (and many other options)...
|
|
|
|
|
=10
"In testa che avete, Signor di Ceprano?"
-- Rigoletto
|
|
|
|
|
Google calculator tells me it's 3,628,800
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
Don't trust decimal folks.
"In testa che avete, Signor di Ceprano?"
-- Rigoletto
|
|
|
|
|
Such an hexed comment.
GCS/GE d--(d) s-/+ a C+++ U+++ P-- L+@ E-- W+++ N+ o+ K- w+++ O? M-- V? PS+ PE Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++* Weapons extension: ma- k++ F+2 X
The shortest horror story: On Error Resume Next
|
|
|
|
|
Hexact!
"In testa che avete, Signor di Ceprano?"
-- Rigoletto
|
|
|
|
|
Bo Derek?
"Ten men in the country could buy the world and ten million can’t buy enough to eat." Will Rogers
PartsBin an Electronics Part Organizer - Release Version 1.3.0 JaxCoder.com
Latest Article: SimpleWizardUpdate
|
|
|
|
|
Mike Hankey wrote: Bo Derek?
These days, she's no more than 9.5.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|