diff --git a/init.lua b/init.lua index 88658ef3033..8cf151fb871 100644 --- a/init.lua +++ b/init.lua @@ -91,7 +91,7 @@ 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` @@ -185,10 +185,13 @@ vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' } -- Use CTRL+ to switch between windows -- -- See `:help wincmd` for a list of all window commands -vim.keymap.set('n', '', '', { desc = 'Move focus to the left window' }) -vim.keymap.set('n', '', '', { desc = 'Move focus to the right window' }) -vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) -vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) +-- vim.keymap.set('n', '', '', { desc = 'Move focus to the left window' }) +-- vim.keymap.set('n', '', '', { desc = 'Move focus to the right window' }) +-- vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) +-- vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) +vim.keymap.set('n', '', '', { desc = 'Scroll up' }) +vim.keymap.set('n', '', '', { desc = 'Scroll down' }) + -- [[ Basic Autocommands ]] -- See `:help lua-guide-autocommands` @@ -718,9 +721,9 @@ require('lazy').setup({ -- No, but seriously. Please read `:help ins-completion`, it is really good! mapping = cmp.mapping.preset.insert { -- Select the [n]ext item - [''] = cmp.mapping.select_next_item(), + -- [''] = cmp.mapping.select_next_item(), -- Select the [p]revious item - [''] = cmp.mapping.select_prev_item(), + -- [''] = cmp.mapping.select_prev_item(), -- Scroll the documentation window [b]ack / [f]orward [''] = cmp.mapping.scroll_docs(-4), @@ -729,13 +732,13 @@ require('lazy').setup({ -- Accept ([y]es) the completion. -- This will auto-import if your LSP supports it. -- This will expand snippets if the LSP sent a snippet. - [''] = cmp.mapping.confirm { select = true }, + [''] = cmp.mapping.confirm { select = true }, -- If you prefer more traditional completion keymaps, -- you can uncomment the following lines --[''] = cmp.mapping.confirm { select = true }, - --[''] = cmp.mapping.select_next_item(), - --[''] = cmp.mapping.select_prev_item(), + [''] = cmp.mapping.select_next_item(), + [''] = cmp.mapping.select_prev_item(), -- Manually trigger a completion from nvim-cmp. -- Generally you don't need this, because nvim-cmp will display @@ -784,7 +787,7 @@ require('lazy').setup({ -- 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' + -- vim.cmd.colorscheme 'tokyonight-night' -- You can configure highlights by doing something like: vim.cmd.hi 'Comment gui=none' @@ -850,6 +853,8 @@ require('lazy').setup({ config = function(_, opts) -- [[ Configure Treesitter ]] See `:help nvim-treesitter` + require('nvim-treesitter.install').compilers = {"clang", "gcc"} + -- Prefer git instead of curl in order to improve connectivity in some environments require('nvim-treesitter.install').prefer_git = true ---@diagnostic disable-next-line: missing-fields @@ -874,9 +879,9 @@ require('lazy').setup({ -- Uncomment any of the lines below to enable them (you will need to restart nvim). -- -- require 'kickstart.plugins.debug', - -- require 'kickstart.plugins.indent_line', + require 'kickstart.plugins.indent_line', -- require 'kickstart.plugins.lint', - -- require 'kickstart.plugins.autopairs', + require 'kickstart.plugins.autopairs', -- require 'kickstart.plugins.neo-tree', -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps @@ -885,7 +890,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 diff --git a/lua/custom/plugins/auto_session.lua b/lua/custom/plugins/auto_session.lua new file mode 100644 index 00000000000..066dca78847 --- /dev/null +++ b/lua/custom/plugins/auto_session.lua @@ -0,0 +1,18 @@ +return { + 'rmagatti/auto-session', + config = function() + require("auto-session").setup { + log_level = "error", + + cwd_change_handling = { + restore_upcoming_session = true, -- already the default, no need to specify like this, only here as an example + pre_cwd_changed_hook = nil, -- already the default, no need to specify like this, only here as an example + post_cwd_changed_hook = function() -- example refreshing the lualine status line _after_ the cwd changes + require("lualine").refresh() -- refresh lualine so the new session name is displayed in the status bar + end, + }, + } + end +} + + diff --git a/lua/custom/plugins/colorschemes.lua b/lua/custom/plugins/colorschemes.lua new file mode 100644 index 00000000000..cd942ae01a0 --- /dev/null +++ b/lua/custom/plugins/colorschemes.lua @@ -0,0 +1,31 @@ +return{ + { + -- Gruvbox colorscheme + 'sainnhe/gruvbox-material', + 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 'gruvbox-material' + + -- You can configure highlights by doing something like: + -- vim.cmd.hi 'Comment gui=none' + end, + }, + { + -- catpuccin colorscheme + "catppuccin/nvim", + priority = 1000, + }, + { + -- kanagawa.nvim colorscheme + 'rebelot/kanagawa.nvim', + priority = 1000, + }, + { + -- onedark colorscheme + 'navarasu/onedark.nvim', + priority = 1000, + }, +} diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index be0eb9d8d7a..3adb89b1a98 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -2,4 +2,5 @@ -- I promise not to create any merge conflicts in this directory :) -- -- See the kickstart.nvim README for more information -return {} +return { +} diff --git a/lua/custom/plugins/oil.lua b/lua/custom/plugins/oil.lua new file mode 100644 index 00000000000..f943a03e32b --- /dev/null +++ b/lua/custom/plugins/oil.lua @@ -0,0 +1,15 @@ +return { + 'stevearc/oil.nvim', + -- Optional dependencies + dependencies = { "nvim-tree/nvim-web-devicons" }, + config = function() + require('oil').setup({ + view_options = { + -- Show files and directories starting with . + show_hidden = true + } + }) + vim.keymap.set("n", "-", "Oil", { desc = "Open parent directory" }) + end, +} + diff --git a/lua/custom/plugins/undotree.lua b/lua/custom/plugins/undotree.lua new file mode 100644 index 00000000000..86ea4b899b2 --- /dev/null +++ b/lua/custom/plugins/undotree.lua @@ -0,0 +1,6 @@ +return { + 'mbbill/undotree', + config = function() + vim.keymap.set('n', 'ut', vim.cmd.UndotreeToggle, { desc = "[u]ndo [t]ree"}) + end, +} diff --git a/lua/custom/plugins/vim_fugitive.lua b/lua/custom/plugins/vim_fugitive.lua new file mode 100644 index 00000000000..a0f4779c6c0 --- /dev/null +++ b/lua/custom/plugins/vim_fugitive.lua @@ -0,0 +1,6 @@ +return { + 'tpope/vim-fugitive', + config = function() + vim.keymap.set('n', 'G', vim.cmd.G, { desc = 'Open [G]it Window' }) + end, +}