diff options
author | root <root@guest.guest> | 2025-06-25 18:25:08 +0000 |
---|---|---|
committer | root <root@guest.guest> | 2025-06-25 18:25:08 +0000 |
commit | fb1977df937127f63728f90702920aeaf7bce35f (patch) | |
tree | a18a3eba105f46a4ede0fbddfdfe655d5efe506f |
-rw-r--r-- | .luarc.json | 5 | ||||
-rw-r--r-- | init.lua | 47 | ||||
-rw-r--r-- | lazy-lock.json | 19 | ||||
-rw-r--r-- | lua/plugins.lua | 1 | ||||
-rw-r--r-- | lua/plugins/alpha.lua | 38 | ||||
-rw-r--r-- | lua/plugins/catppuccin.lua | 8 | ||||
-rw-r--r-- | lua/plugins/completions.lua | 51 | ||||
-rw-r--r-- | lua/plugins/lsp-config.lua | 38 | ||||
-rw-r--r-- | lua/plugins/lualine.lua | 29 | ||||
-rw-r--r-- | lua/plugins/none-ls.lua | 15 | ||||
-rw-r--r-- | lua/plugins/telescope.lua | 10 | ||||
-rw-r--r-- | lua/plugins/treesitter.lua | 13 | ||||
-rw-r--r-- | lua/vim-stuff.lua | 60 |
13 files changed, 334 insertions, 0 deletions
diff --git a/.luarc.json b/.luarc.json new file mode 100644 index 0000000..5d9a1b6 --- /dev/null +++ b/.luarc.json @@ -0,0 +1,5 @@ +{ + "diagnostics.globals": [ + "capabilities" + ] +}
\ No newline at end of file diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..cf168c4 --- /dev/null +++ b/init.lua @@ -0,0 +1,47 @@ +vim.g.mapleader = " " + +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) +require("lazy").setup("plugins") + +require("vim-stuff") + +vim.filetype.add({ + extension = { + tfvars = "terraform", + }, +}) +vim.g.mapleader = " " + +-- Terraform +vim.filetype.add({ + extension = { + tfvars = "terraform", + }, +}) + +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) +require("lazy").setup("plugins") + +require("vim-stuff") diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 0000000..27a0f7e --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,19 @@ +{ + "LuaSnip": { "branch": "master", "commit": "a7a4b4682c4b3e2ba82b82a4e6e5f5a0e79dec32" }, + "alpha-nvim": { "branch": "main", "commit": "41283fb402713fc8b327e60907f74e46166f4cfd" }, + "catppuccin": { "branch": "main", "commit": "56fb98218d22d5c326387bf9e4076227e7372e6b" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, + "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, + "friendly-snippets": { "branch": "main", "commit": "dcd4a586439a1c81357d5b9d26319ae218cc9479" }, + "lazy.nvim": { "branch": "main", "commit": "af6afefbb46ab29a8a1db69536b04290a9403876" }, + "lualine.nvim": { "branch": "master", "commit": "b5e8bb642138f787a2c1c5aedc2a78cb2cebbd67" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "9dfcf2036c223920826140f0151d929a43f9eceb" }, + "mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" }, + "none-ls.nvim": { "branch": "main", "commit": "18910d09d21d7df339805343bfe4a2b2e41c057b" }, + "nvim-cmp": { "branch": "main", "commit": "97dc716fc914c46577a4f254035ebef1aa72558a" }, + "nvim-lspconfig": { "branch": "master", "commit": "6e5c78ebc9936ca74add66bda22c566f951b6ee5" }, + "nvim-treesitter": { "branch": "master", "commit": "b009aba903565163442f2adecff72bc3193bb8fd" }, + "nvim-web-devicons": { "branch": "master", "commit": "585b2dc4bba2b5973f2b1d3e576709af5ac34fb6" }, + "plenary.nvim": { "branch": "master", "commit": "f7adfc4b3f4f91aab6caebf42b3682945fbc35be" }, + "telescope.nvim": { "branch": "master", "commit": "6312868392331c9c0f22725041f1ec2bef57c751" } +}
\ No newline at end of file diff --git a/lua/plugins.lua b/lua/plugins.lua new file mode 100644 index 0000000..a564707 --- /dev/null +++ b/lua/plugins.lua @@ -0,0 +1 @@ +return {} diff --git a/lua/plugins/alpha.lua b/lua/plugins/alpha.lua new file mode 100644 index 0000000..0762154 --- /dev/null +++ b/lua/plugins/alpha.lua @@ -0,0 +1,38 @@ +return { + "goolord/alpha-nvim", + dependencies = { + "nvim-tree/nvim-web-devicons", + }, + + config = function() + local alpha = require("alpha") + local dashboard = require("alpha.themes.dashboard") + + dashboard.section.header.val = { + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ", + " ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ", + " ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ", + " ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ", + " ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ", + " ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ", + " ", + } + + -- Set menu + dashboard.section.buttons.val = { + dashboard.button( "e", " > New file" , ":ene <BAR> startinsert <CR>"), + dashboard.button( "Ctrl-p", " > Find file", ":Telescope find_files<CR>"), + dashboard.button( "q", " > Quit NVIM", ":qa<CR>"), + dashboard.button("m", " > Mason", ":Mason<CR>"), + } + alpha.setup(dashboard.opts) + + end +} diff --git a/lua/plugins/catppuccin.lua b/lua/plugins/catppuccin.lua new file mode 100644 index 0000000..366ee25 --- /dev/null +++ b/lua/plugins/catppuccin.lua @@ -0,0 +1,8 @@ +return { "catppuccin/nvim", + name = "catppuccin", + priority = 1000 , + flavour = "mocha", -- latte, frappe, macchiato, mocha + config = function() +vim.cmd.colorscheme "catppuccin" + end +} diff --git a/lua/plugins/completions.lua b/lua/plugins/completions.lua new file mode 100644 index 0000000..e2de671 --- /dev/null +++ b/lua/plugins/completions.lua @@ -0,0 +1,51 @@ +return { + { + "hrsh7th/cmp-nvim-lsp", + }, + { + "L3MON4D3/LuaSnip", + dependencies = { + "saadparwaiz1/cmp_luasnip", + "rafamadriz/friendly-snippets", + }, + }, + { + "hrsh7th/nvim-cmp", + config = function() + local cmp = require("cmp") + require("luasnip.loaders.from_vscode").lazy_load() + + cmp.setup({ + snippet = { + expand = function(args) + require("luasnip").lsp_expand(args.body) + end, + }, + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + }, + + --- + completion = { + autocomplete = false, + }, + --- + + mapping = cmp.mapping.preset.insert({ + ["<C-p>"] = cmp.mapping.select_prev_item(), + ["<C-n>"] = cmp.mapping.select_prev_item(), + ["<C-Space>"] = cmp.mapping.complete(), + ["<C-e>"] = cmp.mapping.abort(), + ["<CR>"] = cmp.mapping.confirm({ select = true }), + }), + sources = cmp.config.sources({ + { name = "nvim_lsp" }, + { name = "luasnip" }, -- For luasnip users. + }, { + { name = "buffer" }, + }), + }) + end, + }, +} diff --git a/lua/plugins/lsp-config.lua b/lua/plugins/lsp-config.lua new file mode 100644 index 0000000..708b5b3 --- /dev/null +++ b/lua/plugins/lsp-config.lua @@ -0,0 +1,38 @@ +return { + { + "williamboman/mason.nvim", + lazy = false, + config = function() + require("mason").setup() + end, + }, + { + "williamboman/mason-lspconfig.nvim", + lazy = false, + config = function() + require("mason-lspconfig").setup({ + ensure_installed = { "lua_ls", "html" }, + }) + end, + }, + { + "neovim/nvim-lspconfig", + lazy = false, + config = function() + -- local capabilities = require('cmp_nvim_lsp').default_capabilities() + + local lspconfig = require("lspconfig") + lspconfig.html.setup({ + capabilities = capabilities + }) + lspconfig.lua_ls.setup({ + capabilities = capabilities + }) + + vim.keymap.set("n", "K", vim.lsp.buf.hover, {}) + -- vim.keymap.set("n", "<leader>gd", vim.lsp.buf.definition, {}) + -- vim.keymap.set("n", "<leader>gr", vim.lsp.buf.references, {}) + -- vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, {}) + end, + }, +} diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua new file mode 100644 index 0000000..a07a67d --- /dev/null +++ b/lua/plugins/lualine.lua @@ -0,0 +1,29 @@ +return { + "nvim-lualine/lualine.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + config = function() + require("lualine").setup({ + options = { + --theme = "powerline" + --theme = "dracula" + theme = "OceanicNext", + }, + sections = { + lualine_a = { "mode" }, + lualine_b = { "branch", "diff"}, + lualine_c = { "buffers" }, + lualine_x = { "encoding", "fileformat", "filetype" }, + lualine_y = { "progress" }, + lualine_z = { "location" }, + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = { "buffers" }, + lualine_x = { "location" }, + lualine_y = {}, + lualine_z = {}, + }, + }) + end, +} diff --git a/lua/plugins/none-ls.lua b/lua/plugins/none-ls.lua new file mode 100644 index 0000000..a569d93 --- /dev/null +++ b/lua/plugins/none-ls.lua @@ -0,0 +1,15 @@ +return { + "nvimtools/none-ls.nvim", + config = function() + local null_ls = require("null-ls") + null_ls.setup({ + sources = { + null_ls.builtins.formatting.stylua, + null_ls.builtins.formatting.black, -- python + null_ls.builtins.formatting.yamlfmt, + null_ls.builtins.diagnostics.djlint, -- html + }, + }) + vim.keymap.set("n", "<leader>fg", vim.lsp.buf.format, {}) + end, +} diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua new file mode 100644 index 0000000..c4baade --- /dev/null +++ b/lua/plugins/telescope.lua @@ -0,0 +1,10 @@ +return { + "nvim-telescope/telescope.nvim", + tag = "0.1.6", + dependencies = { "nvim-lua/plenary.nvim" }, + config = function() + local builtin = require("telescope.builtin") + vim.keymap.set("n", "<C-p>", builtin.find_files, {}) + vim.keymap.set("n", "<leader>gf", builtin.live_grep, {}) + end, +} diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua new file mode 100644 index 0000000..e7b181d --- /dev/null +++ b/lua/plugins/treesitter.lua @@ -0,0 +1,13 @@ +return { + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + config = function() + local config = require("nvim-treesitter.configs") + config.setup({ + ensure_installed = { "lua", "javascript", "yaml", "python", "terraform" }, + sync_install = false, + highlight = { enable = true }, + indent = { enable = true }, + }) + end +} diff --git a/lua/vim-stuff.lua b/lua/vim-stuff.lua new file mode 100644 index 0000000..eade479 --- /dev/null +++ b/lua/vim-stuff.lua @@ -0,0 +1,60 @@ +vim.keymap.set("n", "<leader>e", vim.cmd.Ex) + +vim.cmd("inoremap jj <Esc>") +vim.cmd("nnoremap <leader>e :Ex<CR>") +vim.cmd("nnoremap <leader>b :bn<Cr>") +--vim.cmd("nnoremap <C-w> :bd<Cr>") + + +-- Main +vim.opt.nu = true +vim.opt.clipboard = { 'unnamedplus' } +vim.opt.wrap = false +vim.opt.termguicolors = true +vim.opt.swapfile = false + + +-- Tabs +vim.opt.tabstop = 2 +vim.opt.softtabstop = 2 +vim.opt.shiftwidth = 2 +vim.opt.expandtab = true + + +-- Cursor +vim.opt.guicursor = block +vim.opt.scrolloff = 999 +vim.opt.sidescrolloff = 999 + + +-- Search +vim.opt.hlsearch = true +vim.opt.incsearch = true +vim.opt.ignorecase = true + + + +-- Misc +vim.opt.formatoptions:remove{ "c", "r", "o" } -- No nextLine autocomments +vim.opt.smartindent = true +vim.g.netrw_banner = 0 + +--YML files - very nice +vim.cmd("autocmd Filetype yaml set cursorcolumn") +vim.cmd("autocmd Filetype yml set cursorcolumn") + +------------------------ +-- Disable Diagnostics - +------------------------ +-- lsp Disabple diagnostic - less good as it reDisables it every time. +-- vim.cmd("autocmd BufWinEnter * lua vim.diagnostic.disable()") + + +vim.diagnostic.config({ + virtual_text = false, + signs = false, + update_in_insert = false, + underline = false, + severity_sort = false, + float = false, +}) |