windows环境下emacs的python简单配置

首先参考了上一篇《emacs极简配置》,我的想法是打开兼容vim的viper到5级,然后一些基本的字体设定,然后如何执行python文件的一个全过程方法。

1、先打开emacs,如果忘了怎么用了,看一下自带的教程,还是中文的,超级方便。

2、学完后,键入 C-x C-f 并按~,这样就会打开默认的配置文件所在的目录。

3、在 .emacs.d 目录中建立文件 init.el viper 两个文件,内容如下:

init.el

(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(default ((t (:family "Consolas" :foundry "outline" :slant normal :weight normal :height 158 :width normal)))))
(setq package-archives '(("gnu" . "http://mirrors.ustc.edu.cn/elpa/gnu/")
                         ("melpa" . "http://mirrors.ustc.edu.cn/elpa/melpa/")
                         ("nongnu" . "http://mirrors.ustc.edu.cn/elpa/nongnu/")))
(package-initialize)
(icomplete-mode 1)
(ido-mode 1)
(setq make-backup-files nil)
;;(menu-bar-mode 0)
(setq viper-mode t)
(require 'viper)
(setq global-unset-key "\C-u\C-x")

viper

(setq viper-inhibit-startup-message 't)
(setq viper-expert-level '5)

4、安装python,并在cmd窗口使用 python --version 查看是否有效现实版本信息。

5、用C-x C-f 打开 t.py 文件,编辑一些python代码,在对应的cmd窗口,用python t.py显示输出结果。

posted @ 2023-04-25 11:55  立体风  阅读(218)  评论(0)    收藏  举报