From 5ada6e2aa520c70b295b33a8083c01618044dbf1 Mon Sep 17 00:00:00 2001 From: padmanabhan08 Date: Thu, 15 May 2025 18:15:00 +0530 Subject: [PATCH] init.lua --- init.lua | 61 ++++++++++++++++++++++++++++++------------------- lua/plugins.lua | 0 2 files changed, 37 insertions(+), 24 deletions(-) create mode 100644 lua/plugins.lua diff --git a/init.lua b/init.lua index ee8fbc99..63c92622 100644 --- a/init.lua +++ b/init.lua @@ -86,12 +86,12 @@ P.S. You can delete this when you're done too. It's your config now! :) -- Set as the leader key -- See `:help mapleader` --- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used) +-- NOTE: Must happen befonre plugins are loaded (otherwise wrong leader will be used) vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' -- Set to true if you have a Nerd Font installed and selected in the terminal -vim.g.have_nerd_font = false +vim.g.have_nerd_font = true -- [[ Setting options ]] -- See `:help vim.opt` @@ -237,7 +237,6 @@ require('lazy').setup({ -- -- Use `opts = {}` to force a plugin to be loaded. -- - -- Here is a more advanced example where we pass configuration -- options to `gitsigns.nvim`. This is equivalent to the following Lua: -- require('gitsigns').setup({ ... }) @@ -256,20 +255,49 @@ require('lazy').setup({ }, }, - -- NOTE: Plugins can also be configured to run Lua code when they are loaded. + { + 'nvim-tree/nvim-tree.lua', + version = '*', + dependencies = { + 'nvim-tree/nvim-web-devicons', + }, + config = function() + require('nvim-web-devicons').setup {} + + require('nvim-tree').setup { + filters = { + dotfiles = false, + }, + git = { + enable = true, + ignore = false, + }, + } + end, + }, -- -- This is often very useful to both group configuration, as well as handle -- lazy loading plugins that don't need to be loaded immediately at startup. -- -- For example, in the following configuration, we use: -- event = 'VimEnter' - -- + --{{{ -- which loads which-key before all the UI elements are loaded. Events can be -- normal autocommands events (`:help autocmd-events`). -- -- Then, because we use the `opts` key (recommended), the configuration runs -- after the plugin has been loaded as `require(MODULE).setup(opts)`. - + -- + { + 'rose-pine/neovim', + priority = 1000, -- Ensures this plugin is loaded before others (if needed) + init = function() + -- Load the colorscheme here + vim.cmd.colorscheme 'rose-pine' -- Set the color scheme to 'tokyonight-day' + -- Customize highlight groups + vim.cmd.hi 'Comment gui=none' -- Set comment highlights + end, + }, { -- Useful plugin to show you pending keybinds. 'folke/which-key.nvim', event = 'VimEnter', -- Sets the loading event to 'VimEnter' @@ -400,6 +428,8 @@ require('lazy').setup({ -- See `:help telescope.builtin` local builtin = require 'telescope.builtin' + vim.keymap.set('n', 'e', ':NvimTreeToggle', { desc = 'Toggle File Explorer' }) + vim.keymap.set('n', 'sh', builtin.help_tags, { desc = '[S]earch [H]elp' }) vim.keymap.set('n', 'sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' }) vim.keymap.set('n', 'sf', builtin.find_files, { desc = '[S]earch [F]iles' }) @@ -466,6 +496,7 @@ require('lazy').setup({ -- Allows extra capabilities provided by nvim-cmp 'hrsh7th/cmp-nvim-lsp', }, + config = function() -- Brief aside: **What is LSP?** -- @@ -833,24 +864,6 @@ require('lazy').setup({ end, }, - { -- You can easily change to a different colorscheme. - -- Change the name of the colorscheme plugin below, and then - -- change the command in the config to whatever the name of that colorscheme is. - -- - -- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`. - 'folke/tokyonight.nvim', - priority = 1000, -- Make sure to load this before all the other start plugins. - init = function() - -- Load the colorscheme here. - -- Like many other themes, this one has different styles, and you could load - -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'. - vim.cmd.colorscheme 'tokyonight-night' - - -- You can configure highlights by doing something like: - vim.cmd.hi 'Comment gui=none' - end, - }, - -- Highlight todo, notes, etc in comments { 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } }, diff --git a/lua/plugins.lua b/lua/plugins.lua new file mode 100644 index 00000000..e69de29b