[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Ranger-users] Tip: ranger as an IDE filemanager, final setup

From: John Z.
Subject: [Ranger-users] Tip: ranger as an IDE filemanager, final setup
Date: Thu, 7 Sep 2017 09:50:43 -0400
User-agent: Mutt/1.9.0 (2017-09-02)

Hi all!
    Some time ago I was writing about setting up ranger as a file
    manager for a project-based IDE, and I think I finally polished the
    solution to what I wanted it to be, so I wanted to share it with
    you. This setup works automatically for any projects you might
    have organized, and it doesn't require file-keeping

    Set up in .vimrc basically just involves that vim runs a server with
    a specific name (project directory) whenever any instance is ran
    under a specific subdirectory ($HOME/workspace in my case):

        " Start server if in workspace subdirectory with proper name
        if match(getcwd(), "/home/john/workspace") != -1 && getcwd() != 
            let s:projectdir = strpart(getcwd(), strridx(getcwd(), "/") + 1)
            let s:servername = "VIM-" . toupper(s:projectdir)
            call remote_startserver(s:servername)
    Set up in ranger is actually just a set up in rifle, an expansion of
    a previous manual project listing; now it does a similar thing - if
    a file is edited in the subdirectory of $HOME/workspace, it'll try
    to use a remote vim instance:

        path workspace/*, mime ^text, label editor = 
            echo "$1" | cut -d/ -f5 | xargs -I{} vim --servername "VIM-{}" 
--remote "$1"

    There you go. I hope it ends up being useful to you.
    Suggestions, optimizations, criticism and trolling are all welcome :-)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]