background preloader

VIM

Facebook Twitter

Carlhuda/janus. Vim-for-php-programmers. Here is why vim uses the hjkl keys as arrow keys. I was reading about vim the other day and found out why it used hjkl keys as arrow keys.

Here is why vim uses the hjkl keys as arrow keys

When Bill Joy created the vi text editor he used the ADM-3A terminal, which had the arrows on hjkl keys. Naturally he reused the same keys and the rest is history! Here is how the hjkl keys looked: ADM-3A keyboard's hjkl keys with arrows. And here is the whole terminal that vi was created on: Lear Siegler's ADM-3A computer terminal. Since vim is derived from vi, it uses the same hjkl keys. And while we're at it, notice where the ESC key is positioned: Create Your Own Syntax Highlighting in Vim. Create Your Own Syntax Highlighting in Vim In text editors like Vim, syntax highlighting is the feature that shows defined components in different colors depending on their functions in the file.

Create Your Own Syntax Highlighting in Vim

Vim has code syntax highlighting already available for a huge array of programming languages, including PHP, Python, HTML, Ruby, JavaScript, and more, and most of them are installed by default in the $VIM/syntax/ directory, so in most cases you can just open up your source code files and see different parts appropriately color-coded. Vim Essential Plugin: SnipMate. The SnipMate plugin aims to mimic the popular snippets feature in TextMate, which allows you to type a sequence of characters, and then automatically expand to a full block of code or html by pressing Tab.

Vim Essential Plugin: SnipMate

It's incredibly helpful. Once installed, you only need to type the desired snippet trigger, and then press Tab. Keep in mind, though, that the available snippets are limited to the extension of the file you're working on. For example, JavaScript snippets will not work within an HTML file, and vice versa. Try visiting your ~.vim/snippets directory for an overview of all the available shortcut keys. If the above snippet is placed within the HTML.snippets file, you'll then be able to create a bla element by typing the shortcut, mysnippet. Vim Cheat Sheat for Programmers by Michael Pohoreski. Update: Version 2.0 is up!

Vim Cheat Sheat for Programmers by Michael Pohoreski

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: Writing Vim Plugins. Vim tips: Using tabs. Before Vim 7.0 was released last May, I usually had six or seven xterms or Konsole windows open, each with a single Vim session in which I was editing a single file. This takes up a lot of screen space, and isn't very efficient. With Vim 7.0, users now have the option of using tabs within Vim. With Vim's tab features you can consolidate all your sessions into one window and move between files more easily. If you're using an version of Vim older than 7.0, you won't have access to this feature. By now, though, most distros have moved to Vim 7.0, so if you're using a recent release you should be OK. List of vim plugins I use - with mini tutorials » mirnazim.org. I am a vim user, and by user I mean I do all(not counting using the textarea inside the web browser) of my editing inside vim.

List of vim plugins I use - with mini tutorials » mirnazim.org

Even when I need to use a word processor, I first type my content inside vim and then open the word processor to format it. Quickfix. A coding font. The latest MacOS release (10.6, or “Snow Leopard”) comes with a new monospace font.

A coding font

It’s called “Menlo” and it’s a slightly modified form of the standard Linux font (with appropriately weightly Linux name) “DejaVu Sans Serif Mono”, which is itself an updated form of Bitstream Vera Sans Mono. Apple’s modifications are a definite improvement to my eyes, mostly because they thicken up some of the wispier glyphs from DejaVu, like the underline and period. There’s a great comparison over here. One thing that bothered me, though, is that they turned the zero into a 1980s-style “slashed circle”. Unhip, daddy-o!

I couldn’t limit my tweaking to the zero glyph, so in the end I made about a dozen changes. A summary of the changes I made: Zero is back to being a circle with a dot in the middle.The ampersand’s loop was closed.