# Copy button or CMD a functionality for code blocks

**URL:** <https://community.bear.app/t/copy-button-or-cmd-a-functionality-for-code-blocks/12800>\
**Category:** Feature Request\
**Created:** [May 20, 2024, 3:09pm UTC](https://community.bear.app/t/copy-button-or-cmd-a-functionality-for-code-blocks/12800 "2024-05-20T15:09:39Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ptrtoEM](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@ptrtoEM](https://community.bear.app/u/ptrtoEM)\
**Post date:** [May 20, 2024, 3:09pm UTC](https://community.bear.app/t/copy-button-or-cmd-a-functionality-for-code-blocks/12800/1 "2024-05-20T15:09:39Z")

</div>

## This has been requested before, but it’s such an important point for me that I will create a new post here. I originally posted this on the subreddit.

This is one of my major pain points with bear. If I have a long code block, and I want to copy it, I have to select it with my mouse, which is very cumbersome.

Unless I’m missing something, adding a copy button to a code block or having cmd + A only select inside the codeblock when inside the code block would be wonderful

Two examples come to mind:

- copy button: In Obsidian, it’s small and out sight, but doesn’t have the CMD + A function.

- cmd + A: In Craft, it doesn’t have the copy button but has the CMD + A function, which I like more

---

<div class="post-metadata">

**Author:** ![roar](https://dub1.discourse-cdn.com/flex013/user_avatar/community.bear.app/roar/32/223_2.png) [@roar](https://community.bear.app/u/roar)\
**Post date:** [May 21, 2024, 12:56am UTC](https://community.bear.app/t/copy-button-or-cmd-a-functionality-for-code-blocks/12800/2 "2024-05-21T00:56:13Z")

</div>

In Bear on MacOS you have right click context menu: `Copy code`:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/bear/original/2X/6/64e1297b67e07a7c78efa0ca6491a6eea2513c68.jpeg)

And also found at menu bar, where you can assign a MacOS keyboard shortcut to it:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/bear/original/2X/a/a728a3b768db87733a85f5923efed275fd661a03.jpeg)

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/bear/original/2X/0/0698b0e87f6c2e8e26c5b30b93c7a0b898081394.jpeg)

Unfortunately, `Copy code` is not present on iPad/iOS,  
so I agree with you, we also need either:

- Copy Button or
- ⌘A to select code only (when cursor is inside a code block)
- or both 😉

---

<div class="post-metadata">

**Author:** ![matteo](https://dub1.discourse-cdn.com/flex013/user_avatar/community.bear.app/matteo/32/21_2.png) [@matteo](https://community.bear.app/u/matteo)\
**Post date:** [May 21, 2024, 10:02am UTC](https://community.bear.app/t/copy-button-or-cmd-a-functionality-for-code-blocks/12800/3 "2024-05-21T10:02:45Z")

</div>

> [@ptrtoEM](#):
>
> - copy button: In Obsidian, it’s small and out sight, but doesn’t have the CMD + A function.
> - cmd + A: In Craft, it doesn’t have the copy button but has the CMD + A function, which I like more

Those have been on my list for a long time, today is the day! I’ve already added the ⌘A and I’ll try to add also the button 🙂

---

<div class="post-metadata">

**Author:** ![ptrtoEM](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@ptrtoEM](https://community.bear.app/u/ptrtoEM)\
**Post date:** [May 21, 2024, 3:10pm UTC](https://community.bear.app/t/copy-button-or-cmd-a-functionality-for-code-blocks/12800/4 "2024-05-21T15:10:29Z")

</div>

Cool, thanks! Do you mean you added them to the todo list? When can we expect this to be live, more or less?

---

<div class="post-metadata">

**Author:** ![matteo](https://dub1.discourse-cdn.com/flex013/user_avatar/community.bear.app/matteo/32/21_2.png) [@matteo](https://community.bear.app/u/matteo)\
**Post date:** [May 22, 2024, 7:44am UTC](https://community.bear.app/t/copy-button-or-cmd-a-functionality-for-code-blocks/12800/5 "2024-05-22T07:44:23Z")

</div>

> [@ptrtoEM](#):
>
> Cool, thanks! Do you mean you added them to the todo list?

No, I’ve added it to the app 😃

---

<div class="post-metadata">

**Author:** ![ptrtoEM](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@ptrtoEM](https://community.bear.app/u/ptrtoEM)\
**Post date:** [May 22, 2024, 3:04pm UTC](https://community.bear.app/t/copy-button-or-cmd-a-functionality-for-code-blocks/12800/6 "2024-05-22T15:04:53Z")

</div>

Do you mean it will be pushed in the next update?

---

<div class="post-metadata">

**Author:** ![matteo](https://dub1.discourse-cdn.com/flex013/user_avatar/community.bear.app/matteo/32/21_2.png) [@matteo](https://community.bear.app/u/matteo)\
**Post date:** [May 22, 2024, 5:08pm UTC](https://community.bear.app/t/copy-button-or-cmd-a-functionality-for-code-blocks/12800/7 "2024-05-22T17:08:57Z")

</div>

I don’t know about the next one, very soon anyway!

---

<div class="post-metadata">

**Author:** ![ptrtoEM](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@ptrtoEM](https://community.bear.app/u/ptrtoEM)\
**Post date:** [May 22, 2024, 5:30pm UTC](https://community.bear.app/t/copy-button-or-cmd-a-functionality-for-code-blocks/12800/8 "2024-05-22T17:30:49Z")

</div>

Thanks for the clarification, very appreciated!
