forked from pgilad/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_vimrc
63 lines (54 loc) · 1.67 KB
/
_vimrc
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
"@author Gilad Peleg
"@license MIT 2014
"@website https://github.com/pgilad/dotfiles
" Note: Skip initialization for vim-tiny or vim-small.
if !1 | finish | endif
" Note: Vim is old
set nocompatible
if &shell =~# 'fish$'
set shell=sh
endif
if has('python3')
" Hack for https://github.com/vim/vim/issues/3117#issuecomment-402622616
silent! python3 1
endif
let g:config = {
\ 'baseDir': '~/.dotfiles/vim/rc/',
\ 'loadFiles': {},
\ 'bundlesPath': '~/vimfiles/bundle/',
\ 'spellDir' : '~/.dotfiles/vim/spell/',
\ 'spellFile' : '~/.dotfiles/vim/spell/en.utf-8.add',
\ 'undoDir' : '~/.cache/undo/',
\ 'env' : {
\ 'windows': has('wind16') || has('win32') || has('win64'),
\ 'cygwin': has('win32unix'),
\ 'mac': has('mac'),
\ 'unix': has('unix') && !has('gui_macvim')
\ }
\}
" map leader keys
let g:mapleader = ","
let g:maplocalleader = ","
set guioptions=Mc
" set guioptions+=a " visual select auto-copy to clipboard
if has('syntax')
syntax off
filetype plugin indent off
endif
" How to quickly load the files:
" Mapping | File
" ---------------------------
" <leader>eg | Gui
" <leader>eb | Bundles
" <leader>es | Settings
" <leader>em | Mappings
" <leader>ea | autoCommands
for fileToLoad in ['bundles', 'settings', 'mappings', 'autoCommands']
" set filename
let b:filePath = g:config.baseDir . fileToLoad . '.vim'
" set file object in config
let g:config.loadFiles[fileToLoad] = b:filePath
" source script
silent execute 'source ' . fnameescape(expand(b:filePath))
endfor
set secure