mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-19 15:27:20 +09:00
File diff suppressed because one or more lines are too long
@@ -167,6 +167,12 @@ Default plugin options:
|
||||
|
||||
default value: `on`
|
||||
|
||||
* `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
|
||||
disable this behavior turn this option off.
|
||||
|
||||
default value: `on`
|
||||
|
||||
Any option you set in the editor will be saved to the file
|
||||
~/.config/micro/settings.json so, in effect, your configuration file will be
|
||||
created for you. If you'd like to take your configuration with you to another
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
if GetOption("ftoptions") == nil then
|
||||
AddOption("ftoptions", true)
|
||||
end
|
||||
|
||||
function onViewOpen(view)
|
||||
if not GetOption("ftoptions") then
|
||||
return
|
||||
end
|
||||
|
||||
local ft = view.Buf.Settings["filetype"]
|
||||
|
||||
if ft == "makefile" or ft == "go" then
|
||||
SetOption("tabstospaces", "off")
|
||||
elseif ft == "python" then
|
||||
elseif ft == "python" or ft == "python2" or ft == "python3" then
|
||||
SetOption("tabstospaces", "on")
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user