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