1
Fork 0

Tweaked vim config a bunch

This commit is contained in:
Matei Adriel 2023-08-30 13:08:50 +03:00
parent c4e8869820
commit f76340f145
No known key found for this signature in database
7 changed files with 107 additions and 113 deletions

View file

@ -1,44 +1,66 @@
local env = require("my.helpers.env")
local M = {
"glepnir/dashboard-nvim",
event = "VimEnter",
opts = {
theme = "hyper",
config = {
week_header = { enable = true },
project = { enable = false },
-- TODO: actually customize these
shortcut = {
{
desc = " Update",
group = "@property",
action = "Lazy update",
key = "u",
},
{
desc = " Files",
group = "Label",
action = "Telescope find_files",
key = "f",
},
{
desc = " Apps",
group = "DiagnosticHint",
action = "Telescope app",
key = "a",
},
{
desc = " dotfiles",
group = "Number",
action = "Telescope dotfiles",
key = "d",
},
},
},
},
"goolord/alpha-nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
local theme = require("alpha.themes.dashboard")
theme.opts.width = 70
theme.opts.position = "center"
theme.section.buttons.val = {}
-- See [the header generator](https://patorjk.com/software/taag/#p=display&v=0&f=ANSI%20Shadow&t=NEOVim%20%3A3)
theme.section.header.opts.hl = "AlphaHeader"
theme.section.header.val = [[
]]
local footer = function()
local version = "🚀 "
.. vim.version().major
.. "."
.. vim.version().minor
.. "."
.. vim.version().patch
local lazy_ok, lazy = pcall(require, "lazy")
if lazy_ok then
local total_plugins = lazy.stats().count .. " Plugins"
local startuptime = (
math.floor(lazy.stats().startuptime * 100 + 0.5) / 100
)
return version
.. " — 🧰 "
.. total_plugins
.. " — 🕐 "
.. startuptime
.. "ms"
else
return version
end
end
vim.api.nvim_create_autocmd("User", {
pattern = "LazyVimStarted",
callback = function()
theme.section.footer.val = footer()
vim.cmd("AlphaRedraw")
end,
desc = "Footer for Alpha",
})
theme.section.footer.opts.hl = "AlphaFooter"
theme.section.header.opts.hl = "AlphaHeader"
theme.section.buttons.opts.hl = "AlphaButton"
require("alpha").setup(theme.config)
end,
lazy = false,
cond = env.vscode.not_active() and env.firenvim.not_active(),
dependencies = { { "nvim-tree/nvim-web-devicons" } },
}
return M

View file

@ -96,11 +96,10 @@ return {
},
-- Helper libs
{
"nvim-lua/plenary.nvim",
},
"nvim-lua/plenary.nvim",
"MunifTanjim/nui.nvim",
"nvim-tree/nvim-web-devicons", -- nice looking icons
"mateiadrielrafael/scrap.nvim", -- vim-abolish rewrite
{
"terrortylor/nvim-comment",
@ -110,9 +109,6 @@ return {
end,
},
-- nice looking icons
"nvim-tree/nvim-web-devicons",
{
-- easly switch between tmux and vim panes
"christoomey/vim-tmux-navigator",
@ -129,14 +125,6 @@ return {
cond = env.vscode.not_active() and env.firenvim.not_active(),
},
{
-- smooth scrolling
"psliwka/vim-smoothie",
-- enabled = env.neovide.not_active(),
enabled = false,
event = "VeryLazy",
},
{
-- show progress for lsp stuff
"j-hui/fidget.nvim",
@ -162,25 +150,6 @@ return {
enabled = false,
},
{
-- reminds you of abbreviations
"0styx0/abbreinder.nvim",
dependencies = "0styx0/abbremand.nvim",
event = "InsertEnter",
},
{
-- md preview (in terminal)
"ellisonleao/glow.nvim",
cmd = "Glow",
cond = env.vscode.not_active(),
},
{
"frabjous/knap", -- md preview
cond = env.vscode.not_active(),
},
{
-- automatically set options based on current file
"tpope/vim-sleuth",
@ -188,15 +157,11 @@ return {
cond = env.vscode.not_active(),
},
-- vim-abolish rewrite
"mateiadrielrafael/scrap.nvim",
{
"ruifm/gitlinker.nvim", -- generate permalinks for code
-- generate permalinks for code
"ruifm/gitlinker.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
opts = {
mappings = "<leader>yg",
},
opts = { mappings = "<leader>yg" },
init = function()
local status, wk = pcall(require, "which-key")
@ -225,15 +190,16 @@ return {
-- Live command preview for stuff like :norm
{
"smjonas/live-command.nvim",
opts = {
commands = {
Norm = { cmd = "norm" },
},
},
config = function()
require("live-command").setup({
commands = {
Norm = { cmd = "norm" },
},
})
end,
event = "VeryLazy",
cond = false,
},
{
"mbbill/undotree",
cmd = "UndotreeToggle",

View file

@ -1,9 +1,11 @@
local K = require("my.keymaps")
local env = require("my.helpers.env")
local M = {
"echasnovski/mini.files",
version = "main",
keys = { "<C-S-F>" },
event = "VeryLazy",
cond = env.vscode.not_active() and env.firenvim.not_active(),
}
function M.config()
@ -11,11 +13,9 @@ function M.config()
files.setup({
windows = {
preview = true,
},
mappings = {
reveal_cwd = "R",
preview = false,
},
mappings = {},
})
K.nmap("<C-S-F>", function()

View file

@ -0,0 +1,8 @@
local M = {
"echasnovski/mini.operators",
version = false,
event = "VeryLazy",
opts = {},
}
return M