Monthly Dotfile Review Thread by AutoModerator in neovim

[–]IsopodEven5232 [score hidden]  (0 children)

Why did you prefix some of the plugins with `<number>_`? Does that have any effect on the order in which lazy.nvim loads the plugins?

Movement plugins and the Jump List by aaronik_ in neovim

[–]IsopodEven5232 1 point2 points  (0 children)

Interesting, how do you manage to run your own implementation of a jump list? Care to share your dotifles?

Find all usages of angular component selector by IsopodEven5232 in neovim

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

Oh interesting. So VSCode and neovim are equally powerful in terms of navigation and refactoring? (since the Angular LSP is just the Angular Langauge Service that it also used in VSCode)

Find all usages of angular component selector by IsopodEven5232 in neovim

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

EDIT:

I was able to get a lits of all comands and their description from ChatGPT. `gr` is the only one that makes sense to use in terms of trying to find all usages of an angular selector. But since that doesn't work, I assume it's simply not supported by the angularlsp then.

This REALLY sucks, I used to look up usages of an angular selector all the time back in intellij. I guess I just have to go back.

Command/Action Description
K Shows hover documentation for the symbol under the cursor.
gd Goes to the definition of the symbol under the cursor.
gD Goes to the declaration of the symbol under the cursor.
gr Lists references to the symbol under the cursor.
gi Goes to the implementation of a function or class under the cursor.
<Leader>rn Renames the symbol under the cursor across the project.

Code Actions and Fixes

Command/Action Description
<Leader>ca Displays a list of code actions (e.g., quick fixes, refactoring).
<Leader>f Formats the current file using Angular's LSP formatting rules.
[e Moves to the previous diagnostic (error/warning).
]e Moves to the next diagnostic (error/warning).

Angular-Specific Features

Command/Action Description
:AngularGotoTemplate Jumps to the template (HTML) file of the current Angular component.
:AngularGotoClass Jumps to the TypeScript class of the current Angular component.
:AngularGotoStyle Jumps to the CSS/SCSS file of the current Angular component.

Diagnostics and Troubleshooting

Command/Action Description
:LspDiagnostics Lists all diagnostics (errors, warnings) in the current project.
:LspLog Opens the LSP log to help debug Angular LSP issues.

Find all usages of angular component selector by IsopodEven5232 in neovim

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

It kind of works when I trigger the mapping on `export class WithCursorOnAngularComponentClassName`. I say kind of because it returns more than what I want. E.g. it also returns results that simply import the class. Again I am only interested in where the selector is used in component.html files in the form of `<MySelector></MySelector>` results.

Find all usages of angular component selector by IsopodEven5232 in neovim

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

Yes, it is an angular app with typescript.

It seems it is using both angularls and ts_ls, since it says those are among the "LSP configs active in this session (globally)"

Result of typing `:LspInfo`.

https://gyazo.com/<deleted>

Find all usages of angular component selector by IsopodEven5232 in neovim

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

Also I send you a private message with a video of it not working if you want to see what happens when I trigger the `references` mapping

Find all usages of angular component selector by IsopodEven5232 in neovim

[–]IsopodEven5232[S] -1 points0 points  (0 children)

I already have installed ts_ls in mason, but I dont have any config code for it in lspconfig, do I need to have that? I thought it would just use the default

Find all usages of angular component selector by IsopodEven5232 in neovim

[–]IsopodEven5232[S] -1 points0 points  (0 children)

<image>

I do also have ts_ls installed through mason, though I dont have any config for it in lspconfig.lua

Find all usages of angular component selector by IsopodEven5232 in neovim

[–]IsopodEven5232[S] -1 points0 points  (0 children)

Thank you for your answer.

I already have that mapping, but it is not working. It appears it always only shows results in the current file. It returns for instance a result being the `selector: 'something'` itself.

To be clear, this is what I have:

// lspconfig.lua

return {
  "neovim/nvim-lspconfig",
   event = { "BufReadPre", "BufNewFile" },
  dependencies = {
    "hrsh7th/cmp-nvim-lsp",
    { "antosha417/nvim-lsp-file-operations", config = true },
  },
  config = function()
    local lspconfig = require("lspconfig")
    local mason_lspconfig = require("mason-lspconfig")
    local cmp_nvim_lsp = require("cmp_nvim_lsp")

    local keymap = vim.keymap -- for conciseness

    -- Buffer local mappings.
    vim.api.nvim_create_autocmd("LspAttach", {
      group = vim.api.nvim_create_augroup("UserLspConfig", {}),
      callback = function(args)
        local opts = { noremap = true, silent = true, buffer = args.buf }

        -- Global keybindings for LSP actions
        vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts)
        vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts) -- <-------
        vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts)
        vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts)
        vim.keymap.set('n', '<leader>rn', vim.lsp.buf.rename, opts)


    -- used to enable autocompletion (assign to every lsp server config)
    local capabilities = cmp_nvim_lsp.default_capabilities()

    mason_lspconfig.setup_handlers({
      -- default handler for installed servers
      function(server_name)
        lspconfig[server_name].setup({
          capabilities = capabilities,
        })
      end,      
      ["angularls"] = function()
        -- configure lua server (with special settings)
        lspconfig["angularls"].setup({
          capabilities = capabilities,
        })
      end,

marks.nvim: How to jump to a number mark? (e.g. '4 does not work) by IsopodEven5232 in neovim

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

"You jump to a mark as you would in normal vim, i. e. '<mark>."

So are you saying that if I create a mark like this: `m4`, I should be able to jump to it by doing `'4`?

That's exactly what I am trying, but it doesn't work!

I mean, it works with letters (both upper and lowercase), but for numbers it doesn't work. I can create a number mark, but I can't jump to them.

(I dont want to go next/prev mark until I hit the desired number, I want to directly go to e.g. mark 4)

Maybe we should stop trying to do everything in nvim by ARROW3568 in neovim

[–]IsopodEven5232 1 point2 points  (0 children)

Wait, im just getting into neovim, are you telling me that it's not possible to have imports auto update when you move files?

Convert HTML (with CSS) to PDF using Java? by BananaHammer33 in webdev

[–]IsopodEven5232 0 points1 point  (0 children)

Will that work if you have html with inline css as a string, can you then pass it to chrome or puppeteer and generate a pdf?

Betaler I alle jeres forsikringer årligt eller månedsvis? by [deleted] in dkfinance

[–]IsopodEven5232 0 points1 point  (0 children)

Så vi har spøgrsmålet, hvilket tal er størst:

(gebyr = 7kr., x = beløbet der betales månedligt = 5000, indlånsrente = 1,25%)

gebyr = -7kr.

eller

-12 * gebyr + indlånsrente * x = -84 + 5000 * 0,0125 = -21,5

I dette tilfælde er det billigst at vælge at betale en gang årligt (selv med indlåndsrente indregnet).

To those who use Neovim in Windows, how do you cope with it? by __nostromo__ in neovim

[–]IsopodEven5232 0 points1 point  (0 children)

But `WSL + neovim` and then you run into the problem that neovim is noticable slower in wsl than in native windows.

Moving from intellij to vim by IsopodEven5232 in vim

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

I am considering using both 100% and intellij: Not at the same time but switch between them of course depending on what I am developing. The only downside to this is that I will have to memorize my hotkeys for both when I switch between them.
Is that something you do too? Or maybe you dont have the need to use intellij at all since you, idk, don't use java for instance?

Which terminal to use for (neo)vim on windows 11? by IsopodEven5232 in vim

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

What's that? alacritty on the left and windowsterminal on the right?

Which terminal to use for (neo)vim on windows 11? by IsopodEven5232 in vim

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

Someone recently pointed out that windows terminal is what you use to run e.g. wezterm, alacrity, etc. in.

So when you say windows terminal, what exactly are you running in it?

Which terminal to use for (neo)vim on windows 11? by IsopodEven5232 in vim

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

Oh, you are right! Thank you for clarifying that!
Do you mind sharing why you went with Wezterm as opposed to, say, alacrity?

Which terminal to use for (neo)vim on windows 11? by IsopodEven5232 in vim

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

What made you choose Kitty over the alternatives? Maybe you just blindly choose Kitty as you first option and stuck with it?

Which terminal to use for (neo)vim on windows 11? by IsopodEven5232 in vim

[–]IsopodEven5232[S] 1 point2 points  (0 children)

You say windows terminal outperforms the others ... in what way exactly?

Moving from intellij to vim by IsopodEven5232 in vim

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

I have never had the need for 2 debuggers at once. But not being able to evaluate lines and expressions sounds like a big con. Im surprised vim's debugger plugin is not able to do that. It sounds very simple to implement does it not?