diff options
author | Kyle Gunger <kgunger12@gmail.com> | 2024-02-13 17:58:07 -0500 |
---|---|---|
committer | Kyle Gunger <kgunger12@gmail.com> | 2024-02-13 17:58:07 -0500 |
commit | 3c7ee73a8036cfaba464640999303e157b19ec15 (patch) | |
tree | 852f2e51c85c41997f736a04d5a96d5db8efc54c | |
parent | a42bc21a1db924910129a259335fccdeb0080c34 (diff) | |
parent | 013dfcae215ae20fe30654247a91a026118deba4 (diff) |
merge laptop and desktop configs
-rw-r--r-- | lazy-lock.json | 7 | ||||
-rw-r--r-- | lua/cshift/autocolor.lua | 11 | ||||
-rw-r--r-- | lua/cshift/init.lua | 5 | ||||
-rw-r--r-- | lua/cshift/lazy.lua | 2 | ||||
-rw-r--r-- | lua/cshift/opt.lua | 7 | ||||
-rw-r--r-- | lua/cshift/plugins/cmp.lua | 26 | ||||
-rw-r--r-- | lua/cshift/plugins/init.lua | 9 | ||||
-rw-r--r-- | lua/cshift/plugins/lsp.lua | 24 | ||||
-rw-r--r-- | lua/cshift/remaps.lua | 23 |
9 files changed, 103 insertions, 11 deletions
diff --git a/lazy-lock.json b/lazy-lock.json index 3420e1e..b11f21d 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,5 +1,10 @@ { "lazy.nvim": { "branch": "main", "commit": "aedcd79811d491b60d0a6577a9c1701063c2a609" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, + "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 index 4a98a77..5bae8c0 100644 --- a/lua/cshift/init.lua +++ b/lua/cshift/init.lua @@ -1,5 +1,10 @@ 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 index 0a9c83d..c20194e 100644 --- a/lua/cshift/lazy.lua +++ b/lua/cshift/lazy.lua @@ -1,4 +1,5 @@ local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" + if not vim.loop.fs_stat(lazypath) then vim.fn.system({ "git", @@ -9,5 +10,6 @@ if not vim.loop.fs_stat(lazypath) then 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 index 4eb9c9d..10f36f2 100644 --- a/lua/cshift/plugins/init.lua +++ b/lua/cshift/plugins/init.lua @@ -1,4 +1,9 @@ return { - "nvim-lua/plenary.nvim", - "nvim-telescope/telescope.nvim", + { + "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 index 2247cf6..bfc25b2 100644 --- a/lua/cshift/remaps.lua +++ b/lua/cshift/remaps.lua @@ -1,19 +1,26 @@ -vim.keymap.set("n", "<leader>f", vim.cmd.Ex) +-- General --- Project (s)cope keymaps -local scope = require("telescope.builtin") -vim.keymap.set("n", "<leader>sf", scope.find_files) +vim.keymap.set('n', '<leader>f', vim.cmd.Explore) --- (P)lugin keymaps -vim.keymap.set("n", "<leader>ps", function() + +-- Project (s)cope + +vim.keymap.set('n', '<leader>sf', function() + require("telescope.builtin").find_files() +end) + + +-- (P)lugins + +vim.keymap.set('n', '<leader>ps', function() require("lazy").sync() end) -vim.keymap.set("n", "<leader>pu", function() +vim.keymap.set('n', '<leader>pu', function() require("lazy").update() end) -vim.keymap.set("n", "<leader>ph", function() +vim.keymap.set('n', '<leader>ph', function() require("lazy").health() end) |