[nvim] use the ftplugin mechanism instead of FileType autocommands

This commit is contained in:
Dmytro Meleshko 2019-12-15 20:39:36 +02:00
parent d4e04125a6
commit 545770bc9e
15 changed files with 12 additions and 35 deletions

View file

@ -0,0 +1,2 @@
" verbose set matchpairs?
" setlocal matchpairs-=<:>

View file

@ -0,0 +1,3 @@
echomsg "did ftplugin"
setlocal matchpairs-=<:>
let b:random_variable = 123

View file

@ -0,0 +1 @@
execute 'source' fnameescape(expand('<sfile>:p:h').'/javascript.vim')

1
nvim/ftplugin/asm.vim Normal file
View file

@ -0,0 +1 @@
setlocal commentstring=#%s

1
nvim/ftplugin/json.vim Normal file
View file

@ -0,0 +1 @@
syntax match Comment +\/\/.\+$+

View file

@ -0,0 +1 @@
execute 'source' fnameescape(expand('<sfile>:p:h').'/text.vim')

1
nvim/ftplugin/python.vim Normal file
View file

@ -0,0 +1 @@
Indent 4

1
nvim/ftplugin/text.vim Normal file
View file

@ -0,0 +1 @@
call pencil#init()

View file

@ -2,7 +2,7 @@ let g:nvim_dotfiles_dir = expand('<sfile>:p:h')
let g:vim_ide = get(g:, 'vim_ide', 0)
let &runtimepath = g:nvim_dotfiles_dir.','.&runtimepath
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')

View file

@ -1,7 +1,3 @@
augroup vimrc-javascript
autocmd FileType javascript,typescript setlocal matchpairs-=<:>
augroup END
if !g:vim_ide | finish | endif
call coc#add_extension('coc-tsserver', 'coc-eslint', 'coc-prettier')

View file

@ -1,8 +1,3 @@
augroup vimrc-languages-json
autocmd!
autocmd FileType json syntax match Comment +\/\/.\+$+
augroup END
if !g:vim_ide | finish | endif
call coc#add_extension('coc-json')

View file

@ -1,11 +1,3 @@
let g:vim_markdown_conceal = 0
let g:vim_markdown_conceal_code_blocks = 0
augroup vimrc-languages-markdown
autocmd!
autocmd FileType markdown call pencil#init()
augroup END
if !g:vim_ide | finish | endif
let g:coc_filetypes += ['markdown']

View file

@ -1,10 +1,3 @@
augroup vimrc-language-python
autocmd!
autocmd FileType python Indent 4
augroup END
let g:python_highlight_all = 1
if !g:vim_ide | finish | endif
call coc#add_extension('coc-python')

View file

@ -1,9 +1,5 @@
let g:rust_recommended_style = 0
augroup vimrc-rust
autocmd FileType rust setlocal matchpairs-=<:>
augroup END
if !g:vim_ide | finish | endif
call coc#add_extension('coc-rls')

View file

@ -1,6 +0,0 @@
augroup vimrc-languages-text
autocmd!
autocmd FileType text call pencil#init()
augroup END
if !g:vim_ide | finish | endif