From 013dfcae215ae20fe30654247a91a026118deba4 Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Tue, 13 Feb 2024 17:50:25 -0500 Subject: laptop config --- 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 ++++++++++++++++++++++++++ 8 files changed, 124 insertions(+) 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 (limited to 'lua/cshift') 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