Cloud-9: How to open a file in the c9-editor from c9-terminal

后端 未结 6 1415
失恋的感觉
失恋的感觉 2020-12-23 20:41

Is there a way to open a file not from the workspace tree view but from the c9-terminal tab?

Background: c9 doesn´t allow me to set the workspace path to / for a use

相关标签:
6条回答
  • 2020-12-23 20:47

    Borrowing from here,

    c9 open <filename>
    
    0 讨论(0)
  • 2020-12-23 20:57

    You can do the next:

    cd ~
    ln -s / root
    

    Then you can see the root link in the workspace. You can navigate through it and open any file (If you do not see the ~ folder in your favorites section, mark the 'Show Home in Favorites' option)

    If you prefer, (once you've installed c9) you can open files from the terminal with:

    c9 open ~/root/...
    

    NOTE: You can open files but not save them if they require superuser permissions.

    0 讨论(0)
  • 2020-12-23 21:02

    At the moment, the only way to open a file from the terminal is in vim or by using ls and then clicking on the file you'd like to open.

    Edit: You can now open from the terminal by running npm install -g c9, restarting your workspace, then doing c9 file.ext or c9 open file.ext

    0 讨论(0)
  • 2020-12-23 21:04

    If you go to Preferences -> Settings -> Terminal, there is an option "Use Cloud9 as the Default Editor". If you enable this option and open a terminal, the EDITOR env variable will look like this:

    $ echo $EDITOR
    `which c9` open --wait

    The path to c9 in my case is:

    /mnt/shared/sbin/c9

    For some reason, this didn't work for me initially, but now it works flawlessly. Perhaps the above default editor setting has to be enabled for it to work?

    0 讨论(0)
  • 2020-12-23 21:10

    I've just written into /mnt/shared/plugins/google.cloud/etc/gitconfig. First I was not allowed to write it, in nano. But using "c9 open" - just closing the tab with .gitconfig saved my changes.

    0 讨论(0)
  • 2020-12-23 21:10

    If you want to open any file from / the cloud 9 IDE must have permission. While configuring the C9 IDE give root as the user name and copy paste the public key in .ssh folder of root, allow root login in the ssh d config ,then you will be able to edit any file from the IDE.

    0 讨论(0)
提交回复
热议问题