You are not logged in.
Hello,
I have installed Kate, but I didn't understand how I can create source files. Clicking on New, it makes only a text document.
Grant.
Last edited by Grant (2013-01-14 13:35:43)
Offline
What are you expecting specifically? Some kind of code templates? TBH, I haven't used Kate in a long time and don't remember if it provides something like that.
Offline
No, I don't want any templates. I want create some C++ files, and not simples text files.
What IDE do you use? Or only a text editor?
Offline
C++ files are simple text files. Programming languages are written in plain text files and usually don't require an IDE. Any text editor will do.
If you wan't to learn C++, you should probably pick up a good book. If its not specifically C++, consider trying a different language first. C++ is not very beginner friendly.
Offline
I know these things. C++ files are text files: but have a "special" extension. It isn't .txt but .cpp for example. A compiler won't accept a .txt file.
I only wanted to know how I can create these files from the program. Trying to create a file, save it with .cpp extension, it gets the syntax highlighting. Is possible to make directly a C++ file?
Before I tried KDevelop: is possible to use gcc/g++ instead cmake?
Offline
So this whole thing is about a filename? Are you kidding me?
Save the file as whatever you want, who cares?
Offline
I want to make a C++ file from Kate: is possible and how?
Offline
I know these things. C++ files are text files: but have a "special" extension. It isn't .txt but .cpp for example. A compiler won't accept a .txt file.
I only wanted to know how I can create these files from the program. Trying to create a file, save it with .cpp extension, it gets the syntax highlighting. Is possible to make directly a C++ file?
Before I tried KDevelop: is possible to use gcc/g++ instead cmake?
I'm still very confused about what you're expecting. You can just save a file with the .cpp as part of the file name. If that's not working for you post the results of trying to compile and the command
file $filename Here's what I got out of file I had in my pkgbuild folder
andy@odin> file application.cpp
application.cpp: C source, ASCII textand one I created with kate and just named along with pasting a couple lines from another file
andy@odin> file test.cpp
test.cpp: C source, ASCII textOffline
You can write c++ file in any text editor, vim, nano, emacs, gedit, kate etc. But you won't be able to compile from within it - there is no button for compilation in simple text editors.
You can also use IDE for c++ programming (eclipse, kdevelop...) to get advanced stuff like compiling, project management etc.
Kate is advanced text editor with tools and extensions aimed at developers. By default you've got nice things like syntax highlighting which can help you writing code - maybe this is what you were asking for in the first post? If so just enable it in tools menu. You've got also code snippets under ctrl+space shortcut. And many many other things made for c++ just spend 5 seconds with Kate and try to learn it.
Last edited by masteryod (2013-01-13 17:56:58)
Offline
Kate is advanced text editor with tools and extensions aimed at developers. By default you've got nice things like syntax highlighting which can help you writing code - maybe this is what you were asking for in the first post?
Nope...
I would create a C++ source file from Kate. I would that Kate creates a .cpp file instead .txt as default. Is clear or not?
Last edited by Grant (2013-01-13 18:03:36)
Offline
I would create a C++ source file from Kate. I would that Kate creates a .cpp file instead .txt as default. Is clear or not?
What's not clear is that YOU determine the filename. This isn't Windows, the extensions don't matter. If you want a file to have a .cpp extension, save it with a .cpp extension. If that's too hard for you, you need to forget about C++.
Offline
Perhaps, and I'm stretching here because this is very odd, but perhaps the problem is that when a new (blank) file is opened, it does not have any syntax highlighting until it is saved with an extension.
So one could not just open a new file and start typing C++ code and get highlighting. You'd have to open a new document, save it as somefile.cpp first.
There should be a way to set the highlighting mode for the default buffer.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
OP wants kate to save files as .cpp by default, without OP having to type .cpp all the time. Kate will not do that, as far as I know. It will always assume .txt. I don't understand, why this is a bother, but everyone to its own.
Last edited by Awebb (2013-01-13 18:51:58)
Offline
Nope...
I would create a C++ source file from Kate. I would that Kate creates a .cpp file instead .txt as default. Is clear or not?
Try templates plugin: http://docs.kde.org/stable/en/kde-basea … plate.html
With this Kate should save file as .cpp file(?) can't test it, I don't have kdepim package and I don't want to install it.
Also, any one knows what Automatically select filename extensions option do and why it's grayed out in "save as" dialog?
PS there is "build" plugin if you're interested so you'll have button for compilation.
Last edited by masteryod (2013-01-13 19:25:37)
Offline
The filename is the problem?! If the .txt default bothers you so much, use a different editor.
Offline
Ok, so I have to create the file and save it to get the syntax highlighting. This is what I wanted to know.
Thanks to all participants.
Offline
If you have the answer you need edit the post title to say [solved]
Offline
masteryod wrote:Kate is advanced text editor with tools and extensions aimed at developers. By default you've got nice things like syntax highlighting which can help you writing code - maybe this is what you were asking for in the first post?
Nope...
but then...
Ok, so I have to create the file and save it to get the syntax highlighting. This is what I wanted to know.
Offline