1
0
Fork 0
mirror of https://github.com/pnx/dotfiles synced 2026-06-17 03:30:01 +02:00

big nvim update. maybe broke something

This commit is contained in:
Henrik Hautakoski 2024-03-10 10:36:20 +01:00
parent 1e68462bc1
commit 8a39a1b88a
32 changed files with 531 additions and 195 deletions

View file

@ -0,0 +1,29 @@
local icons = require('config.icons')
return {
'romgrk/barbar.nvim',
dependencies = {
'lewis6991/gitsigns.nvim',
'nvim-tree/nvim-web-devicons',
},
init = function() vim.g.barbar_auto_setup = false end,
opts = {
animation = false,
auto_hide = 0,
focus_on_close = 'previous',
button = icons.close,
highlight_inactive_file_icons = true,
icons = {
separator = {left = '', right = ''},
separator_at_end = false,
inactive = { button = '' },
modified = {button = icons.filetree.git.modified },
pinned = {button = '', filename = true},
},
maximum_padding = 2,
minimum_padding = 1,
sidebar_filetypes = {
['neo-tree'] = {event = 'BufWipeout'},
}
},
}

View file

@ -0,0 +1,96 @@
return {
"navarasu/onedark.nvim",
lazy = false,
priority = 1000,
opts = {
style = 'darker',
code_style = {
comments = 'none',
keywords = 'none',
functions = 'none',
strings = 'none',
variables = 'none'
},
colors = {
fg = '#ffffff',
bg0 = '#282a33',
bg1 = '#30323b',
bg2 = '#24262f',
bg3 = '#383a43',
bg_d = "#1f2129",
bg_blue = "#ff00ff",
bg_yellow = "#f0d197",
red = '#cc817f',
green = '#7ccfaf',
yellow = '#ffcc99',
orange = '#ffcc99',
blue = '#8ac6f2',
cyan = '#8abeb7',
purple = '#9999cc',
dark_cyan = "#8abeb7",
dark_red = "#cc817f",
dark_yellow = "#ffcc99",
dark_purple = "#9999cc",
},
highlights = {
-- ColorColumn = { bg = "$bg2"},
-- SignColumn = { bg = "$bg2"},
-- LineNr = { fg = "$light_grey", bg = "$bg2" }
LineNr = { fg = "$light_grey" },
CursorLineNr = { fg = "$blue" },
Pmenu = { bg = "$bg2"},
PmenuSel = { bg = "$bg_d", fg = "$fg" },
FloatBorder = { fg = "$grey", bg = 'None' },
-- Syntax
["@comment"] = { fg = "$red" },
["@string"] = { fg = "$purple" },
["@function"] = { fg = "$fg" },
["@keyword"] = { fg = "$yellow" },
["@keyword.import"] = { fg = "$yellow" },
["@keyword.function"] = { fg = "$yellow" },
["@keyword.conditional"] = { fg = "$yellow" },
["@keyword.operator"] = { fg = "$yellow" },
["@keyword.repeat"] = { fg = "$yellow" },
["@constant"] = { fg = "$green" },
["@tag"] = { fg = "$yellow" },
["@tag.delimiter"] = { fg = "$yellow" },
["@tag.attribute"] = { fg = "$cyan" },
["@type"] = { fg = "$blue" },
["@type.qualifier"] = { fg = "$yellow" },
["@type.definition"] = { fg = "$blue" },
["@type.builtin"] = { fg = "$blue" },
["@function.method"] = { fg = "$fg" },
["@function.call"] = { fg = "$fg" },
["@function.builtin"] = { fg = "$fg" },
["@number"] = { fg = "$red" },
["@variable"] = { fg = "$green" },
["@variable.member"] = { fg = "$green" },
["@variable.builtin"] = { fg = "$green" },
["@variable.parameter"] = { fg = "$fg" },
["@property"] = { fg = "$orange" },
-- ["@property"] = { fg = "$fg" },
["@punctuation.delimiter"] = { fg = "$fg" },
["@punctuation.bracket"] = { fg = "$fg" },
["@module"] = { fg = "$fg" },
-- php overrides
["@class_name.php"] = { fg = "$fg" },
["@extend_name.php"] = { fg = "$fg" },
["@implements_name.php"] = { fg = "$fg" },
["@namespace_name.php"] = { fg = "$fg" },
["@namespace_alias.php"] = { fg = "$fg" },
}
},
config = function(_, opts)
local c = require('onedark')
c.setup(opts)
c.load()
vim.cmd(string.format("highlight GitSignsAdd guifg='%s'", opts.colors.green))
vim.cmd(string.format("highlight GitSignsChange guifg='%s'", opts.colors.yellow))
vim.cmd(string.format("highlight GitSignsDelete guifg='%s'", opts.colors.red))
end
}

View file

@ -0,0 +1,42 @@
local logo = [[
::::::::: :::: ::: ::: :::
:+: :+: :+:+: :+: :+: :+:
+:+ +:+ :+:+:+ +:+ +:+ +:+
+#++:++#+ +#+ +:+ +#+ +#++:+
+#+ +#+ +#+#+# +#+ +#+
#+# #+# #+#+# #+# #+#
### ### #### ### ###
]]
logo = string.rep("\n", 8) .. logo .. "\n\n"
return {
'nvimdev/dashboard-nvim',
name = 'dashboard',
dependencies = {
'nvim-tree/nvim-web-devicons'
},
event = 'VimEnter',
opts = {
theme = 'doom',
config = {
header = vim.split(logo, "\n"),
center = {
{ action = function() require('telescope.builtin').find_files() end, desc = " Find file", icon = "", key = "f" },
{ action = "ene | startinsert", desc = " New file", icon = "", key = "n" },
{ action = function() require('telescope.builtin').oldfiles() end, desc = " Recent files", icon = "", key = "r" },
{ action = function() require('telescope.builtin').live_grep() end, desc = " Find text", icon = "", key = "g" },
{ 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 { "Loaded " .. stats.loaded .. "/" .. stats.count .. " plugins in " .. ms .. "ms" }
end,
}
}
}

View file

@ -0,0 +1,23 @@
return {
'stevearc/dressing.nvim',
opts = {
input = {
title_pos = "center",
border = "single",
relative = "win",
},
select = {
backend = { "telescope", "builtin" },
telescope = require('telescope.themes').get_dropdown({
borderchars = {
prompt = { "", "", "", "", "", "", "", "" },
results = { "", "", "", "", "", "", "", "" },
},
max_height = 5
}),
builtin = {
border = "single",
}
}
},
}

View file

@ -0,0 +1,31 @@
local icons = require('config.icons').diff_gutter
return {
'lewis6991/gitsigns.nvim',
dependencies = {
{
"folke/which-key.nvim",
optional = true,
opts = {
defaults = {
["<leader>g"] = { name = "+git" },
},
},
},
},
lazy = false,
keys = {
{ '<leader>gp', '<cmd>Gitsigns preview_hunk<cr>', desc = 'Git preview diff' },
{ '<leader>gb', '<cmd>Gitsigns blame_line<cr>', desc = 'Git blame' }
},
opts = {
signs = {
add = { text = icons.add },
delete = { text = icons.delete },
change = { text = icons.change },
untracked = { text = icons.untracked },
topdelete = { text = icons.delete },
changedelete = { text = icons.change },
},
},
}

View file

@ -0,0 +1,61 @@
local icons = require('config.icons')
return {
'nvim-lualine/lualine.nvim',
event = "VeryLazy",
dependencies = {
'arkav/lualine-lsp-progress',
'nvim-tree/nvim-web-devicons',
},
opts = {
options = {
component_separators = '',
globalstatus = true,
disabled_filetypes = {
statusline = {
'dashboard',
'TelescopePrompt'
}
}
},
sections = {
lualine_a = { "mode" },
lualine_b = { "branch" },
lualine_x = {
{
require("lazy.status").updates,
cond = require("lazy.status").has_updates,
color = { fg = "#ff9e64" },
},
-- {
-- "diff",
-- symbols = {
-- added = icons.diff.added .. ' ',
-- modified = icons.diff.modified .. ' ',
-- removed = icons.diff.removed .. ' '
-- }
-- },
{
"diagnostics",
symbols = {
error = icons.diagnostics.error .. ' ',
warn = icons.diagnostics.warn .. ' ',
info = icons.diagnostics.info .. ' ',
hint = icons.diagnostics.hint .. ' ',
},
},
},
lualine_y = {
'encoding',
'fileformat',
'filetype',
'location'
},
lualine_z = {}
},
extensions = {
'lazy',
'neo-tree'
}
}
}

View file

@ -0,0 +1,60 @@
local icons = require('config.icons')
return {
'nvim-neo-tree/neo-tree.nvim',
cmd = 'Neotree',
keys = {
{ '<leader>fe', ':Neotree reveal toggle<CR>', desc = 'Toggle File Explorer'},
},
dependencies = {
"MunifTanjim/nui.nvim",
"nvim-tree/nvim-web-devicons",
"nvim-lua/plenary.nvim",
},
opts = {
close_if_last_window = true,
hide_root_node = true,
default_component_configs = {
indent = {
indent_size = 2,
padding = 1,
-- indent guides
with_markers = true,
indent_marker = "",
last_indent_marker = "",
},
icon = icons.filetree.basic,
name = {
use_git_status_colors = false,
},
git_status = {
symbols = icons.filetree.git
},
},
event_handlers = {
{
event = "neo_tree_buffer_enter",
handler = function()
if vim.bo.filetype == "neo-tree" then
vim.cmd("setlocal statuscolumn=")
end
end,
}
},
filesystem = {
filtered_items = {
visible = true, -- when true, they will just be displayed differently than normal items
hide_dotfiles = true,
hide_gitignored = true,
hide_hidden = true, -- only works on Windows for hidden files/directories
hide_by_name = {
"node_modules",
"vendor",
},
},
follow_current_file = {
enable = true
},
},
}
}

View file

@ -0,0 +1,16 @@
return {
"folke/noice.nvim",
event = "VeryLazy",
opts = {
cmdline = {
view = "cmdline"
},
presets = {
bottom_search = true,
command_palette = true
}
},
dependencies = {
"MunifTanjim/nui.nvim",
}
}

View file

@ -0,0 +1,22 @@
return {
"folke/which-key.nvim",
event = "VeryLazy",
init = function()
vim.o.timeout = true
vim.o.timeoutlen = 300
end,
opts = {
defaults = {
mode = { "n", "v" },
["<leader>r"] = { name = "+rename" },
["<leader>b"] = { name = "+buffers" },
["<leader>f"] = { name = "+files" },
}
},
config = function(_, opts)
local wk = require("which-key")
wk.setup(opts)
wk.register(opts.defaults)
end
}