Reputation: 2109
If you give in the command "atom ." in the terminal, the Atom editor opens the current folder and I am ready to code.
I am trying to achieve the same with Pycharm using Ubuntu: get the current directory and open it with Pycharm as a project.
Is there way to achieve this by setting a bash alias?
Upvotes: 14
Views: 39201
Reputation: 1
I know this is way old but I just had to do this. I created an alias for pycharm in my bashrc file.
alias pycharm='pycharm.sh $(pwd)'
nesting the pwd command allowed me to use the current directory I am in.
Since jetbrains says to use
pycharm.sh /your/dir
source: https://www.jetbrains.com/help/pycharm/opening-files-from-command-line.html
Upvotes: 0
Reputation: 1512
open -na "PyCharm CE.app" .
worked for me in MacOS & PyCharm Community edition
Upvotes: 2
Reputation: 1
For me its:
pycharm.bat .
but I had to add an Environment Variable first using the path where pycharm.bat is located. In my case it was:
C:\Program Files\JetBrains\PyCharm Community Edition 2019.3.1\bin
(how to add an Environment Variable) Windows https://www.architectryan.com/2018/08/31/how-to-change-environment-variables-on-windows-10/
Ubuntu https://hackprogramming.com/2-ways-to-permanently-set-path-variable-in-ubuntu/
I'm using Pycharm Community Edition 2019.3.1 and for the life of me I couldn't find the "Command line launcher" everyone else is talking about so I had to resort to this method.
This was for Windows but hopefully it will give you some insight on figuring it out on Ubuntu!
Upvotes: 0
Reputation: 11916
PyCharm can be launched using the charm
command line tool (which can be installed while getting started with PyCharm the first time).
charm .
Upvotes: 18
Reputation: 363616
This works for me:
alias atom_pycharm='~/pycharm/bin/pycharm.sh .'
Maybe you installed it to a different path, though - locate
your pycharm.sh
file and modify accordingly.
You have the usual bash tricks: if you want to run in the background, append an &
, redirect stdout/stderr where you want etc.
Upvotes: 3