kkvh / vim-docker-tools Goto Github PK
View Code? Open in Web Editor NEWToolkit for managing docker containers, networks and images in vim.
License: MIT License
Toolkit for managing docker containers, networks and images in vim.
License: MIT License
Thanks for great tool. Nice sort of dashboard.
The log buffer currently allows editing.
Other tools, like tpope/dadbod, often use read-only (buffer with modifiable
set `off) for such purposes. I guess it is set here. (note: I am not an VimScript expert)
This would prevent accidental modification of the content.
For some functionality it would be useful to be able to execute non-volatile docker functions with the output being redirect to somewhere that is not the UI, such as a hidden buffer.
Currently any commands ran using container_exec
or container_action_run
will modify the open terminal window, which mean that the plugin is only as aware of docker objects as the users current view is.
Being able to run these commands and manipulate / interpret the output silently would add a good amount of scripting power by giving access to things like the docker container inspect
, or docker stats
without having to override the users current view.
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
# ------------------------------------------------------------------------------
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.
s
/S
)Uppercase often means the opposite, resp. the uppercase is often more difficult to enter so it is used for more dangerous actions.
d
)While x
is standard vim "delete", it aims at character level. As one image is represented by a line, d
seems more intuitive.
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.
-
/-
)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.
!
)!
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.
<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).
r
)Following the Fugitive style.
q
)q
makes :DockerToolsClose
so simple to call.
Currently, when a command is sent to a docker image (e.g. ping google.com
, or find .
, only first lines of the output are shown in vim window and after the window gets filled, new lines appended to the end are not visible (unless you move there cursor manually).
Expected behaviour is to keep the last line always visible, similarly as when you run such command in neovim :terminal
window.
Note, that if #20 (follow mode for logs) are to be implemented, the same shall apply to them too.
Due to a patch by vim, a: dict should be immutable. This breaking changes causes error in this plugin due to some misuse of variables.
Can we add a toggle for displaying active or exited containers only. It's easier to manage when you have a lot of containers.
I noticed that the main container info buffer automatically updates perodically, but the docker logs buffer that you can open with < does not. This tool would be even better if follow mode (e.g. from docker logs -f) would be added as a configuration parameter of some kind
I have really long docker Image name and it makes the table look ugly.
It would be really nice to have elipsis on all columns if they're too long like how COMMAND column does?
Hi I'm a big fan of the project but I have been having some issues on windows:
Vim Version:
VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Nov 5 2023 23:49:43)
MS-Windows 64-bit GUI version with OLE support
Included patches: 1-2092
Compiled by appveyor@APPVEYOR-VM
Currently :DockerToolsOpen
opens a panel with the following text:
# Press ? for help
"docker container ls" accepts no arguments.
See 'docker container ls --help'.
Usage: docker container ls [OPTIONS]
List containers
The command docker container ls -a
works correctly from any terminal and even from vim doing :!docker container ls -a
so I'm unsure of what could be happening.
I tried to debug the plugin, but my understanding of vimscript is not the greatest and couldn't get any obvious leads.
Thanks again for the project and hope there's an easy fix for this one.
autoload structure require refactoring for more incoming features(e.g. image and network)
It's considered bad practice to add your user to the docker group, as this basically is a priv-esc vulnerability to root.
I would suggest to add a mode where you are actually calling sudo to interact with docker
Please add feature to inspect container or image and feature stats
can we have a command to check container log ?
Attach to container is not working in the latest version :(
regarding #4 ,should also be able to filter containers
It seems, like the list of docker images is automatically reloaded once upon a time.
Sometime I was not sure, if it already provides the latest uptodate information and was searching for a method to reload the content.
Typically such an action is mapped to r
key, which is currently taken by "restart" action.
I will create separate issue to propose alternative mappings.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.