]>
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_DATA_HOME??($HOME."/.local/share"))."/vim" | |
10 | if !isdirectory(x) | |
11 | call mkdir(x, "p", 0700) | |
12 | endif | |
13 | set backup | |
14 | execute 'set backupdir='.x.'//' | |
15 | set backupcopy=yes | |
16 | let x = ($XDG_STATE_HOME??($HOME."/.local/state"))."/vim" | |
17 | if !isdirectory(x) | |
18 | call mkdir(x, "p", 0700) | |
19 | endif | |
20 | set undofile | |
21 | execute 'set undodir='.x.'//' | |
22 | execute 'set viminfofile='.x.'/.viminfo' | |
23 | unlet x | |
24 | ||
25 | set autoindent | |
26 | set colorcolumn=80 | |
27 | highlight ColorColumn term=NONE ctermbg=0 | |
28 | autocmd FileType python setlocal tabstop=4 shiftwidth=4 expandtab | |
29 | autocmd FileType markdown setlocal tabstop=4 shiftwidth=4 expandtab | |
30 | autocmd FileType javascript setlocal tabstop=2 shiftwidth=2 expandtab | |
31 | autocmd FileType json setlocal tabstop=2 shiftwidth=2 expandtab | |
32 | autocmd FileType html setlocal tabstop=2 shiftwidth=2 expandtab | |
33 | autocmd FileType todo setlocal colorcolumn=0 | |
34 | ||
35 | set cursorline | |
36 | set hlsearch | |
37 | set list | |
38 | set listchars=tab:├─,extends:»,precedes:«,space:·,trail:∙,nbsp:■ | |
39 | set number | |
40 | set relativenumber | |
41 | autocmd InsertEnter * setlocal norelativenumber | |
42 | autocmd InsertLeave * setlocal relativenumber | |
43 | autocmd FocusLost * setlocal norelativenumber | |
44 | autocmd FocusGained * setlocal relativenumber | |
45 | highlight WhiteSpaceBol ctermfg=DarkBlue | |
46 | highlight WhiteSpaceMol ctermfg=Black | |
47 | match WhiteSpaceMol / / | |
48 | 2match WhiteSpaceBol /\(^ \+\)\|\( \+$\)/ | |
49 | ||
50 | let g:EditorConfig_enable_for_new_buf = 1 |