feat: add dashboard
This commit is contained in:
parent
c60f7b882b
commit
9ca4ea77fc
10 changed files with 100 additions and 58 deletions
|
@ -12,7 +12,6 @@
|
|||
"dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" },
|
||||
"formatter.nvim": { "branch": "master", "commit": "eb89a1f3e079f1b9680bc7293b75fffccb5e1598" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "4c40357994f386e72be92a46f41fc1664c84c87d" },
|
||||
"incline.nvim": { "branch": "main", "commit": "0eb5b7f6fc6636a4e7b2eb2800b7650fd6d164a2" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
|
||||
"lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "f4f791f67e70d378a754d02da068231d2352e5bc" },
|
||||
|
@ -24,18 +23,18 @@
|
|||
"noice.nvim": { "branch": "main", "commit": "0427460c2d7f673ad60eb02b35f5e9926cf67c59" },
|
||||
"nui.nvim": { "branch": "main", "commit": "8d3bce9764e627b62b07424e0df77f680d47ffdb" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "c27370703e798666486e3064b64d59eaf4bdc6d5" },
|
||||
"nvim-lint": { "branch": "master", "commit": "6e9dd545a1af204c4022a8fcd99727ea41ffdcc8" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "fd26f8626c03b424f7140d454031d1dcb8d23513" },
|
||||
"nvim-notify": { "branch": "master", "commit": "22f29093eae7785773ee9d543f8750348b1a195c" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "38959800c2439c890e3238af559f0dc3be45e393" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "ab4cfee554e501f497bce0856788d43cf2eb93d7" },
|
||||
"persistence.nvim": { "branch": "main", "commit": "166a79a55bfa7a4db3e26fc031b4d92af71d0b51" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
|
||||
"render-markdown.nvim": { "branch": "main", "commit": "a03ed82dfdeb1a4980093609ffe94c171ace8059" },
|
||||
"snacks.nvim": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" },
|
||||
"telescope-file-browser.nvim": { "branch": "master", "commit": "626998e5c1b71c130d8bc6cf7abb6709b98287bb" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "814f102cd1da3dc78c7d2f20f2ef3ed3cdf0e6e4" },
|
||||
"tiny-inline-diagnostic.nvim": { "branch": "main", "commit": "de01d4c9cd032d4dac69bf64d5a184fbe62e1fd1" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" },
|
||||
"toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" },
|
||||
"tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" },
|
||||
"trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" },
|
||||
"typr": { "branch": "main", "commit": "5ee7b67dc610e8ec2c0c8a6912a8d1fba90160c2" },
|
||||
|
|
|
@ -2,7 +2,4 @@ return {
|
|||
"folke/tokyonight.nvim",
|
||||
lazy = true,
|
||||
opts = {},
|
||||
config = function()
|
||||
vim.cmd("colorscheme tokyonight-night")
|
||||
end,
|
||||
}
|
||||
|
|
|
@ -11,8 +11,6 @@ local function opts()
|
|||
}
|
||||
|
||||
return {
|
||||
logging = true,
|
||||
log_level = vim.log.levels.WARN,
|
||||
filetype = {
|
||||
lua = {
|
||||
require("formatter.filetypes.lua").stylua,
|
||||
|
@ -39,7 +37,8 @@ local function opts()
|
|||
require("formatter.filetypes.r").styler,
|
||||
},
|
||||
python = {
|
||||
require("formatter.filetypes.python").black,
|
||||
require("formatter.filetypes.python").ruff,
|
||||
require("formatter.filetypes.python").isort,
|
||||
},
|
||||
json = {
|
||||
prettier,
|
||||
|
|
67
lua/plugins/linting.lua
Normal file
67
lua/plugins/linting.lua
Normal file
|
@ -0,0 +1,67 @@
|
|||
return {
|
||||
"mfussenegger/nvim-lint",
|
||||
opts = {
|
||||
-- Event to trigger linters
|
||||
linters_by_ft = {
|
||||
fish = { "fish" },
|
||||
nix = { "nix" },
|
||||
python = { "ruff" },
|
||||
},
|
||||
events = { "BufWritePost", "BufReadPost", "InsertLeave" },
|
||||
},
|
||||
config = function(_, opts)
|
||||
local lint = require("lint")
|
||||
local M = {}
|
||||
lint.linters_by_ft = opts.linters_by_ft or {}
|
||||
|
||||
function M.debounce(ms, fn)
|
||||
local timer = vim.uv.new_timer()
|
||||
return function(...)
|
||||
local argv = { ... }
|
||||
timer:start(ms, 0, function()
|
||||
timer:stop()
|
||||
vim.schedule_wrap(fn)(unpack(argv))
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
function M.lint()
|
||||
-- Use nvim-lint's logic first:
|
||||
-- * checks if linters exist for the full filetype first
|
||||
-- * otherwise will split filetype by "." and add all those linters
|
||||
-- * this differs from conform.nvim which only uses the first filetype that has a formatter
|
||||
local names = lint._resolve_linter_by_ft(vim.bo.filetype)
|
||||
|
||||
-- Create a copy of the names table to avoid modifying the original.
|
||||
names = vim.list_extend({}, names)
|
||||
|
||||
-- Add fallback linters.
|
||||
if #names == 0 then
|
||||
vim.list_extend(names, lint.linters_by_ft["_"] or {})
|
||||
end
|
||||
|
||||
-- Add global linters.
|
||||
vim.list_extend(names, lint.linters_by_ft["*"] or {})
|
||||
|
||||
-- Filter out linters that don't exist or don't match the condition.
|
||||
local ctx = { filename = vim.api.nvim_buf_get_name(0) }
|
||||
ctx.dirname = vim.fn.fnamemodify(ctx.filename, ":h")
|
||||
names = vim.tbl_filter(function(name)
|
||||
local linter = lint.linters[name]
|
||||
if not linter then
|
||||
vim.notify("Linter not found: " .. name, vim.log.levels.WARN, { title = "nvim-lint" })
|
||||
end
|
||||
return linter and not (type(linter) == "table" and linter.condition and not linter.condition(ctx))
|
||||
end, names)
|
||||
|
||||
-- Run linters.
|
||||
if #names > 0 then
|
||||
lint.try_lint(names)
|
||||
end
|
||||
end
|
||||
vim.api.nvim_create_autocmd(opts.events or {}, {
|
||||
group = vim.api.nvim_create_augroup("nvim-lint", { clear = true }),
|
||||
callback = M.debounce(100, M.lint),
|
||||
})
|
||||
end,
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
return {
|
||||
"neovim/nvim-lspconfig", -- Configurations for Nvim LSP
|
||||
opts = {},
|
||||
lazy = false,
|
||||
config = function()
|
||||
local lspconfig = require("lspconfig")
|
||||
|
||||
|
@ -71,4 +72,7 @@ return {
|
|||
end,
|
||||
})
|
||||
end,
|
||||
keys = {
|
||||
{ "<leader>r", vim.lsp.buf.rename, desc = "Rename a token" },
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,40 +1,18 @@
|
|||
-- vim:fileencoding=utf-8:foldmethod=marker
|
||||
|
||||
return {
|
||||
--: Behaviour {{{
|
||||
{
|
||||
"MeanderingProgrammer/render-markdown.nvim",
|
||||
dependencies = { "nvim-treesitter/nvim-treesitter", "echasnovski/mini.icons" }, -- if you use standalone mini plugins
|
||||
---@module 'render-markdown'
|
||||
---@type render.md.UserConfig
|
||||
opts = {},
|
||||
ft = "md",
|
||||
},
|
||||
"preservim/nerdcommenter", -- (batch)commenting tool
|
||||
{
|
||||
"nvim-telescope/telescope-file-browser.nvim",
|
||||
dependencies = { "nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim" },
|
||||
opts = {
|
||||
extensions = {
|
||||
file_browser = {
|
||||
theme = "ivy",
|
||||
hijack_netrw = true,
|
||||
auto_depth = true,
|
||||
no_ignore = false,
|
||||
hidden = { file_browser = true, folder_browser = true },
|
||||
},
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("telescope").setup(opts)
|
||||
require("telescope").load_extension("file_browser")
|
||||
end,
|
||||
},
|
||||
"direnv/direnv.vim",
|
||||
--:}}}
|
||||
--: Visuals {{u{
|
||||
{
|
||||
"rachartier/tiny-inline-diagnostic.nvim",
|
||||
event = "LspAttach",
|
||||
lazy = false,
|
||||
opts = {
|
||||
options = {
|
||||
show_all_diags_on_cursorline = true,
|
||||
|
@ -69,10 +47,7 @@ return {
|
|||
"lewis6991/gitsigns.nvim",
|
||||
},
|
||||
opts = {
|
||||
-- lazy.nvim will automatically call setup for you. put your options here, anything missing will use the default:
|
||||
animation = true,
|
||||
-- insert_at_start = true,
|
||||
-- …etc.
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -88,9 +63,5 @@ return {
|
|||
vim.notify = require("notify")
|
||||
end,
|
||||
},
|
||||
{
|
||||
"stevearc/dressing.nvim",
|
||||
},
|
||||
|
||||
--:}}}
|
||||
"stevearc/dressing.nvim",
|
||||
}
|
||||
|
|
7
lua/plugins/persistence.lua
Normal file
7
lua/plugins/persistence.lua
Normal file
|
@ -0,0 +1,7 @@
|
|||
return {
|
||||
"folke/persistence.nvim",
|
||||
event = "BufReadPre", -- this will only start session saving when an actual file was opened
|
||||
opts = {
|
||||
-- add any custom options here
|
||||
},
|
||||
}
|
|
@ -1,13 +1,18 @@
|
|||
return {
|
||||
"folke/snacks.nvim",
|
||||
recommended = true,
|
||||
lazy = false,
|
||||
---@type snacks.Config
|
||||
opts = { explorer = {} },
|
||||
opts = {
|
||||
dim = {},
|
||||
dashboard = {},
|
||||
explorer = { replace_netrw = true },
|
||||
picker = { sources = { explorer = { hidden = true } } },
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
"<leader>e",
|
||||
function()
|
||||
require("snacks").explorer()
|
||||
require("snacks").explorer.open()
|
||||
end,
|
||||
desc = "Explorer Snacks (root dir)",
|
||||
},
|
||||
|
|
|
@ -19,5 +19,10 @@ return { -- fuzzy file finder
|
|||
require("telescope.builtin").find_files,
|
||||
desc = "Find File",
|
||||
},
|
||||
{ "<leader>fb", "<cmd>Telescope buffers<CR>", desc = "Find Open Buffers" },
|
||||
{ "<leader>fg", "<cmd>Telescope live_grep<CR>", desc = "Live Grep" },
|
||||
{ "<leader>fh", "<cmd>Telescope help_tags<CR>", desc = "Find Help" },
|
||||
{ "<leader>fi", "<cmd>Telescope builtin<cr>", desc = "Search all Telescope builtins" },
|
||||
{ "<leader>ft", "<cmd>TodoTelescope <cr>", desc = "Open Todo in Telescope" },
|
||||
},
|
||||
}
|
||||
|
|
|
@ -12,20 +12,8 @@ return {
|
|||
end,
|
||||
desc = "Buffer Local Keymaps (which-key)",
|
||||
},
|
||||
{ "<leader>bt", "<cmd>BlameToggle virtual<cr>", desc = "Toggle Virtual Blame" },
|
||||
{ "<leader>c", desc = "NerdCommenter" },
|
||||
{ "<leader>f", desc = "Telescope - Finder" },
|
||||
{ "<leader>fb", "<cmd>Telescope buffers<CR>", desc = "Find Open Buffers" },
|
||||
{ "<leader>fg", "<cmd>Telescope live_grep<CR>", desc = "Live Grep" },
|
||||
{ "<leader>fh", "<cmd>Telescope help_tags<CR>", desc = "Find Help" },
|
||||
{ "<leader>fi", "<cmd>Telescope builtin<cr>", desc = "Search all Telescope builtins" },
|
||||
{ "<leader>ft", "<cmd>TodoTelescope <cr>", desc = "Open Todo in Telescope" },
|
||||
{ "<leader>fu", "<cmd>UrlView<cr>", desc = "Display and open URLs in current buffer" },
|
||||
{ "<leader>n", desc = "Terminal" },
|
||||
{ "<leader>nb", "<cmd>lua _Lazygit_toggle()<CR>", desc = "Open Lazygit" },
|
||||
{ "<leader>nj", "<cmd>ToggleTerm<CR>", desc = "Open Terminal" },
|
||||
{ "<leader>r", "<cmd>lua vim.lsp.buf.rename()<CR>", desc = "Rename a token" },
|
||||
{ "<leader>t1", "<Cmd>BufferGoto 1<CR>", desc = "Go to Buffer 1" },
|
||||
{ "<leader>td", "<Cmd>BufferClose<CR>", desc = "Close Current Buffer" },
|
||||
{ "<leader>h", "<Cmd>BufferPrevious<CR>", desc = "Go the previous Buffer" },
|
||||
{ "<leader>l", "<Cmd>BufferNext<CR>", desc = "Go to the next Buffer" },
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue