Skip to content

Latest commit

 

History

History
60 lines (50 loc) · 1.51 KB

README.md

File metadata and controls

60 lines (50 loc) · 1.51 KB

scrips.nvim

Yep, this is just scrips without the t. I know, it's dumb.

scrips-plugin

What this plugin can do for me?

At the moment, it'll help you to manage scripts.

  • Create a folder to store scripts;
  • Create scripts;
  • Run the script file;
  • Run selection;
  • Telescope your script;

Install

Using Packer

use {
    "LeonardsonCC/scrips.nvim",
    requires = "nvim-lua/plenary.nvim"
}

Setup plugin

require('scrips').setup()

Setup the Telescope extension

require('telescope').load_extension('scrips')

Keymaps

You must set your own keymaps. This is what I personally use:

-- scrips
local scrips = require('scrips')

-- new script
vim.keymap.set('n', '<Leader>en', scrips.new_script, { noremap = true })

-- find scripts
vim.keymap.set('n', '<Leader>se', require('telescope').extensions.scrips.find_file, { noremap = true })

-- Run
vim.keymap.set('n', '<Leader>er', scrips.run_paragraph, { noremap = true })
vim.keymap.set('n', '<Leader>eR', scrips.run_file, { noremap = true })

What I pretend to do

  • Run selection
  • Folder to manage scripts in plugin
  • Telescope to find scripts managed by the plugin
  • Better buffer names
  • Run the file based on his shebang e.g. #! /bin/bash
  • Run the paragraph based on his shebang e.g. #! /bin/bash
  • Run paragraph
  • Subfolders to help manage the scripts
  • Time elapsed
  • Custom environment files