Skip to content

Broil.nvim - Edit and search your directory tree like a buffer. The explosive mixture of broot and oil you never knew you needed!.

License

Notifications You must be signed in to change notification settings

JonasLeonhard/broil

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

Broil = Broot + Oil

Edit and search your directory tree like a buffer. The explosive mixture of Broot and Oil you never knew you needed!.

⚠️ This Plugin is in Beta. So expect stuff to not 100% work and expect breaking changes at any point. Especially make sure that the paths in your edits actually match what was beeing edited!

tested on: Latest master branch version of neovim, (Macos & Linux)

Features

Tree View & Fuzzy Search

Fuzzy search using using telescope-fzf-native:

Open.and.search.mp4

Broil supports the fzf syntax of telescope-fzf-native: ...From their readme: fzf-native is a c port of [fzf][fzf]. It only covers the algorithm and implements few functions to support calculating the score.

This means that the fzf syntax is supported:

Token Match type Description
sbtrkt fuzzy-match Items that match sbtrkt
'wild exact-match (quoted) Items that include wild
^music prefix-exact-match Items that start with music
.mp3$ suffix-exact-match Items that end with .mp3
!fire inverse-exact-match Items that do not include fire
!^music inverse-prefix-exact-match Items that do not start with music
!.mp3$ inverse-suffix-exact-match Items that do not end with .mp3

Cross Directory Buffer Editing:

~ ⚠️ NOTE: this feature is currently experimental and not quite stable, so make sure to look at the edits build from your buffer changes. This feature is not quite ironed out yet! ~

  • create, copy, move, rename & delete ...by just editing the current tree view buffer:
cross_dir_editing.mp4

your edits stay persistent across directories and searches, only you staged changes will get applied. And if you dont like them, you can undo them in a batch - or one by one:

persistent_state.mp4
  • run any terminal command like touch, mkdir, ls, chmod and see the output

Some chars combinations in the terminal mode get autofilled:

  • "%" = path of the currently selected node
  • "%n" = name of the currently selected node
  • "." = path of the currently opened tree view
verb.mp4

Content Search

Search by filecontents using regex that would work in vims string:find('yoursearch')

search_options.mov

Settings

  • Change the search mode (fuzzy searching via file/dir names, or by file contents in the current tree dir)
  • show / hide hidden dot files and directories
  • Sorting by type
  • Sorting alphabetically
  • Sorting by size
  • Sorting by children_count
  • Sort the above (sort order) ascending and descending
  • Fuzzy case mode (smart_case, ignore_case, respect_case)
  • Toggle Fuzzy Search

default Keybindy:

  • gg and g
  • C-j, C-k, j, k, C-u, C-d - movement & scrolling
  • C-l or CR - Open selected
  • C-h - go dir up
  • C-w k - change window up
  • C-w j - change window down
  • C-w l - change window right
  • C-w h - change window left
  • C-q - close window
  • ":" in search prompt to run shell command
  • C-e show edits
  • C-c show config
  • C-z toggle between netrw & broil view.

Configuration

Lazy
return {
  'JonasLeonhard/broil',
  dependencies = {
    "nvim-lua/plenary.nvim",
    "nvim-tree/nvim-web-devicons",
    {
      'nvim-telescope/telescope-fzf-native.nvim',
      cond = function()
        return vim.fn.executable 'make' == 1
      end,
      build =
      'make'
    }
  },
  opts = {
    -- rm_command = 'rm <FROM>', -- optional...(default 'rm'). you could use a trash command here. Or rm --trash for nushell...
    -- ... you can find more opts in ":h broil" or lua/broil/config.lua
  },
  keys = {
    {
      '<leader>o',
      "<cmd>lua require('broil').open()<cr>", -- opens current %:h or cwd by default
      desc = 'Broil open',
    },
    {
      '<leader>O',
      "<cmd>lua require('broil').open(vim.fn.getcwd())<cr>",
      desc = 'Broil open cwd',
    },
  }
}

Contributing

Want to help me make this plugin better? Create a pull request!

License

MIT

About

Broil.nvim - Edit and search your directory tree like a buffer. The explosive mixture of broot and oil you never knew you needed!.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages