background preloader

Best of VIM Tips, gVIM's Key Features zzapper

Best of VIM Tips, gVIM's Key Features zzapper
Tips Home Vim Tips Blog (NEW) Cygwin VimTools Buy Vim Book Support VIM Submit to Social Websites

Vim Cheat Sheat for Programmers by Michael Pohoreski Update: Version 2.0 is up! There are now 4 versions to chose from: (If you are wondering what the differences are between the screen and print: the screen has less color variations, and no gradients to make it easier to read.) One designed for on-screen reading: PDF (Excel 2011 source),One designed for hard-copy reading: PDF (Excel 2011 source),One designed for monochrome printing: PDF (Excel 2011 source), andOne designed for Red/Green color bindness -- a "Blue" theme PDF (Excel 2011 source). The color coded Legend / Keys helps provide guidance for your experience level. Green = Essential Yellow = Basic Orange / Blue = Advanced Red = Expert If you don't like this version (I'd love to hear why) try these, you may find them more to your liking... Thanks to all the redditors for the feedback! The on-screen 150 DPI .png version is shown... The color hard-copy 300 DPI .png version: The monochrome hard-copy 300 DPI .png version: An color blind hard-copy 150 DPI .png version: === Vim Rants ===

Vim: Seven habits of effective text editin Bram Moolenaar November 2000 If you spend a lot of time typing plain text, writing programs or HTML, you can save much of that time by using a good editor and using it effectively. Part 1: edit a file 1. Most time is spent reading, checking for errors and looking for the right place to work on, rather than inserting new text or changing it. Quite often you will want to search for some text you know is there. If you see a specific word and want to search for other occurrences of the same word, use the * command. In structured text there are even more possibilities to move around quickly. Use % to jump from an open brace to its matching closing brace. There are many more, of course. There are three basic steps: While you are editing, keep an eye out for actions you repeat and/or spend quite a bit of time on. Let's use an example to show how it works: You find that when you are editing C program files, you often spend time looking for where a function is defined. 2. 3. 4. 5. 6. 7. Epilogue

Vim Cookbook by Steve Oualline This is the Vim cookbook page. It contains short recipes for doing many simple and not so simple things in Vim. You should already know the basics of Vim, however each command is explained in detail. Each set of instructions is a complete package. Contents Character twiddling If you type fast your fingers can easily get ahead of your mind. To swap two characters, for example "e" with "h", put the cursor on the cursor on the "e" and type xp. The "x" command deletes a character (the "e") and the "p" pastes it after the cursor (which is now placed over the "h".) Interactively replacing one word with another (n. method) Suppose you want to replace every occurrence of the word "idiot" with the word "manager". Here's what you do: Repeat steps 4 and 5 until you have replaced all occurred. The Virgin What!? Interactively replacing one word with another (command line method) Execute the command: :%s/\<idiot\>/manager/gc The parts of this command are: Use the command: :%s/\<idiot\>/manager/g

AWS Management Console With Resource Groups, you can view collections of resources that share common tags. Streamline your use of the console by creating a resource group for each application, service, or collection of related resources that you work with regularly. Quickly navigate to each saved resource group using the “AWS” menu. Use the Tag Editor to easily manage tags for all resource types that support tags in any region. We are eager to hear about your user experience with the AWS Management Console. Coming Home to Vim I’m a programmer. I work with text files for 6-12 hours every weekday so I care about the text editor I use. If switching to a different editor can increase my efficiency by even 10% it would save a good chunk of my time and let me get back to making cool things. I don’t buy the “you’re thinking 90% of the time and only typing 10% of the time, so your editor doesn’t really matter” argument. If I think for 10 minutes and then start typing, I want the typing to take the shortest time possible so I can get back to thinking. I recently started using Vim as my primary editor. Some Background About Me In 2006 I decided it was time for a change. SubEthaEdit: As cool as SubEthaEdit was, I always felt like there was a better editor out there for me. TextMate: At the time I thought TextMate was amazing (and it really was). After using TextMate for four years I decided it was time for another change. Why I Switched to TextMate Aesthetics

Vim Introduction and Tutorial - IMHO I often tried to learn the great Emacs editor/IDE/operating system. The last time I tried it, I spent some time getting comfortable with it until I wanted to customize my .emacs file. That was the point when I entered vi .emacs. As soon as I realized what I’ve done, I knew that Vim has won me over a long time ago. So, here I am – using Vim as my editor of choice. Another big motivational boost came after I discovered that my preferred shell (ZSH) has an awesome vi-mode including the command mode (yes, you can switch between command and insert mode!). Vim has a great deal of features, and learning them takes some time. I took the approach to start using some tutorial and let the help-system guide (type :help <command> to get help for the command) me through the rest. Another reason I like to use Vim is because it’s much more healthy than Emacs (using the default-keymappings). Just remember: Vim’s basics are really very simple, but in combination the simple commands become very powerful.

Power Vim Usage: Tips &amp; Tricks for Everyday Editing Tips & Tricks for Everyday Editing Smylers UKUUG Linux 2004 Conference • 2004 August This view lists all the slides from the talk in a continuous format. The slides are also designed to be viewed as a slideshow from this file with Mozilla or a compatible browser. 1 Intro text editing: crops up all over Linux once good at it, find many uses for it Vim: powerful — potential for great efficiency Emacs and other VI variants also good this talk: tips — features & customizations fast, random, dull to encourage reading the notes work in progress 2 Learning Vim Vim is far too big to learn quickly probably too big to learn slowly learning it as an extension of VI is often not helpful The only way to get the hang of Vim is a bit at a time — learning some things you can make use of, getting comfortable with them, then learning some more. Some of the most useful Vim features don’t require any VI knowledge. 3 Moving About Capital F is similar to f but moves left instead of right. 4 Visual Mode

Vim is hard, I just want to click around More than a year ago, I wrote about switching to Vim. I was quite happy with how it all worked, but I found myself switching back to Textmate after a while. I read through a lot of dotfiles to “steal” some configuration options from others, took some time to go through vimtutor, read some blogposts and after a while, I was quite happy with how it all worked. My new, full screen Janus-powered MacVim editor, with sexy drawer But after some time, I started switching back to Textmate. Sometimes, I just want to click around, especially when looking for and opening files. MacVim It turns out I wasn’t the only one running into problems like this. I got a new hard drive, which was a great excuse to do a clean install and set up a better work environment. The one thing I didn’t really like was the new native Lion fullscreen mode, which newer versions of MacVim use by default. Luckily, that’s pretty easy to achieve. $ defaults write org.vim.MacVim MMNativeFullScreen 0 Janus skip_vim_plugin "nerdtree"

YvoSchaap.com - Easy AJAX inline text edit 2.0 As everybody knows, refreshing pages is so 1999. AJAX, DOM, whatever you call it makes it possible to let people edit a piece of text inline without having to use a submit button. You say: but that ain’t new at all! I say: But all of this has been made easy to use and implement: 2.0! Example page: inline edit (no JS knowledge needed) [source ] | Inline example: Please edit me! How you can make it work (5 easy steps for integration) Download this javascript file: InstantEdit 2.0 JSCreate a update file that handles the input. You’re done! How it works A small piece of javascript reads all SPAN tags, checks if it has class=“editText” and a id=. Compatibility This script works in Internet Explorer, Firefox, Chrome, Opera and Safari. Update hack If you want to force a textarea over a textfield (for example to edit a piece of HTML) use class=“editText” offsetHeight=“10”. If you want to PUSH an ID to your script I use: id=“edit_userID_$userID”.

Writing Vim Plugins A while ago I wrote a post about switching back to Vim. Since then I’ve written two plugins for Vim, one of which has been officially “released”. post: A couple of people have asked me if I’d write a guide to creating Vim plugins. I don’t feel confident enough to write an official “guide”, but I do have some advice for Vim plugin authors that might be useful. Other People Who Know More Than I Do Writing two decently-sized Vim plugins has given me some experience, but there are a lot of people that know far more than I do. Tim Pope The first is Tim Pope. Tim Pope: It would be awesome to read a guide on the ins and outs of Vim scripting by him. Scrooloose It’s 2011. if !

Related: