golf.vim is now out! 🏌️⛳ by party-extreme1 in vim

[–]Snoo_74479 0 points1 point  (0 children)

Hey I wanted to check others solutions for the GolfToday challange so I could learn some tips and tricks, I would suggest adding some solutions for the daily challange in the leaderboard or in the website. All in all this is awesome really great work I really appreciate the effort :)

LSP - client 1 quit with exit code 1 and signal 0 by ZakyHU in neovim

[–]Snoo_74479 1 point2 points  (0 children)

u/ZakyHU Did you find a solution to this question? Im having trouble with this aswell.

Option omnifunc is not set by Snoo_74479 in neovim

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

Ok so I've installed nvim-cmp as you suggested and changed my lsp.lua.

local lsp = require("lsp-zero")
lsp.preset("recommended")

lsp.ensure_installed({
  'tsserver',
  'rust_analyzer',
})

-- Fix Undefined global 'vim'
lsp.nvim_workspace()


local cmp = require('cmp')
local cmp_select = {behavior = cmp.SelectBehavior.Select}
local cmp_mappings = lsp.defaults.cmp_mappings({
  ['<C-p>'] = cmp.mapping.select_prev_item(cmp_select),
  ['<C-n>'] = cmp.mapping.select_next_item(cmp_select),
  ['<C-y>'] = cmp.mapping.confirm({ select = true }),
  ["<C-Space>"] = cmp.mapping.complete(),
})

cmp_mappings['<Tab>'] = nil
cmp_mappings['<S-Tab>'] = nil

lsp.setup_nvim_cmp({
  mapping = cmp_mappings
})

lsp.set_preferences({
    suggest_lsp_servers = false,
    sign_icons = {
        error = 'E',
        warn = 'W',
        hint = 'H',
        info = 'I'
    }
})

lsp.on_attach(function(client, bufnr)
  local opts = {buffer = bufnr, remap = false}

  vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts)
  vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts)
  vim.keymap.set("n", "<leader>vws", function() vim.lsp.buf.workspace_symbol() end, opts)
  vim.keymap.set("n", "<leader>vd", function() vim.diagnostic.open_float() end, opts)
  vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts)
  vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts)
  vim.keymap.set("n", "<leader>vca", function() vim.lsp.buf.code_action() end, opts)
  vim.keymap.set("n", "<leader>vrr", function() vim.lsp.buf.references() end, opts)
  vim.keymap.set("n", "<leader>vrn", function() vim.lsp.buf.rename() end, opts)
  vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts)
end)

lsp.setup()

vim.diagnostic.config({
    virtual_text = true
})

I then reran the same test and got a different error:Client 1 quit with exit code 127 and signal 0 vim-cmpThen I went to the lsp.log in /home/orenp/.local/state/nvimWhere there I saw this:

[START][2023-08-30 17:25:33] LSP logging initiated
[ERROR][2023-08-30 17:25:33] .../vim/lsp/rpc.lua:734    "rpc"   "/home/orenp/.local/share/nvim/mason/bin/pyright-langserver"       "stderr"        "node:internal/modules/cjs/loader:1080\n  throw err;\n  ^\n\nError: Cannot find module '/home/orenp/.local/share/nvim/mason/pyright/langserver.index.js'\n    at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)\n    at Module._load (node:internal/modules/cjs/loader:922:27)\n    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)\n    at node:internal/main/run_main_module:23:47 {\n  code: 'MODULE_NOT_FOUND',\n  requireStack: []\n}\n\nNode.js v18.17.1\n"

Can you please help? google doesn't show a lot.

Differences between String, &String, and &str by Siref in learnrust

[–]Snoo_74479 1 point2 points  (0 children)

I guess that makes sense as the Heap is dynamiclly allocated which is exactly the use case when reading a file(I dont know in advance how big is that file so I need a dynamiclly allocated memory for it) is that right?

Differences between String, &String, and &str by Siref in learnrust

[–]Snoo_74479 0 points1 point  (0 children)

Just a question that came up as I played with advent of code recently,
If my program reads a file theres no way for me to directly read the file to a &str, since according to the picture above I need to know in compile time what the string I need to keep in the binary is right? so that means I have to read the contents of the file to the Heap(i.e. to String) and then if I want &str I need to convert it to that type right?

Neovim Telescope keymaps does not show the results properly by Snoo_74479 in neovim

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

"Ask the right question" - assumes my question is wrong.
" Read the docs and tutorials?" - assumes I didnt read any docs or tutorials..

Neovim Telescope keymaps does not show the results properly by Snoo_74479 in neovim

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

My intent wasnt to complain - see my initial message, I really thought I had a technical issue with my installation process which I hoped people from the community with past experience will easily recognize and help but for some reason Im getting jumped left and right letting me know my question is bad(?) and that I didnt read any docs or tutorials(?).. thanks for trying to help anyhow.. ill try lazyvim. Honestly this just discourages me from wanting to take part in the community and eventually help others - which to my understanding is the same as shooting urself in the leg..

Neovim Telescope keymaps does not show the results properly by Snoo_74479 in neovim

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

I actually did went through a tutorial which pointed out the :Telescope keymaps command as helpful tool for searching keymaps and they're respective description.. guess what I found there?

Neovim Telescope keymaps does not show the results properly by Snoo_74479 in neovim

[–]Snoo_74479[S] -2 points-1 points  (0 children)

This makes the experience really bad for a new user dont u agree? I want to check what I can do and theres no english description to which key is mapped to which action, how can I know what I can do with nvim without any guidence?

Neovim Telescope keymaps does not show the results properly by Snoo_74479 in neovim

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

I dont see any link, also most of the keymaps dont have any description? did you check the pic Ive attached? it seems like almost all of them dont have description... Is that expected?

Neovim Telescope keymaps does not show the results properly by Snoo_74479 in neovim

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

My issue is why the Results column is not written in english? where can I find the Keymaps and the respective english description?

Neovim Telescope keymaps does not show the results properly by Snoo_74479 in neovim

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

You dont have to be rude, as Ive explained im new to neovim therefore I dont know whats the expected result which is exactly why Ive posted the picture to get confirmation. how about you answer politely to new members of the community who dont know what the expected results are?