by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Zachary Yedidia
    @zyedidia
    Oh, doesn't the bufpane:Autocomplete() action do this for you? It starts the autocompletion if it is not started, and if it is started it cycles.
    Ján Priner
    @priner
    yes but i want to use custom completer, not buffer completion
    Zachary Yedidia
    @zyedidia
    Ah I see
    Ayan Banerjee
    @Ayanrocks
    Hi, I need a little help here. I am a beginner and I am trying to add the utf--16 support to micro. The problem here is that I ha e added the utf16 support by hardcoding it for all files. Now the utf-16 LE file is working however utf-8's are not, as expected. So I need a way now to detect the file encoding to change the encoder between utf-8, utf-16LE and utf-16BE. Can anyone help me with that? I am unable to detect the file encoding.
    Zachary Yedidia
    @zyedidia
    Micro does not have support for autodetection and relies on the user to specify the encoding. If you want to open a file with a certain encoding, I recommend you use the command-line flag so you don't alter your global encoding settings. For example, micro -encoding utf-16BE file.txt then the file will be opened with the utf-16BE encoding. To reset your encoding option to default globally (default is utf-8) just run > reset encoding, or > set encoding utf-8.
    Ayan Banerjee
    @Ayanrocks
    What about this issue then ? zyedidia/micro#837
    Is there any plan to support for auto-detection of encoding without specifying
    Zachary Yedidia
    @zyedidia
    Ah that's an old issue. Non-utf8 encodings have been supported since v2.0.
    Ayan Banerjee
    @Ayanrocks
    Ok got it. Close that issue then
    Ayan Banerjee
    @Ayanrocks
    @zyedidia is this issue fixed? or anyone working on it? If not I would like to try fixing it. zyedidia/micro#1708
    matthyno
    @MatthyPlayz
    hello!
    dillon
    @insanetisane
    Hi! checking out micro for the first time. i'm messing around with some things. I have a question: is it possible to feed the output of a term command back to micro or a micro command? for example - output that's the name of a file, passed to the open command
    Zachary Yedidia
    @zyedidia
    @insanetisane Yes, this can be done with some Lua code. I recommend taking a look at the fzf plugin source code for an example: https://github.com/micro-editor/updated-plugins/blob/master/fzf/main.lua. In particular, you would want the shell.RunTermEmulator function.
    Zachary Yedidia
    @zyedidia
    @Ayanrocks That issue is not fixed. You can take a look, in particular at the search.go file in the internal buffer package which handles this. For efficiency micro performs the search match on each line separately instead of converting the buffer to a contiguous array of bytes before performing the search over everything (the buffer is stored as a line array internally). This explains why \n doesn't match at the moment. I think there are two methods to fix this: one is to check if the search pattern contains a newline and if so do the slow method of converting the buffer to a byte array and search on that. The other (and probably better) method is to implement an io.Reader interface for the line array structure and use the regexp search functions for matching on an io.Reader that are provided by the Go stdlib. Feel free to look into it, but I will probably try to fix it at some point if you don't get to it.
    dillon
    @insanetisane
    ok cool. thanks @zyedidia !
    Ayan Banerjee
    @Ayanrocks
    @zyedidia ok cool thanks. I will try to solve it and notify if more problems are faced. If I don't get to it, I will notify you to take a look at it
    Sibren Vasse
    @SibrenVasse
    Hi all, I recently switched from nano to micro, loving it! I've noticed a small issue that is bugging me for a while now. Under wayland (sway + fish + termite) 'cut line' is very slow. Especially noticeable when I keep the keybinding pressed for a while, the action can keep going several seconds after I let go. On xorg (I tested on gnome + fish + termite) cutting lines is instantaneous. Is this a known issue? I am using the released binary from Github.
    Deus Nefum
    @deusnefum_twitter
    @SibrenVasse has to be from the use of xsel or xclip. Micro tries to sync its clipboard with your GUI clipboard. Can you use xsel or xclip from your terminal and see if it's timing out or otherwise struggling?
    Sibren Vasse
    @SibrenVasse
    @deusnefum_twitter Ah that is probably it, xclip doesn't work on sway. Is there a way I can change the command used or disable it?
    Deus Nefum
    @deusnefum_twitter
    uh... maybe try setting "useprimary" to false.
    Sibren Vasse
    @SibrenVasse
    Mmm I see micro checks for wl-copy here. And if I cut a line, it is indeed on my clipboard... So the integration seems to work. Maybe wl-copy is just slow?
    Sibren Vasse
    @SibrenVasse
    Still slow with "useprimary": false. If I remove wl-clipboard it's fast, but then my clipboard is non functional in all applications :(
    dillon
    @insanetisane
    @zyedidia is it possible to pass options to fzf with that fzf plugin?
    like the --previewoption for example
    Zachary Yedidia
    @zyedidia
    @SibrenVasse If you use the nightly build you can set the clipboard option to internal.
    @insanetisane You could modify the source for it so that the call to RunTermEmulator passes fzf --preview=... instead of just fzf.
    Sibren Vasse
    @SibrenVasse
    @zyedidia awesome, that seems to 'solve' my issue
    pcavalcanti
    @pcavalcanti
    hello, is there any key to toggle softwrap on/off?
    Deus Nefum
    @deusnefum_twitter
    @pcavalcanti you can bind arbitrary commands to keys
    "Alt-S": "command:set softwrap off" you'd need another command to set it on
    if you want a true toggle you'd need a plugin to provide the function
    Ayan Banerjee
    @Ayanrocks
    @zyedidia I'm unable to solve the issue. Request you to take a look into it. also if its possible ping me on the PR. I want to see how you solved it.
    pcavalcanti
    @pcavalcanti
    @deusnefum_twitter thank you, I set Alt-W and now it works.
    pcavalcanti
    @pcavalcanti
    Is anyone able to move cursor to beginning / end of document in Putty? Both Ctrl-DownArrow or Ctrl-End doesn't work in Putty.
    Deus Nefum
    @deusnefum_twitter
    @pcavalcanti try going into raw mode and see if micro is getting those key sequences (and what it's getting them as). Ctrl-E, type "raw" press enter then press your key-combos and see what micro says.
    pcavalcanti
    @pcavalcanti
    @deusnefum_twitter When I press Ctrl-End or Ctrl-Home in Putty nothing happens. The same key sequences in other terminals micro says EventKey: Ctrl+End: "\x1b[1;5F" and EventKey: "Ctrl+Home: "\x1b[1;5H"
    Zachary Yedidia
    @zyedidia
    Try using kitty instead of putty. Kitty is a fork of putty with support for these key sequences among other things. https://github.com/cyd01/KiTTY
    Denis Smal'
    @vsile
    изображение.png
    I'd like to use micro from go exec command:
    err := exec.Command("/bin/sh", "-c", "micro ./getenv.go").Run()
    Micro opens the file. I can edit something. But I cannot save!
    The error is "Cannot save scratch buffer".
    I tried to use -debug arg, but log.txt includes only one line: "Micro started"
    Denis Smal'
    @vsile

    I've got it working!
    cmd := exec.Command("/bin/sh", "-c", "micro ./getenv.go")
    cmd.Stdout = os.Stdout
    err := cmd.Run()

    Now I can save the file!

    Zachary Yedidia
    @zyedidia
    Yes micro tries to detect whether its stdout is a pipe or not to determine if it is running in a pipe chain. When running in “piped mode” micro doesn’t let you save and instead when you quit prints the buffer contents to stdout
    Koki Fushimi
    @Paalon

    I tried to add some snippets of Julia to snippets plugin for example:

    snippet alpha
        α

    I have made this file and place it to ~/.config/micro/plug/snippets/snippets/julia.snippets but it seems to crush. As far as I searched other language's snippets, I can't find what's wrong. Does anyone have any idea?

    James Reynolds
    @magnusviri
    When I try to save a file in a location I don't have permission it asks if I want to use sudo but then it is stuck. No matter what key I press (including ctrl-c) nothing happens. I have to close the terminal to stop the process.
    I'm on macOS 10.15 and using Terminal and micro 2.0.6
    Heinrich Stoellinger
    @hstoellinger
    Hi, I have been using micro under Kubuntu and Debian for years now and I love it - in general. There is one issue that has dampened the fun for me, though: how can I copy/paste from inside micro to an external program? I have not been able to get this to work so far.
    Zachary Yedidia
    @zyedidia
    If you aren’t using micro over ssh just make sure you install xclip or xsel and micro should use that to access the clipboard. If you are using ssh things are more complex.
    Heinrich Stoellinger
    @hstoellinger
    Hello Zacharv, thanks a lot for the hint! I didn't realize the issue when using micro via ssh. I already had xclip installed. Everything works when using micro "locally". Since I also use it from my laptop to my LAN-connected Debian server quite often: is it a lot of work to get it to copy to the local clipboard, when using it over ssh?
    Zachary Yedidia
    @zyedidia
    Copying to the clipboard while running over ssh can be done in a few different ways. You can copy using your terminal (disable mouse in micro and then perform selections with the terminal and use Ctrl-Shift-C (Linux) to copy). You can enable X11 forwarding on the client and host. The last solution is to use a recent version of micro (nightly binary) and a terminal that supports OSC52 (KiTTY, iTerm2, maybe WSL terminal) and set the clipboard option to terminal. You can read > help copypaste for all the details you would ever want about how copy/paste in micro works and why it's so annoyingly complicated.
    Heinrich Stoellinger
    @hstoellinger
    Thanks for the explanations, Zachary!
    Koki Fushimi
    @Paalon
    I have tried the original snippet on macOS / iTerm2 and Ubuntu / Terminator but both of them fails to replace and does not receive keyboard input. I need to close the tab. When I reopen it in micro, it shows the backup and when I recover it, there is correctly replaced text.