Giter Site home page Giter Site logo

vim-docker-tools's People

Contributors

caidanw avatar jakecode avatar kkvh avatar pabloscolpino avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

vim-docker-tools's Issues

Show docker logs in read-only buffer

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.

Add utility function to execute docker commands and retrieve the stdout without changing the UI

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.

Proposal for alternative key mappings

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.

Keep last lines of command output (after send command to image) visible in window

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.

Allow for follow mode when reading docker logs

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

Plugin not working on Windows

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.

add 'sudo' compatibility

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

Allow reloading image status manually

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.

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.