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.
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.
- 🎯 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
- 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
- Download
float-narrow-indirect.elto your local machine - Add the following to your Emacs configuration:
(add-to-list 'load-path "/path/to/float-narrow-indirect")
(require 'float-narrow-indirect)- Select a region in any buffer
M-x fni-narrow-to-region-floatingto create a floating window with the selected region- Use
M-x fni-toggle-focusto switch between main and floating windows - Use
M-x fni-clear-aggregationto close all floating windows
(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)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 "::")Contributions are welcome! Feel free to:
- Report bugs
- Suggest new features
- Submit pull requests
This package is developed by the narrow-indirect package.
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.
Yibie
