aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitermayer Reis <mitermayer.reis@gmail.com>2018-11-05 14:34:16 -0800
committerGitHub <noreply@github.com>2018-11-05 14:34:16 -0800
commitc61d6ecce37e04e4257e1f4a0ec3c53cdf972ae5 (patch)
tree545847ceded5f9c3ef73d28dc9e73d41898713e2
parentf84a45f6f1332db9f7a0579214e76c207508f987 (diff)
parentccc58c21190c563128fe0c2eac28858790d68393 (diff)
downloadvim-prettier-c61d6ecce37e04e4257e1f4a0ec3c53cdf972ae5.tar.xz
Merge pull request #155 from prettier/adding-pluggin-support
Rebasing vim-prettier plugin Pull Request 120 to 1.0 branch
-rw-r--r--ftdetect/lua.vim3
-rw-r--r--ftdetect/php.vim3
-rw-r--r--ftdetect/python.vim3
-rw-r--r--ftdetect/swift.vim3
-rw-r--r--ftplugin/lua.vim10
-rw-r--r--ftplugin/php.vim10
-rw-r--r--ftplugin/python.vim10
-rw-r--r--ftplugin/swift.vim10
-rw-r--r--package.json4
9 files changed, 56 insertions, 0 deletions
diff --git a/ftdetect/lua.vim b/ftdetect/lua.vim
new file mode 100644
index 0000000..25550f7
--- /dev/null
+++ b/ftdetect/lua.vim
@@ -0,0 +1,3 @@
+augroup PrettierFileDetect
+ autocmd BufNewFile,BufReadPost *.lua setfiletype lua
+augroup end
diff --git a/ftdetect/php.vim b/ftdetect/php.vim
new file mode 100644
index 0000000..34e3604
--- /dev/null
+++ b/ftdetect/php.vim
@@ -0,0 +1,3 @@
+augroup PrettierFileDetect
+ autocmd BufNewFile,BufReadPost *.php setfiletype php
+augroup end
diff --git a/ftdetect/python.vim b/ftdetect/python.vim
new file mode 100644
index 0000000..ed6cf7a
--- /dev/null
+++ b/ftdetect/python.vim
@@ -0,0 +1,3 @@
+augroup PrettierFileDetect
+ autocmd BufNewFile,BufReadPost *.python setfiletype python
+augroup end
diff --git a/ftdetect/swift.vim b/ftdetect/swift.vim
new file mode 100644
index 0000000..6c31710
--- /dev/null
+++ b/ftdetect/swift.vim
@@ -0,0 +1,3 @@
+augroup PrettierFileDetect
+ autocmd BufNewFile,BufReadPost *.swift setfiletype swift
+augroup end
diff --git a/ftplugin/lua.vim b/ftplugin/lua.vim
new file mode 100644
index 0000000..8a58bde
--- /dev/null
+++ b/ftplugin/lua.vim
@@ -0,0 +1,10 @@
+let b:prettier_ft_default_args = {
+ \ 'parser': 'lua',
+ \ }
+
+augroup Prettier
+ autocmd!
+ if g:prettier#autoformat
+ autocmd BufWritePre *.lua call prettier#Autoformat()
+ endif
+augroup end
diff --git a/ftplugin/php.vim b/ftplugin/php.vim
new file mode 100644
index 0000000..92e3fc2
--- /dev/null
+++ b/ftplugin/php.vim
@@ -0,0 +1,10 @@
+let b:prettier_ft_default_args = {
+ \ 'parser': 'php',
+ \ }
+
+augroup Prettier
+ autocmd!
+ if g:prettier#autoformat
+ autocmd BufWritePre *.php call prettier#Autoformat()
+ endif
+augroup end
diff --git a/ftplugin/python.vim b/ftplugin/python.vim
new file mode 100644
index 0000000..ec76040
--- /dev/null
+++ b/ftplugin/python.vim
@@ -0,0 +1,10 @@
+let b:prettier_ft_default_args = {
+ \ 'parser': 'python',
+ \ }
+
+augroup Prettier
+ autocmd!
+ if g:prettier#autoformat
+ autocmd BufWritePre *.py call prettier#Autoformat()
+ endif
+augroup end
diff --git a/ftplugin/swift.vim b/ftplugin/swift.vim
new file mode 100644
index 0000000..a6753d5
--- /dev/null
+++ b/ftplugin/swift.vim
@@ -0,0 +1,10 @@
+let b:prettier_ft_default_args = {
+ \ 'parser': 'swift',
+ \ }
+
+augroup Prettier
+ autocmd!
+ if g:prettier#autoformat
+ autocmd BufWritePre *.swift call prettier#Autoformat()
+ endif
+augroup end
diff --git a/package.json b/package.json
index cc35f7c..fc61873 100644
--- a/package.json
+++ b/package.json
@@ -9,6 +9,10 @@
"url": "git://github.com/prettier/vim-prettier.git"
},
"dependencies": {
+ "@prettier/plugin-lua": "0.0.1",
+ "@prettier/plugin-php": "^0.9.0",
+ "@prettier/plugin-python": "prettier/plugin-python",
+ "@prettier/plugin-swift": "prettier/plugin-swift",
"prettier": "^1.10.2"
}
}