peek.nvim icon indicating copy to clipboard operation
peek.nvim copied to clipboard

Add instructions how to install using vim-plug

Open sstark opened this issue 1 year ago • 5 comments

Is your feature request related to a problem? Please describe. I tried to install peek using vim-plug using the following:

Plug 'toppair/peek.nvim'
lua <<EOF
require("peek").setup()
EOF

but that does not seem to make it work. If then try:

:lua require("peek").open{}

I get:

Peek error: error: Module not found "file:///home/seb/.config/nvim/plugged/peek.nvim/public/main.bundle.js".

Describe the solution you'd like A clear and concise description of how to install peek using vim-plug. Likely there is a build step missing, but where and how to add it is unclear.

Thanks!

sstark avatar Sep 11 '24 05:09 sstark

Navigate to peek.nvim folder, in my case it's located by this path ~/.local/share/nvim/plugged/peek.nvim and run this command: deno task --quiet build:fast. It might be that you didn't have deno installed beforehand. Make sure it's installed.

egoarka avatar Oct 01 '24 03:10 egoarka

Thank you @egoarka , with this information I could proceed. I didn't know it needs to be run in this directory.

sstark avatar Oct 14 '24 19:10 sstark

i'm also using vim-plug and it doesn't work for me

vim-plug shows peek as being installed

i installed deno via homebrew

i went to the plugin's directory (~/.local/share/nvim/plugins/peek.nvim) and ran the suggested command, even though deno was installed prior to installing the plugin:

deno task --quiet build:fast
Download https://deno.land/[email protected]/cli/parse_args.ts
Download https://deno.land/[email protected]/path/mod.ts
Download https://deno.land/x/[email protected]/index.ts
Download https://deno.land/x/[email protected]/mod.ts
Download https://deno.land/[email protected]/cli/parse_args.ts
Download https://deno.land/[email protected]/collections/sliding_windows.ts
Download https://esm.sh/[email protected]?no-dts
Download https://deno.land/[email protected]/assert/assert.ts
Download https://deno.land/[email protected]/path/windows/mod.ts
Download https://deno.land/[email protected]/path/posix/mod.ts
Download https://deno.land/[email protected]/path/basename.ts
Download https://deno.land/[email protected]/path/constants.ts
Download https://deno.land/[email protected]/path/dirname.ts
Download https://deno.land/[email protected]/path/extname.ts
Download https://deno.land/[email protected]/path/format.ts
Download https://deno.land/[email protected]/path/from_file_url.ts
Download https://deno.land/[email protected]/path/is_absolute.ts
Download https://deno.land/[email protected]/path/join.ts
Download https://deno.land/[email protected]/path/normalize.ts
Download https://deno.land/[email protected]/path/parse.ts
Download https://deno.land/[email protected]/path/relative.ts
Download https://deno.land/[email protected]/path/resolve.ts
Download https://deno.land/[email protected]/path/to_file_url.ts
Download https://deno.land/[email protected]/path/to_namespaced_path.ts
Download https://deno.land/[email protected]/path/common.ts
Download https://deno.land/[email protected]/path/_interface.ts
Download https://deno.land/[email protected]/path/glob_to_regexp.ts
Download https://deno.land/[email protected]/path/is_glob.ts
Download https://deno.land/[email protected]/path/join_globs.ts
Download https://deno.land/[email protected]/path/normalize_glob.ts
Download https://deno.land/[email protected]/path/posix.ts
Download https://deno.land/x/[email protected]/mod.ts
Download https://deno.land/[email protected]/log/mod.ts
Download https://cdn.skypack.dev/[email protected]
Download https://esm.sh/[email protected]
Download https://esm.sh/[email protected]
Download https://esm.sh/[email protected]
Download https://esm.sh/[email protected]
Download https://esm.sh/[email protected]
Download https://esm.sh/[email protected]
Download https://deno.land/x/[email protected]/src/webview.ts
Download https://deno.land/x/[email protected]/src/ffi.ts
Download https://deno.land/[email protected]/assert/assert.ts
Download https://deno.land/[email protected]/assert/assertion_error.ts
Download https://deno.land/[email protected]/path/windows/basename.ts
Download https://deno.land/[email protected]/path/windows/constants.ts
Download https://deno.land/[email protected]/path/windows/dirname.ts
Download https://deno.land/[email protected]/path/windows/extname.ts
Download https://deno.land/[email protected]/path/windows/format.ts
Download https://deno.land/[email protected]/path/windows/from_file_url.ts
Download https://deno.land/[email protected]/path/windows/is_absolute.ts
Download https://deno.land/[email protected]/path/windows/join.ts
Download https://deno.land/[email protected]/path/windows/normalize.ts
Download https://deno.land/[email protected]/path/windows/parse.ts
Download https://deno.land/[email protected]/path/windows/relative.ts
Download https://deno.land/[email protected]/path/windows/resolve.ts
Download https://deno.land/[email protected]/path/windows/to_file_url.ts
Download https://deno.land/[email protected]/path/windows/to_namespaced_path.ts
Download https://deno.land/[email protected]/path/windows/common.ts
Download https://deno.land/[email protected]/path/windows/glob_to_regexp.ts
Download https://deno.land/[email protected]/path/windows/is_glob.ts
Download https://deno.land/[email protected]/path/windows/join_globs.ts
Download https://deno.land/[email protected]/path/windows/normalize_glob.ts
Download https://deno.land/[email protected]/path/posix/basename.ts
Download https://deno.land/[email protected]/path/posix/constants.ts
Download https://deno.land/[email protected]/path/posix/dirname.ts
Download https://deno.land/[email protected]/path/posix/extname.ts
Download https://deno.land/[email protected]/path/posix/format.ts
Download https://deno.land/[email protected]/path/posix/from_file_url.ts
Download https://deno.land/[email protected]/path/posix/is_absolute.ts
Download https://deno.land/[email protected]/path/posix/join.ts
Download https://deno.land/[email protected]/path/posix/normalize.ts
Download https://deno.land/[email protected]/path/posix/parse.ts
Download https://deno.land/[email protected]/path/posix/relative.ts
Download https://deno.land/[email protected]/path/posix/resolve.ts
Download https://deno.land/[email protected]/path/posix/to_file_url.ts
Download https://deno.land/[email protected]/path/posix/to_namespaced_path.ts
Download https://deno.land/[email protected]/path/posix/common.ts
Download https://deno.land/[email protected]/path/posix/glob_to_regexp.ts
Download https://deno.land/[email protected]/path/posix/is_glob.ts
Download https://deno.land/[email protected]/path/posix/join_globs.ts
Download https://deno.land/[email protected]/path/posix/normalize_glob.ts
Download https://deno.land/[email protected]/path/_os.ts
Download https://deno.land/x/[email protected]/deps.ts
Download https://deno.land/[email protected]/assert/assertion_error.ts
Download https://deno.land/[email protected]/path/_common/common.ts
Download https://deno.land/[email protected]/path/_constants.ts
Download https://deno.land/[email protected]/path/_util.ts
Download https://deno.land/x/is_docker/mod.ts
Download https://deno.land/[email protected]/log/base_handler.ts
Download https://deno.land/[email protected]/log/console_handler.ts
Download https://deno.land/[email protected]/log/file_handler.ts
Download https://deno.land/[email protected]/log/rotating_file_handler.ts
Download https://deno.land/[email protected]/log/levels.ts
Download https://deno.land/[email protected]/log/logger.ts
Download https://deno.land/[email protected]/log/formatters.ts
Download https://deno.land/[email protected]/log/critical.ts
Download https://deno.land/[email protected]/log/debug.ts
Download https://deno.land/[email protected]/log/error.ts
Download https://deno.land/[email protected]/log/get_logger.ts
Download https://deno.land/[email protected]/log/info.ts
Download https://deno.land/[email protected]/log/setup.ts
Download https://deno.land/[email protected]/log/warn.ts
Download https://deno.land/x/[email protected]/mod.ts
Download https://deno.land/x/[email protected]/download.ts
Download https://deno.land/x/[email protected]/deps.ts
Download https://deno.land/x/[email protected]/types.ts
Download https://deno.land/x/[email protected]/util.ts
Download https://deno.land/[email protected]/path/mod.ts
Download https://deno.land/[email protected]/fs/mod.ts
Download https://deno.land/[email protected]/encoding/hex.ts
Download https://deno.land/[email protected]/fmt/colors.ts
Download https://cdn.skypack.dev/-/[email protected]/dist=es2019,mode=imports/optimized/highlightjs.js
Download https://deno.land/[email protected]/_util/os.ts
Download https://deno.land/[email protected]/path/win32.ts
Download https://deno.land/[email protected]/path/posix.ts
Download https://deno.land/[email protected]/path/common.ts
Download https://deno.land/[email protected]/path/separator.ts
Download https://deno.land/[email protected]/path/_interface.ts
Download https://deno.land/[email protected]/path/glob.ts
Download https://deno.land/[email protected]/fs/empty_dir.ts
Download https://deno.land/[email protected]/fs/ensure_dir.ts
Download https://deno.land/[email protected]/fs/ensure_file.ts
Download https://deno.land/[email protected]/fs/ensure_link.ts
Download https://deno.land/[email protected]/fs/ensure_symlink.ts
Download https://deno.land/[email protected]/fs/exists.ts
Download https://deno.land/[email protected]/fs/expand_glob.ts
Download https://deno.land/[email protected]/fs/move.ts
Download https://deno.land/[email protected]/fs/copy.ts
Download https://deno.land/[email protected]/fs/walk.ts
Download https://deno.land/[email protected]/fs/eol.ts
Download https://esm.sh/entities@^4.4.0?target=denonext
Download https://esm.sh/linkify-it@^5.0.0?target=denonext
Download https://esm.sh/mdurl@^2.0.0?target=denonext
Download https://esm.sh/punycode.js@^2.3.1?target=denonext
Download https://esm.sh/uc.micro@^2.0.0?target=denonext
Download https://esm.sh/[email protected]/denonext/markdown-it.mjs
Download https://esm.sh/[email protected]/denonext/morphdom.mjs
Download https://cdn.skypack.dev/@types/mermaid?dts
Download https://esm.sh/[email protected]/denonext/markdown-it-emoji.mjs
Download https://esm.sh/[email protected]/denonext/markdown-it-footnote.mjs
Download https://esm.sh/[email protected]/denonext/markdown-it-task-lists.mjs
Download https://esm.sh/katex?target=denonext
Download https://esm.sh/[email protected]/denonext/markdown-it-texmath.mjs
Download https://esm.sh/[email protected]/denonext/katex.mjs
Download https://deno.land/[email protected]/path/_common/basename.ts
Download https://deno.land/[email protected]/path/_common/constants.ts
Download https://deno.land/[email protected]/path/_common/strip_trailing_separators.ts
Download https://deno.land/[email protected]/path/windows/_util.ts
Download https://deno.land/[email protected]/path/_common/dirname.ts
Download https://deno.land/[email protected]/path/_common/assert_path.ts
Download https://deno.land/[email protected]/path/_common/format.ts
Download https://deno.land/[email protected]/path/_common/from_file_url.ts
Download https://deno.land/[email protected]/path/_common/normalize.ts
Download https://deno.land/[email protected]/path/_common/normalize_string.ts
Download https://deno.land/[email protected]/path/_common/relative.ts
Download https://deno.land/[email protected]/path/_common/to_file_url.ts
Download https://deno.land/[email protected]/path/_common/glob_to_reg_exp.ts
Download https://deno.land/[email protected]/path/posix/_util.ts
Download https://deno.land/[email protected]/fmt/colors.ts
Download https://deno.land/[email protected]/fs/exists.ts
Download https://deno.land/[email protected]/log/_state.ts
Download https://deno.land/[email protected]/log/_config.ts
Download https://deno.land/[email protected]/path/_constants.ts
Download https://deno.land/[email protected]/path/_util.ts
Download https://deno.land/[email protected]/_util/asserts.ts
Download https://deno.land/[email protected]/fs/_util.ts
Download https://cdn.skypack.dev/-/@types/[email protected]/dist=es2019,mode=imports/optimized/@types/mermaid.js
Download https://cdn.skypack.dev/-/[email protected]/dist=es2019,mode=imports/optimized/common/core-62ddff3d.js
Download https://cdn.skypack.dev/-/[email protected]/dist=es2019,mode=imports/optimized/common/wasm-cf9dcc58.js
Download https://esm.sh/[email protected]/denonext/lib/decode.mjs
Download https://esm.sh/[email protected]/denonext/lib/escape.mjs
Download https://esm.sh/[email protected]/denonext/entities.mjs
Download https://esm.sh/[email protected]/denonext/linkify-it.mjs
Download https://esm.sh/[email protected]/denonext/mdurl.mjs
Download https://esm.sh/[email protected]/denonext/punycode.mjs
Download https://esm.sh/[email protected]/denonext/uc.micro.mjs
Download https://esm.sh/[email protected]/denonext/katex.mjs

there is no PeekOpen or PeekClose command available

pmatulis avatar Mar 09 '25 00:03 pmatulis

i tried to open it manually and it worked:

lua require("peek").open{}

what do i need to do to get the neovim commands?

pmatulis avatar Mar 09 '25 00:03 pmatulis

i got it to work. for any future travelers:

i am calling the plugin from my hybrid Lua/VimL configuration like this:

lua << EOF
.
.
.
require("peek-conf")
EOF

and peek-conf.lua looks like this:

require("peek").setup({
  auto_load = true,         -- whether to automatically load preview when
                            -- entering another markdown buffer
  close_on_bdelete = true,  -- close preview window on buffer delete

  syntax = true,            -- enable syntax highlighting, affects performance

  theme = 'dark',           -- 'dark' or 'light'

  update_on_change = true,

  app = 'webview',          -- 'webview', 'browser', string or a table of strings
                            -- explained below

  filetype = { 'markdown' },-- list of filetypes to recognize as markdown

  -- relevant if update_on_change is true
  throttle_at = 200000,     -- start throttling when file exceeds this
                            -- amount of bytes in size
  throttle_time = 'auto',   -- minimum amount of time in milliseconds
                            -- that has to pass before starting new render
})

vim.api.nvim_create_user_command("PeekOpen", require("peek").open, {})
vim.api.nvim_create_user_command("PeekClose", require("peek").close, {})

pmatulis avatar Mar 09 '25 00:03 pmatulis