This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-11-05
Channels
- # adventofcode (22)
- # ai (1)
- # announcements (1)
- # babashka (3)
- # beginners (8)
- # calva (8)
- # cider (17)
- # clojure (3)
- # clojure-europe (4)
- # clojure-norway (13)
- # clojurescript (20)
- # core-logic (1)
- # data-science (3)
- # datahike (6)
- # deps-new (4)
- # events (6)
- # hoplon (4)
- # hyperfiddle (4)
- # lsp (34)
- # overtone (8)
- # podcasts-discuss (2)
- # releases (3)
- # ring (5)
- # vim (10)
- # xtdb (2)
Is there a command to yank the contents of the current buffer?
I cant seem to find anything in the neovim docs or via an internet search.
I appreciate I can do gg
to jump to the top then v
for visual mode and then G
to select the whole buffer contents, y
to yank the contents into the clipboard...
am I missing a simpler command sequence or plugin?
Ah, if I do gg
then I can do yG
which feels simpler
You can :%y
Similar to other sed-like commands, the %
means apply to the whole buffer.
I sometimes save one whole keystroke with https://github.com/kana/vim-textobj-entire:
yae
Recently, I’ve been trying to use .md files for Clerk notebooks instead of .clj, since I sometimes have a lot more Markdown text to write than code and editing Markdown is (of course) much nicer in a dedicated buffer than in Clojure comments. However, editing Clojure code without my structural editing tools and without evaluation is very painful, so I was looking for a solution that works similar to how you can edit OrgMode code blocks in Emacs in a temporary buffer that has the correct major mode for the language. I found vim-fancy (https://github.com/vitalk/vim-fancy/), which does exactly what I need, but sometimes crashes Neovim when I evaluate forms that print to the console or when I open popup-buffers, etc. But if I am careful it works quite well for basic stuff. Timeshift (https://github.com/hkupty/timeshift.vim) does the same thing, but I couldn’t get it to work (somehow it doesn’t parse the filetype correctly in my code blocks). Just wanted to ask around if someone knows about another plugin or a different solution.
Haven't tried this, https://github.com/AckslD/nvim-FeMaco.lua supposed to create a floating window for fenced code with correct file type
If you are using neovim with tree-sitter parsers then this is built-in. If you use fenced code blocks that include the language then a matching parser will be injected in. eg, in this picture there is a clojure and typescript code-block and I have typescript and clojure parsers installed. My colorscheme is a bit minimal but you can see that the code is highlighting correctly
Sorry, didn't read properly - you wanted other editing features not just highlighting.