# Globally rename variables in Cabbage scripts

**URL:** <https://forum.cabbageaudio.com/t/globally-rename-variables-in-cabbage-scripts/3873>\
**Category:** Csound Noobs\
**Created:** [29 September 2023 08:26 UTC](https://forum.cabbageaudio.com/t/globally-rename-variables-in-cabbage-scripts/3873 "2023-09-29T08:26:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![WillH0ward-1](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/willh0ward-1/32/4954_2.png) [@WillH0ward-1](https://forum.cabbageaudio.com/u/WillH0ward-1)\
**Post date:** [29 September 2023 08:26 UTC](https://forum.cabbageaudio.com/t/globally-rename-variables-in-cabbage-scripts/3873/1 "2023-09-29T08:26:57Z")

</div>

Morning all,

Just a quick question, is there any way to globally rename a variable across all instances in a Cabbage script? Not sure if this is a feature or not- If not, is there a specific reason? Would it be tricky to implement? I ask since this feature has been very useful in Visual Studio when refactoring code - In Visual Studio, the process is:

_Right click instance of variable \> select ‘Rename’ in dropdown \> Rename variable \> Enter key \> All instances renamed_

Thanks!

---

<div class="post-metadata">

**Author:** ![hdale94](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/hdale94/32/6371_2.png) [@hdale94](https://forum.cabbageaudio.com/u/hdale94)\
**Post date:** [29 September 2023 15:47 UTC](https://forum.cabbageaudio.com/t/globally-rename-variables-in-cabbage-scripts/3873/2 "2023-09-29T15:47:17Z")

</div>

I use VS Code for this. Open the .csd file in VS Code, select the text, right-click and “Change All Occurrences”.

 ![image](https://forum.cabbageaudio.com/uploads/default/original/2X/0/0d58c8f84502eae2d85a973a005f403e5cfc1871.png)

---

<div class="post-metadata">

**Author:** ![WillH0ward-1](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/willh0ward-1/32/4954_2.png) [@WillH0ward-1](https://forum.cabbageaudio.com/u/WillH0ward-1)\
**Post date:** [30 September 2023 09:10 UTC](https://forum.cabbageaudio.com/t/globally-rename-variables-in-cabbage-scripts/3873/3 "2023-09-30T09:10:33Z")

</div>

That certainly works, thanks! Hopefully this is something that could be implemented in future versions of Cabbage

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [1 October 2023 11:53 UTC](https://forum.cabbageaudio.com/t/globally-rename-variables-in-cabbage-scripts/3873/4 "2023-10-01T11:53:11Z")

</div>

> [@WillH0ward-1](#):
>
> Hopefully this is something that could be implemented in future versions of Cabbage

Already there. Edit-\>Replace 🙂 but i will concede that I usually do these kind of operations with VS Code too..

---

<div class="post-metadata">

**Author:** ![WillH0ward-1](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/willh0ward-1/32/4954_2.png) [@WillH0ward-1](https://forum.cabbageaudio.com/u/WillH0ward-1)\
**Post date:** [2 October 2023 11:54 UTC](https://forum.cabbageaudio.com/t/globally-rename-variables-in-cabbage-scripts/3873/6 "2023-10-02T11:54:50Z")

</div>

Great! Thanks for the info - What are the specific advantages of using VS Code for this task?

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [2 October 2023 12:08 UTC](https://forum.cabbageaudio.com/t/globally-rename-variables-in-cabbage-scripts/3873/7 "2023-10-02T12:08:34Z")

</div>

It’s a far better code editor than the one that ship with Cabbage 🙂
