1
0
Fork 0
vim-rc/vimrc

108 lines
2.9 KiB
VimL
Raw Normal View History

"Функция получения текущего режима редактора
function GetMode()
let l:editor_mode = mode()
let l:editor_modes_list = [
\ "NORMAL",
\ "COMMAND",
\ "INSERT",
\ "VISUAL",
\ "VISUAL-LINE",
\ "VISUAL-BLOCK",
\ "REPLACE"
\ ]
if l:editor_mode == "n"
return l:editor_modes_list[0]
elseif l:editor_mode == "c"
return l:editor_modes_list[1]
elseif l:editor_mode == "i"
return l:editor_modes_list[2]
elseif l:editor_mode == "v"
return l:editor_modes_list[3]
elseif l:editor_mode == "V"
return l:editor_modes_list[4]
elseif l:editor_mode =="\<C-v>"
return l:editor_modes_list[5]
elseif l:editor_mode == "R"
return l:editor_modes_list[6]
else
echo l:editor_mode
return "?MODE"
endif
endfunction
"Менеджер плагинов: Vim-Plug
"Подключение плагинов (для установки - :PlugInstal)
call plug#begin('~/.vim/plugged')
Plug 'airblade/vim-gitgutter'
call plug#end()
"Включаем подсветку синтаксиса
2021-02-04 13:20:02 +03:00
syntax on
2020-10-20 23:14:27 +03:00
set nocompatible
" Включение поддержки мыши
"set mouse=a
2020-10-20 23:14:27 +03:00
2020-10-05 09:41:03 +03:00
set encoding=utf8
"Включает колонку нумерации строк
set number
set numberwidth=4
set cursorline
2020-10-05 09:41:03 +03:00
"Не показывать режим (он отображается в нашей строке статуса)
set noshowmode
"Настройки строки статуса
2020-10-05 09:41:03 +03:00
set laststatus=2
set statusline=
set statusline+=%#StatusLineEditorMode#\ %{GetMode()}\
set statusline+=%#StatusLineFileName#\ %f\
set statusline+=%#StatusLineFileFormat#\ %{&ff}\
set statusline+=%#StatusLineEmpty#%=
set statusline+=%#StatusLineReadOnlyFlag#\ %r\
set statusline+=%#StatusLineEncoding#\ %{&fileencoding?&fileencoding:&encoding}\
set statusline+=%#StatusLineFileType#\ %{&ft}\
set statusline+=%#StatusLinePosition#\ %p%%\ %l:%c\
2020-10-05 09:41:03 +03:00
"Выключает перенос строк
set nowrap
"Автоподстановка табов
set smarttab
"Замена табов на пробелы
set expandtab
"Установка отступа на 4 символа
set tabstop=4
set shiftwidth=4
set softtabstop=4
"Автодополнение отступов
set autoindent
set smartindent
"Кеймапы для запуска Python скриптов
autocmd BufRead *.py nmap <F5> :!python3 %<CR>
autocmd BufRead *.py nmap <F6> :!sudo python3 %<CR>
autocmd BufRead *.py nmap <F9> :!pycodestyle %<CR>
2020-10-05 09:41:03 +03:00
"Кеймапы запуска Bash скриптов
autocmd BufRead *.sh nnoremap <F5> :!bash %<CR>
2021-02-04 13:20:02 +03:00
"Перенос сток для .md файлов
autocmd BufRead *.md set wrap
2020-10-05 09:41:03 +03:00
"Кеймапы обновления темы vim
autocmd BufRead *.vim nnoremap <F5> :source %<CR>
2020-10-05 09:41:03 +03:00
"Установка своей цветовой схемы
2021-09-13 08:23:54 +03:00
colorscheme custom_scheme_dark