How to remove unwanted "extra line breaks" that appear in PHP/CSS/JS files after unzip? - unzip

Consider the following:
Zip up a folder, upload to server
unzip on server using 'unzip archive.zip'
Download any PHP file from that folder
Extra line breaks appear where unwanted
Any ideas why this happens or how to "undo it"?
I have tried to do a "find and replace" but that ends up basically minifying the entire file onto "1 line", which is not wanted either...
Examine the attached image here

For the sake of posterity: I found that I was able to use this tactic:
https://pixelflips.com/blog/removing-line-breaks-in-dreamweaver
Open the Find/Replace box (CMD+F / CTRL+F)
In the Find enter: [\r\n]{2,}
In the Replace enter: \n
Check the box "Use regular expression" and un-check any other boxes.
The hit "Replace All"
By using Adobe Dreamweaver, which works...
However, I am not going to make my own answer correct as I still wonder why this happens and want to prevent it if possible.

Related

File won't save as .css (sublime)

I'm new to web development and I'm just starting to learn CSS. I am having a problem where I can't get any of the styling to work. At first I thought I didn't link back to the style sheet correctly, but now I'm seeing that my css file isn't saving as .css. I keep going to save as, select .css and then I go back to look for it under that file type and it's not there. When I click on it to view the properties in the folder, for the type it just says "file". I've tried several times to save it again as .css and nothing. Does anyone know what could be going on here?
Edit: I tried to save it as HTML now and it wouldn't work either. Everything new I am saving is saving as a plain "file" now and I don't know why.
everytime you want to change the ending yourself, select "Save as", type the "file name + ending" and make sure always to check "Save as Type: All files".
You can also just type the "file name" and select the file type in "Save as Type: for example .css / .html"
Beginners' tip: If you are new to web development, I recommend the notepad. Every careless mistake that you notice here is golden for your future overall knowledge.

Show Full Path in Title Bar (adobe - brackets editor)

When a file is opened in brackets, the full path of the file should be shown in the Title Bar. At the moment, only the filename shows in the title bar, and I cannot find any option to turn on the full path.
This can be particularly dangerous when one is editing two files of the same name in different diferectories, but it is always useful to see the directory clearly at the top. The space is otherwise unused.
(I know that the path is displayed when I hover on the filename on the tab just above the code, but this means mucking about with the mouse when I am keyboarding, and is therefore a real nuisance)
There is a GitHub issue for that with an open PR you can watch

How do I disable the colored highlighting left of the line numbers in the Bracket Editor? What is it called/for?

See below for a screenshot of my brackets editor in a css file.
I see the colored highlighting for all file types. I am not sure what to call it.
I have been downloading extensions lately so it could be one of them but not sure what its called and thus can't search online for how to disable it.
Those colored marks are the "gutter marks" from the Brackets Git extension. They indicate added (green), modified (yellow/orange), or deleted (red) lines in the current file.
Personally, I find them very helpful. In case you still want to turn them off, go to the Git Settings and check the box for "Use Git gutter marks".

Default shortcut for Replace-Next in Atom?

Regardless of whether it were supposedly possible to customize this shortcut in the user preferences file (*) : is there actually a default shortcut for Replace/Replace-Next ? Following shows there is no hover-help on it:
(*) After many attempts I have never been successful for the keymap.cson to be respected by Atom. It just gets ignored. Thus I want to use whatever is the default binding for Replace[/-Next] .
No, there is no default shortcut for "Replace Next", only one for "Replace All" (ctrl+enter or ⌘+enter).
But there is a built-in command for it. Putting this in my keymap.cson file works for me:
'atom-text-editor':
'alt-cmd-e': 'find-and-replace:replace-next'
I found this example from here:
https://github.com/bronson/dotfiles/blob/master/.atom/keymap.cson
All of the default settings are here:
https://github.com/atom/find-and-replace/blob/master/keymaps/find-and-replace.cson
It sounds like you already know this, but just for reference, you can find your keymap.cson file by going to Settings (ctrl+, or ⌘+,), and clicking the "Open Config Folder" button.
If your keymap.cson is being ignored, I would start to diagnose the problem by commenting out everything except those two lines in order to see if another setting in keymap.cson is broken.

Alignment plugin in Sublime Text does not work with style.less (less file)

As the title, i can't find the way to make alignment plugin available with .less file. It's just work on CSS File
I haven't tested this yet, but I have a pretty strong hunch that it might help your case.
Open sublime text, and go to Preferences>Browse Packages
Look for the Alignment plugin folder and enter in it.
Look at the files in there, you will see:
Base File.sublime-settings
CSS.sublime-settings
Javascript.sublime-settings
JSON.sublime-settings
Try your hand at creating a LESS.sublime-settings file in there, copying the contents of another of the settings files, for example, the JSON.sublime-settings contains this:
{ "alignment_chars": ["=", ":"] }
It seems to me, that to enable alignment to work as expected with other filetypes not designed as default with the plugin, one would have to add this settings file to the plugin in order for it to work out.
I am not sure if the file name has to be case sensitive towards the syntax you want align to work with. If you installed the less package, you should see "LESS" shows up in the list as all caps, this is why my guess is to name the file LESS.sublime-settings. You can try different naming if it doesn't go at first...
Open any LESS file in Sublime Text.
Navigate to:
- Preferences
-- Package Settings
--- Alignment
---- Settings-Syntax Specific-User
Alternatively, if you're on a Mac hit Command+Shift+P and start typing 'Alignment' and the option will appear. Once clicked, an empty JSON file will be generated for you: LESS.sublime-settings
As EffectiX mentioned, just type in { "alignment_chars": [":"] } or whatever you want to align on. Save the file. This will work with pretty much any file format if configured correctly.

Resources