-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.vim
141 lines (116 loc) · 3.04 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
" vim: foldlevel=0
" config directory setting by each OS {{{
if has('win32') || has('win64')
let s:config_dir = $HOME . '/AppData/Local/nvim'
let g:python3_host_prog = 'C:\Users\' . $USERNAME . '\Anaconda3\python.exe'
elseif has('unix')
let s:config_dir = $HOME . '/.config/nvim'
else
echomsg 'No setting on this OS.'
finish
endif
" }}}
let g:loaded_python_provider=0
let g:loaded_ruby_provider=0
let g:loaded_node_provider=0
let g:loaded_perl_provider=0
" basic settings {{{
" options {{{
set mouse=
set nohlsearch
set number
set cursorline
set wildmode=list:full
set foldmethod=marker
set foldlevelstart=10
set list
set listchars=tab:▸\ ,eol:¬
set splitbelow
set splitright
set expandtab
set tabstop=4
set shiftwidth=4
set softtabstop=4
set noswapfile
if has('persistent_undo')
let s:undo_dir = expand(s:config_dir . '/undo')
if !isdirectory(s:undo_dir)
call mkdir(s:undo_dir)
endif
let &undodir = s:undo_dir
set undofile
unlet s:undo_dir
endif
set ignorecase
" let g:clipboard = {
" \ 'name': 'myClipboard',
" \ 'copy': {
" \ '+': 'win32yank.exe -i',
" \ '*': 'win32yank.exe -i',
" \ },
" \ 'paste': {
" \ '+': 'win32yank.exe -o',
" \ '*': 'win32yank.exe -o',
" \ },
" \ 'cache_enabled': 1,
" \ }
" set clipboard^=unnamedplus
" }}}
" mappings {{{
inoremap jj <ESC>
noremap j gj
noremap k gk
noremap H gT
noremap L gt
" No need cursor key on normal, visual, and insert mode
noremap <Up> <Nop>
noremap <Down> <Nop>
noremap <Left> <Nop>
noremap <Right> <Nop>
inoremap <Up> <Nop>
inoremap <Down> <Nop>
inoremap <Left> <Nop>
inoremap <Right> <Nop>
" }}}
" }}}
" dein.vim settings {{{
function! init#dein() abort
" check git command
if !executable('git')
echoerr "No command 'git' found."
return
end
" directory for dein.vim
let l:dein_dir = s:config_dir . '/dein'
let l:dein_repo_dir = l:dein_dir . '/repos/github.com/Shougo/dein.vim'
" git clone dein.vim unless dein repository exist
if &runtimepath !~# '/dein.vim'
if !isdirectory(l:dein_repo_dir)
execute '!git clone http://github.com/Shougo/dein.vim' l:dein_repo_dir
endif
execute 'set runtimepath+=' . l:dein_repo_dir
endif
if dein#load_state(l:dein_dir)
call dein#begin(l:dein_dir)
let l:inst_tomls = glob(s:config_dir . '/dein/tomls/inst/*.toml')
let l:lazy_tomls = glob(s:config_dir . '/dein/tomls/lazy/*.toml')
for path in split(l:inst_tomls, '\n')
call dein#load_toml(path, {'lazy': 0})
endfor
for path in split(l:lazy_tomls, '\n')
call dein#load_toml(path, {'lazy': 1})
endfor
call dein#end()
call dein#save_state()
call map(dein#check_clean(), "delete(v:val, 'rf')")
endif
if dein#check_install(['vimproc.vim'])
call dein#install(['vimproc.vim'])
endif
if dein#check_install()
call dein#install()
endif
endfunction
call init#dein()
" }}}
filetype indent plugin on