[nvim] put my configs in runtimepath

This commit is contained in:
Dmytro Meleshko 2019-12-15 22:17:10 +02:00
parent 5ad510c830
commit f0d108ab4c
18 changed files with 103 additions and 121 deletions

View file

@ -1,5 +1,3 @@
if !g:vim_ide | finish | endif
let s:filetypes = ['c', 'cpp', 'objc', 'objcpp']
let g:coc_filetypes += s:filetypes

View file

@ -1,4 +1,2 @@
if !g:vim_ide | finish | endif
call coc#add_extension('coc-css')
let g:coc_filetypes += ['css', 'scss', 'less']

View file

@ -1,9 +1,3 @@
let g:haskell_conceal = 0
let g:haskell_conceal_enumerations = 0
let g:haskell_multiline_strings = 1
if !g:vim_ide | finish | endif
let s:filetypes = ['haskell', 'lhaskell', 'chaskell']
let g:coc_filetypes += s:filetypes
call coc#config('languageserver.haskell', {

View file

@ -1,5 +1,3 @@
if !g:vim_ide | finish | endif
call coc#add_extension('coc-html', 'coc-emmet')
let s:emmet_filetype_mapping = { 'jinja': 'html' }
let g:coc_filetypes += ['html'] + keys(s:emmet_filetype_mapping)

View file

@ -1,5 +1,3 @@
if !g:vim_ide | finish | endif
call coc#add_extension('coc-tsserver', 'coc-eslint', 'coc-prettier')
let g:coc_filetypes += ['javascript', 'javascript.jsx', 'typescript', 'typescript.jsx']
call coc#config('eslint', {

View file

@ -1,4 +1,2 @@
if !g:vim_ide | finish | endif
call coc#add_extension('coc-json')
let g:coc_filetypes += ['json', 'json5']

View file

@ -1,3 +1 @@
if !g:vim_ide | finish | endif
let g:coc_filetypes += ['markdown']

View file

@ -1,5 +1,3 @@
if !g:vim_ide | finish | endif
call coc#add_extension('coc-python')
let g:coc_filetypes += ['python']
call coc#config('pyls.plugins.pycodestyle.ignore', ['E501'])

View file

@ -1,7 +1,3 @@
let g:rust_recommended_style = 0
if !g:vim_ide | finish | endif
call coc#add_extension('coc-rls')
let g:coc_filetypes += ['rust']
call coc#config('rust', { 'clippy_preference': 'on' })

View file

@ -1,3 +1 @@
if !g:vim_ide | finish | endif
let g:coc_filetypes += ['yaml']

View file

@ -4,12 +4,92 @@ let g:vim_ide = get(g:, 'vim_ide', 0)
let &runtimepath = g:nvim_dotfiles_dir.','.&runtimepath.','.g:nvim_dotfiles_dir.'/after'
for s:name in ['plugins', 'editing', 'interface', 'files', 'completion', 'terminal', 'git']
execute 'source' fnameescape(g:nvim_dotfiles_dir.'/lib/'.s:name.'.vim')
endfor
let s:vim_config_dir = expand('~/.config/nvim')
let s:vim_plug_script = s:vim_config_dir . '/autoload/plug.vim'
let s:vim_plug_home = s:vim_config_dir . '/plugged'
let s:just_installed_vim_plug = 0
if !filereadable(s:vim_plug_script)
execute '!curl -fL https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim --create-dirs -o' shellescape(s:vim_plug_script)
autocmd VimEnter * PlugInstall --sync
endif
call plug#begin(s:vim_config_dir . '/plugged')
Plug 'junegunn/vim-plug'
" Files {{{
Plug 'tpope/vim-eunuch'
if g:vim_ide
Plug 'francoiscabrol/ranger.vim'
endif
" }}}
" Editing {{{
Plug 'easymotion/vim-easymotion'
Plug 'junegunn/vim-easy-align'
Plug 'Raimondi/delimitMate'
Plug 'tpope/vim-repeat'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-surround'
Plug 'Yggdroot/indentLine'
Plug 'henrik/vim-indexed-search'
Plug 'andymass/vim-matchup'
" Plug 'tommcdo/vim-exchange'
Plug 'inkarkat/vim-ingo-library' " required by LineJuggler
Plug 'inkarkat/vim-LineJuggler', { 'branch': 'stable' }
Plug 'reedes/vim-pencil'
" }}}
" Text objects {{{
Plug 'kana/vim-textobj-user'
Plug 'kana/vim-textobj-entire'
Plug 'kana/vim-textobj-line'
Plug 'kana/vim-textobj-indent'
" }}}
" UI {{{
Plug 'moll/vim-bbye'
Plug 'gerw/vim-HiLinkTrace'
Plug 'vim-airline/vim-airline'
Plug 'tpope/vim-obsession'
Plug 'romainl/vim-qf'
if g:vim_ide
Plug 'dyng/ctrlsf.vim'
endif
" }}}
" Git {{{
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-rhubarb'
Plug 'airblade/vim-gitgutter'
" }}}
" FZF {{{
Plug 'junegunn/fzf', { 'do': './install --bin' }
Plug 'junegunn/fzf.vim'
" }}}
" Programming {{{
Plug 'sheerun/vim-polyglot'
if g:vim_ide
Plug 'neoclide/coc.nvim', { 'do': 'yarn install' }
Plug 'dag/vim2hs'
endif
" }}}
call plug#end()
" Automatically install/clean plugins (because I'm a programmer) {{{
augroup vimrc-plugins
autocmd!
autocmd VimEnter *
\ if len(filter(values(g:plugs), '!isdirectory(v:val.dir)'))
\| PlugInstall --sync | q
\| endif
augroup END
" }}}
colorscheme dotfiles
for s:path in globpath(g:nvim_dotfiles_dir.'/lib/languages', '*', 0, 1)
execute 'source' fnameescape(s:path)
endfor

View file

@ -1,85 +0,0 @@
let s:vim_config_dir = expand('~/.config/nvim')
let s:vim_plug_script = s:vim_config_dir . '/autoload/plug.vim'
let s:vim_plug_home = s:vim_config_dir . '/plugged'
let s:just_installed_vim_plug = 0
if !filereadable(s:vim_plug_script)
exe '!curl -fL https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim --create-dirs -o' shellescape(s:vim_plug_script)
autocmd VimEnter * PlugInstall --sync
endif
call plug#begin(s:vim_config_dir . '/plugged')
Plug 'junegunn/vim-plug'
" Files {{{
Plug 'tpope/vim-eunuch'
if g:vim_ide
Plug 'francoiscabrol/ranger.vim'
endif
" }}}
" Editing {{{
Plug 'easymotion/vim-easymotion'
Plug 'junegunn/vim-easy-align'
Plug 'Raimondi/delimitMate'
Plug 'tpope/vim-repeat'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-surround'
Plug 'Yggdroot/indentLine'
Plug 'henrik/vim-indexed-search'
Plug 'andymass/vim-matchup'
" Plug 'tommcdo/vim-exchange'
Plug 'inkarkat/vim-ingo-library' " required by LineJuggler
Plug 'inkarkat/vim-LineJuggler', { 'branch': 'stable' }
Plug 'reedes/vim-pencil'
" }}}
" Text objects {{{
Plug 'kana/vim-textobj-user'
Plug 'kana/vim-textobj-entire'
Plug 'kana/vim-textobj-line'
Plug 'kana/vim-textobj-indent'
" }}}
" UI {{{
Plug 'moll/vim-bbye'
Plug 'gerw/vim-HiLinkTrace'
Plug 'vim-airline/vim-airline'
Plug 'tpope/vim-obsession'
Plug 'romainl/vim-qf'
if g:vim_ide
Plug 'dyng/ctrlsf.vim'
endif
" }}}
" Git {{{
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-rhubarb'
Plug 'airblade/vim-gitgutter'
" }}}
" FZF {{{
Plug 'junegunn/fzf', { 'do': './install --bin' }
Plug 'junegunn/fzf.vim'
" }}}
" Programming {{{
Plug 'sheerun/vim-polyglot'
if g:vim_ide
Plug 'neoclide/coc.nvim', { 'do': 'yarn install' }
Plug 'dag/vim2hs'
endif
" }}}
call plug#end()
" " Automatically install/clean plugins (because I'm a programmer) {{{
augroup vimrc-plugins
autocmd!
autocmd VimEnter *
\ if len(filter(values(g:plugs), '!isdirectory(v:val.dir)'))
\| PlugInstall --sync | q
\| endif
augroup END
" " }}}

View file

@ -1,7 +1,7 @@
" pop-up (completion) menu mappings {{{
imap <silent><expr> <CR> pumvisible() ? "\<C-y>" : "\<Plug>delimitMateCR"
imap <silent><expr> <Esc> pumvisible() ? "\<C-e>" : "\<Esc>"
imap <silent><expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
imap <silent><expr> <CR> pumvisible() ? "\<C-y>" : "\<Plug>delimitMateCR"
imap <silent><expr> <Esc> pumvisible() ? "\<C-e>" : "\<Esc>"
imap <silent><expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
imap <silent><expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
" }}}
@ -81,4 +81,7 @@ endif
\ 'errorSign': 'XX',
\ 'warningSign': '!!',
\ })
runtime! coc-languages/*.vim
" }}}

View file

@ -164,3 +164,13 @@ set commentstring=//%s
xmap <leader>ga <Plug>(LiveEasyAlign)
nmap <leader>ga <Plug>(LiveEasyAlign)
" }}}
" language-specific settings {{{
let g:rust_recommended_style = 0
let g:haskell_conceal = 0
let g:haskell_conceal_enumerations = 0
let g:haskell_multiline_strings = 1
" }}}