Last active
August 18, 2022 20:06
-
-
Save humodz/71e3840c7161ba49d96f49d2aa627ca7 to your computer and use it in GitHub Desktop.
Use broot as a file browser for neovim
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Use broot as a file browser for neovim |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Search using broot | |
noremap <C-B> :call RunBroot()<CR>i | |
fun! RunBroot() | |
let l:command = 'broot --conf ~/my-config/nvim-broot.toml' | |
enew | |
call termopen(l:command, {'on_exit': 'BrootOnExit'}) | |
endfun | |
fun! BrootOnExit(job_id, code, event) dict | |
let l:filename = getline(1) | |
enew | bd! # | |
if (l:filename != '') | |
execute 'edit ' . l:filename | |
else | |
bp | |
endif | |
endfun |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[verbs]] | |
invocation = "ok" | |
key = "enter" | |
leave_broot = true | |
execution = ":print_path" | |
apply_to = "file" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment