.vimrc
author Oleksandr Gavenko <gavenkoa@gmail.com>
Sun, 25 Sep 2011 17:39:49 +0300
changeset 213 29939202b671
parent 212 6608c5b29815
child 224 c73d2512617d
permissions -rw-r--r--
Remove duplication.
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
211
c6d56d6fbcc2 A 256 color scheme.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 210
diff changeset
     7
" Switch syntax highlighting on, when the terminal has colors
c6d56d6fbcc2 A 256 color scheme.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 210
diff changeset
     8
if &t_Co > 2 || has("gui_running")
c6d56d6fbcc2 A 256 color scheme.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 210
diff changeset
     9
  syntax on
c6d56d6fbcc2 A 256 color scheme.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 210
diff changeset
    10
endif
25
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
    11
211
c6d56d6fbcc2 A 256 color scheme.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 210
diff changeset
    12
" A 256 color scheme.
c6d56d6fbcc2 A 256 color scheme.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 210
diff changeset
    13
if &t_Co >= 256 || has("gui_running")
c6d56d6fbcc2 A 256 color scheme.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 210
diff changeset
    14
  colorscheme inkpot
c6d56d6fbcc2 A 256 color scheme.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 210
diff changeset
    15
endif
161
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
    16
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
    17
set sessionoptions=curdir,buffers,tabpages
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 showcmd  
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
    20
" Do not show line numbers.
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
    21
set nonu
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
    22
" Set command string height.
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
    23
set ch=1
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
    24
211
c6d56d6fbcc2 A 256 color scheme.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 210
diff changeset
    25
" Hide buffers instead of closing them.
161
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
    26
set hidden
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
    27
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
    28
set mouse=a
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
    29
set mousemodel=popup
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
    30
set mousehide
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
    31
210
d71ad1876c46 Disable these characters as word dividers.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 209
diff changeset
    32
" Number of lines of history to remember
d71ad1876c46 Disable these characters as word dividers.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 209
diff changeset
    33
set history=1000
d71ad1876c46 Disable these characters as word dividers.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 209
diff changeset
    34
" Number of levels of undo history
d71ad1876c46 Disable these characters as word dividers.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 209
diff changeset
    35
set undolevels=1000
d71ad1876c46 Disable these characters as word dividers.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 209
diff changeset
    36
26
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    37
" Same as set ts=4, by default - 8, how long TAB.
25
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
    38
set tabstop=4
26
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    39
" Use spaces instead TAB.
48
514847fa6797 Use spaces instead TAB.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 40
diff changeset
    40
set expandtab
25
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
    41
set shiftwidth=4
48
514847fa6797 Use spaces instead TAB.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 40
diff changeset
    42
set softtabstop=4
25
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
    43
set smarttab
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
    44
set et
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
    45
26
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    46
" Move cursor on RET to previous line indent.
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    47
set autoindent
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    48
" Indent for C-like languages.
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    49
set smartindent
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    50
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    51
" 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
    52
" 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
    53
" brace/parenthese/bracket. I've had almost no mismatched-punctuation errors
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    54
" since I started using this setting.
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    55
set showmatch
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    56
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    57
" Turn on incremental search with ignore case (except explicit caps).
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    58
set incsearch
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    59
set ignorecase
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    60
set smartcase
161
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
    61
set hlsearch
26
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    62
212
6608c5b29815 No audio or visual bell.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 211
diff changeset
    63
" No audio or visual bell.
6608c5b29815 No audio or visual bell.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 211
diff changeset
    64
set novisualbell
6608c5b29815 No audio or visual bell.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 211
diff changeset
    65
set noerrorbells
6608c5b29815 No audio or visual bell.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 211
diff changeset
    66
27
55688ec975f9 Remove custom status line.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 26
diff changeset
    67
" Have 3 lines of offset (or buffer) when scrolling.
55688ec975f9 Remove custom status line.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 26
diff changeset
    68
set scrolloff=3
161
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
    69
" set scrolljump=3
27
55688ec975f9 Remove custom status line.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 26
diff changeset
    70
26
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    71
" 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
    72
" visual clutter. This option gets rid of the toolbar.
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    73
set guioptions-=T
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    74
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    75
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    76
" 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
    77
" 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
    78
set vb t_vb=
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    79
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    80
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    81
" This setting ensures that each window contains a statusline that displays
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    82
" the current cursor position.
25
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
    83
set ruler
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
    84
26
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    85
" 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
    86
" 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
    87
" on with :set hls.
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    88
set nohls
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    89
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    90
" 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
    91
" 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
    92
" 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
    93
" 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
    94
" 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
    95
" 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
    96
" the location you want.
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    97
set incsearch
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    98
152
7fe989d9decb Bash like completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 48
diff changeset
    99
" 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
   100
" 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
   101
" through completion options so you can complete the file without further
7fe989d9decb Bash like completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 48
diff changeset
   102
" keys.
7fe989d9decb Bash like completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 48
diff changeset
   103
set wildmode=longest,list,full
7fe989d9decb Bash like completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 48
diff changeset
   104
set wildmenu
7fe989d9decb Bash like completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 48
diff changeset
   105
161
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   106
set complete=""
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   107
" From current buffer.
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   108
set complete+=.
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   109
" From dictionary.
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   110
set complete+=k
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   111
" From another buffers.
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   112
set complete+=b
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   113
" From tags.
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   114
set complete+=t
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   115
210
d71ad1876c46 Disable these characters as word dividers.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 209
diff changeset
   116
" Disable these characters as word dividers.
d71ad1876c46 Disable these characters as word dividers.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 209
diff changeset
   117
set iskeyword+=_
d71ad1876c46 Disable these characters as word dividers.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 209
diff changeset
   118
211
c6d56d6fbcc2 A 256 color scheme.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 210
diff changeset
   119
" Allow backspacing over autoindent, line breaks (join lines), start of insert
c6d56d6fbcc2 A 256 color scheme.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 210
diff changeset
   120
set backspace=indent,eol,start
c6d56d6fbcc2 A 256 color scheme.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 210
diff changeset
   121
c6d56d6fbcc2 A 256 color scheme.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 210
diff changeset
   122
" Affects the output of :TOhtml.
c6d56d6fbcc2 A 256 color scheme.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 210
diff changeset
   123
:let html_use_css = 1
c6d56d6fbcc2 A 256 color scheme.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 210
diff changeset
   124
:let use_xhtml = 1
c6d56d6fbcc2 A 256 color scheme.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 210
diff changeset
   125
161
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   126
" Fix <Enter> for comment
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   127
" set fo+=cr
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   128
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   129
" set termencoding=cp866
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   130
" set fileencoding=cp1251
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   131
" set fileencodings=cp1251,cp866,utf8
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   132
" set encoding=cp1251
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   133
25
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
   134
" Local Variables:
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
   135
" mode: fundamental
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
   136
" comment-start: "\""
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
   137
" eval: (font-lock-add-keywords nil '( ("^[[:blank:]]*\".*" . font-lock-comment-face) ))
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
   138
" End: