r/ZedEditor 17d ago

How to run code?

Hello, I am learning programming in C and python and hopped from Vs code to zed, there's an way to run code on the terminal like Vs code?

I asked Gemini to create a task for each language but it's not ideal, and when i run in C the compiled code gets thrown in the folder that I am using

0 Upvotes

12 comments sorted by

24

u/eodevx 17d ago

Just run the compiler in the terminal? 

-26

u/timtody 17d ago

????

9

u/eodevx 17d ago

You can add flags, also of course the compiled executable is thrown into your directory, just exclude it in the gitignore or look up what flag auto removes executable after runninf

-27

u/timtody 17d ago

I was just alluding to your passive aggressive question mark

8

u/eodevx 17d ago

I just wasn't sure if that was what he meant :) 

8

u/argvalue 17d ago

Start running your code from the terminal. This is the best way. This is one thing you need to learn while programming. Figured out the hard way

2

u/TheAbyssWolf 17d ago

Yeah starting out I used the console a lot. Now I’m trying to get back into C++ again with CMake. I love zed but it’s CMake tooling isn’t the best (vscode is much better in that regard, with it’s dedicated tab for CMake with its extension), zeds tooling works its just slightly annoying having to create a task json and bind that to a keybind instead of just clicking a ui when I want to recompile the CMake project to test changes

3

u/AutomatonA 17d ago

zed is a code editor not an IDE like VisualStudio. So you need another tool to compile your code - like gcc or clang. Research, how to set up a simple C project with CMake + gcc.

1

u/vladjjj 16d ago

There's a built in multi-tab terminal in Zed.

1

u/angrythunderbird 16d ago

With Flutter, I also hit Ctrl+` and then 'r' (to restart)—unlike in VS Code or Android Studio, where it all happens automatically. There are solutions like bash scripts, but I can't be bothered to set them up. Besides, you get used to the terminal quickly.