Code Monkey home page Code Monkey logo

teleport.vim's Introduction

teleport.vim

Build Status

Navigate faster with frecency.

Purpose

Teleport.vim integrates with programs like z and autojump to provide the same navigational magic inside Vim.

:pwd " ./projects/app-name
:Z dotf
:pwd " ~/dotfiles

If those programs don't sound familiar, here's the 30-second pitch:
There's a competing set of command line tools that do pretty much the same thing. They alias cd, remember your most common directories, and let you jump ("teleport") to that directory by passing a substring. It'll filter the directories by your search term and jump to the one which is most frecent.

If you aren't using something like that, stop what you're doing, forget this vim plugin, and just install the CLI tool. It's a massive productivity boost. I recommend zoxide.

Installation

vim-plug

Plug 'PsychoLlama/teleport.vim'

Vundle

Plugin 'PsychoLlama/teleport.vim'

Pathogen

git clone https://github.com/PsychoLlama/teleport.vim ~/.vim/bundle/teleport.vim

Integrations

teleport.vim is compatible with several different implementations.

If you use the oh-my-zsh framework, teleport.vim will work out of the box. You're good to go ๐Ÿš€

If not, you'll need to explicitly provide a path to your z installation. Add this to your vimrc:

let teleport#path = expand('~/path/to/z/z.sh')

Where ~/path/to/z/z.sh is replaced with the actual file path.

There's also a lua-based implementation of z. Configuration is nearly identical. Just put this in your vimrc:

let teleport#path = expand('~/path/to/z.lua/z.lua')

Where ~/path/to/z.lua/z.lua is the actual file path, wherever you installed it.

Zoxide is automatically detected - you don't have to do anything.

In order to get the j alias, you're probably sourcing an autojump file in your bash/zsh/fish setup. Find that file and set it in your vimrc:

let teleport#path = expand('~/path/to/autojump.sh')

Setting the integration

If you have more than one of these installed (why???) there's a chance teleport.vim could choose the wrong one. You can force it to use a particular driver by setting teleport#driver.

let teleport#driver = 'z' " rupa/z
let teleport#driver = 'z.lua' " skywind3000/z.lua
let teleport#driver = 'zoxide' " ajeetdsouza/zoxide
let teleport#driver = 'autojump' " wting/autojump

If you don't see your favorite program listed here, feel free to open a request!

Documentation

In traditional vim fashion, the documentation is kept in a help page. After installing the plugin, run:

:help teleport.vim

teleport.vim's People

Contributors

kuator avatar microthought avatar psychollama avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

teleport.vim's Issues

Add option to automatically set vim working directory

Say I have two projects:

  • project-a/
  • project-b/

I'm working in project-a/ and then jump :Z project-b. Vim's current working directory :pwd is still pointing to project-a/. Fuzzy finders, path resolvers, and sometimes linters will try to execute relative to the old project-a/ repo even though I'm working in a completely different context.

I'd like an option that, if enabled, changes the local working directory after navigating via :Z. It should be opt-in.

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.