From 97ee7d58ab10bf1fe8e83c3cb01ab72241c31cf6 Mon Sep 17 00:00:00 2001 From: Daryl Ronningen Date: Sat, 27 Apr 2024 14:45:20 -0700 Subject: [PATCH] migrate to astro v4 --- .neoconf.json | 20 ++++++++ .stylua.toml | 7 +++ README.md | 34 +++++++++++++ init.lua | 29 ++++++----- lazy-lock.json | 72 ++++++++++++++++++++++++++++ {plugins => lua}/community.lua | 5 ++ lua/lazy_setup.lua | 31 ++++++++++++ lua/plugins/astrocore.lua | 17 +++++++ {plugins => lua/plugins}/neotree.lua | 3 ++ lua/polish.lua | 18 +++++++ neovim.yml | 6 +++ options.lua | 5 -- selene.toml | 8 ++++ 13 files changed, 238 insertions(+), 17 deletions(-) create mode 100644 .neoconf.json create mode 100644 .stylua.toml create mode 100644 README.md create mode 100644 lazy-lock.json rename {plugins => lua}/community.lua (70%) create mode 100644 lua/lazy_setup.lua create mode 100644 lua/plugins/astrocore.lua rename {plugins => lua/plugins}/neotree.lua (83%) create mode 100644 lua/polish.lua create mode 100644 neovim.yml delete mode 100644 options.lua create mode 100644 selene.toml diff --git a/.neoconf.json b/.neoconf.json new file mode 100644 index 0000000..2d7a81f --- /dev/null +++ b/.neoconf.json @@ -0,0 +1,20 @@ +{ + "neodev": { + "library": { + "enabled": true, + "plugins": true + } + }, + "neoconf": { + "plugins": { + "lua_ls": { + "enabled": true + } + } + }, + "lspconfig": { + "lua_ls": { + "Lua.format.enable": false + } + } +} diff --git a/.stylua.toml b/.stylua.toml new file mode 100644 index 0000000..bfcffff --- /dev/null +++ b/.stylua.toml @@ -0,0 +1,7 @@ +column_width = 120 +line_endings = "Unix" +indent_type = "Spaces" +indent_width = 2 +quote_style = "AutoPreferDouble" +call_parentheses = "None" +collapse_simple_statement = "Always" diff --git a/README.md b/README.md new file mode 100644 index 0000000..365674b --- /dev/null +++ b/README.md @@ -0,0 +1,34 @@ +# AstroNvim Template + +**NOTE:** This is for AstroNvim v4+ + +A template for getting started with [AstroNvim](https://github.com/AstroNvim/AstroNvim) + +## 🛠️ Installation + +#### Make a backup of your current nvim and shared folder + +```shell +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 +``` + +#### Create a new user repository from this template + +Press the "Use this template" button above to create a new repository to store your user configuration. + +You can also just clone this repository directly if you do not want to track your user configuration in GitHub. + +#### Clone the repository + +```shell +git clone https://github.com// ~/.config/nvim +``` + +#### Start Neovim + +```shell +nvim +``` diff --git a/init.lua b/init.lua index 4b81cc0..2ce1cdd 100644 --- a/init.lua +++ b/init.lua @@ -1,14 +1,19 @@ -if vim.g.neovide then - vim.o.guifont = "Liga SFMonoNerdFont:h10" - vim.g.neovide_scale_factor = 1 +-- This file simply bootstraps the installation of Lazy.nvim and then calls other files for execution +-- This file doesn't necessarily need to be touched, BE CAUTIOUS editing this file and proceed at your own risk. +local lazypath = vim.env.LAZY or vim.fn.stdpath "data" .. "/lazy/lazy.nvim" +if not (vim.env.LAZY or (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) + +-- validate that lazy is available +if not pcall(require, "lazy") then + -- stylua: ignore + vim.api.nvim_echo({ { ("Unable to load lazy from: %s\n"):format(lazypath), "ErrorMsg" }, { "Press any key to exit...", "MoreMsg" } }, true, {}) + vim.fn.getchar() + vim.cmd.quit() end -return { - updater = { - channel = "nightly", - branch = "nightly", - pin_plugins = false, - show_changelog = true, - auto_quit = true, - }, -} +require "lazy_setup" +require "polish" diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 0000000..376c135 --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,72 @@ +{ + "AstroNvim": { "branch": "main", "commit": "56ab96f491158b4b2392e2e79e418e0256d561f1" }, + "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, + "LuaSnip": { "branch": "master", "commit": "8f3d3465ba5c7ade0a8adb41eca5736f291a3fa8" }, + "SchemaStore.nvim": { "branch": "main", "commit": "26d27cf72a0164cb5a25d7b7ceedbe9a72511932" }, + "aerial.nvim": { "branch": "master", "commit": "83a79f39b709c20be4c830d241379fa85ef21a7c" }, + "alpha-nvim": { "branch": "main", "commit": "41283fb402713fc8b327e60907f74e46166f4cfd" }, + "astrocommunity": { "branch": "main", "commit": "ab4e806d14f6b77f5664e92fd8673bffe989b155" }, + "astrocore": { "branch": "main", "commit": "8a0c57bd49720f5b42ca2e5b8e073280d0f72cde" }, + "astrolsp": { "branch": "main", "commit": "2b90b49d866c435bdbd269dd6138f8d914bdb5ab" }, + "astrotheme": { "branch": "main", "commit": "8b316aa3ecd8c4206430379c0b1da0b4e7969ab9" }, + "astroui": { "branch": "main", "commit": "e5c5d4570cb00d0e1b2d81db357d108b21503592" }, + "better-escape.nvim": { "branch": "master", "commit": "7e86edafb8c7e73699e0320f225464a298b96d12" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-dap": { "branch": "master", "commit": "ea92773e84c0ad3288c3bc5e452ac91559669087" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, + "crates.nvim": { "branch": "main", "commit": "f00e11e8282b94f2a2e938d32712c99f0e0bdeb4" }, + "deno-nvim": { "branch": "master", "commit": "4bc9b5db13e8152b01aed51ce0451cdd38ca6743" }, + "dressing.nvim": { "branch": "master", "commit": "5162edb1442a729a885c45455a07e9a89058be2f" }, + "friendly-snippets": { "branch": "main", "commit": "ea068f1becd91bcd4591fceb6420d4335e2e14d3" }, + "gitsigns.nvim": { "branch": "main", "commit": "035da036e68e509ed158414416c827d022d914bd" }, + "guess-indent.nvim": { "branch": "main", "commit": "b8ae749fce17aa4c267eec80a6984130b94f80b2" }, + "heirline.nvim": { "branch": "master", "commit": "03cff30d7e7d3ba6fdc00925f015822f79cef908" }, + "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, + "lazy.nvim": { "branch": "main", "commit": "bef521ac89c8d423f9d092e37b58e8af0c099309" }, + "lspkind.nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "273fdde8ac5e51f3a223ba70980e52bbc09d9f6f" }, + "mason-null-ls.nvim": { "branch": "main", "commit": "de19726de7260c68d94691afb057fa73d3cc53e7" }, + "mason-nvim-dap.nvim": { "branch": "main", "commit": "67210c0e775adec55de9826b038e8b62de554afc" }, + "mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" }, + "mini.bufremove": { "branch": "main", "commit": "931a3bb514147d9e812767275c4beba6b779b1d3" }, + "mini.indentscope": { "branch": "main", "commit": "a8274b6ea2d868198d27bd91a31ed5ea3a6a5744" }, + "neo-tree.nvim": { "branch": "main", "commit": "25bfdbe802eb913276bb83874b043be57bd70347" }, + "neoconf.nvim": { "branch": "main", "commit": "ba3503e246ea687732e51f7f9878e653e2e2039b" }, + "neodev.nvim": { "branch": "main", "commit": "ce9a2e8eaba5649b553529c5498acb43a6c317cd" }, + "none-ls.nvim": { "branch": "main", "commit": "709a5e56f4273deca737d43355212ac94c1b5083" }, + "nui.nvim": { "branch": "main", "commit": "cbd2668414331c10039278f558630ed19b93e69b" }, + "nvim-cmp": { "branch": "main", "commit": "8f3c541407e691af6163e2447f3af1bd6e17f9a3" }, + "nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" }, + "nvim-dap": { "branch": "master", "commit": "6ae8a14828b0f3bff1721a35a1dfd604b6a933bb" }, + "nvim-dap-python": { "branch": "master", "commit": "3dffa58541d1f52c121fe58ced046268c838d802" }, + "nvim-dap-ui": { "branch": "master", "commit": "edfa93f60b189e5952c016eee262d0685d838450" }, + "nvim-lsp-file-operations": { "branch": "master", "commit": "223aca86b737dc66e9c51ebcda8788a8d9cc6cf2" }, + "nvim-lspconfig": { "branch": "master", "commit": "7133e85c3df14a387da8942c094c7edddcdef309" }, + "nvim-nio": { "branch": "master", "commit": "5800f585def265d52f1d8848133217c800bcb25d" }, + "nvim-notify": { "branch": "master", "commit": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15" }, + "nvim-treesitter": { "branch": "master", "commit": "0883ff05655117a3fc79ab295a640c4984cfd415" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "23b820146956b3b681c19e10d3a8bc0cbd9a1d4c" }, + "nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" }, + "nvim-ts-context-commentstring": { "branch": "main", "commit": "a6382f744f584bbf71d0a563af789af7190aabda" }, + "nvim-ufo": { "branch": "main", "commit": "a5390706f510d39951dd581f6d2a972741b3fa26" }, + "nvim-web-devicons": { "branch": "master", "commit": "beb6367ab8496c9e43f22e0252735fdadae1872d" }, + "nvim-window-picker": { "branch": "main", "commit": "41cfaa428577c53552200a404ae9b3a0b5719706" }, + "package-info.nvim": { "branch": "master", "commit": "45acce5b12ce824332d8000cc2c91805b6710446" }, + "plenary.nvim": { "branch": "master", "commit": "08e301982b9a057110ede7a735dd1b5285eb341f" }, + "promise-async": { "branch": "main", "commit": "93540c168c5ed2b030ec3e6c40ab8bbb85e36355" }, + "resession.nvim": { "branch": "master", "commit": "4463a78e1783c99466d5f5fb79516d06a5d6f3f8" }, + "rustaceanvim": { "branch": "master", "commit": "cd35b0f7fb0c9fe6879b084096230a74fefa4da8" }, + "smart-splits.nvim": { "branch": "master", "commit": "69721b6bbc42cbdbfa36fd97384209981cce49ee" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" }, + "telescope.nvim": { "branch": "master", "commit": "35f94f0ef32d70e3664a703cefbe71bd1456d899" }, + "todo-comments.nvim": { "branch": "main", "commit": "a7e39ae9e74f2c8c6dc4eea6d40c3971ae84752d" }, + "toggleterm.nvim": { "branch": "main", "commit": "066cccf48a43553a80a210eb3be89a15d789d6e6" }, + "tsc.nvim": { "branch": "main", "commit": "c37d7b3ed954e4db13814f0ed7aa2a83b2b7e9dd" }, + "typescript-tools.nvim": { "branch": "master", "commit": "c43d9580c3ff5999a1eabca849f807ab33787ea7" }, + "ultimate-autopair.nvim": { "branch": "v0.6", "commit": "6ecf7461d44513af89f8257f057fcc99e9297612" }, + "venv-selector.nvim": { "branch": "main", "commit": "3c57922256e7e26205a25f5a42ecf7104d9f2c78" }, + "vim-illuminate": { "branch": "master", "commit": "e522e0dd742a83506db0a72e1ced68c9c130f185" }, + "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } +} \ No newline at end of file diff --git a/plugins/community.lua b/lua/community.lua similarity index 70% rename from plugins/community.lua rename to lua/community.lua index 2e2139e..505fbde 100644 --- a/plugins/community.lua +++ b/lua/community.lua @@ -1,3 +1,8 @@ +-- AstroCommunity: import any community modules here +-- We import this file in `lazy_setup.lua` before the `plugins/` folder. +-- This guarantees that the specs are processed before any user plugins. + +---@type LazySpec return { "AstroNvim/astrocommunity", { import = "astrocommunity.pack.typescript-all-in-one" }, diff --git a/lua/lazy_setup.lua b/lua/lazy_setup.lua new file mode 100644 index 0000000..965dc61 --- /dev/null +++ b/lua/lazy_setup.lua @@ -0,0 +1,31 @@ +require("lazy").setup({ + { + "AstroNvim/AstroNvim", + import = "astronvim.plugins", + ---@type AstroNvimOpts + opts = { -- AstroNvim options must be set here with the `import` key + mapleader = " ", -- This ensures the leader key must be configured before Lazy is set up + maplocalleader = ",", -- This ensures the localleader key must be configured before Lazy is set up + icons_enabled = true, -- Set to false to disable icons (if no Nerd Font is available) + pin_plugins = false, -- Default will pin plugins when tracking `version` of AstroNvim, set to true/false to override + }, + }, + { import = "community" }, + { import = "plugins" }, +} --[[@as LazySpec]], { + -- Configure any other `lazy.nvim` configuration options here + install = { colorscheme = { "astrodark", "habamax" } }, + ui = { backdrop = 100 }, + performance = { + rtp = { + -- disable some rtp plugins, add more to your liking + disabled_plugins = { + "gzip", + "netrwPlugin", + "tarPlugin", + "tohtml", + "zipPlugin", + }, + }, + }, +} --[[@as LazyConfig]]) diff --git a/lua/plugins/astrocore.lua b/lua/plugins/astrocore.lua new file mode 100644 index 0000000..ce7f021 --- /dev/null +++ b/lua/plugins/astrocore.lua @@ -0,0 +1,17 @@ +-- AstroCore provides a central place to modify mappings, vim options, autocommands, and more! +-- Configuration documentation can be found with `:h astrocore` +-- NOTE: We highly recommend setting up the Lua Language Server (`:LspInstall lua_ls`) +-- as this provides autocomplete and documentation while editing + +---@type LazySpec +return { + "AstroNvim/astrocore", + ---@type AstroCoreOpts + opts = { + options = { + opt = { + relativenumber = false, + }, + }, + }, +} diff --git a/plugins/neotree.lua b/lua/plugins/neotree.lua similarity index 83% rename from plugins/neotree.lua rename to lua/plugins/neotree.lua index 370d3b1..bedab28 100644 --- a/plugins/neotree.lua +++ b/lua/plugins/neotree.lua @@ -1,3 +1,6 @@ +-- Customize Neotree + +---@type LazySpec return { "nvim-neo-tree/neo-tree.nvim", opts = { diff --git a/lua/polish.lua b/lua/polish.lua new file mode 100644 index 0000000..14c38cd --- /dev/null +++ b/lua/polish.lua @@ -0,0 +1,18 @@ +if true then return end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE + +-- This will run last in the setup process and is a good place to configure +-- things like custom filetypes. This just pure lua so anything that doesn't +-- fit in the normal config locations above can go here + +-- Set up custom filetypes +vim.filetype.add { + extension = { + foo = "fooscript", + }, + filename = { + ["Foofile"] = "fooscript", + }, + pattern = { + ["~/%.config/foo/.*"] = "fooscript", + }, +} diff --git a/neovim.yml b/neovim.yml new file mode 100644 index 0000000..b9235ab --- /dev/null +++ b/neovim.yml @@ -0,0 +1,6 @@ +--- +base: lua51 + +globals: + vim: + any: true diff --git a/options.lua b/options.lua deleted file mode 100644 index cd06b14..0000000 --- a/options.lua +++ /dev/null @@ -1,5 +0,0 @@ -return { - opt = { - relativenumber = false, - }, -} diff --git a/selene.toml b/selene.toml new file mode 100644 index 0000000..e7005c3 --- /dev/null +++ b/selene.toml @@ -0,0 +1,8 @@ +std = "neovim" + +[rules] +global_usage = "allow" +if_same_then_else = "allow" +incorrect_standard_library_use = "allow" +mixed_table = "allow" +multiple_statements = "allow"