Giter Site home page Giter Site logo

render.nvim's Introduction

rendersquirrel

πŸ“Έ render.nvim

Neovim plugin to take screenshots of your Neovim session on MacOS.

neovim: v0.9+ macos: 11+ semantic-release: angular

Warning

This project is still a work in progress and not considered stable

See wiki for detailed information, configuration recipes, and demos.

render-nvim-demo.mov

✨ Features

  • πŸ“· Capture image of window by process ID
  • πŸŽ₯ Capture video recording
  • πŸŸͺ Capture image or video by window boundaries
  • βœ‚οΈ Capture to clipboard
  • πŸ’Ύ Capture to file
  • πŸ”³ Add window's shadow in window capture mode
  • πŸ”’ Take capture after a delay
  • 🎧 Play sound effect on capture
  • πŸ’₯ Flash window on capture
  • πŸ–±οΈ Show clicks during video recording
  • πŸ’… Show floating thumbnail after capture
  • πŸƒβ€β™‚οΈ Open captures in quick view
  • πŸ”§ Open captures in quickfix list
  • πŸ” Automatically open or preview capture
  • ⏰ Limit capture video recording time
  • πŸ“ Fine-tune cropping of window boundaries
  • 🀳 Image formats png jpg pdf psd tga bmp gif tif
  • 🎬 Video format mov

🫑 Commands and Lua API

Command API Description
:Render {profilename} require('render.api').render(string|table|nil) Capture image or video recording
:RenderDryRun {profilename} require('render.api').dryrun(string|table|nil) Execute render logic without capturing result
:RenderClean[!] require('render.api').clean(table|nil) Delete existing captures in output directory and reinstall dependencies
:RenderExplore require('render.api').explore() Open render output directory in Neovim
:RenderQuickfix[!] require('render.api').quickfix(table|nil) Toggle open output directory in quickfix window
:RenderInterrupt require('render.api').interrupt() Send interrupt to stop video recoring
:RenderQuicklook require('render.api').quicklook() Open all files in output directory with quick look
:RenderSetWindowInfo {pid} require('render.api').set_window_info(integer|nil) Set the window information to the active Neovim session or by process ID

⌨️ Keymappings

Keymappings are enabled by default. If you would like to disable all keymappings, set the configuration features.keymaps to false.

{
  features = {
    keymaps = false,
  },
}

If you would like to override the keymappings defined on setup, then set the configuration

{
  fn = {
    keymap_setup = function() 
      -- custom keymaps
    end,
  },
}

The following table lists the default keymappings. <f13> is typically the print screen key, but this may vary depending on your keyboard. <f13> is equivalent to <shift-f1>.

Keymaps Mode Description
<f13> All Capture image or video recording with default profile. Equivalent to require('render.api').render('default')
<leader><f13> Normal Send interrupt to stop video recoring. Equivalent to require('render.api').interrupt()
<c-f13> Normal Toggle open output directory in quickfix window. Equivalent to require('render.api').quickfix({toggle = true})
<cr>, <c-w><cr> Normal (Quickfix window) Open the quickfix item using the command defined in configuration fn.open_cmd
<tab> Normal (Quickfix window) Open the quickfix item using quick look command qlmanage

✍️ Configuration

Property Type Description
features.notify boolean
features.keymaps boolean
features.flash boolean
features.auto_open boolean
features.auto_preview boolean
features.sound_effect boolean
notify.level string
notify.msg fun(msg, level, extra)
notify.verbose boolean
fn.window_info.cmd fun(): string
fn.window_info.opts fun(RenderOutputFiles, RenderProfileOptions): table
fn.screencapture.cmd fun(RenderWindowInfo, RenderOutputFiles, ProfileOptions): table|nil
fn.screencapture.opts fun(RenderOutputFiles, RenderProfileOptions, table): table
TODO: left off here
fn.screencapture_location.cmd
fn.screencapture_location.opts

🟰 Screencapture equivalent

The following table lists equivalent render.nvim options to the underlying screencapture command.

Option Argument Description
features.sound_effect = false -x Do not play sounds
profile.delay = <seconds> -T<seconds> Take the capture after a delay of
profile.filetype = '<format>' -t<format> Image format to create, default is png
profile.image_capture_mode = 'bounds' -R<x,y,w,h> Capture screen rect
profile.image_capture_mode = 'window' -l<id> Capture window with
profile.mode = 'clipboard' -c Force screen capture to go to the clipboard
profile.mode = 'preview' -u Present UI after screencapture is complete
profile.show_clicks = true -k Show clicks in video recording mode
profile.type = 'video' -v Capture video recording of the screen
profile.window_shadow = false -o In window capture mode, do not capture the shadow of the window

πŸ“¦ Installation

Prerequisites and Dependencies

Name Description Installation Method
Neovim v0.9+ Neovim version 0.9 or greater User installed
screencapture Captures image and video of the whole, or part of the screen Included on Mac
qlmanage Displays quick look previews Included on Mac
pdubs Retreives window information for the Neovim session Downloaded by render.nvim
curl, shasum, tar Required to download, extract, and verify pdubs binary Included on Mac

Using lazy.nvim

  {
    "mikesmithgh/render.nvim",
    config = function()
      require("render").setup()
    end,
  }

Using Neovim's built-in package support pack

mkdir -p "$HOME/.local/share/nvim/site/pack/mikesmithgh/start/"
cd $HOME/.local/share/nvim/site/pack/mikesmithgh/start
git clone [email protected]:mikesmithgh/render.nvim.git
nvim -u NONE -c "helptags render.nvim/doc" -c q
echo "require('render').setup()" >> "$HOME/.config/nvim/init.lua" 

🀷 How does it work?

  • Window information such as window ID, size and position are determined for the current process using pdubs
  • Window information and configuration options are parsed and translated to a screencapture command

🍎 Supported OS versions

  • macOS 13 Ventura
  • macOS 12 Monterey
  • macOS 11 Big Sur

πŸ”’ Privacy & Security

Screen recording must be enabled in order for render.nvim to take screencaptures. This will need to be enabled for the application that is running Neovim. For example, Kitty, Alacritty, iTerm2, Neovide, etc. The first time you attempt to take a screenshot, you may see a prompt to allow access.

screencapture-prompt

Open System Settings and enable screen recording for your application.

  • Choose Apple menu 🍎 > System Settings, then click Privacy & Security βœ‹ in the sidebar. (You may need to scroll down.)
  • Click Screen Recording.
  • Turn screen recording on or off for each app in the list.

screencapture-settings

🀝 Ackowledgements

  • 🐿️ gruvsquirrel.nvim Neovim colorscheme written in Lua inspired by gruvbox
  • 🦬 pdubs A simple command-line utility to return macos window information for a given pid.

render.nvim's People

Contributors

mikesmithgh avatar semantic-release-bot avatar

Stargazers

Towry Wang avatar Sina Beyraghdar avatar Shihua Zeng avatar  avatar Will Hopkins avatar Andy Shevchenko avatar PinkLea avatar Aquib Javed avatar Viv Sedov avatar  avatar Yuta Katayama avatar

Watchers

 avatar  avatar

Forkers

archargelod

render.nvim's Issues

The automated release is failing 🚨

🚨 The automated release from the main branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you can benefit from your bug fixes and new features again.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can fix this πŸ’ͺ.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the main branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here are some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


Cannot push to the Git repository.

semantic-release cannot push the version tag to the branch main on the remote Git repository with URL https://github.com/mikesmithgh/render.nvim.

This can be caused by:


Good luck with your project ✨

Your semantic-release bot πŸ“¦πŸš€

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.