Giter Site home page Giter Site logo

cumteayum / astrovim Goto Github PK

View Code? Open in Web Editor NEW

This project forked from astronvim/astronvim

0.0 0.0 0.0 856 KB

AstroVim is an aesthetic and feature-rich neovim config that is extensible and easy to use with a great set of plugins

License: GNU General Public License v3.0

Lua 99.67% Vim Script 0.33%

astrovim's Introduction

AstroVim

AstroVim is an aesthetic and feature-rich neovim config that is extensible and easy to use with a great set of plugins

๐ŸŒŸ Preview

Preview1 Preview2 Preview33

โšก Requirements

๐Ÿ› ๏ธ Installation

Linux

Make a backup of your current nvim folder

mv ~/.config/nvim ~/.config/nvimbackup

Clone the repository

git clone https://github.com/kabinspace/AstroVim ~/.config/nvim
nvim +PackerSync

๐Ÿ“ฆ 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

Manage plugins

Run :PackerClean to remove any disabled or unused plugins
Run :PackerSync to update and clean plugins

Update AstroVim

Run :AstroUpdate to get the latest updates from the repository

โœจ Features

โš™๏ธ Configuration

User directory is given for custom configuration

-- Set colorscheme
colorscheme = "onedark",

-- Add plugins
plugins = {
  { "andweeb/presence.nvim" },
  {
    "ray-x/lsp_signature.nvim",
    event = "BufRead",
    config = function()
      require("lsp_signature").setup()
    end,
  },
},

-- Overrides
overrides = {
  treesitter = {
    ensure_installed = { "lua" },
  },
},

-- On/off virtual diagnostics text
virtual_text = true,

-- Set options
set.relativenumber = true

-- Set key bindings
map("n", "<C-s>", ":w!<CR>", opts)

-- Set autocommands
vim.cmd [[
  augroup packer_conf
    autocmd!
    autocmd bufwritepost plugins.lua source <afile> | PackerSync
  augroup end
]]

-- Add formatters and linters
-- https://github.com/jose-elias-alvarez/null-ls.nvim
null_ls.setup {
  debug = false,
  sources = {
    -- Set a formatter
    formatting.rufo,
    -- Set a linter
    diagnostics.rubocop,
  },
  -- NOTE: You can remove this on attach function to disable format on save
  on_attach = function(client)
    if client.resolved_capabilities.document_formatting then
      vim.cmd "autocmd BufWritePre <buffer> lua vim.lsp.buf.formatting_sync()"
    end
  end,
}

Extending AstroVim

AstroVim should allow you to extend its functionality without going outside of the user directory!

Please get in contact when you run into some setup issue where that is not the case.

Add more Plugins

Just copy the packer configuration without the use and with a , after the last closing } into the plugins key of your user/settings.lua file.

See the example above.

Adding sources to nvim-cmp

To add new completion sources to nvim-cmp you can add the plugin (see above) providing that source like this:

    {
      "Saecki/crates.nvim",
      after = "nvim-cmp",
      config = function()
        require("crates").setup()

        local cmp = require "cmp"
        local config = cmp.get_config()
        table.insert(config.sources, { name = "crates" })
        cmp.setup(config)
      end,
    },

Use the options provided by nvim-cmp to change the order, etc. as you see fit.

Compley LSP server setup

Some plugins need to do special magic to the LSP configuration to enable advanced features. One example for this is the rust-tools.nvim plugin.

Those can override overrides.lsp_installer.server_registration_override.

For example the rust-tools.nvim plugin can be set up like this:

    -- Plugin definition:
    {
      "simrat39/rust-tools.nvim",
      requires = { "nvim-lspconfig", "nvim-lsp-installer", "nvim-dap", "Comment.nvim" },
      -- Is configured via the server_registration_override installed below!
    },

and then wired up with:

  overrides = {
    lsp_installer = {
      server_registration_override = function(server, server_opts)
        -- Special code for rust.tools.nvim!
        if server.name == "rust_analyzer" then
          local extension_path = vim.fn.stdpath "data" .. "/dapinstall/codelldb/extension/"
          local codelldb_path = extension_path .. "adapter/codelldb"
          local liblldb_path = extension_path .. "lldb/lib/liblldb.so"

          require("rust-tools").setup {
            server = server_opts,
            dap = {
              adapter = require("rust-tools.dap").get_codelldb_adapter(codelldb_path, liblldb_path),
            },
          }
        else
          server:setup(server_opts)
        end
      end,
    },
  },

๐Ÿ—’๏ธ Note

Guide is given for basic usage
Learn more about the default key bindings
Watch a review video to know about the out of the box experience

โญ Credits

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

Lua

astrovim's People

Contributors

0xd3e avatar hunger avatar kabinspace avatar lifesign avatar mehalter avatar pre-commit-ci[bot] avatar tilley avatar

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.