why gedit text editor doesn't work?
Hi..
Thanks in advance for reading my topic.Sorry for asking help again. i'm having problem with gedit editor.The problem which i face is that when i type something inside the gedit editor by using command such as opening a existing file: Code:
$ vi linux This is my project question: 1. Open the file named “linux” in the vi editor 2. Append the following text at the new line: Hello World! Hello Good Morning Hello Good Afternoon Hello Good Evening Hello Good Night 3.Delete 2 lines starting from the statement “Hello Good Morning” 4.Search for the entire file for the string named “Hello” and replace each occurrence with the string, namely “Hi” 5.Save and quit the vi editor |
It isn't really clear to me what exactly you're doing. Are you trying to type commands into gedit? If so, that's wrong. All you're doing by typing stuff in gedit is, well, typing stuff. If you want to run vi, then you open a terminal window and run "vi file", where file is the name of the file you want to create.
|
Quote:
As fm_hyudin says, gedit is a text editor, in the same way that vi or emacs is. It sounds like you want to use vi, so you want to start with a terminal program, like gnome-terminal (usually under "Terminal" in the accessories menu). It is also just possible that, when you start vi, you get a window opening labelled "gedit"? If so, then you have an alias set to run gedit instead of vi. You can run Code:
alias Code:
unalias vi |
And, as it happens, on Linux vi is usually symlinked to vim (vi improved) ... just fyi.
In vi/vim, its vi filename - to edit a file, inc create a new one press the 'i' key to go into edit/insert mode type in your lines as described Press 'Esc' button to get out of insert mode, into cmd mode type the following to go to desired line :2 then this to delete 2 lines 2dd global search and replace :%s/Hello/Hi/ exit & save :x easy :) |
@ Nylex
Thanks alot mate for clearing my doubt.No wonder i don't get any reply or error when typing those commands.I really understand now that i did a big and careless mistake.I'm really new to this text editors.So i thought gedit can be used.Sorry for giving problem. @ rjlee Yeap.I'm agree with u mate.If i didn't ask this question now, i will be fool for the rest of my life because this thing was confusing and just like u said. Gedit also is a text editor like emacs and vi.So i thought gedit can be used,Thanks alot mate for clearing my doubt and helping me.I really understand now and i really appreciate your help. @ chrism01 Wow.Thanks alot mate.You really made my day.Thanks alot again.I really appreciate your help.I will be using your answer as my guide mate.By referring to this, it shall help me to make me learn from mistakes and my foundation stronger.Thanks alot again and i really appreciate your help. @ Nylex & rjlee & chrism01 Thanks alot everyone for your kindful help.I really appreciate it.Thanks alot again.Its really glad to see all of you helping me.Sorry for giving problems and for any inconvenience.I learnt alot from this forum due to my mistakes and it had made my foundation in linux become stronger a bit now.God bless you all. |
"Alot" is really two words (see link in my signature).
|
Hi..
I tried typing like these to open my file using vi editor: Code:
vi linux http://www.jettmedia.com/files/4azhn00ukzd19pkpb7de.png so i just ignored the error because i don't understand what it is exactly and start pressing enter button.after that, my file opened itself.so then i got stucked again. my question: Append the following text at the new line: Hello World! Hello Good Morning Hello Good Afternoon Hello Good Evening Hello Good Night the file linux look alike: http://www.jettmedia.com/files/dy2146va7fslejd2y6j1.png where should i start typing those text plz. chrism01 said: press the 'i' key to go into edit/insert mode type in your lines as described Press 'Esc' button to get out of insert mode, into cmd mode type the following to go to desired line. plz guide me.thanks a lot for all your help.god bless. |
plz help......
|
Nobody can help a person who doesn't read.
Inside vi Your press "i" to insert any text Your press "esc" key to finish the insertion Your press :w to write the file thereby saving it Your press :q to quit Also you seem to edit a swap file as warned by the kernel. What you should have done is to create a text file first, like "vi anyfile", opted to save it, quited and then do the project work. A swap file or a binary file is in machine code and has unprintable characters. They should never be edited. |
swp are temporary files created by vim just like ~files in other applications. Most likely vim was exited abruptly and changes were not saved. Close vim and delete the file using the rm command.
You can search the web for vim tutorials, documentation and command cheat sheets which will answer your questions and provide additional help to what has already been provided. http://www.tuxfiles.org/linuxhelp/vimcheat.html |
All times are GMT -5. The time now is 03:44 PM. |