Skip to content

Commit

Permalink
Update config of NeoVim
Browse files Browse the repository at this point in the history
  • Loading branch information
ojiry committed May 14, 2019
1 parent 65c2f74 commit e05ff06
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 95 deletions.
71 changes: 0 additions & 71 deletions config/dein/plugins_lazy.toml

This file was deleted.

49 changes: 31 additions & 18 deletions config/dein/plugins.toml → config/nvim/dein.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ repo = 'elzr/vim-json'
repo = 'fatih/vim-go'
on_ft = 'go'
hook_add = '''
let g:go_def_mapping_enabled = 0
let g:go_doc_keywordprg_enabled = 0
let g:go_def_mode = 'gopls'
let g:go_fmt_autosave = 1
let g:go_fmt_command = "goimports"
let g:go_metalinter_autosave_enabled = ['vet']
'''

[[plugins]]
Expand All @@ -38,19 +38,24 @@ hook_add = '''
let g:terraform_fmt_on_save = 1
'''

[[plugins]]
repo = 'honza/vim-snippets'

[[plugins]]
repo = 'itchyny/lightline.vim'
hook_add = '''
let g:lightline = { 'colorscheme': 'wombat' }
'''

[[plugins]]
repo = 'jodosha/vim-godebug'
repo = '/usr/local/opt/fzf'

[[plugins]]
repo = 'junegunn/fzf.vim'
hook_add = '''
nnoremap [godebug] <Nop>
nmap <Space>g [godebug]
nmap <silent> [godebug]d :GoDebug<CR>
nmap <silent> [godebug]t :GoToggleBreakpoint<CR>
nnoremap <Leader>b :Buffers<CR>
nnoremap <Leader>f :Files<CR>
nnoremap <Leader>t :Filetypes<CR>
'''

[[plugins]]
Expand Down Expand Up @@ -84,12 +89,27 @@ repo = 'prabirshrestha/asyncomplete.vim'
repo = 'prabirshrestha/asyncomplete-lsp.vim'

[[plugins]]
repo = 'prabirshrestha/asyncomplete-neosnippet.vim'
repo = 'prabirshrestha/asyncomplete-ultisnips.vim'
depends = ['asyncomplete.vim', 'ultisnips']
hook_add = '''
let g:UltiSnipsExpandTrigger="<tab>"
let g:UltiSnipsJumpForwardTrigger="<tab>"
let g:UltiSnipsJumpBackwardTrigger="<s-tab>"
if has('python3')
call asyncomplete#register_source(asyncomplete#sources#ultisnips#get_source_options({
\ 'name': 'ultisnips',
\ 'whitelist': ['*'],
\ 'completor': function('asyncomplete#sources#ultisnips#completor'),
\ }))
endif
'''

[[plugins]]
repo = 'prabirshrestha/vim-lsp'
hook_add = '''
let g:lsp_async_completion = 1
if executable('gopls')
au User lsp_setup call lsp#register_server({
\ 'name': 'gopls',
Expand All @@ -98,6 +118,7 @@ hook_add = '''
\ })
autocmd BufWritePre *.go LspDocumentFormatSync
endif
if executable('solargraph')
" gem install solargraph
au User lsp_setup call lsp#register_server({
Expand All @@ -107,6 +128,7 @@ hook_add = '''
\ 'whitelist': ['ruby'],
\ })
endif
if executable('rls')
au User lsp_setup call lsp#register_server({
\ 'name': 'rls',
Expand All @@ -130,13 +152,7 @@ repo = 'rust-lang/rust.vim'
repo = 'Shougo/dein.vim'

[[plugins]]
repo = 'Shougo/neomru.vim'

[[plugins]]
repo = 'Shougo/neosnippet-snippets'

[[plugins]]
repo = 'slim-template/vim-slim'
repo = 'SirVer/ultisnips'

[[plugins]]
repo = 'tmux-plugins/vim-tmux'
Expand All @@ -147,9 +163,6 @@ repo = 'tpope/vim-endwise'
[[plugins]]
repo = 'tpope/vim-fugitive'

[[plugins]]
repo = 'tpope/vim-haml'

[[plugins]]
repo = 'tpope/vim-rails'

Expand Down
6 changes: 6 additions & 0 deletions config/nvim/deinft.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[ftplugin]

vim = '''
setlocal foldmethod=indent
setlocal shiftwidth=2 softtabstop=2
'''
Empty file added config/nvim/deinlazy.toml
Empty file.
14 changes: 8 additions & 6 deletions config/nvim/init.vim
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ augroup MyAutoCmd
autocmd!
augroup END

let g:mapleader = "\<Space>"

let g:cache_home = empty($XDG_CACHE_HOME) ? expand('$HOME/.cache') : $XDG_CACHE_HOME
let g:config_home = empty($XDG_CONFIG_HOME) ? expand('$HOME/.config') : $XDG_CONFIG_HOME
let g:data_home = empty($XDG_DATA_HOME) ? expand('$HOME/.local/share') : $XDG_DATA_HOME
Expand All @@ -11,8 +13,9 @@ let g:dein#install_message_type = 'none'
let g:dein#install_progress_type = 'title'

let s:dein_cache_dir = g:cache_home . '/dein'
let s:dein_toml = g:config_home . '/dein/plugins.toml'
let s:dein_lazy_toml = g:config_home . '/dein/plugins_lazy.toml'
let s:dein_toml = g:config_home . '/nvim/dein.toml'
let s:deinlazy_toml = g:config_home . '/nvim/deinlazy.toml'
let s:deinft_toml = g:config_home . '/nvim/deinft.toml'

if &runtimepath !~# '/dein.vim'
let s:dein_repo_dir = s:dein_cache_dir . '/repos/github.com/Shougo/dein.vim'
Expand All @@ -27,17 +30,16 @@ endif
if dein#load_state(s:dein_cache_dir)
call dein#begin(s:dein_cache_dir)
call dein#load_toml(s:dein_toml, {'lazy': 0})
call dein#load_toml(s:dein_lazy_toml, {'lazy': 1})
call dein#load_toml(s:deinlazy_toml, {'lazy': 1})
call dein#load_toml(s:deinft_toml, {'lazy': 1})
call dein#end()
call dein#save_state()
endif

if has('vim_starting') && dein#check_install()
if !has('vim_starting') && dein#check_install()
call dein#install()
endif

let g:mapleader = "\<Space>"

syntax enable

filetype plugin indent on
Expand Down

0 comments on commit e05ff06

Please sign in to comment.