aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormitermayer <mitermayer.reis@gmail.com>2018-11-05 13:17:20 -0800
committermitermayer <mitermayer.reis@gmail.com>2019-08-25 21:14:06 -0700
commit2536a82999effdf6509df606795ed51404d204c9 (patch)
treed5e025aecf2448ead8c939255a1bae758f7ea92c
parent4177c919e7f7eb33855e118c4a85571af1bd9a42 (diff)
downloadvim-prettier-2536a82999effdf6509df606795ed51404d204c9.tar.xz
Rebasing vim-prettier plugin Pull Request 120 to 1.0 branch
This is a rebase of https://github.com/prettier/vim-prettier/pull/120/files
-rw-r--r--ftdetect/lua.vim1
-rw-r--r--ftdetect/php.vim1
-rw-r--r--ftdetect/python.vim1
-rw-r--r--ftdetect/swift.vim1
-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.json6
9 files changed, 49 insertions, 1 deletions
diff --git a/ftdetect/lua.vim b/ftdetect/lua.vim
new file mode 100644
index 0000000..b59148c
--- /dev/null
+++ b/ftdetect/lua.vim
@@ -0,0 +1 @@
+autocmd BufNewFile,BufReadPost *.lua setfiletype lua
diff --git a/ftdetect/php.vim b/ftdetect/php.vim
new file mode 100644
index 0000000..1e3236f
--- /dev/null
+++ b/ftdetect/php.vim
@@ -0,0 +1 @@
+autocmd BufNewFile,BufReadPost *.php setfiletype php
diff --git a/ftdetect/python.vim b/ftdetect/python.vim
new file mode 100644
index 0000000..a33fa5d
--- /dev/null
+++ b/ftdetect/python.vim
@@ -0,0 +1 @@
+autocmd BufNewFile,BufReadPost *.python setfiletype python
diff --git a/ftdetect/swift.vim b/ftdetect/swift.vim
new file mode 100644
index 0000000..af59e95
--- /dev/null
+++ b/ftdetect/swift.vim
@@ -0,0 +1 @@
+autocmd BufNewFile,BufReadPost *.swift setfiletype swift
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 16a35e3..153a4e6 100644
--- a/package.json
+++ b/package.json
@@ -9,6 +9,10 @@
"url": "git://github.com/prettier/vim-prettier.git"
},
"dependencies": {
- "prettier": "^1.16.4"
+ "prettier": "^1.16.4",
+ "@prettier/plugin-lua": "0.0.1",
+ "@prettier/plugin-php": "^0.9.0",
+ "@prettier/plugin-python": "prettier/plugin-python",
+ "@prettier/plugin-swift": "prettier/plugin-swift"
}
}