image-paste
Copy image or take screenshot and paste it in text document. The image will be saved in given path and relative url will be inserted into document.
This package consumes the following services:
image-paste
The image-paste package allows you to copy images or take screenshots and paste them directly into Pulsar. Here's how to use it:
Installation
To install image-paste
search for image-paste in the Install pane of the Pulsar settings or run ppm install image-paste
. Alternatively, you can run ppm install bacadra/pulsar-image-paste
to install a package directly from the Github repository.
Usage in text-editor
- Take a screenshot or copy any image to the clipboard.
- (Optional) Select text in the TextEditor. The selected text will be used as the proposed name in the next step.
- Paste the image into the TextEditor instance. If the hack is activated, you can use the
core:paste
function (defaultCtrl-V
), or else useimage-paste:paste
. - Change the name of the image or accept the proposed name. Note that the
Image directory
path is prepended to the name. - Press
Enter
. - You will see that a directory including the file has been created, and a figure path has been inserted in the document.
Usage in tree-view
- Take a screenshot or copy any image to the clipboard.
- Select a file or directory in the tree view. If multiple items are selected, only the first one will be used.
- Paste the image. If the hack is activated, you can use the
tree-view:paste
function (defaultCtrl-V
), or else useimage-paste:paste
. - Change the name of the image or accept the proposed name. Note that the
Image directory
path is not prepended to the name. - Press
Enter
. - You will see that a directory including the file has been created, and a figure path has been inserted in the document.
Notes
- If a file with the same name already exists, press
Enter
once more to proceed. - The package supports all grammars, so it can be used in various file types, such as LaTeX, Python, and Markdown.
- Sometimes the copied item may have multiple formats (e.g., tables from MS Excel). In such cases, you can use
Ctrl-Shift-V
to paste raw text. - Only
.png
and.jpg
(also.jpeg
) formats are supported. If the file extension does not match, the.png
format will be used by default. - The package works well with the tree-view-clipboard package.
🍺
ContributingIf you have any ideas on how to improve the package, spot any bugs, or would like to support the development of new features, please feel free to share them via GitHub.