LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-29-2015, 04:58 PM   #1
coder25
LQ Newbie
 
Registered: Apr 2013
Location: Calif.
Distribution: Kubuntu 14.04 w/ XFCE, Win7, OS X 10.6 Snow Leopard
Posts: 11

Rep: Reputation: Disabled
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.
 
Old 01-29-2015, 08:14 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,379
Blog Entries: 28

Rep: Reputation: 6163Reputation: 6163Reputation: 6163Reputation: 6163Reputation: 6163Reputation: 6163Reputation: 6163Reputation: 6163Reputation: 6163Reputation: 6163Reputation: 6163
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.

Last edited by frankbell; 01-29-2015 at 08:16 PM.
 
1 members found this post helpful.
Old 01-30-2015, 12:24 AM   #3
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,880
Blog Entries: 1

Rep: Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871
(Untested)
Press Ctrl+S and in the Save-dialog enter a filename ending in .py
 
Old 03-23-2015, 05:13 PM   #4
coder25
LQ Newbie
 
Registered: Apr 2013
Location: Calif.
Distribution: Kubuntu 14.04 w/ XFCE, Win7, OS X 10.6 Snow Leopard
Posts: 11

Original Poster
Rep: Reputation: Disabled
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.
 
Old 03-23-2015, 06:05 PM   #5
norobro
Member
 
Registered: Feb 2006
Distribution: Debian Sid
Posts: 792

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
"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.
 
Old 03-24-2015, 01:39 AM   #6
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,627

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
https://www.sublimetext.com/buy
well is costs $70 bucks

the BEST editor is well a toss up
Emacs -- GUI
VI/Vim -- terminal

but kate and gedit are also GREAT
 
Old 05-25-2022, 06:41 AM   #7
OLed
LQ Newbie
 
Registered: May 2022
Posts: 1

Rep: Reputation: 0
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.
 
Old 05-25-2022, 09:43 PM   #8
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,249

Rep: Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323
I would have suggested creating the files with "touch" (as in "touch newfile.py") before opening the directory.
 
1 members found this post helpful.
  


Reply

Tags
default, kate, mode, python



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Getting Started With the Kate Text Editor: Kate For Coders LXer Syndicated Linux News 0 04-01-2009 11:40 PM
Question about Kate or another Editor FredJones Linux - Newbie 2 05-19-2008 01:45 PM
change Kate from default 'file' opener drmjh Linux - Desktop 9 08-21-2007 11:53 AM
Kate Is Not Working, Kate editor is not starting in Redhat 9 apur Linux - General 4 05-11-2004 09:52 AM
Kate (editor) is touching me up alex.e.c Linux - Software 0 09-05-2003 09:52 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration