美文网首页
Emacs安装配置及使用经验

Emacs安装配置及使用经验

作者: 一肩月光 | 来源:发表于2016-02-11 08:28 被阅读352次
type

一、安装

版本24.4

从零开始——Emacs 安装配置使用教程 2015

how to set XLIB_SKIP_ARGB_VISUALS=1 for specific applications

GTK bug:

  1. 修改,使命令输入emacs正常打开
    You can try adding these lines in your .bashrc file:
alias emacs='XLIB_SKIP_ARGB_VISUALS=1 emacs'
  1. 修改快捷方式,使单击图标正常打开
  • make a local copy of the emacs .desktop launcher
    cp /usr/share/applications/emacs24.desktop ~/.local/share/applications/
  • edit the copy, changing
    Exec=/usr/bin/emacs24 %F
    to
    Exec=/usr/bin/env XLIB_SKIP_ARGB_VISUALS=1 /usr/bin/emacs24 %F

版本24.3

上一篇


二、插件管理

安装的插件

  • markdown-preview-mode 在浏览器预览 markdown
  • markdown-preview-eww.el

插件配置

  • 启用 markdown 预览
    如出现 /bin/bash: /usr/local/bin/markdown: No such file or directory

安装markdown 渲染插件 Pandoc
或者 sudo apt-get install python-markdown
向 Emacs 配置文件添加路径

(custom-set-variables
'(markdown-command "/usr/bin/pandoc"))

参考资料

卸载插件

  1. The command package-menu-mark-delete
  2. (key 'd')
  3. followed by package-menu-execute (key 'x') worked for me.

三、操作技巧

ibuffer

  • C-x C-b进入 ibuffer 模式
  • ^ 返回上层目录
  • C-x C-q 进入编辑模式
  • C-x C-s 保存并进入命令模式
  • 命令模式下
    • d 标记为待删除
    • x 执行命令

光标移动

  • C-M-b 跳到对应括号
  • C-M-n 将光标移动到对应的右大括号
  • C-M-SPC 选中匹配括号包括的所有内容(光标停留在匹配括号处)。

选择

  • capsLock 大写锁定,从光标处开始选择

连接FTP服务器

  1. 进入Dire
  2. 输入ftp:name@host:
  3. 提示输入密码
  4. 连接成功!

分屏

C-x 3 水平拆分窗口

代码格式化

1、如果想要整理整个文件

M-x mark-whole-buffer  或者 C-x h    //选中整个文件
M-x indent-region 或者 C-M-\         //格式化选中

2、只是整理某个函数

M-x mark-defun 或者 C-M-h         //选中函数
M-x indent-region 或者  C-M-\        //格式化

四、卸载

  1. 彻底卸载
sudo apt-get purge emacsen-common emacs24-common emacs24-bin-common emacs24 xemacs21-mule xemacs21 xemacs21-support gettext-el emacs xemacs21-bin
  1. 清除所有
sudo apt-get update
sudo apt-get autoremove
sudo apt-get autoclean

相关文章

网友评论

      本文标题:Emacs安装配置及使用经验

      本文链接:https://www.haomeiwen.com/subject/yiqukttx.html