-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.vim
109 lines (96 loc) · 3.22 KB
/
init.vim
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
109
" Vim plugin manager requirement:
" https://github.com/junegunn/vim-plug
call plug#begin()
" A scheme called gruvbox-material
Plug 'sainnhe/gruvbox-material'
" Light weight airline
Plug 'itchyny/lightline.vim'
" To show indent line
Plug 'Yggdroot/indentLine'
" Auto remove redundant white spaces
Plug 'ntpeters/vim-better-whitespace'
" Delete, change and add surroundings
Plug 'tpope/vim-surround'
" Comment stuff out.
Plug 'tpope/vim-commentary'
" Text objects enhancement
Plug 'wellle/targets.vim'
call plug#end()
" Get nvim diretory path in all platforms
if has('windows') && !has('mac')
let s:nvim_dir = expand('~/AppData/Local/nvim')
elseif has('mac') || has('linux')
let s:nvim_dir = expand('~/.config/nvim')
endif
" Source ./plug-free.vim
exe 'source '.s:nvim_dir.'/plug-free.vim'
" Auto swith to English input method on InsertLeave
if has('windows') && !has('mac')
let imselect = s:nvim_dir.'/windows/im-select.exe'
autocmd InsertLeave * :silent exe '!'.imselect.' 1033'
elseif has('wsl')
let imselect = '/mnt/c/Users/' . trim(system('whoami'))
\. '/AppData/Local/nvim/windows/im-select.exe'
autocmd InsertLeave * :silent exe '!'.imselect.' 1033'
elseif has('mac')
autocmd InsertLeave * :silent exe '!im-select com.apple.keylayout.ABC'
endif
" Use win32yank to copy and past on Windows
if has('windows') && !has('mac')
let g:clipboard = {
\ 'name': 'wsl-clip',
\ 'copy': {
\ '+': 'win32yank.exe -i',
\ '*': 'win32yank.exe -i',
\ },
\ 'paste': {
\ '+': 'win32yank.exe --lf -o',
\ '*': 'win32yank.exe --lf -o',
\ },
\ 'cache_enabled': 0,
\ }
endif
" Configure lightline plugin
" \ 'separator': { 'left': '', 'right': '' },
" \ 'separator': { 'left': '', 'right': '' },
" \ 'separator': { 'left': '', 'right': '' },
" \ 'subseparator': { 'left': '\\', 'right': '/' },
let g:lightline = {
\ 'colorscheme': 'gruvbox_material',
\ }
" Configure indentLine plugin
let g:indentLine_color_term = 239 " Set color
let g:vim_json_conceal = 0 " Avoid char hidden in json
let g:markdown_syntax_conceal = 0 " Avoid char hidden in markdown
" Configure vim-better-whitespace plugin
let g:better_whitespace_enabled = 1
let g:strip_whitespace_on_save = 1
let g:strip_whitespace_confirm = 0
let g:better_whitespace_guicolor = '#ea6962'
" Available values: 'material', 'mix', 'original'
let g:gruvbox_material_foreground = 'material'
" Remove background color
let g:gruvbox_material_transparent_background = 1
" Disable italic in comment
let g:gruvbox_material_disable_italic_comment = 1
" Enabling this option will reduce loading time
let g:gruvbox_material_better_performance = 1
" Override scheme color
let g:gruvbox_material_colors_override = {
\ 'fg0': ['#cacaca', '223'],
\ 'fg1': ['#cacaca', '223'],
\ 'grey1': ['#838383', '245'],
\ 'grey2': ['#838383', '245'],
\ 'bg_dim': ['#252525', '233'],
\ 'bg0': ['#323232', '236'],
\ 'bg1': ['#3c3c3c', '237'],
\ 'bg2': ['#3c3c3c', '237'],
\ 'bg3': ['#505050', '239'],
\ 'bg4': ['#505050', '239'],
\ 'bg5': ['#666666', '241'],
\ 'bg_statusline1': ['#3c3c3c', '237'],
\ 'bg_statusline2': ['#464646', '237'],
\ 'bg_statusline3': ['#5b5b5b', '241'],
\ }
" Set colorscheme
colorscheme gruvbox-material