Extend nvim config. Setup nonicons usage
This commit is contained in:
parent
277de4cd4f
commit
d5861f05e8
@ -16,6 +16,7 @@ LICENSE
|
||||
.config/nvim/lazyvim.json
|
||||
.config/nvim/stylua.toml
|
||||
.config/nvim/lua/config
|
||||
.config/nvim/lua/plugins/telescope.lua
|
||||
.config/nvim/lua/plugins/core.lua
|
||||
.config/nvim/lua/plugins/test.lua
|
||||
.config/nvim/lua/plugins/disabled.lua
|
||||
|
@ -28,8 +28,6 @@ o.encoding = "utf-8"
|
||||
o.backspace = "indent,eol,start" -- backspace works on every char in insert mode
|
||||
o.completeopt = { 'menu', 'menuone', 'noselect' }
|
||||
o.history = 1000
|
||||
-- o.dictionary = '/home/jan/.vim/dict/words'
|
||||
-- o.dictionary = '/usr/share/dict/words'
|
||||
o.startofline = true
|
||||
o.title = true
|
||||
o.clipboard = 'unnamedplus'
|
||||
@ -62,11 +60,11 @@ o.eol = false -- show if there's no eol char
|
||||
o.showbreak = '↪' -- character to show when line is broken
|
||||
|
||||
-- Folding
|
||||
o.foldenable = true
|
||||
o.foldnestmax = 2
|
||||
o.foldminlines = 10
|
||||
o.foldmethod = "expr"
|
||||
o.foldexpr = "nvim_treesitter#foldexpr()"
|
||||
-- o.foldenable = true
|
||||
-- o.foldnestmax = 2
|
||||
-- o.foldminlines = 10
|
||||
-- o.foldmethod = "expr"
|
||||
-- o.foldexpr = "nvim_treesitter#foldexpr()"
|
||||
|
||||
-- workaround for Telescope bug
|
||||
vim.api.nvim_create_autocmd({ "BufEnter" }, {
|
||||
@ -159,8 +157,8 @@ local map = vim.keymap.set
|
||||
|
||||
map({ 'n', 'v' }, '<Space>', "<Nop>", { silent = true })
|
||||
|
||||
-- clear the search buffer when hitting return
|
||||
map('n', '<CR>', '{->v:hlsearch ? ":nohl\\<CR>" : "\\<CR>"}()', { expr = true })
|
||||
-- Clear search with <esc>
|
||||
map({ "i", "n" }, "<esc>", "<cmd>noh<cr><esc>", { desc = "Escape and clear hlsearch" })
|
||||
|
||||
-- sane regexes
|
||||
map({ 'n', 'v' }, '/', '/\\v', { noremap = true, silent = true })
|
||||
@ -168,9 +166,13 @@ map({ 'n', 'v' }, '/', '/\\v', { noremap = true, silent = true })
|
||||
-- don't jump when using *
|
||||
map('n', '*', '*<c-o>')
|
||||
|
||||
-- keep search matches in the middle of the window
|
||||
map('n', 'n', 'nzzzv')
|
||||
map('n', 'N', 'Nzzzv')
|
||||
-- https://github.com/mhinz/vim-galore#saner-behavior-of-n-and-n
|
||||
map("n", "n", "'Nn'[v:searchforward].'zv'", { expr = true, desc = "Next search result" })
|
||||
map("x", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next search result" })
|
||||
map("o", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next search result" })
|
||||
map("n", "N", "'nN'[v:searchforward].'zv'", { expr = true, desc = "Prev search result" })
|
||||
map("x", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev search result" })
|
||||
map("o", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev search result" })
|
||||
|
||||
-- Same when jumping around
|
||||
map('n', 'g;', 'g;zz')
|
||||
@ -179,6 +181,22 @@ map('n', 'g;', 'g;zz')
|
||||
map('n', 'Q', '@q')
|
||||
map('v', 'Q', '<cmd>norm @q<CR>')
|
||||
|
||||
-- save file
|
||||
map({ "i", "x", "n", "s" }, "<C-s>", "<cmd>w<cr><esc>", { desc = "Save file" })
|
||||
|
||||
-- better indenting
|
||||
map("v", "<", "<gv")
|
||||
map("v", ">", ">gv")
|
||||
|
||||
-- lazy
|
||||
map("n", "<leader>l", "<cmd>Lazy<cr>", { desc = "Lazy" })
|
||||
|
||||
map("n", "<leader>xl", "<cmd>lopen<cr>", { desc = "Location List" })
|
||||
map("n", "<leader>xq", "<cmd>copen<cr>", { desc = "Quickfix List" })
|
||||
|
||||
map("n", "[q", vim.cmd.cprev, { desc = "Previous quickfix" })
|
||||
map("n", "]q", vim.cmd.cnext, { desc = "Next quickfix" })
|
||||
|
||||
-- Shortcut to close quickfix windows
|
||||
map('n', '<leader>a', '<cmd>windo lcl|ccl<CR>')
|
||||
|
||||
@ -200,7 +218,11 @@ map('n', '<down>', '<cmd>resize +2<CR>')
|
||||
map('n', '<left>', '<cmd>vertical resize -2<CR>')
|
||||
map('n', '<right>', '<cmd>vertical resize +2<CR>')
|
||||
|
||||
map('n', '<leader>g', '<cmd>vertical rightbelow Git<cr>', { noremap = true, silent = true })
|
||||
-- windows
|
||||
map("n", "<leader>ww", "<C-W>p", { desc = "Other window", remap = true })
|
||||
map("n", "<leader>wd", "<C-W>c", { desc = "Delete window", remap = true })
|
||||
map("n", "<leader>-", "<C-W>s", { desc = "Split window below", remap = true })
|
||||
map("n", "<leader>|", "<C-W>v", { desc = "Split window right", remap = true })
|
||||
{{ else }}
|
||||
-- bootstrap lazy.nvim, LazyVim and your plugins
|
||||
require("config.lazy")
|
||||
|
@ -45,8 +45,35 @@ return {
|
||||
},
|
||||
opts = function()
|
||||
vim.api.nvim_set_hl(0, "CmpGhostText", { link = "Comment", default = true })
|
||||
local kind_icons = {
|
||||
Text = "",
|
||||
Method = "",
|
||||
Function = "",
|
||||
Constructor = "",
|
||||
Field = "",
|
||||
Variable = "",
|
||||
Class = "",
|
||||
Interface = "",
|
||||
Module = "",
|
||||
Property = "",
|
||||
Unit = "",
|
||||
Value = "",
|
||||
Enum = "",
|
||||
Keyword = "",
|
||||
Snippet = "",
|
||||
Color = "",
|
||||
File = "",
|
||||
Reference = "",
|
||||
Folder = "",
|
||||
EnumMember = "",
|
||||
Constant = "",
|
||||
Struct = "",
|
||||
Event = "",
|
||||
Operator = "",
|
||||
TypeParameter = "",
|
||||
}
|
||||
|
||||
local luasnip = require('luasnip')
|
||||
local lspkind = require('lspkind')
|
||||
local cmp = require("cmp")
|
||||
local defaults = require("cmp.config.default")()
|
||||
return {
|
||||
@ -55,7 +82,7 @@ return {
|
||||
},
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require("luasnip").lsp_expand(args.body)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
@ -83,10 +110,19 @@ return {
|
||||
{ name = "buffer", keyword_length = 3 },
|
||||
}),
|
||||
formatting = {
|
||||
format = lspkind.cmp_format({
|
||||
mode = 'symbol_text', -- show only symbol annotations
|
||||
maxwidth = 50, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters)
|
||||
})
|
||||
format = function(entry, vim_item)
|
||||
-- Kind icons
|
||||
vim_item.kind = string.format('%s %s', kind_icons[vim_item.kind], vim_item.kind) -- This concatenates the icons with the name of the item kind
|
||||
-- Source
|
||||
vim_item.menu = ({
|
||||
buffer = "[Buffer]",
|
||||
nvim_lsp = "[LSP]",
|
||||
luasnip = "[LuaSnip]",
|
||||
nvim_lua = "[Lua]",
|
||||
latex_symbols = "[LaTeX]",
|
||||
})[entry.source.name]
|
||||
return vim_item
|
||||
end
|
||||
},
|
||||
experimental = {
|
||||
ghost_text = {
|
||||
@ -103,6 +139,17 @@ return {
|
||||
require("cmp").setup(opts)
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"kylechui/nvim-surround",
|
||||
version = "*", -- Use for stability; omit to use `main` branch for the latest features
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("nvim-surround").setup({
|
||||
-- Configuration here, or leave empty to use defaults
|
||||
})
|
||||
end
|
||||
},
|
||||
{{ else }}
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
|
@ -1,5 +1,4 @@
|
||||
return {
|
||||
|
||||
-- Fuzzy finder.
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
@ -7,15 +6,19 @@ return {
|
||||
version = false, -- telescope did only one release, so use HEAD for now
|
||||
dependencies = {
|
||||
"nvim-telescope/telescope-fzf-native.nvim",
|
||||
"nvim-telescope/telescope-file-browser.nvim",
|
||||
build = "gmake",
|
||||
config = function()
|
||||
require("telescope").load_extension("fzf")
|
||||
end,
|
||||
},
|
||||
keys = {
|
||||
{ "<C-n>", "<cmd>Telescope file_browser<cr>", desc = "File browser" },
|
||||
{ "<leader>e", "<cmd>Telescope find_files<cr>", desc = "Find file" },
|
||||
{ "<leader>b", "<cmd>Telescope buffers show_all_buffers=true<cr>", desc = "Switch Buffer" },
|
||||
{ "<leader>f", "<cmd>Telescope live_grep<cr>", desc = "Switch Buffer" },
|
||||
{ "<leader>h", "<cmd>Telescope help_tags<cr>", desc = "Search help tags" },
|
||||
{ "<leader><space>", "<cmd>Telescope find_files<cr>", desc = "Find Files" },
|
||||
{ "<leader>,", "<cmd>Telescope buffers show_all_buffers=true<cr>", desc = "Switch Buffer" },
|
||||
{ "<leader>/", "<cmd>Telescope live_grep<cr>", desc = "Switch Buffer" },
|
||||
{ "<leader>sh", "<cmd>Telescope help_tags<cr>", desc = "Search help tags" },
|
||||
{ "<leader>sk", "<cmd>Telescope keymaps<cr>", desc = "Key Maps" },
|
||||
{ "z=", "<cmd>Telescope spell_suggest<cr>", desc = "Spell options" },
|
||||
{ "<leader>ss", "<cmd>Telescope lsp_document_symbols<cr>", desc = "Goto Symbol" },
|
||||
},
|
||||
opts = function()
|
||||
local actions = require("telescope.actions")
|
||||
@ -58,16 +61,18 @@ return {
|
||||
}
|
||||
end,
|
||||
},
|
||||
|
||||
-- add telescope-fzf-native
|
||||
{
|
||||
"telescope.nvim",
|
||||
dependencies = {
|
||||
"nvim-telescope/telescope-fzf-native.nvim",
|
||||
build = "gmake",
|
||||
config = function()
|
||||
require("telescope").load_extension("fzf")
|
||||
end,
|
||||
'numToStr/Comment.nvim',
|
||||
opts = {
|
||||
-- add any options here
|
||||
},
|
||||
lazy = false,
|
||||
},
|
||||
{
|
||||
"windwp/nvim-autopairs",
|
||||
event = "InsertEnter",
|
||||
opts = {
|
||||
fast_wrap = {},
|
||||
},
|
||||
},
|
||||
|
||||
@ -181,35 +186,6 @@ return {
|
||||
},
|
||||
},
|
||||
|
||||
-- buffer remove
|
||||
{
|
||||
"echasnovski/mini.bufremove",
|
||||
|
||||
keys = {
|
||||
{
|
||||
"<leader>bd",
|
||||
function()
|
||||
local bd = require("mini.bufremove").delete
|
||||
if vim.bo.modified then
|
||||
local choice = vim.fn.confirm(("Save changes to %q?"):format(vim.fn.bufname()),
|
||||
"&Yes\n&No\n&Cancel")
|
||||
if choice == 1 then -- Yes
|
||||
vim.cmd.write()
|
||||
bd(0)
|
||||
elseif choice == 2 then -- No
|
||||
bd(0, true)
|
||||
end
|
||||
else
|
||||
bd(0)
|
||||
end
|
||||
end,
|
||||
desc = "Delete Buffer",
|
||||
},
|
||||
-- stylua: ignore
|
||||
{ "<leader>bD", function() require("mini.bufremove").delete(0, true) end, desc = "Delete Buffer (Force)" },
|
||||
},
|
||||
},
|
||||
|
||||
-- better diagnostics list and others
|
||||
{
|
||||
"folke/trouble.nvim",
|
||||
@ -267,4 +243,16 @@ return {
|
||||
{ "<leader>sT", "<cmd>TodoTelescope keywords=TODO,FIX,FIXME<cr>", desc = "Todo/Fix/Fixme" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"folke/flash.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {},
|
||||
keys = {
|
||||
{ "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" },
|
||||
{ "S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" },
|
||||
{ "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" },
|
||||
{ "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" },
|
||||
{ "<c-s>", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" },
|
||||
},
|
||||
}
|
||||
}
|
||||
|
@ -2,10 +2,6 @@ return {
|
||||
-- lspconfig
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
"onsails/lspkind.nvim",
|
||||
"lukas-reineke/lsp-format.nvim",
|
||||
},
|
||||
opts = {
|
||||
-- options for vim.diagnostic.config()
|
||||
diagnostics = {
|
||||
@ -92,18 +88,11 @@ vim.diagnostic.config({
|
||||
end
|
||||
})
|
||||
|
||||
require("lsp-format").setup {
|
||||
html = {
|
||||
exclude = { "html" }
|
||||
}
|
||||
}
|
||||
|
||||
local on_attach = function(client)
|
||||
local bufmap = function(mode, lhs, rhs)
|
||||
local opts = { buffer = true }
|
||||
vim.keymap.set(mode, lhs, rhs, opts)
|
||||
end
|
||||
require("lsp-format").on_attach(client)
|
||||
|
||||
bufmap('n', 'K', '<cmd>lua vim.lsp.buf.hover()<cr>')
|
||||
bufmap('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<cr>')
|
||||
@ -113,10 +102,8 @@ local on_attach = function(client)
|
||||
bufmap('n', 'gA', '<cmd>Telescope diagnostics<cr>')
|
||||
bufmap('n', 'gr', '<cmd>Telescope lsp_references<cr>')
|
||||
bufmap('n', 'gi', '<cmd>Telescope lsp_implementations<cr>')
|
||||
bufmap('n', '<F2>', '<cmd>lua vim.lsp.buf.rename()<cr>')
|
||||
bufmap('n', '<F3>', '<cmd>lua vim.lsp.buf.format({async = true})<cr>')
|
||||
bufmap('n', '<F4>', '<cmd>lua vim.lsp.buf.code_action()<cr>')
|
||||
bufmap('x', '<F4>', '<cmd>lua vim.lsp.buf.range_code_action()<cr>')
|
||||
bufmap('n', '<leader>cr', '<cmd>lua vim.lsp.buf.rename()<cr>')
|
||||
bufmap('n', '<leader>ca', '<cmd>lua vim.lsp.buf.code_action()<cr>')
|
||||
bufmap('n', 'gl', '<cmd>lua vim.diagnostic.open_float()<cr>')
|
||||
bufmap('n', '[d', '<cmd>lua vim.diagnostic.goto_prev()<cr>')
|
||||
bufmap('n', ']d', '<cmd>lua vim.diagnostic.goto_next()<cr>')
|
||||
@ -125,17 +112,63 @@ end
|
||||
lsp.gopls.setup {
|
||||
settings = {
|
||||
gopls = {
|
||||
analyses = {
|
||||
unusedparams = true,
|
||||
unusedvariable = true,
|
||||
shadow = true
|
||||
gofumpt = true,
|
||||
codelenses = {
|
||||
gc_details = false,
|
||||
generate = true,
|
||||
regenerate_cgo = true,
|
||||
run_govulncheck = true,
|
||||
test = true,
|
||||
tidy = true,
|
||||
upgrade_dependency = true,
|
||||
vendor = true,
|
||||
},
|
||||
hints = {
|
||||
assignVariableTypes = true,
|
||||
compositeLiteralFields = true,
|
||||
compositeLiteralTypes = true,
|
||||
constantValues = true,
|
||||
functionTypeParameters = true,
|
||||
parameterNames = true,
|
||||
rangeVariableTypes = true,
|
||||
},
|
||||
analyses = {
|
||||
fieldalignment = true,
|
||||
shadow = true,
|
||||
unusedvariable = true,
|
||||
unusedwrite = true,
|
||||
useany = true,
|
||||
},
|
||||
usePlaceholders = true,
|
||||
completeUnimported = true,
|
||||
staticcheck = true,
|
||||
directoryFilters = { "-.git", "-.vscode", "-.idea", "-.vscode-test", "-node_modules" },
|
||||
semanticTokens = true
|
||||
},
|
||||
},
|
||||
on_attach = on_attach
|
||||
}
|
||||
lsp.clangd.setup {
|
||||
settings = {
|
||||
clangd = {
|
||||
cmd = {
|
||||
"clangd",
|
||||
"--background-index",
|
||||
"--clang-tidy",
|
||||
"--header-insertion=iwyu",
|
||||
"--completion-style=detailed",
|
||||
"--function-arg-placeholders",
|
||||
"--fallback-style=llvm",
|
||||
},
|
||||
init_options = {
|
||||
usePlaceholders = true,
|
||||
completeUnimported = true,
|
||||
clangdFileStatus = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
on_attach = on_attach
|
||||
}
|
||||
lsp.clangd.setup { on_attach = on_attach }
|
||||
lsp.ltex.setup {
|
||||
on_attach = on_attach,
|
||||
filetypes = { "latex", "tex", "bib", "mkd", "gitcommit", "text" },
|
||||
@ -145,6 +178,15 @@ lsp.tsserver.setup { on_attach = on_attach }
|
||||
lsp.lua_ls.setup {
|
||||
settings = {
|
||||
Lua = {
|
||||
workspace = {
|
||||
checkThirdParty = false,
|
||||
},
|
||||
codeLens = {
|
||||
enable = true,
|
||||
},
|
||||
completion = {
|
||||
callSnippet = "Replace",
|
||||
},
|
||||
diagnostics = {
|
||||
globals = { 'vim' }
|
||||
},
|
||||
|
@ -50,10 +50,30 @@ return {
|
||||
vim.o.laststatus = 0
|
||||
end,
|
||||
opts = {
|
||||
icons_enabled = true,
|
||||
options = {
|
||||
theme = 'auto',
|
||||
component_separators = '|',
|
||||
section_separators = '',
|
||||
icons_enabled = true,
|
||||
globalstatus = true,
|
||||
component_separators = "|",
|
||||
disabled_filetypes = { statusline = { "dashboard", "alpha", "starter" } },
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { "mode" },
|
||||
lualine_b = { { "branch", icon = " " }, "diagnostics" },
|
||||
lualine_c = { "filename" },
|
||||
lualine_x = { "encoding",
|
||||
{
|
||||
"fileformat",
|
||||
symbols = {
|
||||
unix = " ",
|
||||
dos = " ",
|
||||
mac = " "
|
||||
}
|
||||
},
|
||||
{ "filetype", icon_only = true } },
|
||||
lualine_y = { "progress" },
|
||||
lualine_z = { "location" },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@ -185,23 +205,175 @@ return {
|
||||
},
|
||||
},
|
||||
|
||||
-- -- lsp symbol navigation for lualine. This shows where
|
||||
-- in the code structure you are - within functions, classes,
|
||||
-- etc - in the statusline.
|
||||
-- icons
|
||||
{
|
||||
"SmiteshP/nvim-navic",
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
lazy = true,
|
||||
opts = function()
|
||||
return {
|
||||
separator = " ",
|
||||
highlight = true,
|
||||
depth_limit = 5,
|
||||
lazy_update_context = true,
|
||||
local devicons = require("nvim-web-devicons")
|
||||
local palette = {
|
||||
orange = "#d18616",
|
||||
black = "#586069",
|
||||
bright_black = "#959da5",
|
||||
white = "#d1d5da",
|
||||
bright_white = "#fafbfc",
|
||||
red = "#ea4a5a",
|
||||
bright_red = "#f97583",
|
||||
green = "#34d058",
|
||||
bright_green = "#85e89d",
|
||||
yellow = "#ffea7f",
|
||||
bright_yellow = "#ffea7f",
|
||||
blue = "#2188ff",
|
||||
bright_blue = "#79b8ff",
|
||||
magenta = "#b392f0",
|
||||
bright_magenta = "#b392f0",
|
||||
cyan = "#39c5cf",
|
||||
bright_cyan = "#56d4dd",
|
||||
}
|
||||
devicons.set_icon({
|
||||
[".zshrc"] = {
|
||||
icon = " ",
|
||||
color = palette.bright_black,
|
||||
name = "Zshrc",
|
||||
},
|
||||
["bash"] = {
|
||||
icon = " ",
|
||||
color = palette.bright_black,
|
||||
name = "Bash",
|
||||
},
|
||||
["c"] = {
|
||||
icon = " ",
|
||||
color = palette.bright_blue,
|
||||
name = "C",
|
||||
},
|
||||
["c++"] = {
|
||||
icon = " ",
|
||||
color = palette.bright_red,
|
||||
name = "CPlusPlus",
|
||||
},
|
||||
["cc"] = {
|
||||
icon = " ",
|
||||
color = palette.bright_red,
|
||||
name = "CPlusPlus",
|
||||
},
|
||||
["go"] = {
|
||||
icon = " ",
|
||||
color = palette.bright_blue,
|
||||
name = "Go",
|
||||
},
|
||||
["js"] = {
|
||||
icon = " ",
|
||||
color = palette.yellow,
|
||||
name = "Js",
|
||||
},
|
||||
["lua"] = {
|
||||
icon = " ",
|
||||
color = palette.bright_blue,
|
||||
name = "Lua",
|
||||
},
|
||||
["markdown"] = {
|
||||
icon = " ",
|
||||
color = palette.bright_blue,
|
||||
name = "Markdown",
|
||||
},
|
||||
["md"] = {
|
||||
icon = " ",
|
||||
color = palette.bright_blue,
|
||||
name = "Md",
|
||||
},
|
||||
["mdx"] = {
|
||||
icon = " ",
|
||||
color = palette.bright_blue,
|
||||
name = "Mdx",
|
||||
},
|
||||
["php"] = {
|
||||
icon = " ",
|
||||
color = palette.magenta,
|
||||
name = "Php",
|
||||
},
|
||||
["pl"] = {
|
||||
icon = " ",
|
||||
color = palette.bright_blue,
|
||||
name = "Pl",
|
||||
},
|
||||
["py"] = {
|
||||
icon = " ",
|
||||
color = palette.bright_blue,
|
||||
name = "Py",
|
||||
},
|
||||
["pyc"] = {
|
||||
icon = " ",
|
||||
color = palette.bright_blue,
|
||||
name = "Pyc",
|
||||
},
|
||||
["pyd"] = {
|
||||
icon = " ",
|
||||
color = palette.bright_blue,
|
||||
name = "Pyd",
|
||||
},
|
||||
["pyo"] = {
|
||||
icon = " ",
|
||||
color = palette.bright_blue,
|
||||
name = "Pyo",
|
||||
},
|
||||
["rake"] = {
|
||||
icon = " ",
|
||||
color = palette.bright_red,
|
||||
name = "Rake",
|
||||
},
|
||||
["rakefile"] = {
|
||||
icon = " ",
|
||||
color = palette.bright_red,
|
||||
name = "Rakefile",
|
||||
},
|
||||
["rb"] = {
|
||||
icon = " ",
|
||||
color = palette.bright_red,
|
||||
name = "Rb",
|
||||
},
|
||||
["sh"] = {
|
||||
icon = " ",
|
||||
color = palette.bright_black,
|
||||
name = "Sh",
|
||||
},
|
||||
["sql"] = {
|
||||
icon = " ",
|
||||
color = palette.bright_black,
|
||||
name = "Sql",
|
||||
},
|
||||
["svelte"] = {
|
||||
icon = " ",
|
||||
color = palette.orange,
|
||||
name = "Svelte"
|
||||
},
|
||||
["yaml"] = {
|
||||
icon = " ",
|
||||
color = palette.bright_black,
|
||||
name = "Yaml",
|
||||
},
|
||||
["yml"] = {
|
||||
icon = " ",
|
||||
color = palette.bright_black,
|
||||
name = "Yml",
|
||||
},
|
||||
["zsh"] = {
|
||||
icon = " ",
|
||||
color = palette.bright_black,
|
||||
name = "Zsh",
|
||||
},
|
||||
["terminal"] = {
|
||||
icon = " ",
|
||||
color = palette.bright_black,
|
||||
name = "Terminal",
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
-- icons
|
||||
{ "nvim-tree/nvim-web-devicons", lazy = true },
|
||||
{
|
||||
"yamatsum/nvim-nonicons",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
lazy = true
|
||||
},
|
||||
|
||||
-- ui components
|
||||
{ "MunifTanjim/nui.nvim", lazy = true },
|
||||
@ -247,7 +419,7 @@ return {
|
||||
{
|
||||
"nvimdev/dashboard-nvim",
|
||||
event = "VimEnter",
|
||||
opts = function(_, opts)
|
||||
opts = function()
|
||||
local logo = [[
|
||||
_ _ _ _
|
||||
| | (_) | | | |
|
||||
@ -258,9 +430,15 @@ return {
|
||||
]]
|
||||
|
||||
logo = string.rep("\n", 8) .. logo .. "\n\n"
|
||||
opts.config.header = vim.split(logo, "\n")
|
||||
opts.theme = "doom"
|
||||
opts.config.center = {
|
||||
|
||||
local opts = {
|
||||
theme = "doom",
|
||||
hide = {
|
||||
statusline = false,
|
||||
},
|
||||
config = {
|
||||
header = vim.split(logo, "\n"),
|
||||
center = {
|
||||
{
|
||||
action = "Telescope find_files",
|
||||
desc = " Find file",
|
||||
@ -298,7 +476,32 @@ return {
|
||||
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,
|
||||
},
|
||||
}
|
||||
|
@ -70,5 +70,5 @@ source $HOME/perl5/perlbrew/etc/bashrc
|
||||
export PATH=/opt/homebrew/bin:$PATH
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
eval "$(atuin init zsh)"
|
||||
{{- end }}
|
||||
|
Loading…
Reference in New Issue
Block a user