Git Product home page Git Product logo

topsy.el's Introduction

topsy.el

This library shows a sticky header at the top of the window. The header shows which definition the top line of the window is within. It’s intended as a simple alternative to semantic-stickyfunc-mode. It’s especially helpful when, for example, browsing a list of occur results: when a line is in the middle of a definition, and the top of the definition is beyond the top of the window, topsy shows what definition the line is in.

Mode-specific functions may be added to topsy-mode-functions.

NOTE: For Org mode buffers, please use org-sticky-header.

Screenshots

images/screenshot.png

Contents

Installation

MELPA

If you installed from MELPA, you’re done. Just run one of the commands below.

Quelpa

The recommended way to install is with quelpa-use-package, like this:

;; Install and load `quelpa-use-package'.
(package-install 'quelpa-use-package)
(require 'quelpa-use-package)

(use-package topsy
  :quelpa (topsy :fetcher github :repo "alphapapa/topsy.el")
  :hook
  (prog-mode . topsy-mode)
  (magit-section-mode . topsy-mode))

Manual

Put topsy.el in your load-path, then:

(require 'topsy)

(add-hook 'prog-mode-hook #'topsy-mode)
(add-hook 'magit-section-mode-hook #'topsy-mode)

Usage

Run command topsy-mode. You may add it to appropriate hooks, such as prog-mode-hook and magit-section-mode-hook.

Tips

  • You can customize settings in the topsy group.

Changelog

0.1-pre

Not yet tagged.

Development

Bug reports, feature requests, suggestions — oh my!

There is currently only one function in topsy-mode-functions, one which returns the line that beginning-of-defun goes to. It should be useful in many major modes, but suggestions for additional, mode-specific functions are welcome.

License

GPLv3

topsy.el's People

Contributors

alphapapa avatar josephmturner avatar aspiers avatar

Stargazers

EGmux99 avatar Stefano Marton avatar Jordan Ellis Coppard avatar Abdelhak Bougouffa avatar P M avatar Tuan Duc Tran avatar Ben Whitley avatar  avatar Ming-Long Huang avatar vbommana avatar Christian Tietze avatar paramtapm.ai avatar  avatar Sergey Makarov avatar Tomoya Otake avatar roife avatar Semen avatar  avatar Jack Minster avatar Ivan Korostelev avatar Daniel Perez Alvarez avatar Space avatar enzu.ru avatar Arialdo Martini avatar Yiorgos Michokostas avatar Tobias avatar Bruno Bigras avatar  avatar Eliza avatar Conscat avatar Zelos Prapas Alkiviadis avatar ROCKTAKEY avatar Makoto Shimabukuro avatar Laurynas Biveinis avatar Akira Tamamori avatar Jumpei KAWAMI avatar Xavier Capaldi avatar Noel Errenil avatar Harrison Pielke-Lombardo avatar yqrashawn avatar  avatar Will B Chang avatar aq2bq avatar Charlie avatar Nelson Gonçalves avatar Kevin Smith avatar Eki Zhang avatar Lumos avatar toyboot4e avatar yibie avatar YI YUE avatar Anton Zavyalov avatar Thiago Lopes avatar Will Foran avatar Garrett Hopper avatar  avatar  avatar Yi Liu avatar Daniel Levy Moreno avatar Roshan Shariff avatar  avatar Cody Goodman avatar  avatar Justin Silverman avatar Samuel Culpepper avatar USAMI Kenta avatar Victor Borja avatar apple avatar Jessica Claire Edwards avatar Nasy avatar Merrick Luo avatar  avatar Dustin Lacewell avatar Kristofer Hjelmtorp avatar DarkBuffalo avatar Huy Giang avatar  avatar  avatar Daniel Kraus avatar  avatar Dan avatar  avatar Mr Unhappy avatar Fox Kiester avatar  avatar Skurikhin Alexandr avatar Akhil Wali avatar Yigit Emre Sahinoglu avatar Frederick Cai avatar  avatar Hayden Stanko avatar Keith Pinson avatar Ashton Wiersdorf avatar Clemens Radermacher avatar  avatar

Watchers

 avatar James Cloos avatar  avatar

topsy.el's Issues

HTML support

Hello! Long time no see. Awesome contribution to the community as usual.

I tried to use it with an html file, expecting the most recent opened tag to be displayed in the header line, however, it is not the case. It would be an awesome feature to have. Do you think it would be possible to implement it?

Thanks a lot for your work!

Comparison to which-func.el

You might want to mention in the README the package which-func.el, shipped with Emacs. It is based on imenu, so I believe it should support any major mode that supports imenu.

(My thinking is that which-func.el should probably also grow the capability to display the current function in the header-line.)

Thanks for the package!

Shows header even if top of window is not in a defun

This can be somewhat confusing, as the end of the defun the header refers to is not visible. I think it should look to see if it's in a defun, and if not, omit the header (or at least offer a defcustom for this behaviour).

Sometimes duplicates the top line

Sometimes the header is identical to the top line of the window immediately below it, e.g. it always happens at the beginning of a buffer:

image

I may have also seen it occasionally duplicate (defun ... lines elsewhere, but not at all sure about that - I can't reproduce, so it might simply have been another start-of-buffer case.

[Feature Request] Also keep outline headers on top

I think it would be so helpful when viewing lisp files to also have the option to keep headings on top, so that at a glance you get a full glimpse of the context of where point is. The top-level heading would obviously be on top, with any subheadings beneath, and finally the relevant function title last. This means the number of lines required at the top would fluctuate as you move through the file, which hopefully wouldn’t be too hard to implement. An example of how it might look would be:

;;; Custom Variables
;;;; Appearance Variables
(defcustom var

Thank you so much for this package, and all of your wonderful packages!

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.