.vimrc
author Oleksandr Gavenko <gavenkoa@gmail.com>
Fri, 09 Jan 2015 23:31:59 +0200
changeset 722 9bd7ce98c7ce
parent 609 0474cf9957c9
child 925 8a010eb167ff
permissions -rw-r--r--
colored-stats
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")
224
c73d2512617d use delek color schema
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 213
diff changeset
    14
  colorscheme delek
211
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
606
f21480ec9818 Beep instead of blink.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 547
diff changeset
    19
" Show mode in last line of screen.
f21480ec9818 Beep instead of blink.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 547
diff changeset
    20
set showmode
f21480ec9818 Beep instead of blink.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 547
diff changeset
    21
" Show last command in last line of screen.
f21480ec9818 Beep instead of blink.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 547
diff changeset
    22
set showcmd
161
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
    23
" Do not show line numbers.
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
    24
set nonu
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
    25
" Set command string height.
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
    26
set ch=1
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
    27
607
db8b30e73baf Highlight line with cursor.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 606
diff changeset
    28
" Highlight line with cursor.
db8b30e73baf Highlight line with cursor.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 606
diff changeset
    29
set cursorline
609
0474cf9957c9 Show long lines... Substitude all matches in line.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 608
diff changeset
    30
" Show long lines...
0474cf9957c9 Show long lines... Substitude all matches in line.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 608
diff changeset
    31
set colorcolumn=120
607
db8b30e73baf Highlight line with cursor.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 606
diff changeset
    32
211
c6d56d6fbcc2 A 256 color scheme.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 210
diff changeset
    33
" Hide buffers instead of closing them.
161
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
    34
set hidden
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
    35
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
    36
set mouse=a
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
    37
set mousemodel=popup
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
    38
set mousehide
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
    39
210
d71ad1876c46 Disable these characters as word dividers.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 209
diff changeset
    40
" Number of lines of history to remember
d71ad1876c46 Disable these characters as word dividers.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 209
diff changeset
    41
set history=1000
d71ad1876c46 Disable these characters as word dividers.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 209
diff changeset
    42
" Number of levels of undo history
d71ad1876c46 Disable these characters as word dividers.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 209
diff changeset
    43
set undolevels=1000
d71ad1876c46 Disable these characters as word dividers.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 209
diff changeset
    44
26
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    45
" Same as set ts=4, by default - 8, how long TAB.
25
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
    46
set tabstop=4
26
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    47
" Use spaces instead TAB.
48
514847fa6797 Use spaces instead TAB.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 40
diff changeset
    48
set expandtab
25
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
    49
set shiftwidth=4
48
514847fa6797 Use spaces instead TAB.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 40
diff changeset
    50
set softtabstop=4
25
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
    51
set smarttab
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
    52
set et
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
    53
26
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    54
" Move cursor on RET to previous line indent.
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    55
set autoindent
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    56
" Indent for C-like languages.
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    57
set smartindent
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    58
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    59
" 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
    60
" 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
    61
" brace/parenthese/bracket. I've had almost no mismatched-punctuation errors
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    62
" since I started using this setting.
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    63
set showmatch
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
" Turn on incremental search with ignore case (except explicit caps).
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    66
set incsearch
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    67
set ignorecase
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    68
set smartcase
161
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
    69
set hlsearch
26
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    70
609
0474cf9957c9 Show long lines... Substitude all matches in line.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 608
diff changeset
    71
" Substitude all matches in line.
0474cf9957c9 Show long lines... Substitude all matches in line.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 608
diff changeset
    72
set gdefault
0474cf9957c9 Show long lines... Substitude all matches in line.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 608
diff changeset
    73
nnoremap / /\v
0474cf9957c9 Show long lines... Substitude all matches in line.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 608
diff changeset
    74
vnoremap / /\v
0474cf9957c9 Show long lines... Substitude all matches in line.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 608
diff changeset
    75
606
f21480ec9818 Beep instead of blink.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 547
diff changeset
    76
" Beep instead of blink.
212
6608c5b29815 No audio or visual bell.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 211
diff changeset
    77
set novisualbell
6608c5b29815 No audio or visual bell.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 211
diff changeset
    78
set noerrorbells
6608c5b29815 No audio or visual bell.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 211
diff changeset
    79
27
55688ec975f9 Remove custom status line.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 26
diff changeset
    80
" Have 3 lines of offset (or buffer) when scrolling.
55688ec975f9 Remove custom status line.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 26
diff changeset
    81
set scrolloff=3
161
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
    82
" set scrolljump=3
27
55688ec975f9 Remove custom status line.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 26
diff changeset
    83
26
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    84
" 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
    85
" visual clutter. This option gets rid of the toolbar.
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    86
set guioptions-=T
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    87
608
817b345c30a5 Always show statusline. Remove duplicate code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 607
diff changeset
    88
" Statusline displays the current cursor position.
25
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
    89
set ruler
608
817b345c30a5 Always show statusline. Remove duplicate code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 607
diff changeset
    90
" Always show statusline.
817b345c30a5 Always show statusline. Remove duplicate code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 607
diff changeset
    91
set laststatus=2
25
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
    92
26
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    93
" 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
    94
" 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
    95
" on with :set hls.
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    96
set nohls
7eeb81dc4fc5 Misc vim stuff.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 25
diff changeset
    97
152
7fe989d9decb Bash like completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 48
diff changeset
    98
" 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
    99
" 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
   100
" through completion options so you can complete the file without further
7fe989d9decb Bash like completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 48
diff changeset
   101
" keys.
7fe989d9decb Bash like completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 48
diff changeset
   102
set wildmode=longest,list,full
7fe989d9decb Bash like completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 48
diff changeset
   103
set wildmenu
7fe989d9decb Bash like completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 48
diff changeset
   104
161
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   105
set complete=""
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   106
" From current buffer.
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   107
set complete+=.
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   108
" From dictionary.
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   109
set complete+=k
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   110
" From another buffers.
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   111
set complete+=b
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   112
" From tags.
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   113
set complete+=t
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   114
210
d71ad1876c46 Disable these characters as word dividers.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 209
diff changeset
   115
" Disable these characters as word dividers.
d71ad1876c46 Disable these characters as word dividers.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 209
diff changeset
   116
set iskeyword+=_
d71ad1876c46 Disable these characters as word dividers.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 209
diff changeset
   117
211
c6d56d6fbcc2 A 256 color scheme.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 210
diff changeset
   118
" 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
   119
set backspace=indent,eol,start
c6d56d6fbcc2 A 256 color scheme.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 210
diff changeset
   120
c6d56d6fbcc2 A 256 color scheme.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 210
diff changeset
   121
" Affects the output of :TOhtml.
c6d56d6fbcc2 A 256 color scheme.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 210
diff changeset
   122
:let html_use_css = 1
c6d56d6fbcc2 A 256 color scheme.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 210
diff changeset
   123
:let use_xhtml = 1
c6d56d6fbcc2 A 256 color scheme.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 210
diff changeset
   124
547
ae98c70a1b57 filetype plugin on
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 545
diff changeset
   125
filetype plugin on
ae98c70a1b57 filetype plugin on
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 545
diff changeset
   126
545
3cbd32a78761 Add Python settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 224
diff changeset
   127
au FileType python setlocal tabstop=8 expandtab shiftwidth=4 softtabstop=4
3cbd32a78761 Add Python settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 224
diff changeset
   128
161
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   129
" Fix <Enter> for comment
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   130
" set fo+=cr
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   131
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   132
" set termencoding=cp866
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   133
" set fileencoding=cp1251
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   134
" set fileencodings=cp1251,cp866,utf8
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   135
" set encoding=cp1251
feeb41993549 Add Kryshtop settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 152
diff changeset
   136
25
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
   137
" Local Variables:
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
   138
" mode: fundamental
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
   139
" comment-start: "\""
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
   140
" eval: (font-lock-add-keywords nil '( ("^[[:blank:]]*\".*" . font-lock-comment-face) ))
da1d92e3768d CRLF ==> LF
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 23
diff changeset
   141
" End: