darkcloud-nvimconfig/vimrc

120 lines
4.3 KiB
VimL
Raw Normal View History

"============================================================"
" "
" Darkcloud Vim Config: vimrc "
" "
" By: Kevin MacMartin (prurigro@gmail.com) "
" Website: https://github.com/prurigro/darkcloud-vimconfig "
" "
" License: MIT "
" "
"============================================================"
"darkcloud vim config folder path: {{{
2018-03-14 11:38:51 -04:00
"if you want to use darkcloud-vimconfig as a package without symlinking
"the vim folder or placing it @ /etc/darkcloud-vimconfig, create a file
"@ ~/.vim/darkcloud-path.vim and in it place the following, except with
"the path pointing to the cloned repo:
"
2018-03-14 11:38:51 -04:00
"let g:darkcloudpath = "/etc/darkcloud-vimconfig"
if filereadable(glob("~/.vim/darkcloud-path.vim"))
source ~/.vim/darkcloud-path.vim
else
let g:darkcloudpath = "/etc/darkcloud-vimconfig"
endif
"}}}
"LOAD DARKCLOUD CONFIG AND THEME FILES: {{{
"Add Config Directory: (distro-agnostic system-wide)
let &runtimepath = printf('%s,%s/vim,%s/vim/after',&runtimepath,g:darkcloudpath,g:darkcloudpath)
"Load Colour Scheme:
2018-03-14 11:38:51 -04:00
colorscheme default "hack to fix vimrc colorschemes in some versions of vim
colorscheme darkcloud
"Load Settings:
runtime config/settings.vim
2018-03-13 15:38:03 -04:00
"Initialize Plugins:
let pathogen_disabled = []
2018-03-13 15:38:03 -04:00
if has('python3')
"configure pythonx and check for the python-neovim and python-msgpack libraries if python3 is found
2018-03-15 13:55:29 -04:00
if !has('nvim')
set pyxversion=3
endif
2018-03-13 15:38:03 -04:00
"check for python-neovim
2018-03-13 15:38:03 -04:00
redir => python_neovim_check
2018-03-15 13:55:29 -04:00
silent python3 exec("import pkgutil\nneovim = pkgutil.find_loader('neovim')\nfound = neovim is not None\nprint(found)")
2018-03-13 15:38:03 -04:00
redir END
if substitute(python_neovim_check, '^\n*\([^\n]*\)\n*$', '\1', '') == 'True'
let g:python_neovim = 1
else
let g:python_neovim = 0
endif
"check for python-msgpack
redir => python_msgpack_check
silent python3 exec("import pkgutil\nmsgpack = pkgutil.find_loader('msgpack')\nfound = msgpack is not None\nprint(found)")
redir END
2018-03-12 10:56:36 -04:00
if substitute(python_msgpack_check, '^\n*\([^\n]*\)\n*$', '\1', '') == 'True'
let g:python_msgpack = 1
else
let g:python_msgpack = 0
endif
else
"if python isn't available disable plugins that depend on it and set library variables to false
call add(pathogen_disabled, 'MatchTagAlways')
let g:python_neovim = 0
let g:python_msgpack = 0
endif
"don't load vim-gutentags if ctags can't be found
if !executable('ctags')
call add(pathogen_disabled, 'vim-gutentags')
endif
if !g:python_neovim || !g:python_msgpack
"don't load deoplete if either of its python dependencies are missing
2018-03-13 15:38:03 -04:00
call add(pathogen_disabled, 'deoplete.nvim')
call add(pathogen_disabled, 'neco-syntax')
call add(pathogen_disabled, 'nvim-yarp')
call add(pathogen_disabled, 'vim-hug-neovim-rpc')
elseif has('nvim')
"don't load the neovim compatibility plugins required by deoplete if actually running neovim
2018-03-13 15:38:03 -04:00
call add(pathogen_disabled, 'nvim-yarp')
call add(pathogen_disabled, 'vim-hug-neovim-rpc')
endif
"disable autocompletion logic when running in vimpager mode
if exists('g:vimpager.enabled')
call add(pathogen_disabled, 'deoplete.nvim')
call add(pathogen_disabled, 'neco-syntax')
call add(pathogen_disabled, 'nvim-yarp')
call add(pathogen_disabled, 'vim-hug-neovim-rpc')
endif
"if neovim is being used we should disable plugins that aren't compatible or necessary
if has('nvim')
call add(pathogen_disabled, 'vim-fixkey')
endif
2018-03-14 11:38:51 -04:00
"use pathogen to load plugins that haven't been disabled
runtime bundle/vim-pathogen/autoload/pathogen.vim
"Load Keymappings:
runtime config/keyboard.vim
"Load User Config:
runtime vimrc.user
"Load Plugin Configuration:
runtime config/plugins.vim
2014-07-16 07:34:35 -04:00
"Load After Config:
runtime config/after.vim
"}}}