mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-25 18:07:07 +09:00
Merge
This commit is contained in:
@@ -200,7 +200,7 @@ Default plugin options:
|
|||||||
default value: `on`
|
default value: `on`
|
||||||
|
|
||||||
* `ftoptions`: by default, micro will set some options based on the filetype. At the moment, micro will
|
* `ftoptions`: by default, micro will set some options based on the filetype. At the moment, micro will
|
||||||
use tabs for makefiles and spaces for python files regardless of your settings. If you would like to
|
use tabs for makefiles and spaces for python and yaml files regardless of your settings. If you would like to
|
||||||
disable this behavior turn this option off.
|
disable this behavior turn this option off.
|
||||||
|
|
||||||
default value: `on`
|
default value: `on`
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ want a callback before the action is executed, use `preAction()`. In this case
|
|||||||
the boolean returned specifies whether or not the action should be executed
|
the boolean returned specifies whether or not the action should be executed
|
||||||
after the lua code completes.
|
after the lua code completes.
|
||||||
|
|
||||||
Another useful callback to know about which is not a action is
|
Another useful callback to know about which is not an action is
|
||||||
`onViewOpen(view)` which is called whenever a new view is opened and the new
|
`onViewOpen(view)` which is called whenever a new view is opened and the new
|
||||||
view is passed in. This is useful for setting local options based on the filetype,
|
view is passed in. This is useful for setting local options based on the filetype,
|
||||||
for example turning off `tabstospaces` only for Go files when they are opened.
|
for example turning off `tabstospaces` only for Go files when they are opened.
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ function onViewOpen(view)
|
|||||||
|
|
||||||
if ft == "makefile" or ft == "go" then
|
if ft == "makefile" or ft == "go" then
|
||||||
SetOption("tabstospaces", "off")
|
SetOption("tabstospaces", "off")
|
||||||
elseif ft == "python" or ft == "python2" or ft == "python3" then
|
elseif ft == "python" or ft == "python2" or ft == "python3" or ft == "yaml" then
|
||||||
SetOption("tabstospaces", "on")
|
SetOption("tabstospaces", "on")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user