Closed daUnknownCoder closed 3 months ago
- i will see if i can think of a way to implement a more customisable watermark
found a workaround:
watermark = (vim.fn.getcwd():gsub(os.getenv("HOME"), "~")),
can u remove the unnecessary because it is not required as it already is in the photo gen...
Hey @daUnknownCoder! thx for using codesnap.nvim and give me useful feedback. base on your questions:
config.watermark
which allows you to custom watermarkcan u remove the unnecessary
It implement in https://github.com/mistricky/codesnap.nvim/pull/18, you will see the changes in next release version :)
Hii @daUnknownCoder, now the codesnap.nvim already implement custom watermark & preview code font_family in the latest version, you can config them via:
require("codesnap").setup({
-- ...
editor_font_family = "CaskaydiaCove Nerd Font",
watermark_font_family = "Pacifico",
})
The preview title can also be customized via:
require("codesnap").setup({
-- ...
preview_title = "CodeSnap.nvim",
})
You can check full changelog in v0.0.9
Based on your question, it seems like you want someplace to display the path of the code that previews on the page, maybe breadcrumbs is a better choice. We will implement breadcrumbs in the future :)
@mistricky this workaround works so if u can integrate this to something like
watermark = (vim.fn.getcwd():gsub(os.getenv("HOME"), "~"))
(with tilde)
watermark = vim.fn.getcwd()
(without tilde)
With aliases liek
watermark = PWD
And
watermark = tPWD
Would be awesome, and wow u guys are fast, maybe focus more on decreasing the dependencies and compilation time first coz these things will resolve on the go but the deal breaker is the compilation time that too 2 different languages... Tho this plugin is v nice
About the compilation time, at the latest version, the code of the preview client was packed on CI before release, this will reduce a lot of compilation time :)
And looks like you just wanna display the $pwd on somewhere if I'm not mistaken, but watermark of this plugin is design to display your own identity symbol or something, it's not suitable to display something like $pwd, but there is a workaround as you say, custom watermark and it's font family would be make the $pwd looks not weird. But still it's a workaround, we have planned to develop breadcrumbs to display pwd, you can looking forward to next release version :)
Can i contribute to those breadcrumbs of yours like do you accept pull requests?
Also a CodeSnapPreviewOff
to disconnect from localhost
Hi can you tell me how to chaneg the watermark family? coz i tried watermark_font_family = "JetBrainsMono Nerd Font",
which didnt work
Can i contribute to those breadcrumbs of yours like do you accept pull requests?
Yeah, of course I'm glad to have others to contribute codesnap.nvim, but this feature is already under development
Hi can you tell me how to chaneg the watermark family? coz i tried watermark_font_family = "JetBrainsMono Nerd Font", which didnt work
looks like your config is correct, please make sure you have installed JetBrainsMono Nerd Font
in your computer
Hi can you tell me how to chaneg the watermark family? coz i tried watermark_font_family = "JetBrainsMono Nerd Font", which didnt work
looks like your config is correct, please make sure you have installed
JetBrainsMono Nerd Font
in your computer
ofc i have, its installed it doesnt work for any font idk why, i tried Iosevka, Rubik, Fira Code too
editor_font_family
also doesnt work
Good to know you moved from
bloatware rustto Good, pure lua
But this is not working, i removed my ~/.local/share/NeutronVim/lazy/codesnap.nvim
folder, i reinstalled the plugin but i always get:
Command CodeSnap
not found after loading codesnap.nvim
lazy.nvim
also says:
Failed to run `config` for codesnap.nvim
...nfig/NeutronVim/lua/NeutronVim/plugins/Utils/useless.lua:103: loop or previous error loading module 'codesnap'
# stacktrace:
- lua/NeutronVim/plugins/Utils/useless.lua:103 _in_ **config**
I also get a horizontal split
with:
Error lazy.nvim Failed to source `/home/daUnknownCoder/.local/share/NeutronVim/lazy/codesnap.nvim/plugin/codesnap.lua`
vim/_editor.lua:0: nvim_exec2()../home/daUnknownCoder/.local/share/NeutronVim/lazy/codesnap.nvim/plugin/codesnap.lua: Vim(source):E5113: Error while calling lua chunk: vim/loader.lua:0: /home/daUnknownCoder/.local/share/NeutronVim/lazy/codesnap.nvim/lua/generator.so: invalid ELF header
stack traceback:
[C]: in function 'error'
vim/loader.lua: in function <vim/loader.lua:0>
[C]: in function 'require'
...hare/NeutronVim/lazy/codesnap.nvim/lua/codesnap/init.lua:3: in main chunk
[C]: in function 'require'
.../share/NeutronVim/lazy/codesnap.nvim/plugin/codesnap.lua:1: in main chunk
[C]: in function 'nvim_exec2'
vim/_editor.lua: in function 'cmd'
...share/NeutronVim/lazy/lazy.nvim/lua/lazy/core/loader.lua:485: in function <...share/NeutronVim/lazy/lazy.nvim/lua/lazy/core/loader.lua:484>
[C]: in function 'xpcall'
...l/share/NeutronVim/lazy/lazy.nvim/lua/lazy/core/util.lua:113: in function 'try'
...share/NeutronVim/lazy/lazy.nvim/lua/lazy/core/loader.lua:484: in function 'source'
...share/NeutronVim/lazy/lazy.nvim/lua/lazy/core/loader.lua:443: in function 'source_runtime'
...share/NeutronVim/lazy/lazy.nvim/lua/lazy/core/loader.lua:411: in function 'packadd'
...share/NeutronVim/lazy/lazy.nvim/lua/lazy/core/loader.lua:346: in function '_load'
...share/NeutronVim/lazy/lazy.nvim/lua/lazy/core/loader.lua:191: in function 'load'
.../NeutronVim/lazy/lazy.nvim/lua/lazy/core/handler/cmd.lua:10: in function '_load'
.../NeutronVim/lazy/lazy.nvim/lua/lazy/core/handler/cmd.lua:34: in function <.../NeutronVim/lazy/lazy.nvim/lua/lazy/core/handler/cmd.lua:16>
# stacktrace:
- vim/_editor.lua:0 _in_ **cmd**
Device things:
neovim version
:
NVIM v0.9.5
Build type: Release
LuaJIT 2.1.1702233742
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/usr/share/nvim"
Run :checkhealth for more info
OS
: Arch Linux -> 6.7.6-arch1-1
WM
: Hyprland -> Hyprland, built from branch main at commit 927da86e3e76a8465c8b45fd7a87a34f25401b37
Terminal
: Warp -> v0.2024.03.05.08.02.stable_01-1
This issue is duplicates https://github.com/mistricky/codesnap.nvim/issues/39
Hi @daUnknownCoder the readme was updated, now you can build codesnap.nvim manually if you still face these problem. And the breadcrumbs is added, you can display current file path easier by open breadcrumbs
hey @mistricky that was cool, yeah but still:
Error executing Lua callback: .../NeutronVim/lazy/lazy.nvim/lua/lazy/core/handler/cmd.lua:48: Vim:Error executing Lua callback: ...hare/NeutronVim/lazy/codesnap.nvim/lua/codesnap/init.lua:31: Please select code which you want to take snapshot first
stack traceback:
[C]: in function 'error'
...hare/NeutronVim/lazy/codesnap.nvim/lua/codesnap/init.lua:31: in function 'get_config'
...hare/NeutronVim/lazy/codesnap.nvim/lua/codesnap/init.lua:49: in function 'copy_into_clipboard'
.../share/NeutronVim/lazy/codesnap.nvim/plugin/codesnap.lua:4: in function <.../share/NeutronVim/lazy/codesnap.nvim/plugin/codesnap.lua:3>
[C]: in function 'cmd'
.../NeutronVim/lazy/lazy.nvim/lua/lazy/core/handler/cmd.lua:48: in function <.../NeutronVim/lazy/lazy.nvim/lua/lazy/core/handler/cmd.lua:16>
stack traceback:
[C]: in function 'cmd'
.../NeutronVim/lazy/lazy.nvim/lua/lazy/core/handler/cmd.lua:48: in function <.../NeutronVim/lazy/lazy.nvim/lua/lazy/core/handler/cmd.lua:16>
when i not select code ⬆️
if i select code, codesnap freezes and after sometime, neovim quits
running the codesnap takes so long idk why and the copied thing doesnt even paste anywhere it does take a long time, almost hangs my PC my neovim crashesmostly saying some panic
- Because CodeSnap need a few time to generate snapshot, can you provide the crash log?
where do i get that
the generated snapshot isnt copied, the saved snapshot doesnt have breadcrumbs
almost hangs my PC my neovim crashesmostly saying some panic
after the crash happens, probably exec the :message
command can find messages contain "panic"
the generated snapshot isnt copied, the saved snapshot doesnt have breadcrumbs
If you wanna breadcrumbs, you can set has_breadcrumbs to true like README mention that:
Breadcrumbs are something to display the current snapshot file path, you can open it through config has_breadcrumbs:
require("codesnap").setup({
-- ...
has_breadcrumbs = true
})
almost hangs my PC my neovim crashesmostly saying some panic
after the crash happens, probably exec the
:message
command can find messages contain "panic"
after the crash i exit neovim so there's no previous session messages
after the crash i exit neovim so there's no previous session messages
Can u reproduce and get the crash message?
ikr
If you wanna breadcrumbs, you can set has_breadcrumbs to true like README mention that:
this is my config
{
"mistricky/codesnap.nvim",
build = "make",
version = "^1",
lazy = true,
cmd = { "CodeSnap", "CodeSnapSave" },
config = function()
require("codesnap").setup({
has_breadcrumbs = true,
bg_theme = "summer",
save_path = "./idk.png",
})
end,
},
so there's no breadcrumbs in save img and i cannot paste the said
copied to clipboard anywhere, mind if you reopen this issue? it feels dumb commenting in a closed issue
this is the idk.png
after the crash i exit neovim so there's no previous session messages
Can u reproduce and get the crash message?
ig i got something:
so there's no breadcrumbs in save img and i cannot paste the said copied to clipboard anywhere, mind if you reopen this issue? it feels dumb commenting in a closed issue
what's your codesnap.nvim version? please make sure update codesnap to latest version v1.1.0
it feels dumb commenting in a closed issue
Would u mind open another issue to describe these issues? this issue contains too much information includes old version issues.
so there's no breadcrumbs in save img and i cannot paste the said copied to clipboard anywhere, mind if you reopen this issue? it feels dumb commenting in a closed issue
what's your codesnap.nvim version? please make sure update codesnap to latest version v1.1.0
https://github.com/mistricky/codesnap.nvim/assets/84800625/56da45b8-452f-4475-99d0-90c3c14dcc28
I want the watermark to be the
$(PWD)
any way to do so? Like:I would also like to change the title of the window from
React App
to<My Custom Title>
is that possible?Custom Installable font instead of most probably
Pacifico
in watermark?See i really like the project but if these can be resolved then this project will be a gr8 success