2021-08-18 03:41:28 +00:00
|
|
|
"automatically install plugin manager if needed
|
|
|
|
|
|
|
|
let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
|
|
|
|
if empty(glob(data_dir . '/autoload/plug.vim'))
|
2021-09-23 01:38:18 +00:00
|
|
|
silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
|
|
|
|
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
|
2021-08-18 03:41:28 +00:00
|
|
|
endif
|
|
|
|
|
2021-09-23 01:38:18 +00:00
|
|
|
if exists('$TMUX')
|
|
|
|
" Colors in tmux
|
|
|
|
let &t_8f = "\033[38;2;%lu;%lu;%lum"
|
|
|
|
let &t_8b = "\033[48;2;%lu;%lu;%lum"
|
|
|
|
endif
|
|
|
|
|
|
|
|
packadd! dracula
|
|
|
|
set termguicolors
|
|
|
|
set background=dark
|
|
|
|
syntax enable
|
|
|
|
colorscheme dracula
|
|
|
|
|
2021-08-18 03:41:28 +00:00
|
|
|
" Install vim-plug if not found
|
|
|
|
if empty(glob('~/.vim/autoload/plug.vim'))
|
2021-09-23 01:38:18 +00:00
|
|
|
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
|
|
|
|
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
2021-08-18 03:41:28 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
" Run PlugInstall if there are missing plugins
|
|
|
|
autocmd VimEnter * if len(filter(values(g:plugs), '!isdirectory(v:val.dir)'))
|
|
|
|
\| PlugInstall --sync | source $MYVIMRC
|
|
|
|
\| endif
|
|
|
|
|
|
|
|
"splitting confiig
|
|
|
|
set splitbelow
|
|
|
|
set splitright
|
|
|
|
|
2021-09-25 19:08:51 +00:00
|
|
|
"nnoremap <C-J> <C-W><C-J>
|
|
|
|
"nnoremap <C-K> <C-W><C-K>
|
|
|
|
"nnoremap <C-L> <C-W><C-L>
|
|
|
|
"nnoremap <C-H> <C-W><C-H>
|
2021-08-18 03:41:28 +00:00
|
|
|
|
|
|
|
"formatting
|
2021-10-20 03:09:24 +00:00
|
|
|
set tabstop=2
|
2021-08-18 03:41:28 +00:00
|
|
|
set softtabstop=0 noexpandtab
|
|
|
|
set shiftwidth=4
|
|
|
|
|
|
|
|
"folding config
|
|
|
|
set foldmethod=indent
|
|
|
|
set foldlevel=99
|
|
|
|
nnoremap <space> za
|
|
|
|
|
|
|
|
"line numbers
|
|
|
|
set number
|
|
|
|
|
|
|
|
"NERDTree shortcuts
|
|
|
|
nnoremap <C-t> :NERDTreeToggle<CR>
|
|
|
|
|
2021-08-19 01:43:35 +00:00
|
|
|
"Language server junk
|
2021-10-20 03:09:24 +00:00
|
|
|
let g:lsc_server_commands = {'py': 'pyls', 'xsh': 'pyls'}
|
2021-08-19 01:43:35 +00:00
|
|
|
|
|
|
|
let g:lsc_auto_map = v:true
|
|
|
|
|
2021-08-18 03:41:28 +00:00
|
|
|
"plugins
|
|
|
|
call plug#begin('~/.vim/plugged')
|
|
|
|
|
|
|
|
Plug 'airblade/vim-gitgutter'
|
|
|
|
Plug 'preservim/nerdtree'
|
2021-09-22 03:41:43 +00:00
|
|
|
Plug 'ycm-core/YouCompleteMe', { 'do': './install.py' }
|
2021-08-18 03:41:28 +00:00
|
|
|
Plug 'chiel92/vim-autoformat'
|
2021-08-19 01:43:35 +00:00
|
|
|
Plug 'natebosch/vim-lsc'
|
2021-09-23 01:38:18 +00:00
|
|
|
Plug 'https://tildegit.org/sloum/gemini-vim-syntax'
|
2021-08-18 03:41:28 +00:00
|
|
|
|
|
|
|
call plug#end()
|