Welcome to Centmin Mod Community
Register Now

editor choice

Discussion in 'Feature Requests & Suggestions' started by Matt, Jun 1, 2014.

  1. Matt

    Matt Moderator Staff Member

    697
    322
    63
    May 25, 2014
    Sheffield, UK
    Ratings:
    +449
    Local Time:
    4:56 PM
    1.7.1
    MariaDB 10
    Would it be possible to for the shortcuts to include an option to choose the editor being used? I personally never use nano, and always use VIM.
     
  2. eva2000

    eva2000 Administrator Staff Member

    30,965
    6,918
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,420
    Local Time:
    2:56 AM
    Nginx 1.13.x
    MariaDB 5.5
    right now it's just hard coded into shorts in /usr/bin i.e.

    Code:
    cat /usr/bin/mycnf
    
    nano -w /etc/my.cnf
    so yeah you can change them manually or just set an alias to replace nano with vim command

    Code:
    alias nano='vim'
    should work ???
     
  3. Matt

    Matt Moderator Staff Member

    697
    322
    63
    May 25, 2014
    Sheffield, UK
    Ratings:
    +449
    Local Time:
    4:56 PM
    1.7.1
    MariaDB 10
    Setting the alias didn't work, it's still opening the files in nano.

    I've just taken what was in the shortcuts_install.inc file, and replaced nano -w with vim and ran the commands:

    Code:
    echo "vim /usr/local/lib/php.ini" > /usr/bin/phpedit ; chmod 700 /usr/bin/phpedit
    echo "vim /etc/my.cnf" >/usr/bin/mycnf ; chmod 700 /usr/bin/mycnf
    echo "vim /usr/local/etc/php-fpm.conf" >/usr/bin/fpmconf ; chmod 700 /usr/bin/fpmconf
    echo "vim /usr/local/nginx/conf/nginx.conf" >/usr/bin/nginxconf ; chmod 700 /usr/bin/nginxconf
    echo "vim /usr/local/nginx/conf/conf.d/virtual.conf" >/usr/bin/vhostconf ; chmod 700 /usr/bin/vhostconf
    echo "vim /usr/local/nginx/conf/php.conf" >/usr/bin/phpinc ; chmod 700 /usr/bin/phpinc
    echo "vim /usr/local/nginx/conf/drop.conf" >/usr/bin/dropinc ; chmod 700 /usr/bin/dropinc
    echo "vim /usr/local/nginx/conf/staticfiles.conf" >/usr/bin/statfilesinc ; chmod 700 /usr/bin/statfilesinc
     
    • Like Like x 1
  4. eva2000

    eva2000 Administrator Staff Member

    30,965
    6,918
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,420
    Local Time:
    2:56 AM
    Nginx 1.13.x
    MariaDB 5.5
    yup that would be a better approach :)

    maybe can make in a centmin.sh set option and for nano or vim and depending on variable set have alternate set of echo commands :)
     
    • Like Like x 1
  5. Matt

    Matt Moderator Staff Member

    697
    322
    63
    May 25, 2014
    Sheffield, UK
    Ratings:
    +449
    Local Time:
    4:56 PM
    1.7.1
    MariaDB 10
    That would be perfect (y)
     
  6. pamamolf

    pamamolf Well-Known Member

    2,824
    253
    83
    May 31, 2014
    Ratings:
    +448
    Local Time:
    6:56 PM
    Nginx-1.13.x
    MariaDB 10.1.x
    I always use nano and for not experts it is easier :)

    The pro user can change it anyway :)
     
    • Like Like x 1
  7. eva2000

    eva2000 Administrator Staff Member

    30,965
    6,918
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,420
    Local Time:
    2:56 AM
    Nginx 1.13.x
    MariaDB 5.5
    • Like Like x 1