.vimrc
author Oleksandr Gavenko <gavenkoa@gmail.com>
Tue, 16 Mar 2010 15:48:46 +0200
changeset 37 5d56427b59a4
parent 27 55688ec975f9
child 40 b8185f03f364
permissions -rw-r--r--
First tab suggests ambiguous variants.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
25
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
     1
" On loding VIM search for /etc/vimrc, ~/.vimrc.
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
     2
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
     3
syntax on
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
     4
26
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
     5
" Do not emulate old vi bug.
25
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
     6
set nocompatible
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
     7
26
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
     8
" Same as set ts=4, by default - 8, how long TAB.
25
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
     9
set tabstop=4
26
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    10
" Use spaces instead TAB.
25
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
    11
set shiftwidth=4
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
    12
set smarttab
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
    13
set et
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
    14
26
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    15
" Move cursor on RET to previous line indent.
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    16
set autoindent
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    17
" Indent for C-like languages.
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    18
set smartindent
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    19
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    20
" This setting will cause the cursor to very briefly jump to a
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    21
" brace/parenthese/bracket's "match" whenever you type a closing or opening
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    22
" brace/parenthese/bracket. I've had almost no mismatched-punctuation errors
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    23
" since I started using this setting.
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    24
set showmatch
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    25
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    26
" Turn on incremental search with ignore case (except explicit caps).
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    27
set incsearch
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    28
set ignorecase
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    29
set smartcase
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    30
27
55688ec975f9 Remove custom status line.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 26
diff changeset
    31
" Have 3 lines of offset (or buffer) when scrolling.
55688ec975f9 Remove custom status line.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 26
diff changeset
    32
set scrolloff=3
55688ec975f9 Remove custom status line.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 26
diff changeset
    33
26
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    34
" I find the toolbar in the GUI version of vim (gvim) to be somewhat useless
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    35
" visual clutter. This option gets rid of the toolbar.
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    36
set guioptions-=T
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    37
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    38
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    39
" This setting prevents vi from making its annoying beeps when a command
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    40
" doesn't work. Instead, it briefly flashes the screen -- much less annoying.
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    41
set vb t_vb=
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    42
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    43
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    44
" This setting ensures that each window contains a statusline that displays
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    45
" the current cursor position.
25
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
    46
set ruler
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
    47
26
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    48
" By default, search matches are highlighted. I find this annoying most of the
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    49
" time. This option turns off search highlighting. You can always turn it back
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    50
" on with :set hls.
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    51
set nohls
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    52
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    53
" With this nifty option, vim will search for text as you enter it. For
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    54
" instance, if you type /bob to search for bob, vi will go to the first "b"
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    55
" after you type the "b," to the first "bo" after you type the "o," and so on.
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    56
" It makes searching much faster, since if you pay attention you never have to
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    57
" enter more than the minimum number of characters to find your target
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    58
" location. Make sure that you press Enter to accept the match after vim finds
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    59
" the location you want.
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    60
set incsearch
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    61
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    62
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    63
" By default, vim doesn't let the cursor stray beyond the defined text. This
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    64
" setting allows the cursor to freely roam anywhere it likes in command mode.
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    65
" It feels weird at first but is quite useful.
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    66
set virtualedit=all
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    67
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    68
set ruler
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    69
25
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
    70
" Local Variables:
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
    71
" mode: fundamental
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
    72
" comment-start: "\""
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
    73
" eval: (font-lock-add-keywords nil '( ("^[[:blank:]]*\".*" . font-lock-comment-face) ))
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
    74
" End: