vim-lf

lf integration for Vim 8.2
git clone git://git.alex.balgavy.eu/vim-lf.git
Log | Files | Refs | README | LICENSE

README.md (2274B)


      1 # vim-lf: lf integration for Vim 8.2
      2 ![Demo of lf integration in Vim](demo.gif)
      3 
      4 ## Why?
      5 Sometimes I need to visually browse through the folder hierarchy to find the file I'm looking for.
      6 In the shell, I use [lf](https://github.com/gokcehan/lf) as a terminal file manager, so I have lots of aliases and commands set up in lf.
      7 In Vim, I generally use netrw or [fzf](https://github.com/junegunn/fzf) to select files, but from time to time I wanted to browse or select files in lf, especially since I also have [rupa/z](https://github.com/rupa/z) integrated into lf.
      8 
      9 I initially looked at [ptzz/lf.vim](https://github.com/ptzz/lf.vim), but I did not like that it used a hard-coded file path to store the selected file instead of Vim's `tempname()`.
     10 I also didn't like its configuration style, which is based on global variables.
     11 I considered the original [lf.vim plugin](https://github.com/gokcehan/lf/blob/master/etc/lf.vim), which had the right idea.
     12 However, both plugins run `lf` as a shell command, and I wanted to make use of Vim's popups.
     13 So I made this plugin.
     14 
     15 ## What?
     16 This plugin integrates lf into Vim, so you need to have lf installed.
     17 It uses a terminal popup window to display the file manager.
     18 This plugin only supports Vim 8.2 and higher, as it requires the popup window features.
     19 There is some code included for Neovim support, which is taken from [ptzz/lf.vim](https://github.com/ptzz/lf.vim), but I cannot guarantee that this will always work everywhere, as I don't use Neovim.
     20 
     21 The plugin exposes two normal mode mappings:
     22 
     23 * `<Plug>LfEdit`: open lf in a popup window; the `open` command in lf will `:edit` each of the selected files in Vim.
     24 * `<Plug>LfSplit`: open lf in a popup window; the `open` command in lf will `:split` each of the selected files in Vim.
     25 
     26 There are no default mappings (by design, so as not to force mappings on users), so you need to map these `<Plug>`s yourself.
     27 
     28 **Disclaimer:** this code is not extensively tested.
     29 It works for me, running Vim 8.2 in the terminal on macOS, but it's not guaranteed to work for others.
     30 It might not work in Neovim, as I don't use Neovim.
     31 
     32 ## Acknowledgements
     33 Inspired by [ptzz/lf.vim](https://github.com/ptzz/lf.vim) and lf's [Vim plugin](https://github.com/gokcehan/lf/blob/master/etc/lf.vim).