emacs配置
来源:互联网 发布:vue 引入iosselect.js 编辑:程序博客网 时间:2024/05/16 04:51
emacs configuration
emacs经过配置可以实现很多功能,我觉得这个配置的过程是使用emacs的一些内置的函数、变量作为接口,写一些函数,来实现自己想要的功能
elisp
配置emacs的编程语言是elisp 了解Elisp
emacs官方网站有专门的 emacs lisp user manual下载
emacs内置函数、变量
如果你要实现一个功能,这个算法当然是非常重要的,然而有时候在emacs中你想实现的一个函数可能只是很简单的一些逻辑,关键是要得到emacs中的信息来作为接口
所以了解emacs内置的函数、变量就非常重要
emacs内 C-h f(v) 查看函数(变量)的说明文档
一些简单的emacs内置函数、变量:
(buffer-name) ; 函数会返回当前buffer的文件名称(concat "str1" "str2") ; 函数会把 字符串str2的头接到 字符串str1尾
一些实用的emacs内置函数
光标位置
(point) ; 返回当前光标位置(point-max) ; 光标最大位置,即文件尾(region-beginning) (region-end) ; region的头和尾(buffer-end 1) ; 返回buffer结尾的绝对位置,无视narrow-to-region
移动光标
(goto-char 300) ; 移动光标到300(forward-char n) ; 向前移动n字符 后backward(skip-chars-forward "\n\t") ; 跳过所有 \n\t 返回移动的字符数
文本编辑
(delete-char 9) ; 删除光标后9个字符 (delete-region mystartpos myendpos) ; 删除选中的两点之间的文本(insert "Forza Inter") ; 在当前光标中插入一个字符串(length "ABC") ; 3(substring myStr startIndex endIndex) ; 获取一个子串(replace-regxp-in-string myRegex myReplacement myStr) ; 正则表达式替换
buffer相关
(buffer-name) ; 返回当前buffer的文件的名称 (buffer-file-name) ; 返回当前buffer文件的路径加上名称 (file-name-base) ; 返回当前buffer文件名称(没有扩展名) (file-name-nondirectory file) ; 返回file的名称(没有路径) (file-name-extension file) ; 返回file的扩展名 (file-name-sans-extension file) ; 返回file的路径加上名称,但是没有扩展名
to be continued... soon
0 0
- emacs配置.emacs
- emacs配置
- emacs 配置
- emacs 配置
- emacs配置
- Emacs配置
- Emacs 配置
- Emacs配置
- emacs配置
- emacs配置
- Emacs配置
- emacs 配置
- emacs配置
- Emacs配置
- emacs配置
- emacs配置
- emacs 配置
- emacs 配置
- JAVA 线程池
- Android中读取大图片到内存(利用Bitmap缩放)
- SocketChannel的read值为0
- PLM实施IC感悟
- 我是这样提高自己开发效率的(概要篇)
- emacs配置
- LocalM**维护笔记 && Android学习笔记
- 唯品会测试专员实习生面试
- .NET前后台的执行顺序
- Perl DBI 数据库操作
- uva - 11525 Permutation
- Oracle设计规范
- js中的call()方法理解和使用
- easyui 自定义toolbar