[英]Customizing emacs like pycharm IDE
I am newbie to Emacs. 我是Emacs的新手。 I mostly work in python (specifically twisted) & trying to configure it more like Pycharm IDE.
我主要使用python(特别是扭曲的)工作,并尝试更像Pycharm IDE进行配置。 I installed package
elpy
. 我安装了软件包
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).
我对pyflakes进行了调整,使其仅显示特定的错误(而不是显示PEP8规范中提到的所有错误)。 But I am trying to make it more like Pycharm.
但我正在尝试使其更像Pycharm。
Has anybody greater luck with this ? 有人有更大的运气吗? Why pycharm is so good in case of autocompletion and finding definitions/sources of functions/classes ?
为什么pycharm在自动补全和查找函数/类的定义/源的情况下如此好? Also Can we configure virtualenv in emacs ?
还可以在emacs中配置virtualenv吗?
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!. 我本人是新手,但由于背后的社区,我确实对
spacemacs
感到更幸运! And hopefully this is can be useful for those never used emacs before as well. 希望这对于以前从未使用过的emacs也是有用的。 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
) 如果我找到更多软件包来改善体验,我将进行更新,请访问github
spacemacs
(Google spacemacs refactor python code
)。
Final Result Should Have (Check the image at the end): 最终结果应该有 ( 最后检查图像):
CMi
) CMi
) Mx linum-mode
) Mx linum-mode
) Mx pyvenv-workon
) Mx pyvenv-workon
) Mx flycheck-mode
) Mx flycheck-mode
)
M-?
) M-?
) Table of Content : 目录 :
Note : 注意事项 :
commandline
(Windows) and Terminal
(Linux) as Terminal
commandline
(Windows)和Terminal
(Linux)作为Terminal
Mx
is to hold alt-key and x-key together Mx
将Alt键和X键组合在一起 Optional Stuff : 可选的东西 :
Prerequisites for Installing Spacemacs : 安装Spacemacs的先决条件 :
Emacs
(Version >= 24.5) Emacs
(版本> = 24.5) Git
Git
Installation of Spacemacs : 安装Spacemacs :
.emacs.d
folder to .emacs.d.bak
. .emacs.d
文件夹(如果有)重命名为.emacs.d.bak
。
%appdata%
%appdata%
Spacemacs
website, click on install
Copy the link provided. Spacemacs
网站,单击install
复制提供的链接。 terminal
, paste the link, press enter
terminal
,粘贴链接,按enter
emacs
emacs
By now you should see: Something like this 现在,您应该看到: 像这样的东西
vim
**, standard
(Spacemacs), heavy and full-feature
(Helm) vim
**, standard
(Spacemacs), heavy and full-feature
(Helm) tea
of your choice while spacemacs install some packages tea
以供选择
emacs
emacs
Prerequisites for Installing Python Layer : 安装Python层的先决条件 :
Installation of Python Layer : 安装Python层 :
emacs
emacs
Mx find-file
and open a python file Mx find-file
并打开python文件 emacs
emacs
.spacemacs
) in any text editor .spacemacs
) dotspacemacs-configuration-layers
and: dotspacemacs-configuration-layers
并执行以下操作:
auto-completion
, spell-checking
and syntax-checking
auto-completion
, spell-checking
和syntax-checking
;;
;;
in front dotspacemacs-additional-packages
and add the following between the brackets dotspacemacs-additional-packages
并在方括号之间添加以下内容
flycheck-pyflakes
terminal
, run pip install pyflakes
, in virtual environment of your choice terminal
,在您选择的虚拟环境中运行pip install pyflakes
emacs
and with for it to install some stuff emacs
并为其安装一些东西 Testing Python Layer : 测试Python层 :
Mx pyvenv-workon
and choose your prefered environment Mx pyvenv-workon
并选择您喜欢的环境 Mx find-file
and open a python file and make some errors Mx find-file
并打开python文件并出错 Mx linum-mode
to show line number Mx linum-mode
显示行号 def asdf4ninja(): pass
asdf4
asdf4
键入部分函数 It should autocomplete for you, otherwise auto-complete with anaconda CMi
它应该为您自动完成,否则使用anaconda
CMi
自动完成
CMi
is hold Ctrl
, Alt
and character i
CMi
按住Ctrl
, Alt
和字符i
In the same file, import hashlib
在同一文件中,
import hashlib
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 注意:错误检查和右下方的
py3.4
是我正在使用的虚拟环境
Final Note : 最后说明 :
M-?
to show documentation Mx pyvenv-workon
to choose environment on start Mx pyvenv-workon
在开始时选择环境 Mx linum-mode
to enable lines Mx linum-mode
启用线路 Summary : 总结 :
CMi
to auto-complete CMi
自动完成 M-?
to show documentation ()
to see the function signature ()
以查看功能签名 spacemacs
spacemacs
了解更多 You can add one more thing in your list 您可以在列表中再添加一件事
Automatic save - (add-hook 'focus-out-hook 'save-buffer)
自动保存-
(add-hook 'focus-out-hook 'save-buffer)
In case, your emacs slows down try (global-hl-line-mode -1)
in dotspacemacs/user-config
万一您的emacs减慢了
dotspacemacs/user-config
try (global-hl-line-mode -1)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.