Skip to content

LuxVim/vim-luxpane

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

vim-luxpane

vim-luxpane is a Vim/Neovim plugin that improves buffer and window management by preventing certain buffers and filetypes from being accidentally overwritten or replaced. This protection keeps important utility or special-purpose buffers intact while you open and navigate files in other windows.

Features

  • Automatic Buffer Protection: Prevents accidental modification or access to specific buffer types and file types.
  • Automatic Window Management: Seamlessly navigates between buffers and manages window states.
  • Customizable Settings: Users can adjust protected buffer and file types according to their needs.

Installation

Use your preferred plugin manager to install vim-luxpane. For example, using vim-plug:

Plug 'LuxVim/vim-luxpane'

Then, reload Vim and run :PlugInstall.

Usage

Buffer Protection

vim-luxpane automatically protects buffers based on their type (&bt) or file type (&filetype). By default, the following types are protected:

let g:luxpane_protected_bt = ['quickfix', 'nofile', 'terminal']
let g:luxpane_protected_ft = ['']

The plugin ensures that protected buffers are not accidentally replaced or closed. If a protected buffer is replaced, it restores the last active protected buffer automatically.

Customizing Protection

You can override the entire list of protected buffer or file types by redefining the global variables. For example:

  • Replace the entire list of protected buffer types:

    let g:luxpane_protected_bt = ['quickfix', 'help', 'terminal', 'scratch']
  • Replace the entire list of protected file types:

    let g:luxpane_protected_ft = ['markdown', 'log', 'txt']

This approach allows you to fully customize which buffers and file types are protected based on your workflow.

Window Management

vim-luxpane automatically handles window navigation to ensure smooth visibility and access to buffers. The plugin uses the following logic:

  1. Focus Existing Windows:

    • If the desired buffer is already open in an existing window, the plugin sets focus on that window.
  2. Open Buffer in Current Tab:

    • If the buffer isn’t displayed in the current tab, the plugin opens it in a new window within the same tab.
  3. Fallback to New Tab:

    • If no suitable window exists in the current tab or if the buffer requires isolation, the plugin opens it in a new tab.

This behavior ensures that buffers are always accessible, minimizing disruptions to your workflow.

License

This plugin is licensed under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! Feel free to open issues or submit pull requests to enhance vim-luxpane.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published