Skip to content

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

float-narrow-indirect

A GNU Emacs package that provides floating window support for narrow-indirect operations. This package allows you to create floating windows containing narrowed regions of buffers, making it easier to view and compare different parts of a file.

Features

When working with multiple parts of a file in Emacs, traditional split-window layouts can make your screen cluttered. float-narrow-indirect offers an elegant solution - it allows you to “extract” selected text regions into independent floating windows.

./asset/float-narrow-indirect.gif

  • 🎯 Focus: Float important code snippets in separate windows to reduce visual distractions
  • 🔄 Flexible: Open multiple floating windows simultaneously for easy content comparison
  • 🎨 Clean: Floating windows without mode-line for a cleaner reading experience
  • ⚡ Quick: One-key focus toggle between main and floating windows
  • 🎛️ Customizable: Adjust window size, transparency, border color and more to your preference

Common Use Cases

  • Keep important paragraphs in floating windows for quick reference while reading long documents
  • View multiple related function implementations simultaneously during code refactoring
  • Compare differences between old and new versions while writing documentation
  • Keep critical code segments in view while debugging

Installation

Manual Installation

  1. Download float-narrow-indirect.el to your local machine
  2. Add the following to your Emacs configuration:
(add-to-list 'load-path "/path/to/float-narrow-indirect")
(require 'float-narrow-indirect)

Usage

  1. Select a region in any buffer
  2. M-x fni-narrow-to-region-floating to create a floating window with the selected region
  3. Use M-x fni-toggle-focus to switch between main and floating windows
  4. Use M-x fni-clear-aggregation to close all floating windows

Recommended Key Bindings

(global-set-key (kbd "C-c n f") 'fni-narrow-to-region-floating)
(global-set-key (kbd "C-c n t") 'fni-toggle-focus)
(global-set-key (kbd "C-c n c") 'fni-clear-aggregation)

Customization

You can customize the following variables:

;; Size of floating windows (width . height) as ratio of parent frame
(setq ni-floating-window-size '(0.3 . 0.5))

;; Border color for floating frames
(setq ni-floating-frame-border-color "gray50")

;; Transparency for floating frames (active . inactive)
(setq ni-floating-frame-transparency '(95 . 90))

;; Buffer name prefix and separator
(setq ni-buf-name-prefix "NI-")
(setq ni-buf-name-separator "::")

Contributing

Contributions are welcome! Feel free to:

  • Report bugs
  • Suggest new features
  • Submit pull requests

Acknowledgements

This package is developed by the narrow-indirect package.

License

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Author

Yibie

About

A GNU Emacs package that provides floating window support for narrow-indirect operations.

Resources

Stars

30 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages