Skip to content

Commit

Permalink
Merge pull request #15 from janlazo/filetype
Browse files Browse the repository at this point in the history
WIP: Move plugin to ftdetect,ftplugin
  • Loading branch information
Yatao Li authored May 25, 2019
2 parents ebd96c9 + 634b85e commit 2a3a405
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
1 change: 1 addition & 0 deletions ftdetect/ps1.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
autocmd BufNewFile,BufRead *.ps*1 setfiletype ps1
12 changes: 5 additions & 7 deletions plugin/coc-powershell.vim → ftplugin/ps1.vim
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
if exists('s:loaded_ftplugin')
finish
endif
let s:loaded_ftplugin = 1
let s:vimscript_dir = expand('<sfile>:p:h')
function! s:PSESSetup ()
let g:pses_dir = resolve(expand(s:vimscript_dir . '/../PowerShellEditorServices/PowerShellEditorServices'))
Expand Down Expand Up @@ -42,10 +46,4 @@ function! s:PSESSetup ()
\)
endfunction

" Set the file type to ps1 for ps1, psm1, and psd1
" 'ps1' is what vim-polyglot uses for styling
if(&filetype == "")
autocmd BufNewFile,BufRead *.ps*1 set filetype=ps1
endif

autocmd FileType ps1,psd1,psm1 call s:PSESSetup()
call s:PSESSetup()

0 comments on commit 2a3a405

Please sign in to comment.