I'm just trying out Atom for the first time and I find it bothersome that Atom keeps opening a new window for each file I click on - I'd prefer that it defaulted to opening each file in the same window.
I'm hoping for something along the lines of "open_files_in_new_window" : false, in Sublime. Unfortunately, all the google results I'm seeing just lament that this toggle is not immediately obvious.
In your terminal you can type atom -a <filename||folder> and the file(s) will open within the same atom window.
Go to Settings > Packages, look for the tabs package. In the settings for this package, choose "use preview Tabs".
Per the atom -h command, one should open files with -n=false or --new-window=false argument passed so that they are opened in an existing window, e.g.
atom -n=false ~/Desktop/test.py
One could make atom -n=false an alias of atom in the ~/.bashrc or ~/.zshrc file, or one could edit the corresponding file in /home/<your username>/.local/share/applications so that the command it invokes is, for instance, /usr/lib/atom/atom -n=false %F.
Just in the editor window, drag the open tab by mouse onto the window you need.
Related
I use sublimetext3 to program C++.
I use multiple window splits with multiple files open.
Sometimes I use alt+o hotkey / switch_file command to open the associated header/source file.
If I hit switch_file command and the matching header/source is already open in the same sub window split, it will jump to that tab instead of reopening the file.
But if I have a header open in one sub window split, and the source open in another sub window split, and I do switch_file command, it will open another copy of the file in the currently focused window.
Is there a way that I can set it to jump to the file even if it needs to focus another window split?
Thanks
I think the easiest way to establish this is to change the switch_file command.
Install PackageResourceViewer and type PackageResourceViewer: Open Resource, select Default and then open switch_file.
In line 41 just change
self.window.open_file(new_path, flags = sublime.FORCE_GROUP)
to
self.window.open_file(new_path)
and save the file. This will not overwrite the existing file (which is in a zip folder), but create a file, which shadows the original file.
Just getting started with Vim and am writing a basic HTML file. In SublimeText you could just right click and open in browser, but i'm having trouble finding how to do the same with Vim. I have Ubuntu and I want to preview the code in Chrome.
Thanks!
You can use :! to execute external commands within vim (see :help :!). The % sign in an :ex command expands to the current file name (see :help :_%). That being said, you can use the following to first save the file and then open it in the browser of your choice
:w|!google-chrome %
If you'd rather use firefox or chromium, use firefox or chromium, respectively, in place of google-chrome. If you're on mac or linux you could also use the open or xdg-open commands, respectively, to open the file in its default application. Don't want to type that out every time? Make your own command or mapping in your .vimrc.
command! ViewInBrowser :w|!google-chrome %
nnoremap <leader>b :ViewInBrowser<cr>
Is there a way to quickly open files in sublime text2?
At the moment I open files like this.
I open my terminal and enter
subl source/myproj/myfile.rs
Can I do this inside of sublime text2/3?
Also when I want to create a new file in source/myproj/ I usally press ctrl + n to create a new window and then I hit ctrl + s to save and name the file. The problem is when I hit ctrl + s my file system dialog opens and I have to use my mouse.
I think I saw someone using vim and he just could say source/myproj/mynewfile.rs and then the file would be created.
Is this possible in sublime text 2/3?
To quickly open a file in your current project, you can hit Ctrl+P and start writing the filename. This will sort through the files in your project and give you a little list, most likely the one you are looking for is pre selected, but if not, it is somewhere near the topmost options to select from, use arrow key down and highlight it, press enter and you just opened that file.
Another option to quickly create a file is using the AdvancedNewFile plugin.
When you hit Ctrl+n, it asks near the bottom of the window for a path and filename, once you enter it, it opens the new tab with the file already created, not an untitled file to later use system dialog to save to disk.
i usually edit files in sublime text 2 that can also be edited and compiled with another program. As i have them already opened in sublimetext i do the following:
right click and choose "copy file path" (to clipboard)
Win+R to open windows run dialog
CTRL+V to paste the file path
hit enter to open the file with the associated program
i wonder some shortcut can be configured so it automatically starts the opened file with its associate program
thanks in advance
This can be done. I was in a very similar situation using Sublime as my editor of choice over the default SAS program editor. I was able to use the win32com.client.dynamic.Dispatch module to connect to SAS via OLE and pass text from Sublime directly to SAS using Sublime's build system to call my plugin. Making the connection was the easy part, it was the other processing that I had to do which was the time consuming part, but since you want to pass just a file name or the entire contents of your file, this should be a fairly straightforward plugin. Since I do not know what program you wish to open, here is the code that makes my implementation work. Maybe you caan glean something out of this.
def send_to_sas_via_ole(selected_code):
from win32com.client.dynamic import Dispatch
sasinstance = Dispatch("SAS.Application")
# submit the lines to sas
for selection in selected_code:
# for some reason cannot send as one big line to SAS, so split into
# multipe lines and send line by line
for line in selection.splitlines():
sasinstance.Submit(line)
and then the call in the run method of my plugin class:
class RunSasMakoCommand(sublime_plugin.TextCommand):
def run(self, edit):
try:
send_to_sas_via_ole(selected_code)
except Exception as e:
print "\n".join(selected_code)
print "Couldn't connect to SAS OLE"
print e
Good luck!
Open 'regedit.exe';
Navigate to
HKEY_CLASSES_ROOT\Applications\sublime_text.exe\shell\open\command
correct the path. Exit 'regedit.exe'
(optional) restart 'explorer.exe' or reboot your PC.
enjoy :p;
Right click on the file, press "Properties". You will see Opens with SomeProgram and then a change button. Click on the change button, and then look through the list for Sublime Text, if you can't find it, you can choose an application using the file explorer, from there you can navigate to C:\Program Files\Sublime Text 2 and choose sublime_text.exe
I'm using IDE 10.5 Community edition.
In one project, I have multiple modules. I also have opened multiple tabs in the editor from different modules.
Is there a way to compare the content of two different tabs in the editor, which can be from different modules?
Select two files (with pressed Ctrl) in project view panel → Right Mouse button → Compare Files.
Right click on the file in project view → Compare With... (Ctrl+D)
If you have opened one file in editor you can navigate in project view to another file and press right mouse button on that file Compare with Editor.
It is possible to compare file against your clipboard content. View → Compare With clipboard
Also you can use idea as external diff tool idea diff file1.txt file2.txt
Outdated; Old verison of IntelliJ: Also you can compare files from 'Commander' tab, just select two files in right and left panels, right click on any of them → Compare two files
There is a plugin Compare Tab With Editor which may not have existed when this question was asked. I'm using it with IntelliJ 2017.2.
There is an updated version for IDE versions 2020.3 — 2022.1, Compare Tab With Editor 2.
One simple solution is the 'Compare with Clipboard' function (in your contextual menu - right click), which allows you to compare the contents of an editor tab with whatever is in your clipboard. As long as you can copy something, you can compare it against a file...
In 2019, select your file and "compare with editor" (which is your opened tab)
I use this to have a config file loaded in intelliJ (which is changed by the server, not stored in my project) and need to compare it to a baseline (in my project)