Page 1 of 1
to gedit or not to gedit?
Posted: Mon Jun 28, 2010 11:30 am
by Isaac
gEdit is my favorite text editor for one reason; it can write/save to a directory while you continue to edit. This is great because if I'm making a few changes to something that's saved on an ftp server the delay isn't noticeable. Instead you see a bar appear which shows that it's saving. However, while this is going on, you can continue to edit while this is happening. I normally save when I change something. After I change something I start looking for the next thing to change. In other editors I have to wait while the text editor writes to the file.
The big problem with gedit is that there's no code folding. There's also no feature that indicates which </div> belongs to which <div... So I have to scroll up and down the page figuring out what ending </div> is enclosing.
Is there a good text editor that can save and chew gum at the same time, but also has code folding?
Posted: Tue Jun 29, 2010 12:57 am
by Xamindar
SciTE has code folding. I use an older version of it on my Zaurus so not sure what the newest version supports. I do know it has code folding and highlighting and can have tabs for multiple open files. Not sure about the saving features.
There is always emacs, I hear it can even wash your clothes for you.
Posted: Tue Jun 29, 2010 3:53 am
by Jeff250
Does the server have an ssh server running, or can you install one? If so, then you can just ssh in and use vim/emacs/pico or whatever your preferred terminal text editor is (as long as it's vim
).
Re:
Posted: Tue Jun 29, 2010 6:24 am
by Isaac
Xamindar wrote:SciTE has code folding. I use an older version of it on my Zaurus so not sure what the newest version supports. I do know it has code folding and highlighting and can have tabs for multiple open files. Not sure about the saving features.
There is always emacs, I hear it can even wash your clothes for you.
Tested it already. It cant save while doing something else at the same time.
Jeff250 wrote:Does the server have an ssh server running, or can you install one? If so, then you can just ssh in and use vim/emacs/pico or whatever your preferred terminal text editor is (as long as it's vim
).
Yes! I use SSH for Nautilus to log-in to the FTP account. I do like vim. This might be the answer to my problem.
In the past, I have connected to the server via $ ftp mysite. That worked pretty well, but I assume there's a proper way to connect to my server using the terminal, that I haven't learned yet.
Posted: Tue Jun 29, 2010 8:43 am
by Jeff250
To ssh in from a terminal:
$ ssh
user@my.server.com
Then you'll get a remote shell. You'll be able to use whatever text editors are installed on the remote server to edit text. One potential impediment is if the server is too geographically distant from you, in which case you may notice some lag when typing, but if it's local, or even in a neighboring state, the lag is virtually nonexistent. The advantage here is that, since you'd now be running the text editor on the remote server itself, saving files is a quick, local (relative to the remote shell) write.
Re:
Posted: Tue Jun 29, 2010 12:35 pm
by Xamindar
Isaac wrote:
Yes! I use SSH for Nautilus to log-in to the FTP account.
Such a Windows kid.
You might not like vi. The commands to do anything in it are completely different than anything else you probably use. You are basically learning a new language to use a text editor. But once you get used to it you will not want to use anything else, at least it was that way for me. Vi has saved me many unintended mistakes.
Vim keeps the current file saved while you edit it so there is no need to constantly save. Also, try ":tabnew".
Re:
Posted: Tue Jun 29, 2010 12:51 pm
by Isaac
Jeff250 wrote:To ssh in from a terminal:
$ ssh
user@my.server.com
Then you'll get a remote shell. You'll be able to use whatever text editors are installed on the remote server to edit text. One potential impediment is if the server is too geographically distant from you, in which case you may notice some lag when typing, but if it's local, or even in a neighboring state, the lag is virtually nonexistent. The advantage here is that, since you'd now be running the text editor on the remote server itself, saving files is a quick, local (relative to the remote shell) write.
Excellent! Thanks. You mean $ ssh
user@ftp.asdf.com ? or just $ ssh
user@asdf.com? Nether seem to work, but I think I can figure this out. It looks like it wants to work, but something is stopping it. A cpanel setting is more than likely the problem; I'm very comfortable with breaking stuff there.
Xamindar wrote:Isaac wrote:
Yes! I use SSH for Nautilus to log-in to the FTP account.
Such a Windows kid.
You might not like vi. The commands to do anything in it are completely different than anything else you probably use. You are basically learning a new language to use a text editor. But once you get used to it you will not want to use anything else, at least it was that way for me. Vi has saved me many unintended mistakes.
Vim keeps the current file saved while you edit it so there is no need to constantly save. Also, try ":tabnew".
hahah! Yeah I still think in "windows".
I have VIM but haven't used it too much. I've used Nano many times, breaking X11 repeatedly. I'm sure exposure to the SSH terminal will give me some good VIM experience.
Posted: Tue Jun 29, 2010 11:40 pm
by Jeff250
If it's a shared hosting site, then they sometimes run ssh on some nonstandard port to evade common port scans. For instance, port 2222 is sometimes used as an alternate:
$ ssh -p2222
user@server.com
Although if you have ssh already working in nautilus, then it should just be the same server/port set up in nautilus (or so I would think). Also, sometimes shared hosting plans also require you to submit some sort of identification, like a driver's license, before they enable you to ssh in. I think that this is just so that they have some fallback if you try to do something criminal from their servers, although, if so, this policy doesn't make sense on a number of levels.
Posted: Wed Jun 30, 2010 7:29 am
by Isaac
Thanks!
I got the secure port working and I'm even being asked for a password. It doesn't want me to log in, but I'm sure I have to use my separate ssh/shell account with this, which is separate from my ftp accounts.
Posted: Wed Jun 30, 2010 9:59 am
by Thenior
A possible idea, which isn't quite exactly what you asked for, but anyway...
Use smart FTP and an editor like Notepad++. If you do an Open With in SmartFTP, everytime you make a change (you do have to save the file), it will upload the changes. It's fairly seamless.
Re:
Posted: Wed Jun 30, 2010 12:18 pm
by Isaac
Thenior wrote:A possible idea, which isn't quite exactly what you asked for, but anyway...
Use smart FTP and an editor like Notepad++. If you do an Open With in SmartFTP, everytime you make a change (you do have to save the file), it will upload the changes. It's fairly seamless.
yeah, I like that, because writing to the HD is really fast then the ftp client could take its time sending and receiving.
I kind of like that idea. But VIM via SSH is really cool, so I'm going to try to make that work for the moment.
Posted: Wed Jun 30, 2010 7:32 pm
by Sirius
Vim has a lot of hacker-fu quality going about it, yes. It's as arcane as you could like, and combined with SSH, well, yeah.
Posted: Wed Jun 30, 2010 9:36 pm
by Jeff250
On the topic of learning vim, I think the best advice I can think to give is to immediately disable the arrow keys in your .vimrc file:
no <up> <nop>
no <down> <nop>
no <left> <nop>
no <right> <nop>
ino <up> <nop>
ino <down> <nop>
ino <left> <nop>
ino <right> <nop>
Moving back and forth between regular keys and the arrow keys is clumsy and bad for your wrists, although not as much as the mouse. Plus, disabling the arrow keys prevents the other related vice of trying to perform movement in insert mode. Although aside from just h/j/k/l, you'll eventually learn other useful ways of moving around that are usually more efficient than moving 1 spot over in a cardinal direction.
Something I found useful to get used to h/j/k/l was to take my favorite game that I played with the arrow keys (I used Tyrian) and remapped the directions to h/j/k/l. I sucked at first, but in a couple of days, I had it down pat. I think I'm actually better now at the game too, since I don't have to share both up and down between one finger--I have one finger uniquely mapped to one direction.
Also, run vimtutor. And then run it again in a week or two. And so on, until you stop learning.
Posted: Thu Jul 01, 2010 1:42 pm
by Isaac
Thanks! I'm learning vim and I'm starting to like its exotic features.
Posted: Fri Jul 02, 2010 11:06 pm
by Isaac
I don't know how I lived with out
r !
Posted: Sun Jul 18, 2010 8:34 pm
by Freakster
hehheheh... To gedit or not to gedit... It's a joke! gedit?
I wouldn't personally know of a good program to do this myself, but a friend of mine said SciTE, what Xamindar suggested, is good. Though he's used it very lightly himself.
Posted: Mon Jul 19, 2010 12:27 am
by Skyalmian
Mousepad.
When I want something with color and higlights,
Notepad++ via WINE.
Re:
Posted: Mon Jul 19, 2010 6:28 am
by Isaac
Skyalmian wrote:Mousepad.
When I want something with color and higlights,
Notepad++ via WINE.
I haven't messed with npp, but, since the source code is available, I would assume that I can compile it to run in Linux. Because I have vim, I haven't spent any time with npp.
Mousepad looks like gedit, which is good. But I already have gedit.
Thanks for your help though!
Freakster wrote:SciTE
I tried it but I didn't like it for some reason. I already forgot why...
@Jeff250
Now when I'm using a word processor, like MS Word, or when I'm posting on the forums, I have to make a conscious effort not to use hjkl. Also, when I'm editing in a Word doc, I can feel part myself wanting to use vim commands. It didn't take much to get used to vim, but the more comfortable I get with it the more unnatural everything else feels. I'm sure my brain is connecting new synapses in different ways because of this.
Posted: Wed Jul 21, 2010 12:42 am
by Jeff250
I'm pretty sure that's normal, although if you're doing it in word processing software, then you might have an especially bad case.