Konfiguration
Die Konfiguration in ~/.vimrc kann z.B. folgendermaßen aussehen:
" Sets the character encoding inside vim set encoding=utf-8 " no automatic line wrap set textwidth=0 " automatically indent lines set autoindent " auto-indenting for code paste set paste " Changes all tabs in spaces set expandtab " Number of spaces for each Tab set shiftwidth=4 set tabstop=4 " Tabs are always 'tabstop' positions set softtabstop=4 " <BS>, <Del>, CTRL-W and CTRL-U in Insert mode: " indent allow backspacing over autoindent " eol allow backspacing over line breaks (join lines) " start allow backspacing over the start of insert; CTRL-W and CTRL-U " stop once at the start of insert. set backspace=indent,eol,start " Incremental searching set incsearch " Ignore case in search patterns set ignorecase " Highlight all search matches set hlsearch " Show the line and column number of the cursor position set ruler " command-line completion operates in an enhanced mode. On pressing 'wildchar' " (usually <Tab>) to invoke completion, the possible matches are shown just " above the command line, with the first match highlighted set wildmenu " A template for a comment. The "%s" in the value is replaced with the " comment text. set commentstring=\ #\ %s " Sets the fold level: Folds with a higher level will be closed. " Setting this option to zero will close all folds. set foldlevel=0 " Syntax highlighting syntax on
Encoding-Deklarationen
Das Encoding kann auch in Python-Skripten selbst angegeben werden. Diese Angaben werden dann von vim automatisch ausgegeben. Eine solche Deklaration kann z.B. folgendermaßen aussehen:
# -*- coding: UTF-8 -*-
Weitere Informationen erhalten Sie in der Python-Dokumentation unter 2.1.4. Encoding declarations.
