Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redesign hotkeys #116

Closed
yorukot opened this issue May 11, 2024 · 5 comments
Closed

Redesign hotkeys #116

yorukot opened this issue May 11, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@yorukot
Copy link
Owner

yorukot commented May 11, 2024

Basically, the hotkey of superfile is just to put whatever I think of, which is different from the habits of most users.

The redesign hopes to be based on the usage habits of most file managers/nvim.

This new design is expected to be added in the next version

If you have your own hotkeys design, please share below!

@yorukot yorukot added the enhancement New feature or request label May 11, 2024
@mactanxin
Copy link

is it possible to combine actions in to one? like using a for both create new file and folder, when name is ending with / means a new folder, otherwise just whatever file-type entered.

@yorukot
Copy link
Owner Author

yorukot commented May 11, 2024

I like this idea about typing / to create folder!

@yorukot
Copy link
Owner Author

yorukot commented May 11, 2024

# =================================================================================================
# Here is global, all global key cant conflicts with other hotkeys
confirm = ['enter', 'l']
quit = ['q', 'esc'] # (q)uit
# movement
list_up = ['up', 'k'] # most user use
list_down = ['down', 'j'] # most user use
# file panel controll
close_file_panel = ['w', '']
create_new_file_panel = ['n', ''] # (n)ew file panel
next_file_panel = ['tab', 'L']
previous_file_panel = ['shift+left', 'H']
# change focus
focus_on_process_bar = ['p', ''] # (p)rocessbar
focus_on_sidebar = ['s', ''] # (s)idebar
focus_on_metadata = ['m', ''] # (m)etadata
# create file/directory and rename 
file_panel_item_create = ['ctrl+n', ''] # (n)ew file or folder
file_panel_item_rename = ['ctrl+r', ''] # (r)name
# file operate
copy_items = ['ctrl+c', '']  # Most systems are for (c)opy
paste_items = ['ctrl+v', ''] # Most systems are for pasting
cut_items = ['ctrl+x', ''] # Most systems are for cut
delete_items = ['ctrl+d', 'delete'] #(d)elete
# compress and extract
extract_file = ['ctrl+e', ''] # (e)xtract
compress_file = ['ctrl+a', ''] # (a)rchive file
# editor
oepn_file_with_editor = ['e', ''] # (e)ditor
open_current_directory_with_editor = ['E', ''] # (E)ditor
# else
pinned_directory = ['P', ''] # (P)inned
toggle_dot_file = ['.', ''] # (.)dot
change_panel_mode = ['v', ''] # (v)isual
open_help_menu = ['?', '']
# =================================================================================================
# Here is typing hotkey can conflict with all hotkeys
confirm_typing = ['enter', '']
cancel_typing = ['ctrl+c', 'esc']
# =================================================================================================
# Here is normal mode hotkey you can conflicts with other mode (cant conflicts with global hotkey)
parent_directory = ['h', 'backspace'] 
search_bar = ['/', '']
# =================================================================================================
# Here is select mode hotkey you can conflicts with other mode (cant conflicts with global hotkey)
file_panel_select_mode_items_select_down = ['shift+down', 'J']
file_panel_select_mode_items_select_up = ['shift+up', 'K']
file_panel_select_all_items = ['A', '']

After thinking about it, I found that if I want to use nvim, it must be "completely" based on nvim, otherwise there will be conflicts. But if I don't want to be completely based on nvim, I have to design new logic myself.

Here is my design logic
My current design logic is to use ctrl+{key} for file operations. When you don’t press ctrl, pressing any key will not lead to your file or folder.
And about the delete hotkey I decided to add a confirmation window to it when the user deletes the file.
The rest are mostly chosen based on the prefixes of the words.

Of course, if you have any ideas before the new version release, feel free to suggest them!

@yorukot yorukot closed this as completed by moving to Done in superfile todo list May 13, 2024
@yorukot
Copy link
Owner Author

yorukot commented May 13, 2024

Temporarily closed. Of course, if you have better suggestions, you are welcome to open it again.

@yorukot
Copy link
Owner Author

yorukot commented May 17, 2024

# =================================================================================================
# Global hotkeys (cannot conflict with other hotkeys)
# I know this is not really that "vim", but the control flow is different.

confirm = ['enter']
quit = ['ctrl+c'] # also know as, theprimeagen troller

# movement
list_up = ['k']
list_down = ['j']

# file panel control
create_new_file_panel = ['n']
close_file_panel = ['q']
next_file_panel = ['tab']
previous_file_panel = ['shift+tab']

# change focus
focus_on_process_bar = ['ctrl+p']
focus_on_sidebar = ['ctrl+s']
focus_on_metadata = ['ctrl+m']

# create file/directory and rename
file_panel_item_create = ['a']
file_panel_item_rename = ['r']

# file operations
copy_items = ['y']
cut_items = ['x']
paste_items = ['p']
delete_items = ['d']

# compress and extract
extract_file = ['ctrl+e']
compress_file = ['ctrl+a']

# editor
open_file_with_editor = ['e']
open_current_directory_with_editor = ['E']

# other
pinned_directory = ['P']
toggle_dot_file = ['.']
change_panel_mode = ['m']
open_help_menu = ['?']

# =================================================================================================
# Typing hotkeys (can conflict with all hotkeys)
confirm_typing = ['enter']
cancel_typing = ['esc']

# =================================================================================================
# Normal mode hotkeys (can conflict with other modes, cannot conflict with global hotkeys)

parent_directory = ['-']
search_bar = ['/']
# =================================================================================================
# Select mode hotkeys (can conflict with other modes, cananot conflict with global hotkeys)

file_panel_select_mode_items_select_down = ['J']
file_panel_select_mode_items_select_up = ['K']
file_panel_select_all_items = ['A']

vim like hotkeys design
by @nonepork

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

No branches or pull requests

2 participants