Hide one line in Sublime Text 3 - html

I have one line in a html file containing a base64 representation of an image. This line spans thousands of lines in the editor, which is a huge hassle when always scrolling past it.
Is there a good way in ST3 of hiding this line?

Select the text you want to hide, then from the Edit menu -> Code Folding -> Fold.
Note that folding is not stored in the session, and reopening the file or ST will display the text unfolded again.
You could also take a look at plugins designed to help you with this: https://packagecontrol.io/packages/Base64%20Fold

you can simply press ctrl+shift+{ and to revert back just press ctrl+shift+}

Related

VS Code: Auto-indent on tab press to match indentation of previous line

For comparison:
In Sublime (and also Atom), if I press tab under a line of code that already has 4 tab spaces, Sublime will automatically jump to the same tab spacing of the previous line (4 tab spaces).
In VS Code – when trying to accomplish the same thing – tabs will fail to 'jump' to the previous line's spacing, and force me to manually press tab multiple times, instead of once.
Is there a work-around, or am I missing something?
Sublime, Atom - 1x tab press
VS Code - 4x tab press
If you add this to your settings, you'll be able to just type out the line without watching indentation and whenever you hit enter, vscode will indent that previously written line automatically:
"editor.formatOnType": true
I know this isn't exactly what you're looking for, but I thought I might as well share and hope this is a satisfying answer.

Visual cue to know whether a file has unsaved changes in Sublime Text editor

I recently moved to Sublime Text 3 for development and trying to figure out a way in which I can know whether a file is saved or not just by looking at it in the editor. For e.g.
Eclipse puts a star in front of the file name if there are unsaved changes
Notepad++ changes the tab color as red
Is there any such easy to see visual cue in Sublime Text 3 to know if a file has unsaved changes?
By default Sublime Text displays dot (•) instead of x used to close tabs when there are unsaved changes.
You can make this highlighting of modified tabs even more distinctive using following property which causes modified tabs to have different color:
{
"highlight_modified_tabs": true
}
The color of modified tabs with this property enabled will depend on the theme you are using. If you want to change it, either change the theme or change the color manually in your settings. See this answer for more details on that.
In Sublime text there is a indication on the tabs, a full circle is not saved, a cross (x) is a saved file, indicating that you could close it.
Not saved file:
Saved file:

How to make a specific file always visible on the sidebar everytime I open sublime text 3

I switched from Notepad++ to Sublime Text 3 last week and I'm loving it. I know Notepad++ don't have a feature like this also, but is there a plugin or setting on Sublime Text 3 that I can use to make a file always visible on my sidebar every time I open it? I have a single text file that has some login info and useful note for my development and I want Sublime to remember to at least add a shortcut on that file on my sidebar so that I can access it anytime I want to.
I want workdocs.php to be always visible on my sidebar when every I open my Sublime Text 3. Thanks in advance!
It's not exactly what you want but you could try Sublime FavoriteFiles:
https://github.com/facelessuser/FavoriteFiles
It's ST3 compatible and works well. You can assign keyboard short-cuts to the various commands or use Control + Shift + P to access them quickly.

Move cursor across html tags in text editor

How can I move the cursor across HTML tags in a text editor like Sublime Text or anything else instead of pressing ctrl+arrow (not a direct move) keys so many times?
Is there any shortcut available?, if not, how can I create one for Sublime Text editor?
Here is how I want to move the cursor.
<html>
<p>
"a"
</p>
<div>
"b"
</div>
</html>
I want move the cursor from position a to b using a shortcut.
I'm not familiar with Sublime but I have heard that it's very similar to Textmate, it may actually be based on Textmate, I'm not sure.
I am familiar with Textmate 1.5 though, and it does have a feature like this which allows you to setup tab triggers and templates by using the built in Bundle Editor.
note: it's worth noting that there is a newer version of Textmate available. I believe the current version is 2.0 but I tried it and decided to stick with 1.5 because 2.0 implemented some major changes and I preferred to stick with what I was familiar and happy with.
A very basic example of how tab triggers can be used in Textmate would be..
<table border="0" cellpadding="$1" cellspacing="0"><tr><td height="$2"><table border="0" cellpadding="0" cellspacing="0"><tr><td></td></tr></table></td></tr></table>
This is a simple table spacer that I use in emails rather than using transparent shims. By nesting a table within a table it will prevent it from collapsing and works as a cross-compatible alternative to transparent gif images for email layouts.
By setting this up in Textmate, all I have to do is type tspace followed by a Tab and this code automatically populates at the position of the cursor. Subsequent Tab's will jump the cursor to each $ notation, which is Textmate's own syntax.
So tspace + Tab generates the code, + Tab jumps to $1 where I then fill in the appropriate value, + Tab jumps to $2 where I fill in the appropriate value + Tab jumps to the end of the code block.
note: you can also set it up where any placeholder is repeated so if I notate $1 in more than one location, it will automatically populate everywhere that variable is, the first time I fill it in.
This is only the most basic of examples. There are other similar features in Textmate, and they are only limited by how complex you set them up to be.
Though, as I mentioned, I'm not familiar with Sublime, I did look into it briefly and found this article which outlines the exact same functionality that I've described and how it works within Sublime.

Is there a Surround With for aptana studio plugin?

Is there some way to get "surround with" in the Aptana perspective in Eclipse like you have in the Java perspective. I would love to be able to surround text with html tags like eg: <div></div> with a keyboard shortcut. Is there some way of doing that with the snippets rubles?
Thanks,
You can do this with AutoHotKey, which has the added benefit of being available across all apps. I have a script which launches a 'surround' menu when I select some text and press CTRL+SHIFT+C
To use it, install AutoHotKey, and create a new .txt file with the following code, and replace the extension with .ahk
http://pastebin.com/48ipiXsG
At the top of the file you'll find a number of groups of items, in the following format
<h1>~<h1>##</h1>
the ~ character divides the name of the function and the function content. The bit before ~ is what appears on your menu, and after the ~ is the code. ## represents where your selected text will go. So if you select the text 'AutoHotKey' and press CTRL+SHIFT+C, and then select <h1> from the menu, it'll replace the with <h1>AutoHotKey</h1>
There are several menus in the script, set up to launch based on what app you press CTRL+SHIFT+C in. For example, I get different shortcuts if I'm in Visual Studio than if I'm in SQL Server. You can modify these easily enough, but the generic menu should work fine for you. Feel free to chop and change but you have to leave GENERIC at the top of the script.
PS: I use this script everyday, and there is one small bug. The script saves whatever you have in the clipboard in a variable, and then writes it back to the clipboard when it's done. Sometimes, instead of surrounding text it replaces it with whatever you had in the clipboard. This is easily undone with CTRL-Z and usually works the second time you try it. I've never been able to figure out what causes this, maybe some autohotkey heads can help out?
PPS : This script is based on some other scripts from the AHK forums, including this one
http://www.autohotkey.com/docs/scripts/FavoriteFolders.htm
So you may find comments that don't make sense. I've seen a few references to the middle click, as the script above uses the middle mouse button instead of CTRL+SHIFT+C.