GithubHelp home page GithubHelp logo

zsh-shell-word-at-point's Introduction

shell-word-at-point for zsh

Synopsis

  • shell-word-at-point - zle function to get a shell word at point

Description

Unless I am missing something, zsh does not provide the "ffap" (find-file-at-point) functionality out of the box. This library provides the following functions to fill the needs.

  • shell-word-at-point sets a shell word at point to a global variable shell_word.

  • edit-file-at-point invokes EDITOR (default: vi) passing a file name at point.

  • view-file-at-point invokes PAGER (default: more) passing a file name at point.

  • run-shell-word-at-point opens a new command line with only the current shell word set, pushing the whole command line with push-line.

After closing EDITOR or PAGER, you will be back on the command line exactly with the previous status.

How to set up

Put the file shell-word-at-point somewhere in your $fpath and add these lines to your .zshrc:

autoload -Uz shell-word-at-point
shell-word-at-point

Here's example bindings for Emacs users:

bindkey '^X^F' edit-file-at-point
bindkey '^X^R' view-file-at-point
bindkey '^[!' run-shell-word-at-point

License

Copyright (c) 2015-2023 Akinori MUSHA

Licensed under the 2-clause BSD license. See LICENSE for details.

zsh-shell-word-at-point's People

Contributors

knu avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

jiahut

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.