feat: new config with everything manually installed

This commit is contained in:
2025-05-30 08:19:56 +02:00
commit d3de5b76fb
47 changed files with 2180 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
-- ╭────────────╮
-- │ Blueprints │
-- ╰────────────╯
return {
{
"dqnid/nvim-blueprints",
name = "blueprints",
init = function()
require("blueprints").setup({ blueprintsDir = "/home/danih/.config/nvim/blueprints" })
end,
},
}

View File

@@ -0,0 +1,97 @@
-- ╭────────────╮
-- │ Code utils │
-- ╰────────────╯
return {
-- │ Code parse │
{
"nvim-treesitter/nvim-treesitter",
opts = function()
return require("plugins.opts.treesitter")
end,
config = function(_, opts)
require("nvim-treesitter.configs").setup(opts)
end,
},
-- To test if TreeSitter is working
-- "nvim-treesitter/playground",
{
"nvim-treesitter/nvim-treesitter-context",
opts = function()
return require("plugins.opts.treesitterContext")
end,
},
-- │ Completion │
{
"hrsh7th/nvim-cmp",
enabled = true,
dependencies = {
"hrsh7th/cmp-emoji",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-emoji",
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-cmdline",
"hrsh7th/cmp-path",
},
opts = function()
return require("plugins.opts.cmp")
end,
},
{
"L3MON4D3/LuaSnip",
build = "make install_jsregexp",
dependencies = { "rafamadriz/friendly-snippets" },
},
{
"saadparwaiz1/cmp_luasnip",
dependencies = {
"hrsh7th/nvim-cmp",
},
},
-- │ Auto close │
{
"m4xshen/autoclose.nvim",
},
{
"windwp/nvim-ts-autotag",
config = function(_, opts)
require('nvim-ts-autotag').setup({
opts = {
enable_close = true, -- Auto close tags
enable_rename = true, -- Auto rename pairs of tags
enable_close_on_slash = false -- Auto close on trailing </
},
per_filetype = {
["html"] = {
enable_close = true
}
}
})
end,
},
-- │ Diagnostics │
{
"folke/trouble.nvim",
opts = { use_diagnostic_signs = true },
},
-- │ Easy comments │
{
"numToStr/Comment.nvim",
keys = {
{ "gcc", mode = "n", desc = "Comment toggle current line" },
{ "gc", mode = { "n", "o" }, desc = "Comment toggle linewise" },
{ "gc", mode = "x", desc = "Comment toggle linewise (visual)" },
{ "gbc", mode = "n", desc = "Comment toggle current block" },
{ "gb", mode = { "n", "o" }, desc = "Comment toggle blockwise" },
{ "gb", mode = "x", desc = "Comment toggle blockwise (visual)" },
},
config = function(_, opts)
require("Comment").setup(opts)
end,
},
}

View File

@@ -0,0 +1,39 @@
return {
{
"folke/snacks.nvim",
priority = 1000,
lazy = false,
---@type snacks.Config
opts = {
animate = { enabled = false },
bigfile = { enabled = true },
bufdelete = { enabled = true },
dashboard = { enabled = false },
debug = { enabled = false },
dim = { enabled = false },
explorer = { enabled = false },
git = { enabled = false },
gitbrowse = { enabled = false },
image = { enabled = false },
indent = { enabled = false },
input = { enabled = false },
layout = { enabled = false },
lazygit = { enabled = true },
picker = { enabled = false },
notifier = { enabled = false },
profiler = { enabled = false },
quickfile = { enabled = true },
rename = { enabled = false },
scope = { enabled = false },
scroll = { enabled = true },
scratch = { enabled = false },
statuscolumn = { enabled = false },
terminal = { enabled = false },
toggle = { enabled = false },
util = { enabled = false },
win = { enabled = false },
words = { enabled = true },
zen = { enabled = true },
}
},
}

77
lua/plugins/context.lua Normal file
View File

@@ -0,0 +1,77 @@
-- ╭─────────╮
-- │ Context │
-- ╰─────────╯
return {
{
"akinsho/bufferline.nvim",
version = "*",
dependencies = "nvim-tree/nvim-web-devicons",
opts = function()
return require("plugins.opts.bufferline")
end,
},
-- Separate buffers in tabs
{ "tiagovla/scope.nvim", config = true },
{
"nvim-lualine/lualine.nvim",
event = "VeryLazy",
dependencies = { "nvim-tree/nvim-web-devicons" },
opts = function()
return require("plugins.opts.lualine")
end,
},
{
"nvim-neo-tree/neo-tree.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons",
"MunifTanjim/nui.nvim",
{
"s1n7ax/nvim-window-picker",
version = "2.*",
config = function()
require("window-picker").setup({
filter_rules = {
include_current_win = false,
autoselect_one = true,
bo = {
filetype = { "neo-tree", "neo-tree-popup", "notify" },
buftype = { "terminal", "quickfix" },
},
},
})
end,
},
},
opts = function()
return require("plugins.opts.neotree")
end,
},
{
"stevearc/aerial.nvim",
opts = {},
dependencies = {
"nvim-treesitter/nvim-treesitter",
"nvim-tree/nvim-web-devicons",
},
},
{
"lukas-reineke/indent-blankline.nvim",
main = "ibl",
opts = {},
init = function()
require("ibl").setup({
whitespace = {
highlight = { "Whitespace", "NonText" },
remove_blankline_trail = true,
},
scope = { exclude = { language = { "lua", "css" } } },
})
end,
},
}

11
lua/plugins/formater.lua Normal file
View File

@@ -0,0 +1,11 @@
-- ╭────────────────╮
-- │ Code formatter │
-- ╰────────────────╯
return {
{
"stevearc/conform.nvim",
opts = function()
return require("plugins.opts.conformFormat")
end,
},
}

16
lua/plugins/git.lua Normal file
View File

@@ -0,0 +1,16 @@
-- ╭─────╮
-- │ Git │
-- ╰─────╯
return {
{
"lewis6991/gitsigns.nvim",
opts = function()
return require("plugins.opts.gitsigns")
end,
},
{
"sindrets/diffview.nvim",
lazy = false,
},
{ "tpope/vim-fugitive" }
}

21
lua/plugins/help.lua Normal file
View File

@@ -0,0 +1,21 @@
-- ╭────────────╮
-- │ Usage help │
-- ╰────────────╯
return {
{
"folke/which-key.nvim",
event = "VeryLazy",
opts = function()
return require("plugins.opts.which-key")
end,
keys = {
{
"<leader>?",
function()
require("which-key").show({ global = false })
end,
desc = "Buffer Local Keymaps (which-key)",
},
},
}
}

View File

@@ -0,0 +1,28 @@
return {
-- ╭────────────╮
-- │ Navigation │
-- ╰────────────╯
{
"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",
},
},
},
}

View File

@@ -0,0 +1,323 @@
local config = {
backends = { "treesitter", "lsp", "markdown", "asciidoc", "man" },
layout = {
-- These control the width of the aerial window.
-- They can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
-- min_width and max_width can be a list of mixed types.
-- max_width = {40, 0.2} means "the lesser of 40 columns or 20% of total"
max_width = { 40, 0.2 },
width = nil,
min_width = 10,
-- key-value pairs of window-local options for aerial window (e.g. winhl)
win_opts = {},
-- Determines the default direction to open the aerial window. The 'prefer'
-- options will open the window in the other direction *if* there is a
-- different buffer in the way of the preferred direction
-- Enum: prefer_right, prefer_left, right, left, float
default_direction = "prefer_right",
-- Determines where the aerial window will be opened
-- edge - open aerial at the far right/left of the editor
-- window - open aerial to the right/left of the current window
placement = "window",
-- When the symbols change, resize the aerial window (within min/max constraints) to fit
resize_to_content = true,
-- Preserve window size equality with (:help CTRL-W_=)
preserve_equality = false,
},
-- Determines how the aerial window decides which buffer to display symbols for
-- window - aerial window will display symbols for the buffer in the window from which it was opened
-- global - aerial window will display symbols for the current window
attach_mode = "window",
-- List of enum values that configure when to auto-close the aerial window
-- unfocus - close aerial when you leave the original source window
-- switch_buffer - close aerial when you change buffers in the source window
-- unsupported - close aerial when attaching to a buffer that has no symbol source
close_automatic_events = {},
-- Keymaps in aerial window. Can be any value that `vim.keymap.set` accepts OR a table of keymap
-- options with a `callback` (e.g. { callback = function() ... end, desc = "", nowait = true })
-- Additionally, if it is a string that matches "actions.<name>",
-- it will use the mapping at require("aerial.actions").<name>
-- Set to `false` to remove a keymap
keymaps = {
["?"] = "actions.show_help",
["g?"] = "actions.show_help",
["<CR>"] = "actions.jump",
["<2-LeftMouse>"] = "actions.jump",
["<C-v>"] = "actions.jump_vsplit",
["<C-s>"] = "actions.jump_split",
["p"] = "actions.scroll",
["<C-j>"] = "actions.down_and_scroll",
["<C-k>"] = "actions.up_and_scroll",
["{"] = "actions.prev",
["}"] = "actions.next",
["[["] = "actions.prev_up",
["]]"] = "actions.next_up",
["q"] = "actions.close",
["o"] = "actions.tree_toggle",
["za"] = "actions.tree_toggle",
["O"] = "actions.tree_toggle_recursive",
["zA"] = "actions.tree_toggle_recursive",
["l"] = "actions.tree_open",
["zo"] = "actions.tree_open",
["L"] = "actions.tree_open_recursive",
["zO"] = "actions.tree_open_recursive",
["h"] = "actions.tree_close",
["zc"] = "actions.tree_close",
["H"] = "actions.tree_close_recursive",
["zC"] = "actions.tree_close_recursive",
["zr"] = "actions.tree_increase_fold_level",
["zR"] = "actions.tree_open_all",
["zm"] = "actions.tree_decrease_fold_level",
["zM"] = "actions.tree_close_all",
["zx"] = "actions.tree_sync_folds",
["zX"] = "actions.tree_sync_folds",
},
-- When true, don't load aerial until a command or function is called
-- Defaults to true, unless `on_attach` is provided, then it defaults to false
lazy_load = true,
-- Disable aerial on files with this many lines
disable_max_lines = 10000,
-- Disable aerial on files this size or larger (in bytes)
disable_max_size = 2000000, -- Default 2MB
-- A list of all symbols to display. Set to false to display all symbols.
-- This can be a filetype map (see :help aerial-filetype-map)
-- To see all available values, see :help SymbolKind
filter_kind = {
"Class",
"Constructor",
"Enum",
"Function",
"Interface",
"Module",
"Method",
"Struct",
},
-- Determines line highlighting mode when multiple splits are visible.
-- split_width Each open window will have its cursor location marked in the
-- aerial buffer. Each line will only be partially highlighted
-- to indicate which window is at that location.
-- full_width Each open window will have its cursor location marked as a
-- full-width highlight in the aerial buffer.
-- last Only the most-recently focused window will have its location
-- marked in the aerial buffer.
-- none Do not show the cursor locations in the aerial window.
highlight_mode = "split_width",
-- Highlight the closest symbol if the cursor is not exactly on one.
highlight_closest = true,
-- Highlight the symbol in the source buffer when cursor is in the aerial win
highlight_on_hover = false,
-- When jumping to a symbol, highlight the line for this many ms.
-- Set to false to disable
highlight_on_jump = 300,
-- Jump to symbol in source window when the cursor moves
autojump = false,
-- Define symbol icons. You can also specify "<Symbol>Collapsed" to change the
-- icon when the tree is collapsed at that symbol, or "Collapsed" to specify a
-- default collapsed icon. The default icon set is determined by the
-- "nerd_font" option below.
-- If you have lspkind-nvim installed, it will be the default icon set.
-- This can be a filetype map (see :help aerial-filetype-map)
icons = {},
-- Control which windows and buffers aerial should ignore.
-- Aerial will not open when these are focused, and existing aerial windows will not be updated
ignore = {
-- Ignore unlisted buffers. See :help buflisted
unlisted_buffers = false,
-- Ignore diff windows (setting to false will allow aerial in diff windows)
diff_windows = true,
-- List of filetypes to ignore.
filetypes = {},
-- Ignored buftypes.
-- Can be one of the following:
-- false or nil - No buftypes are ignored.
-- "special" - All buffers other than normal, help and man page buffers are ignored.
-- table - A list of buftypes to ignore. See :help buftype for the
-- possible values.
-- function - A function that returns true if the buffer should be
-- ignored or false if it should not be ignored.
-- Takes two arguments, `bufnr` and `buftype`.
buftypes = "special",
-- Ignored wintypes.
-- Can be one of the following:
-- false or nil - No wintypes are ignored.
-- "special" - All windows other than normal windows are ignored.
-- table - A list of wintypes to ignore. See :help win_gettype() for the
-- possible values.
-- function - A function that returns true if the window should be
-- ignored or false if it should not be ignored.
-- Takes two arguments, `winid` and `wintype`.
wintypes = "special",
},
-- Use symbol tree for folding. Set to true or false to enable/disable
-- Set to "auto" to manage folds if your previous foldmethod was 'manual'
-- This can be a filetype map (see :help aerial-filetype-map)
manage_folds = false,
-- When you fold code with za, zo, or zc, update the aerial tree as well.
-- Only works when manage_folds = true
link_folds_to_tree = false,
-- Fold code when you open/collapse symbols in the tree.
-- Only works when manage_folds = true
link_tree_to_folds = true,
-- Set default symbol icons to use patched font icons (see https://www.nerdfonts.com/)
-- "auto" will set it to true if nvim-web-devicons or lspkind-nvim is installed.
nerd_font = "auto",
-- Call this function when aerial attaches to a buffer.
on_attach = function(bufnr) end,
-- Call this function when aerial first sets symbols on a buffer.
on_first_symbols = function(bufnr) end,
-- Automatically open aerial when entering supported buffers.
-- This can be a function (see :help aerial-open-automatic)
open_automatic = false,
-- Run this command after jumping to a symbol (false will disable)
post_jump_cmd = "normal! zz",
-- Invoked after each symbol is parsed, can be used to modify the parsed item,
-- or to filter it by returning false.
--
-- bufnr: a neovim buffer number
-- item: of type aerial.Symbol
-- ctx: a record containing the following fields:
-- * backend_name: treesitter, lsp, man...
-- * lang: info about the language
-- * symbols?: specific to the lsp backend
-- * symbol?: specific to the lsp backend
-- * syntax_tree?: specific to the treesitter backend
-- * match?: specific to the treesitter backend, TS query match
post_parse_symbol = function(bufnr, item, ctx)
return true
end,
-- Invoked after all symbols have been parsed and post-processed,
-- allows to modify the symbol structure before final display
--
-- bufnr: a neovim buffer number
-- items: a collection of aerial.Symbol items, organized in a tree,
-- with 'parent' and 'children' fields
-- ctx: a record containing the following fields:
-- * backend_name: treesitter, lsp, man...
-- * lang: info about the language
-- * symbols?: specific to the lsp backend
-- * syntax_tree?: specific to the treesitter backend
post_add_all_symbols = function(bufnr, items, ctx)
return items
end,
-- When true, aerial will automatically close after jumping to a symbol
close_on_select = false,
-- The autocmds that trigger symbols update (not used for LSP backend)
update_events = "TextChanged,InsertLeave",
-- Show box drawing characters for the tree hierarchy
show_guides = false,
-- Customize the characters used when show_guides = true
guides = {
-- When the child item has a sibling below it
mid_item = "├─",
-- When the child item is the last in the list
last_item = "└─",
-- When there are nested child guides to the right
nested_top = "",
-- Raw indentation
whitespace = " ",
},
-- Set this function to override the highlight groups for certain symbols
get_highlight = function(symbol, is_icon, is_collapsed)
-- return "MyHighlight" .. symbol.kind
end,
-- Options for opening aerial in a floating win
float = {
-- Controls border appearance. Passed to nvim_open_win
border = "rounded",
-- Determines location of floating window
-- cursor - Opens float on top of the cursor
-- editor - Opens float centered in the editor
-- win - Opens float centered in the window
relative = "cursor",
-- These control the height of the floating window.
-- They can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
-- min_height and max_height can be a list of mixed types.
-- min_height = {8, 0.1} means "the greater of 8 rows or 10% of total"
max_height = 0.9,
height = nil,
min_height = { 8, 0.1 },
override = function(conf, source_winid)
-- This is the config that will be passed to nvim_open_win.
-- Change values here to customize the layout
return conf
end,
},
-- Options for the floating nav windows
nav = {
border = "rounded",
max_height = 0.9,
min_height = { 10, 0.1 },
max_width = 0.5,
min_width = { 0.2, 20 },
win_opts = {
cursorline = true,
winblend = 10,
},
-- Jump to symbol in source window when the cursor moves
autojump = false,
-- Show a preview of the code in the right column, when there are no child symbols
preview = false,
-- Keymaps in the nav window
keymaps = {
["<CR>"] = "actions.jump",
["<2-LeftMouse>"] = "actions.jump",
["<C-v>"] = "actions.jump_vsplit",
["<C-s>"] = "actions.jump_split",
["h"] = "actions.left",
["l"] = "actions.right",
["<C-c>"] = "actions.close",
},
},
lsp = {
diagnostics_trigger_update = false,
update_when_errors = true,
update_delay = 300,
},
}
return config

View File

@@ -0,0 +1,21 @@
local options = {
auto_session_enabled = true,
auto_save_enabled = false,
auto_restore_enabled = false,
auto_session_use_git_branch = true,
log_level = "error",
auto_session_suppress_dirs = { "~/", "~/Projects", "~/Downloads", "/" },
session_lens = {
-- If load_on_setup is false, make sure you use `:SessionSearch` to open the picker as it will initialize everything first
load_on_setup = false,
theme_conf = { border = true },
previewer = false,
mappings = {
-- Mode can be a string or a table, e.g. {"i", "n"} for both insert and normal mode
delete_session = { "i", "<C-D>" },
alternate_session = { "i", "<C-S>" },
},
},
}
return options

View File

@@ -0,0 +1,108 @@
local config = {
highlights = {
buffer_selected = { bold = true },
diagnostic_selected = { bold = true },
info_selected = { bold = true },
info_diagnostic_selected = { bold = true },
warning_selected = { bold = true },
warning_diagnostic_selected = { bold = true },
error_selected = { bold = true },
error_diagnostic_selected = { bold = true },
},
options = {
themeable = true,
numbers = "none",
diagnostics = "nvim_lsp", -- or "coc"
max_prefix_length = 8,
close_command = "b# | bd#",
right_mouse_command = "b# | bd#",
left_mouse_command = "buffer %d",
buffer_close_icon = "󰅖",
modified_icon = "",
close_icon = "",
left_trunc_marker = "",
right_trunc_marker = "",
max_name_length = 18,
truncate_names = true,
tab_size = 18,
color_icons = true,
show_buffer_icons = true,
show_buffer_close_icons = true,
show_tab_indicators = true,
duplicates_across_groups = true, -- whether to consider duplicate paths in different groups as duplicates
persist_buffer_sort = true, -- whether or not custom sorted buffers should persist
separator_style = { "", "" }, -- "slant" | "slope" | "thick" | "thin" | { 'any', 'any' },
-- always_show_bufferline = false,
auto_toggle_bufferline = true,
show_close_icon = true,
hover = {
enabled = true,
delay = 200,
reveal = { "close" },
},
offsets = {
{
filetype = "neo-tree",
text = "",
highlight = "Directory",
separator = "", -- use a "true" to enable the default, or set your own character
},
},
groups = {
options = {
toggle_hidden_on_enter = true, -- when you re-enter a hidden group this options re-opens that group so the buffer is visible
},
items = {
{
name = "Tests",
highlight = { underline = true, sp = "blue" },
priority = 2,
-- icon = " ",
matcher = function(buf)
return buf.path:match("%_test") or buf.path:match("%_spec")
end,
},
{
name = "Docs",
-- icon = "󰈙 ",
highlight = { undercurl = false, sp = "green" },
auto_close = false,
matcher = function(buf)
return buf.path:match("%.md") or buf.path:match("%.txt")
end,
separator = {
style = require("bufferline.groups").separator.tab,
},
},
{
name = "Shells",
icon = "",
highlight = { undercurl = false, sp = "grey" },
auto_close = false,
matcher = function(buf)
return buf.path:match("zsh")
end,
separator = {
style = require("bufferline.groups").separator.tab,
},
},
{
name = "Docker",
highlight = { undercurl = false, sp = "blue" },
auto_close = false,
matcher = function(buf)
return buf.path:match("dockerfile")
or buf.path:match("DOCKERFILE")
or buf.path:match("Dockerfile")
or buf.path:match("docker%-compose%.yml")
end,
separator = {
style = require("bufferline.groups").separator.tab,
},
},
},
},
},
}
return config

83
lua/plugins/opts/cmp.lua Normal file
View File

@@ -0,0 +1,83 @@
local cmp = require("cmp")
local function border(hl_name)
return {
{ "", hl_name },
{ "", hl_name },
{ "", hl_name },
{ "", hl_name },
{ "", hl_name },
{ "", hl_name },
{ "", hl_name },
{ "", hl_name },
}
end
local options = {
completion = {
completeopt = "menu,menuone",
},
window = {
completion = {
side_padding = 1,
scrollbar = false,
},
documentation = {
border = border("CmpDocBorder"),
winhighlight = "Normal:CmpDoc",
},
},
snippet = {
expand = function(args)
require("luasnip").lsp_expand(args.body)
end,
},
preselect = cmp.PreselectMode.None,
mapping = {
["<C-p>"] = cmp.mapping.select_prev_item(),
["<C-n>"] = cmp.mapping.select_next_item(),
["<C-d>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.close(),
["<CR>"] = cmp.mapping.confirm({
behavior = cmp.ConfirmBehavior.Insert,
select = true,
}),
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif require("luasnip").expand_or_jumpable() then
vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-expand-or-jump", true, true, true), "")
else
fallback()
end
end, {
"i",
"s",
}),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif require("luasnip").jumpable(-1) then
vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-jump-prev", true, true, true), "")
else
fallback()
end
end, {
"i",
"s",
}),
},
sources = {
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "buffer" },
{ name = "nvim_lua" },
{ name = "path" },
{ name = "emoji" },
},
}
return options

View File

@@ -0,0 +1,36 @@
local config = {
-- Define your formatters
formatters_by_ft = {
rust = { "rustfmt" },
lua = { "stylua" },
go = { "goimports", "gofmt" },
javascript = { "prettierd", "prettier", "biome", stop_after_first = true },
javascriptreact = { "prettierd", "prettier", "biome", stop_after_first = true },
typescript = { "prettierd", "prettier", "biome", stop_after_first = true },
typescriptreact = { "prettierd", "prettier", "biome", stop_after_first = true },
css = { "prettierd", "prettier", "biome", stop_after_first = true },
scss = { "prettierd", "prettier", "biome", stop_after_first = true },
-- python = function(bufnr)
-- if require("conform").get_formatter_info("ruff_format", bufnr).available then
-- return { "ruff_format" }
-- else
-- return { "isort", "black" }
-- end
-- end,
["_"] = { "trim_whitespace" }, -- run only on filetypes without formater
-- ["*"] = { "trim_whitespace" }, -- run in all filetypes
},
-- Managed by lazyvim
-- format_on_save = {
-- timeout_ms = 500,
-- lsp_format = "fallback",
-- },
-- Customize formatters
formatters = {
shfmt = {
prepend_args = { "-i", "2" },
},
},
}
return config

View File

@@ -0,0 +1,42 @@
local config = {
signs = {
add = { text = "" },
change = { text = "" },
delete = { text = "_" },
topdelete = { text = "" },
changedelete = { text = "~" },
untracked = { text = "" },
},
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
watch_gitdir = {
follow_files = true,
},
auto_attach = true,
attach_to_untracked = false,
current_line_blame = true, -- Toggle with `:Gitsigns toggle_current_line_blame`
current_line_blame_opts = {
virt_text = true,
virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align'
delay = 500,
ignore_whitespace = false,
virt_text_priority = 100,
},
current_line_blame_formatter = "<author>, <author_time:%R> - <summary>",
sign_priority = 6,
update_debounce = 100,
status_formatter = nil, -- Use default
max_file_length = 40000, -- Disable if file is longer than this (in lines)
preview_config = {
-- Options passed to nvim_open_win
border = "single",
style = "minimal",
relative = "cursor",
row = 0,
col = 1,
},
}
return config

View File

@@ -0,0 +1,42 @@
local options = {
options = {
icons_enabled = true,
theme = "auto",
component_separators = { left = "", right = "" },
section_separators = { left = "", right = "" },
disabled_filetypes = {
statusline = {},
winbar = {},
},
ignore_focus = {},
always_divide_middle = true,
globalstatus = true,
refresh = {
statusline = 1000,
tabline = 1000,
winbar = 1000,
},
},
sections = {
lualine_a = { "mode" },
lualine_b = { "branch", "diff" },
lualine_c = { "filename" },
lualine_x = { "diagnostics", "filetype", "encoding", "fileformat" },
lualine_y = { "progress" },
lualine_z = { "location" },
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = { "filename" },
lualine_x = { "location" },
lualine_y = {},
lualine_z = {},
},
tabline = {},
winbar = {},
inactive_winbar = {},
extensions = {},
}
return options

View File

@@ -0,0 +1,268 @@
local config = {
close_if_last_window = false,
popup_border_style = "rounded",
enable_git_status = true,
enable_diagnostics = true,
open_files_do_not_replace_types = { "terminal", "trouble", "qf" }, -- when opening files, do not use windows containing these filetypes or buftypes
sort_case_insensitive = false, -- used when sorting files and directories in the tree
sort_function = nil,
follow_current_file = { enabled = true },
source_selector = {
winbar = true,
statusline = false,
},
default_component_configs = {
container = {
enable_character_fade = true,
},
indent = {
indent_size = 2,
padding = 1, -- extra padding on left hand side
-- indent guides
with_markers = true,
indent_marker = "",
last_indent_marker = "",
highlight = "NeoTreeIndentMarker",
-- expander config, needed for nesting files
with_expanders = nil, -- if nil and file nesting is enabled, will enable expanders
expander_collapsed = "",
expander_expanded = "",
expander_highlight = "NeoTreeExpander",
},
icon = {
folder_closed = "",
folder_open = "",
folder_empty = "󰜌",
-- The next two settings are only a fallback, if you use nvim-web-devicons and configure default icons there
-- then these will never be used.
default = "*",
highlight = "NeoTreeFileIcon",
},
modified = {
symbol = "[+]",
highlight = "NeoTreeModified",
},
name = {
trailing_slash = false,
use_git_status_colors = true,
highlight = "NeoTreeFileName",
},
git_status = {
symbols = {
-- Change type
added = "", -- or "✚", but this is redundant info if you use git_status_colors on the name
modified = "", -- or "", but this is redundant info if you use git_status_colors on the name
deleted = "", -- this can only be used in the git_status source
renamed = "󰁕", -- this can only be used in the git_status source
-- Status type
untracked = "",
ignored = "",
unstaged = "󰄱",
staged = "",
conflict = "",
},
},
-- If you don't want to use these columns, you can set `enabled = false` for each of them individually
file_size = {
enabled = true,
required_width = 64, -- min width of window required to show this column
},
type = {
enabled = true,
required_width = 122, -- min width of window required to show this column
},
last_modified = {
enabled = true,
required_width = 88, -- min width of window required to show this column
},
created = {
enabled = true,
required_width = 110, -- min width of window required to show this column
},
symlink_target = {
enabled = false,
},
},
-- A list of functions, each representing a global custom command
-- that will be available in all sources (if not overridden in `opts[source_name].commands`)
-- see `:h neo-tree-custom-commands-global`
commands = {},
window = {
position = "left",
width = 40,
mapping_options = {
noremap = true,
nowait = true,
},
mappings = {
["<space>"] = {
"toggle_node",
nowait = false, -- disable `nowait` if you have existing combos starting with this char that you want to use
},
["<2-LeftMouse>"] = "open",
["<cr>"] = "open",
["<esc>"] = "cancel", -- close preview or floating neo-tree window
["P"] = { "toggle_preview", config = { use_float = true, use_image_nvim = true } },
-- Read `# Preview Mode` for more information
["l"] = "focus_preview",
["S"] = "open_split",
["s"] = "open_vsplit",
-- ["S"] = "split_with_window_picker",
-- ["s"] = "vsplit_with_window_picker",
["t"] = "open_tabnew",
-- ["<cr>"] = "open_drop",
-- ["t"] = "open_tab_drop",
["w"] = "open_with_window_picker",
--["P"] = "toggle_preview", -- enter preview mode, which shows the current node without focusing
["C"] = "close_node",
-- ['C'] = 'close_all_subnodes',
["z"] = "close_all_nodes",
--["Z"] = "expand_all_nodes",
["a"] = {
"add",
-- this command supports BASH style brace expansion ("x{a,b,c}" -> xa,xb,xc). see `:h neo-tree-file-actions` for details
-- some commands may take optional config options, see `:h neo-tree-mappings` for details
config = {
show_path = "none", -- "none", "relative", "absolute"
},
},
["A"] = "add_directory", -- also accepts the optional config.show_path option like "add". this also supports BASH style brace expansion.
["d"] = "delete",
["r"] = "rename",
["y"] = "copy_to_clipboard",
["x"] = "cut_to_clipboard",
["p"] = "paste_from_clipboard",
["c"] = "copy", -- takes text input for destination, also accepts the optional config.show_path option like "add":
-- ["c"] = {
-- "copy",
-- config = {
-- show_path = "none" -- "none", "relative", "absolute"
-- }
--}
["m"] = "move", -- takes text input for destination, also accepts the optional config.show_path option like "add".
["q"] = "close_window",
["R"] = "refresh",
["?"] = "show_help",
["<"] = "prev_source",
[">"] = "next_source",
["i"] = "show_file_details",
},
},
nesting_rules = {},
filesystem = {
filtered_items = {
visible = false, -- 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"
},
hide_by_pattern = { -- uses glob style patterns
--"*.meta",
--"*/src/*/tsconfig.json",
},
always_show = { -- remains visible even if other settings would normally hide it
--".gitignored",
},
always_show_by_pattern = { -- uses glob style patterns
--".env*",
},
never_show = { -- remains hidden even if visible is toggled to true, this overrides always_show
--".DS_Store",
--"thumbs.db"
},
never_show_by_pattern = { -- uses glob style patterns
--".null-ls_*",
},
},
group_empty_dirs = false, -- when true, empty folders will be grouped together
hijack_netrw_behavior = "open_default", -- netrw disabled, opening a directory opens neo-tree
-- in whatever position is specified in window.position
-- "open_current", -- netrw disabled, opening a directory opens within the
-- window like netrw would, regardless of window.position
-- "disabled", -- netrw left alone, neo-tree does not handle opening dirs
use_libuv_file_watcher = false, -- This will use the OS level file watchers to detect changes
follow_current_file = { enabled = true },
-- instead of relying on nvim autocmd events.
window = {
mappings = {
["<bs>"] = "navigate_up",
["."] = "set_root",
["H"] = "toggle_hidden",
["/"] = "fuzzy_finder",
["D"] = "fuzzy_finder_directory",
["#"] = "fuzzy_sorter", -- fuzzy sorting using the fzy algorithm
-- ["D"] = "fuzzy_sorter_directory",
["f"] = "filter_on_submit",
["<c-x>"] = "clear_filter",
["[g"] = "prev_git_modified",
["]g"] = "next_git_modified",
["o"] = { "show_help", nowait = false, config = { title = "Order by", prefix_key = "o" } },
["oc"] = { "order_by_created", nowait = false },
["od"] = { "order_by_diagnostics", nowait = false },
["og"] = { "order_by_git_status", nowait = false },
["om"] = { "order_by_modified", nowait = false },
["on"] = { "order_by_name", nowait = false },
["os"] = { "order_by_size", nowait = false },
["ot"] = { "order_by_type", nowait = false },
-- ['<key>'] = function(state) ... end,
},
fuzzy_finder_mappings = { -- define keymaps for filter popup window in fuzzy_finder_mode
["<down>"] = "move_cursor_down",
["<C-j>"] = "move_cursor_down",
["<up>"] = "move_cursor_up",
["<C-k>"] = "move_cursor_up",
-- ['<key>'] = function(state, scroll_padding) ... end,
},
},
commands = {}, -- Add a custom command or override a global one using the same function name
},
buffers = {
follow_current_file = {
enabled = true, -- This will find and focus the file in the active buffer every time
-- -- the current file is changed while the tree is open.
leave_dirs_open = false, -- `false` closes auto expanded dirs, such as with `:Neotree reveal`
},
group_empty_dirs = true, -- when true, empty folders will be grouped together
show_unloaded = true,
window = {
mappings = {
["bd"] = "buffer_delete",
["<bs>"] = "navigate_up",
["."] = "set_root",
["o"] = { "show_help", nowait = false, config = { title = "Order by", prefix_key = "o" } },
["oc"] = { "order_by_created", nowait = false },
["od"] = { "order_by_diagnostics", nowait = false },
["om"] = { "order_by_modified", nowait = false },
["on"] = { "order_by_name", nowait = false },
["os"] = { "order_by_size", nowait = false },
["ot"] = { "order_by_type", nowait = false },
},
},
},
git_status = {
window = {
position = "float",
mappings = {
["A"] = "git_add_all",
["gu"] = "git_unstage_file",
["ga"] = "git_add_file",
["gr"] = "git_revert_file",
["gc"] = "git_commit",
["gp"] = "git_push",
["gg"] = "git_commit_and_push",
["o"] = { "show_help", nowait = false, config = { title = "Order by", prefix_key = "o" } },
["oc"] = { "order_by_created", nowait = false },
["od"] = { "order_by_diagnostics", nowait = false },
["om"] = { "order_by_modified", nowait = false },
["on"] = { "order_by_name", nowait = false },
["os"] = { "order_by_size", nowait = false },
["ot"] = { "order_by_type", nowait = false },
},
},
},
}
return config

View File

@@ -0,0 +1,81 @@
local config = {
views = {
cmdline_popup = {
position = {
row = 3,
col = "50%",
},
size = {
width = 60,
height = "auto",
},
},
cmdline_popupmenu = {
position = {
row = 6,
col = "50%",
},
size = {
width = 60,
height = "auto",
},
},
},
cmdline = {
enabled = true,
view = "cmdline_popup",
opts = {},
---@type table<string, CmdlineFormat>
format = {
cmdline = { pattern = "^:", icon = "λ", lang = "vim", title = "" },
search_down = { kind = "search", pattern = "^/", icon = " ", lang = "regex" },
search_up = { kind = "search", pattern = "^%?", icon = " ", lang = "regex" },
filter = { pattern = "^:%s*!", icon = "$", lang = "bash" },
lua = {
pattern = { "^:%s*lua%s+", "^:%s*lua%s*=%s*", "^:%s*=%s*" },
icon = "",
lang = "lua",
},
help = { pattern = "^:%s*he?l?p?%s+", icon = "" },
input = {}, -- Used by input()
-- lua = false, -- to disable a format, set to `false`
},
},
notify = {
-- Noice can be used as `vim.notify` so you can route any notification like other messages
-- Notification messages have their level and other properties set.
-- event is always "notify" and kind can be any log level as a string
-- The default routes will forward notifications to nvim-notify
-- Benefit of using Noice for this is the routing and consistent history view
enabled = false,
view = "notify",
},
lsp = {
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
override = {
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
["vim.lsp.util.stylize_markdown"] = true,
["cmp.entry.get_documentation"] = true, -- requires hrsh7th/nvim-cmp
},
},
presets = {
bottom_search = true, -- use a classic bottom cmdline for search
command_palette = true, -- position the cmdline and popupmenu together
long_message_to_split = true, -- long messages will be sent to a split
inc_rename = false, -- enables an input dialog for inc-rename.nvim
lsp_doc_border = false, -- add a border to hover docs and signature help
},
routes = {
{ view = "cmdline", filter = { event = "msg_showmode" } },
{
filter = {
event = "msg_show",
kind = "",
find = "written",
},
opts = { skip = true },
},
},
}
return config

View File

@@ -0,0 +1,63 @@
local options = {
defaults = {
vimgrep_arguments = {
"rg",
"-L",
"--color=never",
"--no-heading",
"--with-filename",
"--line-number",
"--column",
"--smart-case",
},
prompt_prefix = "",
selection_caret = " ",
entry_prefix = " ",
initial_mode = "insert",
selection_strategy = "reset",
sorting_strategy = "ascending",
layout_strategy = "horizontal",
layout_config = {
horizontal = {
prompt_position = "top",
preview_width = 0.55,
results_width = 0.8,
},
vertical = {
mirror = false,
},
width = 0.87,
height = 0.80,
preview_cutoff = 120,
},
file_sorter = require("telescope.sorters").get_fuzzy_file,
file_ignore_patterns = { "node_modules" },
generic_sorter = require("telescope.sorters").get_generic_fuzzy_sorter,
path_display = { "truncate" },
winblend = 0,
border = {},
borderchars = { "", "", "", "", "", "", "", "" },
color_devicons = true,
set_env = { ["COLORTERM"] = "truecolor" }, -- default = nil,
file_previewer = require("telescope.previewers").vim_buffer_cat.new,
grep_previewer = require("telescope.previewers").vim_buffer_vimgrep.new,
qflist_previewer = require("telescope.previewers").vim_buffer_qflist.new,
-- Developer configurations: Not meant for general override
buffer_previewer_maker = require("telescope.previewers").buffer_previewer_maker,
mappings = {
n = { ["q"] = require("telescope.actions").close },
},
},
extensions_list = { "fzf" },
extensions = {
fzf = {
fuzzy = true,
override_generic_sorter = true,
override_file_sorter = true,
case_mode = "smart_case",
},
},
}
return options

View File

@@ -0,0 +1,35 @@
local options = {
auto_install = true,
ensure_installed = {
"lua",
"css",
"scss",
"html",
"json",
"tsx",
"bash",
"javascript",
"json",
"markdown",
"markdown_inline",
"python",
"query",
"regex",
"typescript",
"styled",
"vim",
"yaml",
"rust",
"ruby",
"c",
},
highlight = {
enable = true,
use_languagetree = true,
},
indent = { enable = true },
}
return options

View File

@@ -0,0 +1,16 @@
local options = {
enable = true, -- Enable this plugin (Can be enabled/disabled later via commands)
max_lines = 1, -- How many lines the window should span. Values <= 0 mean no limit.
min_window_height = 0, -- Minimum editor window height to enable context. Values <= 0 mean no limit.
line_numbers = true,
multiline_threshold = 20, -- Maximum number of lines to show for a single context
trim_scope = "outer", -- Which context lines to discard if `max_lines` is exceeded. Choices: 'inner', 'outer'
mode = "cursor", -- Line used to calculate context. Choices: 'cursor', 'topline'
-- Separator between context and content. Should be a single character string, like '-'.
-- When separator is set, the context will only show up when there are at least 2 lines above cursorline.
separator = nil,
zindex = 20, -- The Z-index of the context window
on_attach = nil, -- (fun(buf: integer): boolean) return false to disable attaching
}
return options

View File

@@ -0,0 +1,35 @@
local options = {
plugins = {
marks = true, -- shows a list of your marks on ' and `
registers = true, -- shows your registers on " in NORMAL or <C-r> in INSERT mode
spelling = {
enabled = true, -- enabling this will show WhichKey when pressing z= to select spelling suggestions
suggestions = 20, -- how many suggestions should be shown in the list?
},
},
replace = {
-- override the label used to display some keys. It doesn't affect WK in any other way
["<space>"] = "SPC",
["<cr>"] = "RET",
["<tab>"] = "TAB",
},
icons = {
breadcrumb = "»", -- symbol used in the command line area that shows your active key combo
separator = "", -- symbol used between a key and it's label
group = "+", -- symbol prepended to a group
},
win = {
border = "single", -- none, single, double, shadow
position = "top", -- bottom, top
margin = { 1, 0, 1, 0 }, -- extra window margin [top, right, bottom, left]
padding = { 2, 2, 2, 2 }, -- extra window padding [top, right, bottom, left]
},
layout = {
height = { min = 4, max = 25 }, -- min and max height of the columns
width = { min = 20, max = 50 }, -- min and max width of the columns
spacing = 3, -- spacing between columns
align = "left", -- align columns left, center or right
},
}
return options

32
lua/plugins/search.lua Normal file
View File

@@ -0,0 +1,32 @@
-- ╭───────────╮
-- │ Telescope │
-- ╰───────────╯
return {
{
"nvim-telescope/telescope.nvim",
dependencies = {
"nvim-treesitter/nvim-treesitter",
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
{
"isak102/telescope-git-file-history.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"tpope/vim-fugitive",
},
},
},
cmd = "Telescope",
opts = function()
return require("plugins.opts.telescope")
end,
config = function(_, opts)
local telescope = require("telescope")
telescope.setup(opts)
-- load extensions
for _, ext in ipairs(opts.extensions_list) do
telescope.load_extension(ext)
end
end,
},
}

16
lua/plugins/sessions.lua Normal file
View File

@@ -0,0 +1,16 @@
-- ╭──────────╮
-- │ Sessions │
-- ╰──────────╯
return {
{
"rmagatti/auto-session",
dependencies = {
"nvim-telescope/telescope.nvim",
},
opts = function()
return require("plugins.opts.autosession")
end,
lazy = false,
},
}

54
lua/plugins/style.lua Normal file
View File

@@ -0,0 +1,54 @@
-- ╭─────────╮
-- │ Styling │
-- ╰─────────╯
return {
{
-- "dqnid/plain-colors.nvim",
-- dir = "~/Documents/Proyectos/neovim-theme",
dir = "~/Documents/Code/plain-colors.nvim",
name = "rose-pine",
opts = {
variant = "darker", -- dark, light, darker
},
},
{
"folke/noice.nvim",
event = "VeryLazy",
dependencies = {
"MunifTanjim/nui.nvim",
-- OPTIONAL: (if not mini is the backup)
-- "rcarriga/nvim-notify",
},
opts = function()
return require("plugins.opts.noice")
end,
},
{
"norcalli/nvim-colorizer.lua",
config = function()
require("colorizer").setup({})
end,
},
{ "shortcuts/no-neck-pain.nvim", version = "*" },
{
"sphamba/smear-cursor.nvim",
opts = {
smear_between_buffers = false,
smear_between_neighbor_lines = true,
scroll_buffer_space = true,
-- Set to `true` if your font supports legacy computing symbols (block unicode symbols).
legacy_computing_symbols_support = false,
smear_insert_mode = true,
-- fast smear
stiffness = 0.8, -- 0.6 [0, 1]
trailing_stiffness = 0.5, -- 0.4 [0, 1]
stiffness_insert_mode = 0.6, -- 0.4 [0, 1]
trailing_stiffness_insert_mode = 0.6, -- 0.4 [0, 1]
distance_stop_animating = 0.5, -- 0.1 > 0
},
},
}