9

Show HN: tmux.nvim – turning Neovim into a terminal multiplexer

 2 years ago
source link: https://github.com/spywhere/tmux.nvim
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

tmux.nvim

This plugin still under development

This plugin provides a framework to turns Neovim into terminal multiplexer (heavily based on tmux)

The intention of this plugin is to eliminate the need of tmux for a basic terminal multiplexing feature by leveraging Neovim split and tab features

For those who's on Windows, this could be a workaround for lack of tmux but only for terminal multiplexing

Table Of Contents

Features

This are non exhaustive list of features available

  • Panes
  • Windows
  • Status bar1
  • Copy mode1
  • (Detachable) Sessions2

1: Partially implemented
2: This requires Neovim to implement a server / client architecture which planned in 0.7

Getting Started

To quickly setup and run the first session of tmux.nvim

curl -fLo ~/.tmux.nvim/init.lua --create-dirs https://raw.githubusercontent.com/spywhere/tmux.nvim/main/tests/git.lua
nvim -u ~/.tmux.nvim/init.lua

This will download a basic configuration to ~/.tmux.nvim/init.lua and run it. In which, it will automatically install and setup the plugin using vim-plug.

Configurations

As the plugin still under development, please find the default configurations from following locations...

  • Neovim configurations: lua/tmux/config.lua
  • Status bar (built using tabline): lua/tmux/statusbar.lua
  • Key bindings: lua/tmux/bindings.lua
  • Available commands: lua/tmux/commands.lua

Please note that some options are opinionated and will be updated to match tmux's defaults later on

Installation

It is highly recommended to clone the repository (or download a zip file) and place it somewhere (~/.tmux.nvim would work too)

git clone https://github.com/spywhere/tmux.nvim ~/.tmux.nvim

or install using a plugin manager of your choice, for example:

" neovim 0.5 or later that supports lua
Plug 'spywhere/tmux.nvim'

Integration

Create a file named init.lua and place it somewhere (in this example, ~/.tmux.nvim/init.lua will be used)

-- if you're cloning the repository, you will need to add the plugin directory
--   to the 'runtimepath'
vim.opt.rtp:append('~/.tmux.nvim')

local tmux = require('tmux')

-- some configurations go here

tmux.start() -- this will start a terminal session

then, when you're ready to use Neovim as terminal multiplexer, just run

nvim -u ~/.tmux.nvim/init.lua

Contributes

During the development, you can use the following command to automatically setup a working configurations to test the plugin...

make testrun
nvim -u tests/init.lua

Alternatively, if you wish to test the plugin through direct cloning, use...

make testrun-from-git
nvim -u tests/git.lua

License

Released under the MIT License


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK