" vim: fdm=marker "{{{ Клавиши Leader и LocalLeader let mapleader="\" let maplocalleader="," " Таймауты для ввода комбинаций, использующих клавиши Leader и LocalLeader set timeout timeoutlen=5000 ttimeoutlen=100 "}}} " https://github.com/tpope/vim-pathogen call pathogen#infect() " https://github.com/junegunn/vim-plug " Менеджер плагинов call plug#begin('~/.vim/plugged') " https://github.com/skywind3000/asyncrun.vim " Запуск асинхронных команд Plug 'skywind3000/asyncrun.vim' " https://github.com/mhinz/vim-startify " Стартовый экран Plug 'mhinz/vim-startify' " https://github.com/ryanoasis/vim-devicons " Поддержка иконок Plug 'ryanoasis/vim-devicons' " https://github.com/lyokha/vim-xkbswitch " Автоматическое переключение раскладки клавиатуры в режиме вставки Plug 'lyokha/vim-xkbswitch' " https://github.com/srcery-colors/srcery-vim " Тема srcery Plug 'srcery-colors/srcery-vim' " https://github.com/wellle/context.vim " Отображение контекста Plug 'wellle/context.vim' " https://github.com/itchyny/lightline.vim " Настраиваемая строка состояния " https://github.com/taohexxx/lightline-buffer " Строка с названиями буферов Plug 'itchyny/lightline.vim' | Plug 'taohexxx/lightline-buffer' " https://github.com/Cheeto836/vim-rainbow " Разноцветные скобки Plug 'Cheeto836/vim-rainbow' " https://github.com/ntpeters/vim-better-whitespace " Подсветка лишних пробельных символов Plug 'ntpeters/vim-better-whitespace' " https://github.com/wincent/terminus " Улучшенная поддержка терминала Plug 'wincent/terminus' " https://github.com/Thyrum/vim-stabs " Tab для логической разметки, Space для выравнивания Plug 'Thyrum/vim-stabs' " https://github.com/tpope/vim-commentary " Комментарии Plug 'tpope/vim-commentary' " https://github.com/ctrlpvim/ctrlp.vim " Поиск файлов и буферов Plug 'ctrlpvim/ctrlp.vim' " https://github.com/easymotion/vim-easymotion " Быстрая навигация Plug 'easymotion/vim-easymotion' " https://github.com/haya14busa/incsearch.vim " Поиск Plug 'haya14busa/incsearch.vim' | Plug 'haya14busa/incsearch-easymotion.vim' " https://github.com/mihaifm/bufstop Plug 'mihaifm/bufstop' " https://github.com/moll/vim-bbye " Удаление буферов с сохранением расположения окон Plug 'moll/vim-bbye' " https://github.com/sstallion/vim-wildignore " Чтение масок файлов из файлов wildignore и suffixes Plug 'sstallion/vim-wildignore' " https://github.com/tpope/vim-fugitive " Git " Plug 'tpope/vim-fugitive' " https://github.com/airblade/vim-gitgutter " Отличия от Git в левой колонке Plug 'airblade/vim-gitgutter' " https://github.com/neomake/neomake " Проверка синтаксиса в фоновом режиме Plug 'neomake/neomake' " https://github.com/dense-analysis/ale " Проверка синтаксиса Plug 'dense-analysis/ale' " https://github.com/ciaranm/securemodelines " Настраиваемая поддержка строки режима в файле Plug 'ciaranm/securemodelines' " https://github.com/stephpy/vim-yaml " YAML Plug 'stephpy/vim-yaml' " https://github.com/plasticboy/vim-markdown " Markdown Plug 'plasticboy/vim-markdown' "https://github.com/habamax/vim-asciidoctor " AsciiDoctor Plug 'habamax/vim-asciidoctor' " https://github.com/SirVer/ultisnips " Вставка фрагментов кода Plug 'sirver/ultisnips' " https://github.com/honza/vim-snippets " Библиотека фрагментов кода Plug 'honza/vim-snippets' " https://github.com/aklt/plantuml-syntax " PlantUML Plug 'aklt/plantuml-syntax' " https://github.com/dhruvasagar/vim-table-mode " Создание таблиц Plug 'dhruvasagar/vim-table-mode' " https://github.com/junegunn/vim-easy-align " Выравнивание строк Plug 'junegunn/vim-easy-align' " https://github.com/henry4k/vim-fontzoom " Изменение размера шрифта Plug 'henry4k/vim-fontzoom' " https://dmitryfrank.com/projects/vimprj " Опции для отдельных проектов Plug 'elnull/vim-dfutil' | Plug 'elnull/vimprj' " https://github.com/ilyachur/cmake4vim " CMake Plug 'ilyachur/cmake4vim' " LaTeX Plug 'lervag/vimtex' Plug 'xuhdev/vim-latex-live-preview', { 'for': 'tex' } " https://github.com/jez/vim-superman " MAN Plug 'jez/vim-superman' " https://github.com/kergoth/vim-bitbake " Bitbake Plug 'kergoth/vim-bitbake' " https://github.com/python-mode/python-mode " Python Plug 'python-mode/python-mode', { 'for': 'python', 'branch': 'develop' } " https://github.com/puremourning/vimspector " Multi language graphical debugger Plug 'puremourning/vimspector' " https://github.com/itspriddle/vim-shellcheck " Shell Plug 'itspriddle/vim-shellcheck' Plug 'rhysd/vim-grammarous' " https://github.com/mcchrish/nnn.vim " File manager for vim/neovim powered by n³ Plug 'mcchrish/nnn.vim' " Перечисление плагинов заканчивается здесь call plug#end() "{{{ Базовые настройки " Включена подсветка синтаксиса " Plug устанавливает свои значения, нужно явно переопределить после plug#end syntax on filetype plugin indent on " Выбор движка для регулярных выражений autocmd FileType ruby,tex set regexpengine=1 " Отключен режим совместимости set nocompatible " Проверка изменения файла другой программой set autoread " Автоматическая запись перед make, внешними командами и т.п. set autowrite " Показывать парные скобки set showmatch " Размер табуляции set tabstop=4 " Размер сдвига при нажатии на клавиши << и >> set shiftwidth=4 " Количество пробелов, на которое будет заменена табуляция set softtabstop=4 " Не заменять на пробелы set noexpandtab " Визуальный перенос строк set wrap " Визуальный перенос строк по словам, а не по буквам set linebreak " Визуальный перенос строки с учётом отступов set breakindent " Подсветка выражения, которое ищется в тексте set hlsearch " Переход на найденный текст в процессе набора строки set incsearch " Не останавливать поиск при достижении конца файла set wrapscan " Игнорировать регистр букв при поиске, если в шаблоне нет заглавных букв set smartcase " Копирует отступ от предыдущей строки set autoindent " Автоматическая расстановка отступов set smartindent " По умолчанию не сворачивать set nofoldenable " Сворачивание согласно синтаксису тормозит, нужно использовать что-то другое set foldmethod=marker " Разрешено использование строки режима в файле set modeline " Количество строк, в которых производится поиск команд для настройки режима set modelines=5 " Кодировка внутри Vim set encoding=utf-8 " Кодировка терминала set termencoding=utf-8 " Кодировка для сохраняемого файла set fileencoding=utf-8 " Список предполагаемых кодировок в порядке предпочтения set fileencodings=utf8,koi8r,cp1251,cp866,latin1,ucs-2le " Включаем мышку даже в текстовом режиме " (без этого символы табуляции раскладываются в кучу пробелов) set mouse=a " Модель поведения правой кнопки мыши set mousemodel=popup " Тип переноса строк set fileformat=unix " В графическом режиме: убрать меню set guioptions-=m " В графическом режиме: убрать панель инструментов set guioptions-=T " В графическом режиме: убрать прокрутку справа set guioptions-=r " В графическом режиме: убрать прокрутку слева set guioptions-=L " В графическом режиме: отключить графические вкладки set guioptions-=e " Шрифт в графическом режиме if has('gui_running') && !has('nvim') set guifont=Iosevka\ Fixed\ SS08\ 10 endif " Количество отображаемых строк над/под курсором set scrolloff=6 " Количество отображаемых колонок слева/справа от курсора set sidescrolloff=5 " Нумерация строк включена set number " Нумерация строк абсолютная set nornu " Использовать меню в статусной строке set wildmenu " Клавиша для переключения между пунктами меню set wildcharm= " Всегда отображать статусную строку для каждого окна set laststatus=2 " Отображение набираемой в данный момент команды в правом нижнем углу экрана set showcmd " Пробельные символы set listchars=tab:>·,trail:~,extends:>,precedes:<,space:␣ " Включение отображения пробельных символов set list " Копирование выравнивания от предыдущей строки set copyindent " set clipboard^=unnamed,unnamedplus "}}} map b :Bufstop " get a visual on the buffers map w :BufstopPreview " switch files by moving inside the window map a :BufstopModeFast " a command for quick switching map :BufstopBack map :BufstopForward let g:BufstopAutoSpeedToggle = 1 " now I can press ,3,3,3 to cycle the last 3 buffers let g:BufstopSorting = "none" "{{{ Раскладки клавиатуры let g:XkbSwitchEnabled = 1 let g:XkbSwitchNLayout = 'us' let g:XkbSwitchIMappings = ['ru'] let g:XkbSwitchIMappingsTr = { \ 'ru': \ {'<': 'qwertyuiop[]asdfghjkl;''zxcvbnm,.`/'. \ 'QWERTYUIOP{}ASDFGHJKL:"ZXCVBNM<>?~@#$^&|', \ '>': 'йцукенгшщзхъфывапролджэячсмитьбюё.'. \ 'ЙЦУКЕНГШЩЗХЪФЫВАПРОЛДЖЭЯЧСМИТЬБЮ,Ё"№;:?/'} \ } let g:XkbSwitchSkipIMappings = { \ 'c' : ['.', '>', ':', '{', '/*', '/*'], \ 'cpp' : ['.', '>', ':', '{', '/*', '/*'], \ 'markdown' : ['[', ']', '{', '}', "'", '"', '`', '~'] \ } "}}} "{{{ Цветовая схема kolor https://github.com/zeis/vim-kolor/ " Enable italic. Default: 1 " let g:kolor_italic=0 " Enable bold. Default: 1 " let g:kolor_bold=1 " Enable underline. Default: 0 " let g:kolor_underlined=0 " Gray 'MatchParen' color. Default: 0 " let g:kolor_alternative_matchparen=0 " White foreground 'MatchParen' color that might work better with some terminals. Default: 0 " let g:kolor_inverted_matchparen=0 " colorscheme kolor "}}} "{{{ Цветовая схема srcery https://github.com/srcery-colors/srcery-vim " Enables italic text. " let g:srcery_italic=0 " Enables bold text. let g:srcery_bold=1 " Enables underlined text. let g:srcery_underline=1 " Enables undercurled text. let g:srcery_undercurl=1 " Highlight search matches using inverse colors. let g:srcery_inverse_matches=0 " When enabled will highlight matching delimiters using inverse colors. (:DoMatchParen) let g:srcery_inverse_match_paren=0 colorscheme srcery "}}} "{{{ "highlight SpecialKey guifg=#585858 guibg=NONE gui=none "highlight NonText guifg=#585858 guibg=#2e2d2b gui=none "if &t_Co <= 256 " highlight SpecialKey ctermfg=240 ctermbg=none cterm=none " highlight NonText ctermfg=240 ctermbg=235 cterm=none "endif " Разноцветные скобки для определённых типов файлов autocmd FileType bash,python,vim,html,c,cpp,objc,objcpp call rainbow#load() "}}} "{{{ Подсветка лишних пробельных символов let g:better_whitespace_enabled=1 let g:strip_whitelines_at_eof=1 let g:strip_whitespace_on_save=0 autocmd FileType javascript,c,cpp,java,html,python,ruby,tex,vim EnableStripWhitespaceOnSave "}}} "{{{1 Статусная строка " Всегда отображать статусную строку для каждого окна set laststatus=2 " Всегда отображать перечень буферов set showtabline=2 " \ [ 'fugitive', 'readonly', 'filename', 'modified' ] ], " \ 'fugitive': '%{exists("*fugitive#head")?fugitive#head():""}', " \ 'fugitive': '(exists("*fugitive#head") && ""!=fugitive#head())', " Lightline let g:lightline = { \ 'colorscheme': 'wombat', \ 'active': { \ 'left': [ [ 'filetype' ], \ [ 'mode', 'paste' ], \ [ 'readonly', 'filename', 'modified' ] ], \ 'right': [ [ 'character', 'lineinfo', 'percent' ], [ 'fileformat', 'fileencoding' ], [ 'neomake_errors', 'neomake_warnings' ] ] \ }, \ 'tabline': { \ 'left': [ [ 'bufferinfo' ], \ [ 'separator' ], \ [ 'bufferbefore', 'buffercurrent', 'bufferafter' ], ], \ 'right': [ [ 'close' ], ], \ 'separator': { 'left': '|', 'right': '|' }, \ }, \ 'component': { \ 'readonly': '%{&filetype=="help"?"":&readonly?"⭤":""}', \ 'modified': '%{&filetype=="help"?"":&modified?"+":&modifiable?"":"-"}', \ 'character': '%04B', \ 'separator': '|', \ 'lineinfo': '%3l:%-2v', \ }, \ 'component_function': { \ 'mode': 'LightlineMode', \ 'bufferinfo': 'lightline#buffer#bufferinfo', \ }, \ 'component_visible_condition': { \ 'readonly': '(&filetype!="help"&& &readonly)', \ 'modified': '(&filetype!="help"&&(&modified||!&modifiable))', \ 'neomake_errors': '(exists(":Neomake") && ((get(neomake#statusline#QflistCounts(), "E", 0) + get(neomake#statusline#LoclistCounts(), "E", 0)) > 0)', \ 'neomake_warnings': '(exists(":Neomake") && ((get(neomake#statusline#QflistCounts(), "W", 0) + get(neomake#statusline#LoclistCounts(), "W", 0)) > 0)', \ 'character': '1' \ }, \ 'component_expand': { \ 'buffercurrent': 'lightline#buffer#buffercurrent', \ 'bufferbefore': 'lightline#buffer#bufferbefore', \ 'bufferafter': 'lightline#buffer#bufferafter', \ 'neomake_errors': 'LightLineNeomakeErrors', \ 'neomake_warnings': 'LightLineNeomakeWarnings', \ }, \ 'component_type': { \ 'buffercurrent': 'tabsel', \ 'bufferbefore': 'raw', \ 'bufferafter': 'raw', \ }, \ 'separator': { 'left': '', 'right': '' }, \ 'subseparator': { 'left': '|', 'right': '|' }, \ 'tabline_separator': { 'left': '', 'right': '' }, \ 'tabline_subseparator': { 'left': '|', 'right': '|' }, \ } function! LightlineMode() return expand('%:t') ==# '__Tagbar__' ? 'Tagbar': \ expand('%:t') ==# 'ControlP' ? 'CtrlP' : \ &filetype ==# 'unite' ? 'Unite' : \ &filetype ==# 'vimfiler' ? 'VimFiler' : \ &filetype ==# 'vimshell' ? 'VimShell' : \ winwidth(0) > 60 ? lightline#mode()[0:2] : '' endfunction function! LightLineNeomakeErrors() if !exists(":Neomake") || ((get(neomake#statusline#QflistCounts(), "E", 0) + get(neomake#statusline#LoclistCounts(), "E", 0)) == 0) return '' endif return 'E:'.(get(neomake#statusline#LoclistCounts(), 'E', 0) + get(neomake#statusline#QflistCounts(), 'E', 0)) endfunction function! LightLineNeomakeWarnings() if !exists(":Neomake") || ((get(neomake#statusline#QflistCounts(), "W", 0) + get(neomake#statusline#LoclistCounts(), "W", 0)) == 0) return '' endif return 'W:'.(get(neomake#statusline#LoclistCounts(), 'W', 0) + get(neomake#statusline#QflistCounts(), 'W', 0)) endfunction "1}}} "{{{ Настройка CtrlP let g:ctrlp_custom_ignore = { \ 'dir': '\v[\/](\.(git|hg|svn)|\_site)$', \ 'file': '\v\.(exe|so|dll|class|png|jpg|jpeg)$', \ 'link': 'some_bad_symbolic_links', \ } let g:ctrlp_follow_symlinks = 1 if executable('ag') " Use ag over grep set grepprg=ag\ --nogroup\ --nocolor " Use ag in CtrlP for listing files. Lightning fast and respects .gitignore let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""' " ag is fast enough that CtrlP doesn't need to cache let g:ctrlp_use_caching = 0 endif """ """ Settings from mswin.vim """ if has("clipboard") " CTRL-X and SHIFT-Del are Cut vnoremap "+x vnoremap "+x " CTRL-C and CTRL-Insert are Copy vnoremap "+y vnoremap "+y " CTRL-V and SHIFT-Insert are Paste map "+gP map "+gP cmap + cmap + endif " Pasting blockwise and linewise selections is not possible in Insert and " Visual mode without the +virtualedit feature. They are pasted as if they " were characterwise instead. " Uses the paste.vim autoload script. " Use CTRL-G u to have CTRL-Z only undo the paste. if 1 exe 'inoremap