From 94403559fc507ffe03a9e8dddb76e45ae9a2dedb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0mundur=20Bjarki=20Sigur=C3=B0sson?= Date: Wed, 27 Mar 2024 00:13:27 +0000 Subject: [PATCH] wip --- init.lua | 11 +++-- lua/custom/plugins/colorscheme.lua | 6 +-- lua/custom/plugins/conform.lua | 2 +- lua/custom/plugins/deshboard.lua | 71 ++++++++++++++++++++++++++++++ lua/custom/plugins/indent_line.lua | 9 ---- lua/custom/plugins/lspconfig.lua | 2 +- lua/custom/plugins/treesitter.lua | 2 +- 7 files changed, 82 insertions(+), 21 deletions(-) create mode 100644 lua/custom/plugins/deshboard.lua delete mode 100644 lua/custom/plugins/indent_line.lua diff --git a/init.lua b/init.lua index a91641ad..aff4c7d4 100644 --- a/init.lua +++ b/init.lua @@ -16,7 +16,7 @@ vim.g.have_nerd_font = true vim.opt.number = true -- You can also add relative line numbers, to help with jumping. -- Experiment for yourself to see if you like it! --- vim.opt.relativenumber = true +vim.opt.relativenumber = true -- Enable mouse mode, can be useful for resizing splits for example! vim.opt.mouse = 'a' @@ -90,10 +90,10 @@ vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagn vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' }) -- TIP: Disable arrow keys in normal mode --- vim.keymap.set('n', '', 'echo "Use h to move!!"') --- vim.keymap.set('n', '', 'echo "Use l to move!!"') --- vim.keymap.set('n', '', 'echo "Use k to move!!"') --- vim.keymap.set('n', '', 'echo "Use j to move!!"') +vim.keymap.set('n', '', 'echo "Use h to move!!"') +vim.keymap.set('n', '', 'echo "Use l to move!!"') +vim.keymap.set('n', '', 'echo "Use k to move!!"') +vim.keymap.set('n', '', 'echo "Use j to move!!"') -- Keybinds to make split navigation easier. -- Use CTRL+ to switch between windows @@ -139,7 +139,6 @@ vim.opt.rtp:prepend(lazypath) -- -- NOTE: Here is where you install your plugins. require('lazy').setup({ - -- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link). 'tpope/vim-sleuth', { 'numToStr/Comment.nvim', opts = {} }, { import = 'custom.plugins' }, diff --git a/lua/custom/plugins/colorscheme.lua b/lua/custom/plugins/colorscheme.lua index 8fe74eeb..40f77dd4 100644 --- a/lua/custom/plugins/colorscheme.lua +++ b/lua/custom/plugins/colorscheme.lua @@ -3,13 +3,13 @@ return { -- You can easily change to a different colorscheme. -- 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. + 'ellisonleao/gruvbox.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' + vim.cmd.colorscheme 'gruvbox' -- You can configure highlights by doing something like: vim.cmd.hi 'Comment gui=none' diff --git a/lua/custom/plugins/conform.lua b/lua/custom/plugins/conform.lua index 51293a58..86ab6687 100644 --- a/lua/custom/plugins/conform.lua +++ b/lua/custom/plugins/conform.lua @@ -15,7 +15,7 @@ return { -- Autoformat formatters_by_ft = { lua = { 'stylua' }, -- Conform can also run multiple formatters sequentially - -- python = { "isort", "black" }, + python = { "isort", "black" }, -- -- You can use a sub-list to tell conform to run *until* a formatter -- is found. diff --git a/lua/custom/plugins/deshboard.lua b/lua/custom/plugins/deshboard.lua new file mode 100644 index 00000000..b1d55fee --- /dev/null +++ b/lua/custom/plugins/deshboard.lua @@ -0,0 +1,71 @@ +return { + "nvimdev/dashboard-nvim", + event = "VimEnter", + opts = function() + local logo = [[ + 9XXb._ _.dXXXXb dXXXXbo. .odXXXXb dXXXXb._ _.dXXP", + 9XXXXXXXXXXXXXXXXXXXVXXXXXXXXOo. .oOXXXXXXXXVXXXXXXXXXXXXXXXXXXXP", + `9XXXXXXXXXXXXXXXXXXXXX'~ ~`OOO8b d8OOO'~ ~`XXXXXXXXXXXXXXXXXXXXXP'", + `9XXXXXXXXXXXP' `9XX' DIE `98v8P' HUMAN `XXP' `9XXXXXXXXXXXP'", + ~~~~~~~ 9X. .db|db. .XP ~~~~~~~", + )b. .dbo.dP'`v'`9b.odb. .dX(", + ,dXXXXXXXXXXXb dXXXXXXXXXXXb.", + dXXXXXXXXXXXP' . `9XXXXXXXXXXXb", + dXXXXXXXXXXXXb d|b dXXXXXXXXXXXXb", + 9XXb' `XXXXXb.dX|Xb.dXXXXX' `dXXP", + `' 9XXXXXX( )XXXXXXP `'", + XXXX X.`v'.X XXXX", + XP^X'`b d'`X^XX", + X. 9 ` ' P )X", + ]] + + logo = string.rep("\n", 8) .. logo .. "\n\n" + + 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 = LazyVim.telescope("files"), desc = " Find file", icon = " ", key = "f" }, + { action = "ene | startinsert", desc = " New file", icon = " ", key = "n" }, + { action = "Telescope oldfiles", desc = " Recent files", icon = " ", key = "r" }, + { action = "Telescope live_grep", desc = " Find text", icon = " ", key = "g" }, + { action = [[lua LazyVim.telescope.config_files()()]], desc = " Config", icon = " ", key = "c" }, + { action = 'lua require("persistence").load()', desc = " Restore Session", icon = " ", key = "s" }, + { action = "LazyExtras", desc = " Lazy Extras", icon = " ", key = "x" }, + { action = "Lazy", desc = " Lazy", icon = "󰒲 ", key = "l" }, + { action = "qa", 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 + + -- close Lazy and re-open when the dashboard is ready + if vim.o.filetype == "lazy" then + vim.cmd.close() + vim.api.nvim_create_autocmd("User", { + pattern = "DashboardLoaded", + callback = function() + require("lazy").show() + end, + }) + end + + return opts + end, +} diff --git a/lua/custom/plugins/indent_line.lua b/lua/custom/plugins/indent_line.lua deleted file mode 100644 index ed7f2693..00000000 --- a/lua/custom/plugins/indent_line.lua +++ /dev/null @@ -1,9 +0,0 @@ -return { - { -- Add indentation guides even on blank lines - 'lukas-reineke/indent-blankline.nvim', - -- Enable `lukas-reineke/indent-blankline.nvim` - -- See `:help ibl` - main = 'ibl', - opts = {}, - }, -} diff --git a/lua/custom/plugins/lspconfig.lua b/lua/custom/plugins/lspconfig.lua index 4146b6ee..5a97b49f 100644 --- a/lua/custom/plugins/lspconfig.lua +++ b/lua/custom/plugins/lspconfig.lua @@ -136,7 +136,7 @@ return { -- LSP Configuration & Plugins local servers = { -- clangd = {}, -- gopls = {}, - -- pyright = {}, + pyright = {}, -- rust_analyzer = {}, -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs -- diff --git a/lua/custom/plugins/treesitter.lua b/lua/custom/plugins/treesitter.lua index fa555f74..df4ed15a 100644 --- a/lua/custom/plugins/treesitter.lua +++ b/lua/custom/plugins/treesitter.lua @@ -2,7 +2,7 @@ return { -- Highlight, edit, and navigate code 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate', opts = { - ensure_installed = { 'bash', 'c', 'html', 'lua', 'markdown', 'vim', 'vimdoc' }, + ensure_installed = { 'bash', 'c', 'html', 'lua', 'markdown', 'vim', 'vimdoc', "python" }, -- Autoinstall languages that are not installed auto_install = true, highlight = {