From db882645be525a7b633704c9a3ed570f311b0202 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Miguel=20R=C3=BAa?= Date: Tue, 30 Apr 2024 17:47:47 +0200 Subject: [PATCH] Adding oil.lua and theme.lua plugins --- init.lua | 45 +++++++++++++++++++---------------- lua/custom/plugins/oil.lua | 16 +++++++++++++ lua/custom/plugins/themes.lua | 22 +++++++++++++++++ 3 files changed, 62 insertions(+), 21 deletions(-) create mode 100644 lua/custom/plugins/oil.lua create mode 100644 lua/custom/plugins/themes.lua diff --git a/init.lua b/init.lua index 5b145fbb..83c21b27 100644 --- a/init.lua +++ b/init.lua @@ -164,7 +164,8 @@ vim.keymap.set('n', '', 'nohlsearch') -- Diagnostic keymaps vim.keymap.set('n', 'qq', 'q!', { desc = 'Quit all without close' }) vim.keymap.set('n', '', 'w', { desc = 'Save a file' }) -vim.keymap.set('n', 'e', vim.diagnostic.open_float, { desc = 'Show diagnostic [E]rror messages' }) +vim.keymap.set('n', 'e', 'Oil', { desc = 'Open folder structure with Oil' }) +vim.keymap.set('n', 'E', vim.diagnostic.open_float, { desc = 'Show diagnostic [E]rror messages' }) vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) -- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier @@ -221,6 +222,7 @@ vim.cmd 'set expandtab' vim.cmd 'set tabstop=2' vim.cmd 'set softtabstop=2' vim.cmd 'set shiftwidth=2' + -- require('lazy').setup({ -- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link). @@ -804,27 +806,27 @@ 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. - opts = { - transparent = true, - }, + -- { -- 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. + -- opts = { + -- transparent = true, + -- }, - 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' + -- 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, - }, + -- 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 } }, @@ -933,7 +935,7 @@ require('lazy').setup({ -- -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. -- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins` - -- { import = 'custom.plugins' }, + { import = 'custom.plugins' }, }, { ui = { -- If you are using a Nerd Font: set icons to an empty table which will use the @@ -956,5 +958,6 @@ require('lazy').setup({ }, }) +vim.cmd.colorscheme 'catppuccin' -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et diff --git a/lua/custom/plugins/oil.lua b/lua/custom/plugins/oil.lua new file mode 100644 index 00000000..d776f122 --- /dev/null +++ b/lua/custom/plugins/oil.lua @@ -0,0 +1,16 @@ +return { + { + 'stevearc/oil.nvim', + opts = {}, + -- Optional dependencies + dependencies = { 'nvim-tree/nvim-web-devicons' }, + + config = function() + require('oil').setup { + default_file_explorer = true, + } + + vim.keymap.set('n', 'e', 'Oil', { desc = 'Open folder structure with Oil' }) + end, + }, +} diff --git a/lua/custom/plugins/themes.lua b/lua/custom/plugins/themes.lua new file mode 100644 index 00000000..8ed5e530 --- /dev/null +++ b/lua/custom/plugins/themes.lua @@ -0,0 +1,22 @@ +return { + { + 'catppuccin/nvim', + name = 'catppuccin', + priority = 1000, + opts = { + flavour = 'macchiato', + transparent_background = true, + term_colors = true, + custom_highlights = function(colors) + return { + Comment = { fg = colors.subtext1 }, + TabLineSel = { bg = colors.teal }, + CmpBorder = { fg = colors.surface2 }, + StatusLine = { fg = colors.blue }, + GetFile = { fg = colors.blue }, + } + end, + }, + }, + { 'folke/tokyonight.nvim', name = 'tokyonight', priority = 1000, opts = { transparent = true } }, +}