Giter VIP home page Giter VIP logo

user_example's Introduction

AstroNvim



AstroNvim is an aesthetically pleasing and feature-rich neovim config that is extensible and easy to use with a great set of plugins

🌟 Preview

Preview Image

✨ Features

⚡ Requirements

Note

[1] All downloadable Nerd Fonts contain icons which are used by AstroNvim. Install the Nerd Font of your choice to your system and in your terminal emulator settings, set its font face to that Nerd Font. If you are using AstroNvim on a remote system via SSH, you do not need to install the font on the remote system.

Note

[2] Note when using default theme: For MacOS, the default terminal does not have true color support. You will need to use iTerm2, Kitty, WezTerm, or another terminal emulator that has true color support.

🛠️ Installation

AstroNvim is provided as a plugin that can be installed with the lazy.nvim plugin manager and then used to import all of the plugin configurations that AstroNvim provides. To quickly get started it is recommended to start with the official AstroNvim Template which provides a great starting point for a new AstroNvim based configuration.

Linux/Mac OS (Unix)

Make a backup of your current nvim and shared folder

mv ~/.config/nvim ~/.config/nvim.bak
mv ~/.local/share/nvim ~/.local/share/nvim.bak
mv ~/.local/state/nvim ~/.local/state/nvim.bak
mv ~/.cache/nvim ~/.cache/nvim.bak

Clone the template repository

git clone --depth 1 https://github.com/AstroNvim/template ~/.config/nvim
rm -rf ~/.config/nvim/.git
nvim

Windows (Powershell)

Make a backup of your current nvim and nvim-data folder

Rename-Item -Path $env:LOCALAPPDATA\nvim -NewName $env:LOCALAPPDATA\nvim.bak
Rename-Item -Path $env:LOCALAPPDATA\nvim-data -NewName $env:LOCALAPPDATA\nvim-data.bak

Clone the repository

git clone --depth 1 https://github.com/AstroNvim/template $env:LOCALAPPDATA\nvim
Remove-Item $env:LOCALAPPDATA\nvim\.git -Recurse -Force
nvim

Minimal ~/.config/nvim/init.lua

Some user's might not want to use an entire template or do any customization. Here is a minimal ~/.config/nvim/init.lua file that simply set's up a base AstroNvim installation:

local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
  -- stylua: ignore
  vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath })
end
vim.opt.rtp:prepend(lazypath)

require("lazy").setup { "AstroNvim/AstroNvim", version = "^4", import = "astronvim.plugins" }

📦 Basic Setup

Install LSP

Enter :LspInstall followed by the name of the server you want to install
Example: :LspInstall pyright

Install language parser

Enter :TSInstall followed by the name of the language you want to install
Example: :TSInstall python

Install Debugger

Enter :DapInstall followed by the name of the debugger you want to install
Example: :DapInstall python

Manage plugins

Run :Lazy check to check for plugin updates

Run :Lazy update to apply any pending plugin updates

Run :Lazy clean to remove any disabled or unused plugins

Run :Lazy sync to update and clean plugins

Update AstroNvim Packages

Run :AstroUpdate (<leader>pa) to update both Neovim plugins and Mason packages

🗒️ Links

📹 Videos

There have been some great review videos released by members of the community! Here are a few:

🚀 Contributing

If you plan to contribute, please check the contribution guidelines first.

⭐ Credits

Sincere appreciation to the following repositories, plugin authors and the entire neovim community out there that made the development of AstroNvim possible.

Lua

user_example's People

Contributors

mehalter avatar mifix avatar tomaintaround avatar utkarshgupta137 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

user_example's Issues

tagbar not working

Checklist

  • I have searched through the AstroNvim docs
  • I have searched through the existing issues of AstroNvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

NVIM v0.9.0-dev-1047+gf0f27e9ae

Operating system/version

wsl

Terminal/GUI

windows terminal

Describe the bug

I installed the "preservim/tagbar" plugin but it doesn't work.

I added { "preservim/tagbar" }, to my user.lua file.

I want to use tagbar,

please check.

Steps to Reproduce

{ "preservim/tagbar" },
:TagbarToggle

Expected behavior

...

Screenshots

No response

Additional Context

No response

support icons in which-key menu

AstroNvim uses icons for many of the top level menu items in which-key.

Is it possible to use icons with key bindings defined in the AstroNvim/user_example config, e.g. mappings.lua

I would like to include icons for menu items from packages I have added to my own user config (forked from this example template).

Packages are added via the Astrocommunity or directly using the lazy syntax.

Thank you.

References

add some code for cmp

examples how to extend cmp with crates.nvim or cmp-copilot would be nice.
or maybe how to have a rust.lua or a copilot.lua

Avoid overwriting Treesitter/Mason ensure_installed

Problem

Adding packages to ensure_installed in plugins/treesitter.lua and plugins/mason.lua overwrites the ensure_installed tables set by any astrocommunity packs.

Example

I have imported a few language packs in plugins/community.lua:

return {
  "AstroNvim/astrocommunity",

  -- colorschemes
  { import = "astrocommunity.colorscheme.catppuccin" },

  -- languages
  { import = "astrocommunity.pack.json" },
  { import = "astrocommunity.pack.toml" },
  { import = "astrocommunity.pack.markdown" },
  { import = "astrocommunity.pack.lua" },
}

This results in the following being set in treesitter:

:TSConfigInfo
{
  ...
  ensure_installed = { "json", "jsonc", "toml", "markdown", "markdown_inline", "lua", "luap" },
  ...
}

But once I add something manually to plugins/treesitter.lua (following the commented out example):

return {
  "nvim-treesitter/nvim-treesitter",
  opts = {
    ensure_installed = { "python" },
  },
}

treesitter's ensure_installed is overwritten:

:TSConfigInfo
{
  ...
  ensure_installed = { "python" },
  ...
}

Proposal

We could change the commented out examples in plugins/treesitter.lua and plugins/mason.lua to utilize the util function used by astrocommunity to extend the ensure_installed list. This would risk confusing users, but would allow for interoperability between community packs and manual config.

local utils = require "astrocommunity.utils"
return {
  "nvim-treesitter/nvim-treesitter",
  opts = function(_, opts)
    if not opts.ensure_installed then
      opts.ensure_installed = {}
    elseif opts.ensure_installed == "all" then
      return
    end
    -- utils.list_insert_unique(opts.ensure_installed, { "python" })
  end
}

plugin.default_config(opts) throws nil value error

Checklist

  • Using a stable version of Neovim (i.e. not neovim nightly)
  • :PackerSync
  • :AstroUpdate
  • Restarted AstroNvim

Operating system/version

13.2.1

Terminal/GUI

wezterm

AstroNvim Health

astronvim: require("astronvim.health").check()
========================================================================
## AstroNvim
  - INFO: AstroNvim Version: v3.0.1
  - INFO: Neovim Version: v0.8.2
  - OK: Using stable Neovim >= 0.8.0
  - OK: `git` is installed: Used for core functionality such as updater and plugin
  management
  - OK: `open` is installed: Used for `gx` mapping for opening files with system opener
  (Optional)
  - OK: `lazygit` is installed: Used for mappings to pull up git TUI (Optional)
  - OK: `node` is installed: Used for mappings to pull up node REPL (Optional)
  - OK: `gdu` is installed: Used for mappings to pull up disk usage analyzer (Optional)
  - WARNING: `btm` is not installed: Used for mappings to pull up system monitor
  (Optional)
  - OK: `python3` is installed: Used for mappings to pull up python REPL (Optional)

Describe the bug

Calling plugin.default_config(opts) in a plugin throws nil value error.

Steps to Reproduce

File: plugins/treesitter.lua

return {
  "nvim-treesitter/nvim-treesitter",
  config = function(plugin, opts)
    plugin.default_config(opts)
  end
}

Expected behavior

Should not throw error.

Screenshots

image

Additional Context

No response

how to setup dap config from user config files

I am trying to setup the debugger from react and am successful in doing so, only if I add my config file somewhere inside the Astrovim folder and calling require for this config file

Eg added my config nvim-dap-config.lua inside astrovim/plugins/configs/nvim-dap-config.lua and called
local dap-config = require("plugins.configs.nvim-dap-config") inside mappings.lua .Everything is working as expected

now I wanted to move this file to $HOME/config/astrovim/user/... Can i get some help on how to acheive this

Contents of nvim-dap-config.lua

local dap = require("dap")
dap.set_log_level("TRACE")
dap.adapters.node2 = {
  type = "executable",
  command = "node",
  args = { vim.fn.stdpath("data") .. "/mason/packages/node-debug2-adapter/out/src/nodeDebug.js" },
}
dap.configurations.javascriptreact = {
  {
    name = "Chrome (9222)",
    type = "chrome",
    request = "attach",
    program = "${file}",
    cwd = vim.fn.getcwd(),
    sourceMaps = true,
    protocol = "inspector",
    port = 9222,
    webRoot = "${workspaceFolder}",
  },
  {
    name = "React Native (8081) (Node2)",
    type = "node2",
    request = "attach",
    program = "${file}",
    cwd = vim.fn.getcwd(),
    sourceMaps = true,
    protocol = "inspector",
    console = "integratedTerminal",
    port = 8081,
  },
  {
    name = "Attach React Native (8081)",
    type = "pwa-node",
    request = "attach",
    processId = require("dap.utils").pick_process,
    cwd = vim.fn.getcwd(),
    rootPath = "${workspaceFolder}",
    skipFiles = { "<node_internals>/**", "node_modules/**" },
    sourceMaps = true,
    protocol = "inspector",
    console = "integratedTerminal",
  },
}

I tried following the same  method as above,  the file is getting detected by the astro config, but dap  this new dap config is not getting appended

Any help on how to add this config in  my user astro config will be much appreciated
I don't want to lose new features 

Buffer visibly shifts on format with gitsigns on

Operating System: Fedora Linux 37

Terminal: Kitty or Gnome Terminal

Description: When there are gitsigns markers present, the buffer will visibly shift side to side on format. It appears that the gitsigns markers are disappearing and loading back in, causing the movement.

Steps to reproduce:

  • Remove/rename any existing user config
  • Clone the user_example repository to the lua/ directory
  • Rename user_example to user
  • Open a file with a formatter active
  • Make a change that needs to be formatted
  • Format

Recording:
In the recording, I start with no user/ directory, so I'm using default AstroNvim. I open mappings.lua, add some unwanted whitespace, and run the formatter to see the expected behaviour of no shifting of the buffer.

Then, I rename user_example to user, repeat the above, and observe the bug.

Finally, I open the same file which has been copied to a location not in a git repository, repeat the steps, and see the expected behaviour again.

asciicast

Provide an alternative single file example

Thanks for putting together this user_example.

I understand you favor a multiple file configuration but for many people this is not ideal and rather complex.

Could you please provide an example of a single file configuration?

Custom functions should be placed where?

For instance, I want to add a function that adds an ipdb breakpoint in python files and bind it in mapping.lua. Where should I elegantly position this function within the template?

'Use this template' Button missing?

As the title states, I can't seem to find the button, maybe it's a problem to do with my browser or something, I'm quite new to using github.

How to setup the config on Windows?

Both the written documentation and youtube tutorials are using Unix environment with ~/.config but the Windows environment is different.

Can there be some documentation on how to set up the user config on Windows?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.