Edit and search your directory tree like a buffer. The explosive mixture of Broot and Oil you never knew you needed!.
tested on: Latest master branch version of neovim, (Macos & Linux)
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 |
~
- 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
Search by filecontents using regex that would work in vims string:find('yoursearch')
search_options.mov
- 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
- 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.
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',
},
}
}
Want to help me make this plugin better? Create a pull request!
MIT