vim file-explorer
Being forced to use MS windows at work, i hate to find my explorer going for a toss every now and then for reasons beyond my comprehension. So i tried out some replacements like servant salamander but ended up using by favourite text editor also as a file browser. VIM has a very useful *file-explorer* plugin which can be used for browsing or exploring directories or files. This file-explorer plugin comes in the default vim installation. This is lauched when you open a directory in vim or by pressing :E in vim. If you are using Gvim then you can even click on the names of the files to open them. There is a preview option in which it splits the window and displays the contents of the selected file in the newly created buffer. This is particularly useful when you are trying to look at the contents of a bunch of text files. To realise the utility of this embedded vim file-explorer think of a case when you have a directory containing 100s of text files and you have to search for certain file names and examine their contents. With vim you can do a simple regular expression search for the file name in that directory, preview its contents and then move on to next matching file name. Doing the same thing using the windows explorer and an external editor is quite a task.
Some basic vimrc options to customise the *file-explorer* behaviour:-
let g:explVertical=1 ” Split vertically let g:explSplitRight=1 ” Put new window to the right of the explorer
To get the complete list of options type :help file-explorer in vim. Similar documentation can also be found at http://www.vim.org/htmldoc/pi_expl.html
PS: I have avoided mentioning emacs - “the extensible, customizable, self-documenting real-time display editor”, because i found it too complex to handle.
February 11th, 2006 at 7:26 am
Basically my problem with vi is that I havent figured out an efficient way to cut/copy arbitrary blocks of text (the way you can do in GUI editors using shift key). I dont want too much customization because you dont have the settings you are used to on other’s computers or when you connect to remote computers.
February 11th, 2006 at 1:04 pm
In Gvim you can do that too..
You can use shift and arrow keys to select text, Ctl-c to copy, Ctl-v to paste, Ctl-x to cut etc…
February 11th, 2006 at 1:04 pm
venu,
You can try this,(in normal mode)
press v (enter visual mode) where u want to start copying
press movement keys until reach end of the region(h,j,k,l,$,arrowkeys)
then yank it (press y)
then paste it (press p or P)
And also, copying and pasting in vim is much much faster than any normal text editors
February 11th, 2006 at 3:03 pm
Chand,
You say that a big reason to learn vi properly is that its the only hope when you’re connected to remote machines etc, and I agree with you. I wont be having access to gvim in such cases. In fact, I dont have gvim in the Solaris machines I work on, although there is vim -g. Shift selection doesnt work in vim -g.
Praveena,
And Visual mode doesnt work in the primitive VI either. I guess you’ll just have to sacrifice somethings when you’re working on slow connections. We’ve had our discussions regarding vi, so lets not redo it here.
February 11th, 2006 at 5:45 pm
Somehow I don’t like using gvim. It becomes kinda unintuitive when you try to use a console utility in a window (at least for me). The file explorer plugin is good.
Vi is unbeatable. Simple & powerful. But when it comes to proper window based text editors, I prefer KWrite. Emacs is of course incomprehensible.
The worst editor out there is Notepad. It beats any other editor hollow. Next would be Wordpad.
February 11th, 2006 at 7:30 pm
well, notepad and wordpad arent meant for programming purposes. In terms of IDEs, I’ve heard people saying Visual Studio beats everything else hollow. MS basically put its money where it was worth it.
February 25th, 2006 at 4:19 pm
eclipse rules anyday
February 27th, 2006 at 6:57 am
Yes eclipse is great.
But it takes up lot of resources.
I am trying out netbeans — another free ide from sun. Looks good and importantly light. But still i am not been able to review all its features.
February 27th, 2006 at 12:49 pm
yeah, had to upgrade my RAM to 1GB for normal work in eclipse. Our offices can afford anyway