Compare Pastes

Differences between the pastes #270588 (31.08.2023 01:42) and #270589 (31.08.2023 01:43).
1
" Bootstrap Plug
2
let autoload_plug_path = stdpath('config') . '/autoload/plug.vim'
3
if !filereadable(autoload_plug_path)
4
  silent execute '!curl -fLo ' . autoload_plug_path . '  --create-dirs
5
      \ "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim"'
6
  autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
7
endif
8
unlet autoload_plug_path
9
let g:plugged_home = stdpath('config') . '/plugged'
10
11
" Plugins List
12
call plug#begin(g:plugged_home)
13
    " UI related
14
    " Plug 'junegunn/fzf.vim'
15
    Plug 'base16-project/base16-vim'
16
    Plug 'itchyny/lightline.vim'
17
    " Better Visual Guide
18
    Plug 'Yggdroot/indentLine'
19
    " syntax check
20
    Plug 'w0rp/ale'
21
    " Autocomplete
22
    Plug 'ncm2/ncm2'
23
    Plug 'roxma/nvim-yarp'
24
    Plug 'ncm2/ncm2-bufword'
25
    Plug 'ncm2/ncm2-path'
26
    Plug 'ncm2/ncm2-jedi'
27
    " Formater
28
    Plug 'stsewd/isort.nvim', { 'do': ':UpdateRemotePlugins' }
29
    Plug 'Chiel92/vim-autoformat'
30
    Plug 'tpope/vim-surround'
31
    Plug 'tpope/vim-commentary'
32
    Plug 'mrk21/yaml-vim'
33
    Plug 'lepture/vim-jinja'
34
    " Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
35
    Plug 'hashivim/vim-terraform'
36
call plug#end()
37
38
filetype plugin indent on
39
40
" Configurations Part
41
" UI configuration
42
syntax on
43
syntax enable
44
" colorscheme
45
let base16colorspace=256
46
colorscheme base16-gruvbox-dark-hard
47
set background=dark
48
" True Color Support if it's avaiable in terminal
49
if has("termguicolors")
50
    set termguicolors
51
endif
52
if has("gui_running")
53
    set guicursor=n-v-c-sm:block,i-ci-ve:block,r-cr-o:blocks
54
endif
55
set clipboard+=unnamedplus
56
set number
57
set relativenumber
58
set hidden
59
set mouse=a
60
set noshowmode
61
set noshowmatch
62
set nolazyredraw
63
" Turn off backup
64
set nobackup
65
set noswapfile
66
set nowritebackup
67
" Search configuration
68
set ignorecase                    " ignore case when searching
69
set smartcase                     " turn on smartcase
70
" Tab and Indent configuration
71
set expandtab
72
set tabstop=4
73
set shiftwidth=4
74
set colorcolumn=+1
75
set backspace=indent,eol,start
76
set cursorline
77
set textwidth=100
78
set list listchars=tab:\|\ ,extends:›,precedes:‹,nbsp:·,trail:·
79
" Folding
80
" set foldmethod=syntax
81
set foldnestmax=10
82
set nofoldenable
83
set foldlevel=1
84
set fillchars=fold:\ 
85
86
" Python
87
let g:python3_host_prog = '~/src/python/.nvim/bin/python'
88
let g:loaded_python_provider = 0
89
90
" Ruby
91
let g:loaded_ruby_provider = 0
92
93
" Perl
94
let g:loaded_perl_provider = 0
95
96
" Node.Js
97
let g:loaded_node_provider = 0
98
99
function! MyFoldText()
100
    let indent_level = indent(v:foldstart)
101
    let indent = repeat(' ',indent_level)
102
    " setting fold text
103
    let nl = v:foldend - v:foldstart + 1
104
    let comment = substitute(getline(v:foldstart),"^ *","",1)
105
    let linetext = substitute(getline(v:foldstart+1),"^ *","",1)
106
    let txt = indent . '+  Скрыто: ' . nl .  ' строк'
107
    return txt
108
endfunction
109
set foldtext=MyFoldText()
110
111
let g:indentLine_char_list = ['|', '¦', '┆', '┊']
112
113
" Hightlighting extra chars and spaces
114
highlight ExtraWhitespace ctermfg=124 guifg=#cc241d
115
match ExtraWhitespace /\s\+$/
116
autocmd BufWinEnter * match ExtraWhitespace /\s\+$/
117
autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@
118
autocmd InsertLeave * match ExtraWhitespace /\s\+$/
119
autocmd BufWinLeave * call clearmatches()
120
121
" --- Bundles settings
122
"  netrw (File Manager)
123
let g:netrw_liststyle=3
124
let g:netrw_brows_split = 4
125
let g:netrw_altv = 1
126
let g:netrw_winsize = -32
127
let g:netrw_banner = 0
128
let g:netrw_list_hide='.*\.swp$,.*\.pyc$,^\.git/$,^__pycache__/$,.*\.egg-info/$,^\.env/$'
129
let g:netrw_sizestyle="h"
130
let g:netrw_hide = 1
131
132
noremap i :Isort
133
noremap ' :Lex
134
let g:go_fmt_command = "goimports"
135
let g:go_auto_type_info = 1
136
map  :cnext
137
map  :cprevious
138
nnoremap a :cclose
139
autocmd FileType go nmap b  (go-build)
140
autocmd FileType go nmap r  (go-run)
141
142
143
" Ale
144
let g:ale_lint_on_enter = 0
145
let g:ale_lint_on_text_changed = 'never'
146
let g:ale_echo_msg_error_str = 'E'
147
let g:ale_echo_msg_warning_str = 'W'
148
let g:ale_echo_msg_format = '[%linter%] %s [%severity%]'
149
let g:ale_linters = {'python': ['flake8']}
150
let g:ale_sign_warning = '▲'
151
let g:ale_sign_error = '✗'
152
highlight link ALEWarningSign String
153
highlight link ALEErrorSign Title
154
155
nmap   (ale_previous_wrap)
156
nmap   (ale_next_wrap)
157
158
" Lightline
159
let g:lightline = {
160
            \ 'colorscheme': 'seoul256',
161
            \ 'active': {
162
            \   'left': [['mode', 'paste'], ['filename', 'modified']],
163
            \   'right': [['lineinfo'], ['percent'], ['readonly', 'linter_warnings', 'linter_errors', 'linter_ok']]
164
            \ },
165
            \ 'component_expand': {
166
            \   'linter_warnings': 'LightlineLinterWarnings',
167
            \   'linter_errors': 'LightlineLinterErrors',
168
            \   'linter_ok': 'LightlineLinterOK'
169
            \ },
170
            \ 'component_type': {
171
            \   'readonly': 'error',
172
            \   'linter_warnings': 'warning',
173
            \   'linter_errors': 'error'
174
            \ },
175
            \ }
176
177
function! LightlineLinterWarnings() abort
178
    let l:counts = ale#statusline#Count(bufnr(''))
179
    let l:all_errors = l:counts.error + l:counts.style_error
180
    let l:all_non_errors = l:counts.total - l:all_errors
181
    return l:counts.total == 0 ? '' : printf('%d ◆', all_non_errors)
182
endfunction
183
function! LightlineLinterErrors() abort
184
    let l:counts = ale#statusline#Count(bufnr(''))
185
    let l:all_errors = l:counts.error + l:counts.style_error
186
    let l:all_non_errors = l:counts.total - l:all_errors
187
    return l:counts.total == 0 ? '' : printf('%d ✗', all_errors)
188
endfunction
189
function! LightlineLinterOK() abort
190
    let l:counts = ale#statusline#Count(bufnr(''))
191
    let l:all_errors = l:counts.error + l:counts.style_error
192
    let l:all_non_errors = l:counts.total - l:all_errors
193
    return l:counts.total == 0 ? '✓ ' : ''
194
endfunction
195
196
" Update and show lightline but only if it's visible (e.g., not in Goyo)
197
autocmd User ALELint call s:MaybeUpdateLightline()
198
function! s:MaybeUpdateLightline()
199
    if exists('#lightline')
200
        call lightline#update()
201
    end
202
endfunction
203
204
" vim-autoformat
205
noremap  :Autoformat
206
" NCM2
207
augroup NCM2
208
    autocmd!
209
    autocmd BufEnter * call ncm2#enable_for_buffer()
210
    set completeopt=noinsert,menuone,noselect
211
    inoremap   (pumvisible() ? "\\" : "\")
212
augroup END
213
214
au BufEnter,BufNewFile,BufRead *.py  set ts=4 sw=4 tw=79 sta et fo=croql ai ff=unix foldmethod=indent
215
" add yaml stuffs
216
au! BufNewFile,BufReadPost *.{yaml,yml} set filetype=yaml foldmethod=indent
217
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
218
219
au BufNewFile,BufRead *.j2 set ft=jinja
1
" Bootstrap Plug
2
let autoload_plug_path = stdpath('config') . '/autoload/plug.vim'
3
if !filereadable(autoload_plug_path)
4
  silent execute '!curl -fLo ' . autoload_plug_path . '  --create-dirs
5
      \ "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim"'
6
  autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
7
endif
8
unlet autoload_plug_path
9
let g:plugged_home = stdpath('config') . '/plugged'
10
11
" Plugins List
12
call plug#begin(g:plugged_home)
13
    " UI related
14
    " Plug 'junegunn/fzf.vim'
15
    Plug 'base16-project/base16-vim'
16
    Plug 'itchyny/lightline.vim'
17
    " Better Visual Guide
18
    Plug 'Yggdroot/indentLine'
19
    " syntax check
20
    Plug 'w0rp/ale'
21
    " Autocomplete
22
    Plug 'ncm2/ncm2'
23
    Plug 'roxma/nvim-yarp'
24
    Plug 'ncm2/ncm2-bufword'
25
    Plug 'ncm2/ncm2-path'
26
    Plug 'ncm2/ncm2-jedi'
27
    " Formater
28
    Plug 'stsewd/isort.nvim', { 'do': ':UpdateRemotePlugins' }
29
    Plug 'Chiel92/vim-autoformat'
30
    Plug 'tpope/vim-surround'
31
    Plug 'tpope/vim-commentary'
32
    Plug 'mrk21/yaml-vim'
33
    Plug 'lepture/vim-jinja'
34
    " Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
35
    Plug 'hashivim/vim-terraform'
36
call plug#end()
37
38
filetype plugin indent on
39
40
" Configurations Part
41
" UI configuration
42
syntax on
43
syntax enable
44
" colorscheme
45
let base16colorspace=256
46
colorscheme base16-gruvbox-dark-hard
47
set background=dark
48
" True Color Support if it's avaiable in terminal
49
if has("termguicolors")
50
    set termguicolors
51
endif
52
if has("gui_running")
53
    set guicursor=n-v-c-sm:block,i-ci-ve:block,r-cr-o:blocks
54
endif
55
set clipboard+=unnamedplus
56
set number
57
set relativenumber
58
set hidden
59
set mouse=a
60
set noshowmode
61
set noshowmatch
62
set nolazyredraw
63
" Turn off backup
64
set nobackup
65
set noswapfile
66
set nowritebackup
67
" Search configuration
68
set ignorecase                    " ignore case when searching
69
set smartcase                     " turn on smartcase
70
" Tab and Indent configuration
71
set expandtab
72
set tabstop=4
73
set shiftwidth=4
74
set colorcolumn=+1
75
set backspace=indent,eol,start
76
set cursorline
77
set textwidth=100
78
set list listchars=tab:\|\ ,extends:›,precedes:‹,nbsp:·,trail:·
79
" Folding
80
" set foldmethod=syntax
81
set foldnestmax=10
82
set nofoldenable
83
set foldlevel=1
84
set fillchars=fold:\ 
85
86
" Python
87
let g:python3_host_prog = '~/src/python/.nvim/bin/python'
88
let g:loaded_python_provider = 0
89
90
" Ruby
91
let g:loaded_ruby_provider = 0
92
93
" Perl
94
let g:loaded_perl_provider = 0
95
96
" Node.Js
97
let g:loaded_node_provider = 0
98
99
function! MyFoldText()
100
    let indent_level = indent(v:foldstart)
101
    let indent = repeat(' ',indent_level)
102
    " setting fold text
103
    let nl = v:foldend - v:foldstart + 1
104
    let comment = substitute(getline(v:foldstart),"^ *","",1)
105
    let linetext = substitute(getline(v:foldstart+1),"^ *","",1)
106
    let txt = indent . '+  Скрыто: ' . nl .  ' строк'
107
    return txt
108
endfunction
109
set foldtext=MyFoldText()
110
111
let g:indentLine_char_list = ['|', '¦', '┆', '┊']
112
113
" Hightlighting extra chars and spaces
114
highlight ExtraWhitespace ctermfg=124 guifg=#cc241d
115
match ExtraWhitespace /\s\+$/
116
autocmd BufWinEnter * match ExtraWhitespace /\s\+$/
117
autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@
118
autocmd InsertLeave * match ExtraWhitespace /\s\+$/
119
autocmd BufWinLeave * call clearmatches()
120
121
" --- Bundles settings
122
"  netrw (File Manager)
123
let g:netrw_liststyle=3
124
let g:netrw_brows_split = 4
125
let g:netrw_altv = 1
126
let g:netrw_winsize = -32
127
let g:netrw_banner = 0
128
let g:netrw_list_hide='.*\.swp$,.*\.pyc$,^\.git/$,^__pycache__/$,.*\.egg-info/$,^\.env/$'
129
let g:netrw_sizestyle="h"
130
let g:netrw_hide = 1
131
132
noremap i :Isort
133
noremap ' :Lex
134
let g:go_fmt_command = "goimports"
135
let g:go_auto_type_info = 1
136
map  :cnext
137
map  :cprevious
138
nnoremap a :cclose
139
autocmd FileType go nmap b  (go-build)
140
autocmd FileType go nmap r  (go-run)
141
142
143
" Ale
144
let g:ale_lint_on_enter = 0
145
let g:ale_lint_on_text_changed = 'never'
146
let g:ale_echo_msg_error_str = 'E'
147
let g:ale_echo_msg_warning_str = 'W'
148
let g:ale_echo_msg_format = '[%linter%] %s [%severity%]'
149
let g:ale_linters = {'python': ['flake8']}
150
let g:ale_sign_warning = '▲'
151
let g:ale_sign_error = '✗'
152
highlight link ALEWarningSign String
153
highlight link ALEErrorSign Title
154
155
nmap   (ale_previous_wrap)
156
nmap   (ale_next_wrap)
157
158
" Lightline
159
let g:lightline = {
160
            \ 'colorscheme': 'seoul256',
161
            \ 'active': {
162
            \   'left': [['mode', 'paste'], ['filename', 'modified']],
163
            \   'right': [['lineinfo'], ['percent'], ['readonly', 'linter_warnings', 'linter_errors', 'linter_ok']]
164
            \ },
165
            \ 'component_expand': {
166
            \   'linter_warnings': 'LightlineLinterWarnings',
167
            \   'linter_errors': 'LightlineLinterErrors',
168
            \   'linter_ok': 'LightlineLinterOK'
169
            \ },
170
            \ 'component_type': {
171
            \   'readonly': 'error',
172
            \   'linter_warnings': 'warning',
173
            \   'linter_errors': 'error'
174
            \ },
175
            \ }
176
177
function! LightlineLinterWarnings() abort
178
    let l:counts = ale#statusline#Count(bufnr(''))
179
    let l:all_errors = l:counts.error + l:counts.style_error
180
    let l:all_non_errors = l:counts.total - l:all_errors
181
    return l:counts.total == 0 ? '' : printf('%d ◆', all_non_errors)
182
endfunction
183
function! LightlineLinterErrors() abort
184
    let l:counts = ale#statusline#Count(bufnr(''))
185
    let l:all_errors = l:counts.error + l:counts.style_error
186
    let l:all_non_errors = l:counts.total - l:all_errors
187
    return l:counts.total == 0 ? '' : printf('%d ✗', all_errors)
188
endfunction
189
function! LightlineLinterOK() abort
190
    let l:counts = ale#statusline#Count(bufnr(''))
191
    let l:all_errors = l:counts.error + l:counts.style_error
192
    let l:all_non_errors = l:counts.total - l:all_errors
193
    return l:counts.total == 0 ? '✓ ' : ''
194
endfunction
195
196
" Update and show lightline but only if it's visible (e.g., not in Goyo)
197
autocmd User ALELint call s:MaybeUpdateLightline()
198
function! s:MaybeUpdateLightline()
199
    if exists('#lightline')
200
        call lightline#update()
201
    end
202
endfunction
203
204
" vim-autoformat
205
noremap  :Autoformat
206
" NCM2
207
augroup NCM2
208
    autocmd!
209
    autocmd BufEnter * call ncm2#enable_for_buffer()
210
    set completeopt=noinsert,menuone,noselect
211
    inoremap   (pumvisible() ? "\\" : "\")
212
augroup END
213
214
au BufEnter,BufNewFile,BufRead *.py  set ts=4 sw=4 tw=79 sta et fo=croql ai ff=unix foldmethod=indent
215
" add yaml stuffs
216
au! BufNewFile,BufReadPost *.{yaml,yml} set filetype=yaml foldmethod=indent
217
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
218
219
au BufNewFile,BufRead *.j2 set ft=jinja