first vim configs: statusline + yaml configs
This commit is contained in:
@@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
- link:
|
- link:
|
||||||
~/.tmux.conf: tmux.conf
|
~/.tmux.conf: tmux.conf
|
||||||
|
~/.vim: vim
|
||||||
|
|
||||||
- shell:
|
- shell:
|
||||||
- [git submodule update --init --recursive, Installing submodules]
|
- [git submodule update --init --recursive, Installing submodules]
|
||||||
|
|||||||
1
vim/.gitignore
vendored
Normal file
1
vim/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
bundle/*
|
||||||
2812
vim/autoload/plug.vim
Normal file
2812
vim/autoload/plug.vim
Normal file
File diff suppressed because it is too large
Load Diff
1
vim/ftplugin/eyaml/folding.vim
Symbolic link
1
vim/ftplugin/eyaml/folding.vim
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../yaml/folding.vim
|
||||||
1
vim/ftplugin/raml/folding.vim
Symbolic link
1
vim/ftplugin/raml/folding.vim
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../yaml/folding.vim
|
||||||
1
vim/ftplugin/sls/folding.vim
Symbolic link
1
vim/ftplugin/sls/folding.vim
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../yaml/folding.vim
|
||||||
38
vim/ftplugin/yaml/folding.vim
Normal file
38
vim/ftplugin/yaml/folding.vim
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
function! YamlFolds()
|
||||||
|
let previous_level = indent(prevnonblank(v:lnum - 1)) / &shiftwidth
|
||||||
|
let current_level = indent(v:lnum) / &shiftwidth
|
||||||
|
let next_level = indent(nextnonblank(v:lnum + 1)) / &shiftwidth
|
||||||
|
|
||||||
|
if getline(v:lnum + 1) =~ '^\s*$'
|
||||||
|
return "="
|
||||||
|
|
||||||
|
elseif current_level < next_level
|
||||||
|
return next_level
|
||||||
|
|
||||||
|
elseif current_level > next_level
|
||||||
|
return ('s' . (current_level - next_level))
|
||||||
|
|
||||||
|
elseif current_level == previous_level
|
||||||
|
return "="
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
|
return next_level
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! YamlFoldText()
|
||||||
|
let lines = v:foldend - v:foldstart
|
||||||
|
return getline(v:foldstart) . ' (level ' . v:foldlevel . ', lines ' . lines . ')'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
setlocal foldmethod=expr
|
||||||
|
setlocal foldexpr=YamlFolds()
|
||||||
|
setlocal foldtext=YamlFoldText()
|
||||||
|
|
||||||
|
|
||||||
|
let b:undo_ftplugin =
|
||||||
|
\ exists('b:undo_ftplugin')
|
||||||
|
\ ? b:undo_ftplugin . ' | '
|
||||||
|
\ : ''
|
||||||
|
\ . 'setlocal foldexpr< foldmethod< foldtext<'
|
||||||
35
vim/vimrc
Normal file
35
vim/vimrc
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
filetype plugin indent on "Включает определение типа файла, загрузку...
|
||||||
|
"... соответствующих ему плагинов и файлов отступов
|
||||||
|
set encoding=utf-8 "Ставит кодировку UTF-8
|
||||||
|
" set nocompatible "Отключает обратную совместимость с Vi
|
||||||
|
syntax enable "Включает подсветку синтаксиса
|
||||||
|
set term=xterm-256color
|
||||||
|
|
||||||
|
" Folding params
|
||||||
|
set foldlevelstart=20
|
||||||
|
" Folding toggle hotkey remap
|
||||||
|
nnoremap <Space> za
|
||||||
|
|
||||||
|
if empty(glob('~/.vim/autoload/plug.vim')) "Если vim-plug не стоит
|
||||||
|
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
|
||||||
|
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
||||||
|
"И скачать его оттуда
|
||||||
|
"А после прогнать команду PlugInstall, о которой мы сейчас поговорим
|
||||||
|
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
|
||||||
|
endif
|
||||||
|
|
||||||
|
call plug#begin('~/.vim/bundle') "Начать искать плагины в этой директории
|
||||||
|
Plug 'vim-airline/vim-airline'
|
||||||
|
Plug 'Yggdroot/indentLine'
|
||||||
|
call plug#end() "Перестать это делать
|
||||||
|
|
||||||
|
" To enable powerfonts you first need to install it system-wide: https://github.com/ryanoasis/nerd-fonts#font-installation
|
||||||
|
" Then you need to enable Non-ASCII font displaying on your terminal settings
|
||||||
|
let g:airline_powerline_fonts = 1 "Включить поддержку Powerline шрифтов
|
||||||
|
let g:airline#extensions#keymap#enabled = 0 "Не показывать текущий маппинг
|
||||||
|
let g:airline_section_z = "\ue0a1:%l/%L Col:%c" "Кастомная графа положения курсора
|
||||||
|
let g:Powerline_symbols='unicode' "Поддержка unicode
|
||||||
|
|
||||||
|
" YAML files config
|
||||||
|
autocmd FileType yaml,yml setlocal ts=2 sts=2 sw=2 expandtab
|
||||||
|
let g:indentLine_char = '⦙'
|
||||||
Reference in New Issue
Block a user