Emacs Enchantment Chapter-Making Python IDE

Source: Internet
Author: User

Tagged with: GitHub lisp scheme


Individual armed configuration compared to rubbing. I hope the great God is correct.

We're going to go here and collect the hero. Props--Hao Tian Ta emacs for windows:http://ftp.gnu.org/gnu/emacs/windows/

I'm using the underworld version 24.3.


release the psychic pressure of Emacs and unzip it in the directory you need, in the generated bin directory, click Addpm.exe,

The ". Emacs.d" subdirectory is produced under the "C:\Users\Administrator\AppData\Roaming" directory.

Then in the extracted Bin directory, click Runemacs, you can see the Hao Tian Tower appeared!



in order to test out the ". Emacs" configuration file, where is this doer hiding, so let's configure the interface style of Emacs at random, scrambling its

I habitually use the "Courier New Bold 12th" font, so first set the default font under Opition, then be sure to save opitions.

Then I found that the buffer below Emacs had. The hiding-place of the Phantom of Emacs:



Then open it with Notepad or some other artifact, and you'll see these scribblings, which are said to be a relic of the ancient race called Lisp,

As to what it was about, who made it:


But this time the artifact Hao Tian Tower emacs appearance seems not very harmonious, a little scary,

To set the length width, add the following mantra in the. Emacs Configuration file:

(setq default-frame-alist ' (height. 20) (width.) (menubar-lines)))


Under the C:\USERS\ADMINISTRATOR\APPDATA\ROAMING\.EMACS.D directory,

Create a Plugins subdirectory (Auto-save-list is automatically generated without the need to control it).



First configure the ECB, the artifact is used to browse the file, that is, to browse the code of the three realms of sentient beings,

The ECB needs to use the Cedet as a sacrifice, but the underworld version of the 24.3 built-in Cedet, so you do not have to explore the ruins of Cedet:

Go to three treasure Hall: HTTPS://GITHUB.COM/EMACSMIRROR/ECB Download ECB,

Under the plugins directory, create the ECB subdirectory and release the ECB's psychic pressure inside:



In the. Emacs configuration file, write the following mantra and save:

;;;;;;;;;;;;;;;;;;;;; Begin the ECB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(Add-to-list ' Load-path "~/.EMACS.D/PLUGINS/ECB")
(Require ' ECB)
(setq ecb-auto-activate T
Ecb-tip-of-the-day Nil)
;;;;;;;;;;;;;;;;;;;;; End ECB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


Then summon Hao Tian Ta emacs to see this interface when it proves that the ECB is well configured:



But this time the ECB is more stubborn, not very co-ordination, such as with the left mouse click some files will not open, so need to read the mantra, re-transform:

m-x ecb-customize-most-important  

(m-x in Windows is press ALT + x, and then enter in the buffer below ecb- customize-most-important )

will see this ghost, and then select primary:mouse-1, secondary:mouse -2, finally remember to save, found that the left mouse click can be used :


OK, first off Emacs .... Our artifact has to rest.


Summon Yasnippet This zombie below: This zombie has the black magic of making code templates.

Of course, we'll have to go to the magic Nest, GitHub, to explore: Https://github.com/capitaomorte/yasnippet,

Then, after creating the Yasnippet subdirectory under the plugins directory, release the Yaoqi of Yasnippet :


In the. Emacs configuration file, write the following spell to summon the Yasnippet ghost:

;;;;;;;;;;;;;;;;;;;; Begin yasnippet;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(Add-to-list ' Load-path "~/.emacs.d/plugins/yasnippet")
(Require ' Yasnippet)
(Setq yas/prompt-functions
' (Yas/dropdown-prompt yas/x-prompt yas/completing-prompt
Yas/ido-prompt yas/no-prompt))
(Yas/global-mode 1)
(yas/minor-mode-on)
;;;;;;;;;;;;;;;;;;;; End yasnippet;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

OK, call Emacs again, create a new test.py file, and you'll find Yasnippet as follows:



to rectify elpy, say this ghost is a demon-catching division Orange Moon/away from Snow help me catch it back.

according to the Demon Treasure Book: Elpy's Magic value than Auto-complete + pymacs + pyrope + ropemacs + pycomplete These monsters add up to high.

But before you do, you have to collect four python artifacts! Let's read the curse together:

Pip Install rope

Pip Install Jedi

Pip Install Flake8

Pip Install Importmagic

OK, after the cast, open the. Emacs configuration file and add the following code

(Require ' package)
(Add-to-list ' package-archives
' ("elpy". "Http://jorgenschaefer.github.io/packages/"))

Then open the Hao Tian ta emacs:

write the mantra: m-x package-refresh-contents ,

press ENTER before entering: m-x Package-install ,

ENTER after return elpy

Since elpy is the Great devil, it takes a little time to wait 1 minutes to suppress it with Hao Tian Tower.

And then found the. EMACS.D directory under the ELPA subdirectory, there are many more messy monsters, you can first ignore.



Delete the code from the. Emacs Configuration File

(Require ' package)
(Add-to-list ' package-archives
' ("elpy". "Http://jorgenschaefer.github.io/packages/"))

and add the following code:

;;;;;;;;;;;;;;;;;;;;;;;;; Begin elpy;;;;;;;;;;;;;;;;;;;;;;;;;
(package-initialize)
(elpy-enable)
;;;;;;;;;;;;;;;;;;;;;;;;; End elpy;;;;;;;;;;;;;;;;;;;;;

Restart Emacs, create a python file, enter keywords to find hints, including functions in the library:


Yasnippet this time can also be used, input keywords, such as input class after the press ENTER,

When the elpy tips disappear, press the TAB key to do so.



Press CTRL + X 2 to appear in two edit areas, press CTRL + C,ctrl + C,python in the upper edit area to execute the code below.

But the inside of the goods is a bit ugly, integrated Ipython bar.

First read the mantra Pip install Ipython.

After that, edit the following spells in the. Emacs Configuration file:

;;;;;;;;;;;;;;;;;;;;;;; Begin python;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(Require ' Python)
;; Use Ipython
(setq python-command "Ipython")
(setq
Python-shell-interpreter "Ipython"
Python-shell-interpreter-args ""
Python-shell-prompt-regexp "in \\[[0-9]+\\]:"
Python-shell-prompt-output-regexp "out\\[[0-9]+\\]:"
Python-shell-completion-setup-code "from IPython.core.completerlib import Module_completion"
Python-shell-completion-string-code "'; '. Join (__ip.complete ("'%s '" p)) \ n "
Python-shell-completion-module-string-code "")
(Add-hook ' Python-mode-hook
(Lambda ()
(set-variable ' Indent-tabs-mode nil)
(Define-key python-mode-map (kbd "RET") ' Newline-and-indent)] )
;;;;;;;;;;;;;;;;;;;;;;;; End python;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


Restart Emacs, edit Python again to find support for auto indent, and run again to see Ipython:



As to why the front will appear in[1], in[2], in[3] Such a strange repl hint,

It is the time of elpy, or any other reason has not been verified.


But between Flake8 this eight will constantly prompt you code has a problem, you can choose to fry it squid:

Select the configuration in the elpy (wait a moment for it to appear)

Change the python check command's Flake8 to nil (although it is not known that this is not true, but it works).



Well, actually not finished, first so much.




Emacs Enchantment Chapter-making the Python IDE

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.