-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.vimrc
157 lines (127 loc) · 3.27 KB
/
.vimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
" Plugins (Vundle)
if has("user_commands")
" Setting up Vundle - the vim plugin bundler
let VundleInstalled=0
let vundle_readme=expand('~/.vim/bundle/Vundle.vim/README.md')
if !filereadable(vundle_readme)
echo "Installing Vundle.."
echo ""
silent !mkdir -p ~/.vim/bundle
silent !git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/Vundle.vim
let VundleInstalled=1
endif
endif
filetype off
set nocompatible
set rtp+=~/.vim/bundle/Vundle.vim/
call vundle#begin()
" utils
Plugin 'VundleVim/Vundle.vim' " Vundle bundler, https://github.com/VundleVim/Vundle.vim
Plugin 'vim-scripts/IndexedSearch' " Better search message, https://github.com/vim-scripts/IndexedSearch
" files
Plugin 'preservim/nerdtree' " Files tree at left, https://github.com/preservim/nerdtree
Plugin 'jeetsukumaran/vim-buffergator' " Work with buffers as tabs, https://github.com/jeetsukumaran/vim-buffergator
" text
Plugin 'bronson/vim-trailing-whitespace' " Highlight trailing whitespaces, https://github.com/bronson/vim-trailing-whitespace
" syntax
Plugin 'HerringtonDarkholme/yats.vim' " TypeScript, https://github.com/HerringtonDarkholme/yats.vim
Plugin 'tpope/vim-commentary' " Comment command, https://github.com/tpope/vim-commentary
call vundle#end()
filetype plugin indent on
" Config encoding
scriptencoding utf-8
set encoding=utf-8
" General
set ttyfast
set nobackup
set noswapfile
set shell=/bin/bash
set exrc secure
set autoread
set undofile
set undodir=~/.vimundo/
set hidden
set history=1000
set autoread
set re=0
" Mouse
let does_tmux_mouse_enabled=exists('$TMUX') && trim(system('tmux show-option -gv mouse')) == 'on'
if does_tmux_mouse_enabled
set mouse=a
else
set mouse=
endif
" Display
set t_Co=256
set t_ut=
set title
set novisualbell
set nowrap
set scrolloff=3
set sidescroll=5
set sidescrolloff=5
set showcmd
set nostartofline
if has("autocmd")
" Remember last position in file
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
endif
" Highlight
syntax on
set lazyredraw
" Colors
" recommended: default, desert, torte, pablo, koehler, murphy
color default
map <F11> :color desert<CR>
" Status
set laststatus=2
set statusline=[%n]\ %t\ \|\ %Y\ %{&encoding}\ %{&ff}\ \|\ Len\ %L\ \|\ Pos\ %03l:%03v\ %p%%\ %=%<%F\ %m%r%h%q%w
highlight StatusLine ctermfg=lightgray ctermbg=black
" Text format
set termencoding=utf-8
set fileformats=unix,dos,mac
set fileencoding=utf-8
set fileencodings=utf-8,ucs-2,cp1251,cp866,koi8-r
set backspace=indent,eol,start
set textwidth=0
set spelllang=en,ru
" Indents
set tabstop=4
set shiftwidth=4
set smarttab
set expandtab
set autoindent
set smartindent
set cindent
set shiftround
set pastetoggle=<leader>p
" Code
set completeopt=menu,preview
set infercase
set showmatch
set matchpairs+=<:>
set wildmenu
set wildcharm=<TAB>
" Search
set smartcase
set incsearch
set hlsearch
set gdefault
map <F4> :noh<CR>
" Diff
set diffopt=filler
set diffopt+=horizontal
set diffopt+=iwhite
" Commands
" reload .vimrc
map <F2> :NERDTreeToggle<CR>
map <F3> :BuffergatorToggle<CR>
map <F12> :so $MYVIMRC<CR>
let NERDTreeShowHidden=1
" Enable .vimrc.extra
if has("user_commands")
let vimrc_extra=expand('~/.vimrc.extra')
if filereadable(vimrc_extra)
execute 'source '.vimrc_extra
endif
endif