Fedora Engineering Steering Committee has recently had a meeting where the upcoming Fedora 18 features were decided. Out of the whole list, I am actually really looking forward to just one – 256 color terminals:
Many terminal programs (like vim and ls for example) can take advantage of 256 color terminals, and all xterms I know of support at least 256 colors and sometimes more.
So let’s break through the artificial 8 color limit!
Also when preparing this page, while searching the net I noticed that Mac OS X Terminal’s default $TERM value is xterm-256color since Lion 10.7 That will ease some of the compatibility issues noted below.
You can see vim’s default appearance using the above expanded palette at:
Sure, the upgraded Perl and Python, Samba4 and Active Directory integration, FedFs and even the MATE Desktop (based on Gnome 2.x) are all cool. But I don’t use any of them on a daily basis anymore. Most of my needs have moved beyond desktop and straight into the browser. But the colorful terminal still plays a major role in my daily routine, so I’m glad to see there will be an enhancement.
What’s your most expected feature?
Vim is quite famous for being the best text editor in the world. However it has quite a learning curve, especially for people who don’t touch type and who aren’t much interested in their own productivity. Over the years, there were a few efforts to help the newcomers learn the basics. But, I think, nothing came close to the amazing game Vim adventures – a maze navigation game, that uses Vim controls.
I’m using Vim text editor for more than decade now. And I still can’t say I really know Vim. I’m used to it and my fingers remember the commands. And for those commands that I don’t remember, I’ve found some way of working around and got used to it too. Today I came across not one, but two tips that I’m adding to my arsenal of Vim tricks.
Re-selecting visual block
Usually I only need to select the block once. I then process it and never get back to it. But sometimes, I need to select the same section of the text a few moments later. Until today I was simply switching to visual selection and marking the block again. Not too much of a problem, but it would be nice to have a shortcut for re-selecting the previous selection. Of course, there is such a shortcut in Vim. I just didn’t know it. Simply type ‘gv‘ (without quotes) while in normal mode and your last visual selection will be selected again.
Increasing line limit on cross-file copying
There is no limit to number of lines copied between files, if all files are being edited in the same instance of Vim. However if you copy a large selection from one file, then quit Vim, then open another file, and paste, you’ll probably see that only the first 50 lines or so were copied and the rest was lost. Again this is not such a frequent scenario for me, and when it was happening I was simply opening both files in the same instance of Vim and copy all that I needed. It turns out, I don’t really have to do that.
Vim uses ~/.viminfo file (default location) to remember things like command history, file marks, and registers between Vim instances. There is a way to configure what and how much of what is going into this file. If you are annoyed by any limits, you can easily raise them or totally remove them. Have a look at “:help ‘viminfo’” manual page to see what is possible. Adding “set viminfo=’100,<1000,s100” to ~/.vimrc file solved my problem.
P.S.: my messy Vim configuration files are available from GitHub, in case you wanted to take a pick at what else I have there.
After years of using Vim, I recently moved to its graphical version – gvim. It turned out that things that I didn’t like about gvim are trivial to fix.
set guioptions-=m " No menu
set guioptions-=T " No toolbar
set guioptions+=c " Use console dialogs where possible
You’d probably want to read “:help guioptions” for more.
Now there is a greater variety of colorschemes to choose from, and, finally, I can have italic font for comments in the code – nothing beats that!
I don’t need this functionality very often, but when I do, it’s nice to have a quick and easy way to do it. In order to insert the current filename, while in insert mode press
Via vim users mailing list.
Here are a bunch of bookmarks about Vim text editor.
Continue reading “Daily del.icio.us bookmarks”
I’ve been using dante color scheme for Vim for as long as I can remember. It’s a nice one and suits me perfectly. Sometime though I feel that need for a change and than I have to go through a rather painful process of getting something new. This time I decided to change my Vim color scheme. This process is particularly painful because:
- there are a lot of color schemes available for Vim
- screenshots are rarely available
- most color schemes are designed for graphical mode (gvim), while I use console only
Anyway, I went through a number of color schemes today and decided that I like Impact. Not only it is designed for console, but it also defaults for black background, which is exactly what I use.
I tried it with both Perl files and email messages and I am satisfied with my choice. Now for some useful stuff…
: I came across a great page that is generated by a perl script once in a while. The goal of the page is to provide an easy way of finding a colorscheme appropriate for your tastes without the hassle of installing numerour colorschemes on your computer.
This is my attempt to provide a clear and simple instructions on adopting Vim text editor for programming needs. I am using Perl as the programming language in the examples, but most of this document will apply equally for any other programming language.
This post was translated into Portuguese by Alceu Rodrigues de Freitas Junior.
Continue reading “Vim for Perl developers”