Add vi-mode
Needs RevisionPublic

Authored by rominf on Mar 15 2018, 1:47 PM.

Details

Reviewers
markg
ngraham
Group Reviewers
Dolphin
Summary

Add vi-mode (inspired by ranger)

FEATURE: 94001

Supported functionality:

  • Move to trash (x or d)
  • Go home (gh)
  • Go root (gr)
  • Paste (p)
  • Undo (u)
  • Copy (y)
  • Move selection up and down (k and j)
  • Go up (h)
  • Open selected item (l)
  • Select/deselect files one by one (+ and -)

Test Plan

See the video

Diff Detail

Repository
R318 Dolphin
Branch
vi-mode
Lint
No Linters Available
Unit
No Unit Test Coverage
rominf requested review of this revision.Mar 15 2018, 1:47 PM
rominf created this revision.
rominf edited the summary of this revision. (Show Details)Mar 15 2018, 1:48 PM

Lot's of actions can also be implemented. I'm looking for a feedback. If feedback will be positive, I'll implement additional functionality like switching between tabs.

While I think this could be useful (never used vi) your patch breaks the selection of files.
For example I created a bunch of files, each one starts with one letter from the alphabet and now I want to jump to "h.txt" so I press the letter h on my keyboard and it jumpes up instead of selecting the file which is bad.

markg requested changes to this revision.Mar 15 2018, 2:26 PM
markg added a subscriber: markg.

-1 as is.
It's not a "mode" as you currently implemented it. It's a "always on" thingy.
It should be behind a switch somewhere and off by default.

I'm also not sure if this would be accepted. Not every feature request should be implemented.
Things like this would be perfectly suited for a plugin, too bad Dolphin has no plugin support ;)

This revision now requires changes to proceed.Mar 15 2018, 2:26 PM
ngraham requested changes to this revision.Mar 15 2018, 2:27 PM
ngraham added a subscriber: ngraham.

Kate's "vi mode" is a dedicated mode that you need to turn on; it's not always on, or on by default. If this is to be added to Dolphin, it needs to be the same way, hidden behind an option, because it's a super-advanced feature that would only confuse normal or even advanced-but-not-unix-nerd-expert users.

I'm also not even sure how much sense this makes conceptually. vi is a text editor; Dolphin is a file manager. The concepts don't really mesh very well.

OK, the main problem from your comments is that it's enabled by default. I followed the example of Okular with it's hjkl keys for movements (those keys are enabled by default, you can test it).

But it's not a big deal, I can make it an option that's disabled by default.

@mmustac OK, it indeed breaks select-as-you-type feature. As a workaround, it's possible to use / to invoke a filter panel.

I'm also not sure if this would be accepted. Not every feature request should be implemented.
Things like this would be perfectly suited for a plugin, too bad Dolphin has no plugin support ;)

Kate and Okular have a plugin system, although they have vi-mode builtin. What's wrong with having a functionality what's disabled by default?

I'm also not even sure how much sense this makes conceptually. vi is a text editor; Dolphin is a file manager. The concepts don't really mesh very well.

From a vi user perspective, vi-mode make sense in any application. See those two lists.
As for file managers, look at ranger. It's one of the most popular console file managers.

So, will you accept this if I make it optional and disabled by default?

We'll have to see once we get there! :)

markg added a comment.Mar 15 2018, 4:11 PM

OK, the main problem from your comments is that it's enabled by default. I followed the example of Okular with it's hjkl keys for movements (those keys are enabled by default, you can test it).

But it's not a big deal, I can make it an option that's disabled by default.

@mmustac OK, it indeed breaks select-as-you-type feature. As a workaround, it's possible to use / to invoke a filter panel.

I'm also not sure if this would be accepted. Not every feature request should be implemented.
Things like this would be perfectly suited for a plugin, too bad Dolphin has no plugin support ;)

Kate and Okular have a plugin system, although they have vi-mode builtin. What's wrong with having a functionality what's disabled by default?

I'm also not even sure how much sense this makes conceptually. vi is a text editor; Dolphin is a file manager. The concepts don't really mesh very well.

From a vi user perspective, vi-mode make sense in any application. See those two lists.
As for file managers, look at ranger. It's one of the most popular console file managers.

So, will you accept this if I make it optional and disabled by default?

Well, i will only review the code and then resign when it's OK in my opinion. I'm not going to give a +1 for this feature as i highly doubt it's usefulness and therefore only clutters the code with a feature no-one (or very few people) will use.
If others like it then there might be a justifications for adding it. I guess you just have to find some people who would really like to have this.

I'm also not sold on the usefulness of this. Dolphin can already be fully controlled by keyboard only. Ranger also has to have these extensive key bindings since it's not a GUI application so without those you can't really use it.

On the other hand, If this will indeed go through then it probably needs to be a slew of configurations to customize key mappings and so on instead of having them hard coded into the keyPress event. Could be suitable for a plugin, but I'm not sure if this needs to go into the main repository.