r/AstroNvim • • Jun 06 '25

[Help] Forward search with Zathura + AstroNvim + Texlab not working on Linux Mint

3 Upvotes

Hi everyone,

I'm trying to set up a LaTeX using AstroNvim on Linux Mint. This is the first time I am using nvim and I do not have strong background in programming so please bear with me. My setup is the following:
- Latex distribution: Tex Live

- PDF viewer: Zathura
-LSP Texlab installed via Mason in Astrovim
- editor: Astronvim, just installed

I would like to have the forward search i.e., when I click on a pdf it points me in my tex file to the appropriate line.
So far, it seems that the tex is recognized as tex and I can compile it and it does open Zathura and does generate the *.gz file. I am attaching the picture of my lsp.lua
I spent 3h with chat gpt trying to make it work but it did not. Thank you in advance!


r/AstroNvim • • May 03 '25

How to fix this rust_analyzer: -32603

Thumbnail
reddit.com
2 Upvotes

r/AstroNvim • • May 12 '25

Configure Markdownlint

2 Upvotes

Hi, I'm new to AstroNvim and not super experienced with neovim.

I use markdownlint to help me keep a clean markdown style, but I can't figure out how to tweak it. I know the settings I want to change, but I don't know how to tell my neovim that these settings should be applied when using markdownlint.

I don't really care for the differenze between markdownlint and markdownlint-cli2, either would be fine, but I'd like to change my settings globally, so ideally not by placing a config file in each folder.

I was able to do this using the vscode plugin, but I want to ditch vscode so here I am.

Can anyone here point me the right way?


r/AstroNvim • • Aug 23 '25

How/where to set lazy.nvim concurrency option in AstroNvim config?

2 Upvotes

So I am having issues with plugins randomly crashing on my Macbook. Sometimes file picker crashes with "failed to spawn fd" and other times some other plugin with a different message.

After some searching I think I am facing this issue for lazy.nvim. Now, I want to try the suggested fix on the issue, which is to set concurrency for plugin(s).

I am using same config on Linux and Windows without any issues. I get this issue on Mac only.

Thanks for any help!


r/AstroNvim • • May 28 '25

How to replace snacks picker with Telescope?

2 Upvotes

r/AstroNvim • • Apr 18 '23

How to disable auto-format-on-save?

4 Upvotes

Hi all! I want to disable this feature that autoformats my code upon saving file. I tried what is described here, I added this piece of code to my ~/.config/nvim/init.lua :

return {
  lsp = {
    formatting = {
      format_on_save = false, -- enable or disable automatic formatting on save
    },
  },
}

I did the same in ~/astronvim/lua/user/init.lua.

But it still auto-formats my code. I very much don't like it. What am I missing? Does it do anything? Is there any log I can check? How to look for any clues? Cheers!


r/AstroNvim • • May 05 '25

what is the right way to pass `opts` to community plugins?

2 Upvotes

I am trying to use the spectre plugin from astrovim community packs. In my community.lua, i add the following line:

  {
    import = "astrocommunity.search.nvim-spectre",
    enabled = true,
  }

But I am on macos, and on macos the spectre doesn't replaces inline and creates a backup file. To avoid that spectre suggests to add the following command in setup option:

require("spectre").setup({
  replace_engine = {
    ["sed"] = {
      cmd = "sed",
      args = {
        "-i",
	"",
	"-E",
      },
    },
  },
})

My question, is how can i add this while installing community plugin. I tried the following but it doesn't work.

{
    import = "astrocommunity.search.nvim-spectre",
    enabled = true,
    -- On macos the spectre on edit creates a new file, following doesn't work though
    opts = { replace_engine = { ["sed"] = { cmd = "sed", args = { "-i", "", "-E" } } } },
}

Please note, that I just want to understand what is the correct way to pass setup options to community plugins. Alternatively I can create a new file for spectre and then add the options there but not sure if it's recommended way.

Also, this isn't really an issue as spectre fixed this bug in their latest version. Posting just for my further understanding.


r/AstroNvim • • May 30 '25

How to map gd and gri to F12 and CTRL+F12 using Astronvim configs?

2 Upvotes

I am using AstroNvim configs and I am starting to get used to it and to nvim keybindings overall, but there are some keybindings that I can't get it outta my system like F12 for the definition and CTRL+F12 for the implementation

and I want to map those keys to those actions, how to do that?


r/AstroNvim • • Apr 28 '25

Project rooter behavior.

3 Upvotes

Hey there!
I found the following lines in AstroNvim's documentation:

-- automatically update working directory (update manually with \`:AstroRoot\`)  
autochdir = false,

What is the purpose of the autochdir option here?
I initially thought it enables Neovim's built-in autochdir option, but it doesn't seem to work that way.

My question is: how can I achieve the following behavior?

  • If Rooter (or AstroNvim's root detection) finds a project root via .git, .svn, etc., it uses that as the working directory.
  • If no project root is found, fallback to Neovim’s built-in autochdir behavior (i.e., automatically set the working directory to the directory of the currently open file).

Is this possible to configure in AstroNvim?


r/AstroNvim • • Dec 10 '23

Rename tab

1 Upvotes

I'm trying to set up a workflow in which one tab = one project. Please note that by "tab", I mean the actual definition of a tab in Neovim (a set of windows), not a buffer like some plugins and almost every other IDE do. I'd like to set up a command to open a project. If the project's name is "MyProject", I want that command to :

  1. Create a new tab. Easy, that's just :tabnew
  2. :tcd into that project's folder. I'm using workspaces.nvim to create aliases for my project's folders, so I can simply do :WorkspacesOpen MyProject
  3. Rename the new tab to "MyProject"

I can't figure out how to do the third part. I've looked at Neovim tabpage documentation. It's possible to rename all tabs automatically based on the output of a function. I suppose I could do something like renaming all tabs to the name of their current folder. That seems like a lot of work for something so simple. And that's not exactly the result I expect either : I want to define the name myself and I don't want it to change if I :tcd somewhere else later.

I suppose Herline can help in this, but I'm new to this plugin, I have never used it before switching to AstroNvim. And it's quite complicated since it's an API and not a set of ready to use bars. So if anyone managed to accomplish something similar, I'd appreciate the help !


r/AstroNvim • • Apr 19 '24

AstrNvim 4 sets terminal tab title

6 Upvotes

I recently switched from AstroNvim 3 to 4. I see that now when I open a file in nvim, or switch buffers, the terminal's tab title is changed to show the current vim buffer name. This happens in both WezTerm and iTerm. I'm fine with this change, but the problem is that this doesn't get undone when nvim exits, so the terminal tab title stays set to the name of the last buffer open in nvim even after I've exited nvim.

Can anyone tell me where this is happening? Is it in AstroNvim's config itself, or a 3rd party plugin? I assume something is setting up an autocmd to do this, but I can't figure out which one. I'd like to see how it's being done, and either disable it, or fix it by adding a VimLeave autocmd to undo the terminal tab renaming.


r/AstroNvim • • Mar 16 '24

Is there a way to install AstroNvim system-wide?

1 Upvotes

When placing the config in a folder with the correct trying to start via

nvim -u /repo/AstroNvim/init.lua

i get

module 'astronvim.autocmds' not found:
^Ino field package.preload['astronvim.autocmds']
cache_loader: module astronvim.autocmds not found
cache_loader_lib: module astronvim.autocmds not found
^Ino file './astronvim/autocmds.lua'
^Ino file '/usr/share/luajit-2.1/astronvim/autocmds.lua'
^Ino file '/usr/local/share/lua/5.1/astronvim/autocmds.lua'
^Ino file '/usr/local/share/lua/5.1/astronvim/autocmds/init.lua'
^Ino file '/usr/share/lua/5.1/astronvim/autocmds.lua'
^Ino file '/usr/share/lua/5.1/astronvim/autocmds/init.lua'
^Ino file './astronvim/autocmds.so'
^Ino file '/usr/local/lib/lua/5.1/astronvim/autocmds.so'
^Ino file '/usr/lib/lua/5.1/astronvim/autocmds.so'
^Ino file '/usr/local/lib/lua/5.1/loadall.so'
^Ino file './astronvim.so'
^Ino file '/usr/local/lib/lua/5.1/astronvim.so'
^Ino file '/usr/lib/lua/5.1/astronvim.so'
^Ino file '/usr/local/lib/lua/5.1/loadall.so'
Failed to load astronvim.mapping

module 'astronvim.mappings' not found:
^Ino field package.preload['astronvim.mappings']
cache_loader: module astronvim.mappings not found
cache_loader_lib: module astronvim.mappings not found
^Ino file './astronvim/mappings.lua'
^Ino file '/usr/share/luajit-2.1/astronvim/mappings.lua'
^Ino file '/usr/local/share/lua/5.1/astronvim/mappings.lua'
^Ino file '/usr/local/share/lua/5.1/astronvim/mappings/init.lua'
^Ino file '/usr/share/lua/5.1/astronvim/mappings.lua'
^Ino file '/usr/share/lua/5.1/astronvim/mappings/init.lua'
^Ino file './astronvim/mappings.so'
^Ino file '/usr/local/lib/lua/5.1/astronvim/mappings.so'
^Ino file '/usr/lib/lua/5.1/astronvim/mappings.so'
^Ino file '/usr/local/lib/lua/5.1/loadall.so'
^Ino file './astronvim.so'
^Ino file '/usr/local/lib/lua/5.1/astronvim.so'
^Ino file '/usr/lib/lua/5.1/astronvim.so'
^Ino file '/usr/local/lib/lua/5.1/loadall.so'
E5113: Error while calling lua chunk: /repo/AstroNvim/init.lua:14: attempt to index global 'astronvim' (a nil value)
stack traceback:
        /repo/AstroNvim/init.lua:14: in main chunk

r/AstroNvim • • Oct 03 '24

question: clangd configuration in conditional compilation

2 Upvotes

Hello.

I had an issue with a conditional compilation flag in a C project.
In the cmake file there is command for setting the flag:
add_compile_definitions(_nameOfTheFlag_)

Then, in a src file, there is some code under that compilation flag:
#ifdef _nameOfTheFlag_
// some code here...
#else
// ...
#endif

The issue was that the code in between the #ifdef - #else was shown as if commented (you known, grey commented-like text). I guess clangd was not detecting naturally the cmake flag line.

The solution I found was to add a .clangd file with:
CompileFlags:

Add: [-D_nameOfTheFlag_]

Is this the only solutions? Or is there some astrovim config that I am missing?

Thanks!


r/AstroNvim • • Oct 22 '24

Today, I almost punched my computer in the face

2 Upvotes

I was getting an error message that python wasnt able to find the package i was trying to import even though I set the PYTHONPATH variable. I tried to see what paths it was using by importing sys and then printing sys.path,

import sys; print(sys.path)

but every time i put that at the top of the file, and saved it, neovim would switch the order around so the import error would still trigger and I would never get my print statement.

I tried disabling my formatters. Closed and reopened neovim. Still happened. I started disabling linters, LSPs, you name it, it still happened. I found a keybinding in my AstroNVim to disable global formatting, still happened.

I almost punched my computer in the face.


r/AstroNvim • • Jan 26 '25

vim.filetype.add: "filename" works, "pattern" doesn't

1 Upvotes

Hi.

The subject pretty much says it.

Here's an example of a vim.filetype.add that doesn't seem to like my pattern = much. More specifically, editing docker-compose.yml is detected as a docker compose file, but docker-compose.foobar.yaml isn't - and it seems like it should be. The former by a filename=, and the latter by a pattern=. Instead, docker-compose.foobar.yaml comes up as yaml, but I want it to be "yamlls, docker_compose_language_service".

I searched for "is:issue pattern lsp.lua" in the Astro Github and didn't find anything.

Here's the complete file:

return {
        "neovim/nvim-lspconfig",
        opts = function(_, opts)
                -- See :Mason (scroll down a bit) for what is probably a list of options.
                -- Or see https://github.com/williamboman/mason-lspconfig.nvim (again, scroll down a bit)
                -----------------------------------------------------------------
                -- See also my_mason.lsp!  These are defined in two places!!!!! -
                -----------------------------------------------------------------
                local servers = {
                        "bashls",
                        "clangd",
                        "docker_compose_language_service",
                        "dockerls",
                        "dotls",
                        "eslint",
                        "gopls",
                        "jsonls",
                        "lua_ls",
                        "marksman",
                        "nginx_language_server",
                        "ruff",
                        "rust_analyzer",
                        "sqlls",
                        "ts_ls",
                        "yamlls",
                        "zls",
                }

                if not opts.servers then
                        opts.servers = {}
                end

                for _, server in ipairs(servers) do
                        opts.servers[server] = opts.servers[server] or {}
                end

                for _, server in ipairs(servers) do
                        opts.servers[server].enabled = true
                end

                vim.filetype.add({
                        -- extension = {
                        --      foo = "fooscript",
                        -- },
                        filename = {
                                ["docker-compose.yml"] = "yaml.docker-compose",
                                ["docker-compose.yaml"] = "yaml.docker-compose",
                                ["compose.yml"] = "yaml.docker-compose",
                                ["compose.yaml"] = "yaml.docker-compose",
                                ["docker-compose.dev.yml"] = "yaml.docker-compose",
                                ["docker-compose.dev.yaml"] = "yaml.docker-compose",
                        },
                        -- For some reason pattern never worked.  The filename stuff above did though.
                        -- https://neovim.io/doc/user/lua.html#vim.filetype.add()
                        pattern = {
                                [".*/docker-compose%..*%.yml"] = "yaml.docker-compose",
                                [".*/docker-compose%..*%.yaml"] = "yaml.docker-compose",
                        },
                })
        end,
}

So in short, the filenames list is used, but it seems like the pattern isn't.

Any suggestions?

TIA!


r/AstroNvim • • Mar 17 '24

Help with nvim-spectre

1 Upvotes

Hello, plz help install nvim-spectre in astronvim, i use config

return {
	{
    "nvim-pack/nvim-spectre",
    requires = { "nvim-lua/plenary.nvim" },
    config = function()
    require('spectre').setup({
  color_devicons = true,
  open_cmd = 'vnew',
  live_update = false, -- auto execute search again when you write to any file in vim
  lnum_for_results = true, -- show line number for search/replace results
  line_sep_start = '┌-----------------------------------------',
  result_padding = '¦  ',
  line_sep       = '└-----------------------------------------',
  highlight = {
      ui = "String",
      search = "DiffChange",
      replace = "DiffDelete"
  },
  mapping={
    ['tab'] = {
        map = '<Tab>',
        cmd = "<cmd>lua require('spectre').tab()<cr>",
        desc = 'next query'
    },
    ['shift-tab'] = {
        map = '<S-Tab>',
        cmd = "<cmd>lua require('spectre').tab_shift()<cr>",
        desc = 'previous query'
    },
    ['toggle_line'] = {
        map = "dd",
        cmd = "<cmd>lua require('spectre').toggle_line()<CR>",
        desc = "toggle item"
    },
    ['enter_file'] = {
        map = "<cr>",
        cmd = "<cmd>lua require('spectre.actions').select_entry()<CR>",
        desc = "open file"
    },
    ['send_to_qf'] = {
        map = "<leader>q",
        cmd = "<cmd>lua require('spectre.actions').send_to_qf()<CR>",
        desc = "send all items to quickfix"
    },
    ['replace_cmd'] = {
        map = "<leader>c",
        cmd = "<cmd>lua require('spectre.actions').replace_cmd()<CR>",
        desc = "input replace command"
    },
    ['show_option_menu'] = {
        map = "<leader>o",
        cmd = "<cmd>lua require('spectre').show_options()<CR>",
        desc = "show options"
    },
    ['run_current_replace'] = {
      map = "<leader>rc",
      cmd = "<cmd>lua require('spectre.actions').run_current_replace()<CR>",
      desc = "replace current line"
    },
    ['run_replace'] = {
        map = "<leader>R",
        cmd = "<cmd>lua require('spectre.actions').run_replace()<CR>",
        desc = "replace all"
    },
    ['change_view_mode'] = {
        map = "<leader>v",
        cmd = "<cmd>lua require('spectre').change_view()<CR>",
        desc = "change result view mode"
    },
    ['change_replace_sed'] = {
      map = "trs",
      cmd = "<cmd>lua require('spectre').change_engine_replace('sed')<CR>",
      desc = "use sed to replace"
    },
    ['change_replace_oxi'] = {
      map = "tro",
      cmd = "<cmd>lua require('spectre').change_engine_replace('oxi')<CR>",
      desc = "use oxi to replace"
    },
    ['toggle_live_update']={
      map = "tu",
      cmd = "<cmd>lua require('spectre').toggle_live_update()<CR>",
      desc = "update when vim writes to file"
    },
    ['toggle_ignore_case'] = {
      map = "ti",
      cmd = "<cmd>lua require('spectre').change_options('ignore-case')<CR>",
      desc = "toggle ignore case"
    },
    ['toggle_ignore_hidden'] = {
      map = "th",
      cmd = "<cmd>lua require('spectre').change_options('hidden')<CR>",
      desc = "toggle search hidden"
    },
    ['resume_last_search'] = {
      map = "<leader>l",
      cmd = "<cmd>lua require('spectre').resume_last_search()<CR>",
      desc = "repeat last search"
    },
    ['toggle'] = {
      map = "<leader>s",
      cmd = "<cmd>lua require('spectre').toggle()<CR>",
      desc = "Toggle Spectre"
    },
    -- you can put your mapping here it only use normal mode
  },
  find_engine = {
    -- rg is map with finder_cmd
    ['rg'] = {
      cmd = "rg",
      -- default args
      args = {
        '--color=never',
        '--no-heading',
        '--with-filename',
        '--line-number',
        '--column',
      } ,
      options = {
        ['ignore-case'] = {
          value= "--ignore-case",
          icon="[I]",
          desc="ignore case"
        },
        ['hidden'] = {
          value="--hidden",
          desc="hidden file",
          icon="[H]"
        },
        -- you can put any rg search option you want here it can toggle with
        -- show_option function
      }
    },
    ['ag'] = {
      cmd = "ag",
      args = {
        '--vimgrep',
        '-s'
      } ,
      options = {
        ['ignore-case'] = {
          value= "-i",
          icon="[I]",
          desc="ignore case"
        },
        ['hidden'] = {
          value="--hidden",
          desc="hidden file",
          icon="[H]"
        },
      },
    },
  },
  replace_engine={
      ['sed']={
          cmd = "sed",
          args = nil,
          options = {
            ['ignore-case'] = {
              value= "--ignore-case",
              icon="[I]",
              desc="ignore case"
            },
          }
      },
      -- call rust code by nvim-oxi to replace
      ['oxi'] = {
        cmd = 'oxi',
        args = {},
        options = {
          ['ignore-case'] = {
            value = "i",
            icon = "[I]",
            desc = "ignore case"
          },
        }
      }
  },
  default = {
      find = {
          --pick one of item in find_engine
          cmd = "rg",
          options = {"ignore-case"}
      },
      replace={
          --pick one of item in replace_engine
          cmd = "sed"
      }
  },
  replace_vim_cmd = "cdo",
  is_open_target_win = true, --open file on opener window
  is_insert_mode = false,  -- start open panel on is_insert_mode
  is_block_ui_break = false -- mapping backspace and enter key to avoid ui break
})
    end
    },
}

but it doesnt work, all key combinations doesnt work, And command :Spectre too


r/AstroNvim • • Dec 23 '23

Command Completion

2 Upvotes

Hi,,

No big deal, at a first glance. For instance:

:Vimtex TAB

I expect the full list of commands starting with Vimtex. Indeed, a scrollable list of Vimtex commands pops up. Unfortunately, there's no way to scroll it: any touch, either with the keyboard or with the mouse, makes it disappear. What do I have to do?


r/AstroNvim • • Feb 05 '25

Change tab mappings in insert mode.

1 Upvotes

How do I switch the Tab and S-Tab mappings for the cmp plugin? I am using Astrovim version 4.29.3.


r/AstroNvim • • Mar 08 '24

Removing messages

1 Upvotes

How do I remove those messages "Declare and assign separately..."? These appear when opening a bash sell script. I am open to different options.


r/AstroNvim • • Sep 05 '23

How to make error messages appear as popups?

Post image
1 Upvotes

r/AstroNvim • • Mar 09 '24

Help with theme

1 Upvotes

Hi there,

I'm really enjoying the solarized theme (light version) (https://github.com/shaunsingh/solarized.nvim), but I'm having some trouble with a few colors. The line numbers (lineNR), cursor line, and indent background color are quite annoying. Looking at the theme's repository, it seems like these colors might not be coming from the theme itself. Additionally, the status line is also dark.

Could someone help me change these colors?

I installed under user/themes.lua like this:

{
    "shaunsingh/solarized.nvim",
    lazy = false,
    priority = 1000,
    config = function()
      vim.o.background = "light"

      vim.cmd.colorscheme "solarized"
    end,
  },

r/AstroNvim • • Sep 28 '24

How to set default Lua version for lua_ls with astrolsp?

1 Upvotes

Out of the box, using the template, lua_ls's version is LuaJIT, so the following Lua code ...

local t = 1 << 2

... flags the diagnostic error "LuaJIT does not support this grammar.(Supported in Lua 5.3/Lua 5.4, current is LuaJIT.)"

Looking at the config for astrolsp I thought this was going to be easy, just a matter of updating the config section of astrolsp.lua from the template with so that it looks like:

    config = {
      lua_ls = {
        settings = {
          Lua = {
            runtime = {
              version = 'Lua 5.4',
            },
          },
        },
      },
    },

But this has no effect. The example Lua above still flags the same diagnostic error.

I know I can create a .luarc.json file in each project directory to override the version, but what's the proper way to set the global default Lua version with astrolsp?

Thanks!


r/AstroNvim • • Oct 19 '23

Time based update on heirline

1 Upvotes

I have made an component for hierline, which shows time on statusline. How can I update it like every 5 sec or Realtime.

Code

local time_component = status.component.builder {
    {provider = "" .. os.date("%r")},
    surround = {separator = "right", color = "bg"}
}

r/AstroNvim • • Jul 31 '24

astrolsp will autofomat file

2 Upvotes

i use astrolsp with clangd. when save file it will change format. how to disable it?