Skip to content
Open built-in terminal in the floating window
Vim script
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
autoload Break change: modify keymaps Oct 22, 2019
plugin Dynamic values of g:floaterm_width and g:floaterm_height, close #10 Oct 17, 2019
LICENSE Create LICENSE Oct 12, 2019
README.md Break change: modify keymaps Oct 22, 2019

README.md

vim-floaterm

Open the terminal in the neovim's floating window. Detached from my dotfiles

Installation

  • vim-plug
Plug 'voldikss/vim-floaterm'
  • dein.nvim
call dein#add('voldikss/vim-floaterm', {'on_cmd': 'FloatermToggle'})

Configurations

g:floaterm_type

  • Available: 'floating'(neovim only), 'normal'(vim8 or neovim)

  • Default: 'floating'

g:floaterm_width

  • Type: number

  • Default: 0.7 * &columns

g:floaterm_height

  • Type: number

  • Default: 0.7 * &lines

g:floaterm_winblend

  • Description: The opacity of the floating terminal

  • Type: number(0-100)

  • Default: 0

g:floaterm_position

  • Available: 'auto', 'topleft', 'topright', 'bottomleft', 'bottomright', 'center'

  • Default: 'auto'(at the cursor position)

g:floaterm_background

  • Type: string(e.g. '#000000', 'black')

  • Default: depends on your colorscheme

Commands

:FloatermToggle

Keymaps

Recommended configuration

noremap  <silent> <F12>           :FloatermToggle<CR>
noremap! <silent> <F12>           <Esc>:FloatermToggle<CR>
tnoremap <silent> <F12>           <C-\><C-n>:FloatermToggle<CR>

Q & A

  • This plguin leaves an empty window on startify window

    Put this code in vimrc

    autocmd User Startified setlocal buflisted
  • I want to use another shell in the terminal. (e.g. Use fish instead of bash/zsh)

    Set shell option in your vimrc:

    set shell=/path/to/shell
  • I would like to customize the floating window behavior

    Use autocmd. For example

    function s:floatermSettings()
        setlocal number
        " more settings
    endfunction
    
    autocmd FileType terminal call s:floatermSettings()

Todo

  • add doc
You can’t perform that action at this time.