This repository has been archived by the owner on Jul 18, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.vim
170 lines (128 loc) · 3.9 KB
/
main.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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
" Stone's 2021 Vim Config
" -----------------------------
" Make sure dependencies are installed:
source ~/.vim/autoinstall.vim
" Load helper functions:
source ~/.vim/util.vim
function! PostinstallCoc(info)
echohl None
echo " - Automatically finishing coc.nvim install using npm (yarn if available)"
silent !cd ~/.vim/pdata/coc.nvim; npm install
syntax on
"call system("cd ~/.vim/pdata/coc.nvim; npm install")
endfunction
" Plugins:
call plug#begin('~/.vim/pdata')
Plug 'neoclide/coc.nvim', {'branch': 'master', 'do': function('PostinstallCoc')}
Plug 'kevinoid/vim-jsonc'
"
" Temporary fix until I find out why:
if filereadable('~/.vim/pdata/coc.nvim/build/index.js')
echo 'Broken coc.nvim, run yarn again'
endif
Plug 'sheerun/vim-polyglot'
Plug 'kana/vim-arpeggio'
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
Plug 'Xuyuanp/nerdtree-git-plugin', { 'on': 'NERDTreeToggle' }
Plug 'jistr/vim-nerdtree-tabs', { 'on': 'NERDTreeTabsToggle' }
Plug 'aperezdc/vim-template'
" Git:
Plug 'tpope/vim-fugitive'
Plug 'airblade/vim-gitgutter'
Plug 'tpope/vim-commentary'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'majutsushi/tagbar'
Plug 'janko-m/vim-test'
Plug 'mbbill/undotree'
Plug 'nathanaelkane/vim-indent-guides'
Plug 'tpope/vim-surround'
Plug 'raimondi/delimitmate'
Plug 'chriskempson/base16-vim'
Plug 'luochen1990/rainbow'
Plug 'christoomey/vim-tmux-navigator'
Plug 'Shougo/neco-vim'
Plug 'neoclide/coc-neco'
call plug#end()
function! Load()
source ~/.vim/update.vim
source ~/.vim/settings.vim
" Provide fallback when not installed:
call arpeggio#load()
filetype plugin indent on
source ~/.vim/commands.vim
source ~/.vim/nerdtree.vim
source ~/.vim/undo.vim
source ~/.vim/theme.vim
source ~/.vim/keybinds.vim
for f in split(glob('~/.vim/plugins/*.vim'), '\n')
exe 'source' f
endfor
source ~/.vim/splash.vim
endfunction
" Check for first install:
if !isdirectory(glob('~/.vim/pdata/'))
"autocmd VimEnter * PlugInstall --sync
" Text can bleed through for some reason unless this is set
" TODO conditionally run based on $TERM
echohl None
redraw
" Use a fullscreen window for this one:
let g:plug_window= "botleft " + winheight(0) + "new"
PlugInstall --sync
unlet g:plug_window
" We can't reload here, as it would cause a redefinition
" of FirstInstall(), so set a flag and do it later:
let g:needsReload=1
" Create new and close old window:
enew
call win_execute(0, 'close')
call append('$', "")
"call append('$', ' vim' . GetVimVersion())
call append('$', ' Welcome to Vim')
call append('$', "")
call append('$', " running stone's vimrc v.2.0.2")
call append('$', "")
call append('$', " ")
" ... and set some options for it
setlocal
\ nocursorcolumn
\ nocursorline
\ nolist
\ nonumber
\ foldcolumn=0
\ nofoldenable
\ noswapfile
\ norelativenumber
\ bufhidden=wipe
\ buftype=nofile
\ nobuflisted
\ nospell
\ ft=help
\ stl=
\ scr=0
\ mouse=
" is this a bug? hide cursor by telling vim there's no show command:
setlocal t_ve=
" No modifications to this buffer
setlocal nomodifiable nomodified readonly
" When we go to insert mode start a new buffer, and start insert
nnoremap <buffer><silent> <CR> :q | set t_ve&vim
nnoremap <buffer><silent> e :enew<CR> | set t_ve&vim
nnoremap <buffer><silent> i :enew <bar> startinsert<CR> | setlocal t_ve&vim | setlocal nomodified
nnoremap <buffer><silent> o :enew <bar> startinsert<CR> | setlocal t_ve&vim | setlocal nomodified
call indent_guides#disable()
redraw
source $MYVIMRC
redraw
endif
if isdirectory(glob('~/.vim/pdata/'))
call Load()
endif
" Not sure why this is here, TODO move it:
let g:tmux_navigator_no_mappings = 1
nnoremap <silent> <C-w>h :TmuxNavigateLeft<cr>
nnoremap <silent> <C-w>j :TmuxNavigateDown<cr>
nnoremap <silent> <C-w>k :TmuxNavigateUp<cr>
nnoremap <silent> <C-w>l :TmuxNavigateRight<cr>
nnoremap <silent> <C-w>\ :TmuxNavigatePrevious<cr>