Giter VIP home page Giter VIP logo

telescope-scratch-run.nvim's Introduction

Telescope Scratch Run integration

Telescope picker for running simple code via stdin to language compiler and output to message window.

How does it look?

Color scheme is Darcula made with TJ's colorbuddy plugin
drawing
Using Python as an example
drawing

Why?

This plugin was created so I do not have to create a file or go to playground to test simple code. A lot of times, I just want to see if syntax is correct or validate my logic is correct. And this plugin does exactly that. It is a simple plugin, it simply run :w !YOUR_LANG_COMPLIER command.

You dont need to save anything into a file. Just open a new/scratch buffer with :new and type out the code you need to test. Then running this telescope plugin and it will take current buffer as standard input (stdin) and run it via your language's compiler.

Note: you need to have your language toolchain/compiler installed before running this.

Installation

If you are using packer.nvim, use this to setup scratch_run

use "4542elgh/telescope-scratch-run.nvim"

If you are using lazy.nvim, use this to setup scratch_run

"4542elgh/telescope-scratch-run.nvim"

In Telescope setup, require smb_unc module

require('telescope').load_extension('scratch_run')

Configuration

For user defined command, you can use the following config structure under Telescope's setup.extensions

require("telescope").setup({
    defaults = {
        ...
    },
    extensions = {
        ...
        scratch_run = {
            custom_compilers = {
                lua = {
                    name = "lua",
                    cmd = ":w !jit" -- Make sure your command start with ':w !' then follow by your compiler command
                }
            }
        }
    },
})

Usage

The extension provides the following picker:

" output available compilers
:Telescope scratch_run 

Lua equivalent:

require('telescope').extensions.scratch_run.all()

telescope-scratch-run.nvim's People

Contributors

4542elgh avatar

Stargazers

Patryk Kielar avatar Yuta Katayama 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.