Trying to code a basic text editor to play around with Java's file objects and classes.
What I cannot seem to figure out is how to go about developing something like the 'nano' interface. Or 'vim' interface, for that matter.
File creation is not a problem, its editing on the fly, and post-creation editing, that has just got me.
Any ideas?
Edits: Similar questions on Stackoverflow that I found interesting:
1 Text editor theory
User CHARVA
You can get the output like below.
Check out this link http://www.pitman.co.za/projects/charva/index.html
Related
There are some files like GEDCOM and ADIF that are plain text files, but many people tend to work with them through GUIs. Say I wanted to do data entry on these files directly without any GUI.There are a number of things that make this a little dangerous. Things like misspellings of necessary file-grammar, missing a necessary key, incorrect types for values, etc. There is also something to be said for the additional difficulty of having to type additional characters relative to a GUI.
From what I can tell by thinking about this for 15mins ;) is that having the following would make the job of plain text entry much easier.
A formatter. I think of something like Python's Black which is a CLI that can be run on a file. It can let users know of bad formatting and can provide fixes.
A linter. I think of flake8 to ensure the styling matches the standard.
Autocomplete. The file type examples I showed above have a dictionary of key words. To save on typing it would be nice to have autocomplete.
Syntax Highlighting. Having a way to know if my data entry is good or bad in real-time would be helpful.
It seems like requirements 1-2 could be solved by making a file specific CLIs that combs through plain text files.
Requirement 4 seems IDE specific. vim and vscode allow users to make syntax highlighting plugins. The problem is that this is normally solved by connecting to a language server. When you are not looking for a language server, but for key words and proper values in a plain text file how does let their IDE know that to look for? Is this just a regex soup solution or is there a better way?
Requirement 3 may also be IDE specific, but the same question applies as for requirement 4. When there is not a language server how can I let an IDE know what/how to autocomplete?
Any examples of plain text data entry made easier would be appreciated.
Thanks!
Premise: I coded a Tkinter GUI for a python script. It works. I can launch it from terminal. I created an icon and the icon will show up in my GUI just fine. I've been looking for tutorial on .desktop launchers and none of the examples I've found work. After a few hours of wading through SEO spam in SERPs trying to find a tutorial on the subject or a forum question that has been correctly answered. Finally I decided to join a forum ask a question. I've found a lot of code snippets on this site in the past. Figured I would try here.
I've tried about 20 different examples none of which have worked but I think I at least know the questions to ask. Here's an example of a .desktop file: It's not an example that works but it's one on found on this site so I figure I will start there.
[Desktop Entry]
Type=Application
Terminal=false
Icon=/path/to/icon/icon.ico
Name=ApplicationName
Exec=python3 /path/to/application.py
Categories=Application;
Note the example in the other post shows a red highlight over Categories=Utility; and when I try to change it in /usr/share/applications/ it makes gnome-terminal insert an A when hit the up key to get my last BASH entry and change a bunch of keys on my keyboard into hotkeys rather than being able to type it pops open print dialogs and things like that that which is wicked annoying.
Does anyone want to discuss what each entry line in a .desktop file is supposed to look like. Also does the application, icon, and everything have to be in /usr/share/applications? What file locations are ok to use in this type of file?
Something else I thought of; is it possible that my Exec line is not correct. Does exec have to be a single argument? Do I need to create a bash script that can be called by Exec that is just something like ./script.sh or should I create a command alias that is a single argument? Or does it actually matter?
I also have a Linux question: What package handles .desktop icons? Who maintains said package? And where can I find actual documentation on the subject?
I'm using Arabic language while designing my website and I want to wrap lines like it displays in Microsoft word (in that there is no line wider/smaller than another)
http://c.top4top.net/p_432s7e8u0.png
Without any example of your code, it's hard to say based on your personal situation but you may be looking for the following CSS property:
word-wrap: break-word
This should wrap your text in an element where this property is applied.
See the following link from W3Schools.
https://www.w3schools.com/cssref/css3_pr_word-wrap.asp
If this isn't what you're looking for, post an example of your code and we can try again!! :)
I'm not too sure whether you're talking about your actual website content or your IDE / Developer Tool. I'd assume the latter as you're talking about javascript and css (which the user wouldn't see on the page) but hey, here's a reference to how to show users it like that (on a website) anyway
"how do you change spacing of words to fit the whole line?"
https://www.cnet.com/forums/discussions/how-do-you-change-spacing-of-words-to-fit-the-whole-line-248002/
For line wrap, I suggest Googling "line wrap " + the tool you're using
For justify, it's likely not supported in the tool you're using, but you can still throw an attempt at Googling "justify text in " + the tool you're using
Note: I'd give more information, but your question lacks detail
I apologize if this this is an extremely amateur question. But before yesterday I had never even heard to tex, latex, mactex, all this stuff.
Basically I have cloned a git repo in which the UML documents appear to be in a .tex file. Following google, this has led me to install MacTex, try to open these files. Click 'typeset' which I presume is how it produces the document, but it gives an error about 'uml2' being invalid syntax.
What program, or what anything, am I supposed to use to open a .tex file which has stuff like this in it:
\tikzstyle{uml2} = [
fill=rupBody,
draw=rupBorder,
font={\ttfamily},
]
Is this even something your supposed to open in a program and view visually? I suppose this file named uml.tex will show a UML diagram once opened. Or do I have completely the wrong idea? Sorry if this is extremely amateur, like I said I've never heard of this since before yesterday, and google isn't turning up lots of information on this. Any direction would be much appreciated.
You need to install pgf from http://ctan.org/pkg/pgf The easiest is to use TexLive. Once you got all packages installed you can typeset the TeX file. I'm using TexShop which is a nice app for the Mac.
Since you indicate you never heard of TeX before: TeX is a program written by Donald Knuth many, many years ago when computers were engined with steam. But it's the best you can find for typesetting. It's mature, crude and more than 99,99% error free. Donald Knuth has a bounty for each error you find in the code and he did not have to pay since many years. What you do is to create those TeX files (there are different macro packages were LaTeX is the most famous) and send them to the TeX processor. That will create the output (now its PDF and formerly it was some DIV (device independent viewer IIRC)).
Edit I downloaded tikz-uml from here: http://perso.ensta-paristech.fr/~kielbasi/tikzuml/index.php and moved the tikz-uml.sty to folder where the main .tex source is placed. After including
\usepackage{tikz-uml}
in the header I was able to compile the source.
Note: there is a global location for .sty files but that depends in the app you use. Use Google to find this place. But putting .sty near your .tex is fine anyway. A \usepackage directive first looks in the source folder before looking into the global ones.
I was using notepad++ to create a report and its taking a quite a while for me to type and do so.
Well i had tried a software called typing assistant it was really good(except for the money part :D).
TO the Point :
is there any way tat i can link a dict(text file of words) and use notepad ++ as typing assistant please tell me if so i
can speed my report.
Cause i am a programmer too so i really like the keyword completion and stuff .But is there a way to use it for text ?
already tried Phrase Express -.-:
Takes long and its kinda for macro text and text completion don't work tat fast for me to tab and complete
if there's a question in the form like mine link me to tat :
i searched it and i didn't get it
Yes, you can set up your own custom auto-complete dictionaries in notepad++. You need to create an xml file with your language name and put it under the plugins/APIs directory in notepad++. Of course this assumes you know how to write xml. There's a formal description of how to implement this here.
I've never tried to create an auto-complete dictionary for plain text files, so I'm not sure if it's possible, but I have successfully created them for user-defined languages, which you could also do if you can't get it to work with text files.
I'm not sure if this question is really a duplicate, but here is a very similar one, which may help you in your research.