Skip to content

Commit

Permalink
change to use <script> from <sfile>
Browse files Browse the repository at this point in the history
  • Loading branch information
sasaplus1 committed Dec 26, 2024
1 parent 65bed4e commit 7d01eb9
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 16 deletions.
2 changes: 1 addition & 1 deletion vim/plugin-manager.vim
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ endif
call dein#begin(s:plugin_dir)
call dein#add(s:dein_dir)

let plugin_files = split(glob(expand('<sfile>:h') . '/plugins/*.vim'), '\n')
let plugin_files = split(glob(expand('<script>:h') . '/plugins/*.vim'), '\n')

for plugin_file in plugin_files
execute 'source' plugin_file
Expand Down
2 changes: 1 addition & 1 deletion vim/plugins/coc.nvim.vim
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ endfunction
" https://github.com/neoclide/coc.nvim/issues/1826#issuecomment-1149259027

call dein#add('neoclide/coc.nvim', {
\ 'hooks_file' : expand('<sfile>:p'),
\ 'hooks_file' : expand('<script>:p'),
\ 'lazy' : 1,
\ 'merged' : 0,
\ 'on_cmd' : ['<Plug>(coc-'],
Expand Down
2 changes: 1 addition & 1 deletion vim/plugins/ctrlp.vim.vim
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ function! s:hook_source() abort
endfunction

call dein#add('ctrlpvim/ctrlp.vim', {
\ 'hooks_file' : expand('<sfile>:p'),
\ 'hooks_file' : expand('<script>:p'),
\ 'lazy' : 1,
\ 'on_map' : ['<C-p>', ',ub', ',ug', ',ul', ',um', '<Plug>(CtrlP'],
\ })
Expand Down
2 changes: 1 addition & 1 deletion vim/plugins/fzf.vim.vim
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ function! s:hook_source() abort
endfunction

call dein#add('junegunn/fzf.vim', {
\ 'hooks_file' : expand('<sfile>:p'),
\ 'hooks_file' : expand('<script>:p'),
\ 'lazy' : 1,
\ 'on_map' : [',ch', ',gs', ',gm', ',rg', ',rG', '<Plug>(fzf-', '<C-p>', ',ub', ',ug', ',ul', ',um'],
\ 'on_source' : 'fzf',
Expand Down
2 changes: 1 addition & 1 deletion vim/plugins/lightline.vim.vim
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ endfunction

" NOTE: ColorSchemeイベントは初回起動時に必要
call dein#add('itchyny/lightline.vim', {
\ 'hooks_file' : expand('<sfile>:p'),
\ 'hooks_file' : expand('<script>:p'),
\ 'lazy' : 1,
\ 'on_event' : ['ColorScheme', 'VimEnter']
\ })
Expand Down
9 changes: 4 additions & 5 deletions vim/plugins/nvim-treesitter.vim
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ if !has('nvim')
finish
endif

" このファイルの拡張子をvimからluaに変更したもの
let s:config = expand('<sfile>:r') . '.lua'

function! s:hook_source() abort
" hook_source {{{
" このスクリプトのパスを取得する
let script = dein#get('nvim-treesitter').hooks_file
" Luaの設定ファイルを読み込む
execute 'luafile' s:config
execute 'luafile' fnamemodify(script, ':r') . '.lua'
" nvim-treesitterでの折りたたみを使用する
setglobal foldmethod=expr
setglobal foldexpr=nvim_treesitter#foldexpr()
Expand All @@ -26,7 +25,7 @@ function! s:hook_done_update() abort
endfunction

call dein#add('nvim-treesitter/nvim-treesitter', {
\ 'hooks_file' : expand('<sfile>:p'),
\ 'hooks_file' : expand('<script>:p'),
\ 'merged' : 0,
\ })

Expand Down
2 changes: 1 addition & 1 deletion vim/plugins/operator-camelize.vim.vim
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function! s:hook_source() abort
endfunction

call dein#add('tyru/operator-camelize.vim', {
\ 'hooks_file' : expand('<sfile>:p'),
\ 'hooks_file' : expand('<script>:p'),
\ 'lazy' : 1,
\ 'on_source' : 'vim-operator-user',
\ 'on_map' : ['c', '_', '<Plug>(operator-'],
Expand Down
2 changes: 1 addition & 1 deletion vim/plugins/vfiler.vim.vim
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ endfunction
" 表示が崩れていたのはvim-parenmatchのlazyloadのタイミング設定が悪かった
" coc.nvimをlazyloadするようにしたらまた崩れるようになった
call dein#add('obaland/vfiler.vim', {
\ 'hooks_file' : expand('<sfile>:p'),
\ 'hooks_file' : expand('<script>:p'),
\ 'lazy' : 1,
\ 'on_cmd' : ['VFiler'],
\ 'on_map' : [',vf', ',vF'],
Expand Down
2 changes: 1 addition & 1 deletion vim/plugins/vim-gf-user.vim
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function! s:hook_source() abort
endfunction

call dein#add('kana/vim-gf-user', {
\ 'hooks_file' : expand('<sfile>:p'),
\ 'hooks_file' : expand('<script>:p'),
\ 'lazy' : 1,
\ 'on_ft' : [
\ 'javascript',
Expand Down
2 changes: 1 addition & 1 deletion vim/plugins/vim-gruvbox8.vim
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function! s:hook_source() abort
endfunction

call dein#add('lifepillar/vim-gruvbox8', {
\ 'hooks_file' : expand('<sfile>:p'),
\ 'hooks_file' : expand('<script>:p'),
\ 'lazy' : 1,
\ 'merged' : 0,
\ 'on_event' : ['ColorScheme', 'VimEnter'],
Expand Down
2 changes: 1 addition & 1 deletion vim/plugins/vim-operator-surround.vim
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function! s:hook_source() abort
endfunction

call dein#add('rhysd/vim-operator-surround', {
\ 'hooks_file' : expand('<sfile>:p'),
\ 'hooks_file' : expand('<script>:p'),
\ 'lazy' : 1,
\ 'on_map' : [
\ 'sa',
Expand Down
2 changes: 1 addition & 1 deletion vim/plugins/vim-parenmatch.vim
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function! s:hook_source() abort
endfunction

call dein#add('itchyny/vim-parenmatch', {
\ 'hooks_file' : expand('<sfile>:p'),
\ 'hooks_file' : expand('<script>:p'),
\ 'lazy' : 1,
\ 'on_event' : ['VimEnter'],
\ })
Expand Down

0 comments on commit 7d01eb9

Please sign in to comment.