Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cralfa/vim9-img-search
Image search plugin for Vim written in Vim9 script
https://github.com/cralfa/vim9-img-search
google-custom-search vim vim9-script
Last synced: about 2 months ago
JSON representation
Image search plugin for Vim written in Vim9 script
- Host: GitHub
- URL: https://github.com/cralfa/vim9-img-search
- Owner: CRaLFa
- Created: 2022-09-19T13:17:19.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-02-01T10:55:56.000Z (almost 2 years ago)
- Last Synced: 2023-07-02T01:21:39.853Z (over 1 year ago)
- Topics: google-custom-search, vim, vim9-script
- Language: Vim Script
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# vim9-img-search
Image search plugin for Vim 9
## Installation
Using [dein.vim](https://github.com/Shougo/dein.vim) plugin manager:
```vim
dein#add('CRaLFa/vim9-img-search')
```## Variables
* `g:img_search_api_key`: API key for Google Custom Search API (required)
* `g:img_search_engine_id`: Search engine ID for Google Custom Search API (required)
* `g:img_search_max_width`: Max image width (default: 480)
* `g:img_search_max_height`: Max image height (default: 270)### Example
In `~/.vimrc`:
```vim
let g:img_search_api_key = 'AIzaSxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
let g:img_search_engine_id = '7e1ffxxxxxxxxxxxx'
let g:img_search_max_width = 768
let g:img_search_max_height = 432
```## Usage
Press `Alt` + `i` to search image using the word under the cursor in Normal mode or the string in the selected range in Visual mode as the keyword.
When the search is completed, a new window will open in the lower half of the screen to display the result images.The maximum number of search results is 10.
`Alt` + `b` displays the previous image, and `Alt` + `n` displays the next image.The URL of the image being displayed is set in the unnamed register and can be pasted with `p` or `P`.
Press `Alt` + `j` to close the search results window.