Keith Devens .com |
Thursday, May 17, 2012 | ![]() |
| Battle not with monsters lest ye become a monster and if you gaze into the abyss the abyss gazes into... – Friedrich Nietzsche | ||
|
| ← Enums in PHP | DOOM III → |

Thierry Lalinne (http://radio.weblogs.com/0105685/) wrote:
Keith (http://www.keithdevens.com/) wrote:
I don't use metapad as my primary editor - just as a notepad replacement (where it hooks into IE's view source, etc.).
It's a great quick text viewer, it opens fast, you hit escape and it exits, etc.
I use EditPlus as my primary editor. I've tried VIM and don't use it for two or three main reasons.
And you really do get some benefit from using an actual Windows app under Windows.
Help me get past these objections and I'd be happy to use VIM.
Thierry Lalinne (http://radio.weblogs.com/0105685/) wrote:
I just thought that you were using Metapad as your primary programming editor. Last month, in one of your posting, you were trying an editor and complaining (rightly) that you had to register to get a simple demo stuff. I concluded that you were searching (like many developers) for the perfect editor.
I also use a small editor (NoteTab Pro) as a Notepad replacement for quick and dirty editing and viewing, it works like a charm. Sometimes, I use TextPad which is a nice little editor but, as you pointed out, its syntax-highlighting sucks especially for Python (triple-quoted strings especially) which I use a lot.
I tried a bunch of editors in the past and couldn't settle on one particularly for my editing chores. One day, I decided to stick with Vim because it has many advantages: cross-platform, robust, customizable syntax-highlighting, extensible, regular expressions, folding, scriptable, keyboard friendly, Unicode, GUI/console mode, windows splitting (horz and vert) etc... Also it's small by today standards unlike Emacs. It's reassuring to work with an open-source editor that works the same on Windows, Linux and MacOS.
For FTP, it works quite well. Just type ':e ftp://machine/path' and it'll ask you about your login and password then will download the file. After you are finished with the file just type ':w' and it will upload the file back. Easy!
Navigation in Vim is really easy once you get used to the many keys devoted to it. Try these commands:
w/W: one word forward
b/B: one word backward
e/E: end of the word
)/(: beginning of next/previous sentence
}/{: beginning of next/previous paragraph
]]/[[: beginning of next/previous section
0/$: beginning/end of a line
f/F + <char>: next/previous <char> on the line
%: match a paren
<line number>G: Goto line xxx
H: Top of page
M: Middle of page
L: Bottom of page
gg: top of file
G: end of the file
<number>%: Go to xx% of the file.
/regexp: search forward next match of regexp (it works continuously as you type just like in a combo box and it highlight the search argument in the text)
...
They are really too numerous to list them all.
Remark: All command may be prefixed with a count. You can also put bookmarks in your text to quickly return to a specific region of your code.
And for navigating between file there are some plugins like buffexplorer that lets you do just that easily.
Honestly, I can't find of a feature that Vim don't have either in standard or implemented as a plugin.
Download the latest version (6.1) and give it a try you won't regret it.
There is also an O'Reilly book that includes a chapter on Vim:
"Learning the Vi editor (6th edition)".
Keith (http://www.keithdevens.com/) wrote:
Never knew about buffexplorer before. Thanks for all the VIM tips!
To give an example of what I'm talking about, check out, oh crap, did I disable images in my comments?? I think I did 

Hey, look at that, I didn't 

Those are examples of some of the errors I get when trying to use its ftp functions. However, it does seem to open the file correctly. I didn't try saving. Previously, it wasn't working for me at all - I was trying to use the Nread functions directly (you can't find any documentation on this stuff!).
And you're right - like many developers, I am looking for The Perfect Editor. While I like EditPlus, I'm not totally pleased with it. I've been asking the author for a vertical open file listing forever, right now there are only tabs, which aren't good if you have 30 files open 
Only a programmer can understand how important our editors are to us 
Thierry Lalinne (http://radio.weblogs.com/0105685/) wrote:
I get the same kind of errors as you! It does work nonetheless. The code for this stuff is in the plugin subdirectory of Vim and the filename is netrw.vim.
Quite cryptic!
You can find the bufexplorer plugin here http://lanzarotta.tripod.com/vim.html
As for tabs, yes they are nice if you have a couple of files opened but when you have 30 files openend it becomes a nightmare. TextPad has a nice open file list pane, though.
So the quest continue ;-)
Feel free to post a comment below. Please see my comment policy.
Formatting Rules (No HTML):
Generated in about 0.237s.
(Used 8 db queries)
Why don't you use a real editor like Vim. It's rock solid, has been around for ages and free.