dots/.vimrc

73 lines
1.7 KiB
VimL
Raw Normal View History

"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
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
" 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
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>
"formatting
2021-10-20 03:09:24 +00:00
set tabstop=2
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>
"Language server junk
2021-10-20 03:09:24 +00:00
let g:lsc_server_commands = {'py': 'pyls', 'xsh': 'pyls'}
let g:lsc_auto_map = v:true
"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' }
Plug 'chiel92/vim-autoformat'
Plug 'natebosch/vim-lsc'
2021-09-23 01:38:18 +00:00
Plug 'https://tildegit.org/sloum/gemini-vim-syntax'
call plug#end()