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

Proposal for alternative key mappings #19

Open
vlcinsky opened this issue Jul 30, 2018 · 1 comment
Open

Proposal for alternative key mappings #19

vlcinsky opened this issue Jul 30, 2018 · 1 comment
Projects

Comments

@vlcinsky
Copy link

I am aware that usability can become never ending story. Anyway, as I feel the vim-docker-tools is hitting the need of couple of users, here is my humble contribution to that topic:

Consider changing key mapping in status buffer as follows:

# ------------------------------------------------------------------------------
# s: start container
# d=>S: stop container
# r=>R: restart container
# x=>d: delete container
# p=>-: pause container
# u=>-: unpause container
# >=>!: execute command to container
# <=><CR>: show container logs
# a: toggle show all/running containers
#  =>r: reload status
# =>q: close status (this window)
# ?: toggle help
# ------------------------------------------------------------------------------

Reasoning:

My proposal is heavily inspired by Fugitive key mapping which is very popular and many users are likely to have these keys already in muscle memory.

start/stop (s/S)

Uppercase often means the opposite, resp. the uppercase is often more difficult to enter so it is used for more dangerous actions.

delete (d)

While x is standard vim "delete", it aims at character level. As one image is represented by a line, d seems more intuitive.

restart image (R)

not using r to reserve r for "refresh status" (for more see later).

R includes stop, so it is consistent with the "shift" being present in "S"top.

pause/unpause (-/-)

This assumes that it is easy to ensure "toggle" behaviour with pause/unpause.

It follows the "add/remove" logic at Fugitve.

The "-" is mnemonic to pause symbol on players and behaves the same style.

Execute command in container (!)

! is common in vim for executing something.

Personally I have difficulties to think, which of > and < are for execution and which for logs. ! is easy to remember.

Show container logs (<CR>)

<CR> is often used to "open the file". Log represents the running image (and has an advantage there is up to one log per image).

Reload status (r)

Following the Fugitive style.

Close status (q)

q makes :DockerToolsClose so simple to call.

@kkvh
Copy link
Owner

kkvh commented Jul 31, 2018

Thanks for the suggestion! Some of the key bindings are really good(e.g. ! for command execution) and I will consider adopting some of them.

@kkvh kkvh added this to To do in Dev Jul 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Dev
  
To do
Development

No branches or pull requests

2 participants