-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.vimrc
130 lines (112 loc) · 2.99 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
" settings {{{
syntax enable
set synmaxcol=210
set encoding=utf-8
set backspace=indent,eol,start
set hidden
set visualbell
set t_vb=
set noswapfile
set wildmenu
set path+=**
" set wildignore+=**/node_modules/**
set isfname+=@-@
set suffixesadd=.js,.ts,.tsx
set lazyredraw
" }}}
" undo history {{{
if !isdirectory($HOME.'/.vim/undo')
call mkdir($HOME.'/.vim/undo', 'p')
endif
set undofile
set undodir=$HOME/.vim/undo
" }}}
" terminal {{{
set notitle
set icon
" }}}
" editing {{{
set autoindent
set smartindent
set smarttab
set smartcase
set ignorecase
set expandtab
set tabstop=4
set shiftwidth=4
set scrolloff=30
set colorcolumn=80
set nowrap
set linebreak
set cursorline
set showmatch
set list
set listchars=tab:→\ ,trail:·,extends:❯,precedes:❮,nbsp:×
" }}}
" statusline {{{
set laststatus=2
set statusline=:b%n\ %<%F\ %h%m%r%=%-8.(%l,%c%V%)\ %P
" }}}
" file types {{{
autocmd FileType markdown setlocal wrap
autocmd FileType javascript setlocal suffixesadd=.js
autocmd FileType typescript setlocal suffixesadd=.ts,.tsx,.d.ts
autocmd FileType python setlocal softtabstop=4 tabstop=4 shiftwidth=4 textwidth=79
autocmd FileType yaml setlocal softtabstop=2 tabstop=2 shiftwidth=2
" }}}
" search {{{
set incsearch
set hlsearch
" }}}
" folding {{{
set foldmethod=syntax
autocmd FileType vim,text setlocal foldmethod=marker
" }}}
" spell {{{
" http://www.opennet.ru/base/X/vim_orfo.txt.html
set spell spelllang=en,ru
" }}}
" buffers {{{
nnoremap <Leader>[ :bprev<cr>
nnoremap <Leader>] :bnext<cr>
" }}}
" [p]aste mode {{{
set pastetoggle=<Leader>p
" }}}
" [b]lame {{{
" In Visual mode exec git blame with selected text
vnoremap <Leader>b :<C-U>!git blame <C-R>=expand("%:p") <CR> \| sed -n <C-R>=line("'<") <CR>,<C-R>=line("'>") <CR>p <CR>
" }}}
" ya [p]aste {{{
" In Visual mode exec ya paste with selected text
vnoremap <Leader>p :<C-U>!ya paste <(cat <C-R>=expand("%:p") <CR> \| sed -n <C-R>=line("'<") <CR>,<C-R>=line("'>") <CR>p )<CR>
" }}}
" Load previous session {{{
" Only available when compiled with the +viminfo feature
" set viminfo='10,\"100,:20,%,n~/.viminfo
" }}}
" Set cursor to its last position {{{
autocmd BufReadPost * if line("'\"") > 0|if line("'\"") <= line("$")|exe("norm '\"")|else|exe "norm $"|endif|endif
" }}}
" Auto change the directory to the current file I'm working on {{{
" autocmd BufEnter * lcd %:p:h
" }}}
" Убирает тормоза при работе с большими файлами {{{
autocmd BufEnter * call clearmatches()
autocmd BufWinEnter * if line2byte(line("$") + 1) > 1000000 | syntax clear | setlocal nospell | endif
" }}}
" Netrw {{{
let g:netrw_banner=0
let g:netrw_localrmdir='rm -r'
let g:netrw_keepdir=0
" }}}
" ALE {{{
" https://github.com/dense-analysis/ale
" Установка:
" mkdir -p ~/.vim/pack/git-plugins/start
" git clone --depth 1 https://github.com/dense-analysis/ale.git ~/.vim/pack/git-plugins/start/ale
set omnifunc=ale#completion#OmniFunc
"let g:ale_completion_enabled=1
"let g:ale_lint_on_text_changed='never'
"let g:ale_lint_on_insert_leave=0
" }}}