Skip to content

Instantly share code, notes, and snippets.

@rawnly
Created November 25, 2025 22:09
Show Gist options
  • Select an option

  • Save rawnly/01601a4b8b5e389ec8e4bca0bc2df7c0 to your computer and use it in GitHub Desktop.

Select an option

Save rawnly/01601a4b8b5e389ec8e4bca0bc2df7c0 to your computer and use it in GitHub Desktop.
-- Set buffer to be readonly
vim.api.nvim_buf_set_option(buf, "readonly", true)
vim.api.nvim_buf_set_option(buf, "modifiable", false)
vim.api.nvim_buf_set_name(
buf,
string.format("gist://%s/%s", gist.hash, gist.name)
)
-- Set winbar
local winbar = string.format("%%=GIST `%s` [READ-ONLY]", gist.name)
vim.api.nvim_win_set_option(win, "winbar", winbar)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment