Giter VIP home page Giter VIP logo

lf.vim's People

Contributors

alaskra avatar apenpfkkhm avatar augustfengd avatar divramod avatar enthudave avatar francoiscabrol avatar gauteh avatar hlidotbe avatar hoelter avatar lmburns avatar mar04 avatar michelesr avatar mroavi avatar nitsas avatar ptzz avatar sirewix avatar sitiom avatar theethernaut avatar tillbaks avatar wikimatze avatar zahyur avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

lf.vim's Issues

Overriding the `open` command has no effect

I added this code to my lfrc in order to open text files with nvim and other files, like images, with xdg-open.

# Open with $EDITOR or xdg-open based on type of file
cmd open ${{
    case $(file --mime-type "$f" -bL) in
        text/*|application/json) $EDITOR "$f";;
        *) xdg-open "$f" ;;
    esac
}}

This works fine if I open lf from the terminal. However, it does not work with lf's vim plugin.

lf_command_override broken(?)

Hi, I've been using this for a while so thank you!

With the latest build of lf, the configuration let g:lf_command_override = 'lf -command "set hidden"' is not respected, while it used to.

If I try several times (\f q \f q \f q) it shows hidden files like 40% of the time; which is weird
What I think happens is set hidden is actualy on, because even when .files do not show, using my mapping for set hidden! in the lf buffer does nothing on the first press, and then shows hidden files on the second press, which means it was set in the first place. Indeed, on reload it shows hidden files.

Edit: I tried running lf -command "set hidden" outside of vim and I have the same issue, so I guess this is related to lf. I will try debugging it and open an issue over there in case

Removal of "g:floaterm_open_command" in vim-floaterm broke wrapper

See this PR which was just merged; it looks like g:floaterm_open_command was replaced with g:floaterm_opener, and it works somewhat differently. I tried removing the g:floaterm_open_command argument from this line altogether, as seen on the upstream wrapper, but it did not work. Documentation for g:floaterm_opener should be here.

The error I get is:

Error detected while processing function <SNR>97_on_floaterm_close[26]..LfCallback[21]..floaterm#util#open:
line    2:
E730: using List as a String

Cannot open file on Windows 10 PowerShell

I am on Windows 10 PowerShell and using Neovim.
lfrc is cmd open $nvim %f%

Lf spawned from neovim does not allow me to open file using l or right arrow key, however lf spawned from powershell works fine. Am I missing something ?

[Process exited 0] on 'q' exit while browsing

Hello,

If i start the lf plug in, when i try to exit the file explorer i don't immediately get back where i started but i get a blank page first with the text
[Process exited 0]
and on the status line
term://.//31215:lf -selection-path=/tmp/chosenfile "some/path"

I then have to press q again to properly exit.

Not changing directory at the first try

When I run :Lf it is going to go to the location for the previous buffer in the first try, I have to hit q and run :Lf again for it to go to the current buffer's directory. Any idea what is happening here? My vim's current directory works fine when I run something like :!pwd . It is only on Lf that it behaves like this.

And thank you for this awesome extension.

Wrong buffer displayed when lf is closed

I just noticed a strange bug after using lf for some time. Here is how to reproduce it:

Open nvim with several files as arguments:

nvim a.txt b.txt c.txt

The file a.txt will be displayed on start. Open and quit the lf plugin. File c.txt gets displayed. I think that the correct behavior is to display the buffer from which you launched lf.

lf_replace_netrw not working with vim-floaterm

Using let g:lf_replace_netrw = 1 is not working after the switch to floating windows: nvim DIRECTORY opens an an empty buffer where the directory is open and visible in a floating terminal, but the focus is on the buffer.

:Lf not opening window properly

Floaterm window closes immediately after running :Lf

I have lf.vim loading before vim-floaterm in init.vim, so I'm not sure what's going on.

Screen.Recording.2022-06-20.at.10.37.42.AM-1.mov

How to change directory using Lf?

I want to combine this plugin with Telescope on a command. For example I want to switch to a directory and do a live grep in it using Telescope. The issue is that right now without this option I have to manually use vim internal cd command to do it. I see a Lfcd and Lflcd in commands related to Lf but can't find any documentation about them and not sure how to use it. Is there a way to use Lf to change directory without changing the current buffer?

Sorry for asking this here as I know it is more of a question rather than a bug but there is no discussion tab.

Thanks

How to not use floatterm

Hello, I recently updated to the most recent version of this plugin, and I keep getting the "Failed to open a floating terminal. Make sure voldikss/vim-floaterm is installed." error when trying to open using :Lf
Is there no way of using this plugin now without using Floatterm?

I'm also in Neovim so there's no need for the floatterm plugin as that's builtin to nvim

Thanks!

Allow setting a path in Lfcd

Hi I would like to specify a folder when I activate Lfcd like in :Lfcd my/custom/path.

Lf normally gets opened in the current directory, I have a special commands where I only look for projects, and all my projects are in a workspace dir, which I would like here to popup.
Sadly the custom -command options doesn't help here in overwriting the directory.

I looked through it but very much suck in vim script, if you could add that I would really appreciate it :)

Files opened with lf.vim not listed in file history

First of all thank you for this plugin. This issue is probably not related to it but I want to know the reason behind.

I'm using fzf.vim and its History command a lot. The issue is that this command does not list recent files opened via lf. This also should not be related to fzf.vim because I have the same situation with another plugin called 'Startify'. It must be a VIM behavior that must be set via a config but I don't know what it is, if there is a such a config of course.

Maybe each of these and other similar plugins maintain their own MRU lists and I hope it's not true.

Thanks in advance.

Opening of the file from LF in Floaterm is broken "

I open LF inside the Floaterm as usual, but when I try to open file from the LF - I got this error:

Error detected while processing function <SNR>157_on_floaterm_close[26]..LfCallback:
line   21:
E108: No such variable: "s:edit_cmd"

And instead of opening file in the separate buffer and tab, NeoVIM opens it in the vertical split.

I tried two NeoVIM versions:

:version
NVIM v0.4.4
Build type: Release
LuaJIT 2.0.5
Compilation: /usr/bin/cc -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wex
tra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-com
mon -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/build/neovim/src/build/config -I/build
/neovim/src/neovim-0.4.4/src -I/usr/include -I/build/neovim/src/build/src/nvim/auto -I/build/neovim/src/build/include
Compiled by builduser

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

And Neovim nighty:

:version
NVIM v0.5.0-dev+1085-g52397aaa0
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconvers
ion -Wmissing-prototypes -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DN
VIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/home/runner/work/neovim/neovim/build/config -I/home/runner/work/neovim/neovim/src -I/home/runner/work/neovim/neovim/.deps/usr/in
clude -I/usr/include -I/home/runner/work/neovim/neovim/build/src/nvim/auto -I/home/runner/work/neovim/neovim/build/include
Compiled by runner@fv-az205-835

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/share/nvim"

Run :checkhealth for more info

Both are the same.

My init.vim:

call plug#begin('~/.local/share/nvim/plugged')

if has('nvim')
    Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
  else
    Plug 'Shougo/deoplete.nvim'
    Plug 'roxma/vim-hug-neovim-rpc'
endif
Plug 'NLKNguyen/papercolor-theme'
Plug 'ncm2/ncm2' " autocompletion
Plug 'roxma/nvim-yarp' " autocompletion
Plug 'neovimhaskell/haskell-vim'
Plug 'tpope/vim-surround'
Plug 'Yggdroot/indentLine'
Plug 'vim-syntastic/syntastic'
Plug 'vim-airline/vim-airline-themes'
Plug 'bling/vim-airline'
Plug 'mhinz/vim-signify'
Plug 'airblade/vim-gitgutter'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-commentary'
" Plug 'easymotion/vim-easymotion'
Plug 'mattn/Stupid-EasyMotion'
Plug 'junegunn/fzf'
Plug 'junegunn/fzf.vim'
Plug 'autozimu/LanguageClient-neovim', { 'branch': 'next', 'do': 'bash install.sh' }
Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'
Plug 'vimwiki/vimwiki'
" { integration with lf
Plug 'rbgrouleff/bclose.vim'
Plug 'ptzz/lf.vim'
"wrapper for floating window
Plug 'voldikss/vim-floaterm'
" }
Plug 'dhruvasagar/vim-table-mode'
Plug 'junegunn/goyo.vim'
Plug 'jiangmiao/auto-pairs'
Plug 'liuchengxu/vim-which-key'
"Cheat sheet
Plug 'RishabhRD/popfix'
Plug 'RishabhRD/nvim-cheat.sh'
" Syntax highlighting
Plug 'sheerun/vim-polyglot'

call plug#end()

...
" LF
command! LF FloatermNew lf
let g:lf_replace_netrw = 1
let g:lf_map_keys = 0
nmap <leader>o :LF<CR>
...

<Esc> tries to open current file and causes undefined behavior

When opening a new window with <leader> f it seems that lf's default keybindings cause issues.

When pressing <Esc> with the lf floaterm window open, it tries to open the file in the buffer that I had open when initializing the window. Further keypresses of <Esc> cause the file to enter -- INSERT -- mode, and inserts newlines of exit, and if i long-press <Esc>, random text will be inserted in newlines depending on how long the key is held.

image

I can't exit the insert mode either, unless I use my custom keybind for <Esc>. Upon exiting, it enters a read-only view of lf of the file, allowing the normal q keybind to be used to go back to original lf view.

Floaterm wrapper API change

Sorry about the inconvenience caused by the change of wrapper API in vim-floaterm. I promise there won't be another changes in a long time...

Please update the lf.vim according to the patch. Once lf.vim is updated, I'll merge voldikss/vim-floaterm#261

diff --git a/autoload/floaterm/wrapper/lf.vim b/autoload/floaterm/wrapper/lf.vim
index 30b2956..dd7ba65 100644
--- a/autoload/floaterm/wrapper/lf.vim
+++ b/autoload/floaterm/wrapper/lf.vim
@@ -1,4 +1,4 @@
-function! floaterm#wrapper#lf#(cmd) abort
+function! floaterm#wrapper#lf#(cmd, jobopts, ...) abort
   let lf_tmpfile = tempname()
   let lastdir_tmpfile = tempname()
   let original_dir = getcwd()
@@ -14,5 +14,6 @@ function! floaterm#wrapper#lf#(cmd) abort
 
   exe "lcd " . original_dir
   let cmd = [&shell, &shellcmdflag, cmd]
-  return [cmd, {'on_exit': funcref('LfCallback', [lf_tmpfile, lastdir_tmpfile])}, v:false]
+  let a:jobopts.on_exit = funcref('LfCallback', [lf_tmpfile, lastdir_tmpfile])
+  return [v:false, cmd]
 endfunction

Unable to find the project in vim Awesome

Personnally, I think this project is great. I am a vim and lf user for my daily work so this plugin was a real life saver.

It's a shame that this project can't be found in Vim Awesome.
I don't know if you know about this site, but it's like a store for vim plugins were everyone can look for plugins to install.

The link is here

Of course, there is no need to add your project here. I just think it could be cool if more people know about your work.

Kind regards

dynamic values for Width and Height

Hi,

Is there a way to set dynamic values for width / height?

ie: If I opens up the terminal in full screen or in smaller size, it'd have the proper values set according to the terminal size.

I tried different things for g:lf_width / g:lf_height variables without success, and if I just leave the default values, the ones from LF itself, it doesn't seem to work properly for me.

I ended up doing a small hack in those floaterm values, here:

exec 'FloatermNew' . ' --height=' . string(get(g:, 'lf_height', g:floaterm_height)) . ' --width=' . string(get(g:, 'lf_width', g:floaterm_width)) . ' ' . s:lf_command . ' ' . ' -- ' . currentPath

But I was wondering if we can accomplish this without messing with the plugin files. Maybe those two variables could have dynamic values?

Let me show you what I mean:

  1. In the 1st try the width is messed up after resizing the terminal
  2. In the 2nd try it works but I had to hack the mentioned file.
lf_issue.mp4

Thanks.

Disable line numbers when lf is launched

Could you disable the line numbers in the buffer that gets created when lf is launched? They are not adding anything and hence are distracting. It is also confusing that the one at the bottom of the buffer gets highlighted.

Error detected while processing function <SNR>92_on_floaterm_close[27] .. LfCallback

Hey ptzz,

Appreciate your work on this plugin. I am trying to set it up and have followed installation steps and installed dependencies of floaterm as well.

While calling any of the Lf commands, I am getting error -

Error detected while processing function <SNR>92_on_floaterm_close[27]..LfCallback:
line   26:
lf returned non-zero exit code 127

I checked scriptnames and 92nd Script is: vim-floaterm/autoload/floaterm/terminal.vim. Here

I just ensured all plugins are at the latest version.

Is there anything that I am missing?

Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.