Remove trailing spaces of the code text in the editor of PL/SQL Developer - plsqldeveloper

I haven't found in the editor preferences the option that allows remove trailing spaces of the code text when save a file.
Are there a plugin that will remove trailing spaces on file saving or is there any other way?

Select All (Ctrl+A) your code
right click (context menu)
menu item "Selection"
submenu item "Remove Trailing Blanks"

Related

Find and delete (strip) all occurances of html tag and its contents in visual studio code

How can I find and delete all occurrences of an html tag using Visual Studio Code.
As an example, I am trying to parse a page that is riddled with SVG tags. I don't want the tags, nor the contents of those tags in the file.
If you are opening the "Find and Replace" popup in VS-Code (Windows: CTRL + H, Mac ⌥ + ⌘ + F), then inside the "Search" input field there are three icons on the right side.
Press the right one .* in order to activate regular expressions.
After it's activated you can search for SVG tags like so:
<\s*svg[^>]*>(.*?)<\s*\/\s*svg>
Leave the replace input empty and press enter in order to replace it with "nothing" and therefore removing the HTML-Tag and it's inner text.
But be careful, this will really delete everything between those matched tags.
So for example if you are looking for <a> tags, even this String will be completely removed: Some <span>special</span> formatted link
You can find an example with it here: https://regex101.com/r/ewEttF/1
You can use Regex Search and Emmet.
Use regex search to find the start tags: <svg[^>]*>
While the focus is still in the find dialog: Alt+Enter
this will select all matching cases and put focus on the editor
Move cursors after the opening tag: RightArrow
Use Emmet: Balance outward to select content of tag
Use Emmet: Balance outward to select content and tag start and tag end
Delete selected stuff with: Delete
End Multi Cursor with: Esc

Notepad++ tabs to spaces everywhere other than beginning of line

Due to a new coding style that I've been having to use I'm required to use tabs in the beginning of lines but spaces everywhere else to align things.
Is there a way to customize notepad++ to only replace tabs with spaces if it's not at the beginning of a new line?
Just as an example of what I mean I'll use this bit of 'code':
function someFunction():
while(true):
veryLongCodeStuff() // Some comment
shortCode() // Aligned comment
Which I would have to write like this (where \t = tab and a "." represents a space):
function someFunction():
\twhile(true):
\t\tveryLongCodeStuff()..// Some comment
\t\tshortCode()..........// Aligned comment
To convert existing files, I would suggest a two step approach:
replace all tabs with spaces (this can be done with Edit -> Blank operations -> TAB to Space )
replace spaces at the beginning of lines: do a regular expression find/replace like this:
Open Replace Dialog
Find What: ^([\t]?)( ){4} instead of 4 use the number of spaces you have configured as tab width
Replace With: \1\t
check regular expression
click Replace All: as each Replace All replaces only one indent level for all lines: repeat until the status bar of the find dialog tells you, that no more replacements were done (just keep Alt-A pressed for a second or two)

How to remove line break and all spaces on the next line in sublime text editor?

It happens many times when we need to remove line end and unnecessary space between the HTML element. So this could be proven as a time-saving technique.
open Search and replace (CTRL+H)
enable "Regular Expression" (circled in red)
enter \n\s+ in the search field, clear the replace field
press "Replace all"
This will remove all newlines (\n+) followed by all whitespace (\s+) in the next line.
In your Sublime Text user settings, you can specify the following to trim trailing white space.
"trim_trailing_white_space_on_save": true
You might want to have a look at the Trimmer that has a couple of options to trim whitespace.
you can also use \n+ to remove all the unwanted space , if you want to use a single line then replace with \n online

Is there a way to replace a whole paragraph in Notepad++

I am trying to replace in Notepad++ using the Replace module, the below paragraph in html (i have 30 html file, and need to replace the below in all of them)
<script type="text/javascript">
<!--
var slideInterval=20000;
var slideTransition=3500;
var slideArray=["/background1.jpg","background2.jpg"];
jQuery.fx.interval=33;
// -->
</script>
But Notepad++ doesn't let me replace unless it's a line instead of a paragraph, and if i put everything on one line to replace, i will have another problems to worry about in my html.
I hope you have a work around on that.
I found a good way to use a multi-line "find" or "replace". I just copy pasted the paragraph into the Ctrl+H "find" field, then brought another paragraph and pasted it into the "replace" field. Notepad++ will show a tabbed space that means a line break. And voila, you can "Replace in all open documents" with just a single click.
N.B.: the "copy" operation should be within Notepad++, otherwise it would paste only the first line in either fields.
Update:
To be clearer about my answer, i found out that Notepad++ will let me only Paste once. That means, if i Copy a paragraph, i can paste it WITH its line break in the "find" field for example but if i paste it another time in the replace field, it will paste only the first line. Hence, no more than 1 "paste" operation is allowed into the Ctrl+H box in case i want to "paste" the line break.
So, in order for this to be done, first, i select any text i want and Ctrl+C on it, then, i go for the paragraph to be found, i just "Select" it and hit Ctrl+H: Notepad++ automatically shows the already selected text into the "find" field. Secondly, we "Paste" the text that's already in our clipboard into the "Replace" field. And the line breaks are here!
In brief: Select text --> Ctrl+C --> Select text --> Ctrl+H --> Ctrl+V in "replace field"
I think I found a guide that describes what you're looking for. The author has examples and the results, and some multi-line replacements are included. You should be able to extrapolate what he does over multiple files by clicking "Replace All in All Opened Documents".
http://markantoniou.blogspot.com/2008/06/notepad-how-to-use-regular-expressions.html

Sublime Text 2 - Problems with HTML automatic indentation

Every time I type an opening html tag (like <div>) then press the Enter key, the cursor automatically inserts an indention on the next line. However I don't want it to be indented since I still have to write the closing tag (actually I press the enter twice and write the closing tag in the third line so I can have an empty line in between). Now I have to press the back button to align the cursor with the opening tag.
I am aware of Sublime Text 2's autocomplete like when you type '<' and Ctrl + Space, a list
of available elements would appear. And when you select one item from the list, the editor would
provide you of both the opening and the closing tag. However, I'm not used to that kind of typing.
So is there a way to turn off this annoying feature of Sublime Text 2
You can disable auto-indentation by setting auto_indent to false.
In order to do this for the HTML syntax only, go to Preferences/Settings – More/Syntax Specific – User and insert the following contents:
{
"auto_indent": false
}
This will make the cursor to jump back at column 0 after hitting return.
To make it stay at the column of the opening tag, re-enable auto_indent and tweak the indentation settings in Packages/HTML/Miscellaneous.tmPreferences. If you aren’t into regular expressions, try to get rid of this file completely.
You can also just type the closing </div> tag and sublime text will automatically un-indent it for you.