Git Product home page Git Product logo

neovim-termhide's Introduction

neovim-termhide

Support For Hide-able NeoVim :terminal Buffers

Status: experimental

Usage

  1. Start a new shell terminal :Term
  2. Switch back to some other buffer, maybe closing the terminal window first, for example:
    • <C-\><C-n> to return to normal mode
    • <C-w>c to close the terminal window
    • NOTE this does not kill the running terminal, it continues in the background, and can be seen in the buffer list
  3. Return to the running shell terminal with :Term
    • NOTE if there is a window already showing the terminal, than it is focused in insert mode instead of switching the current window

May use the :TermSplit or :TermVSplit commands to work in a split, instead of changing the current window. Similarly :TermHUD creates a fixed-height bottom window. Like :Term these commands focus any existing window if possible, rather than creating a new split window.

You may also specify a different shell to run as in:

  • :Term zsh
  • :Term powershell.exe
  • :Term python NOTE any interactive terminal REPL should work

You may specify a different default shell in $MYVIMRC by setting g:termhide_default_shell:

let g:termhide_default_shell = 'powershell.exe'

Otherwise the default shell is used (see :help 'shell'). Be careful when changing this, as it may break other plugins that make assumptions about the default shell on Windows or Unix.

Suggested Mappings

Easy HUD toggle:

nnoremap <leader>` :TermHUD<cr>
tnoremap <leader>` <C-\><C-n><C-w>c

Easily switch to a terminal:

nnoremap <leader>$ :Term<cr>

And easier exits from a terminal:

" Back to wherever we were before this terminal
tnoremap <C-\><C-o> <C-\><C-n><C-o>

" Close terminal window, e.g. when it was in a new split
tnoremap <C-\><C-c> <C-\><C-n><C-w>c

Fugitive Status HUD

A :Ghud command is also provided to easily open fugitive's :Gstatus buffer in a fixed hud window at the bottom.

Install

neovim-termhide follows the standard runtime path structure. Install with something like vim-plug:

Plug 'jcorbin/neovim-termhide'

TODO

  • improve the HUD mode
  • change default modality of the :Term command? or instead provide a a higher level <plug>(term) entry point
  • floating window mode?

Related Questions and Issues

neovim-termhide's People

Contributors

jcorbin avatar abhinav avatar

Watchers

 avatar James Cloos avatar  avatar

neovim-termhide's Issues

Session restore doesn't restore bufhidden

Currently :Term buffers don't get restored with their bufhidden variable:

  • so that means that one round of show/hide the through termhide, ends up killing the (newly respawned) terminal program after-all
  • perhaps the termhide plugin should be more aggressive about ensuring bufhidden=hide
  • ...or maybe neovim could restore such buffer properties
  • ...or if neovim ends up just making hiding terminal buffers non-fatal by default, this plugin can just scope in on the core ux part of "show-or-create" X "quake-style/vert/split"

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.