background preloader

100 Vim commands every programmer should know

100 Vim commands every programmer should know

Linux Newbie Guide by Stan, Peter and Marie Klimas Intro. We are relative Linux newbies (with Linux since Summer 1998). We run mostly RedHat and Mandrake -> the solutions might not be directly applicable to other Linux distributions (although most of them probably will be). Hope this helps; we try to be as practical as possible. Of course, we provide no warranty whatsoever. If you spotted a bad error or would like to contribute a part on a topic of your choice, we would like to hear from you. General description of this Guide. Conventions: <> = single special or function key on the keyboard. Part 0: For the Undecided (Linux Benefits) If you are wondering what the Linux pros and cons are, and whether Linux is for you. Part 1: Before Linux Installation What distribution should I use, how to obtain it, Linux hardware requirements, how to partition your hard drive, about dual boot, which packages to install, which graphical user interface (GUI) to install (gnome or kde?) Licence, Acknowledgments and log of changes.

VIM Vim es un editor de texto altamente configurable desarrollado para hacer más eficiente la edición de texto. Es una versión mejorada del editor de texto vi distribuido con la mayoría de sistemas Unix. Vim es usualmente llamado «el editor del programador», y es tan bueno para la programación que muchos lo consideran como un IDE completo. Aunque, no es solo para programadores. Características Características modernas con respecto a vi: Múltiples niveles para deshacer. Características para usuarios avanzados: Formateo de texto. Características para rendimiento en programación: Edita-compila-edita más velozmente. Más información en la FAQ oficial de vim (en inglés). Instalación Mediante repositorios Instala el paquete vim del repositorio main de Ubuntu. Manualmente Vim está disponible para muchos sistemas y existen muchas versiones. Uso Inicio Para inicia vim desde terminal, ejecuta el siguiente comando: vim Modos vi (y por lo tanto vim) se caracteriza por disponer de distintos modos para trabajar.

Vim Regular Expressions 101 All commands Vi Vim Tips And Tricks - Part 3 This is a guest post written by SathiyaMoorthy You can perform automatic word completion in Vim using Ctrl-x in insert or append mode. By typing the first few characters of a word you can get the whole word either from a dictionary, or a thesaurus, or even the words that are already present on the file that you are editing. This article explains how to perform following operations with examples and screen shots: Word / pattern completion Line completion Dictionary word completion File name completionFilling up words with similar meaning (Thesaurus word completion). (more…) This is a guest post written by SathiyaMoorthy. Adding file header Adding function/frame comment Including default code snippet Performing syntax check Reading documentation about a function Converting a code block to comment, and vice versa The Perl-Support Vim Plugin – Perl-IDE offers easiest way to do all of the above, saving lot of time and keystrokes. This is a guest post written by Lakshmanan G.

Easy note taking in Vim peterodding.com / code / vim / notes Ohloh: Mostly written in Vim Script, 2411 lines of code, 5 contributors in last 12 monthsGitHub: Watched by 201 people, most recent update was 8 months agoVim Online: Rated 358, downloaded 4839 times The vim-notes plug-in for the Vim text editor makes it easy to manage your notes in Vim: # Install & usage Please note that the vim-notes plug-in requires my vim-misc plug-in which is separately distributed. Unzip the most recent ZIP archives of the vim-notes and vim-misc plug-ins inside your Vim profile directory (usually this is ~/.vim on UNIX and %USERPROFILE%\vimfiles on Windows), restart Vim and execute the command :helptags ~/.vim/doc (use :helptags ~\vimfiles\doc instead on Windows). If you prefer you can also use Pathogen, Vundle or a similar tool to install & update the vim-notes and vim-misc plug-ins using a local clone of the git repository. # Options :let g:notes_directories = ['~/Documents/Notes', '~/Dropbox/Shared Notes'] # Backwards compatibility

Learn Linux, 101: The Linux command line Overview This article gives you a brief introduction to some of the major features of the bash shell, and covers the following topics: Interacting with shells and commands using the command lineUsing valid commands and command sequencesDefining, modifying, referencing, and exporting environment variablesAccessing command history and editing facilitiesInvoking commands in the path and outside the pathUsing man (manual) pages to find out about commands This article helps you prepare for Objective 103.1 in Topic 103 of the Junior Level Administration (LPIC-1) exam 101. Back to top The bash shell The bash shell is one of several shells available for Linux. Before we delve deeper into bash, recall that a shell is a program that accepts and executes commands. Shells have some builtin commands, such as cd, break, and exec. Shells also use three standard I/O streams: Input streams provide input to programs, usually from terminal keystrokes. Listing 1. [db2inst1@echidna db2inst1]$ ian@lyrebird:~> $

Vi and Vim Autocommand: 3 Steps to Add Custom Header To Your File Automatically This is a guest post written by Lakshmanan G. This article is part of the ongoing Vi / Vim Tips & Tricks series. Using autocommand feature in Vi / Vim, you can specify some Vim commands to be executed automatically while reading or writing a file, or while entering/leaving a buffer/window, or while exiting Vim. In this article, using 3 simple steps, let us review how to use this powerful autocmd feature of Vim to create a header section inside a file (for example, header in a C programming code) with file name, creation date, last modified date/time automatically populated when you open a file in vi.Vim autocmd syntax: autocmd {event} {pattern} {cmd} Events: There are more than 40 autocmd events. BufNewFile - Starting to edit a file that doesn't exist. Most of the developers want some default header for their programs. /* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. * File Name : 1.c * Purpose : * Creation Date : 22-12-2008 * Last Modified : Mon 22 Dec 2008 10:36:49 PM PST * Created By : _

Vim: Seven habits of effective text editing 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

Related: