-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
95 lines (72 loc) · 2.74 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
call pathogen#runtime_append_all_bundles()
call pathogen#helptags()
" режим несовместимости с vi
set nocompatible
" размер табуляции
set ts=4
" число пробелов, используемых при автоотступе
set sw=4
" пробелы вместо табуляции
set et
" нумерация строк
set nu
" инкрементальный поиск
set is
" подсветка всех результатов поиска (:noh, чтобы убрать уже подсвеченные
" результаты)
set hlsearch
" автоматическая расстановка отступов
set autoindent
set smartindent
" подсветка синтаксиса
syntax on
" тема для подсветки синтаксиса
colorscheme coniferous
" 256 цветов в консоли
set t_Co=256
" не пищать, только портить:
set noerrorbells
if has('autocmd')
autocmd GUIEnter * set visualbell t_vb=
endif
" хранение всех swap-файлов в одном каталоге
set directory=~/.vim/swap
" возможные кодировки и последовательность определения
set fileencodings=utf8,cp1251
set encoding=utf8
" подсвечивать html-теги внутри строк в PHP
let php_htmlInStrings=1
" подсвечивать SQL внутри строк в PHP
let php_sql_query=1
" сворачивание классов и функций в PHP
let php_folding=1
" переключение раскладок
set keymap=russian-jcukenwin
" английская по умолчанию
set iminsert=0 " при вводе
set imsearch=0 " при поиске
" переключение раскладки по ctrl+l
imap <C-l> <C-^>
nmap <C-l> a<C-l><ESC>
" управление вкладками
nmap <C-tab> :tabnext<cr>
vmap <C-tab> <ESC><C-tab>
imap <C-tab> <ESC><C-tab>
" сохранение по F2
nmap <F2> :w<cr>
imap <F2> <ESC><F2>a
" вставка текущего времени и даты по F5
"nmap <F5> "=strftime("%d-%m-%Y %H:%M:%S")"<CR>P
"imap <F5> <C-R>=strftime("%d-%m-%Y %H:%M:%S")<CR>
" «стандартное» поведение клавиши Home
noremap <expr> <Home> (col('.') == matchend(getline('.'), '^\s*')+1 ? '0' : '^')
"noremap <expr> <End> (col('.') == match(getline('.'), '\s*$') ? '$' : 'g_')
"vnoremap <expr> <End> (col('.') == match(getline('.'), '\s*$') ? '$h' : 'g_')
imap <Home> <C-o><Home>
"imap <End> <C-o><End>
" показывать файловое дерева по нажатию F9
nnoremap <silent> <F9> :NERDTreeToggle <CR>
" нужно для нормальной работы matchit.vim
filetype plugin on
" set spell
" set spelllang=en,ru