]>
Commit | Line | Data |
---|---|---|
1 | source $VIMRUNTIME/defaults.vim | |
2 | ||
3 | let x = ($XDG_CONFIG_HOME??($HOME.'/.config')).'/vim' | |
4 | execute 'set runtimepath='.x.','.&runtimepath.','.x.'/after' | |
5 | execute 'set packpath='.x.','.&packpath.','.x.'/after' | |
6 | ||
7 | packadd matchit | |
8 | ||
9 | let x = ($XDG_STATE_HOME??($HOME.'/.local/state')).'/vim' | |
10 | if !isdirectory(x) | |
11 | call mkdir(x, 'p', 0700) | |
12 | endif | |
13 | execute 'set viminfofile='.x.'/.viminfo' | |
14 | ||
15 | let y = x.'/swap' | |
16 | if !isdirectory(y) | |
17 | call mkdir(y, 'p', 0700) | |
18 | endif | |
19 | execute 'set directory='.y.'//' | |
20 | ||
21 | let y = x.'/backup' | |
22 | if !isdirectory(y) | |
23 | call mkdir(y, 'p', 0700) | |
24 | endif | |
25 | set backup | |
26 | execute 'set backupdir='.y.'//' | |
27 | set backupcopy=yes | |
28 | ||
29 | let y = x.'/undo' | |
30 | if !isdirectory(y) | |
31 | call mkdir(y, 'p', 0700) | |
32 | endif | |
33 | set undofile | |
34 | execute 'set undodir='.y.'//' | |
35 | ||
36 | unlet x | |
37 | unlet y | |
38 | ||
39 | set autoindent | |
40 | set colorcolumn=80 | |
41 | highlight ColorColumn term=NONE ctermbg=0 | |
42 | autocmd FileType python setlocal tabstop=4 shiftwidth=4 expandtab | |
43 | autocmd FileType markdown setlocal tabstop=4 shiftwidth=4 expandtab | |
44 | autocmd FileType javascript setlocal tabstop=2 shiftwidth=2 expandtab | |
45 | autocmd FileType json setlocal tabstop=2 shiftwidth=2 expandtab | |
46 | autocmd FileType html setlocal tabstop=2 shiftwidth=2 expandtab | |
47 | autocmd FileType todo setlocal colorcolumn=0 | |
48 | ||
49 | set cursorline | |
50 | set hlsearch | |
51 | set list | |
52 | set listchars=tab:├─,extends:»,precedes:«,space:·,trail:∙,nbsp:■ | |
53 | set number | |
54 | set relativenumber | |
55 | autocmd InsertEnter * setlocal norelativenumber | |
56 | autocmd InsertLeave * setlocal relativenumber | |
57 | autocmd FocusLost * setlocal norelativenumber | |
58 | autocmd FocusGained * setlocal relativenumber | |
59 | highlight WhiteSpaceBol ctermfg=DarkBlue | |
60 | highlight WhiteSpaceMol ctermfg=Black | |
61 | match WhiteSpaceMol / / | |
62 | 2match WhiteSpaceBol /\(^ \+\)\|\( \+$\)/ | |
63 | ||
64 | let g:EditorConfig_enable_for_new_buf = 1 |