" Configuration file for gvim " Written for Debian GNU/Linux by W.Akkerman " Some modifications by J.H.M. Dassen " Normally we use vim-extensions. If you want true vi-compatibility " remove change the following statements set nocompatible " Use Vim defaults (much better!) set backspace=2 " allow backspacing over everything in insert mode " Now we set some defaults for the editor set autoindent " always set autoindenting on set textwidth=0 " Don't wrap words by default set nobackup " Don't keep a backup file set viminfo='20,\"50 " read/write a .viminfo file, don't store more than " 50 lines of registers set history=50 " keep 50 lines of command line history set ruler " show the cursor position all the time " Suffixes that get lower priority when doing tab completion for filenames. " These are files we are not likely to want to edit or read. set suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc " We know xterm-debian is a color terminal if &term =~ "xterm-debian" || &term =~ "xterm-xfree86" set t_Co=16 set t_Sf=[3%dm set t_Sb=[4%dm endif " Make p in Visual mode replace the selected text with the "" register. vnoremap p :let current_reg = @"gvdi=current_reg " Vim5 and later versions support syntax highlighting. Uncommenting the next " 3 lines enables syntax highlighting by default. if has("syntax") && &t_Co > 2 syntax on endif " Debian uses compressed helpfiles. We must inform vim that the main " helpfiles is compressed. Other helpfiles are stated in the tags-file. "set helpfile=$VIMRUNTIME/doc/help.txt.gz if has("autocmd") " Enabled file type detection " Use the default filetype settings. Also load indent files to automatically " do language-dependent indenting filetype plugin indent on " Also, support editing of gzip-compressed files. DO NOT REMOVE THIS! " This is also used when loading the compressed helpfiles. endif " has ("autocmd") " Some Debian-specific things augroup filetype au BufRead reportbug.* set ft=mail augroup END " The following are commented out as they cause vim to behave a lot " different from regular vi. They are highly recommended though. set showcmd " Show (partial) command in status line. set showmatch " Show matching brackets. set ignorecase " Do case insensitive matching set incsearch " Incremental search set autowrite " Automatically save before commands like :next and :make "od tego miejsca b.p. inoremap :wa noremap :wi noremap :N inoremap :N noremap :n inoremap :n set tabstop=4 set shiftwidth=4 "set foldmethod=indent set visualbell set helplang=pl "poniżej zakomentowana metoda uzupełniania za pomocą "function InsertTabWrapper() " let col = col('.') - 1 " if !col || getline('.')[col - 1] !~ '\k' " return "\" " else " return "\" " endif "endfunction "inoremap =InsertTabWrapper() autocmd BufEnter *.c setlocal expandtab inoremap s #includeint main(void){}return 0; noremap s i#includeint main(void){}return 0; inoremap i #include noremap i i#include inoremap d #define noremap d i#define inoremap b o/*********************************************************************************************************************/ noremap b o/*********************************************************************************************************************/ inoremap :1,$!indent -ts2 -npsl -l99 -br -brs :%s/\t/ /g noremap :1,$!indent -ts2 -npsl -l99 -br -brs :%s/\t/ /g noremap 9 :make CC=gcc CFLAGS='-Wall -pedantic -std=c99 -lm' %< inoremap 9 :make CC=gcc CFLAGS='-Wall -pedantic -std=c99 -lm' %< noremap :make inoremap :make noremap :make CFLAGS='-Wall -pedantic -lm' %< inoremap :make CFLAGS='-Wall -pedantic -lm' %< inoremap r :!%< noremap r :!%< inoremap f ofor ( ) {}kA noremap f ofor ( ) {}kA inoremap e oelse if ( ) {}kA5la noremap e oelse if ( ) {}kA5la inoremap w owhile ( ) {}kA noremap w owhile ( ) {}kA inoremap i oif ( ) {}kAa noremap i oif ( ) {}kAa inoremap e oelse {}kA noremap e oelse {}kA inoremap c :%s/^[ \t]*\n// noremap c :%s/^[ \t]*\n// let k1="F3-r wykonuje\n" let k2="F3-i wstawia #include\n" let k3="F3-9 kompiluje w C99\n" let k4="F3-s wstawia początek\n" let k5="F3-d wstawia #define\n" let k6="F3-b wstawia box\n" let k7="F7 make\n" let k8=" F8 kompiluje\n" let k9="F9 wywołuje indent\n" let ka="F3-f wstawia for\n" let kb="F3-e wstawia else if\n" let kc="F3-w wstawia while\n" let kd="F2 zapisuje\n" let ke="F5 edytuje poprzedni plik\n" let kf="F6 edytuje następny plik" let kg="F4-i wstawia if\n" let kh="F4-e wstawia else\n" let ki="F3-c czyści puste linie\n" noremap :echo k8 k3 k9 k7 k1 k4 k2 k5 k6 ka kb kc kg kh ki kd ke kf inoremap :echo k8 k3 k9 k7 k1 k4 k2 k5 k6 ka kb kc kg kh ki kd ke kf runtime ftplugin/man.vim noremap K :exec 'Man ' . expand("") set isk=a-z,A-Z,48-57,_,.,-,> "odkomentuj poniższe jeśli chcesz dopisywać nawias } do nawiasu { "inoremap { {}A set fileencodings=ucs-bom,utf-8,default,latin2 filetype plugin on set grepprg=grep\ -nH\ $* "do .bashrc dopisać "export PATH=./:$PATH "export CFLAGS='-Wall -pedantic' "export CPPFLAGS='-Wall -pedantic'