diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000000..3e72b6e9630 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,35 @@ +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v5.0.0 + hooks: + - id: trailing-whitespace + - id: check-added-large-files + - id: end-of-file-fixer +- repo: https://github.com/hhatto/autopep8 + rev: 'v2.3.2' + hooks: + - id: autopep8 +- repo: https://github.com/gitleaks/gitleaks.git + rev: 'v8.24.0' + hooks: + - id: gitleaks +- repo: https://github.com/koalaman/shellcheck-precommit + rev: v0.10.0 + hooks: + - id: shellcheck + exclude: .*jenkins-slave$ +- repo: https://github.com/hadolint/hadolint + rev: v2.13.1-beta + hooks: + - id: hadolint-docker + args: + - --ignore=DL3015 # Ignore not using --no-install-recommends with apt + - --ignore=DL3008 # Ignore not pinning all software package versions (apt-get) + - --ignore=DL3018 # Ignore not pinning all software package versions (apk) + - --ignore=SC1091 # Ignore missing shellcheck mock files +- repo: https://github.com/gruntwork-io/pre-commit + rev: 'v0.1.26' + hooks: + - id: terraform-validate diff --git a/init.lua b/init.lua index 5cac3d14601..3f70ca0b73a 100644 --- a/init.lua +++ b/init.lua @@ -1,89 +1,3 @@ ---[[ - -===================================================================== -==================== READ THIS BEFORE CONTINUING ==================== -===================================================================== -======== .-----. ======== -======== .----------------------. | === | ======== -======== |.-""""""""""""""""""-.| |-----| ======== -======== || || | === | ======== -======== || KICKSTART.NVIM || |-----| ======== -======== || || | === | ======== -======== || || |-----| ======== -======== ||:Tutor || |:::::| ======== -======== |'-..................-'| |____o| ======== -======== `"")----------------(""` ___________ ======== -======== /::::::::::| |::::::::::\ \ no mouse \ ======== -======== /:::========| |==hjkl==:::\ \ required \ ======== -======== '""""""""""""' '""""""""""""' '""""""""""' ======== -======== ======== -===================================================================== -===================================================================== - -What is Kickstart? - - Kickstart.nvim is *not* a distribution. - - Kickstart.nvim is a starting point for your own configuration. - The goal is that you can read every line of code, top-to-bottom, understand - what your configuration is doing, and modify it to suit your needs. - - Once you've done that, you can start exploring, configuring and tinkering to - make Neovim your own! That might mean leaving Kickstart just the way it is for a while - or immediately breaking it into modular pieces. It's up to you! - - If you don't know anything about Lua, I recommend taking some time to read through - a guide. One possible example which will only take 10-15 minutes: - - https://learnxinyminutes.com/docs/lua/ - - After understanding a bit more about Lua, you can use `:help lua-guide` as a - reference for how Neovim integrates Lua. - - :help lua-guide - - (or HTML version): https://neovim.io/doc/user/lua-guide.html - -Kickstart Guide: - - TODO: The very first thing you should do is to run the command `:Tutor` in Neovim. - - If you don't know what this means, type the following: - - - - : - - Tutor - - - - (If you already know the Neovim basics, you can skip this step.) - - Once you've completed that, you can continue working through **AND READING** the rest - of the kickstart init.lua. - - Next, run AND READ `:help`. - This will open up a help window with some basic information - about reading, navigating and searching the builtin help documentation. - - This should be the first place you go to look when you're stuck or confused - with something. It's one of my favorite Neovim features. - - MOST IMPORTANTLY, we provide a keymap "sh" to [s]earch the [h]elp documentation, - which is very useful when you're not exactly sure of what you're looking for. - - I have left several `:help X` comments throughout the init.lua - These are hints about where to find more information about the relevant settings, - plugins or Neovim features used in Kickstart. - - NOTE: Look for lines like this - - Throughout the file. These are for you, the reader, to help you understand what is happening. - Feel free to delete them once you know what you're doing, but they should serve as a guide - for when you are first encountering a few different constructs in your Neovim config. - -If you experience any errors while trying to install kickstart, run `:checkhealth` for more info. - -I hope you enjoy your Neovim journey, -- TJ - -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) @@ -91,7 +5,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` @@ -107,6 +21,12 @@ vim.opt.number = true -- Enable mouse mode, can be useful for resizing splits for example! vim.opt.mouse = 'a' +-- Use spaces instead of tabs +vim.opt.tabstop = 4 +vim.opt.softtabstop = 4 +vim.opt.shiftwidth = 4 +vim.opt.expandtab = true + -- Don't show the mode, since it's already in the status line vim.opt.showmode = false @@ -118,6 +38,9 @@ vim.schedule(function() vim.opt.clipboard = 'unnamedplus' end) +-- Set syntax highlighting for .hujson to json +vim.cmd [[au BufNewFile,BufRead *.hujson setf json]] + -- Enable break indent vim.opt.breakindent = true @@ -141,6 +64,8 @@ vim.opt.timeoutlen = 300 vim.opt.splitright = true vim.opt.splitbelow = true +vim.g.expandtab = true + -- Sets how neovim will display certain whitespace characters in the editor. -- See `:help 'list'` -- and `:help 'listchars'` @@ -161,8 +86,38 @@ vim.opt.scrolloff = 10 -- Clear highlights on search when pressing in normal mode -- See `:help hlsearch` + vim.keymap.set('n', '', 'nohlsearch') +-- Buffer keymaps +local map = vim.keymap.set +map('n', 'bn', 'enew', { desc = '[B]uffer [N]ew' }) +map('n', '', 'BufferPrevious', { desc = 'Cycle Previous Buffer' }) +map('n', '', 'BufferNext', { desc = 'Cycle Next Buffer' }) +map('n', 'bN', 'BufferOrderByName', { desc = '[B]uffer Order by [N]ame' }) +map('n', 'bc', 'BufferClose!', { desc = '[B]uffer [C]lose' }) +map('n', 'br', 'BufferRestore', { desc = '[B]uffer [R]estore' }) +map('n', 'tc', 'gcc', { desc = '[T]oggle [C]omment', remap = true }) +map('v', 'tc', 'gc', { desc = '[T]oggle [C]omment', remap = true }) +map('n', ';', 'Telescope cmdline', { desc = 'Telescope Cmd History' }) + +-- Floaterm keymaps +map('n', 'tt', 'FloatermToggle', { desc = '[T]erminal [T]toggle' }) +map('n', 'tn', 'FloatermNew', { desc = '[T]erminal [New]' }) +map('n', 'tN', 'FloatermNext', { desc = 'Cycle Next Terminal' }) +vim.g.floaterm_title = 'Terminal ($1/$2)' + +-- Kubernetes keymaps +map('n', 'kkK', 'OpenK9s', { desc = 'Open [K]9s' }) +map('n', 'kkk', 'OpenK9sSplit', { desc = 'Open [k]9s in Split Pane' }) +map('n', 'kkc', 'SelectSplitCRD', { desc = 'View [C]RD in Split Pane' }) +map('n', 'klv', 'ViewPodLogs', { desc = '[V]iew Pod Logs' }) +map('n', 'klf', 'JsonFormatLogs', { desc = 'JSON Log [F]ormat' }) +map('n', 'kkt', 'ToggleYamlHelm', { desc = '[T]oggle YAML/Helm' }) +map('n', 'kka', 'KubectlApplyFromBuffer', { desc = '[A]pply Manifest from Buffer' }) +map('n', 'kht', 'HelmTemplateFromBuffer', { desc = '[H]elm [T]emplate' }) +map('n', 'khu', 'HelmDependencyUpdateFromBuffer', { desc = '[H]elm Dependency [U]pdate' }) + -- Diagnostic keymaps vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) @@ -203,6 +158,15 @@ vim.api.nvim_create_autocmd('TextYankPost', { end, }) +-- Enable concealing characters on certain filetypes +-- For markdown this renders inline links, etc +vim.api.nvim_create_autocmd('FileType', { + pattern = { 'markdown' }, + callback = function() + vim.opt.conceallevel = 3 + end, +}) + -- [[ Install `lazy.nvim` plugin manager ]] -- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' @@ -227,6 +191,48 @@ vim.opt.rtp:prepend(lazypath) -- -- NOTE: Here is where you install your plugins. require('lazy').setup({ + -- Automatically check for updates + checker = { + enabled = true, + notify = true, + }, + -- Enable caching + performance = { + cache = { + enabled = true, + }, + -- Disable some rtp plugins for performance + rtp = { + disabled_plugins = { + '2html_plugin', + 'tohtml', + 'getscript', + 'getscriptPlugin', + 'gzip', + 'logipat', + 'netrw', + 'netrwPlugin', + 'netrwSettings', + 'netrwFileHandlers', + 'matchit', + 'tar', + 'tarPlugin', + 'rrhelper', + 'spellfile_plugin', + 'vimball', + 'vimballPlugin', + 'zip', + 'zipPlugin', + 'tutor', + 'rplugin', + 'syntax', + 'synmenu', + 'optwin', + 'compiler', + 'bugreport', + }, + }, + }, -- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link). 'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically @@ -252,18 +258,18 @@ require('lazy').setup({ -- options to `gitsigns.nvim`. -- -- See `:help gitsigns` to understand what the configuration keys do - { -- Adds git related signs to the gutter, as well as utilities for managing changes - 'lewis6991/gitsigns.nvim', - opts = { - signs = { - add = { text = '+' }, - change = { text = '~' }, - delete = { text = '_' }, - topdelete = { text = '‾' }, - changedelete = { text = '~' }, - }, - }, - }, + -- { -- Adds git related signs to the gutter, as well as utilities for managing changes + -- 'lewis6991/gitsigns.nvim', + -- opts = { + -- signs = { + -- add = { text = '+' }, + -- change = { text = '~' }, + -- delete = { text = '_' }, + -- topdelete = { text = '‾' }, + -- changedelete = { text = '~' }, + -- }, + -- }, + -- }, -- NOTE: Plugins can also be configured to run Lua code when they are loaded. -- @@ -276,8 +282,10 @@ require('lazy').setup({ -- 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)`. + { 'voldikss/vim-floaterm' }, { -- Useful plugin to show you pending keybinds. 'folke/which-key.nvim', @@ -325,12 +333,19 @@ require('lazy').setup({ -- Document existing key chains spec = { + { 'k', group = '[K]ubernetes' }, + { 'kk', group = '[K]ubectl' }, + { 'kl', group = '[L]ogs' }, + { 'kh', group = '[H]elm' }, { 'c', group = '[C]ode', mode = { 'n', 'x' } }, { 'd', group = '[D]ocument' }, { 'r', group = '[R]ename' }, + { 'g', group = '[G]it' }, { 's', group = '[S]earch' }, { 'w', group = '[W]orkspace' }, { 't', group = '[T]oggle' }, + { 'b', group = '[B]uffer' }, + { 'l', group = '[L]azy Git' }, { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, }, }, @@ -349,6 +364,8 @@ require('lazy').setup({ branch = '0.1.x', dependencies = { 'nvim-lua/plenary.nvim', + 'jonarrien/telescope-cmdline.nvim', + 'jvgrootveld/telescope-zoxide', { -- If encountering errors, see telescope-fzf-native README for installation instructions 'nvim-telescope/telescope-fzf-native.nvim', @@ -393,25 +410,40 @@ require('lazy').setup({ -- You can put your default mappings / updates / etc. in here -- All the info you're looking for is in `:help telescope.setup()` -- - -- defaults = { - -- mappings = { - -- i = { [''] = 'to_fuzzy_refine' }, - -- }, - -- }, + defaults = { + layout_config = { + prompt_position = 'top', + }, + sorting_strategy = 'ascending', + }, -- pickers = {} extensions = { ['ui-select'] = { require('telescope.themes').get_dropdown(), }, + zoxide = { + mappings = { + default = { + after_action = function(selection) + print('Update to (' .. selection.z_score .. ') ' .. selection.path) + end, + }, + }, + }, }, } -- Enable Telescope extensions if they are installed pcall(require('telescope').load_extension, 'fzf') pcall(require('telescope').load_extension, 'ui-select') + pcall(require('telescope').load_extension, 'cmdline') + pcall(require('telescope').load_extension, 'zoxide') -- See `:help telescope.builtin` local builtin = require 'telescope.builtin' + vim.keymap.set('n', 'gs', builtin.git_status, { desc = '[G]it [S]tatus' }) + vim.keymap.set('n', 'gc', builtin.git_commits, { desc = '[G]it [C]ommits' }) + vim.keymap.set('n', 'gb', builtin.git_branches, { desc = '[G]it [B]ranches' }) 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' }) @@ -422,6 +454,7 @@ require('lazy').setup({ vim.keymap.set('n', 'sr', builtin.resume, { desc = '[S]earch [R]esume' }) vim.keymap.set('n', 's.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) vim.keymap.set('n', '', builtin.buffers, { desc = '[ ] Find existing buffers' }) + vim.keymap.set('n', 'Z', require('telescope').extensions.zoxide.list, { desc = 'Open [Z]oxide' }) -- Slightly advanced example of overriding default behavior and theme vim.keymap.set('n', '/', function() @@ -659,8 +692,58 @@ require('lazy').setup({ -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ local servers = { -- clangd = {}, - -- gopls = {}, - -- pyright = {}, + gopls = {}, + jsonls = {}, + ansiblels = { + settings = { + ansible = { + validation = { + enabled = true, + lint = { + enabled = true, + }, + }, + }, + }, + }, + -- pyright { + bashls = {}, + helm_ls = {}, + groovyls = {}, + terraformls = {}, + -- yamlls = { + -- settings = { + -- yaml = { + -- keyOrdering = false, + -- }, + -- }, + -- }, + pylsp = { + settings = { + pylsp = { + plugins = { + -- Formatters + autopep8 = { enabled = true }, + black = { enabled = false }, + pyls_isort = { enabled = true }, + yapf = { enabled = false }, + -- Linters + pylint = { enabled = false }, + pyflakes = { enabled = true }, + pycodestyle = { + ignore = { 'W391' }, + maxLineLength = 130, + }, + -- Complexity Checkers + mccabe = { enabled = true }, + -- Type Checkers + pylsp_mypy = { enabled = true }, + -- Auto-completers + jedi_completion = { fuzzy = true }, + }, + }, + }, + }, -- rust_analyzer = {}, -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs -- @@ -703,6 +786,12 @@ require('lazy').setup({ local ensure_installed = vim.tbl_keys(servers or {}) vim.list_extend(ensure_installed, { 'stylua', -- Used to format Lua code + 'python-lsp-server', + 'terraform-ls', + 'bash-language-server', + 'autopep8', + 'json-lsp', + 'groovy-language-server', }) require('mason-tool-installer').setup { ensure_installed = ensure_installed } @@ -757,6 +846,8 @@ require('lazy').setup({ end, formatters_by_ft = { lua = { 'stylua' }, + python = { 'autopep8' }, + sh = { 'shfmt' }, -- Conform can also run multiple formatters sequentially -- python = { "isort", "black" }, -- @@ -786,12 +877,12 @@ require('lazy').setup({ -- `friendly-snippets` contains a variety of premade snippets. -- See the README about individual language/framework/plugin snippets: -- https://github.com/rafamadriz/friendly-snippets - -- { - -- 'rafamadriz/friendly-snippets', - -- config = function() - -- require('luasnip.loaders.from_vscode').lazy_load() - -- end, - -- }, + { + 'rafamadriz/friendly-snippets', + config = function() + require('luasnip.loaders.from_vscode').lazy_load() + end, + }, }, }, 'saadparwaiz1/cmp_luasnip', @@ -838,9 +929,9 @@ require('lazy').setup({ -- 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.confirm { select = true }, + [''] = 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 @@ -889,20 +980,21 @@ require('lazy').setup({ -- 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. + 'projekt0n/github-nvim-theme', + name = 'github-theme', + lazy = false, + priority = 1000, config = function() - ---@diagnostic disable-next-line: missing-fields - require('tokyonight').setup { - styles = { - comments = { italic = false }, -- Disable italics in comments - }, - } - + require('github-theme').setup {} + end, + 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' + vim.cmd.colorscheme 'github_dark' + + -- You can configure highlights by doing something like: + vim.cmd.hi 'Comment gui=none' end, }, @@ -930,17 +1022,17 @@ require('lazy').setup({ -- Simple and easy statusline. -- You could remove this setup call if you don't like it, -- and try some other statusline plugin - local statusline = require 'mini.statusline' - -- set use_icons to true if you have a Nerd Font - statusline.setup { use_icons = vim.g.have_nerd_font } - - -- You can configure sections in the statusline by overriding their - -- default behavior. For example, here we set the section for - -- cursor location to LINE:COLUMN - ---@diagnostic disable-next-line: duplicate-set-field - statusline.section_location = function() - return '%2l:%-2v' - end + -- local statusline = require 'mini.statusline' + -- -- set use_icons to true if you have a Nerd Font + -- statusline.setup { use_icons = vim.g.have_nerd_font } + -- + -- -- You can configure sections in the statusline by overriding their + -- -- default behavior. For example, here we set the section for + -- -- cursor location to LINE:COLUMN + -- ---@diagnostic disable-next-line: duplicate-set-field + -- statusline.section_location = function() + -- return '%2l:%-2v' + -- end -- ... and there is more! -- Check out: https://github.com/echasnovski/mini.nvim @@ -952,7 +1044,24 @@ require('lazy').setup({ main = 'nvim-treesitter.configs', -- Sets main module to use for opts -- [[ Configure Treesitter ]] See `:help nvim-treesitter` opts = { - ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }, + ensure_installed = { + 'bash', + 'diff', + 'lua', + 'luadoc', + 'markdown', + 'markdown_inline', + 'vim', + 'vimdoc', + 'hcl', + 'python', + 'go', + 'yaml', + 'markdown', + 'markdown_inline', + 'dockerfile', + 'toml', + }, -- Autoinstall languages that are not installed auto_install = true, highlight = { @@ -984,15 +1093,16 @@ require('lazy').setup({ -- require 'kickstart.plugins.debug', -- require 'kickstart.plugins.indent_line', -- require 'kickstart.plugins.lint', - -- require 'kickstart.plugins.autopairs', - -- require 'kickstart.plugins.neo-tree', - -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps + require 'kickstart.plugins.autopairs', + require 'kickstart.plugins.neo-tree', + require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` -- This is the easiest way to modularize your config. -- -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. - -- { import = 'custom.plugins' }, + -- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins` + { import = 'custom.plugins' }, -- -- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec` -- Or use telescope! diff --git a/lua/custom/plugins/barbar.lua b/lua/custom/plugins/barbar.lua new file mode 100644 index 00000000000..bbe9c525dce --- /dev/null +++ b/lua/custom/plugins/barbar.lua @@ -0,0 +1,21 @@ +return { + { + 'romgrk/barbar.nvim', + dependencies = { + 'lewis6991/gitsigns.nvim', + 'nvim-tree/nvim-web-devicons', + }, + init = function() + vim.g.barbar_auto_setup = false + end, + opts = { + animation = true, + insert_at_start = true, + sidebar_filetypes = { + ['neo-tree'] = { event = 'BufWipeout' }, + }, + }, + version = '^1.0.0', + }, + require('gitsigns').setup {}, +} diff --git a/lua/custom/plugins/dashboard.lua b/lua/custom/plugins/dashboard.lua new file mode 100644 index 00000000000..705a7754b2a --- /dev/null +++ b/lua/custom/plugins/dashboard.lua @@ -0,0 +1,70 @@ +return { + { + 'nvimdev/dashboard-nvim', + lazy = false, -- As https://github.com/nvimdev/dashboard-nvim/pull/450, dashboard-nvim shouldn't be lazy-loaded to properly handle stdin. + dependencies = { + { 'nvim-tree/nvim-web-devicons' }, + }, + opts = function() + local logo = [[ + ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ + ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ + ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ + ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ + ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ + ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ + ]] + + logo = string.rep('\n', 8) .. logo .. '\n\n' + + local builtin = require 'telescope.builtin' + local opts = { + theme = 'doom', + hide = { + -- this is taken care of by lualine + -- enabling this messes up the actual laststatus setting after loading a file + statusline = false, + }, + config = { + header = vim.split(logo, '\n'), + -- stylua: ignore + center = { + { action = builtin.find_files, desc = " Find File", icon = " ", key = "f" }, + { action = "ene | startinsert", desc = " New File", icon = " ", key = "n" }, + { action = builtin.oldfiles, desc = " Recent Files", icon = " ", key = "r" }, + { action = builtin.live_grep, desc = " Find Text", icon = " ", key = "g" }, + { action = 'lua require("persistence").load()', desc = " Restore Session", icon = " ", key = "s" }, + { action = "Lazy", desc = " Lazy", icon = "󰒲 ", key = "l" }, + { action = "Mason", desc = " Mason", icon = "⌘ ", key = "m" }, + { action = function() vim.api.nvim_input("qa!") end, desc = " Quit", icon = " ", key = "q" }, + }, + footer = function() + local stats = require('lazy').stats() + local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100) + return { '⚡ Neovim loaded ' .. stats.loaded .. '/' .. stats.count .. ' plugins in ' .. ms .. 'ms' } + end, + }, + } + + for _, button in ipairs(opts.config.center) do + button.desc = button.desc .. string.rep(' ', 43 - #button.desc) + button.key_format = ' %s' + end + + -- open dashboard after closing lazy + if vim.o.filetype == 'lazy' then + vim.api.nvim_create_autocmd('WinClosed', { + pattern = tostring(vim.api.nvim_get_current_win()), + once = true, + callback = function() + vim.schedule(function() + vim.api.nvim_exec_autocmds('UIEnter', { group = 'dashboard' }) + end) + end, + }) + end + + return opts + end, + }, +} diff --git a/lua/custom/plugins/filetype.lua b/lua/custom/plugins/filetype.lua new file mode 100644 index 00000000000..e2f3370fe9b --- /dev/null +++ b/lua/custom/plugins/filetype.lua @@ -0,0 +1,7 @@ +return { + 'towolf/vim-helm', + lazy = false, + dependencies = { + 'crakkhead/ansible.nvim', + }, +} diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua deleted file mode 100644 index be0eb9d8d7a..00000000000 --- a/lua/custom/plugins/init.lua +++ /dev/null @@ -1,5 +0,0 @@ --- You can add your own plugins here or in other files in this directory! --- I promise not to create any merge conflicts in this directory :) --- --- See the kickstart.nvim README for more information -return {} diff --git a/lua/custom/plugins/kube-utils.lua b/lua/custom/plugins/kube-utils.lua new file mode 100644 index 00000000000..fd5a5d44b08 --- /dev/null +++ b/lua/custom/plugins/kube-utils.lua @@ -0,0 +1,11 @@ +return { + { + 'h4ckm1n-dev/kube-utils-nvim', + dependencies = { 'nvim-telescope/telescope.nvim' }, + lazy = true, + event = 'VeryLazy', + config = function() + require('kube-utils-nvim').setup() + end, + }, +} diff --git a/lua/custom/plugins/lazygit.lua b/lua/custom/plugins/lazygit.lua new file mode 100644 index 00000000000..0794409bfdb --- /dev/null +++ b/lua/custom/plugins/lazygit.lua @@ -0,0 +1,20 @@ +return { + 'kdheepak/lazygit.nvim', + lazy = true, + cmd = { + 'LazyGit', + 'LazyGitConfig', + 'LazyGitCurrentFile', + 'LazyGitFilter', + 'LazyGitFilterCurrentFile', + }, + -- optional for floating window border decoration + dependencies = { + 'nvim-lua/plenary.nvim', + }, + -- setting the keybinding for LazyGit with 'keys' is recommended in + -- order to load the plugin when the command is run for the first time + keys = { + { 'lg', 'LazyGit', desc = '[L]azy[G]it' }, + }, +} diff --git a/lua/custom/plugins/lualine.lua b/lua/custom/plugins/lualine.lua new file mode 100644 index 00000000000..bb8f80ad74d --- /dev/null +++ b/lua/custom/plugins/lualine.lua @@ -0,0 +1,15 @@ +return { + -- Use lualine instead of mini.statusline + { + 'nvim-lualine/lualine.nvim', + dependencies = { 'nvim-tree/nvim-web-devicons' }, + config = function() + require('lualine').setup { + options = { + icons_enabled = true, + globalstatus = true, + }, + } + end, + }, +} diff --git a/lua/custom/plugins/persistence.lua b/lua/custom/plugins/persistence.lua new file mode 100644 index 00000000000..82ea737c784 --- /dev/null +++ b/lua/custom/plugins/persistence.lua @@ -0,0 +1,19 @@ +return { + -- Session management. This saves your session in the background, + -- keeping track of open buffers, window arrangement, and more. + -- You can restore sessions when returning through the dashboard. + { + 'folke/persistence.nvim', + event = 'BufReadPre', + opts = {}, + -- stylua: ignore + keys = { + { "sS", function() require("persistence").select() end,desc = "[S]earch Previous [S]essions" }, + { "sR", function() require("persistence").load({ last = true }) end, desc = "Restore Last [S]ession" }, + { "sD", function() require("persistence").stop() end, desc = "Don't Save Current [S]ession" }, + }, + }, + + -- library used by other plugins + { 'nvim-lua/plenary.nvim', lazy = true }, +} diff --git a/lua/kickstart/plugins/neo-tree.lua b/lua/kickstart/plugins/neo-tree.lua index bd4422695aa..dd128bf2265 100644 --- a/lua/kickstart/plugins/neo-tree.lua +++ b/lua/kickstart/plugins/neo-tree.lua @@ -11,13 +11,13 @@ return { }, cmd = 'Neotree', keys = { - { '\\', ':Neotree reveal', desc = 'NeoTree reveal', silent = true }, + { 'e', ':Neotree reveal', desc = '[N]eoTree reveal', silent = true }, }, opts = { filesystem = { window = { mappings = { - ['\\'] = 'close_window', + ['e'] = 'close_window', }, }, },