I would like to set up my iterm2 to open hyperlink file to pycharm on my mac. With default setting of iterm2, file is open by Xcode App and do some research online from this post open-file-on-intellij-from-iterm-2 and set up my iterm2 from Preferences/Profiles/Advanced/Semantic History -> Run command -> /usr/local/bin/charm \1 --line \2 or /Applications/PyCharm.app/Contents/MacOS/pycharm \1 --line \2. Neither of them works. How I can open file in Pycharm with a command + click in iterm2?
I was looking for the same thing in RubyMine. Turns out I just needed to associate .rb files with RubyMine in the Finder. No changes to iTerm config were needed.
Pick any .py file in Finder, and do Get Info (cmd-i) on the file. Under 'Open with:' pick PyCharm. You might have to first select 'Other...' and then you can pick PyCharm. Under that dropdown menu is a button that says 'Change All...', use that to associate all .py files, not just the one you initially selected.
Works like a charm (no pun intended) in RubyMine. The particular file I tried to open was already contained in a project that RM had opened, so it focused that project window, and opened that file.
Related
Every time I open a file from the terminal it opens the file in Xcode.
open hashing.md then Xcode opens. I don't want it to open in Xcode.
How can I make my terminal open files in Atom instead?
I'm on a Mac, Monterey, 12.1.
(I'm at the point where I just want to uninstall Xcode, but, who knows, I may need it in the future.)
I see this suggestion from someone, but I don't know how to do it. How do I "add the following to my ~/.bashrc file?" What does that mean? Where is my ~/.bashrc file and how do I add to it?
Add the following to your ~/.bashrc file:
export EDITOR="/Applications/TextEdit.app/Contents/MacOS/TextEdit"
Open finder and look for a file with the extension you want to open using atom, ".md" for example.
Right click on it and go to "Get info". You should see an "Open With" tab. Click on it, choose atom and click on the "Change all" button. That will make it the default option to open any ".md" file.
In case you just want to open a certain file with atom, use the -a flag with the open command.
~% open -a atom file.md
I'd like to be able to right click a folder in finder then choose an option on that menu to open it directly in sublime, including its full contents tree. This saves me the repetitive task of opening a terminal, manually navigating to the correct directory, then typing subl .
I followed the instructions here (2012) but it doesn't seem to work for me on the current version of OS X.
I followed the method here:
https://gist.github.com/vincentmac/6703537
and it worked for me.
I had to include willcharlton's correction as well:
/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl -n "$#"
Also -n allows you to open it in a new sublime window, -a allows you to add to existing sublime window.
When Iterm2 shows a file name and line number in Mac OS X, can I ⌘-click on the file and have it open in an already open window in Visual Studio Code and position the cursor at the correct line number.
(Asking this question to document the solution)
It looks like you can just select "Open with editor..." in advanced settings > semantic history now
UPDATE - see the newer accepted answer by #csilk for more recent solution
It turns out you can, though it is not entirely obvious.
Go to Iterm2 Preferences > Profiles > (chosse the profile) > Advanced, then in the Semantic History section choose: Run Command, and enter the following:
/usr/local/bin/code -g \1:\2
If that appears to open in a new window then also try changing your Visual Studio Code settings by adding the following to your settings.json, press ⌘, and add in the right hand pane add:
"window.openFilesInNewWindow": false
EDIT - as mentioned in the comments by #BenjaminPasero adding -r to the command line will also force the file to be opened in the last active Code window, e.g.:
/usr/local/bin/code -r -g \1:\2
As an alternative solution you may still use the default configuration of iTerm2 (open files with default app) but adjust the default app for file itself in MacOS.
File -> Get Info -> Open with: ->
and set your app in combobox (also changes may be applied to all type like the following one)
I did not find the configuration in iTerm2 to set the default editor.
However, it turns out there is another solution.Check out the image below.
set default app for *.js file
I'm using iTerm2 and RubyMine in Mavericks.
In iTerm I can open a file from error message by clicking file name with Command key.
But somehow the .rb file is opend SublimeText.
I changed association of the file to RubyMine in Finder.
(Select a .rb file` -> Open Menu -> Open File with: RubyMine -> All type of files are opend same Application)
But it seems to be valid only in Finder.
How can I configure so that I can open .rb file by RubyMine from iTerm?
If you want to open the file on the given line, you can use the second parameter in Semantic History settings of iTerm2. The line number should be passed as the --line parameter to rubymine:
path_to_rubymine --line \2 \1
See Rubymine and iTerm2 help for more info.
Go to iTerm2 > Preferences > Profiles > Advanced.
Under Semantic History
Change to Run command... with the value open \1
On Ubuntu Sublime Text 3 has the option to "Open Folder..." to keep a folderstructure in the sidebar. All Subfolders are shown whenever I open ST3. BUT on Mac this option doesn't exist. I can say "Open File..." and select that folder which keeps it inside the sidebar but only for the current session. After I restart the Program my Sidebar with all its folders from the last time is gone.
Is there some way to fix it? Is it a bug or an non-existent feature on Mac?
Go to Sublime Text - Preferences - Settings User
Then add this code:
{
"hot_exit": true,
}
Hit CMD+Q (Quit the app)
Start after few seconds. That worked for me