iwata / FTerm.nvim

No nonsense floating terminal written in Lua.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FTerm.nvim

No nonsense floating terminal written in lua.

FTerm

Requirements

  • Neovim Nightly

Install

Plug 'numtostr/FTerm.nvim'
use 'numtostr/FTerm.nvim'

Commands

  • To open the terminal
:FTermOpen
  • To close the terminal
:FTermClose

Actually this closes the floating window not the actual terminal buffer

  • To toggle the terminal
:FTermToggle

Setup

-- NOTE: No need to call .setup() if you don't want to customize anything
require'FTerm'.setup({
    -- Default dimensions in percentage, you can customize them individually
    -- Value should be between 0 and 1
    dimensions  = {
        height = 0.8,
        width = 0.8,
        row = 0.5,
        col = 0.5
    }
    -- Default border characters, you can customize them individually
    border = {
        horizontal = '',
        vertical = '|',
        topLeft = '',
        topRight = '',
        bottomRight = '',
        bottomLeft = ''
    }
})

-- Keybinding

-- Closer to the metal
vim.fn.nvim_set_keymap('n', '<A-i>', '<CMD>lua require"FTerm".toggle()<CR>', { noremap = true, silent = true })
vim.fn.nvim_set_keymap('t', '<A-i>', '<C-\\><C-n><CMD>lua require"FTerm".toggle()<CR>', { noremap = true, silent = true })

-- or

vim.fn.nvim_set_keymap('n', '<A-i>', ':FTermToggle<CR>', { noremap = true, silent = true })
vim.fn.nvim_set_keymap('t', '<A-i>', '<C-\\><C-n>:FTermToggle<CR>', { noremap = true, silent = true })

About

No nonsense floating terminal written in Lua.


Languages

Language:Lua 97.8%Language:Vim Script 2.2%