I am newbie to Emacs. I mostly work in python (specifically twisted) & trying to configure it more like Pycharm IDE. I installed package elpy
. But still it doesn't work well in case of auto completion. Also it shows all errors in red color either they are errors or warnings. I tweaked pyflakes to show only specific errors ( instead of showing all errors mentioned in PEP8 specifications). But I am trying to make it more like Pycharm.
Has anybody greater luck with this ? Why pycharm is so good in case of autocompletion and finding definitions/sources of functions/classes ? Also Can we configure virtualenv in emacs ?
Any suggestions/resources/ideas will be welcome.
I am a newbie myself, but I did have more luck with spacemacs
, thanks to the community behind it!. And hopefully this is can be useful for those never used emacs before as well. I had hard time installing so I will make the guide very detail. I'll be updating this if I find any more package to improve the experience Read more at github spacemacs
(Google spacemacs refactor python code
)
Final Result Should Have (Check the image at the end):
CMi
) Mx linum-mode
) Mx pyvenv-workon
) Mx flycheck-mode
)
M-?
) Table of Content :
Note :
commandline
(Windows) and Terminal
(Linux) as Terminal
Mx
is to hold alt-key and x-key together Optional Stuff :
Prerequisites for Installing Spacemacs :
Emacs
(Version >= 24.5) Git
Installation of Spacemacs :
.emacs.d
folder to .emacs.d.bak
.
%appdata%
Spacemacs
website, click on install
Copy the link provided. terminal
, paste the link, press enter
emacs
By now you should see: Something like this
vim
**, standard
(Spacemacs), heavy and full-feature
(Helm) tea
of your choice while spacemacs install some packages
emacs
Prerequisites for Installing Python Layer :
Installation of Python Layer :
emacs
Mx find-file
and open a python file emacs
.spacemacs
) in any text editor dotspacemacs-configuration-layers
and:
auto-completion
, spell-checking
and syntax-checking
;;
in front dotspacemacs-additional-packages
and add the following between the brackets
flycheck-pyflakes
terminal
, run pip install pyflakes
, in virtual environment of your choice emacs
and with for it to install some stuff Testing Python Layer :
Mx pyvenv-workon
and choose your prefered environment Mx find-file
and open a python file and make some errors Mx linum-mode
to show line number def asdf4ninja(): pass
asdf4
It should autocomplete for you, otherwise auto-complete with anaconda CMi
CMi
is hold Ctrl
, Alt
and character i
In the same file, import hashlib
hashlib.
(Note the dot .
) You should see: Something like this
Note: The error checking and bottom right py3.4
is the virtual environment I am using
Final Note :
M-?
to show documentation Mx pyvenv-workon
to choose environment on start Mx linum-mode
to enable lines Summary :
CMi
to auto-complete M-?
to show documentation ()
to see the function signature spacemacs
You can add one more thing in your list
Automatic save - (add-hook 'focus-out-hook 'save-buffer)
In case, your emacs slows down try (global-hl-line-mode -1)
in dotspacemacs/user-config
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.