aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/lua/vim')
-rw-r--r--runtime/lua/vim/filetype.lua13
-rw-r--r--runtime/lua/vim/ui.lua25
2 files changed, 37 insertions, 1 deletions
diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua
index 7fa2fbe001..ff44f48195 100644
--- a/runtime/lua/vim/filetype.lua
+++ b/runtime/lua/vim/filetype.lua
@@ -756,6 +756,7 @@ local extension = {
zu = "zimbu",
zut = "zimbutempl",
zsh = "zsh",
+ vala = "vala",
E = function() vim.fn["dist#ft#FTe"]() end,
EU = function() vim.fn["dist#ft#EuphoriaCheck"]() end,
EW = function() vim.fn["dist#ft#EuphoriaCheck"]() end,
@@ -788,7 +789,7 @@ local extension = {
ex = function() vim.fn["dist#ft#ExCheck"]() end,
exu = function() vim.fn["dist#ft#EuphoriaCheck"]() end,
exw = function() vim.fn["dist#ft#EuphoriaCheck"]() end,
- frm = function() vim.fn["dist#ft#FTVB"]("form") end,
+ frm = function() vim.fn["dist#ft#FTbas"]("form") end,
fs = function() vim.fn["dist#ft#FTfs"]() end,
h = function() vim.fn["dist#ft#FTheader"]() end,
htm = function() vim.fn["dist#ft#FThtml"]() end,
@@ -1388,6 +1389,16 @@ local pattern = {
["zlog.*"] = starsetf('zsh'),
["zsh.*"] = starsetf('zsh'),
["ae%d+%.txt"] = 'mail',
+ ["snd%.%d+"] = "mail",
+ ["%.letter%.%d+"] = "mail",
+ ["%.article%.%d+"] = "mail",
+ ["pico%.%d+"] = "mail",
+ ["mutt%-.*%-%w+"] = "mail",
+ ["neomutt%-.*%-%w+"] = "mail",
+ ["muttng%-.*%-%w+"] = "mail",
+ ["mutt" .. string.rep("[%w_-]", 6)] = "mail",
+ ["neomutt" .. string.rep("[%w_-]", 6)] = "mail",
+ ["/tmp/SLRN[0-9A-Z.]+"] = "mail",
["[a-zA-Z0-9].*Dict"] = function() vim.fn["dist#ft#FTfoam"]() end,
["[a-zA-Z0-9].*Dict%..*"] = function() vim.fn["dist#ft#FTfoam"]() end,
["[a-zA-Z].*Properties"] = function() vim.fn["dist#ft#FTfoam"]() end,
diff --git a/runtime/lua/vim/ui.lua b/runtime/lua/vim/ui.lua
index 9568b60fd0..0f2de6ce5c 100644
--- a/runtime/lua/vim/ui.lua
+++ b/runtime/lua/vim/ui.lua
@@ -18,6 +18,24 @@ local M = {}
--- Called once the user made a choice.
--- `idx` is the 1-based index of `item` within `item`.
--- `nil` if the user aborted the dialog.
+---
+---
+--- Example:
+--- <pre>
+--- vim.ui.select({ 'tabs', 'spaces' }, {
+--- prompt = 'Select tabs or spaces:',
+--- format_item = function(item)
+--- return "I'd like to choose " .. item
+--- end,
+--- }, function(choice)
+--- if choice == 'spaces' then
+--- vim.o.expandtab = true
+--- else
+--- vim.o.expandtab = false
+--- end
+--- end)
+--- </pre>
+
function M.select(items, opts, on_choice)
vim.validate {
items = { items, 'table', false },
@@ -57,6 +75,13 @@ end
--- Called once the user confirms or abort the input.
--- `input` is what the user typed.
--- `nil` if the user aborted the dialog.
+---
+--- Example:
+--- <pre>
+--- vim.ui.input({ prompt = 'Select value for shiftwidth: ' }, function(input)
+--- vim.o.shiftwidth = tonumber(input)
+--- end)
+--- </pre>
function M.input(opts, on_confirm)
vim.validate {
on_confirm = { on_confirm, 'function', false },