Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/voldikss/fzf-floaterm
Fzf support for vim-floaterm
https://github.com/voldikss/fzf-floaterm
fzf fzf-plugin neovim vim
Last synced: 23 days ago
JSON representation
Fzf support for vim-floaterm
- Host: GitHub
- URL: https://github.com/voldikss/fzf-floaterm
- Owner: voldikss
- Created: 2020-09-10T00:58:24.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2023-11-05T11:05:09.000Z (about 1 year ago)
- Last Synced: 2024-10-12T22:50:20.689Z (about 1 month ago)
- Topics: fzf, fzf-plugin, neovim, vim
- Language: Vim Script
- Homepage:
- Size: 7.81 KB
- Stars: 23
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# fzf-floaterm
Fzf support for [vim-floaterm](https://github.com/voldikss/vim-floaterm)
## Install
```vim
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'voldikss/fzf-floaterm'
Plug 'voldikss/vim-floaterm'
```## Usage
### Get Started
```
:Floaterms
```### Create New Pre-configured Floaterms
Using `:Floaterms` not just for switching to existing terminals but also to
create new ones (with different config).Define the different terminal types by a global variable
`g:fzf_floaterm_newentries` that we can set in `.vimrc` for a root shell, fish
shell and a powershell terminal.The key represents a unique identifier which must be non numerical (or at
least outside the buffer number range). The options will be forwarded to
floaterm itself, where cmd defines the command.```vim
let g:fzf_floaterm_newentries = {
\ '+root' : {
\ 'title': 'Root Shell',
\ 'cmd': 'sudo sh' },
\ '+fish' : {
\ 'title': 'Fish Shell',
\ 'cmd': 'fish' },
\ '+pwsh' : {
\ 'title': 'Powershell',
\ 'cmd': 'pwsh' }
\ }
```### Get current working directory in vim
The plugin use indices and terminal working directory as fzf entries.
Neovim has `b:buffer` variable for getting working directory of terminal, but vim must use `Tapi_` to notify the information.
So you should add `source /path/fzf-floaterm/macros/termcwd.sh` to your `.bashrc` or `.zshrc` file in vim only.
### Floaterm Fzf layout options
Define fzf layout by `g:floatterm_fzf_layout`, exmaple is bellow.
```vim
let g:floatterm_fzf_layout = {
\ 'window': {
\ 'width': 0.9,
\ 'height': 0.6,
\ 'border': 'sharp',
\ 'highlight': 'FloatermBorder'
\ }
\}```