From 711aa4510da734b917a8ff89d863a7eabcc45277 Mon Sep 17 00:00:00 2001 From: Alyxia Sother Date: Mon, 28 Aug 2023 22:02:52 +0200 Subject: [PATCH] [nvim-new] Start work --- nvim-new/README.md | 1 + nvim-new/init.lua | 12 +++++++++ nvim-new/init.vim | 16 ++++++++++++ nvim-new/lua/aly/options.lua | 12 +++++++++ nvim-new/lua/aly/plugins.lua | 47 ++++++++++++++++++++++++++++++++++++ 5 files changed, 88 insertions(+) create mode 100644 nvim-new/README.md create mode 100644 nvim-new/init.lua create mode 100644 nvim-new/init.vim create mode 100644 nvim-new/lua/aly/options.lua create mode 100644 nvim-new/lua/aly/plugins.lua diff --git a/nvim-new/README.md b/nvim-new/README.md new file mode 100644 index 0000000..4a21c60 --- /dev/null +++ b/nvim-new/README.md @@ -0,0 +1 @@ +# WIP!!! diff --git a/nvim-new/init.lua b/nvim-new/init.lua new file mode 100644 index 0000000..b841d64 --- /dev/null +++ b/nvim-new/init.lua @@ -0,0 +1,12 @@ +local init_modules = { + "aly.plugins", + "aly.options" +} + +for _, module in ipairs(init_modules) do + local ok, err = pcall(require, module) + if not ok then + error("Error loading " .. module .. "\n\n" .. err) + end +end + diff --git a/nvim-new/init.vim b/nvim-new/init.vim new file mode 100644 index 0000000..6fc649b --- /dev/null +++ b/nvim-new/init.vim @@ -0,0 +1,16 @@ +" Honestly, the only reason this file is even here is because of the stupid +" runtimepath. Nothing else. + +let g:nvim_dotfiles_dir = expand(':p:h') + +" +function! s:configure_runtimepath() abort + let rtp = split(&runtimepath, ',') + let dotf = g:nvim_dotfiles_dir + if index(rtp, dotf ) < 0 | call insert(rtp, dotf ) | endif + if index(rtp, dotf.'/after') < 0 | call add(rtp, dotf.'/after') | endif + let &runtimepath = join(rtp, ',') +endfunction +call s:configure_runtimepath() + +luafile :h/init.lua diff --git a/nvim-new/lua/aly/options.lua b/nvim-new/lua/aly/options.lua new file mode 100644 index 0000000..34c9efd --- /dev/null +++ b/nvim-new/lua/aly/options.lua @@ -0,0 +1,12 @@ +print("yes") + +local options = { + termguicolors = true, -- how do I even use the editor without this? +} + +for o, _ in pairs(options) do + vim.opt[o] = _ +end + +vim.cmd("filetype plugin indent on") +vim.cmd("syntax enable") diff --git a/nvim-new/lua/aly/plugins.lua b/nvim-new/lua/aly/plugins.lua new file mode 100644 index 0000000..2a65647 --- /dev/null +++ b/nvim-new/lua/aly/plugins.lua @@ -0,0 +1,47 @@ +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + 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({ +-- { +-- "neovim/nvim-lspconfig", +-- dependencies = { +-- { "williamboman/mason.nvim", config = true }, +-- "williamboman/mason-lspconfig.nvim", +-- { "j-hui/fidget.nvim", tag = "legacy", opts = {} }, +-- +-- "folke/neodev.nvim", +-- }, +-- }, + { + "hrsh7th/nvim-cmp", + dependencies = { + "L3MON4D3/LuaSnip", + "saadparwaiz1/cmp_luasnip", + + "hrsh7th/cmp-nvim-lsp", + }, + }, + { + "windwp/nvim-autopairs", + dependencies = { "hrsh7th/nvim-cmp" }, + config = function() + require("nvim-autopairs").setup {} + local cmp_autopairs = require("nvim-autopairs.completion.cmp") + local cmp = require("cmp") + cmp.event:on( + 'confirm_done', + cmp_autopairs.on_confirm_done() + ) + end, + }, +}, {})