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