Skip to content

Feature: New command, '$volt edit' and '$volt profile edit' #230

Description

@AvianY

I often want to edit the plugin configuration files or the rc file of the current profile, but it's hard to always look for the scripts deep in the subdirectories.
A simple command $volt edit <plugname> could simply take you to the rc file of that plugin
and edit it with the $EDITOR command.
And a command like $volt profile edit <profile? (default current) > would edit the rc file of the current profile.
It is also useful because the autocomplete of the volt command would help you select the plugin config you need to edit.
what do you think?

Activity

  1. tyru commented on Apr 7, 2018

    @tyru
    Member

    Yes, I'm also thinking of this.
    But the feature editing plugconf, profile's vimrc, ... files should be implemented in vim plugin, I think.
    I'm thinking :VoltEdit command, which allows you to edit the volt related files.

    " Open specified plugconf
    :VoltEdit tyru/caw.vim
    " Open profile's vimrc
    :VoltEdit profile:default:vimrc
    " Or gvimrc
    :VoltEdit profile:default:gvimrc
    " Open config.toml
    :VoltEdit config
    

    What's the advantage when it's implemented in vim plugin

    Vim can detect :write and invoke volt build automatically

    See #221, if the volt up (or maybe volt build is replaced) command is implemented. when you update config file and the syntax is correct, volt automatically installs/removes plugins without typing volt up command!

    You can stick on stable Vim while trying new plugins

    When you add or remove plugin, you might want to check if your Vim environment will not be broken by new plugins, or and so on.

    Volt uses Vim 8's package feature, so we don't have to care Vim 7 users basically.
    So we can use job, terminal(it's not in Vim 8.0.0, but it helps the restart-vim-and-check-it cycle. see below).

    • If the file is updated by :write, Vim asynchronously invokes volt build (or volt up) in background.
    • Then user can continue using current stable Vim instance
    • And it can also invoke new Vim from :terminal or another terminal emulator and shell to check the Vim environment is stable.
    • After Checking new Vim environment is stable, you can safely restart current Vim.

    Maybe someone says "I don't care. I manage vimrc (and $HOME/volt) in git, so I can revert them when the environment breaks."
    Yes, it's true.
    This is small advantage to decide the architecture.
    The important thing is mainly asynchronous volt build (or volt up).

    :VoltEdit argument syntax

    I wonder if the argument should be URI syntax as well as #208, and I found volt should define own URN(Uniform Resource Name), like urn:volt:config which references the filepath of config.toml.
    :VoltEdit parses given string as urn:volt:{arg} and if it's correct path, opens it.

  2. tyru commented on Apr 15, 2018

    @tyru
    Member

    I wonder if the argument should be URI syntax as well as #208, and I found volt should define own URN(Uniform Resource Name), like urn:volt:config which references the filepath of config.toml.
    :VoltEdit parses given string as urn:volt:{arg} and if it's correct path, opens it.

    URL parsing is easier than URN parsing (just use net/url).

    • volt-file://{path to file relative under $VOLTPATH}
      • This is used for :VoltEdit argument (:VoltEdit takes path after volt-file://)
      • ex) volt-file://config.toml
      • ex) volt-file://rc/default/vimrc
    • volt-profile://{profile name}
      • This is used in config.toml, lock.json.
  3. tyru commented on Oct 27, 2018

    @tyru
    Member

    After a while ago, as I see this, I think the URN notation I wrote is too complex to understand...
    I think :VoltEdit command just provides tab completion of files under ~/volt is enough.

    What's the advantage when it's implemented in vim plugin

    This does not seem to be related to :VoltEdit command.
    I don't know what I thought before...
    Auto volt build feature is useful and necessary while editing files, but not while trying to open files.

  4. AvianY commented on Nov 1, 2018

    @AvianY
    ContributorAuthor

    I would just like to say, that I have found a temporary solution which might be a good alternative to creating special commands for editing config files inside vim.
    Using the tpope's plugin projectionst, one can define commands for quick editing of these files if only you set up the JSON file correctly.
    For example:

      let g:projectionist_heuristics = {
          \   "*": {
          \     ".vim/volt/plugconf/github.com/*.vim": {"type": "plug"}
          \ } }
    
    

    This works for my setup. I can just type :Eplug proj inside vim
    and it will complete it into tpope/vim-projectionst.vim
    Just an idea to think about...

  5. hupfdule commented on Mar 26, 2019

    @hupfdule
    Contributor

    But the feature editing plugconf, profile's vimrc, ... files should be implemented in vim plugin,

    I tend to disagree. While it is certainly a nice feature to implement this into the vim-volt plugin, I think it is still necessary too also provide that command from the CLI client.

  6. added a commit that references this issue on Apr 16, 2019
    b940ff7
  7. added a commit that references this issue on Apr 29, 2019
    e3ab549
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions