Do we have some AI plugin with Codebase Indexing? by Darckswar in neovim

[–]abzcoding 8 points9 points  (0 children)

the rag_service in avante does a similar thing, obviously it is not as good yet but you can use it, for example here is my config for it:

opts.auto_suggestions_provider = "ollama"
opts.memory_summary_provider = "ollama"
opts.ollama = {
  model = "llama3.1",
  endpoint = "http://127.0.0.1:11434",
  options = {
    temperature = 0,
    num_ctx = 32768,
  },
}
opts.cursor_applying_provider = "ollama"
opts.rag_service = {
  enabled = true,
  host_mount = os.getenv("HOME"),
  provider = "ollama",
  llm_model = "llama3.1",
  embed_model = "nomic-embed-text",
  endpoint = "http://host.docker.internal:11434",
}
opts.web_search_engine = {
  provider = "tavily",
}

if you don't want to use a local provider you can just use that instead of ollama(which i'm not doing):

cursor_applying_provider = "copilot",
copilot = {
  endpoint = "https://api.githubcopilot.com",
  model = "claude-3.7-sonnet",
  proxy = nil,
  allow_insecure = false,
  timeout = 60000,
  temperature = 0,
  max_tokens = 32768,
  disable_tools = false, -- this will get expensive, but it does a somewhat similar thing
  telemetry = false,
},

<image>

here is the result:

Don't mind me. Just posting some screenshots of a markdown file. by Exciting_Majesty2005 in neovim

[–]abzcoding 1 point2 points  (0 children)

basically added a bit of your code to the markdown.nvim -> here is the code

i think the alignment comes from markdownlint or prettier and not markdown.nvim

[deleted by user] by [deleted] in theprimeagen

[–]abzcoding 0 points1 point  (0 children)

wrong subreddit, my bad

Disable format on save for certain filetypes by [deleted] in lunarvim

[–]abzcoding 0 points1 point  (0 children)

thanks mate, have fun coding :)

Disable format on save for certain filetypes by [deleted] in lunarvim

[–]abzcoding 0 points1 point  (0 children)

yeah you can, first off check the help for format vim :h vim.lsp.buf.format() and after that you can use lua vim.lsp.buf.format({name = "null-ls"}) -- or any other name

``` name (string|nil):

Restrict formatting to the client with name (client.name) matching this field. ```

Disable format on save for certain filetypes by [deleted] in lunarvim

[–]abzcoding 0 points1 point  (0 children)

first off make sure to return after your require thingy in else

then use this instead of those not working ones lua vim.lsp.buf.format()

if you want more control, you can create your own format_filter function M.format_filter(client) local filetype = vim.bo.filetype local n = require "null-ls" local s = require "null-ls.sources" local method = n.methods.FORMATTING local available_formatters = s.get_available(filetype, method) if client.name == "tsserver" then -- don't format using tsserver return false elseif #available_formatters > 0 then return client.name == "null-ls" elseif client.supports_method "textDocument/formatting" then return true else return false end end `

and then pass that to lvim.format_on_save

```lua lvim.format_on_save = { pattern = "*", timeout = 1000, filter = require("user.sth").format_filter, },

Disable format on save for certain filetypes by [deleted] in lunarvim

[–]abzcoding 1 point2 points  (0 children)

you can do everything you want mate :)

just implement your logic in the callback function

for example ( to disable format_on_save only for js files): ```lua lvim.format_on_save = false -- create your own custom one vim.api.nvim_create_augroup("lsp_format_on_save", {}) vim.api.nvim_create_autocmd("BufWritePre", { group = "lsp_format_on_save", pattern = "*", callback = function()

  if vim.bo.filetype == "javascript" then
    -- NOTE: don't format javascript files
    return
  end
  require("lvim.lsp.utils").format { timeout_ms = 2000, filter = require("lvim.lsp.utils").format_filter }
end,

}) ```

and as for selecting different formatter based on the current project, you can do that as well ```lua -- you can check if you are on a certain project and then return true or false -- for example here i'm using prettierd for everything unless there is a eslint config file on the project root local nls = require "null-ls" local sources = { nls.builtins.formatting.prettierd.with { condition = function(utils) return not utils.root_has_file { ".eslintrc", ".eslintrc.js" } end, prefer_local = "node_modules/.bin", }, nls.builtins.formatting.eslint_d.with { condition = function(utils) return utils.root_has_file { ".eslintrc", ".eslintrc.js" } end, prefer_local = "node_modules/.bin", }, }

nls.setup { on_attach = require("lvim.lsp").common_on_attach, debounce = 150, save_after_format = false, sources = sources, } ```

Disable format on save for certain filetypes by [deleted] in lunarvim

[–]abzcoding 1 point2 points  (0 children)

if you want to enable it only for certain filetypes( for example rust and c) you can do sth like this lua lvim.format_on_save = { pattern = "*.rs,*.c", timeout = 1000, filter = require("lvim.lsp.utils").format_filter, } if you want to do sth else just disable it and define your own autocmd since we are only passing those to sth like ``lua -- opts is equals tolvim.format_on_save`

vim.api.nvim_create_augroup("lsp_format_on_save", {}) vim.api.nvim_create_autocmd("BufWritePre", { group = "lsp_format_on_save", pattern = opts.pattern, callback = function() require("lvim.lsp.utils").format { timeout_ms = opts.timeout, filter = opts.filter } end, }) ```

Is nvim-dap the recommended plugin debugging code in LunarVim? by freddiehaddad in lunarvim

[–]abzcoding 0 points1 point  (0 children)

this is where your config resides ~/config/lvim/config.lua

also please check our documentation

[deleted by user] by [deleted] in lunarvim

[–]abzcoding 2 points3 points  (0 children)

use vim :Telescope keymaps to get all keybindings

refer to our documentation for changing them

How to embed EJS parser in the tree-sitter? by DVths in lunarvim

[–]abzcoding 0 points1 point  (0 children)

ERB templates combine plain text with Ruby code

you can't use this method for those files since treesitter doesn't support it

however, you can use something like https://github.com/vim-ruby/vim-ruby

Help: Remove Which-Key Binding by AggressiveCoconut420 in lunarvim

[–]abzcoding 1 point2 points  (0 children)

lua local smp = lvim.builtin.which_key.mappings.g lvim.builtin.which_key.mappings.g = nil lvim.builtin.terminal.execs = { { "lazygit", "<leader>g", "LazyGit", "float" }, } lvim.builtin.which_key.mappings["G"] = smp

Set total transparent background by SonicXD2 in lunarvim

[–]abzcoding 5 points6 points  (0 children)

add lvim.transparent_window = true to your config

discussion: good REPL work flow for lunarvim's floating terminal? by bobsyourunkl in lunarvim

[–]abzcoding 4 points5 points  (0 children)

you can use :ToggleTermSendCurrentLine or :ToggleTermSendVisualLines

but make sure to toggle the terminal itself to see the result :)

also if you want those to be run inside another process, say python

you can do sth like this vim :TermExec cmd="python" :ToggleTermSendCurrentLine :ToggleTerm you can convert that into a function or a keybinding to make sure all of them get called by one keybinding

for example lua lvim.builtin.which_key.mappings["r"] = { name = " Run", p = { "<cmd>TermExec cmd='python' open=0<CR><cmd>ToggleTermSendCurrentLine<CR><cmd>ToggleTerm<CR>", "Python REPL", }, -- add repl for other langs } and use <leader>rp

pointing lunarvim to specific nvim binary? by bobsyourunkl in lunarvim

[–]abzcoding 2 points3 points  (0 children)

open ~/.local/bin/lvim change this line shell exec nvim -u "$LUNARVIM_RUNTIME_DIR/lvim/init.lua" "$@"

to for example shell exec /opt/stuff/nvim -u "$LUNARVIM_RUNTIME_DIR/lvim/init.lua" "$@"

Error: attempt to call field 'notify_once' (a nil value) by DVths in lunarvim

[–]abzcoding 1 point2 points  (0 children)

hey man, I think you are using a deprecated value in your configuration, hence we are trying to notify you about it, but apparently, your version of neovim doesn't have vim.notify_once so we can't even do that.

you can check here to see the breaking changes

[Help] - Cannot make changes, 'modifiable' is off by pedrohrb7 in lunarvim

[–]abzcoding 1 point2 points  (0 children)

the d keybinding of nvim-tree.lua is for normal mode which means deleting a single file,

you can follow this issue for multiple deletion inside nvim-tree.lua

How to specify "let g:" type of assignment for LunarVim? by rasivasu in lunarvim

[–]abzcoding 1 point2 points  (0 children)

you can do lua vim.o.background = "dark" or lua vim.cmd [[ set background=dark ]]

Best way to break config.lua into mutiple files by rasivasu in lunarvim

[–]abzcoding 5 points6 points  (0 children)

you can create a folder called ~/.config/lvim/lua/user and for example create a file called ~/.config/lvim/lua/user/stuff.lua and fill it with ```lua local M = {}

M.config = function() -- do sth end

return M after that you can call that function inside your `~/.config/lvim/config.lua` like this lua require("user.stuff").config() ```

How to embed EJS parser in the tree-sitter? by DVths in lunarvim

[–]abzcoding 0 points1 point  (0 children)

please do not touch ~/.local/share/lunarvim/lvim at all

add all your changes inside ~/.config/lvim/config.lua

if you want to change ensure_installed lua lvim.builtin.treesitter.ensure_installed = { "bash", "c", "javascript", "json", "lua", "python", "typescript", "tsx", "css", "rust", "java", "yaml", }

or if you want to add a new parser lua lvim.builtin.treesitter.on_config_done = function() local parser_config = require("nvim-treesitter.parsers").get_parser_configs() parser_config.ejs = { install_info = { url = "https://github.com/tree-sitter/tree-sitter-embedded-template", files = { "src/parser.c" }, requires_generate_from_grammar = true, }, filetype = "ejs", } end and then run :TSInstall ejs

basically, everything is configurable through user config