GithubHelp home page GithubHelp logo

qfc's Introduction

qfc

Quick Command-line File Completion

qfc

qfc is a shell auto-complete alternative which features real-time multi-directories matching: It provides results while you type against files in the current directory and its sub-directories. This is useful, to avoid the burden of writing the whole path whenever you want to cd or vim a file, which is frequent especially if you use the terminal as your IDE(The terminal is the best IDE, remember! :-) ).

Features:

  • Real-time matching: Results are displayed while you type.
  • Multi-directories && Context relevant matching: if you're in a cvs(git,mercurial) managed directory, qfc will matches against your tracked(or new) files only. This is very useful to avoid 10000+ of dependency files cluttering up the results. for unmanaged dirs, qfc looks for unhidden files up to a maximum depth(set to 3).
  • Enhanced Filtering/Sorting of matches.
  • No dependencies.

Requirements

Installation:

  • git clone https://github.com/pindexis/qfc $HOME/.qfc
  • Add the following line to your *rc (.zshrc, .bashrc, .bash_profile in OSX):
    [[ -s "$HOME/.qfc/bin/qfc.sh" ]] && source "$HOME/.qfc/bin/qfc.sh"

Usage:

  • Ctrl-f : complete the word under cursor using qfc
  • while qfc is open:
    • TAB: Append the selected match to the current path.
    • ENTER: Append the selected match to the current path and returns the result.
    • Ctrl-f: Returns the current path.
    • Arrow keys: Navigation between files.

Even more Productivity:

If you're using zshell or Bash 4.3+, You can combine qfc with commands you frequently use to get one key-stroke experience. For example, I have the following lines in my .zshrc:

qfc_quick_command 'cd' '\C-b' 'cd $0'
qfc_quick_command 'vim' '\C-p' 'vim $0'

This allows me to switch directories by just pressing Ctrl-b(or editing a file by pressing Ctrl-p). qfc

qfc_quick_command expects an id, a shortcut, and a command with $0 placeholder(which will be replaced with the completion path).
It's recommended to choose a 2-5 length letters only id(else you may encounter issues).
Also, be careful with what keyboard shortcuts to choose(mapping some keys can prevent the terminal from working correctly).

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.