Some things have changed in a few short weeks. I have to give kudos to vim/Gvim and the vim plugin, HTML.vim. I also want to thank everyone who responded to the original post with vim suggestions and their favorite editor.
But this post is mostly to share my text editor joy; using Gvim to edit HTML files. (Note, I refer here to only Gvim, not vim in a terminal.)
One problem I had was that the current Linux implementation of Gvim is "broken" in that the File Open/Close dialog boxes do not use the API's of the OS as they do in Windows. (I regard this as neither good nor bad; I was told of Gvim for Windows only a year ago and only used it in that environment till the past August when I installed Mint.) Of course, my intent was to open the dialog, navigate once to a folder, then reverse time order the listing to get the most recent file.
Only after searching many days did I stumble upon a simple solution. As vim natively can use the standard "netrw" plugin to "edit" a directory, and within the netrw framework change both the attribute and order on which to sort, I write a simple mapping into ~/.vimrc. By experimenting, I find that the order is "sticky"; once sorted by reverse timestamp, the directory listing stays sorted in that order so my new docs get added to the top of the listing. The mapping code (below) show I mapped "lh#" to key strokes to change directory to a folder I have in a Windows partition via symbolic link (winDocs), then "edit" the current directory (":e ."), and finally use netrw commands to change attribute sorted to Time then reverse the sort order.
- Code: Select all
:map lh# :cd /home/aehjr1/winDocs/HTMLs<CR>:e .<CR>s r
One problem solved for good, especially as I can save a new article from Firefox into the folder, switch to Gvim and ":e ." to find the newly saved file on the top of the directory listing, cursor down and Enter to edit the file.
The next problem was that when "correcting" curly single- and double- quotes to HTML codes so they display correctly across a range of browsers (an issue with documents saved in charset Windows-1252). I could high-light a quote, bring up the Find & Replace dialog, but the Replace All function botched replace; ironically the Replace function worked correctly, so I would click Replace till the cows came home. I think the reason is the replacement characters--HTML characters--all begin with "&" (ampersand) which mucks up the internal replacement substitution. I can still do all on the command line instead of using a dialog, however, some characters have no mnemonics but use numbers instead. This is more difficult.
A plugin comes to the rescue. After installing the HTML.vim plugin, I have an extra menu item when editing an HTML file (Gvim only, not terminal vim) which gives me literally dozens of new abbreviations, almost impossible to stumble across. One of these in particular is handy, as it--in visual mode only--reviews the character high-lighted and converts it to the approved HTML code (most of which are numerics). Unfortunately, I still can't do global replaces on most of these as I can't type the "correct" (actually incorrect) character into the substitution command, and although going visual then using the dialog box captures the bad character, the Replace All still doesn't work. But, I can relatively easily spot the problems, go visual then two keypresses and the character changed.
To add to the mix, the HTML plugin comes with a modifiable template to start editing from scratch, the ability to high-light text then enclose the text in whatever HTML tags are desired and some other goodies. For me, things can only get better and faster.
To cap it all off, I finally learned how to use the visual mode, and use it pretty efficiently. I finish with one story.
Over a decade ago when I started switching from mainframe development & analysis to UNIX/Oracle, one contractor (trying to teach me a few arcane vi commands) told me that he had worked at dozens of installations. Some had EMACS, others had different editors, BUT, no matter where he went, he could always depend the server, whether HP, IBM, Sun, IRIX or other, would always have vi. Knowing the 10-15 most common commands will get 90% of the work done, maybe not most efficiently, but at least done. I learned his lesson well.
The more I learn vi/vim, the better I like it. I wouldn't want to write my resume with it, but I'd rather use vi/vim than any other editor when it comes to code.
I hope this helps someone else. I tried to describe my problems well so keyword searches can find them, and also included links when applicable. Thank you again to all who responded before.