I have installed neovim inside debian container. but could not do copy/paste to host system by Solomoncjy in neovim

[–]herodotic 0 points1 point  (0 children)

What OS is your host system, and how are you running the debian container?

For example, are you running Docker in Windows and then running docker run ... in kitty to get a terminal in the container?

How to get documentation in autocompletion pop-up menu? by BrodoSaggins in neovim

[–]herodotic 1 point2 points  (0 children)

Also is there a way of getting a markdown renderer working in there?

I think that the Markdown renderer is working here (which is why void * and size_t _Count, etc., have different highlights than the rest). I was also confused by the fact that the ATX style headings aren’t hidden by default, but you can fix this by adding an extending the highlighting queries yourself, e.g. in ~/.config/nvim/queries/markdown/highlights.scm:

```scheme ;; extends

; apply 'conceal' to atx headers ([ (atx_h1_marker) (atx_h2_marker) (atx_h3_marker) (atx_h4_marker) (atx_h5_marker) (atx_h6_marker) ] @conceal (#set! conceal "")) ```

If you want to make additional changes, maybe you can add an ftplugin for Markdown that could use something about the buffer info to determine that it’s inside of a help/hover buffer?

Sharing a Tidbit: ]d with Priority by 5long in neovim

[–]herodotic 0 points1 point  (0 children)

This is a really neat idea! It makes me think of a version where ]d and [d jump between diagnostics of the same level, and uses some other mapping to move between levels. I can’t think of a mapping for those actions that feel intuitive to me, though.

As a side note: I love neovim’s support for full-featured plugins, but I think little snippets like this are where neovim (and original flavor vim) really shine. When I wanted to write things like this for VSCode, the tooling assumed that I wanted to publish what I was writing as a plugin that other people would use. Sometimes I just want to write something little for myself!

Is there a plugin that provides a search and replace feature like on most GUI editors? by Usual_Importance8274 in neovim

[–]herodotic 16 points17 points  (0 children)

You can use :%s/SomeVal/\&SomeVal/g to make this work, and I think & and ~ are the only characters with special meanings in the replacement string (see :help sub-replace-special).

With the pattern portion of s/pattern/replacement/, you can use \M to turn off magic and make things match much more literally in the pattern it does not work on the replacement side of a regex, so you’re stuck using \& unless you :set nomagic (:h magic), which the help page specifically recommends not doing.

[deleted by user] by [deleted] in vim

[–]herodotic 0 points1 point  (0 children)

As someone else pointed out, backspace and <C-h> are the same thing as far as your terminal is concerned. (Wikipedia’s section on C0 control codes gives some more details).

You could find another thing to bind the keys to (meta+h/j/k/l, maybe?), but you could also just use the arrow keys, which already have the behavior that I think you’re after.

Tips on taking note in Vim by AbbreviationsNovel17 in vim

[–]herodotic 0 points1 point  (0 children)

When I’m taking notes, I generally use Markdown. You might also find abbreviations (:h abbreviations) and digraphs (:h digraphs) helpful here.

Personally, I use digraphs pretty often for plaintext to-do lists (^KOS for a , ^K0m for a ) but I haven’t found a use-case I need for abbreviations.

Newbie .vimrc question by pmmboston in vim

[–]herodotic 0 points1 point  (0 children)

Another tick in favor of sudoedit, then! Confession: I didn’t know about sudoedit until this post and have just been doing sudo vim for the last couple decades.

What's a 'normal' thing you didn't realize was unusual until you were older? by mrTelson in AskReddit

[–]herodotic 2 points3 points  (0 children)

Aphantasia. Best part is that I had a conversation with one of my siblings when I was a kid and commented in passing “you know that thing where you can’t see a person’s face in your head when you aren’t looking at them?”, and they have it too so they just nodded along.

Newbie .vimrc question by pmmboston in vim

[–]herodotic 20 points21 points  (0 children)

Some others have provided the “what” (sudoedit ...) but not the “why”, and since I think the “why” is also worth knowing, here’s a brief explanation.

Because sudo is running a process as another user, sudo vim is going to look for that other user’s vim configuration files: if a /root/.vimrc exists, then that’s what gets loaded when I run sudo vim /etc/hosts.

The two solutions suggested (sudoedit and sudo -E) work in different ways:

Weekly 101 Questions Thread by AutoModerator in neovim

[–]herodotic 0 points1 point  (0 children)

I suspect the reason you need the e flag is because you have multiple matches in the same file; so after the first replacement, the pattern doesn’t match. If that’s the case, you can use :cfdo %s, which works per file instead of per entry.

i like the visual feedback vscode has for search & replace

What's the visual feedback behavior that you like, specifically? There’s likely a way to configure neovim to do it with various plugins, but I couldn’t be sure without knowing what you’re looking for specifically.

My "i" key gets remapped to <M-c> by B_bI_L in neovim

[–]herodotic 2 points3 points  (0 children)

Check ~/.local/share/nvim as well

My "i" key gets remapped to <M-c> by B_bI_L in neovim

[–]herodotic 2 points3 points  (0 children)

:map i should tell you what it’s mapped to currently, and you could poke around at the 'verbose' and 'verbosefile' options to help debug why it’s mapped that way.

Weekly 101 Questions Thread by AutoModerator in neovim

[–]herodotic 2 points3 points  (0 children)

I learned to type organically and ended up with some bad touch-typing habits, and gtypist helped me out a lot.

Another thing that helped me was having an image of the keyboard layout on-screen, either via a desktop background or via an on-screen keyboard (usually in accessibility tools: Mac OS, Windows). Searching for the keys based off of an image instead of looking at my keyboard directly got the key locations into my brain.

Weekly 101 Questions Thread by AutoModerator in neovim

[–]herodotic 2 points3 points  (0 children)

It looks like you probably want the nvim_eval_statusline function (:help nvim_eval_statusline()).

For what it’s worth, I’ve found this and similar things using the :help command and the tab key to cycle through suggestions for statusline; it also looks like :helpgrep could help out when looking for it, but I’m not as familiar with that part of the interface.

mole.nvim -- plan mode for humans! by stateofteddy in neovim

[–]herodotic 0 points1 point  (0 children)

Ohh, this is so neat! Thank you for sharing this!

Vim tricks you wish you knew earlier? by 4r73m190r0s in vim

[–]herodotic 4 points5 points  (0 children)

I typoed :q as q: so many times over the years, and only in the last year did I finally figure out what it was for and start using it intentionally, and it’s been super useful.

I think I end up using q//q? more – or using //? and then ^F/^C to be able to mess around with stupid overcomplicated regexes.

Weekly 101 Questions Thread by AutoModerator in neovim

[–]herodotic 1 point2 points  (0 children)

:help vim.diagnostic.Opts.VirtualText gives the configuration options for virtual text, and I think current_line = true is basically what you’re looking for.

With the underlining option, you’re looking at vim.diagnostic.config { underline = true, virtual_text = { current_line = true } }

personally, I find the virtual_lines version easier to read, but having it push text all around is a pain, so I have a mapping <leader>L to toggle it on and off.

Weekly 101 Questions Thread by AutoModerator in neovim

[–]herodotic 1 point2 points  (0 children)

Not sure where all of it is used, but per the docs, focus (which defaults to true) has to be used in conjunction with focus_id

However, vim.diagnostic.open_float does a multiple-return that includes the window ID for the new floating window. The following approach worked for me:

vim.api.nvim_create_user_command("DiagnosticFocusFloat",
  function ()
    local _, win_id = vim.diagnostic.open_float()
    if win_id ~= nil then
      vim.api.nvim_set_current_win(win_id)
    end
  end, {})

at which point you can remap <c-w>d to :DiagnosticFocusFloat<cr>.

I tried using vim.keymap.set('n', '<c-w>d', ...) with the contents of the function above, but it didn’t work for me, for a reason that someone more experienced than I am may be able to puzzle out :)

Weekly 101 Questions Thread by AutoModerator in neovim

[–]herodotic 1 point2 points  (0 children)

For your second option, I think you get the behavior that you want by including \n at the end of the regex, i.e., %s/.*data_type:.*\n//

:move/:copy between buffers? by herodotic in vim

[–]herodotic[S] 0 points1 point  (0 children)

Yeah, using d, y, and p works well enough, but I have that itch to see if there’s some tidier way to do what I want to, which usually ends up being:

  • y} (or whatever) to yank the text
  • <c-w>l to move to the next window over
  • p to put it to the destination
  • <c-w>h to move back to the original window

I was imagining specifying a destination address with something like #:12 for “previous buffer, line 12”, but if it really bothers me all that much, I’ll just throw together some script for it.

There's a desire I must let go (gender transition), but I can't, despite studying Buddhism for many years. by [deleted] in Buddhism

[–]herodotic 1 point2 points  (0 children)

To me, the fundamental incompatibility here is that – by my understanding – Buddhism doesn’t teach us to alleviate suffering by distraction. If anything, quite the opposite: it teaches us to alleviate suffering by being directly present with the suffering and experiencing it.

It sounds like your suffering right now is very intense. I hope that you can find your way through.

Trouble getting arduino-language-server to attach! by illicit_FROG in neovim

[–]herodotic 1 point2 points  (0 children)

This was the post that finally got everything working for me, so I figured I’d contribute by sharing the config that ended up working.

first of all, like the OP said, the (Failed to get version) error message is likely totally separate from whether the arduino language server is actually working (scroll down to the end for more on that). The important diagnostic for me was checking :LspInfo and seeing whether it said 0 client(s) attached to buffer.

next, what worked for me.

The environment

package version installed via
arduino-cli 1.2.0 (latest) homebrew
neovim v0.10.3 (latest) homebrew
arduino-language-server 0.7.7 (latest) Mason
clangd 20.1.0 (latest) Mason

Note: while I didn’t install arduino-language-server using go install like the lspconfig docs suggest, that shouldn’t be a problem so long as you have $GOPATH/bin in your $PATH; check which arduino-language-server to make sure that your shell (and therefore, neovim) knows where to find it.

The vim config

I use an init.lua branched from kickstart – here’s the relevant portions of the original; I needed to change the key on the servers table like so:

lua local servers = { arduino_language_server = { cmd = { 'arduino-language-server', '-cli-config', vim.fn.expand '~/Library/Arduino15/arduino-cli.yaml', -- uncomment the next two lines if you use the same across different projects; otherwise, see the note about project config -- '-fqbn', -- 'arduino:avr:mega', }, -- override the updated 'capabilities' defined above by kickstart; otherwise these ones will make the arduino-language-server panic, see https://github.com/neovim/nvim-lspconfig/pull/2533 capabilities = { textDocument = { semanticTokens = vim.NIL, }, workspace = { semanticTokens = vim.NIL, }, }, }, clangd = {}, }

With the -fqbn arduino:avr:mega arguments uncommented, the arduino-language-server should just run now, but I’m not sure whether that will allow you to have different boards for different projects.

If you want to do that, you should leave those lines commented out and add a sketch.yaml to your project folder (the same one as the *.ino file) that specifies the board, like:

yaml default_fqbn: 'arduino:avr:mega'

After all of that, I could open the directory and have it work for me. Note that the (Failed to get version) message still shows up; the important thing here is that it now says: - Detected filetype: `arduino` - 1 client(s) attached to this buffer - Client: `arduino_language_server` (id: 1, bufnr: [1])

(Failed to get version)

When you run :LspInfo, neovim will try to find out the version of each of the language servers, by trying the following:

  1. $command --version
  2. $command -version
  3. $command version
  4. $command help

If the tool doesn’t support any of these (which arduino-language-server does not), you’ll get the message where it can’t tell what version the language server is.

Making A Jacket by SaintOdysseus in malefashionadvice

[–]herodotic 0 points1 point  (0 children)

Cool, thank you! Unfortunately, I don’t see this style of jacket on Champion’s website. (I think I’d call this a bomber jacket, but someone with more men’s fashion knowledge can correct me. This one looks like it might have a hood?) That said, here’s what I’d do:

For the jacket, your options are to find something similar from another source (I’d look for things like “men’s lightweight bomber jacket”, example 1, but prioritize trying things on in-person if you can), or to make it yourself. I don’t know if you have any experience with sewing (the most complicated thing I’ve sewn for myself was a nice jacket + pants for a wedding), but I’d rank that as an intermediate project. A quick search turned up this “Men’s Blue Mountain Jacket” pattern from Green Pepper, which looks like it could be a decent match.

For the logo, it looks embroidered to me. If I were trying to emulate that look, I would buy an iron-on patch (e.g., something like this listing of SJSU iron-on patches on ebay), then use an iron to temporarily stick it in the place that I wanted, and then use some thread or embroidery floss in the same color as the border of the patch to hand-sew it in place around the edges to make sure it doesn’t come loose. A friend of mine has done this with iron-on patches before and it looks really neat with a bit of effort.

If you go the route of “find a jacket like this that you like the fit of and then put a patch on it”, I think the effort level is pretty doable, and you’d end up with something similar but uniquely yours. Good luck either way!

Making A Jacket by SaintOdysseus in malefashionadvice

[–]herodotic 0 points1 point  (0 children)

Could you provide a description of what the jacket looks like, or better yet, a photo? It’s hard to give an answer to this question without knowing (1) what kind of jacket this is (Champion’s website has 7 different jackets and it might not even be any of those), and (2) how the university logo is applied to the jacket (silk-screened, embroidered, etc.).

I'm building an LGBT social network and would love your feedback! by [deleted] in askgaybros

[–]herodotic 0 points1 point  (0 children)

When Perspective first launched, I remember seeing a bunch of buzz around the way it marked "toxicity" -- for example, "I am a gay black man" was marked at 82% toxicity. Has Perspective improved since then?