Skip to content

Commit

Permalink
Added base files for setting for each filetypes.
Browse files Browse the repository at this point in the history
To add setting for new filetype, edit dein_filetype.toml and execute
below command.
call dein#recache_runtimepath()
  • Loading branch information
n-hachi committed Jan 1, 2020
1 parent 3e512c0 commit 88f91b9
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
12 changes: 5 additions & 7 deletions init.vim
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,20 @@ if !isdirectory(s:dein_repo_dir)
endif
let &runtimepath = s:dein_repo_dir . "," . &runtimepath


" Required:
let s:rc_dir = fnamemodify(expand('<sfile>'),':h') . '/rc'
if dein#load_state(s:dein_dir)
call dein#begin(s:dein_dir)
let s:toml_file = s:rc_dir . '/dein.toml'
let s:toml_filetype_file = s:rc_dir . '/dein_filetype.toml'
let s:toml_lazy_file = s:rc_dir . '/dein_lazy.toml'
call dein#load_toml(s:toml_file, {'lazy': 0})
call dein#load_toml(s:toml_filetype_file)
call dein#load_toml(s:toml_lazy_file,{'lazy': 1})

call dein#end()
call dein#save_state()
endif

" Required:
filetype plugin indent on
syntax enable

" If you want to install not installed plugins on startup.
if dein#check_install()
call dein#install()
Expand All @@ -42,7 +39,8 @@ function! s:source_rc(path, ...)
endif
endfunction


call s:source_rc('/options.rc.vim')
call s:source_rc('/mappings.rc.vim')

filetype plugin indent on
syntax enable
13 changes: 13 additions & 0 deletions rc/dein_filetype.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[ftplugin]
_ = '''
'''

html = '''
" Indent settings.
setlocal softtabstop=2
setlocal shiftwidth=2
setlocal smarttab
setlocal expandtab
setlocal shiftround
'''

2 changes: 2 additions & 0 deletions rc/options.rc.vim
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ set nobackup
set noswapfile
set backupdir-=.

"" Default indent settings.
"" If want to change according to filetype, edit dein_filetyle.toml.
" Smart tab setting.
set smarttab
" Exchange tab to space.
Expand Down

0 comments on commit 88f91b9

Please sign in to comment.