How to open a different tab in same folder using sublime text or visual studio code? - sublimetext2

I use sublime text 3 and visual studio code, but i found that if i open a different file in same folder , it does not open a different tab, instead the new tab will replace the old tab. How do I get a file to open in a different tab in same folder ?

I'm not familiar with VSCode, but in Sublime, single clicking a file opens it in a semi-transient view for preview purposes. You can tell this is happening by the file name in the tab being italicized.
The reason for this is to allow you to quickly preview files for editing without having an excessive number of tabs open. So when you single click on another file, the existing preview tab is reused for the new file.
In order to commit the tab to being a "fully opened" file, you can either double click the file to tell Sublime that you want to edit it, or make a modification to the file in the buffer.
This is controlled by the setting preview_on_click, which is turned on by default. If you turn this off, single clicking files will not preview them, so you need to double-click files in order to open them.

In both editors, if you single click a file it remains in a single tab that is re-used by other single-clicked files. If you double click the file, it opens it in a new tab. At a glance, you'll also notice that the "single click tab" title is italicized, while the ones you double clicked are regular text.

Related

how can i directly open browser to view html file from vs code?

I write HTML and CSS code in VS Code and for previewing it I need to open file explorer then files then double click them to open them in my default browser.
it takes too much time. is there any proper way for this?
I have tried one live extension called live server but the problem with it is we have to click the 'go live' button any time I want to refresh the code.
If the live server extension is the one by Ritwick Dey..
.. then then after clicking Go Live, it will open your page in the default browser and reload it automatically, every time you save your work.
in some cases, it is helpful to save the folder containing your HTML to a Workspace, in VS Code, especially if you are writing an app using the MVC modal and the HTML and CSS are in subfolders.
You can install an extension called open in browser.
After installation complete restart vscode and go to settings Ctrl + ,. Search for Open-in-browser setting and set your default browser as you can see below:
Then whenever you edit a html file, you can use shortcut Alt + B to open this file in browser.

Sublime Text 2 Paste with Colors to MS Word

I would like to paste my code to a word document while preserving the highlighted, colored texts. Is there a way to do this?
You can install highlight plugin and then use SublimeHighlight: copy to clipboard as RTF command from the command palette.
If you want to use your own color scheme use ExportHTML plugin to export to html and copy and paste the html in MS Word.
HTMLExport can be configured to use any of your installed color schemes. just read the docs and look at the default settings.
Use a browser like Safari that can copy in RTF to the clipboard. For me chrome does not work.
My Answer here, is for people who Don't know how to install SublimeHighlight Package on Sublime Text 3:
Install Package Control inside sublime text 3. If you don't know how, follow this link here
Open the Sublime Command Palette by pressing CTRL+SHIFT+P` on Windows or ⌘+⇧+P on Mac
Type "Add Repository", and press enter
Then paste this link https://github.com/n1k0/SublimeHighlight/tree/python3
Press CTRL+SHIFT+P on Windows or ⌘+⇧+P on Mac again and type "Install package" and press enter or return
Type "Sublime highlight" and press enter to install the plugin
Restart your Sublime
How to Use SublimeHighlight
Highlight the Text you want to copy
Press CTRL+SHIFT+P
Type, for example, "SublimeHighlight: copy to clipboard as RTF: " like so:
Paste it in Word or Powerpoint, you will find the text has been pasted with coloring and formatting.
These are the commands you can use:
SublimeHighlight: convert to HTML: will convert current code to highlighted HTML in a new SublimeText tab.
SublimeHighlight: convert to RTF: will convert current code to highlighted RTF in a new SublimeText tab.
SublimeHighlight: view as HTML: will convert current code to highlighted HTML and open it in your default browser.
SublimeHighlight: view as RTF: will convert current code to an RTF document and open the generated file with your default program.
SublimeHighlight: copy to clipboard as HTML: will convert current code to highlighted HTML and store it into the system clipboard.
SublimeHighlight: copy to clipboard as RTF: will convert current code to raw highlighted RTF and store it into the system clipboard.
Customizing the Theme (OPTIONAL):
go to Preferences --> Package Settings --> SublimeHighlight --> Settings-User.
paste this code
{
"theme": "fruity",
"linenos": "inline",
"noclasses": true,
"fontface": "Menlo"
}
Here, I have used the "fruity" theme, you can choose whatever you like. These are all possible themes:
Set Hotkey (OPTIONAL)
In the next code, I have set the CTRL+ALT+C to copy the text with formatting, you can do that following these few steps:
Go to Preferences --> Key Bindings-User.
Paste this code:
{ "keys": ["ctrl+alt+c"],
"command": "sublime_highlight",
"args": { "target": "clipboard",
"output_type": "rtf"
}},
`
Now whenever you copy a text with CTRL+C, it will be copied without formatting and with CTRL+ALT+C, it will be copied with coloring :)
The SublimeHighlight plugin does work well! But as Jorre noted, code can lose some colors. I found that the selection you are copying to the clipboard matters.
When, for example, I select a portion of a CSS stylesheet, but the selection does not include the closing style tag, the colors will be lost. It appears that any incomplete element will be copied to the clipboard as white text.
My solution has been to simply copy the entire code file to the clipboard as RTF, paste into Word, then make the selection there for further copy / pasting into a PowerPoint slide or elsewhere.

How to prevent Sublime Text 2 from opening iA Writer .md files?

Sublime Text 2 on Mountain Lion always makes itself the preferred app to open .md files. I use iA Writer for my programming notes which saves files as .md.
Every time when I right-click "Open As…" and select the "Always with this app" option and then select iA Writer from Applications folder, it reverts back to Sublime Text.
Even when Sublime Text is not even running. I found no options to teach Sublime Text or the OS which files to open with which program.
I need iA writer for my programming notes because of the larger font. It helps me think sharper. So it is programming related. Also when I work in Sublime Text for code I like the clear separation of notes taking and coding.
In Finder, right-click (or Ctrl-click) on a .md file and select the Get Info option. In the window that pops up, select iA Writer from the Open with: dropdown menu, then click the Change All button just below it. Confirm the dialog that pops up, and now all Markdown files should be associated with the correct app. The association may change upon updating Sublime or installing the beta of ST3, but it's easy enough to change back.
The reason your previous action wasn't working was because you were only associating that particular file with iA Writer, not all .md files.

Can Dreamweaver open .manifest files?

Is there any way to edit .manifest files with Dreamweaver (CS 6)?
I have a HTML 5 page, with a lot of files connected to it. The manifest sometimes needs to change, or I have to give an update online.
This is not possible with Drwamweaver. When I doubleclick the file, Dreamweaver alerts me that there is no valid editor for this extension. When I doubleclick the file in Explorer, it just opens with Notepad++.
You need to let Dreamweaver know that you want to open .manifest files in code view.
Go to Edit > Preferences
and choose category File Types / Editors
In the input field "Open in code view" you add ".manifest" as a file extension.
Click OK to save your preferences.
Double clicking a *.manifest file will now result in Dreamweaver opening the file in code view.

Is there a way to export code to HTML in Eclipse?

I know NetBeans has this feature, but I can't find it in Eclipse. A quick search for plugins was not successful.
Java2Html - Eclipse Plugin:
Convert files:
Select items in the Package Explorer, Navigator or other views and right click to open the context menu. There is a Java2Html menu item that opens the conversion dialog.
Convert text from a text editor:
Right click on an editor and choose the Java2Html context menu item to convert the current selected text.
Adjust preferences:
Colors, tab size, etc. for conversion can be adjusted on the preference pages (Menu "Window" - "Preferences" - "Java" - "Java2Html")...
Hackish way:
On Windows at least, when you do Ctrl-A (Select all), Ctrl+C (Copy) what actually gets copied to the clipboard is formatted text (with all the colors and fonts). Then you can paste (Ctrl-V) it to something that can accept formatted text, say Microsoft Word or even Wordpad and save it to whatever format you wish.
The Copy as HTML eclipse IDE plugin allows us to directly copy our
code as HTML and paste it to our blogs or forums without any
formatting.
Download Copy as HTML eclipse plugin
Steps to install the plugin:
Download the Copy as HTML eclipse plugin
Copy it to the 'dropins' folder of your eclipse installation
If 'dropins' folder is not present then copy it to the 'plugins' folder of your eclipse installation
Restart eclipse IDE
That's it
Steps to Use
Select the code or text to be copied
Select 'Copy as HTML' option or press 'cntrl+shift+3'
Paste it your superb blog
Taken from here:
http://java-sample-program.blogspot.hu/2012/12/copy-as-html-eclipse-plugin.html