Code Monkey home page Code Monkey logo

Comments (31)

Canop avatar Canop commented on May 16, 2024 12

Yes, I should work on including those, maybe through readline modes, for both vi and emacs styles.

from broot.

dgrisham avatar dgrisham commented on May 16, 2024 10

+1 for vi keybindings. Would also be nice to just be able to set custom keys in general :)

from broot.

fnune avatar fnune commented on May 16, 2024 8
[[verbs]]
name = "line_down"
key = "ctrl-n"
execution = ":line_down"

[[verbs]]
name = "line_up"
key = "ctrl-p"
execution = ":line_up"

I added my own ctrl-p and ctrl-n by adding custom verbs that just call built-in verbs.

from broot.

derrickcope avatar derrickcope commented on May 16, 2024 7

+1 for "hjkl" keybinds for navigation

from broot.

Canop avatar Canop commented on May 16, 2024 4

Broot 1.5.0 just released

from broot.

derrickcope avatar derrickcope commented on May 16, 2024 3

I would just use "/" to search or filter like in vim or vifm.
I would love to replace vifm with broot. Seems like this is more light weight.

Edit: after playing with broot for a little while I see that you are meant to use fuzzy find to navigate rather that navigation keys. It's a great app. I need to play with it a bit longer to see if I can replace my file manager.

from broot.

Canop avatar Canop commented on May 16, 2024 2

This might help other users. Maybe we'll include it in the documentation.

from broot.

Canop avatar Canop commented on May 16, 2024 1

invocation was needed previously but isn't in recent versions of broot.

from broot.

Canop avatar Canop commented on May 16, 2024 1

There's currently no internal you could use to clear the input. I'll add one.

from broot.

Canop avatar Canop commented on May 16, 2024

+1 for "hjkl" keybinds for navigation

and how would you deal with search ? Right now those keys would filter the tree.

from broot.

 avatar commented on May 16, 2024

make sure you dont hard-set those bindings, as not everyone is using qwerty.

from broot.

anuvyklack avatar anuvyklack commented on May 16, 2024

+1 for "hjkl" keybinds for navigation

and how would you deal with search ? Right now those keys would filter the tree.

Good option to use Ctrl + hjkl like in fzf. When Ctrl is bind to Caps Lock key it's super convenient.

from broot.

Canop avatar Canop commented on May 16, 2024

@anuvyklack you can already bind ctrl + hjkl to navigation functions in broot. See https://dystroy.org/broot/documentation/configuration/#keyboard-key

from broot.

anuvyklack avatar anuvyklack commented on May 16, 2024

@Canop I've tried but it doesn't work. It seems like a bug. `alt + hjkl' works perfect. But it's not convenient everywhere use ctrl and in broot use alt.

Is it really a bug? Need I open an issue?

from broot.

Canop avatar Canop commented on May 16, 2024

I just tried and noticed that ctrl-j seems to be one of those key combinations that my terminals intercepts.

That's the biggest problem usually: when the terminal already handles the chars, it's hard to do anything.

You can open an issue, with the exact configuration you tested which didn't work.

from broot.

Canop avatar Canop commented on May 16, 2024

@fnune just to be clear: does this configuration works for you ?

from broot.

fnune avatar fnune commented on May 16, 2024

Indeed it does! I could add keybindings for everything this way, I think.

from broot.

fnune avatar fnune commented on May 16, 2024

I think my "name" attribute is superfluous there and key + execution should suffice. But you probably know better :)

from broot.

Canop avatar Canop commented on May 16, 2024

What could be a "planned" way ? A part of the config to uncomment maybe ? I don't want to have users opt-in for some key bindings in a whole and not being able to change them.

from broot.

fnune avatar fnune commented on May 16, 2024

I deleted the previous comment because I thought a bit more about it: I think the current options are totally fine.

from broot.

gubikmic avatar gubikmic commented on May 16, 2024

Hmm, @fnune adding your config, broot complains:

Invalid [[verbs]] entry in configuration
Missing invocation
Invalid [[verbs]] entry in configuration
Missing invocation

from broot.

jwr avatar jwr commented on May 16, 2024

Just wanted to mention that I tried broot, and really liked it, but the first thing I wanted to do as a long-time Emacs user was use Control-N and Control-P to move down/up.

The next thing I expected (I do not know why?) was being able to compose a command line by pressing Command/Control/Alt-Enter and having the currently selected file/directory name copied to the end of a command line. I guess that's because I am old enough to have Norton Commander in my finger memory.

from broot.

Canop avatar Canop commented on May 16, 2024

@jwr It's not clear if you noticed, but ctrl-n / ctrl-p is easy (see up if necessary).

Regarding the second part, I'm not sure I follow you (I don't remember Norton Commander well enough, I guess it's Alzheimer). Are you after the :print_path verb and mapping it to the desired key shortcut (https://dystroy.org/broot/documentation/configuration/#verbs-shortcuts-and-keys) ?

from broot.

jwr avatar jwr commented on May 16, 2024

@Canop I thought the setup above didn't work based on the comments. Now I wanted to try it, but I am ashamed to admit I can't figure out where the configuration file is supposed to live (Mac OS). I looked at https://dystroy.org/broot/documentation/configuration/#opening-the-configuration-file but it only mentions "conf.toml" and says the location is OS-dependent. The method with typing :os from help doesn't seem to work for me (verb not found "os" and when trying :open_stay nothing happens — am I supposed to enter the name of the file now?).

Also, I think this is only a partial solution — this doesn't let me use Ctrl-A/Ctrl-E as Home/End in the command line, or press Ctrl-K to kill from cursor to the end of the line.

As for :print_path, no, this is not quite what I meant. In Norton Commander you could start typing a command line (say type "mv", and use Ctrl-ENTER to append selected file or directory names one by one, so you would build up "mv file1.txt file2.txt some_dir" and then execute it with ENTER once you were ready). I realize broot has a different UI concept, but this could be something to think about.

from broot.

Canop avatar Canop commented on May 16, 2024

@jwr when you type ?, you're normally shown the help screen, which displays the path to the config file.

Regarding the other shortcuts, like the ones to navigate into the input, I have no objections against adding a few other verbs even if rarely used but please make sure you've read the documentation on https://dystroy.org/broot/documentation/usage/ and https://dystroy.org/broot/documentation/configuration/ )

Last point understood, thanks.

from broot.

jwr avatar jwr commented on May 16, 2024

@Canop Thanks, now I can see the config file path, my terminal colors made it difficult to see. I also feel silly for not seeing it earlier.

I will do my best to configure the Emacs keybindings and come back with suggestions of things that might be added.

from broot.

fnune avatar fnune commented on May 16, 2024

Hmm, @fnune adding your config, broot complains:

Invalid [[verbs]] entry in configuration
Missing invocation
Invalid [[verbs]] entry in configuration
Missing invocation

@gubikmic It worked for me. Maybe it's referring to a missing invocation attribute like it appears on other verbs:

[[verbs]]
name = "view"
invocation = "view"
execution = "$PAGER {file}"

Maybe you can try adding that?

from broot.

partiallyordered avatar partiallyordered commented on May 16, 2024

@Canop it's taken a few brushes but I'm starting to find myself incorporating broot into my workflow. It's a pleasure to use when I have the impetus to do so, thank you for developing it.

I came across this issue looking for the exact same keybindings as the original poster: c-w and c-u. I was able to map ctrl-w to :input_del_word_left. The documentation doesn't seem to indicate any input verb to clear the input. I tried to map ctrl-u to :back, noticing only that Esc was default mapped to :back, but having used that and it having not done as I expected, it seems as though Esc performs :back and the additional function of clearing the line. I'm a total amateur broot user so I might be misunderstanding something. Just wondering if there's a way to get the ctrl-u functionality so I can bring my muscle memory 😁

from broot.

partiallyordered avatar partiallyordered commented on May 16, 2024

That would be great, I'd really appreciate that. No rush, no pressure, take it easy. Thank you again!

from broot.

Canop avatar Canop commented on May 16, 2024

I've added the :input_clear internal which may be mapped this way:

	{
		key: ctrl-u
		internal: ":input_clear"
	}

It will be officially available in 1.5.0 which should be released in a few hours

from broot.

partiallyordered avatar partiallyordered commented on May 16, 2024

That's amazing, thank you for your super-quick response. Now to get it in my env.. 😁. Thanks again.

from broot.

Related Issues (20)

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.