Giter Site home page Giter Site logo

fzf-project's Introduction

fzf-switch-project

This plugin provides an easy way of switching between project directories indexed from a specified workspace folder or folders. It's based on an idea I originally stole from kieran-bamforth's dotfiles.

Screen Capture

Install

Install via Plug

Plug 'benwainwright/fzf-project'

Usage

Running FzfSwitchProject in command mode will produce a list of folders from within your workspace folders. When you select a project, the working directory is changed and you are presented with a fzf list of files to switch to.

AutoRooting

Installing FzfSwitchProject will automatically cd to the root directory of any given project when you open a file. It does this by recursively locating the nearest .git folder in the directory hierarchy. For this reason, is recommended to use git with this plugin

Git Initialisation

To assist with the above, if you switch to a folder that does not contain a .git repository, you have the option of automatically creating one. This behavior can be configured below.

Configure

let g:fzfSwitchProjectWorkspaces = [ '~/workspace1', '~/workspace2' ]

automatically list projects in the above folders

let g:fzfSwitchProjectProjects = [ '~/folder1', '~/folder2' ]

add individual folders to the project list (I use it for my dotfiles folder)

let g:fzfSwitchProjectGitInitBehavior = 'ask' " default

what to do if you switch to a project folder that doesn't contain a .git directory:

  • ask (default) prompt the user to confirm if a new git repository should be initialised
  • auto always initialise a new git repository if one isn't found
  • none do nothing

Command that is executed to get a list of all the files in a given project

let g:fzfSwitchProjectFindFilesCommand = 'git ls-files --others --exclude-standard --cached' " default

Don't automatically open a file picker once project is selected

let g:fzfSwitchProjectAlwaysChooseFile = 0

Commands

  • FzfSwitchProject - open project switcher
  • FzfChooseProjectFile - switch file within project

Dependencies

fzf-project's People

Watchers

James Cloos 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.