• Stars
    star
    349
  • Rank 120,756 (Top 3 %)
  • Language
    Lua
  • License
    MIT License
  • Created almost 4 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Neovim file explorer

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

More Repositories

1

nlsp-settings.nvim

A plugin for setting Neovim LSP with JSON or YAML files
Lua
316
star
2

cmp-zsh

nvim-cmp source for zsh
Shell
68
star
3

LeaderF-filer

📂 LeaderF file explorer
Python
39
star
4

nowt36

30
star
5

nowt36lp

25
star
6

compe-zsh

zsh completion source for nvim-compe
Shell
21
star
7

lir-git-status.nvim

Git status integration of lir.nvim
Lua
15
star
8

telescope-sonictemplate.nvim

sonictemplate-vim integration
Lua
14
star
9

vimfiles

My vimfiles
Lua
12
star
10

tiknot.nvim

A disposable floating window.
Lua
12
star
11

vim-gaming-line

🌈 Vim Plugin for Gamers!
Vim Script
11
star
12

vim-browsersync

This plugin uses browser-sync from Vim.
Vim Script
10
star
13

lsp-preview-hover-doc.nvim

textDocument/hover plugin
Lua
9
star
14

telescope-openbrowser.nvim

openbrowser.vim integration
Lua
9
star
15

lir-bookmark.nvim

Lua
7
star
16

lir-mmv.nvim

Lua
7
star
17

vim-clap-help

vim-clap help provider
Vim Script
7
star
18

split-mini

36 key split keyboard
7
star
19

dps-gignore

Generating gitignore using gitignore.io
TypeScript
7
star
20

PyTwitcasting

PyTwitcasting is a library for API v2 (β) of Twitcasting.
Python
6
star
21

small-keycaps

OpenSCAD
6
star
22

lua-gameoflife.nvim

Lua
6
star
23

gku34

Game Maker Language
5
star
24

LeaderF-bookmark

📑 This Plugin use LeaderF to navigate the bookmark.
Python
5
star
25

compe-necosyntax

neco-syntax completion source for nvim-compe
Lua
3
star
26

date_the_image

Python
3
star
27

LeaderF-openbrowser

🌐 This Plugin use LeaderF to navigate the OpenBrowser url.
Python
2
star
28

LeaderF-sonictemplate

Vim Script
2
star
29

korpo44

自分のためのキーボード
Makefile
2
star
30

EvoRoll

Game Maker Language
2
star
31

haqua34

Game Maker Language
2
star
32

LeaderF-neosnippet

Vim Script
1
star
33

LeaderF-packadd

LeaderF :packadd
Vim Script
1
star
34

cmp-deol-history

nvim-cmp source for deol.nvim
Lua
1
star
35

gu34

34 key choc v1 keyboard
1
star
36

keyboard-firmwares

C
1
star
37

post_nanaco_slack

Get nanaco balance info
Python
1
star