.vimrc
author Oleksandr Gavenko <gavenkoa@gmail.com>
Sun, 25 Sep 2011 17:13:42 +0300
changeset 210 d71ad1876c46
parent 209 f236b47efe74
child 211 c6d56d6fbcc2
permissions -rw-r--r--
Disable these characters as word dividers.
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
209
f236b47efe74 This must be first, because it changes other options as side effect.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 178
diff changeset
     3
" Do not emulate old vi bug.
f236b47efe74 This must be first, because it changes other options as side effect.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 178
diff changeset
     4
" This must be first, because it changes other options as side effect.
f236b47efe74 This must be first, because it changes other options as side effect.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 178
diff changeset
     5
set nocompatible
f236b47efe74 This must be first, because it changes other options as side effect.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 178
diff changeset
     6
25
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
     7
syntax on
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
     8
178
8f02d11f289d Disable colorsheme as it can be not present on host.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 161
diff changeset
     9
" colorscheme delek
161
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
    10
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
    11
set sessionoptions=curdir,buffers,tabpages
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
    12
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
    13
set showcmd  
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
    14
" Do not show line numbers.
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
    15
set nonu
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
    16
" Set command string height.
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
    17
set ch=1
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
    18
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
    19
set hidden
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
    20
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
    21
set mouse=a
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
    22
set mousemodel=popup
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
    23
set mousehide
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
    24
210
d71ad1876c46 Disable these characters as word dividers.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 209
diff changeset
    25
" Number of lines of history to remember
d71ad1876c46 Disable these characters as word dividers.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 209
diff changeset
    26
set history=1000
d71ad1876c46 Disable these characters as word dividers.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 209
diff changeset
    27
" Number of levels of undo history
d71ad1876c46 Disable these characters as word dividers.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 209
diff changeset
    28
set undolevels=1000
d71ad1876c46 Disable these characters as word dividers.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 209
diff changeset
    29
26
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    30
" Same as set ts=4, by default - 8, how long TAB.
25
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
    31
set tabstop=4
26
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    32
" Use spaces instead TAB.
48
514847fa6797 Use spaces instead TAB.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 40
diff changeset
    33
set expandtab
25
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
    34
set shiftwidth=4
48
514847fa6797 Use spaces instead TAB.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 40
diff changeset
    35
set softtabstop=4
25
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
    36
set smarttab
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
    37
set et
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
    38
26
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    39
" Move cursor on RET to previous line indent.
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    40
set autoindent
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    41
" Indent for C-like languages.
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    42
set smartindent
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 will cause the cursor to very briefly jump to a
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    45
" 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
    46
" brace/parenthese/bracket. I've had almost no mismatched-punctuation errors
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    47
" since I started using this setting.
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    48
set showmatch
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    49
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    50
" Turn on incremental search with ignore case (except explicit caps).
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    51
set incsearch
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    52
set ignorecase
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    53
set smartcase
161
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
    54
set hlsearch
26
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    55
27
55688ec975f9 Remove custom status line.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 26
diff changeset
    56
" Have 3 lines of offset (or buffer) when scrolling.
55688ec975f9 Remove custom status line.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 26
diff changeset
    57
set scrolloff=3
161
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
    58
" set scrolljump=3
27
55688ec975f9 Remove custom status line.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 26
diff changeset
    59
26
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    60
" 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
    61
" visual clutter. This option gets rid of the toolbar.
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    62
set guioptions-=T
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    63
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    64
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    65
" 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
    66
" 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
    67
set vb t_vb=
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    68
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    69
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    70
" This setting ensures that each window contains a statusline that displays
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    71
" the current cursor position.
25
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
    72
set ruler
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
    73
26
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    74
" 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
    75
" 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
    76
" on with :set hls.
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    77
set nohls
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    78
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    79
" 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
    80
" 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
    81
" 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
    82
" 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
    83
" 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
    84
" 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
    85
" the location you want.
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    86
set incsearch
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    87
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    88
set ruler
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    89
152
7fe989d9decb Bash like completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 48
diff changeset
    90
" When you type the first tab hit will complete as much as possible, the
7fe989d9decb Bash like completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 48
diff changeset
    91
" second tab hit will provide a list, the third and subsequent tabs will cycle
7fe989d9decb Bash like completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 48
diff changeset
    92
" through completion options so you can complete the file without further
7fe989d9decb Bash like completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 48
diff changeset
    93
" keys.
7fe989d9decb Bash like completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 48
diff changeset
    94
set wildmode=longest,list,full
7fe989d9decb Bash like completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 48
diff changeset
    95
set wildmenu
7fe989d9decb Bash like completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 48
diff changeset
    96
161
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
    97
set complete=""
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
    98
" From current buffer.
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
    99
set complete+=.
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   100
" From dictionary.
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   101
set complete+=k
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   102
" From another buffers.
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   103
set complete+=b
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   104
" From tags.
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   105
set complete+=t
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   106
210
d71ad1876c46 Disable these characters as word dividers.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 209
diff changeset
   107
" Disable these characters as word dividers.
d71ad1876c46 Disable these characters as word dividers.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 209
diff changeset
   108
set iskeyword+=_
d71ad1876c46 Disable these characters as word dividers.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 209
diff changeset
   109
161
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   110
" Fix <Enter> for comment
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   111
" set fo+=cr
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   112
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   113
" set termencoding=cp866
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   114
" set fileencoding=cp1251
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   115
" set fileencodings=cp1251,cp866,utf8
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   116
" set encoding=cp1251
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   117
25
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
   118
" Local Variables:
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
   119
" mode: fundamental
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
   120
" comment-start: "\""
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
   121
" eval: (font-lock-add-keywords nil '( ("^[[:blank:]]*\".*" . font-lock-comment-face) ))
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
   122
" End: