Micro: ( no issue: just help! ) settings.json

Created on 10 Aug 2020  路  4Comments  路  Source: zyedidia/micro

hi guys, THANK YOU SO MUCH FOR A BEAUTIFUL TEXT EDITOR both complex yet SO simple to use at the same time?! THANK YOU!!! anyways...
I tried out some of the extra values in settings.json, but I am doing something wrong each time (json noob!) could you please tell me where I am going wrong? here they are:

{
    "colorscheme": "monokai"
    "basename": "false"
    "clipboard": "terminal"
    "diffgutter": "true"
    "divreverse": "true"
    "Alt-g": "UnbindKey"
    "mouse": "true"
    "xterm": "true"
    "statusformatl": "$(filename)  [$(modified)]  ($(line),$(col)) $(status.paste) "
    "statusformatr": "( $(opt:filetype) : $(opt:fileformat) : $(opt:encoding)"
    "sucmd": "su -c"
    "ft:bash":{
        "tabsize":2
  },
    "*.sh":{
    "tabsize":2
  },
    "tabstospaces":false
    "tabsize":4
}

I have tried to follow all the "options" page in the wiki, but to no avail, just me being a dumb-ass! side-note: perhaps providing the full set of default values displayed like above (only correctly! :) at the bottom of the options page? thus allowing us to see a full example, and allowing us to simply copy/paste all the default values and just tweak them to our liking? obviously, adding any values described in the options page that arent default. Thank you again!

Most helpful comment

The first issue is that json requires a comma after every line. Next, options should only be set to non-default values in the settings.json so some of these should be omitted (micro will automatically remove them). Also boolean options should be specified without quotes. Finally Alt-g should be unbound in bindings.json not settings.json. Here's what you should have roughly:

settings.json:

{
    "*.sh": {
        "tabsize": 2
    },
    "clipboard": "terminal",
    "colorscheme": "monokai",
    "diffgutter": true,
    "ft:bash": {
        "tabsize": 2
    },
    "statusformatl": "$(filename) $(modified)($(line),$(col)) $(status.paste) ",
    "statusformatr": "$(opt:filetype) : $(opt:fileformat) : $(opt:encoding)",
    "sucmd": "su -c",
    "xterm": true
}

bindings.json:

{
    "Alt-g": "None"
}

I agree that it would be a good idea to include a complete and correctly formatted json description of the options in the documentation (I will close this issue when that is added). Also keep in mind that you can always set options in the editor > set option value and this will edit the settings.json with correct formatting and type information.

All 4 comments

The first issue is that json requires a comma after every line. Next, options should only be set to non-default values in the settings.json so some of these should be omitted (micro will automatically remove them). Also boolean options should be specified without quotes. Finally Alt-g should be unbound in bindings.json not settings.json. Here's what you should have roughly:

settings.json:

{
    "*.sh": {
        "tabsize": 2
    },
    "clipboard": "terminal",
    "colorscheme": "monokai",
    "diffgutter": true,
    "ft:bash": {
        "tabsize": 2
    },
    "statusformatl": "$(filename) $(modified)($(line),$(col)) $(status.paste) ",
    "statusformatr": "$(opt:filetype) : $(opt:fileformat) : $(opt:encoding)",
    "sucmd": "su -c",
    "xterm": true
}

bindings.json:

{
    "Alt-g": "None"
}

I agree that it would be a good idea to include a complete and correctly formatted json description of the options in the documentation (I will close this issue when that is added). Also keep in mind that you can always set options in the editor > set option value and this will edit the settings.json with correct formatting and type information.

Wow that was fast! thank you so much, everything looks perfect now!
Used Micro now for a couple years and never thought to change anything as its pretty much perfect TBH! (OH! thanks for telling me about controlling the settings.json via the editors command-line! again... a simple answer for a more complex task! LOVE MICRO.)
And excellent! by all means leave this open till the default values are up for us to use! THANK YOU!
The last thing to do is check out the extra plugins... so one last question, if I could possibly?
Just installed a few to see what they are like, tried:

  • gotham-colors
  • fzf (EDIT: found out this works via micro's commandline)
  • filemanager
  • fmt

1) How do I use them? I see no example anywhere (unless I am just not looking in the right places?)
2) Only difference I have now is upon opening any file I see this and have to confirm it (is this normal?):

fmt:4: attempt to call a non-function object
stack traceback:
        fmt:4: in main chunk
        [G]: ?

Press enter to continue.

Thank you so much for your time, effort and prompt replies! I understand how busy you must be maintaining such an awesome project (and... dealing with idiots like me! :) ITS APPRECIATED!

EDIT: Im no genius, but as this editor (and its staff) has been so good to me, If a write-up on the plugins (a more verbose description with how to use them) is needed, I am more than happy to contribute this once I have learned how to use them myself?

I believe the fmt plugin has not been updated for version 2.0 yet. Most plugins should contain some documentation, so try > help plugin-name.

plugins with help available:

  1. bounce
  2. comment
  3. join-lines
  4. linter
  5. manipulator
  6. quoter
  7. status
  8. wc

The are a few missing, they do not show as options when using tab-completion, and issuing the command instead says:
"sorry, no help for PluginName"
(fzf / filemanager / gotham-colors etc.)
Thank you again!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Rbagman picture Rbagman  路  4Comments

ns-cweber picture ns-cweber  路  4Comments

aerth picture aerth  路  4Comments

xintrea picture xintrea  路  3Comments

bitcoinmeetups picture bitcoinmeetups  路  3Comments