{"id":26944176,"url":"https://github.com/fraserlee/scratchpad","last_synced_at":"2025-04-02T17:19:28.846Z","repository":{"id":40262572,"uuid":"473045707","full_name":"FraserLee/ScratchPad","owner":"FraserLee","description":"plugin to auto-centre neovim buffers with a useful persistent scratchpad on the side","archived":false,"fork":false,"pushed_at":"2023-11-19T18:40:38.000Z","size":28,"stargazers_count":54,"open_issues_count":4,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-08T01:36:57.783Z","etag":null,"topics":["neovim","neovim-lua-plugin","neovim-plugin","vim","vim-plugin"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FraserLee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-03-23T05:14:38.000Z","updated_at":"2024-07-01T06:09:18.000Z","dependencies_parsed_at":"2024-01-17T00:18:49.587Z","dependency_job_id":"cb426ca1-d3cb-44ed-bead-3bf659be9a0e","html_url":"https://github.com/FraserLee/ScratchPad","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FraserLee%2FScratchPad","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FraserLee%2FScratchPad/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FraserLee%2FScratchPad/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FraserLee%2FScratchPad/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FraserLee","download_url":"https://codeload.github.com/FraserLee/ScratchPad/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246856582,"owners_count":20844974,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["neovim","neovim-lua-plugin","neovim-plugin","vim","vim-plugin"],"created_at":"2025-04-02T17:19:28.195Z","updated_at":"2025-04-02T17:19:28.839Z","avatar_url":"https://github.com/FraserLee.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ScratchPad\n\nA snazzy neovim plugin to centre your buffer by creating a persistent\nscratchpad off to the left.\n\n![scratchpad-vid](https://raw.githubusercontent.com/FraserLee/readme_resources/main/resize.gif)\n\n\u003cbr\u003e\u003cbr\u003e\n# Installation\n\nIf you're reading this you've probably already got a plugin manager. If not, I\nrecommend [Vim-Plug](https://github.com/junegunn/vim-plug), but they're essentially\ninterchangeable. Add the appropriate line in the appropriate spot in your\n`.vimrc` file.\n\n```vim\n\" vim-plug\nPlug 'FraserLee/ScratchPad'\n\n\" vundle\nPlugin 'FraserLee/ScratchPad'\n\n\" packer.nvim\nuse 'FraserLee/ScratchPad'\n\n\" etc...\n```\n\nRun your version of `:PlugInstall` and things should be good to go.\n\n\u003cbr\u003e\u003cbr\u003e\u003cbr\u003e\u003cbr\u003e\n# Usage\n\n```vim\nnnoremap \u003cleader\u003ecc \u003ccmd\u003eScratchPad\u003ccr\u003e\n```\n---\n\nBy default, all scratchpad windows point to one underlying file\n(`~/.scratchpad` unless changed). They'll auto-save when modified,\nreload if the file is changed, and automatically close when all other\nwindows are gone.\n\nI tend to use them as the digital equivalent of the sticky notes that coat\nall objects vaguely proximate to my desk, but that's not a requirement.\n\n- `:ScratchPad` to toggle the scratchpad\n- `:ScratchPad open` opens a new scratchpad\n- `:ScratchPad close` closes all scratchpads in the current tab\n\n\u003cbr\u003e\u003cbr\u003e\u003cbr\u003e\u003cbr\u003e\n# Configuration\n\nBy default, the scratchpad will auto-open when you open vim, and automatically\nopen / close / resize itself as the window size (and spilt) changes.\n\n\nDisable scratchpad on startup:\n```vim\nlet g:scratchpad_autostart = 0\n```\n\nDisable automatic resizing:\n```vim\nlet g:scratchpad_autosize = 0\n```\n\n### Automatic Size Junk\n\nThe assumed width of code, as per what will be centred on screen. Set this to the same\nthing as any sort of colour column.\n\n```vim\nlet g:scratchpad_textwidth = 80 \" (80 is the default)\n```\n\nThe minimum width of a ScratchPad before it will - if autosize is enabled -\nclose itself.\n\n```vim\nlet g:scratchpad_minwidth = 12\n```\n\n## File Locations\n\nChange the scratchpad file by\n```vim\nlet g:scratchpad_location = '~/.scratchpad'\n```\n\nAuto-focus when opening a scratchpad window:\n```vim\nlet g:scratchpad_autofocus = 1\n```\n\n### Daily ScratchPad\nInstead of having one ScratchPad have a fresh one for each day.\nThe old ScratchPads are saved as well. Disabled by default.\n\nEnable daily scratchpad\n```vim\nlet g:scratchpad_daily = 1\n```\n\nChange the daily scratchpad directory\n```vim\nlet g:scratchpad_daily_location = '~/.daily_scratchpad'\n```\n\nChange the daily scratchpad file name format using [lua os date](https://www.lua.org/pil/22.1.html)\n```vim\nlet g:scratchpad_daily_format = '%Y-%m-%d'\n```\n\n---\n\nEdit colour with\n```vim\nhi ScratchPad ctermfg=X ctermbg=Y\n```\n\n\n\u003cbr\u003e\u003cbr\u003e\u003cbr\u003e\u003cbr\u003e\n# Making Stuff Look (somewhat) Decent\n\nI've added a line to disable the\n[virtual-text colour column](https://github.com/lukas-reineke/virt-column.nvim)\nin scratchpad buffers if that plugin's found, since I think these two pair\npretty well together. If you want to get something looking similar to the\nscreenshots, here's a start.\n\n```vim\ncall plug#begin('~/.vim/plugged')\nPlug 'morhetz/gruvbox'\nPlug 'fraserlee/ScratchPad'\nPlug 'lukas-reineke/virt-column.nvim'\ncall plug#end()\n\n\" ------------------------------ SETUP ---------------------------------------\n\nse nu             \" Turn on line numbers\nse colorcolumn=80 \" Set the colour-column to 80\n\nnoremap \u003cSPACE\u003e \u003cNop\u003e\nlet mapleader=\" \"\n\n\" \u003cspace\u003ecc to toggle ScratchPad\nnnoremap \u003cleader\u003ecc \u003ccmd\u003eScratchPad\u003ccr\u003e\n\nlua \u003c\u003c EOF\n    require('virt-column').setup{ char = '|' }\nEOF\n\n\" -------------------------- COLOUR SCHEME -----------------------------------\n\ncolorscheme gruvbox\nlet g:gruvbox_contrast_dark = 'hard'\nse background=dark\n\n\" Set the colourcolumn background to the background colour,\n\" foreground to the same as the window split colour\n\nexecute \"hi ColorColumn ctermbg=\" .\n            \\matchstr(execute('hi Normal'), 'ctermbg=\\zs\\S*')\nhi! link VirtColumn VertSplit\n```\n\n![1](https://raw.githubusercontent.com/FraserLee/readme_resources/main/screenshot%201.png)\n![2](https://raw.githubusercontent.com/FraserLee/readme_resources/main/screenshot%202.png)\n![3](https://raw.githubusercontent.com/FraserLee/readme_resources/main/screenshot%203.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffraserlee%2Fscratchpad","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffraserlee%2Fscratchpad","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffraserlee%2Fscratchpad/lists"}