Coder Social home page Coder Social logo

vim-rooter's Introduction

This is a fork repo

The original project can be found at but the modification that I applyed maybe are too personal so I preferred to keep this repo as a fork for now

Rooter

Rooter is a Vim plugin which changes the working directory to the project root when you open a file.

The project root is identified by the presence of known directory, such as a VCS directory, or file, such as a Rakefile or a "Container" directory. Currently git, darcs, mercurial, bazaar, and subversion are supported.

Use

By default you don't need to do anything: vim-rooter will change the working directory automatically.

You can always invoke vim-rooter manually.

Note: autochdir will be disabled by this plugin

Configuration

If you want to use this plugin manually you have to set the g:rooter_manual_only and define a mapping for <Plug>(rooter-change-root-directory) like this:

map <silent> <unique> <Leader>foo <Plug>(rooter-change-root-directory)

where <Leader>foo is the mapping you want.

You can add your own directory and file patterns like this:

call rooter#extend_patterns(['Rakefile', '.git/'])

this will add the patterns to the default one.

Note: directories should have a trailing slash.

Container Directory

If a pattern like this is set

call rooter#extend_patterns(['~/some/path/{}'])

With this directories:

+-~/
| +-some
| | +-path
| | | +-project1
| | | +-project2

Open a file inside project1 would set ~/some/path/project1 as local current directory

You can have vim-rooter change directory (:cd) instead of locally changing directory (:lcd) by adding this to your .vimrc:

let g:rooter_use_cd = 1

When vim-rooter encounters a non-project file, it won't change directory by default. If you would instead like vim-rooter to change to the file's directory, do this:

let g:rooter_change_directory_for_non_project_files = 1

Installation

Manual Install

Install the distributed files into your Vim script directory which is usually ~/.vim/, or $HOME/vimfiles on Windows.

Pathogen

cd ~/.vim/bundle
git clone git://github.com/vheon/vim-rooter.git

Vundle

Bundle 'vheon/vim-rooter'

vim-rooter's People

Contributors

airblade avatar blueyed avatar endel avatar leucos avatar mechazoidal avatar rphillips avatar teranex avatar vheon avatar zah avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.