Coder Social home page Coder Social logo

lir.nvim's Introduction

lir.nvim

A simple file explorer

Note: lir.nvim does not define any default mappings, you need to configure them yourself by referring to help.

Installation

Plug 'tamago324/lir.nvim'
Plug 'nvim-lua/plenary.nvim'

" Optional
Plug 'kyazdani42/nvim-web-devicons'

Configuration

local actions = require'lir.actions'
local mark_actions = require 'lir.mark.actions'
local clipboard_actions = require'lir.clipboard.actions'

require'lir'.setup {
  show_hidden_files = false,
  ignore = {}, -- { ".DS_Store", "node_modules" } etc.
  devicons = {
    enable = false,
    highlight_dirname = false
  },
  mappings = {
    ['l']     = actions.edit,
    ['<C-s>'] = actions.split,
    ['<C-v>'] = actions.vsplit,
    ['<C-t>'] = actions.tabedit,

    ['h']     = actions.up,
    ['q']     = actions.quit,

    ['K']     = actions.mkdir,
    ['N']     = actions.newfile,
    ['R']     = actions.rename,
    ['@']     = actions.cd,
    ['Y']     = actions.yank_path,
    ['.']     = actions.toggle_show_hidden,
    ['D']     = actions.delete,

    ['J'] = function()
      mark_actions.toggle_mark()
      vim.cmd('normal! j')
    end,
    ['C'] = clipboard_actions.copy,
    ['X'] = clipboard_actions.cut,
    ['P'] = clipboard_actions.paste,
  },
  float = {
    winblend = 0,
    curdir_window = {
      enable = false,
      highlight_dirname = false
    },

    -- -- You can define a function that returns a table to be passed as the third
    -- -- argument of nvim_open_win().
    -- win_opts = function()
    --   local width = math.floor(vim.o.columns * 0.8)
    --   local height = math.floor(vim.o.lines * 0.8)
    --   return {
    --     border = {
    --       "+", "─", "+", "│", "+", "─", "+", "│",
    --     },
    --     width = width,
    --     height = height,
    --     row = 1,
    --     col = math.floor((vim.o.columns - width) / 2),
    --   }
    -- end,
  },
  hide_cursor = true
}

vim.api.nvim_create_autocmd({'FileType'}, {
  pattern = {"lir"},
  callback = function()
    -- use visual mode
    vim.api.nvim_buf_set_keymap(
      0,
      "x",
      "J",
      ':<C-u>lua require"lir.mark.actions".toggle_mark("v")<CR>',
      { noremap = true, silent = true }
    )
  
    -- echo cwd
    vim.api.nvim_echo({ { vim.fn.expand("%:p"), "Normal" } }, false, {})
  end
})

-- custom folder icon
require'nvim-web-devicons'.set_icon({
  lir_folder_icon = {
    icon = "",
    color = "#7ebae4",
    name = "LirFolderNode"
  }
})

NOTE: Actions can be added easily (see wiki)

Usage

Use normal buffer (like dirvish)

$ nvim /path/to/directory/

or

:edit .

Use floating window

:lua require'lir.float'.toggle()
:lua require'lir.float'.init()

Extensions

Credit

Screenshots

License

MIT

lir.nvim's People

Contributors

adriancmiranda avatar baleksa avatar creativenull avatar dhruvmanila avatar heygarrett avatar ishan9299 avatar js-everts avatar kuuote avatar nathanmsmith avatar opalmay avatar pheon-dev avatar sindrets avatar spflaumer avatar tamago324 avatar ten3roberts avatar ttak0422 avatar uga-rosa avatar vinnya3 avatar whoissethdaniel 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

lir.nvim's Issues

Getting error message after latest update 'Error detected while processing BufEnter Autocommands for "*":'

I started to get error when I enter lir, I can proceed to use it but error pops out every time I use lir.nvim.

Here is the message:

Error detected while processing BufEnter Autocommands for "*":
E5108: Error executing lua ...l/share/nvim/site/pack/packer/start/lir.nvim/lua/lir.lua:243: Vim(lua):E5108: Error executing lua ...ck/packer
/start/lir.nvim/lua/lir/float/curdir_window.lua:113: attempt to index field 'curdir_window' (a nil value)

Thank you.

Clipboard action picking up items from previous selection in visual mode (`v`)

Description

I've a custom function which marks the items and calls the respective clipboard action all in one. This was working perfectly well, but at some point in the past it stopped working. Today, I got the time to debug it and seems to be a problem in the plugin, but I'm not 100% sure.

Reproduction

  1. Save the below code in minimal.lua
-- Load the 'runtime/' files
vim.cmd [[set runtimepath=$VIMRUNTIME]]

-- Originally, `packpath` contains a lot of path to search into which also
-- includes the `~/.config/nvim` directory. Now, if we open Neovim, the files
-- in the `plugin/`, `ftplugin/`, etc. directories will be loaded automatically.
--
-- We will set the value of `packpath` to contain only our testing directory to
-- avoid loading files from our config directory.
--
--     $ nvim -nu minimal.lua
vim.cmd [[set packpath=/tmp/nvim/site]]

local package_root = '/tmp/nvim/site/pack'
local packer_install_path = package_root .. '/packer/start/packer.nvim'

local function load_plugins()
  require('packer').startup {
    {
      'wbthomason/packer.nvim',
      -- Add plugins to test...
      'tamago324/lir.nvim',
      'nvim-lua/plenary.nvim',
    },
    config = {
      package_root = package_root,
      compile_path = packer_install_path .. '/plugin/packer_compiled.lua',
      display = { non_interactive = true },
    },
  }
end

_G.load_config = function()
  -- Add the necessary `init.lua` settings which could include the setup
  -- functions for the plugins...
  vim.g.loaded_netrw = 1
  vim.g.loaded_netrwPlugin = 1

  local lir = require 'lir'
  local actions = require 'lir.actions'
  local mark_actions = require 'lir.mark.actions'

  local clipboard_actions = setmetatable({}, {
    __index = function(_, action)
      return function(mode)
        mark_actions.mark(mode)
        require('lir.clipboard.actions')[action]()
      end
    end,
  })

  lir.setup {
    mappings = {
      ['q'] = actions.quit,
      ['h'] = actions.up,
      ['l'] = actions.edit,
    },
    on_init = function()
      vim.keymap.set('x', 'C', function()
        clipboard_actions.copy 'v'
      end, {
        buffer = true,
        desc = 'Lir: Copy visual selection',
      })

      vim.keymap.set('x', 'X', function()
        clipboard_actions.cut 'v'
      end, {
        buffer = true,
        desc = 'Lir: Cut visual selection',
      })
    end,
  }

  vim.keymap.set('n', '-', require('lir.float').toggle)
end

if vim.fn.isdirectory(packer_install_path) == 0 then
  print 'Installing plugins and dependencies...'
  vim.fn.system {
    'git',
    'clone',
    '--depth=1',
    'https://github.com/wbthomason/packer.nvim',
    packer_install_path,
  }
end

load_plugins()
require('packer').sync()
vim.cmd [[autocmd User PackerComplete ++once echo "Ready!" | lua load_config()]]
  1. Open Neovim with nvim -n -u path/to/minimal.lua
  2. Open the Lir floating window with the key -
  3. Select any number of items and press C (that's uppercase C)
  4. Now, select items other than the ones from step 4 and repeat

You'll notice that in step 4, nothing got marked as copy while in step 5, the previous selection got marked as copy.

Video

lir_bug_repro

New lir buffer is opened and floating window remains on cd

When using the floating window and entering a directory, either through actions.up or actions.edit the directory is opened in a new non floating buffer behind the floating window, which remains but loses focus.

The floating window needs to be manually focused and closed and navigation can not continue in a floating window

Path issues on OS:Windows

Hi there!
I just started using this plugin but some of the default actions are not working properly on OS:Windows, I suspect paths are not handled properly.
In particular require('lir.actions').up is not working at all. As my understandings of it, it should go up one level in the folder hierarchy (thus doing something like cd ..).

I gave a quick look to the function and i found out that the name variable is always empty, it HAS to do with Windows slash notation.

function actions.up()
  local cur_file, path, name, dir
  local ctx = get_context()
  cur_file = ctx:current_value()
  path = string.gsub(ctx.dir, "/$", "")
  name = vim.fn.fnamemodify(path, ":t") <--- This line
  if name == "" then
    return
  end
  ...

As my current vimscripting knowledge, name should be containing the current folder/file name underneath the cursor, but debugging with primordial tools (print) it is actually nil, so the function returns.

Turns out the ctx.dir is ill-formed, it always ends in \/ (e.g. ~\.config\nvim\lua\/), thus it detects no :t(ail) on the vim.fn.fnamemodify.

A dirty quickfix to this very function is literally repeat the string.gsub twice
path = string.gsub(string.gsub(ctx.dir, "/$", ""), "\\$", "")

Other actions are affected as well, not as severly (thus still working properly!), for example when using require('lir.actions').edit the echo'd pattern has an extra right slant in the name

immagine

Thanks!

`vim.opt.autochdir = true` causing lir to always go one directory up when being toggled in an empty window

Hey, thank you for this great plugins! I really love the minimalistic style of this file explorer. Unfortunately though, I likely found an issue. I set vim.opt.autochdir to true in my config, and that's causing lir to always go up one directory whenever I toggle it in a newly opened nvim.

EDIT
Okay I likely find a fix/workaround. I read about lir.float.toggle() that takes a path as parameter. By defaults it expands "%:p:h". Storing the expanded string to a variable would make the issue gone. But I think I'll keep this open in case you interested to investigate more.

Expected behavior

lir should always be in the same directory whenever it's being toggled on an empty buffer

Actual behavior

lir always jumps one directory up whenever being toggled

Steps to reproduce

  1. The minimal init.lua
local fn = vim.fn
local cmd = vim.cmd
local fmt = string.format

-- vim.cmd [[ set autochdir ]]
vim.opt.autochdir = true

local function ensure(user, repo)
	local path = fmt("%s/site/pack/packer/start/%s", fn.stdpath("data"), repo)
	if fn.empty(fn.glob(path)) > 0 then
		cmd(fmt("!git clone --depth 1 https://github.com/%s/%s %s", user, repo, path))
		cmd(fmt("packadd %s", repo))
	end
end

ensure("wbthomason", "packer.nvim")

local packer = require("packer")

packer.startup(function(use)
	use("wbthomason/packer.nvim")

	use({
		"tamago324/lir.nvim",
		module = "lir",
		config = function()
			local lir = require("lir")
			lir.setup({})
		end,
		requires = {
			{ "nvim-lua/plenary.nvim", module = "plenary" },
		},
	})
end)

vim.keymap.set({ "n" }, "<C-a>", "<cmd>lua require'lir.float'.toggle()<cr>")
  1. run nvim
  2. toggle lir by pressing the keymap multiple times, and you would see it always jump one directory back everytime it's being toggled

Extra

I've also made a screencast, hope it would give a better illustration of this issue. First, I set it to true, then opening nvim inside a deeply nested directory (~/directory/nested/deep/very/a/is/this), that would cause the issue, then I set to false and the issue would gone

lir-autochdir.mov

Disable for specific buffers

Currently, lir runs on every buffer via BufEnter * and checks if the current buffer's filename is a directory. If it is, then lir takes over by doing a variety of buffer changes and setting the filetype to lir.

It would be nice to have a flag or something to exclude buffers from initialization. Maybe having something like b:lir_ignore = 1.

Moving up or down directories should visually preserve marked items

Hi, i am wondering if it is possible to visually show the marks if you go up/down a directory. Currently, if you mark items in a directory they would show up in the gutter, but if you then go into a subdirectory , and go back into the parent directory the marks are not there anymore, this can be confusing, in case you have initialized a mark related operation. There is no way to cancel it, without i guess closing and reopening the explorer. This use case is very much needed if you want to mark items across multiple dir levels.

Another kind of related issue is, it might be more user-friendly if cut and copy work by default on the current item and take marks into account only if there are any ? Or at least have the default behaviour as a user option

Close on lose focus

Hello!

I'm using this plugin and love it so far! But, I think is good to when I open the float and do <C-w>h (to back the focus to the opened file) the float window closes. Maybe it's a good idea to close it when loses focus?

Or just disable all others keymaps (like telescope do)?

Gravacao.de.Tela.2021-04-30.as.21.46.32.mov

Thanks!

Make optional file opener callback function

I'm thinking that if the user can supply a callback that's triggered on selection, what you do with it could be much more versatile, eg. Handing out certain filetypes to external programs.

Error: Get Filter Error after #5d62e83 commit

Hey @tamago324, got this error after the last commit for filter

Error:
E5108: Error executing lua ...n/.local/share/nvim/lazy/lir.nvim/lua/lir/float/init.lua:170: Vim(lua):E5108: Error executing lua /home/pheon/.local/share/nvim/lazy/lir.nvim/lua/lir.lua:173: attempt to call field 'get_filters' (a nil value)
stack traceback:
	/home/pheon/.local/share/nvim/lazy/lir.nvim/lua/lir.lua:173: in function 'do_filter'
	/home/pheon/.local/share/nvim/lazy/lir.nvim/lua/lir.lua:229: in function 'init' [string ":lua"]:1: in main chunk [C]: in function 'cmd'
	...n/.local/share/nvim/lazy/lir.nvim/lua/lir/float/init.lua:170: in function 'init'
	...n/.local/share/nvim/lazy/lir.nvim/lua/lir/float/init.lua:86: in function 'toggle'
	[string ":lua"]:1: in main chunk stack traceback:
	[C]: in function 'cmd'
	...n/.local/share/nvim/lazy/lir.nvim/lua/lir/float/init.lua:170: in function 'init'
	...n/.local/share/nvim/lazy/lir.nvim/lua/lir/float/init.lua:86: in function 'toggle'
	[string ":lua"]:1: in main chunk

Overrides nvim-nonicons

Hello, I use nvim-nonicons
When I set devicons_enable = true in lir.setup({}) everything (expressline, telescope) uses the default web-devicons instead of nonicons

Add LirCursorLine hightlight

As the current float window use CursorLine hightlight for selection, May I request adding a LirCursorLine highlight group.

e.g set hi link LirCursorLine Visual

Small doc suggestion

Might want to mention in the README that by default there are no keymaps (at least, as far as I could tell) so when installing you're not surprised that nothing is happening 😆

Cool plugin :) I like it thus far!

Advice on implementing plugin integration

Hi! Wanted to reach out as I'm looking into adding lir.nvim support to distant.nvim in the near future. Do you have any recommendations on the best practices for altering how lir accesses the filesystem? My integration would want to change how lir reads, opens, etc.

What is distant?

My plugin's goal is to enable listing, creating, deleting, and editing files remotely on another machine from the comfort of neovim. Rather than netrw's scp approach, this actually runs a small program I've written called distant that listens for encrypted commands. I've gotten most of the functions working now in the plugin, so I'm looking to spruce it up by integrating some of the plugins I use on my local machine.

What am I trying to do?

While I could have lir's settings specify equivalent actions that act on the remote machine, I want to be able to distinguish lir operating locally (like it does today) versus remotely with distant. E.g. if I start lir with some flag that it's using the remote machine, then all of the actions would be through distant whereas if I start lir without that flag then it works as normal

Root dir is not loaded properly when accessing from `lir` buffer

I have the following action to go to the root dir similar to what you mentioned in the Wiki for going to the home dir:

    ["`"] = function()
      vim.cmd("edit /")
    end,

I tried using the above key binding from both the floating window and the split view and in both cases lir opened a blank buffer, although when I refreshed the buffer using :edit, then it shows me all the entries.

Screen.Recording.2021-05-25.at.11.42.42.mov

I also tried doing :edit / from a normal buffer and that works perfectly. I don't know why this is happening.

Disable netrw

In the terminal if I do $ nvim /path/to/directory/ as the docs suggest, netrw opens instead of lir.
Do I need to configure something special or is a bug?

Should `mkdir` create the parent directories?

Plenary provides this functionality through the option: path:mkdir { parents = true }

It would be useful if a user wants to create multiple directories like foo/bar/baz in one shot.

Conflict with nvim-tree

I am using this to specifically open my notes directory and nvim tree for everything else as this plugin allows me to open a floating window. However, with nvim tree enabled this plugin 1) gives the following error 2) opens nvim-tree

E5108: Error executing lua ...vim/site/pack/packer/opt/lir.nvim/lua/lir/float/init.lua:138: Vim(lua):E5108: Error executing lua ...vim/site/pack/packer/opt/nvim-tree.lua/lua/nvim-tree.lua:317:
 Invalid buffer id: 74
stack traceback:
        [C]: in function 'nvim_buf_delete'
        ...vim/site/pack/packer/opt/nvim-tree.lua/lua/nvim-tree.lua:317: in function 'open_on_directory'
        [string ":lua"]:1: in main chunk
        [C]: in function 'cmd'
        ...vim/site/pack/packer/opt/lir.nvim/lua/lir/float/init.lua:138: in function 'init'
        ...vim/site/pack/packer/opt/lir.nvim/lua/lir/float/init.lua:82: in function 'toggle'
        [string ":lua"]:1: in main chunk
stack traceback:
        [C]: in function 'cmd'
        ...vim/site/pack/packer/opt/lir.nvim/lua/lir/float/init.lua:138: in function 'init'
        ...vim/site/pack/packer/opt/lir.nvim/lua/lir/float/init.lua:82: in function 'toggle'
        [string ":lua"]:1: in main chunk

Add completion for `rename` and move into directory if only a directory is specified.

It would be useful if the rename functionality game command line completion for the file renaming now when directory moval is possible.

It would also be useful if only a directory is specified, e.g; "lua" or ".."

This is how the linux mv command works.

I will open a pull request if such a feature is wanted.

The default behaviour will be kept.

The prompt can be left empty (instead of the old name) is config.rename_default is false.

I do not know if that should be default behaviour or not, so I've left it as it was before

Keymaps should have `nowait = true` to avoid waiting

There could be similar mappings globally which would clash in the lir buffer making the keypresses wait for some time before executing. Eg., q to quit, etc.

There are two solutions here:

  1. Provide the nowait = true option in the code directly
  2. Give user the option to provide what options to pass for setting the keymaps (similar to gitsigns.nvim)

Cannot delete non-empty directory

The function used to delete vim.loop.fs_rmdir which is similar to rmdir utility cannot delete directories which are non-empty:

{
  [2] = "ENOTEMPTY: directory not empty: /Users/dhruvmanilawala/dotfiles/config/nvim/scratch/test",
  [3] = "ENOTEMPTY"
}

The confirmation prompt asks for the force option as well but that does not seem to be doing anything nor used in the code.

Devicon colors do not work

local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "https://github.com/folke/lazy.nvim.git",
    "--branch=stable", -- latest stable release
    lazypath,
  })
end
vim.opt.rtp:prepend(lazypath)

require("lazy").setup({
  {
    "catppuccin/nvim",
    name = "catppuccin",
    priority = 1000,
    config = function()
      vim.cmd.colorscheme("catppuccin")
    end,
  },
  {
    "nvim-tree/nvim-web-devicons",
    opts = { default = true },
  },
  {
    "tamago324/lir.nvim",
    dependencies = {
      "nvim-lua/plenary.nvim",
      "nvim-tree/nvim-web-devicons",
    },
    config = function()
      require("lir").setup({
        show_hidden_files = false,
        ignore = {}, -- { ".DS_Store", "node_modules" } etc.
        devicons = {
          enable = true,
          highlight_dirname = false,
        },
        float = {
          winblend = 0,
          curdir_window = {
            enable = false,
            highlight_dirname = false,
          },
        },
        hide_cursor = true,
      })

      vim.api.nvim_create_autocmd({ "FileType" }, {
        pattern = { "lir" },
        callback = function()
          -- use visual mode
          vim.api.nvim_buf_set_keymap(
            0,
            "x",
            "J",
            ':<C-u>lua require"lir.mark.actions".toggle_mark("v")<CR>',
            { noremap = true, silent = true }
          )

          -- echo cwd
          vim.api.nvim_echo({ { vim.fn.expand("%:p"), "Normal" } }, false, {})
        end,
      })
    end,
  },
})

Additional user configurable hl-groups

Hi,

Could you please make the directory (and I guess symlink) hl-groups configurable?
The hl I have for the default FuncRef isn't very fitting.

Thanks!

FYI on dirvish/netrw style `nvim ./`

If lir.nvim is loaded within the vim.defer_fn() than dirvish/netrw style loading will not work properly. I do not know why this is, but just wanted to make you aware. I do not know if this is something that can be fixed or if the answer is to either avoid defer_fn entirely or to just be aware that if you use it you'll need to than call lir outside of it.

Toggle mode, disabling going down

Hi, thank you for the amazing plugin.

I want to disable going one line below when toggling. It really bothers me. Is there a way to configure it?
Thanks.

Hide cursor bug

If I use the option to hide the cursor, the colors shift one character to the right making it look weird.

Here is the cursor enabled:
image

Here the cursor is hidden:
image

Screenshots

Please add some screenshots in the README.md.

Don't show files set in `wildignore`

Similar to netrw it would be nice to filter out files defined in wildignore. For instance, I never want to see .DS_Store.

I'm open to creating a PR for it if you give me some pointers.

Error using `nvim .` after disabling netrw

If I don't disable netrw it still opens instead of lir when I do nvim . but if I do disable netrw (as shown in my config below) I get the following error:

Error detected while processing VimEnter Autocommands for "*"..function <SNR>15_VimEnter[10]..<SNR>15_LocalBrowse:
line   32:
E117: Unknown function: netrw#LocalBrowseCheck
Press ENTER or type command to continue

Here's my lir config:

return {
	"tamago324/lir.nvim",
	config = function()
		local loaded, lir = pcall(require, "lir")
		if not loaded then return end

		vim.g.loaded_netrw = 1
		vim.g.loaded_netrwPlugin = 1

		local actions = require("lir.actions")
		lir.setup({
			show_hidden_files = true,
			mappings = {
				["<cr>"] = actions.edit,
				["-"] = actions.up,
				["d"] = actions.mkdir,
				["D"] = actions.wipeout,
				["%"] = actions.newfile,
				["R"] = function() actions.rename(false) end,
				["r"] = actions.reload,
			},
		})

		vim.api.nvim_create_user_command("Lir", function()
			local directory = vim.fn.expand("%:p:h")
			vim.cmd.edit({
				args = { directory },
			})
		end, {})
	end,
}

Edit: Here's the more verbose error from using nvim -V10nvim.log .:

Error detected while processing BufEnter Autocommands for "*":
E5108: Error executing lua Vim:E194: No alternate file name to substitute for '#'
stack traceback:
        [C]: in function 'expand'
        ...l/share/nvim/site/pack/packer/start/lir.nvim/lua/lir.lua:182: in function 'init'
        [string ":lua"]:1: in main chunk
Error detected while processing VimEnter Autocommands for "*"..function <SNR>23_VimEnter[10]..<SNR>23_LocalBrowse:
line   32:
E117: Unknown function: netrw#LocalBrowseCheck
Press ENTER or type command to continue

Feature requests / Suggestions

This is such an amazing plugin with a beautiful and intuitive API. Thanks for making this :)

This is just me dumping out my ideas, feel free to ignore them if not viable.

For floating window:

  • Provide additional options like width_percentage/height_percentage. This will allow configuration to make the window have more height then width, as most of the space is just empty.

Overall:

  • Option to enable file details like ls -l/Telescope file_browser and ability to toggle them in the buffer similar to show_hidden_files/actions.toggle_show_hidden
  • Update implementation for newfile to be similar to that of mkdir. Currently, newfile opens the buffer with the filename, but does not actually create the file unless we save the buffer.
  • #22
  • Delete the buffer when deleting files/directories, similar to how vim-eunuch does with :Delete: Delete a buffer and the file on disk simultaneously. or maybe provide two options, again similar to vim-eunuch: (1) To delete both buffer and file, (2) To only delete the file (already provided) #40

I could open a few PRs to implement most of the above as I have already done it in my own config.

Fullpath contains double slash before filename

When running command like this in lir buffer

:lua print(require"lir".get_context():current().fullpath)

the resulting path looks like:
/home/my_user//test.txt on wsl
C:\Users\my_user\\test.txt on windows

using:

  • lir: commit 969e95b
  • nvim v0.9.4
  • both on windows and wsl

Float fails when in Terminal buffer

To reproduce:

  1. :terminal<cr>
  2. :lua require'lir.float'.toggle()
  3. The opposite of profit

As best as I can tell, if you toggle a floating Lir window while in a terminal buffer, Lir will fail with the error

...lir/float/curdir_window.lua:98: attempt to index a ni value

In addition to this error in the command area, it shows Process exited 0 in the floating window. Upon exiting this window :q the "heading" window (smaller floating window above the larger floating window) remains up and will not go away until Neovim is exitted.

I discovered another issue that I cannot replicate but I believe might be tied to the above issue nonetheless:

Sometimes a buffer of Lir seems to "hang" in the background. For some reason this buffer cannot be killed and :q will not quit, due to this buffer being open. The only way to escape from this Neovim-jail is with a :quitall. There is a chance that this is unrelated to Lir, however it seems to only ever happen following the above error.

bug: Error detected while processing BufEnter Autocommands for "*":

got this output upon launching nvim (running nvim . in the terminal in a directory)

Error detected while processing BufEnter Autocommands for "*":
E5108: Error executing lua ...pack/packer/start/lir.nvim/lua/lir/smart_cursor/init.lua:49: E545: Missing colon
stack traceback:
        [C]: in function 'nvim_set_option'
        ...pack/packer/start/lir.nvim/lua/lir/smart_cursor/init.lua:49: in function '_hide'
        ...pack/packer/start/lir.nvim/lua/lir/smart_cursor/init.lua:61: in function 'init'
        ...l/share/nvim/site/pack/packer/start/lir.nvim/lua/lir.lua:214: in function 'init'
        [string ":lua"]:1: in main chunk

im using the default configuration in the README

image

Can't use lir.nvim at the same time as oil.nvim

I recently added oil.nvim as I like the way you can add and change file names. I don't want to use lir-mmv, as I prefer the interface of oil better for changing. But when I use oil, lir stops working properly. I like navigating through directories using l and h and that functionality stoped when I added oil.nvim. Please fix

Some issues with README

I don't think the Screenshots are actually present in the images repo. I tried to download them but it didn't happen.

Also in lir setup if the if I comment out the this portion :-

  float = {
    size_percentage = 0.5,
    winblend = 15,
    border = true,
    borderchars = {"╔" , "═" , "╗" , "║" , "╝" , "═" , "╚", "║"},
    shadow = true,
  },

I am able to see the window borders. If these are not commented out I can't see the borders.

I think it is kind of difficult to figure out how to open a non-floating window.

Make rename behave like linux `mv`

This would allow both renaming and moving with the same command and is already intuitive for those using linux or unix

I have already opened a pull request which implements this
#59

guicursor not restored to custom setting when hide_cursor is enabled

If I have manually set guicursor to something other than the default provided and have hide_cursor enabled in lir then after opening lir a file in lir will reset it back to the nvim provided default and not the user provided option.

Steps to reproduce:

  1. set guicursor=n-v-c-sm:block,i-ci-ve:block,r-cr-o:hor20
  2. Add hide_cursor to lir setup require('lir').setup({ hide_cursor = true })
  3. Open a lir instance with :lua require('lir.float').toggle()
  4. Choose a file to open
  5. Check guicursor with :set guicursor?

Expected Result

guicursor should be the same as set in Step 1

Actual Result

guicursor is set to default nvim guicursor setting: n-v-c-sm:block,i-ci-ve:ver25,r-cr-o:hor20


I have a fork with the proper changes needed for it to persist user configured option with hide_cursor enabled and be will to make the PR. But I wanted to see if it is an issue with other users as well before I can proceed.

Folder icon doesn't appear correctly

image
In the above screenshot src/ is a folder, but the icon doesn't show correctly.
My Configuration is copy and pasted from the README of lir.nvim.

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.