Hello! I'm new to this software. The code tree function is very convient.
However,is it possible to define my own code tree?Like .rst file,there are levels in the code tree. I want to define my own level mark in .txt file. Such as *is level 1,** is level 2? (Not for .md file,mainly used for .py or .js or .txt file)
In spyder,there is a concept of cell,is it possible to define cell in CudaText with active cell filled with different background color?
Is it possible to assign Chinse charecter with different font,while English letters with another?
Thanks a lot!
about user defined CodeTree
-
- Posts: 2245
- Joined: 25.08.2021 18:15
we can adjust code-tree using one of ways:
a. correct pascal code which is "reST code-tree helper", in source, in file cudatext/app/treehelper_rest.pas.
it has these characters for levels:
b. you can write new 'reST tree helper" in python and put it into 'py' folder. (docs about tree-helpers are in the wiki https://wiki.freepascal.org/CudaText_API .) this is slow way. pascal tree helper is much faster.
pls, more details.
a. correct pascal code which is "reST code-tree helper", in source, in file cudatext/app/treehelper_rest.pas.
it has these characters for levels:
Code: Select all
const
cHeaderChars = '-=\''"`:^~_*+#<>';
i did not understand this question.In spyder,there is a concept of cell,is it possible to define cell in CudaText with active cell filled
pls, more details.
sorry, no such a feature.>>Is it possible to assign Chinse charecter with different font
Thanks!Furthermore,
1."reST code-tree helper" is a plugin? I didn't find this,and "cudatext/app/treehelper_rest.pas." didn't exist. No sub folder named /app. (cudatext-windows-amd64-1.196.0.0 is used)
2.For file type like .py, is it possible to add levels?
3.about the cell and question 1 and 2,pls also see the attachment. I want to know if cudatext can split cells by outline and by different colors for .py file.
1."reST code-tree helper" is a plugin? I didn't find this,and "cudatext/app/treehelper_rest.pas." didn't exist. No sub folder named /app. (cudatext-windows-amd64-1.196.0.0 is used)
2.For file type like .py, is it possible to add levels?
3.about the cell and question 1 and 2,pls also see the attachment. I want to know if cudatext can split cells by outline and by different colors for .py file.
-
- Posts: 2245
- Joined: 25.08.2021 18:15
1. 'reST code-tree helper' is part of Pascal sources.
2. yes, it's possible if you make the custom code-tree helper written in Python. https://wiki.freepascal.org/CudaText_API#TreeHelpers
3. OK, 'cells' is a custom feature. if you write the custom tree helper for Python lexer (written in Python), you can consider 'cells' there. the different way is to change the Python lexer file data/lexlib/Python.lcf. CudaText gives tutorials in the 'readme' folder - how to write lexers.
2. yes, it's possible if you make the custom code-tree helper written in Python. https://wiki.freepascal.org/CudaText_API#TreeHelpers
3. OK, 'cells' is a custom feature. if you write the custom tree helper for Python lexer (written in Python), you can consider 'cells' there. the different way is to change the Python lexer file data/lexlib/Python.lcf. CudaText gives tutorials in the 'readme' folder - how to write lexers.
Thanks!
1. I've check the online wiki page, and for the following sentence.
"CudaText contains built-in support for TreeHelpers. They build code-tree for additional lexers. TreeHelpers must be plugins, which have special install.inf file (Ini format)"
Does that mean if I want to add additional lexers(not in Pascal sources),I need to create a new plugin following the requirement on the wiki page?
2.And if I want to change the Pascal sources,I need to compile the code on GitHub rather than install the windows package on sourceforge?
3.By the way, It seems the console on CudaText can be used as python IDE, does it with the function of "run selection from editor'' like the ExTerminal plugin? I didn't find where to assign the hot key for it.
1. I've check the online wiki page, and for the following sentence.
"CudaText contains built-in support for TreeHelpers. They build code-tree for additional lexers. TreeHelpers must be plugins, which have special install.inf file (Ini format)"
Does that mean if I want to add additional lexers(not in Pascal sources),I need to create a new plugin following the requirement on the wiki page?
2.And if I want to change the Pascal sources,I need to compile the code on GitHub rather than install the windows package on sourceforge?
3.By the way, It seems the console on CudaText can be used as python IDE, does it with the function of "run selection from editor'' like the ExTerminal plugin? I didn't find where to assign the hot key for it.
-
- Posts: 2245
- Joined: 25.08.2021 18:15
yes, correct.>Does that mean if I want to add additional lexers(not in Pascal sources),I need to create a new plugin following the requirement on the wiki page?
yes, correct.>And if I want to change the Pascal sources,I need to compile the code on GitHub
you need the CudaExt plugin (lot of commands in it), it gives Command Palette item:>console on CudaText can be used as python IDE, does it with the function of "run selection from editor'' like the ExTerminal plugin?
"misc: execute selected text in console".
you can assign any hotkey to any Command Palette item - F9 key.
-
- Posts: 2245
- Joined: 25.08.2021 18:15
on Windows, CudaText uses Python from its folder.The python version in console seems to be locked on the cuda folder.
but not on Unixes. it uses current OS's python there.
you can copy any folder to [cudatext]/py subdir, and it will be available for "import" python operator, in Console and plugins. because "py" dir is added to "sys.path".Is it possible to use my own python path or install new packages for console?
Thanks to your help,I'm trying on this,and further questions:
1.If I chang the contents in /cudatext/data/lexlib/Python.lcf&Python.cuda-lexmap, will it affect the code tree,or it just affect the highlighting on contents window?
2.I see some zip files in \CudaText_addons\treehelper,is it can be token as the example of the method "b. you can write new 'reST tree helper" in python and put it into 'py' folder. (docs about tree-helpers are in the wiki https://wiki.freepascal.org/CudaText_API .) this is slow way. pascal tree helper is much faster."
1.If I chang the contents in /cudatext/data/lexlib/Python.lcf&Python.cuda-lexmap, will it affect the code tree,or it just affect the highlighting on contents window?
2.I see some zip files in \CudaText_addons\treehelper,is it can be token as the example of the method "b. you can write new 'reST tree helper" in python and put it into 'py' folder. (docs about tree-helpers are in the wiki https://wiki.freepascal.org/CudaText_API .) this is slow way. pascal tree helper is much faster."
-
- Posts: 2245
- Joined: 25.08.2021 18:15