From 013dfcae215ae20fe30654247a91a026118deba4 Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Tue, 13 Feb 2024 17:50:25 -0500 Subject: laptop config --- init.lua | 1 + lazy-lock.json | 10 ++++++++++ lua/cshift/autocolor.lua | 11 +++++++++++ lua/cshift/init.lua | 6 ++++++ lua/cshift/lazy.lua | 15 +++++++++++++++ lua/cshift/opt.lua | 7 +++++++ lua/cshift/plugins/cmp.lua | 26 ++++++++++++++++++++++++++ lua/cshift/plugins/init.lua | 9 +++++++++ lua/cshift/plugins/lsp.lua | 24 ++++++++++++++++++++++++ lua/cshift/remaps.lua | 26 ++++++++++++++++++++++++++ 10 files changed, 135 insertions(+) create mode 100644 init.lua create mode 100644 lazy-lock.json create mode 100644 lua/cshift/autocolor.lua create mode 100644 lua/cshift/init.lua create mode 100644 lua/cshift/lazy.lua create mode 100644 lua/cshift/opt.lua create mode 100644 lua/cshift/plugins/cmp.lua create mode 100644 lua/cshift/plugins/init.lua create mode 100644 lua/cshift/plugins/lsp.lua create mode 100644 lua/cshift/remaps.lua diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..efa72e6 --- /dev/null +++ b/init.lua @@ -0,0 +1 @@ +require("cshift") diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 0000000..3c7adb4 --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,10 @@ +{ + "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, + "lazy.nvim": { "branch": "main", "commit": "aedcd79811d491b60d0a6577a9c1701063c2a609" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "0954d7730e749d606ddf8d7ae8846848be435d53" }, + "mason.nvim": { "branch": "main", "commit": "c43eeb5614a09dc17c03a7fb49de2e05de203924" }, + "nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" }, + "nvim-lspconfig": { "branch": "master", "commit": "ae91a303a2258cb9cd9501e9d20c2dc92792d362" }, + "plenary.nvim": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" }, + "telescope.nvim": { "branch": "master", "commit": "0f865f17af4f9bc1587a0132414cdfd32d91852e" } +} \ No newline at end of file diff --git a/lua/cshift/autocolor.lua b/lua/cshift/autocolor.lua new file mode 100644 index 0000000..10155d2 --- /dev/null +++ b/lua/cshift/autocolor.lua @@ -0,0 +1,11 @@ +local autocolors = vim.api.nvim_create_augroup("AutoColors", {clear = true}) + +vim.api.nvim_create_autocmd("ColorScheme", { + pattern = "*", + callback = function() + vim.cmd("highlight Normal ctermbg=none") + vim.cmd("highlight EndOfBuffer ctermbg=none") + vim.cmd("highlight NonText ctermbg=none") + end, + group = autocolors +}) diff --git a/lua/cshift/init.lua b/lua/cshift/init.lua new file mode 100644 index 0000000..11941b5 --- /dev/null +++ b/lua/cshift/init.lua @@ -0,0 +1,6 @@ +vim.g.mapleader = "s" +require("cshift.autocolor") +require("cshift.lazy") +require("lazy").setup("cshift.plugins") +require("cshift.remaps") +require("cshift.opt") diff --git a/lua/cshift/lazy.lua b/lua/cshift/lazy.lua new file mode 100644 index 0000000..c20194e --- /dev/null +++ b/lua/cshift/lazy.lua @@ -0,0 +1,15 @@ +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", -- latest stable release + lazypath, + }) +end + +vim.opt.rtp:prepend(lazypath) + diff --git a/lua/cshift/opt.lua b/lua/cshift/opt.lua new file mode 100644 index 0000000..880bbc4 --- /dev/null +++ b/lua/cshift/opt.lua @@ -0,0 +1,7 @@ +vim.opt.number = true +vim.opt.relativenumber = true + +vim.opt.shiftwidth = 4 +vim.opt.tabstop = 4 + +vim.cmd.colorscheme("slate") diff --git a/lua/cshift/plugins/cmp.lua b/lua/cshift/plugins/cmp.lua new file mode 100644 index 0000000..a1e80b4 --- /dev/null +++ b/lua/cshift/plugins/cmp.lua @@ -0,0 +1,26 @@ +return { + "hrsh7th/nvim-cmp", + dependencies = { + "neovim/nvim-lspconfig", + "hrsh7th/cmp-nvim-lsp", + }, + + config = function() + local cmp = require("cmp") + cmp.setup({ + snippit = { + expand = function(args) + end + }, + + window = { + }, + + sources = cmp.config.sources({ + {name = "nvim_lsp"} + }, { + {name = "buffer"} + }) + }) + end +} diff --git a/lua/cshift/plugins/init.lua b/lua/cshift/plugins/init.lua new file mode 100644 index 0000000..10f36f2 --- /dev/null +++ b/lua/cshift/plugins/init.lua @@ -0,0 +1,9 @@ +return { + { + "nvim-telescope/telescope.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + }, + }, +} + diff --git a/lua/cshift/plugins/lsp.lua b/lua/cshift/plugins/lsp.lua new file mode 100644 index 0000000..ebaeab1 --- /dev/null +++ b/lua/cshift/plugins/lsp.lua @@ -0,0 +1,24 @@ +return { + "neovim/nvim-lspconfig", + dependencies = { + "williamboman/mason.nvim", + "williamboman/mason-lspconfig.nvim", + }, + + config = function() + require("mason").setup() + require("mason-lspconfig").setup({ + ensure_installed = { + "lua_ls", + "clangd" + }, + + handlers = { + function(server_name) + require("lspconfig")[server_name].setup({}) + end + } + }) + + end +} diff --git a/lua/cshift/remaps.lua b/lua/cshift/remaps.lua new file mode 100644 index 0000000..bfc25b2 --- /dev/null +++ b/lua/cshift/remaps.lua @@ -0,0 +1,26 @@ +-- General + +vim.keymap.set('n', 'f', vim.cmd.Explore) + + +-- Project (s)cope + +vim.keymap.set('n', 'sf', function() + require("telescope.builtin").find_files() +end) + + +-- (P)lugins + +vim.keymap.set('n', 'ps', function() + require("lazy").sync() +end) + +vim.keymap.set('n', 'pu', function() + require("lazy").update() +end) + +vim.keymap.set('n', 'ph', function() + require("lazy").health() +end) + -- cgit v1.2.3