Code Monkey home page Code Monkey logo

global-interactive-emacs's Introduction

Global Interactive Emacs

This tool is inspired by article : Global interactive Emacs functions.It provides an idea to run Emacs functions outside of Emacs.

So I try to use this idea to wrtie a tool like lauchbar or Alfred . It can help user to quickly lauch app or run work flow.

I’m using it to replace the lauchbar.

Pros and cons

This toole has some pros and cons, and I think if you have the following needs, you can try to use it :

  • you don’t want pay for other tools like lauchbar or Alfred .
  • you wish some function in Emacs could run out of Emacs.
  • You’re familiar with Emacs, there are some plugins, and custom functions that you want to reuse.
  • You don’t want to learn a new language or workflow of a new software

Pros

  • free: Whether Lauchbar or Alfred, you need to pay for it to use it comfortably and efficiently. Just need Emacs and some open source software that you can use for free.
  • consistency: You can use the same features inside or outside of Emacs and have a similar experience.
  • Simple Configuration: If you are familiar with Emacs, you can easily configure it with emacs-lisp without having to relearn the language and process of other tools.
  • Scalability: You can write your own interactive functions and plug them into the tool, or use the Emacs plugins developed by others to extract the interaction functions and plug them into the tool.

Cons

  • Not powerful for now: Obviously, the tool is not as powerful as lauchbar or Alfred. At the moment it is only useful for my own needs. I will continue to improve according to my needs, and anyone is welcome to help improve it.
  • Can’t perfectly support all Emacs interactive functions: There are currently some Emacs interaction functions that cannot be run outside of Emacs, such as execute-extended-command. I don’t have the train of thought to support it yet.

Prerequisites

  • choose

choose github

Global Interactive Emacs use it as interface to interactively communicate with Emacs.

Maybe using rofi is okay in Linux, but I only have Mac OS and can’t test it.

Installing

  • clone the project in your own emacs configuration files directory, like:
git clone [email protected]:ginqi7/global-interactive-emacs.git ~/.emacs.d/lisp/global-interactive-emacs
  • add the path to ‘load-path’
(add-to-list 'load-path (expand-file-name "~/.emacs.d/lisp/d/lisp/global-interactive-emacs"))

Configuration

I split different functions into different files, you can choose by your needs.

(require 'global-interactive-emacs)
(require 'global-interactive-run-app)
(require 'global-interactive-open-url)
(require 'global-interactive-leetcode)
(require 'global-interactive-kubectl)

global-interactive-run-app

You could run ‘global-interactive-run-app-init’ in your init file, it will find your apps in your ‘/Applications’ directory. If you don’t run it manual, it will be called in your first choose lauch some apps.

(global-interactive-run-app-init)

global-interactive-open-url

You could define some urls to quickly jump to selected url. the configuration is using yaml file or emacs plist.

If you use emacs plist to define urls:

 (setq global-interactive-url-plist (:movie
[(:Doctor\ Strange\ in\ the\ Multiverse\ of\ Madness "https://www.imdb.com/title/tt9419884/?ref_=hm_fanfav_tt_t_1_pd_fp1")
 (:The\ Batman "https://www.imdb.com/title/tt1877830/?ref_=hm_tpks_tt_t_2_pd_tp1_pbr_ic")]
:music
[(:jay\ chou "https://www.wikiwand.com/en/List_of_songs_recorded_by_Jay_Chou")])

If you use yaml to define urls:

  • you need add package: yaml
  • you need save yaml config to a file. it values like:
  movie:
  - Doctor Strange in the Multiverse of Madness: https://www.imdb.com/title/tt9419884/?ref_=hm_fanfav_tt_t_1_pd_fp1
  - The Batman: https://www.imdb.com/title/tt1877830/?ref_=hm_tpks_tt_t_2_pd_tp1_pbr_ic
music:
  - jay chou: https://www.wikiwand.com/en/List_of_songs_recorded_by_Jay_Chou
  • you need config parameter ‘global-interactive-url-yaml-path’
    (setq global-interactive-url-yaml-path "some path to yaml file")
        

Usage

After you install and configurate this tool. you need start emacs server, and run:

emacsclient --eval "(global-interactive-emacs)"

If successfully run, you could use some tool to bind the command in a hotkey.

I use phoenix to bind the command to “cmd + space”.

Features

global-interactive-run-app

You could quickly launch apps in you MacOS.

global-interactive-open-url

You could quickly jump pre define urls.

global-interactive-kubectl

You could conbine other Emacs plugin, have a similar experience in or out of Emacs.

The kubectl plugin is here.

global-interactive-leetcode

The leetcode plugin is here.

global-interactive-emacs's People

Stargazers

Roman avatar

Watchers

 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.