terminal.nvim

July 30, 2026 ยท View on GitHub

terminal.nvim is a simple floating terminal plugin for Neovim. It provides a clean floating window with smooth open animation, and integrates with picker.nvim for fuzzy-finding terminal buffers and selecting preset shells.

Run Tests GitHub License GitHub Issues or Pull Requests GitHub commit activity GitHub Release luarocks

Image

โœจ Features

  • Floating terminal window with smooth open animation
  • Open terminal in current directory or custom cwd
  • Support custom shell commands per terminal
  • Reopen existing terminal buffers in a floating window
  • Picker sources for picker.nvim:
    • terminal โ€” fuzzy find opened terminal buffers
    • terminal_shells โ€” select from preset shells with availability check
  • Fully configurable border, shell, and highlight groups

๐Ÿ“ฆ Installation

terminal.nvim works with all major Neovim plugin managers.

  • Using nvim-plug

    require('plug').add({
      {
        'wsdjeg/terminal.nvim',
        keys = {
          {
            'n',
            "<leader>'",
            '<cmd>lua require("terminal").open()<cr>',
            { silent = true, desc = 'open terminal in current path' },
          },
          {
            'n',
            '<leader>"',
            '<cmd>lua require("terminal").open(vim.fn.expand("%:p:h"))<cr>',
            { silent = true, desc = 'open terminal in file path' },
          },
        },
        opts = {
          border = { 'โ•ญ', 'โ”€', 'โ•ฎ', 'โ”‚', 'โ•ฏ', 'โ”€', 'โ•ฐ', 'โ”‚' },
        },
      },
    })
    
  • Using lazy.nvim

    {
      "wsdjeg/terminal.nvim",
      keys = {
        { "<leader>'", '<cmd>lua require("terminal").open()<cr>', desc = "open terminal" },
        { '<leader>"', '<cmd>lua require("terminal").open(vim.fn.expand("%:p:h"))<cr>', desc = "open terminal in file path" },
      },
      opts = {
        border = { 'โ•ญ', 'โ”€', 'โ•ฎ', 'โ”‚', 'โ•ฏ', 'โ”€', 'โ•ฐ', 'โ”‚' },
      },
    }
    
  • Using packer.nvim

    use({
      'wsdjeg/terminal.nvim',
      config = function()
        require('terminal').setup({
          border = { 'โ•ญ', 'โ”€', 'โ•ฎ', 'โ”‚', 'โ•ฏ', 'โ”€', 'โ•ฐ', 'โ”‚' },
        })
      end,
    })
    
  • Using luarocks

    luarocks install terminal.nvim
    

๐Ÿ”ง Configuration

require('terminal').setup({
  -- default shell, passed to jobstart
  shell = vim.o.shell,

  -- floating window border
  border = { 'โ•ญ', 'โ”€', 'โ•ฎ', 'โ”‚', 'โ•ฏ', 'โ”€', 'โ•ฐ', 'โ”‚' },

  -- preset shells for :Picker terminal_shells
  -- each entry: { name = "display name", cmd = { "executable", "arg1", "arg2" } }
  -- picker auto-checks executable availability and shows โœ“/โœ—
  shells = {
    { name = 'bash',       cmd = { 'bash' } },
    { name = 'zsh',        cmd = { 'zsh' } },
    { name = 'lua',        cmd = { 'lua' } },
    { name = 'cmd',        cmd = { 'cmd', '/c', 'cls' } },
    { name = 'powershell', cmd = { 'powershell' } },
  },

  -- picker highlight groups
  picker = {
    highlight = {
      --  [25768   ] โœ“ { "cmd.exe", "/s", "/c", '"cmd.exe"' } (~\AppData\Local\nvim) buf:2
      --   jobpid   status            cmd                             cwd            bufnr
      jobpid = 'Number',
      status_ok = 'DiagnosticOk',
      status_error = 'DiagnosticError',
      cmd = 'String',
      cwd = 'Comment',
      buffer = 'Comment',
      shell_name = 'Function',
      shell_cmd = 'Comment',
    },
  },
})

โš™๏ธ Basic Usage

API

FunctionDescription
terminal.open(cwd, shell)Open floating terminal. cwd defaults to current directory, shell defaults to config.shell
terminal.open_with_terminal(term_buf)Open existing terminal buffer in floating window
terminal.setup(opt)Merge config
terminal.get_config()Get current config

Examples

Open terminal in current directory:

require('terminal').open()

Open terminal in a specific directory:

require('terminal').open(vim.fn.expand('%:p:h'))

Open terminal with a custom shell:

require('terminal').open(nil, { 'python3' })

Open an existing terminal buffer in a floating window:

require('terminal').open_with_terminal(bufnr)

๐Ÿ”Œ Picker Sources

terminal.nvim provides two picker sources for picker.nvim:

terminal

Fuzzy find opened terminal buffers.

:Picker terminal

picker-terminal

Each entry shows:

[25768   ] โœ“ { "cmd.exe", "/s", "/c", '"cmd.exe"' } (~\AppData\Local\nvim) buf:2
 jobpid     status            cmd                             cwd            bufnr
key bindingdescription
<Enter>open selected terminal buffer in floating window

terminal_shells

Fuzzy select a preset shell and open a new terminal with it.

:Picker terminal_shells

picker-terminal-shells

Each shell's availability is auto-checked via executable():

โœ“ bash          bash
โœ“ zsh           zsh
โœ— lua           lua
โœ“ cmd           cmd /c cls
โœ“ powershell    powershell
key bindingdescription
<Enter>open new terminal with selected shell

โ“ FAQ

  1. how to change the floating window border?
require('terminal').setup({
  border = 'rounded', -- or a custom table: { 'โ•ญ', 'โ”€', 'โ•ฎ', 'โ”‚', 'โ•ฏ', 'โ”€', 'โ•ฐ', 'โ”‚' }
})
  1. how to add preset shells for :Picker terminal_shells?
require('terminal').setup({
  shells = {
    { name = 'bash',  cmd = { 'bash' } },
    { name = 'fish',  cmd = { 'fish' } },
    { name = 'python', cmd = { 'python3' } },
  },
})
  1. how to disable the smooth open animation?

The animation is built-in and cannot be disabled via config. If you prefer no animation, you can override the open_float_windows function in your config.

๐Ÿ“ฃ Self-Promotion

Like this plugin? Star the repository on GitHub.

Love this plugin? Follow me on GitHub or Twitter.

๐Ÿ’ฌ Feedback

If you encounter any bugs or have suggestions, please file an issue in the issue tracker

๐Ÿ™ Credits

๐Ÿ“„ License

Licensed under GPL-3.0.