aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorA Farzat <a@farzat.xyz>2024-10-02 00:22:35 +0900
committerA Farzat <a@farzat.xyz>2024-10-02 00:22:35 +0900
commit8609c77b9c2360153436159d75c815486e463d24 (patch)
treeabd3828cdd9671818408a627524bcd28e4409178
parent7cbefbb9acea27c18718d32a3c20b87886971e8a (diff)
downloadnvim-8609c77b9c2360153436159d75c815486e463d24.tar.gz
nvim-8609c77b9c2360153436159d75c815486e463d24.zip
Add ftplugins
-rw-r--r--ftplugin/c.lua10
-rw-r--r--ftplugin/c.vim4
-rw-r--r--ftplugin/css.vim1
-rw-r--r--ftplugin/html.vim1
-rw-r--r--ftplugin/info.vim5
-rw-r--r--ftplugin/javascript.vim3
-rw-r--r--ftplugin/json.vim1
-rw-r--r--ftplugin/lua.vim3
-rw-r--r--ftplugin/markdown.vim1
-rw-r--r--ftplugin/processing.vim1
-rw-r--r--ftplugin/python.vim3
-rw-r--r--ftplugin/sh.vim2
-rw-r--r--ftplugin/tex.vim4
13 files changed, 39 insertions, 0 deletions
diff --git a/ftplugin/c.lua b/ftplugin/c.lua
new file mode 100644
index 0000000..d6e872d
--- /dev/null
+++ b/ftplugin/c.lua
@@ -0,0 +1,10 @@
+vim.api.nvim_buf_create_user_command(0, "ToggleComment", function()
+ if
+ require("Comment.ft").get("c", require("Comment.utils").ctype.linewise)
+ == "//%s"
+ then
+ require("Comment.ft").set("c", "/*%s*/")
+ else
+ require("Comment.ft").set("c", "//%s")
+ end
+end, {})
diff --git a/ftplugin/c.vim b/ftplugin/c.vim
new file mode 100644
index 0000000..1550367
--- /dev/null
+++ b/ftplugin/c.vim
@@ -0,0 +1,4 @@
+command-buffer Compile w | make %:r:S
+command-buffer CompileM w | !gcc -o %:r:S %:S -lm
+command-buffer Make w | !make %:r:S
+command-buffer -nargs=* Run split | terminal chmod +x %:p:S; %:p:S <args>
diff --git a/ftplugin/css.vim b/ftplugin/css.vim
new file mode 100644
index 0000000..46cf568
--- /dev/null
+++ b/ftplugin/css.vim
@@ -0,0 +1 @@
+setlocal tabstop=2
diff --git a/ftplugin/html.vim b/ftplugin/html.vim
new file mode 100644
index 0000000..46cf568
--- /dev/null
+++ b/ftplugin/html.vim
@@ -0,0 +1 @@
+setlocal tabstop=2
diff --git a/ftplugin/info.vim b/ftplugin/info.vim
new file mode 100644
index 0000000..f725e8d
--- /dev/null
+++ b/ftplugin/info.vim
@@ -0,0 +1,5 @@
+if &buftype =~? 'nofile'
+ nmap <buffer> gu <Plug>(InfoUp)
+ nmap <buffer> gn <Plug>(InfoNext)
+ nmap <buffer> gp <Plug>(InfoPrev)
+endif
diff --git a/ftplugin/javascript.vim b/ftplugin/javascript.vim
new file mode 100644
index 0000000..0269951
--- /dev/null
+++ b/ftplugin/javascript.vim
@@ -0,0 +1,3 @@
+command-buffer -nargs=* Run split | terminal chmod +x %:p:S; %:p:S <args>
+command-buffer -nargs=* WRun w | Run <args>
+setlocal tabstop=2
diff --git a/ftplugin/json.vim b/ftplugin/json.vim
new file mode 100644
index 0000000..46cf568
--- /dev/null
+++ b/ftplugin/json.vim
@@ -0,0 +1 @@
+setlocal tabstop=2
diff --git a/ftplugin/lua.vim b/ftplugin/lua.vim
new file mode 100644
index 0000000..0269951
--- /dev/null
+++ b/ftplugin/lua.vim
@@ -0,0 +1,3 @@
+command-buffer -nargs=* Run split | terminal chmod +x %:p:S; %:p:S <args>
+command-buffer -nargs=* WRun w | Run <args>
+setlocal tabstop=2
diff --git a/ftplugin/markdown.vim b/ftplugin/markdown.vim
new file mode 100644
index 0000000..4e41779
--- /dev/null
+++ b/ftplugin/markdown.vim
@@ -0,0 +1 @@
+setlocal tabstop=4
diff --git a/ftplugin/processing.vim b/ftplugin/processing.vim
new file mode 100644
index 0000000..2550b8e
--- /dev/null
+++ b/ftplugin/processing.vim
@@ -0,0 +1 @@
+command-buffer WRun w | make
diff --git a/ftplugin/python.vim b/ftplugin/python.vim
new file mode 100644
index 0000000..6dd1221
--- /dev/null
+++ b/ftplugin/python.vim
@@ -0,0 +1,3 @@
+command-buffer -nargs=* Run split | terminal chmod +x %:p:S; %:p:S <args>
+command-buffer -nargs=* WRun w | Run <args>
+setlocal textwidth=79
diff --git a/ftplugin/sh.vim b/ftplugin/sh.vim
new file mode 100644
index 0000000..9d9e5a4
--- /dev/null
+++ b/ftplugin/sh.vim
@@ -0,0 +1,2 @@
+command-buffer -nargs=* Run split | terminal chmod +x %:p:S; %:p:S <args>
+command-buffer -nargs=* WRun w | Run <args>
diff --git a/ftplugin/tex.vim b/ftplugin/tex.vim
new file mode 100644
index 0000000..783fab6
--- /dev/null
+++ b/ftplugin/tex.vim
@@ -0,0 +1,4 @@
+" Settings for tex files.
+setlocal keywordprg=texdoc
+setlocal spell spelllang=en
+setlocal tabstop=2