Emacs中的前进后退jump-tree

.title { text-align: center }
.todo { font-family: monospace; color: red }
.done { color: green }
.tag { background-color: #eee; font-family: monospace; padding: 2px; font-size: 80%; font-weight: normal }
.timestamp { color: #bebebe }
.timestamp-kwd { color: #5f9ea0 }
.right { margin-left: auto; margin-right: 0px; text-align: right }
.left { margin-left: 0px; margin-right: auto; text-align: left }
.center { margin-left: auto; margin-right: auto; text-align: center }
.underline { text-decoration: underline }
#postamble p,#preamble p { font-size: 90%; margin: .2em }
p.verse { margin-left: 3% }
pre { border: 1px solid #ccc; padding: 8pt; font-family: monospace; overflow: auto; margin: 1.2em }
pre.src { position: relative; overflow: visible; padding-top: 1.2em }
pre.src::before { display: none; position: absolute; background-color: white; top: -10px; right: 10px; padding: 3px; border: 1px solid black }
pre.src:hover::before { display: inline }
pre.src-sh::before { content: "sh" }
pre.src-bash::before { content: "sh" }
pre.src-emacs-lisp::before { content: "Emacs Lisp" }
pre.src-R::before { content: "R" }
pre.src-perl::before { content: "Perl" }
pre.src-java::before { content: "Java" }
pre.src-sql::before { content: "SQL" }
table { border-collapse: collapse }
caption.t-above { caption-side: top }
caption.t-bottom { caption-side: bottom }
td,th { vertical-align: top }
th.right { text-align: center }
th.left { text-align: center }
th.center { text-align: center }
td.right { text-align: right }
td.left { text-align: left }
td.center { text-align: center }
dt { font-weight: bold }
.footpara:nth-child(0n+2) { display: inline }
.footpara { display: block }
.footdef { margin-bottom: 1em }
.figure { padding: 1em }
.figure p { text-align: center }
.inlinetask { padding: 10px; border: 2px solid gray; margin: 10px; background: #ffffcc }
#org-div-home-and-up { text-align: right; font-size: 70%; white-space: nowrap }
textarea { }
.linenr { font-size: smaller }
.code-highlighted { background-color: #ffff00 }
.org-info-js_info-navigation { border-style: none }
#org-info-js_console-label { font-size: 10px; font-weight: bold; white-space: nowrap }
.org-info-js_search-highlight { background-color: #ffff00; color: #000000; font-weight: bold }
code { color: #FF0000 }
pre.src { background-color: #002b36; color: #839496 }

Emacs中的前进后退jump-tree

Table of Contents

  • 1. 效果
  • 2. 为什么开发这个插件?
  • 3. 特点
    • 3.1. 包含jump-list的所有功能
    • 3.2. 具有undo-tree的树形结构记录
    • 3.3. 增加命令移动的距离超过给定值时自动记录位置的功能
    • 3.4. 增加切换buffer或者文件时自动记录位置的功能
  • 4. 安装

1 效果

可以自由的跳转到不同的定义和文件中去,然后,再跳转回来。

2 为什么开发这个插件?

本人在使用Emacs的过程中,长期由于缺乏一个类似于Vim的前进和后退的功能而苦恼。搜索了各种jump的实现方式,都总感觉欠缺了点什么。

直到发现jump-list,但是jump-list有时不太清楚到底发生了什么,特别是在阅读别人的代码的时候,经常要跳转到定义的地方去,然后,跳回来,继续往下读,然后再跳到新的定义里面去。但有时候,又想跳到刚刚的定义里面去。这时,由于跳回来之后后面的记录把前面的记录会抹掉,所以,肯定是到不了前面那个定义中去的。

由于,经常使用undo-tree来做一些后退和恢复的操作,发现它的树形记录,可以记录所有的操作历史。任意的状态,总是可以后退回去的。这个在进行反复操作的时候,非常有用。如果发现有什么地方不对,马上打开可视化的界面,进行后退,如果有分支的话,可以进入分支进行查看。于是,想能不能把这两个结合起来。然后,就开发了这个jump-tree插件。

3 特点

3.1 包含jump-list的所有功能

可以根据设定的command列表,只要这些命令执行时,就记录一个位置点,用于后退和前进。

3.2 具有undo-tree的树形结构记录

采用树结构可以用来保存所有的历史位置。我们可以跳转到所有之前记录的位置。

3.3 增加命令移动的距离超过给定值时自动记录位置的功能

当命令移动的距离超过设定值时,记录一个位置点用于后退。比如,翻页,跳转到函数头、函数尾等。这些也可以使用前面的命令列表来实现,默认,命令列表的优先级比这个要高一些。当没有设置命令列表时,只要移动距离比较大,也可以马上退回到之前的位置。

3.4 增加切换buffer或者文件时自动记录位置的功能

当我们的命令,会打开一个新的buffer或者文件时,会记录一个位置,可以跳转回去。

4 安装

  • 可以使用package-list-packages进行安装
  • 可以使用malpa进行安装:

    melpa/jump-tree

  • 也可以从github上直接下载安装:

    yangwen0228/jump-tree

    如果觉得好用也可以给项目点赞。^_^

Date: 2017-08-12 20:03

Author: WEN YANG

Created: 2017-08-12 Sat 20:35

Emacs 25.2.1 (Org mode 8.2.10)

Validate

时间: 2024-08-02 02:49:47

Emacs中的前进后退jump-tree的相关文章

在Emacs中使用GNU Global

背景 在我平时用Emacs编写C代码时,经常需要进行代码的跳转,主要需求为函数定义的跳转,某个具体函数的调用查找,某个结构体的定义跳转以及结构体中具体某一项的跳转等,GNU Global就能完全满足我的这个需求,所以习惯了Emacs的人可以将Source Insight扔开了. GNU Global简介 GNU Global全称为GNU Global source code tagging system,官方定义为GNU Global是一个可以跨越各种环境的代码标记系统,例如在Emacs,VI,

Emacs 中的coding system

.title { text-align: center; margin-bottom: .2em } .subtitle { text-align: center; font-size: medium; font-weight: bold; margin-top: 0 } .todo { font-family: monospace; color: red } .done { font-family: monospace; color: green } .priority { font-fami

Vim 中文件目录浏览插件——NERD tree

说明 :vim的插件NERDTree用于使得vim窗口分左右窗口显示的用法说明.其中,左侧为目录的树形界面,简称为NERDTree界面,右则为vim界面. 一.配置步骤 下载地址: http://www.vim.org/scripts/script.php?script_id=1658 或者 http://download.csdn.net/detail/caoyingsdhzcx/5752889 树形目录插件NERDTree的安装方法,如下: 1. 在当前用户文件夹(例如simpman)下,建

Emacs 中使用 shell

直接在 Emacs 中使用 shell 能增加一点效率.Emacs 本身支持的 shell 相关的命令很多,此处化繁为简,只用一条足够了. M-x shell:将打开一个名为 * shell * 的 buffer,之后可以像 terminal 中一样使用了. 效果如下,

在Emacs中生成LaTeX公式

苹果系统下面有个LaTeXiT软件,可以方便地生成LaTeX公式,然后拖拽到别的程序中直接使用.在Windows下这方面的工具就比较少了.不过如果装有CTeX中文套装和Emacs的话,倒不妨自己做一个简易的版本. 思路很简单:开一个Emacs buffer,编辑好公式,执行自编的texify函数调用相关命令生成dvi文件.然后再根据这篇文章中说的方法,对其进行适当的裁剪,并一次生成多种图片格式,以供其他程序使用.该函数如下: (defun texify () (interactive) (let

在Emacs中使用ECB(转载)

转自:http://joerong666.iteye.com/blog/1813876 By:             潘云登 Date:          2009-7-9 Email:         [email protected] Homepage:http://blog.csdn.net/intrepyd Copyright: 该文章版权由潘云登所有.可在非商业目的下任意传播和复制. 对于商业目的下对本文的任何行为需经作者同意. 写在前面 ECB代表的是“Emacs Code Bro

emacs中查询英汉字典

在用emacs查阅文档或上网的时候时常会遇到不认识的英文单词,若老是要切换到xdict查寻单词再切回emacs则显得太过繁琐.所幸,使用dict/dictd工具和dictionary.el可以实现直接在emacs中查询英文单词的释义. 1. 安装dict/dictd ubuntu下可以直接用apt-get安装 sudo apt-get install dict dictd 2. 安装英文-中文字典 sudo apt-get install dict-xdict dict-stardic 3. 安

Emacs 中使用中文插件 eim

在 Emacs 中输入中文,一般用 ibus 一类的输入法也能应付,但来回切换有点麻烦,这里介绍国人写的一个好插件 eim. - 安装 由于在 list-packages 中没有找到这个插件,所以不能自动安装,选择手动直接从 github 克隆,(为方便管理,手动安装的插件都放在 ~/.emacs.d/manual_plugin 底下) $ git clone https://github.com/viogus/eim.git ~/.emacs.d/manual_plugin/eim-maste

Emacs中自动刷新dired缓冲区

Emacs中自动刷新dired缓冲区 在dired模式中,如果在不同buffer间切换,buffer不会自动更新,有时还需要手工按“g”键,比较麻烦,如下设置和代码能够在buffer切换和执行shell命令后自动更新dired buffer: ;; 切换buffer后,立即刷新 (defadvice switch-to-buffer (after revert-buffer-now activate) (if (eq major-mode 'dired-mode) (revert-buffer)