mirror of
https://github.com/zyedidia/micro
synced 2024-11-05 17:41:24 +00:00
parent
e7ee194acf
commit
f364965ac0
3 changed files with 20 additions and 6 deletions
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
|
||||
|
|
Loading…
Reference in a new issue