-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc.Linux
108 lines (103 loc) · 2.86 KB
/
vimrc.Linux
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
" somini.vimrc - Linux
" Data Safety and Managing {{{
let s:user_cache = $HOME.'/.cache/vim'
let s:global_tmp = '/tmp'
let s:global_mnt = '/media/'.$USERNAME
let s:global_mnt2= '/run/media/'.$USERNAME
call CheckDir(s:user_cache)
" Vim Info {{{
if !has('nvim')
let g:viminfo_old = $HOME.'/.viminfo'
let g:viminfo_new = s:user_cache.'/viminfo'
else
let g:viminfo_new = s:user_cache.'/shada'
endif
let &viminfo = &viminfo.',r'.s:global_tmp
let &viminfo = &viminfo.',r'.s:global_mnt
let &viminfo = &viminfo.',r'.s:global_mnt2
let &viminfo = &viminfo.',n'.g:viminfo_new
"}}}
" Undo {{{
let &undodir = s:user_cache.'/undo'
call CheckDir(&undodir)
" }}}
" Views {{{
let &viewdir = s:user_cache.'/views'
call CheckDir(&viewdir)
"}}}
" Swap Files {{{
let s:swap_dir = s:user_cache.'/swap'
call CheckDir(s:swap_dir)
" Use the user cache with the full path name
" Check the temporaries too, with full path name
" If all those fail, use the current directory
let &directory = s:swap_dir.'//,'.s:global_tmp.'//'.',.'
" }}}
" Backup Files {{{
let s:backup_dir = s:user_cache.'/backup'
call CheckDir(s:backup_dir)
" Same as swap, only on a different folder
let &backupdir = s:backup_dir.'//'.','.s:global_tmp.'//'.',.'
let &backupskip = &backupskip.','.s:global_tmp.'/*,'.s:global_mnt.'/*,'.s:global_mnt2.'/*'
" }}}
let g:NERDTreeBookmarksFile = s:user_cache.'/NERDTree_Bookmarks'
" }}}
" Plugin Configuration {{{
" CtrlP {{{
let s:ctrlp_cache = s:user_cache.'/plugin/ctrlp'
call CheckDir(s:ctrlp_cache)
let g:ctrlp_cache_dir = s:ctrlp_cache
" Abbreviations {{{
let g:ctrlp_abbrev['abbrevs'] += [
\ {
\ 'pattern': '^@h',
\ 'expanded': '@cd $HOME',
\ 'mode': 'pfrz',
\ },
\ {
\ 'pattern': '^@r',
\ 'expanded': '@cd /',
\ 'mode': 'pfrz',
\ },
\ ]
"}}}
let g:ctrlp_funky_cache_dir = s:ctrlp_cache.'/funky'
call CheckDir(g:ctrlp_funky_cache_dir)
" Fallback to find, that's everywhere
unlet g:ctrlp_user_command
let g:ctrlp_user_command = {
\ 'types': {
\ 1: ['.git', 'cd %s && git ls-files -oc --exclude-standard'],
\ 2: ['.hg', 'hg --cwd %s locate -I .'],
\ },
\ }
if executable('ag')
let g:ctrlp_user_command['fallback'] = 'cd %s && ag --nocolor -g ""'
elseif executable('ack')
let g:ctrlp_user_command['fallback'] = 'cd %s && ack --nocolor -g ""'
elseif executable('pt')
let g:ctrlp_user_command['fallback'] = 'cd %s && pt --nocolor -g ""'
else
let g:ctrlp_user_command['fallback'] = 'cd %s && find . -type f | cut --complement -c -2'
endif
"}}}
" EasyClip {{{
let s:easyclip_cache = s:user_cache.'/plugin/easyclip'
call CheckDir(s:easyclip_cache)
let g:EasyClipShareYanksDirectory = s:easyclip_cache
"}}}
" Rust {{{
let g:rust_doc#downloaded_rust_doc_dir = '/usr/local/share/doc/rust/html'
"}}}
"}}}
" Workarounds {{{
" Fedora {{{
" Delete all autocommands
augroup fedora
autocmd!
augroup END
" }}}
" }}}
" Modeline {{{
" vim:ft=vim:ts=2:sw=2:fdm=marker
"}}}