summaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua')
-rw-r--r--lua/cshift/autocolor.lua11
-rw-r--r--lua/cshift/init.lua5
-rw-r--r--lua/cshift/lazy.lua2
-rw-r--r--lua/cshift/opt.lua7
-rw-r--r--lua/cshift/plugins/cmp.lua26
-rw-r--r--lua/cshift/plugins/init.lua9
-rw-r--r--lua/cshift/plugins/lsp.lua24
-rw-r--r--lua/cshift/remaps.lua23
8 files changed, 97 insertions, 10 deletions
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)