Want Kate editor to default to Python mode on new document/file
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Kubuntu 14.04 w/ XFCE, Win7, OS X 10.6 Snow Leopard
Posts: 11
Rep:
Want Kate editor to default to Python mode on new document/file
Am using Kubuntu/XFCE/Kate editor in a Python class. In Kate, it's annoying to have to click Mode and select Python every time I create a new file in a fast-paced class. Teacher uses VIM/Ubuntu and he doesn't need to do this, his new Vim files are automatically Python.
After you configure Kate as you wish, go to "Session" on the menu and "save as" [session name of your choice]. Then, on startup, Kate will ask you what session you want to start. You can have multiple session-types configured.
This is not a feature I use regularly; I stumbled over it a while ago and that's how I know it's there (I do use the "Session" feature in Konqueror). There are probably more elegant ways to do this, but at least this can be a start.
Distribution: Kubuntu 14.04 w/ XFCE, Win7, OS X 10.6 Snow Leopard
Posts: 11
Original Poster
Rep:
Have installed Sublime
The Python course instructors basically demanded I start using Sublime. Sublime has the terminal command "subl ." (note: that's a space before the period) which causes Sublime to open the current terminal folder, with the first document in the folder open in the Sublime window ready for editing, and a "tree view" in the left bar showing the folder and it's contents. I tried issuing the command "kate ." but Kate objected.
"kate *" opens the current directory with a tree view and the last document in the editing window on my system. It doesn't open sub-directories though.
I am answering this 7 years later in case anyone else has this question and ended up here via a search engine.
For the purposes of syntax highlighting, you can do this in Kate.
Settings -> Configure Kate... -> Open/Save -> Modes & Filetypes -> Filetype: Normal -> set "Variables:" to "kate: syntax Python;"
The filename will not automatically have the extension .py, but you can add that yourself when you're eventually saving the files.
In the meantime, any newly created text files will be highlighted with Python syntax highlighting.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.