首页 \ 问答 \ Geany4Windows文本编辑(Geany4Windows text editing)

Geany4Windows文本编辑(Geany4Windows text editing)

我已经使用了Geany4Windows很长一段时间但我仍然困惑它如何处理编辑文本文件,我现在决定寻求帮助!

如果我从菜单中打开一个新文件,我可以在其中键入纯文本,但是当我保存文件时,它没有提供.txt扩展名选项来保存为,而我可以将其添加到我给予的名称的末尾。文件并保存,它保存为.txt文件没有问题。 如果相反,我不这样做,并取消文件扩展名,然后保存,它保存为没有扩展名的文件!

有一个选项可以打开一个新的模板文件但在我的Geany4Windows中没有.txt模板。 我尝试使用{fileheader}创建一个文件并将其保存在C:\ Program Files(x86)\ Geany \ data \ templates \ files中作为file.txt。

这样就可以选择打开一个新的模板文本文件但是当我保存文本文件头时会生成这个:

 /*
 * mynewdefaulttexttemplateGeany.txt.txt
 * 
 * Copyright 2014 Richard <Richard@RPDHPI5PAVILION>
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 * MA 02110-1301, USA.
 * 
 * 
 */My first text file from new text template I just created in Geany.....

文件头显示为>> mynewdefaulttexttemplateGeany.txt.txt <<,扩展名为.txt。

如果我可以为我的默认模板file.txt文件修复此文件头(因此它不会随着扩展名添加两次而保存),我会更乐意使用Geany4Windows中的纯文本文件! 有谁知道我可以解决这个问题吗? 谢谢。

我的编辑我现在已经解决了这个问题,下面马修斯的帖子对此有所帮助(见我的评论)。 回顾一下解决方案:我使用{fileheader}创建了一个新的自定义文件类型file.txt为了完成这项工作,我将行txt = * .txt添加到filetype_extensions.conf中我还创建了filetypes.txt.conf并添加了..

[settings] extension = txt lexer_filetype = C [styling = C] #dultiline comments comment_open = / * comment_close = * /

这个现在有效! 查看之前和之后的屏幕截图: 具有自定义.txt文件和文件头扩展名问题的Geany编辑器,默认情况下不是红色文本

后: 具有自定义.txt文件和文件头的Geany编辑器现在默认正常工作

我喜欢Geany4Windows,但尝试自定义它以使用新的文件类型等会很有趣。在Windows和Linux上使用Geany进行快乐编码和编辑(它是否在Mac上运行?!)。 我很高兴现在已经修好了。 :-)


I have used Geany4Windows for a long while but am still confused how it handles editing text files and I decided to ask for help now!

If I open a new file from menu I can type plain text in it and yet when I save the file it does not give a .txt extension option to save as and while I can add this to the end of the name I give to the file and save it and it saves as a .txt file with no problem. If instead, I do not do this and leave off the file extension, and then save it, it saves as a file with no extension!

There is an option to open a new template file but in my Geany4Windows there is no .txt template. I tried making my own by making a file with a {fileheader} and saving it in C:\Program Files (x86)\Geany\data\templates\files as file.txt.

This does then give me the option to open a new template text file but when I save that the text fileheader produces this:

 /*
 * mynewdefaulttexttemplateGeany.txt.txt
 * 
 * Copyright 2014 Richard <Richard@RPDHPI5PAVILION>
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 * MA 02110-1301, USA.
 * 
 * 
 */My first text file from new text template I just created in Geany.....

The file header shows as >> mynewdefaulttexttemplateGeany.txt.txt << with a double .txt extension.

If I could fix this file header for my default template file.txt file (so it doesn't save with the extension added twice), I would be happier working with plain text files in Geany4Windows! Anyone know how I can fix this please? Thanks.

MY EDIT I have fixed this now and it was helped by Matthews post below (& see my comment on that). To recap the solution: I made a new custom file type file.txt with {fileheader} To make this work I added the line txt=*.txt to filetype_extensions.conf Also I created filetypes.txt.conf and added..

[settings] extension=txt lexer_filetype=C [styling=C] # multiline comments comment_open=/* comment_close=*/

This works now! See screenshots before & after: Geany editor with custom .txt file and fileheader extension issue & not in red text as default

after: Geany editor with custom .txt file and fileheader now working correctly as default

I do like Geany4Windows but it can be interesting trying to customise it to use new filetypes etc etc. Happy coding & editing with Geany on Windows & Linux (does it run on Mac?!). I'm pleased this is fixed now. :-)


原文:https://stackoverflow.com/questions/21380063
更新时间:2023-05-31 22:05

相关问答

更多

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)