This repository has been archived by the owner on Feb 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
/
vimrc
68 lines (64 loc) · 2.26 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
64
65
66
67
68
"=============================================================================
" vimrc --- Entry file for vim
" Copyright (c) 2016-2021 Shidong Wang & Contributors
" Author: Shidong Wang < [email protected] >
" URL: https://spacevim.org
" License: GPLv3
"=============================================================================
" ============================ Before Load SpaceVim ==========================
" Note: Skip initialization for vim-tiny or vim-small.
if 1
let g:_spacevim_if_lua = 0
if has('lua')
" add ~/.SpaceVim/lua to lua package path
if has('win16') || has('win32') || has('win64')
let s:plugin_dir = fnamemodify(expand('<sfile>'), ':h').'\lua'
let s:str = s:plugin_dir . '\?.lua;' . s:plugin_dir . '\?\init.lua;'
else
let s:plugin_dir = fnamemodify(expand('<sfile>'), ':h').'/lua'
let s:str = s:plugin_dir . '/?.lua;' . s:plugin_dir . '/?/init.lua;'
endif
silent! lua package.path=vim.eval("s:str") .. package.path
if empty(v:errmsg)
let g:_spacevim_if_lua = 1
endif
endif
execute 'source' fnamemodify(expand('<sfile>'), ':h').'/main.vim'
endif
" ============================ After Load SpaceVim ==========================
" WSL clipboard
if $WSL_DISTRO_NAME !=# ''
let s:clip = 'win32yank.exe -i --crlf'
augroup WSLYank
autocmd!
autocmd TextYankPost * if v:event.operator ==# 'y' && v:event.regname ==# 'x' | call system(s:clip, @x) | endif
augroup END
xnoremap <Leader>y "xy
nnoremap <leader>y "xy
nnoremap <leader>Y "xy$
nnoremap <leader>, "xyl
xnoremap <silent><leader>p x:let @x = system('win32yank.exe -o --lf')<cr>"xp
nnoremap <silent><leader>p :let @x = system('win32yank.exe -o --lf')<cr>"xp
nnoremap <silent><leader>o :r !win32yank.exe -o --lf<cr>
endif
" cursor shape
let &t_SI.="\e[5 q"
let &t_EI.="\e[1 q"
" color schemes
set termguicolors
let s:colorschemes = [
\ 'SpaceVim',
\ 'gruvbox',
\ 'NeoSolarized',
\ 'palenight',
\ 'material',
\]
if &diff == 1
colorscheme gruvbox
elseif $DARKBG !=# ''
if index(s:colorschemes, $DARKBG) > 0
exe 'colorscheme '. $DARKBG
else
exe 'colorscheme '. s:colorschemes[localtime() % 5]
endif
endif