commit cf8f6fc5f462434c46285bd07f32a490c5ab0b8a Author: kenyzum Date: Thu Feb 26 15:09:38 2026 +0100 init diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..cb09597 --- /dev/null +++ b/init.lua @@ -0,0 +1,33 @@ +vim.cmd("set expandtab") +vim.cmd("set tabstop=2") +vim.cmd("set softtabstop=2") +vim.cmd("set shiftwidth=2") +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", + lazypath, + }) +end +vim.opt.rtp:prepend(lazypath) + +require("lazy").setup("plugins") +local builtin = require("telescope.builtin") +vim.keymap.set('n', '', builtin.find_files, {}) +vim.keymap.set('n', 'fg', builtin.live_grep, {}) +vim.keymap.set('n', '', ':Neotree filesystem reveal left') + +require('nvim-treesitter').setup { + ensure_installed = { "c", "javascript", "lua" }, + highlight = { enable = true }, + indent = { enable = true } +} + +require("catppuccin").setup() +vim.cmd.colorscheme "catppuccin" diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 0000000..543c70a --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,18 @@ +{ + "LuaSnip": { "branch": "master", "commit": "dae4f5aaa3574bd0c2b9dd20fb9542a02c10471c" }, + "catppuccin": { "branch": "main", "commit": "0a5de4da015a175f416d6ef1eda84661623e0500" }, + "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" }, + "cmp-nvim-lua": { "branch": "main", "commit": "e3a22cb071eb9d6508a156306b102c45cd2d573d" }, + "cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" }, + "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, + "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, + "neo-tree.nvim": { "branch": "v3.x", "commit": "9d6826582a3e8c84787bd7355df22a2812a1ad59" }, + "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, + "nvim-cmp": { "branch": "main", "commit": "da88697d7f45d16852c6b2769dc52387d1ddc45f" }, + "nvim-lspconfig": { "branch": "master", "commit": "f386df19b145607a33885b6110ef5c04faae42cb" }, + "nvim-treesitter": { "branch": "main", "commit": "957f86ae3f049ab6681ed64c05b05768fcaed0d2" }, + "nvim-web-devicons": { "branch": "master", "commit": "737cf6c657898d0c697311d79d361288a1343d50" }, + "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, + "telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" } +} diff --git a/lua/plugins/catppuccin.lua b/lua/plugins/catppuccin.lua new file mode 100644 index 0000000..a6d1b7c --- /dev/null +++ b/lua/plugins/catppuccin.lua @@ -0,0 +1,5 @@ +return { + "catppuccin/nvim", + name = "catppuccin", + priority = 1000 +} diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua new file mode 100644 index 0000000..72db529 --- /dev/null +++ b/lua/plugins/cmp.lua @@ -0,0 +1,31 @@ +return { + "hrsh7th/nvim-cmp", + dependencies = { + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-nvim-lua", + "saadparwaiz1/cmp_luasnip", + "L3MON4D3/LuaSnip", + }, + config = function() + local cmp = require'cmp' + local luasnip = require'luasnip' + + cmp.setup({ + snippet = { expand = function(args) luasnip.lsp_expand(argx.body) end }, + mapping = cmp.mapping.preset.insert({ + [''] = cmp.mapping.select_next_item(), + [''] = cmp.mapping.select_prev_item(), + [''] = cmp.mapping.confirm({ select = true }), + [''] = cmp.mapping.complete(), + }), + sources = { + { name = 'nvim_lsp' }, + { name = 'luasnip' }, + { name = 'buffer' }, + { name = 'path' }, + } + }) + end +} diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua new file mode 100644 index 0000000..3def804 --- /dev/null +++ b/lua/plugins/lsp.lua @@ -0,0 +1,17 @@ +return { + "neovim/nvim-lspconfig", + config = function() + local cmp_nvim_lsp = require("cmp_nvim_lsp") + local capabilities = cmp_nvim_lsp.default_capabilities() + + vim.lsp.config('clangd', { + capabilities = capabilities, + cmd = { "clangd", "--background-index" }, + filetypes = { "c", "cpp", "objc", "objcpp" }, + root_markers = { "compile_commands.json", ".git" }, + }) + + vim.lsp.enable('clangd') + vim.keymap.set('n', 'e', vim.diagnostic.open_float) + end +} diff --git a/lua/plugins/neo_tree.lua b/lua/plugins/neo_tree.lua new file mode 100644 index 0000000..f7a5f1e --- /dev/null +++ b/lua/plugins/neo_tree.lua @@ -0,0 +1,11 @@ +return { + "nvim-neo-tree/neo-tree.nvim", + branch = "v3.x", + dependencies = { + "nvim-lua/plenary.nvim", + "MunifTanjim/nui.nvim", + "nvim-tree/nvim-web-devicons" + }, + lazy = false, +} + diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua new file mode 100644 index 0000000..52c6aab --- /dev/null +++ b/lua/plugins/telescope.lua @@ -0,0 +1,5 @@ +return { + "nvim-telescope/telescope.nvim", + tag = "0.1.5", + dependencies = { "nvim-lua/plenary.nvim" } +} diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua new file mode 100644 index 0000000..a6a684e --- /dev/null +++ b/lua/plugins/treesitter.lua @@ -0,0 +1,5 @@ +return { + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + highlight = { enable = true } +}