Giter Site home page Giter Site logo

longer-jump's Introduction

hst-mode --- Go back to last cursor positions in Emacs

A workable solution to going back'' in Emacs. All IDEs (and even Vim/evil) have ways to go back to the last place'' (cursor position) you were at.

This only works for the local bufffer. You won't jump around to different buffers, windows, and frames by hitting the back button.

Installation

Just put hst-mode.el into your LOAD-PATH; e.g.:

$ curl https://github.com/hackharmony/longer-jump/blob/master/hst-mode.el > ~/.emacs.d/lisp/hst-mode.el

Then add this to your ~/.emacs:

(add-to-list 'load-path "~/.emacs.d/lisp/")
(require 'hst-mode)

;; only if you want this to be enabled everywhere!
(global-hst-mode 1)

;; otherwise you need to do M-x hst-mode on a per-buffer basis or something like…
(add-hook 'text-mode-hook #'hst-mode) ;; track history when writing text
(add-hook 'prog-mode'hook #'hst-mode) ;; track history when writing code

Usage

M-x hst-mode in a buffer you want to use this in.

Default keybindings are ⌘-[ to go back in history and ⌘-] to go forward. Change them like this:

(define-key hst-map (kbd "C-}") #'hst-mode--go-forward)
;                   ^^^^^^^^^^^ or anything you want
(define-key hst-map (kbd "C-{") 'hst-mode--go-back)
;                   ^^^^^^^^^^^ or anything you want

Customizations

A number of things can be customized. M-x customize-group hst to see the full list.

  • hst-mode-max-history-entries --- How many entries you want to be remembered
  • hst-mode-threshold-lines-moved --- How many lines you need to approximately move before a new history entry is registered

longer-jump's People

Contributors

proprietary avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.