diff --git a/nvim/.gitignore b/nvim/.gitignore new file mode 100644 index 0000000..e033bc6 --- /dev/null +++ b/nvim/.gitignore @@ -0,0 +1 @@ +lazy-lock.json diff --git a/nvim/init.lua b/nvim/init.lua index d9edd15..afcf3ed 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -1,4 +1,6 @@ package.path = package.path .. ";/home/dhanus/.config/nvim/?.lua" + require('settings') require('bindings') +require('packconf.lazy') diff --git a/nvim/lua/plugins/init.lua b/nvim/lua/plugins/init.lua new file mode 100644 index 0000000..21acfc9 --- /dev/null +++ b/nvim/lua/plugins/init.lua @@ -0,0 +1,23 @@ +return { + { + "tpope/vim-fugitive", + }, + { + "nvim-telescope/telescope.nvim", + config = function() + local builtin = require('telescope.builtin') + vim.keymap.set('n', 'tf', builtin.find_files, { desc = 'Telescope find files' }) + vim.keymap.set('n', 'gr', builtin.live_grep, { desc = 'Telescope live grep' }) + vim.keymap.set('n', 'tb', builtin.buffers, { desc = 'Telescope buffers' }) + end + }, + { + "neovim/nvim-lspconfig", + config = function() + vim.lsp.enable('rust_analyzer') + vim.lsp.enable('clangd') + vim.lsp.enable('lua_ls') + vim.keymap.set('n', 'e', vim.diagnostic.open_float) + end + }, +} diff --git a/nvim/packconf/lazy.lua b/nvim/packconf/lazy.lua new file mode 100644 index 0000000..c382b5d --- /dev/null +++ b/nvim/packconf/lazy.lua @@ -0,0 +1,25 @@ +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" + +if not (vim.uv or vim.loop).fs_stat(lazypath) then + local lazyrepo = "https://github.com/folke/lazy.nvim.git" + local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) + if vim.v.shell_error ~= 0 then + vim.api.nvim_echo({ + { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, + { out, "WarningMsg" }, + { "\nPress any key to exit..." }, + }, true, {}) + vim.fn.getchar() + os.exit(1) + end +end + +vim.opt.rtp:prepend(lazypath) + +require("lazy").setup({ + spec = { + {import = "plugins"} + }, + install = { colorscheme = { "habamax" } }, + checker = { enabled = true }, +})