
Resizing Vim window splits like a boss - Read'n'Code - Flaviu Simihaian's Blog If you’re using Vim as your text editor (if you’re not, these videos will convince you), you’re probably using window splits. If you’re using window splits, you probably wished you had a quick way to resize them. I recently watched Gary Bernhardt’s video on VIM File Navigation, and got inspired to research this problem. So, set the following in your ~/.vimrc: This will make sure all splits will be at least 5 lines (which is enough for reference), and the current window will be 30 lines. You can increase or decrease the size of a window by one line with Ctrl-w + - and Ctrl-w + +. That probably makes no sense. As for navigation, I’m using these mappings to move between splits with Ctrl-w + - and Ctrl-w + *+: Also, if you want to make all windows equal, use Ctrl-w + = Check this out for similar nuggets.
Start - Synchronizing plugins with git submodules and pathogen - Pentadactyl Synchronizing plugins with git submodules and pathogen If you use Vim on muliple machines, it can be difficult to keep your configuration files synchronized across them. One solution is to put your dotfiles under version control. Keep your dotfiles in git The following instructions assume that your home directory contains a .vimrc file, a .vim directory and a .gvimrc file (optional). Move the .vimrc and .gvimrc files into the .vim directory: mv .vimrc ~/.vim/vimrc mv .gvimrc ~/.vim/gvimrc Create symbolic links so that ~/.vimrc points to the ~/.vim/vimrc file: ln -s ~/.vim/vimrc ~/.vimrc ln -s ~/.vim/gvimrc ~/.gvimrc Change to the .vim directory, and initialize it as a git repository: cd ~/.vim git init Create a README file, and paste installation instructions into it (see example README). Add all files, and make an initial commit: git add . git commit -m "Initial commit" Keep your plugins in git Pathogen.vim The pathogen plugin makes it possible to cleanly install plugins as a bundle. Updates
vi/vim tips Editing with vi/vim is a fairly wide subject. This section contains some interesting information for vi/vim users, as well as for those learning to use vi/vim. It also contains vi/vim related stories, such as how & why I began using vim (in 2005!). Some of the articles were initially published as blog posts, and the links below point to the original blog post. If you want to find more content related to other matters, such as developing a compiler and virtual machine, extending Visual Studio, using the Cheetah template engine to structure a web site, etc... visit the main NGEDIT articles section. Articles Why, oh WHY, do those nutheads use vi? Graphical cheat sheet & tutorial [March 2006] How to start learning vi/vim [Sept 2005] Why start using vi/vim/ViEmu?
Vim eighteen months on - shapeshed I switched to Vim for editing text about 18 months ago. Here's an overview of my experience. Goodbye TextMate? About 18 months ago I made the decision to give Vim a go as my primary text editor. I had been using vi extensively for server admin work for a number of years so I wasn't a total noob. TextMate was my default editor and broadly I was happy with it but decided to give Vim a go. Baby steps I started out with baby steps, looking back to TextMate and doing all of the common things a switcher does, especially looking for TextMate's features in Vim. Many people recommend using MacVim to ease the transition. Installation of MacVim via homebrew on OSX is easy brew install macvim MacVim works like a standard application so you don't need to edit directly in the terminal and comes with many common keyboard shortcuts that you'll likely be used to. The setup phase As with with many things in UNIX you get back what you put in. Learn as you go Vim does take time to learn. :help lowercase Now
vim - Vim as XML Editor: Setup - Pentadactyl Again, this is just one way of setting things up. TMTOWTDI ;) Your local environment is likely to be different, as well as your preferences, and the tools evolve. I'll give a short overview of what I use; please refer to the documentation of the respective tool for instructions on how to best set things up. If you experience problems with any of the tools featured below please file bug reports directly to the respective project. Linux Here's my .bashrc: ~/.bashrc Often it helps to do source .bashrc after having modified .bashrc and after having created new command scripts. Windows When creating batch files on Windows (file name suffix .bat) don't forget to make sure that the file format is set correctly. The vimrc file is the place where you set your preferences. vimrc The latest version is online at www.pinkjuice.com/vim/vimrc.txt. For example there is let mapleader = "," and nmap <Leader>l <Leader>cd:%w ! which means that whenever I want xmllint to validate the buffer I do , l. home Home Manual man #!
Power Vim Usage: Tips & 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
Mastering the VI editor Date: 15/06/2012 I decided to republish the article below after trying to visit the original (to share the link with friend) and discovering it no longer existed. The original was written by Ben Y. Hopefully by replicating the original here, I can help a few more people find benefit from it. Download/View PDF Introduction The VI editor is a screen-based editor used by many Unix users. Conventions In this tutorial, the following convention will be used: ^X denotes a control character. Before You Begin The VI editor uses the full screen, so it needs to know what kind of terminal you have. TERM = (vt100) If you know your terminal is a vt100 (or an emulator that can do vt100), just hit return for the terminal type when you log in. If you make an error when you log in and type the wrong terminal type, don't panic and log out. First, tell your shell what type of terminal you have. set term=vt100 For Bourne Shell (/bin/sh) or Korn Shell (/bin/ksh), the commands are the following: export TERM TERM=vt100
VIM Adventures Why, oh WHY, do those #?@! nutheads use vi? The VI Gang Sign by Jon Beltran de Heredia, May 16th, 2007 Yes, even if you can't believe it, there are a lot fans of the 30-years-old vi editor (or its more recent, just-15-years-old, best clone & great improvement, vim). No, they are not dinosaurs who don't want to catch up with the times - the community of vi users just keeps growing: myself, I only got started 2 years ago (after over 10 years of being a professional programmer). Friends of mine are converting today. Yes, there are definite reasons why the vi/vim editing model is just superior to any other out there. Misconception #1: modal editing The first time you stumble into vi or vim, you are shocked and disgusted that you have to use 'i' to start typing text. Turns out, this is just a completely wrong way to use vi or vim. Let me explain the philosophy behind this. One good benefit of this is that the '.' command repeats the last complete, combined editing command (not movement commands). And now we come to insert commands.
Vim Regular Expressions 101 Beginner's guide to Vi Improved (vim) Jesse Goerz jwgoerz@users.sourceforge.net Copyright © 2002 Jesse Goerz, NewbieDoc project. This manual is free software; you may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. You should have received a copy of the GNU General Public License with your Debian GNU/Linux system, in /usr/doc/copyright/GPL, or with the debiandoc-sgml source package as the file COPYING. 1. This document will cover the console version of vim from Debian stable. Learning vim can be a bit of a trial but it is well worth it in the long run. No introduction to vim would be complete without a warning. If it is so irritating why would you want to learn how to use it? 4. To get more information on modes type: 4.2.
Getting Started with Vi Most people who are getting started with Linux or UNIX today already know how to use graphical WYSIWYG (what you see is what you get) editors, with heavy use of the mouse, icons and pull-down menus. When they first encounter the traditional UNIX/Linux editor, vi, it may seem awkward and not very powerful, but the opposite is true. As with graphical editors, you can select a range of text and execute a command to make changes, move the cursor by indicating where you want it to be and insert text by typing at the keyboard. The difference is that vi doesn't use the mouse; you use the keyboard to specify changes or move the cursor. In order for the entire keyboard to be available for commands, vi has separate command and insert modes. Modes can be confusing at first. Most new vi users learn only a few basic commands: the arrow keys, i for insert, x to delete a character, dd to delete a line, :wq to save and exit and perhaps a few others. The first command to learns in vi is i.
Making MacVim work with Vimperator's external editor feature Because I'm a vim user, it's naturally for me to use vimperator on top of Firefox. Today I posted a tip on vimperator.org that helps me use Vimperator on my MacOS system. I'm reposting that tip here. To make a long story short, try an editor setting like :set editor='bash -lc "mvim -f \$*" mvim ' or (if you prefer gvim) :set editor='bash -lc "gvim -f \$*" gvim ' Then you should be able to hit CNTRL+I to launch an external editor for textareas. Shelling out to external commands is hairier in OS X than it is on other platforms. In my case, I use MacVim, which includes a script mvim that can be called as mvim -f ... so that the script will wait for the GUI to exit before it exits. My mvim script is in /usr/local/bin. :! As you can see, those environment variables are very different from the ones you'd expect in a "login shell." :set shcf='-lc' Then you'll notice that :! A simple solution is to :set editor='/usr/local/bin/mvim -f' For most people, this solution will be perfect.
Ctags The original Ctags was introduced in BSD Unix and was written by Ken Arnold, with Fortran support by Jim Kleckner and Pascal support by Bill Joy. Editors that support ctags[edit] Tag index files are supported by many source code editors, including: Variants of ctags[edit] There are a few variations of the ctags program: Etags[edit] Etags is the ctags utility that comes with Emacs. Exuberant Ctags[edit] Exuberant Ctags includes support for over 40 programming languages with the ability to add support for even more using regular expressions. Hasktags[edit] jsctags[edit] jsctags is a ctags-compatible code indexing solution for JavaScript.[4] It is specialized for JavaScript and its packaging system CommonJS and outperforms Exuberant Ctags for JavaScript code, finding more tags than the latter.[5] Tags file formats[edit] There are multiple tag file formats. Ctags and Exuberant Ctags[edit] The original ctags and Exuberant Ctags have similar file formats:[6] Ctags[edit] The fields are specified as follows: