add base setup with dotter
This commit is contained in:
parent
6b0da868bb
commit
42e6595b60
177 changed files with 1062 additions and 70 deletions
78
config/nvim/lua/aleidk/plugins/ai.lua
Normal file
78
config/nvim/lua/aleidk/plugins/ai.lua
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
return {
|
||||
"olimorris/codecompanion.nvim",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
{
|
||||
"zbirenbaum/copilot.lua",
|
||||
cmd = "Copilot",
|
||||
event = "InsertEnter",
|
||||
config = function()
|
||||
require("copilot").setup({
|
||||
suggestion = { enabled = false },
|
||||
panel = { enabled = true, auto_refresh = true },
|
||||
})
|
||||
end,
|
||||
},
|
||||
"hrsh7th/nvim-cmp", -- Optional: For using slash commands and variables in the chat buffer
|
||||
"nvim-telescope/telescope.nvim", -- Optional: For using slash commands
|
||||
{ "stevearc/dressing.nvim", opts = {} }, -- Optional: Improves `vim.ui.select`
|
||||
},
|
||||
opts = {
|
||||
strategies = {
|
||||
chat = {
|
||||
adapter = "copilot",
|
||||
},
|
||||
inline = {
|
||||
adapter = "copilot",
|
||||
},
|
||||
agent = { adapter = "copilot" },
|
||||
},
|
||||
display = {
|
||||
action_palette = {
|
||||
prompt = " "
|
||||
}
|
||||
}
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
"<leader>at",
|
||||
function()
|
||||
require("codecompanion").toggle()
|
||||
end,
|
||||
desc = "Toggle AI chat",
|
||||
mode = { "n", "v" }
|
||||
},
|
||||
{
|
||||
"<leader>aa",
|
||||
"<CMD>CodeCompanion<CR>",
|
||||
desc = "Run an inline prompt",
|
||||
mode = { "n", "v" }
|
||||
},
|
||||
{
|
||||
"<leader>aA",
|
||||
function()
|
||||
require("codecompanion").actions()
|
||||
end,
|
||||
desc = "Open AI actions",
|
||||
mode = { "n", "v" }
|
||||
},
|
||||
{
|
||||
"<leader>av",
|
||||
function()
|
||||
require("codecompanion").add()
|
||||
end,
|
||||
desc = "Add visual selection to chat",
|
||||
mode = "v"
|
||||
},
|
||||
{
|
||||
"<leader>ae",
|
||||
function()
|
||||
require("codecompanion").prompt("explain")
|
||||
end,
|
||||
desc = "Explain code",
|
||||
mode = "v"
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
5
config/nvim/lua/aleidk/plugins/auto-pairs.lua
Normal file
5
config/nvim/lua/aleidk/plugins/auto-pairs.lua
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
return {
|
||||
"windwp/nvim-autopairs",
|
||||
event = "InsertEnter",
|
||||
opts = {}, -- this is equalent to setup({}) function
|
||||
}
|
||||
34
config/nvim/lua/aleidk/plugins/bookmarks.lua
Normal file
34
config/nvim/lua/aleidk/plugins/bookmarks.lua
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
local function select_or_create(search)
|
||||
local grapple = require("grapple")
|
||||
|
||||
if grapple.exists(search) then
|
||||
grapple.select(search)
|
||||
else
|
||||
grapple.tag()
|
||||
end
|
||||
end
|
||||
|
||||
return {
|
||||
"cbochs/grapple.nvim",
|
||||
dependencies = {
|
||||
{ "nvim-tree/nvim-web-devicons", lazy = true },
|
||||
},
|
||||
lazy = false,
|
||||
cmd = "Grapple",
|
||||
keys = {
|
||||
{ "<leader><leader>a", "<cmd>Grapple toggle<cr>", desc = "Toggle bookmark for current file" },
|
||||
{ "<leader><leader>D", "<cmd>Grapple reset<cr>", desc = "Delete all bookmarks" },
|
||||
{ "<leader><leader>t", "<cmd>Grapple toggle_tags<cr>", desc = "Toggle bookmarks window" },
|
||||
{ "<leader><leader>T", "<cmd>Grapple toggle_scopes<cr>", desc = "Toggle scopes window" },
|
||||
{ "<leader><leader>n", "<cmd>Grapple cycle forward<cr>", desc = "Next bookmark" },
|
||||
{ "<leader><leader>N", "<cmd>Grapple cycle backward<cr>", desc = "Prev bookmark" },
|
||||
{ "<leader><leader>j", function() select_or_create({ index = 1 }) end, desc = "Go or create bookmark 1" },
|
||||
{ "<leader><leader>k", function() select_or_create({ index = 2 }) end, desc = "Go or create bookmark 2" },
|
||||
{ "<leader><leader>l", function() select_or_create({ index = 3 }) end, desc = "Go or create bookmark 3" },
|
||||
{ "<leader><leader>ñ", function() select_or_create({ index = 4 }) end, desc = "Go or create bookmark 4" },
|
||||
{ "<leader><leader>J", "<cmd>Grapple tag index=1<cr>", desc = "Override bookmark 1" },
|
||||
{ "<leader><leader>K", "<cmd>Grapple tag index=2<cr>", desc = "Override bookmark 2" },
|
||||
{ "<leader><leader>L", "<cmd>Grapple tag index=3<cr>", desc = "Override bookmark 3" },
|
||||
{ "<leader><leader>Ñ", "<cmd>Grapple tag index=4<cr>", desc = "Override bookmark 4" },
|
||||
},
|
||||
}
|
||||
39
config/nvim/lua/aleidk/plugins/colorscheme.lua
Normal file
39
config/nvim/lua/aleidk/plugins/colorscheme.lua
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
return { -- Change colors.none if not using a transparent background
|
||||
"catppuccin/nvim",
|
||||
priority = 1000,
|
||||
lazy = false,
|
||||
opts = {
|
||||
flavour = "macchiato",
|
||||
transparent_background = true,
|
||||
integrations = {
|
||||
cmp = true,
|
||||
notify = true,
|
||||
harpoon = false,
|
||||
mason = true,
|
||||
neogit = true,
|
||||
noice = true,
|
||||
hop = true,
|
||||
lsp_trouble = true,
|
||||
indent_blankline = {
|
||||
enabled = true,
|
||||
},
|
||||
},
|
||||
custom_highlights = function(colors)
|
||||
return {
|
||||
-- Fix colors for cmp
|
||||
Pmenu = { bg = colors.none, blend = 0 },
|
||||
FloatBorder = { bg = colors.none },
|
||||
CmpItemMenu = { fg = colors.text, bg = colors.none },
|
||||
-- dadbod-ui
|
||||
NotificationInfo = { bg = colors.none, fg = colors.text },
|
||||
NotificationWarning = { bg = colors.none, fg = colors.yellow },
|
||||
NotificationError = { bg = colors.none, fg = colors.red },
|
||||
}
|
||||
end,
|
||||
},
|
||||
|
||||
config = function(_, opts)
|
||||
require("catppuccin").setup(opts)
|
||||
vim.cmd.colorscheme("catppuccin")
|
||||
end,
|
||||
}
|
||||
49
config/nvim/lua/aleidk/plugins/comments.lua
Normal file
49
config/nvim/lua/aleidk/plugins/comments.lua
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
return {
|
||||
{
|
||||
"echasnovski/mini.comment",
|
||||
version = "*",
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
{ "nvim-treesitter/nvim-treesitter-context" },
|
||||
},
|
||||
opts = {
|
||||
options = {
|
||||
custom_commentstring = function()
|
||||
return require("ts_context_commentstring.internal").calculate_commentstring()
|
||||
or vim.bo.commentstring
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"LudoPinelli/comment-box.nvim",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("comment-box").setup({
|
||||
outer_blank_lines = true,
|
||||
})
|
||||
|
||||
local cb = require("comment-box")
|
||||
|
||||
-- left aligned fixed size box with left aligned text
|
||||
MAP({ "n", "v" }, "gcb", cb.lcbox, "Create a comment box")
|
||||
-- centered adapted box with centered text
|
||||
MAP({ "n", "v" }, "gcl", cb.llline, "Create a comment line")
|
||||
end,
|
||||
},
|
||||
{
|
||||
"danymat/neogen",
|
||||
opts = { snippet_engine = "luasnip" },
|
||||
dependencies = { "nvim-treesitter/nvim-treesitter" },
|
||||
version = "*", -- stable releases
|
||||
keys = {
|
||||
{
|
||||
"gcd",
|
||||
function()
|
||||
require("neogen").generate()
|
||||
end,
|
||||
desc = "Generate comment docstring",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
120
config/nvim/lua/aleidk/plugins/completion.lua
Normal file
120
config/nvim/lua/aleidk/plugins/completion.lua
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
---@diagnostic disable: missing-fields
|
||||
return {
|
||||
"hrsh7th/nvim-cmp",
|
||||
version = false, -- last release is way too old
|
||||
event = "InsertEnter",
|
||||
dependencies = {
|
||||
"L3MON4D3/LuaSnip",
|
||||
"davidsierradz/cmp-conventionalcommits",
|
||||
"hrsh7th/cmp-buffer",
|
||||
"hrsh7th/cmp-cmdline",
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-path",
|
||||
"petertriho/cmp-git",
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
"windwp/nvim-autopairs",
|
||||
{
|
||||
"zbirenbaum/copilot-cmp",
|
||||
config = function()
|
||||
require("copilot_cmp").setup()
|
||||
end
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
vim.api.nvim_set_hl(0, "CmpGhostText", { link = "Comment", default = true })
|
||||
local cmp = require("cmp")
|
||||
|
||||
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
||||
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
|
||||
|
||||
local defaults = require("cmp.config.default")()
|
||||
local window_opts = {
|
||||
border = "rounded",
|
||||
side_padding = 1,
|
||||
-- fix colors for catppuccin colorscheme
|
||||
winhighlight = "Normal:Pmenu,FloatBorder:FloatBorder,CursorLine:PmenuSel,Search:None",
|
||||
}
|
||||
local opts = {
|
||||
visible_docs = false,
|
||||
completion = {
|
||||
completeopt = "menu,menuone,noinsert",
|
||||
},
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require("luasnip").lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<C-n>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||
["<C-p>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||
["<C-j>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||
["<C-k>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||
["<C-u>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-d>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-o>"] = function()
|
||||
if cmp.visible_docs() then
|
||||
cmp.close_docs()
|
||||
else
|
||||
cmp.open_docs()
|
||||
end
|
||||
end,
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
["<C-e>"] = cmp.mapping.abort(),
|
||||
["<BR>"] = cmp.mapping.abort(),
|
||||
["<C-CR>"] = cmp.mapping.confirm({ select = false }), -- Confirm only if selected an item
|
||||
["<CR>"] = cmp.mapping.confirm({
|
||||
-- Auto confirms first item
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = true,
|
||||
}),
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = "conventionalcommits" },
|
||||
{ name = "copilot" },
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" },
|
||||
{ name = "buffer" },
|
||||
{ name = "path" },
|
||||
}),
|
||||
formatting = {
|
||||
fields = { "kind", "abbr", "menu" },
|
||||
format = function(_, item)
|
||||
local icons = require("aleidk.constants").icons.kinds
|
||||
if icons[item.kind] then
|
||||
item.kind = icons[item.kind] .. item.kind
|
||||
end
|
||||
return item
|
||||
end,
|
||||
},
|
||||
window = {
|
||||
completion = cmp.config.window.bordered(window_opts),
|
||||
documentation = cmp.config.window.bordered(window_opts),
|
||||
},
|
||||
experimental = {
|
||||
ghost_text = {
|
||||
hl_group = "CmpGhostText",
|
||||
},
|
||||
},
|
||||
sorting = {
|
||||
priority_weight = 2,
|
||||
comparators = {
|
||||
require("copilot_cmp.comparators").prioritize,
|
||||
|
||||
-- Below is the default comparitor list and order for nvim-cmp
|
||||
cmp.config.compare.offset,
|
||||
-- cmp.config.compare.scopes, --this is commented in nvim-cmp too
|
||||
cmp.config.compare.exact,
|
||||
cmp.config.compare.score,
|
||||
cmp.config.compare.recently_used,
|
||||
cmp.config.compare.locality,
|
||||
cmp.config.compare.kind,
|
||||
cmp.config.compare.sort_text,
|
||||
cmp.config.compare.length,
|
||||
cmp.config.compare.order,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
cmp.setup(opts)
|
||||
end,
|
||||
}
|
||||
35
config/nvim/lua/aleidk/plugins/dashboard.lua
Normal file
35
config/nvim/lua/aleidk/plugins/dashboard.lua
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
return {
|
||||
"goolord/alpha-nvim",
|
||||
lazy = false,
|
||||
opts = function()
|
||||
local dashboard = require("alpha.themes.dashboard")
|
||||
|
||||
dashboard.section.header.val = {
|
||||
" ████ ███ █████ █████ ",
|
||||
" ░░███ ░░░ ░░███ ░░███ ",
|
||||
" ██████ ░███ ██████ ████ ███████ ░███ █████",
|
||||
" ░░░░░███ ░███ ███░░███░░███ ███░░███ ░███░░███ ",
|
||||
" ███████ ░███ ░███████ ░███ ░███ ░███ ░██████░ ",
|
||||
" ███░░███ ░███ ░███░░░ ░███ ░███ ░███ ░███░░███ ",
|
||||
"░░████████ █████░░██████ █████░░████████ ████ █████",
|
||||
" ░░░░░░░░ ░░░░░ ░░░░░░ ░░░░░ ░░░░░░░░ ░░░░ ░░░░░ ",
|
||||
}
|
||||
dashboard.section.header.opts.hl = "DashboardHeader"
|
||||
|
||||
dashboard.section.buttons.val = {
|
||||
dashboard.button("LDR f f", " Find File ", "<leader>ff"),
|
||||
dashboard.button("LDR LDR t", " Bookmars", "<leader><leader>t"),
|
||||
dashboard.button("LDR g g", " Git ", "<leader>gg"),
|
||||
}
|
||||
|
||||
dashboard.section.footer.val =
|
||||
{ " ", " ", " ", "Nvim loaded " .. require("lazy").stats().count .. " plugins " }
|
||||
dashboard.section.footer.opts.hl = "DashboardFooter"
|
||||
|
||||
dashboard.config.layout[1].val = vim.fn.max({ 2, vim.fn.floor(vim.fn.winheight(0) * 0.2) })
|
||||
dashboard.config.layout[3].val = 5
|
||||
dashboard.config.opts.noautocmd = true
|
||||
|
||||
return dashboard.opts
|
||||
end,
|
||||
}
|
||||
44
config/nvim/lua/aleidk/plugins/database.lua
Normal file
44
config/nvim/lua/aleidk/plugins/database.lua
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
return {
|
||||
"kristijanhusak/vim-dadbod-ui",
|
||||
dependencies = {
|
||||
{ "tpope/vim-dadbod", lazy = true },
|
||||
{ "kristijanhusak/vim-dadbod-completion", ft = { "sql", "mysql", "plsql" }, lazy = true },
|
||||
},
|
||||
cmd = {
|
||||
"DBUI",
|
||||
"DBUIToggle",
|
||||
"DBUIAddConnection",
|
||||
"DBUIFindBuffer",
|
||||
},
|
||||
keys = {
|
||||
{ "<Leader>ud", "<CMD>DBUIToggle<CR>", desc = "Toggle DB UI" },
|
||||
},
|
||||
init = function()
|
||||
-- Your DBUI configuration
|
||||
vim.g.db_ui_use_nerd_fonts = 1
|
||||
vim.g.db_ui_force_echo_notifications = 1
|
||||
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = {
|
||||
"sql",
|
||||
"mysql",
|
||||
"plsql",
|
||||
},
|
||||
command = [[setlocal omnifunc=vim_dadbod_completion#omni]],
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = {
|
||||
"sql",
|
||||
"mysql",
|
||||
"plsql",
|
||||
},
|
||||
callback = function()
|
||||
---@diagnostic disable-next-line: missing-fields
|
||||
require("cmp").setup.buffer({
|
||||
sources = { { name = "vim-dadbod-completion" }, { name = "buffer" } },
|
||||
})
|
||||
end,
|
||||
})
|
||||
end,
|
||||
}
|
||||
7
config/nvim/lua/aleidk/plugins/debugprint.lua
Normal file
7
config/nvim/lua/aleidk/plugins/debugprint.lua
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
return {
|
||||
"andrewferrier/debugprint.nvim",
|
||||
opts = {},
|
||||
-- Remove the following line to use development versions,
|
||||
-- not just the formal releases
|
||||
version = "*",
|
||||
}
|
||||
10
config/nvim/lua/aleidk/plugins/dressing.lua
Normal file
10
config/nvim/lua/aleidk/plugins/dressing.lua
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
return {
|
||||
-- better imputs
|
||||
"stevearc/dressing.nvim",
|
||||
opts = {
|
||||
input = {
|
||||
-- handle by noice
|
||||
enabled = false,
|
||||
},
|
||||
},
|
||||
}
|
||||
100
config/nvim/lua/aleidk/plugins/file-browser.lua
Normal file
100
config/nvim/lua/aleidk/plugins/file-browser.lua
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
return {
|
||||
{
|
||||
"nvim-tree/nvim-tree.lua",
|
||||
enabled = false,
|
||||
version = "*",
|
||||
dependencies = {
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
keys = {
|
||||
{ "<Leader>e", "<CMD>NvimTreeToggle<CR>", desc = "Open file explorer" },
|
||||
},
|
||||
cmd = { "NvimTreeToggle", "Tree" },
|
||||
config = function()
|
||||
local tree = require("nvim-tree")
|
||||
local api = require("nvim-tree.api")
|
||||
|
||||
tree.setup({
|
||||
hijack_unnamed_buffer_when_opening = true,
|
||||
disable_netrw = false,
|
||||
hijack_netrw = false, -- handle by telescope browser
|
||||
hijack_cursor = true, -- cursor at the start of filename
|
||||
sync_root_with_cwd = true,
|
||||
respect_buf_cwd = true,
|
||||
update_focused_file = {
|
||||
enable = true, -- focus curren file
|
||||
update_root = true,
|
||||
},
|
||||
actions = { open_file = { quit_on_open = true } },
|
||||
renderer = {
|
||||
full_name = true, -- show remaining name in floating text
|
||||
group_empty = true, -- group empty folders
|
||||
add_trailing = true, -- Trailing slash to folders
|
||||
highlight_opened_files = "all",
|
||||
highlight_git = true,
|
||||
},
|
||||
view = {
|
||||
centralize_selection = true, -- center current file on enter
|
||||
width = 30, -- N° of columns or %
|
||||
},
|
||||
on_attach = function(bufnr)
|
||||
local function opts(desc)
|
||||
return {
|
||||
desc = "nvim-tree: " .. desc,
|
||||
buffer = bufnr,
|
||||
noremap = true,
|
||||
silent = true,
|
||||
nowait = true,
|
||||
}
|
||||
end
|
||||
|
||||
-- Check defaults here: https://github.com/nvim-tree/nvim-tree.lua/wiki/Migrating-To-on_attach
|
||||
api.config.mappings.default_on_attach(bufnr)
|
||||
|
||||
vim.keymap.set("n", "l", api.node.open.edit, opts("Open"))
|
||||
vim.keymap.set("n", "o", api.node.open.edit, opts("Open"))
|
||||
vim.keymap.set("n", "<CR>", api.node.open.edit, opts("Open"))
|
||||
vim.keymap.set("n", "<2-LeftMouse>", api.node.open.edit, opts("Open"))
|
||||
vim.keymap.set("n", "s", api.node.open.vertical, opts("Open in vsplit"))
|
||||
vim.keymap.set("n", "v", api.node.open.horizontal, opts("Open in hsplit"))
|
||||
vim.keymap.set("n", "t", api.node.open.tab, opts("Open in tab"))
|
||||
vim.keymap.set("n", "h", api.node.navigate.parent_close, opts("Close dir"))
|
||||
vim.keymap.set("n", "<BS>", api.node.navigate.parent_close, opts("Close dir"))
|
||||
vim.keymap.set("n", "i", api.tree.toggle_hidden_filter, opts("Toggle Dotfiles"))
|
||||
vim.keymap.set("n", "I", api.tree.toggle_gitignore_filter, opts("Toggle Git Ignore"))
|
||||
end,
|
||||
})
|
||||
|
||||
-- Auto open when a dir is opened
|
||||
|
||||
local function open_nvim_tree(data)
|
||||
-- buffer is a directory
|
||||
local directory = vim.fn.isdirectory(data.file) == 1
|
||||
|
||||
if not directory then
|
||||
return
|
||||
end
|
||||
|
||||
-- create a new, empty buffer
|
||||
vim.cmd.enew()
|
||||
|
||||
-- wipe the directory buffer
|
||||
vim.cmd.bw(data.buf)
|
||||
|
||||
-- change to the directory
|
||||
vim.cmd.cd(data.file)
|
||||
|
||||
-- open the tree
|
||||
require("nvim-tree.api").tree.open()
|
||||
end
|
||||
|
||||
vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree })
|
||||
vim.api.nvim_create_user_command("Tree", "NvimTreeToggle", {})
|
||||
|
||||
-- bindings
|
||||
-- disabled to discourage the use of this plugin without disabling it
|
||||
-- vim.keymap.set("n", "<leader>e", ":NvimTreeToggle<CR>", { desc = "Toggle file tree", silent = true })
|
||||
-- vim.keymap.set("n", "<C-e>", ":NvimTreeToggle<CR>", { desc = "Toggle file tree", silent = true })
|
||||
end,
|
||||
},
|
||||
}
|
||||
66
config/nvim/lua/aleidk/plugins/file-explorer.lua
Normal file
66
config/nvim/lua/aleidk/plugins/file-explorer.lua
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
return {
|
||||
"rolv-apneseth/tfm.nvim",
|
||||
lazy = false,
|
||||
opts = {
|
||||
-- TFM to use
|
||||
-- Possible choices: "ranger" | "nnn" | "lf" | "vifm" | "yazi" (default)
|
||||
file_manager = "yazi",
|
||||
-- Replace netrw entirely
|
||||
-- Default: false
|
||||
replace_netrw = true,
|
||||
-- Enable creation of commands
|
||||
-- Default: false
|
||||
-- Commands:
|
||||
-- Tfm: selected file(s) will be opened in the current window
|
||||
-- TfmSplit: selected file(s) will be opened in a horizontal split
|
||||
-- TfmVsplit: selected file(s) will be opened in a vertical split
|
||||
-- TfmTabedit: selected file(s) will be opened in a new tab page
|
||||
enable_cmds = true,
|
||||
-- Custom keybindings only applied within the TFM buffer
|
||||
-- Default: {}
|
||||
keybindings = {
|
||||
["<ESC>"] = "q",
|
||||
},
|
||||
-- Customise UI. The below options are the default
|
||||
ui = {
|
||||
border = "rounded",
|
||||
height = 1,
|
||||
width = 1,
|
||||
x = 0.5,
|
||||
y = 0.5,
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
"<leader>e",
|
||||
function()
|
||||
require("tfm").open()
|
||||
end,
|
||||
desc = "TFM",
|
||||
},
|
||||
{
|
||||
"<leader>mh",
|
||||
function()
|
||||
local tfm = require("tfm")
|
||||
tfm.open(nil, tfm.OPEN_MODE.split)
|
||||
end,
|
||||
desc = "TFM - horizontal split",
|
||||
},
|
||||
{
|
||||
"<leader>mv",
|
||||
function()
|
||||
local tfm = require("tfm")
|
||||
tfm.open(nil, tfm.OPEN_MODE.vsplit)
|
||||
end,
|
||||
desc = "TFM - vertical split",
|
||||
},
|
||||
{
|
||||
"<leader>mt",
|
||||
function()
|
||||
local tfm = require("tfm")
|
||||
tfm.open(nil, tfm.OPEN_MODE.tabedit)
|
||||
end,
|
||||
desc = "TFM - new tab",
|
||||
},
|
||||
},
|
||||
}
|
||||
120
config/nvim/lua/aleidk/plugins/formatter.lua
Normal file
120
config/nvim/lua/aleidk/plugins/formatter.lua
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
return {
|
||||
"stevearc/conform.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
-- log_level = vim.log.levels.DEBUG,
|
||||
|
||||
-- See aviable formatters in: https://github.com/stevearc/conform.nvim#formatters
|
||||
-- Formatters can be installed by mason
|
||||
formatters_by_ft = {
|
||||
-- Conform will run multiple formatters sequentially
|
||||
-- Use a stop_after_first = true to run only the first available formatter
|
||||
-- Use the "_" filetype to run formatters on filetypes that don't
|
||||
-- have other formatters configured.
|
||||
["_"] = { "trim_whitespace" },
|
||||
blade = { "blade-formatter" },
|
||||
css = { "prettierd", "prettier" },
|
||||
go = { "gofumpt", "goimports_reviser", "golines" },
|
||||
html = { "djlint", "prettierd", stop_after_first = true },
|
||||
javascript = { "prettierd", "prettier", stop_after_first = true },
|
||||
javascriptreact = { "prettierd", "prettier", stop_after_first = true },
|
||||
json = { "prettierd", "prettier", stop_after_first = true },
|
||||
jsonc = { "prettierd", "prettier", stop_after_first = true },
|
||||
lua = { "stylua" },
|
||||
markdown = { "markdownlint" },
|
||||
nim = { "nimpretty" },
|
||||
php = { "pint" },
|
||||
python = { "ruff_format", "ruff_organize_imports" },
|
||||
scss = { "prettierd", "prettier", stop_after_first = true },
|
||||
sh = { "shfmt" },
|
||||
typescript = { "prettierd", "prettier", stop_after_first = true },
|
||||
typescriptreact = { "prettierd", "prettier", stop_after_first = true },
|
||||
xml = { "lemminx" },
|
||||
zsh = { "shfmt" }
|
||||
},
|
||||
formatters = {
|
||||
djlint = {
|
||||
prepend_args = {
|
||||
"--format-css",
|
||||
"--indent-css",
|
||||
"2",
|
||||
"--format-js",
|
||||
"--indent-js",
|
||||
"2",
|
||||
"--indent",
|
||||
"2",
|
||||
"--preserve-blank-lines",
|
||||
"--quiet"
|
||||
}
|
||||
}
|
||||
},
|
||||
format_on_save = function(bufnr)
|
||||
-- Disable with a global or buffer-local variable
|
||||
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
|
||||
return
|
||||
end
|
||||
|
||||
return { timeout_ms = 2000, lsp_fallback = true }
|
||||
end,
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("conform").setup(opts)
|
||||
|
||||
local function toggleAutoFormat()
|
||||
-- to make this global, change b to g
|
||||
if vim.b.disable_autoformat == nil then
|
||||
vim.b.disable_autoformat = true
|
||||
print("Autoformat set to: " .. tostring(not vim.b.disable_autoformat))
|
||||
return
|
||||
end
|
||||
|
||||
vim.b.disable_autoformat = not vim.b.disable_autoformat
|
||||
print("Autoformat set to: " .. tostring(not vim.b.disable_autoformat))
|
||||
end
|
||||
|
||||
MAP("n", "<leader>uf", toggleAutoFormat, "Toggle auto format")
|
||||
|
||||
vim.api.nvim_create_user_command("Fmt", function(args)
|
||||
local range = nil
|
||||
if args.count ~= -1 then
|
||||
local end_line = vim.api.nvim_buf_get_lines(0, args.line2 - 1, args.line2, true)[1]
|
||||
range = {
|
||||
start = { args.line1, 0 },
|
||||
["end"] = { args.line2, end_line:len() },
|
||||
}
|
||||
end
|
||||
|
||||
local function callback(err, did_edit)
|
||||
if not did_edit then
|
||||
vim.notify("The file was not formatted:\n" .. tostring(err), vim.log.levels.ERROR)
|
||||
return
|
||||
end
|
||||
|
||||
if args.bang then
|
||||
vim.cmd("w")
|
||||
end
|
||||
end
|
||||
|
||||
require("conform").format(
|
||||
{
|
||||
async = true,
|
||||
lsp_format = "fallback",
|
||||
range = range,
|
||||
formatters = args.fargs
|
||||
},
|
||||
callback
|
||||
)
|
||||
end, {
|
||||
range = true,
|
||||
bang = true,
|
||||
force = true,
|
||||
desc = "Format the document",
|
||||
nargs = '*',
|
||||
-- complete = function()
|
||||
-- local formatters = require('conform').formatters_by_ft
|
||||
--
|
||||
-- return vim.tbl_keys(formatters)
|
||||
-- end
|
||||
})
|
||||
end,
|
||||
}
|
||||
114
config/nvim/lua/aleidk/plugins/git.lua
Normal file
114
config/nvim/lua/aleidk/plugins/git.lua
Normal file
|
|
@ -0,0 +1,114 @@
|
|||
return {
|
||||
{
|
||||
"lewis6991/gitsigns.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
opts = {
|
||||
-- See `:help gitsigns.txt`
|
||||
signs = {
|
||||
add = { text = "▎" },
|
||||
change = { text = "▎" },
|
||||
delete = { text = "" },
|
||||
topdelete = { text = "" },
|
||||
changedelete = { text = "▎" },
|
||||
untracked = { text = "▎" },
|
||||
},
|
||||
on_attach = function(buffer)
|
||||
local gs = package.loaded.gitsigns
|
||||
|
||||
local function map(mode, l, r, desc)
|
||||
vim.keymap.set(mode, "<leader>g" .. l, r, { buffer = buffer, desc = desc })
|
||||
end
|
||||
|
||||
-- stylua: ignore start
|
||||
map("n", "j", gs.next_hunk, "Next Hunk")
|
||||
map("n", "k", gs.prev_hunk, "Prev Hunk")
|
||||
map({ "n", "v" }, "s", ":Gitsigns stage_hunk<CR>", "Stage Hunk")
|
||||
map({ "n", "v" }, "r", ":Gitsigns reset_hunk<CR>", "Reset Hunk")
|
||||
map("n", "u", gs.undo_stage_hunk, "Undo Stage Hunk")
|
||||
map("n", "R", gs.reset_buffer, "Reset Buffer")
|
||||
map("n", "<TAB>", gs.preview_hunk, "Preview Hunk")
|
||||
map("n", "l", function() gs.blame_line({full = true}) end, "Blame Line")
|
||||
map("n", "d", gs.diffthis, "Diff This")
|
||||
end,
|
||||
},
|
||||
},
|
||||
{
|
||||
"kdheepak/lazygit.nvim",
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
},
|
||||
keys = {
|
||||
{ "<leader>gG", ":LazyGit<CR>", desc = "Lazygit" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"NeogitOrg/neogit",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim", -- required
|
||||
"nvim-telescope/telescope.nvim", -- optional
|
||||
"sindrets/diffview.nvim", -- optional
|
||||
},
|
||||
config = true,
|
||||
opts = {
|
||||
disable_line_numbers = false,
|
||||
console_timeout = 8000,
|
||||
graph_style = "unicode",
|
||||
kind = "tab",
|
||||
ignored_settings = {
|
||||
"NeogitPushPopup--force",
|
||||
"NeogitPullPopup--rebase",
|
||||
"NeogitCommitPopup--allow-empty",
|
||||
"NeogitCommitPopup--reuse-message",
|
||||
"NeogitRevertPopup--no-edit",
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
"<leader>gg",
|
||||
function()
|
||||
require("neogit").open()
|
||||
end,
|
||||
desc = "Neogit",
|
||||
},
|
||||
{
|
||||
"<leader>gc",
|
||||
function()
|
||||
require("neogit").open({ "commit" })
|
||||
end,
|
||||
desc = "Commit",
|
||||
},
|
||||
{
|
||||
"<leader>gp",
|
||||
function()
|
||||
require("neogit").open({ "pull" })
|
||||
end,
|
||||
desc = "Pull",
|
||||
},
|
||||
{
|
||||
"<leader>gP",
|
||||
function()
|
||||
require("neogit").open({ "push" })
|
||||
end,
|
||||
desc = "Push",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
"pwntester/octo.nvim",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-telescope/telescope.nvim",
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
opts = { enable_builtin = true },
|
||||
keys = {
|
||||
{
|
||||
"<leader>go",
|
||||
"<CMD>Octo<CR>",
|
||||
desc = "Octo.nvim",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
38
config/nvim/lua/aleidk/plugins/http.lua
Normal file
38
config/nvim/lua/aleidk/plugins/http.lua
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
return {
|
||||
"jellydn/hurl.nvim",
|
||||
dependencies = {
|
||||
"MunifTanjim/nui.nvim",
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-treesitter/nvim-treesitter"
|
||||
},
|
||||
ft = "hurl",
|
||||
opts = {
|
||||
-- Show debugging info
|
||||
debug = false,
|
||||
-- Show notification on run
|
||||
show_notification = false,
|
||||
-- Show response in popup or split
|
||||
mode = "popup",
|
||||
-- Default formatter
|
||||
formatters = {
|
||||
json = { 'jq' }, -- Make sure you have install jq in your system, e.g: brew install jq
|
||||
html = {
|
||||
'prettierd', -- Make sure you have install prettier in your system, e.g: npm install -g prettier
|
||||
'--parser',
|
||||
'html',
|
||||
},
|
||||
},
|
||||
env_file = {
|
||||
'hurl.env',
|
||||
'.env',
|
||||
'.env.local',
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
-- Run API request
|
||||
{ "<leader>ph", "<cmd>HurlRunnerAt<CR>", desc = "Run HTTP request" },
|
||||
{ "<leader>pH", "<cmd>HurlRunner<CR>", desc = "Run all HTTP requests" },
|
||||
-- Run Hurl request in visual mode
|
||||
{ "<leader>ph", ":HurlRunner<CR>", desc = "Run HTTP requests", mode = "v" },
|
||||
},
|
||||
}
|
||||
30
config/nvim/lua/aleidk/plugins/indent-blankline.lua
Normal file
30
config/nvim/lua/aleidk/plugins/indent-blankline.lua
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
return {
|
||||
-- Add indentation guides even on blank lines
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
event = { "BufReadPost", "BufNewFile" },
|
||||
main = "ibl",
|
||||
opts = {
|
||||
-- char = "▏",
|
||||
indent = {
|
||||
char = "│",
|
||||
tab_char = "│",
|
||||
},
|
||||
scope = {
|
||||
enabled = true,
|
||||
},
|
||||
exclude = {
|
||||
filetypes = {
|
||||
"help",
|
||||
"alpha",
|
||||
"dashboard",
|
||||
"neo-tree",
|
||||
"Trouble",
|
||||
"lazy",
|
||||
"mason",
|
||||
"notify",
|
||||
"toggleterm",
|
||||
"lazyterm",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
99
config/nvim/lua/aleidk/plugins/init.lua
Normal file
99
config/nvim/lua/aleidk/plugins/init.lua
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
return {
|
||||
-- Detect tabstop and shiftwidth automatically
|
||||
"tpope/vim-sleuth",
|
||||
{ "nvim-tree/nvim-web-devicons", lazy = true },
|
||||
{
|
||||
"mbbill/undotree",
|
||||
config = function()
|
||||
vim.g.undotree_WindowLayout = 2
|
||||
vim.g.undotree_ShortIndicators = 1
|
||||
vim.g.undotree_SetFocusWhenToggle = 1
|
||||
end,
|
||||
keys = {
|
||||
{ "<leader>fu", vim.cmd.UndotreeToggle, desc = "Undo tree" },
|
||||
},
|
||||
},
|
||||
{
|
||||
-- Highlight word under cursor
|
||||
"RRethy/vim-illuminate",
|
||||
event = { "BufReadPost", "BufNewFile" },
|
||||
opts = { delay = 200 },
|
||||
config = function(_, opts)
|
||||
require("illuminate").configure(opts)
|
||||
end,
|
||||
},
|
||||
{
|
||||
-- Color Picker
|
||||
"uga-rosa/ccc.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
auto_enable = true,
|
||||
lsp = true,
|
||||
},
|
||||
keys = {
|
||||
{ "<leader>uc", "<CMD>CccPick<CR>", desc = "Open Color picker" },
|
||||
{ "<leader>uC", "<CMD>CccHighlighterToggle<CR>", desc = "Toggle Color highlight" },
|
||||
},
|
||||
},
|
||||
-- Dotfiles management
|
||||
{
|
||||
"xvzc/chezmoi.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim", "alker0/chezmoi.vim" },
|
||||
config = function()
|
||||
require("chezmoi").setup({
|
||||
{
|
||||
edit = {
|
||||
watch = false,
|
||||
force = false,
|
||||
},
|
||||
notification = {
|
||||
on_open = true,
|
||||
on_apply = true,
|
||||
on_watch = false,
|
||||
},
|
||||
telescope = {
|
||||
select = { "<CR>" },
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, {
|
||||
-- INFO: this should be the same as $(chezmoi source-path)
|
||||
pattern = { os.getenv("HOME") .. "/.local/share/chezmoi/chezmoi/*" },
|
||||
callback = function()
|
||||
vim.schedule(require("chezmoi.commands.__edit").watch)
|
||||
end,
|
||||
})
|
||||
local telescope = require("telescope")
|
||||
|
||||
telescope.load_extension("chezmoi")
|
||||
vim.keymap.set("n", "<leader>fz", telescope.extensions.chezmoi.find_files, { desc = "Find dotfile" })
|
||||
end,
|
||||
},
|
||||
{
|
||||
"pmizio/typescript-tools.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim", "neovim/nvim-lspconfig" },
|
||||
opts = {
|
||||
init_options = {
|
||||
preferences = {
|
||||
disableSuggestions = true,
|
||||
},
|
||||
},
|
||||
settings = {
|
||||
-- array of strings("fix_all"|"add_missing_imports"|"remove_unused"|
|
||||
-- "remove_unused_imports"|"organize_imports") -- or string "all"
|
||||
-- to include all supported code actions
|
||||
-- specify commands exposed as code_actions
|
||||
expose_as_code_action = "all",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
"olexsmir/gopher.nvim",
|
||||
ft = "go",
|
||||
build = function()
|
||||
vim.cmd([[silent! GoInstallDeps]])
|
||||
end,
|
||||
},
|
||||
}
|
||||
85
config/nvim/lua/aleidk/plugins/key-help.lua
Normal file
85
config/nvim/lua/aleidk/plugins/key-help.lua
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
return {
|
||||
"echasnovski/mini.clue",
|
||||
version = "*",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
local miniclue = require("mini.clue")
|
||||
miniclue.setup({
|
||||
triggers = {
|
||||
-- Leader triggers
|
||||
{ mode = "n", keys = "<Leader>" },
|
||||
{ mode = "v", keys = "<Leader>" },
|
||||
{ mode = "x", keys = "<Leader>" },
|
||||
|
||||
-- Built-in completion
|
||||
{ mode = "i", keys = "<C-x>" },
|
||||
|
||||
-- `g` key
|
||||
{ mode = "n", keys = "g" },
|
||||
{ mode = "x", keys = "g" },
|
||||
|
||||
-- Marks
|
||||
{ mode = "n", keys = "'" },
|
||||
{ mode = "n", keys = "`" },
|
||||
{ mode = "x", keys = "'" },
|
||||
{ mode = "x", keys = "`" },
|
||||
|
||||
-- Registers
|
||||
{ mode = "n", keys = '"' },
|
||||
{ mode = "x", keys = '"' },
|
||||
{ mode = "i", keys = "<C-r>" },
|
||||
{ mode = "c", keys = "<C-r>" },
|
||||
|
||||
-- Window commands
|
||||
{ mode = "n", keys = "<C-w>" },
|
||||
|
||||
-- `z` key
|
||||
{ mode = "n", keys = "z" },
|
||||
{ mode = "x", keys = "z" },
|
||||
},
|
||||
|
||||
-- Add a "postkeys" value to activate those keys after others
|
||||
clues = {
|
||||
miniclue.gen_clues.builtin_completion(),
|
||||
miniclue.gen_clues.g(),
|
||||
miniclue.gen_clues.marks(),
|
||||
miniclue.gen_clues.registers(),
|
||||
miniclue.gen_clues.windows(),
|
||||
miniclue.gen_clues.z(),
|
||||
|
||||
{ mode = "n", keys = "<Leader><Leader>", desc = "+Bookmarks" },
|
||||
{ mode = "n", keys = "<Leader><Leader>n", postkeys = "<Leader><Leader>" },
|
||||
{ mode = "n", keys = "<Leader><Leader>N", postkeys = "<Leader><Leader>" },
|
||||
{ mode = "n", keys = "<Leader>b", desc = "+Buffers" },
|
||||
{ mode = "n", keys = "<Leader>bh", postkeys = "<Leader>b" },
|
||||
{ mode = "n", keys = "<Leader>bl", postkeys = "<Leader>b" },
|
||||
{ mode = "n", keys = "<Leader>f", desc = "+Find" },
|
||||
{ mode = "n", keys = "<Leader>g", desc = "+Git" },
|
||||
{ mode = "n", keys = "<Leader>l", desc = "+LSP" },
|
||||
{ mode = "n", keys = "<Leader>r", desc = "+Replace" },
|
||||
{ mode = "n", keys = "<Leader>u", desc = "+UI & Config" },
|
||||
{ mode = "n", keys = "<Leader>un", desc = "+Noice" },
|
||||
{ mode = "n", keys = "<Leader>w", desc = "+Workspace" },
|
||||
{ mode = "n", keys = "<Leader>p", desc = "+Run stuff" },
|
||||
{ mode = "n", keys = "<Leader>z", desc = "+ZK" },
|
||||
{ mode = "v", keys = "<Leader>z", desc = "+ZK" },
|
||||
{ mode = "v", keys = "<Leader>a", desc = "+AI" },
|
||||
{ mode = "n", keys = "<Leader>a", desc = "+AI" },
|
||||
{ mode = "n", keys = "g?", desc = "+Print Debug" },
|
||||
},
|
||||
|
||||
-- Clue window settings
|
||||
window = {
|
||||
-- Floating window config
|
||||
config = {
|
||||
width = "auto",
|
||||
},
|
||||
-- Delay before showing clue window
|
||||
delay = 200,
|
||||
-- Keys to scroll inside the clue window
|
||||
scroll_down = "<C-d>",
|
||||
scroll_up = "<C-u>",
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
29
config/nvim/lua/aleidk/plugins/linters.lua
Normal file
29
config/nvim/lua/aleidk/plugins/linters.lua
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
return {
|
||||
"mfussenegger/nvim-lint",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
local lint = require("lint")
|
||||
|
||||
lint.linters.gitlint.stdin = true
|
||||
lint.linters.gitlint.args = { "--contrib", "contrib-title-conventional-commits", "--msg-filename", "-" }
|
||||
|
||||
lint.linters_by_ft = {
|
||||
javascript = { "eslint_d" },
|
||||
typescript = { "eslint_d" },
|
||||
javascriptreact = { "eslint_d" },
|
||||
typescriptreact = { "eslint_d" },
|
||||
-- astro = { "eslint_d" },
|
||||
python = { "ruff" },
|
||||
sh = { "shellcheck" },
|
||||
NeogitCommitMessage = { "gitlint" },
|
||||
gitcommit = { "gitlint" },
|
||||
markdown = { "markdownlint" },
|
||||
}
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
|
||||
callback = function()
|
||||
require("lint").try_lint()
|
||||
end,
|
||||
})
|
||||
end,
|
||||
}
|
||||
215
config/nvim/lua/aleidk/plugins/lsp.lua
Normal file
215
config/nvim/lua/aleidk/plugins/lsp.lua
Normal file
|
|
@ -0,0 +1,215 @@
|
|||
return {
|
||||
-- LSP Configuration & Plugins
|
||||
"neovim/nvim-lspconfig",
|
||||
event = { "BufReadPost", "BufNewFile", "BufWritePre" },
|
||||
dependencies = {
|
||||
-- Automatically install LSPs to stdpath for neovim
|
||||
{ "williamboman/mason.nvim" },
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
-- Additional lua configuration, makes nvim stuff amazing!
|
||||
{ "folke/neodev.nvim", opts = {} },
|
||||
},
|
||||
|
||||
config = function()
|
||||
-- LSP settings.
|
||||
local on_attach = function(_, bufnr)
|
||||
local nmap = function(keys, func, desc)
|
||||
if desc then
|
||||
desc = "LSP: " .. desc
|
||||
end
|
||||
|
||||
vim.keymap.set("n", keys, func, { buffer = bufnr, desc = desc })
|
||||
end
|
||||
|
||||
nmap("<leader>lr", vim.lsp.buf.rename, "Rename")
|
||||
-- stylua: ignore
|
||||
vim.keymap.set({ "n", "x", "v" }, "<leader>la", vim.lsp.buf.code_action, { buffer = bufnr, desc = "Code Action" })
|
||||
nmap("<leader>ld", vim.lsp.buf.type_definition, "Go to type definition")
|
||||
nmap("<leader>lf", function()
|
||||
vim.lsp.buf.format()
|
||||
end, "Format")
|
||||
|
||||
nmap("gd", vim.lsp.buf.definition, "Go to definition")
|
||||
nmap("gr", require("telescope.builtin").lsp_references, "Goto References")
|
||||
nmap("gI", vim.lsp.buf.implementation, "Go to Implementation")
|
||||
|
||||
-- See `:help K` for why this keymap
|
||||
nmap("K", vim.lsp.buf.hover, "Hover Documentation")
|
||||
-- nmap("<C-k>", vim.lsp.buf.signature_help, "Signature Documentation")
|
||||
|
||||
-- Lesser used LSP functionality
|
||||
nmap("gD", vim.lsp.buf.declaration, "Goto Declaration")
|
||||
|
||||
nmap("<leader>lj", vim.diagnostic.goto_next, "Go to next diagnostic")
|
||||
nmap("<leader>lk", vim.diagnostic.goto_prev, "Go to prev diagnostic")
|
||||
nmap("<leader>lK", function()
|
||||
-- execute twice to enter the float inmediatly
|
||||
vim.diagnostic.open_float()
|
||||
vim.diagnostic.open_float()
|
||||
end, "Hover current diagnostic")
|
||||
|
||||
-- Create a command `:Format` local to the LSP buffer
|
||||
vim.api.nvim_buf_create_user_command(bufnr, "Format", function(_)
|
||||
vim.lsp.buf.format()
|
||||
end, { desc = "Format current buffer with LSP" })
|
||||
end
|
||||
|
||||
-- Enable the following language servers
|
||||
-- To see options and cofigurations: https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
|
||||
local servers = {
|
||||
astro = {},
|
||||
bashls = {},
|
||||
cssls = {},
|
||||
dockerls = {},
|
||||
emmet_ls = {
|
||||
filetypes = {
|
||||
"astro",
|
||||
"css",
|
||||
"eruby",
|
||||
"html",
|
||||
"htmldjango",
|
||||
"javascriptreact",
|
||||
"less",
|
||||
"pug",
|
||||
"sass",
|
||||
"scss",
|
||||
"svelte",
|
||||
"typescriptreact",
|
||||
"vue",
|
||||
"htmlangular",
|
||||
"php",
|
||||
"blade"
|
||||
},
|
||||
},
|
||||
html = {},
|
||||
["nil_ls"] = {},
|
||||
marksman = {},
|
||||
pyright = {},
|
||||
phpactor = {},
|
||||
gopls = {
|
||||
settings = {
|
||||
gopls = {
|
||||
completeUnimported = true,
|
||||
usePlaceholders = true,
|
||||
analyses = {
|
||||
unusedparams = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
ruff = {},
|
||||
rust_analyzer = {
|
||||
settings = {
|
||||
["rust-analyzer"] = {
|
||||
imports = {
|
||||
granularity = {
|
||||
group = "module",
|
||||
},
|
||||
prefix = "self",
|
||||
},
|
||||
cargo = {
|
||||
buildScripts = {
|
||||
enable = true,
|
||||
},
|
||||
},
|
||||
procMacro = {
|
||||
enable = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
sqlls = {},
|
||||
yamlls = {},
|
||||
tsserver = {
|
||||
init_options = {
|
||||
preferences = {
|
||||
disableSuggestions = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
lua_ls = {
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
-- Tell the language server which version of Lua you're using
|
||||
-- (most likely LuaJIT in the case of Neovim)
|
||||
version = "LuaJIT",
|
||||
},
|
||||
-- Make the server aware of Neovim runtime files
|
||||
workspace = {
|
||||
checkThirdParty = false,
|
||||
library = {
|
||||
vim.env.VIMRUNTIME,
|
||||
-- "${3rd}/luv/library"
|
||||
-- "${3rd}/busted/library",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
-- nvim-cmp supports additional completion capabilities, so broadcast that to servers
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities)
|
||||
|
||||
-- Ensure the servers above are installed
|
||||
local mason_lspconfig = require("mason-lspconfig")
|
||||
|
||||
mason_lspconfig.setup({
|
||||
ensure_installed = vim.tbl_keys(servers),
|
||||
automatic_installation = { exclude = { "astro", "phpactor", "gopls", "rust_analyzer", "sqlls" } },
|
||||
})
|
||||
|
||||
mason_lspconfig.setup_handlers({
|
||||
function(server_name)
|
||||
local _border = "single"
|
||||
|
||||
local default_config = {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
handlers = {
|
||||
["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, {
|
||||
border = _border,
|
||||
}),
|
||||
["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {
|
||||
border = _border,
|
||||
}),
|
||||
},
|
||||
}
|
||||
|
||||
require("lspconfig")[server_name].setup(
|
||||
vim.tbl_deep_extend("force", default_config, servers[server_name] or {})
|
||||
)
|
||||
end,
|
||||
})
|
||||
|
||||
vim.diagnostic.config({
|
||||
update_in_insert = false,
|
||||
underline = true,
|
||||
float = {
|
||||
source = true
|
||||
},
|
||||
virtual_text = {
|
||||
severity = vim.diagnostic.severity.ERROR,
|
||||
source = true,
|
||||
spacing = -1,
|
||||
prefix = nil,
|
||||
format = function(diagnostic)
|
||||
-- show small error code instead of whole error that probably won't fit in the screen
|
||||
-- to see the whole error use other keybindings
|
||||
return tostring(diagnostic.code)
|
||||
end,
|
||||
virt_text_hide = true
|
||||
},
|
||||
severity_sort = true,
|
||||
})
|
||||
|
||||
-- Customize gutter icons
|
||||
local signs = require("aleidk.constants").icons.diagnostics
|
||||
for type, icon in pairs(signs) do
|
||||
local hl = "DiagnosticSign" .. type
|
||||
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
|
||||
end
|
||||
end,
|
||||
}
|
||||
230
config/nvim/lua/aleidk/plugins/lualine.lua
Normal file
230
config/nvim/lua/aleidk/plugins/lualine.lua
Normal file
|
|
@ -0,0 +1,230 @@
|
|||
return {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
lazy = false,
|
||||
dependencies = {
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
"cbochs/grapple.nvim",
|
||||
{ 'AndreM222/copilot-lualine' }
|
||||
},
|
||||
opts = function()
|
||||
local icons = require("aleidk.constants").icons
|
||||
local palete = require("catppuccin.palettes").get_palette "macchiato"
|
||||
|
||||
local function diff_source()
|
||||
local gitsigns = vim.b.gitsigns_status_dict
|
||||
if gitsigns then
|
||||
return {
|
||||
added = gitsigns.added,
|
||||
modified = gitsigns.changed,
|
||||
removed = gitsigns.removed,
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
local function position_scrollbar(str)
|
||||
local sbar = { "▁▁", "▂▂", "▃▃", "▄▄", "▅▅", "▆▆", "▇▇", "██" }
|
||||
|
||||
local curr_line = vim.api.nvim_win_get_cursor(0)[1]
|
||||
local lines = vim.api.nvim_buf_line_count(0)
|
||||
local i = math.floor((curr_line - 1) / lines * #sbar) + 1
|
||||
return str .. " " .. sbar[i]
|
||||
end
|
||||
|
||||
local codecompanion_status = require("lualine.component"):extend()
|
||||
|
||||
codecompanion_status.processing = false
|
||||
codecompanion_status.spinner_index = 1
|
||||
|
||||
local spinner_symbols = require("copilot-lualine.spinners").bouncing_bar
|
||||
|
||||
-- Initializer
|
||||
function codecompanion_status:init(options)
|
||||
codecompanion_status.super.init(self, options)
|
||||
|
||||
local group = vim.api.nvim_create_augroup("CodeCompanionHooks", {})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "User" }, {
|
||||
pattern = "CodeCompanionRequest*",
|
||||
group = group,
|
||||
callback = function(request)
|
||||
if request.match == "CodeCompanionRequestStarted" then
|
||||
self.processing = true
|
||||
elseif request.match == "CodeCompanionRequestFinished" then
|
||||
self.processing = false
|
||||
end
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
-- Function that runs every time statusline is updated
|
||||
function codecompanion_status:update_status()
|
||||
if self.processing then
|
||||
self.spinner_index = (self.spinner_index % #spinner_symbols) + 1
|
||||
return spinner_symbols[self.spinner_index]
|
||||
else
|
||||
return nil
|
||||
end
|
||||
end
|
||||
|
||||
return {
|
||||
options = {
|
||||
theme = "catppuccin",
|
||||
globalstatus = true,
|
||||
disabled_filetypes = { statusline = { "dashboard", "alpha" } },
|
||||
component_separators = "",
|
||||
section_separators = "",
|
||||
},
|
||||
sections = {
|
||||
lualine_a = {
|
||||
{
|
||||
"mode",
|
||||
padding = 0,
|
||||
fmt = function()
|
||||
return " "
|
||||
end,
|
||||
},
|
||||
},
|
||||
lualine_b = {},
|
||||
lualine_c = {
|
||||
{ "branch", icon = icons.git.branch },
|
||||
{
|
||||
"copilot",
|
||||
cond = function()
|
||||
return vim.bo.filetype ~= "codecompanion"
|
||||
end,
|
||||
show_colors = true,
|
||||
symbols = {
|
||||
status = {
|
||||
icons = {
|
||||
enabled = " ",
|
||||
sleep = " ", -- auto-trigger disabled
|
||||
disabled = " ",
|
||||
warning = " ",
|
||||
unknown = " "
|
||||
},
|
||||
hl = {
|
||||
enabled = palete.teal,
|
||||
sleep = palete.lavender,
|
||||
disabled = palete.subtext0,
|
||||
warning = palete.peach,
|
||||
unknown = palete.red
|
||||
}
|
||||
},
|
||||
spinners = spinner_symbols,
|
||||
spinner_color = palete.mauve
|
||||
},
|
||||
},
|
||||
{ codecompanion_status },
|
||||
{
|
||||
"overseer",
|
||||
},
|
||||
{
|
||||
-- Macro recording status
|
||||
function()
|
||||
return require("noice").api.status.mode.get()
|
||||
end,
|
||||
cond = function()
|
||||
return package.loaded["noice"] and require("noice").api.status.mode.has()
|
||||
end,
|
||||
},
|
||||
},
|
||||
lualine_x = {
|
||||
{
|
||||
function()
|
||||
return require("grapple").statusline()
|
||||
end,
|
||||
},
|
||||
},
|
||||
lualine_y = {
|
||||
{ "searchcount" },
|
||||
{ "location" },
|
||||
{
|
||||
"progress",
|
||||
fmt = position_scrollbar,
|
||||
separator = " ",
|
||||
padding = 0,
|
||||
},
|
||||
},
|
||||
lualine_z = {},
|
||||
},
|
||||
winbar = {
|
||||
lualine_b = {
|
||||
{
|
||||
"filename",
|
||||
path = 1,
|
||||
symbols = {
|
||||
modified = " ●", -- Text to show when the buffer is modified
|
||||
alternate_file = "#", -- Text to show to identify the alternate file
|
||||
directory = "", -- Text to show when the buffer is a directory
|
||||
},
|
||||
},
|
||||
},
|
||||
lualine_y = {
|
||||
{
|
||||
"diff",
|
||||
symbols = {
|
||||
added = icons.git.added,
|
||||
modified = icons.git.modified,
|
||||
removed = icons.git.removed,
|
||||
},
|
||||
source = diff_source,
|
||||
},
|
||||
{
|
||||
"diagnostics",
|
||||
symbols = {
|
||||
error = icons.diagnostics.Error,
|
||||
warn = icons.diagnostics.Warn,
|
||||
info = icons.diagnostics.Info,
|
||||
hint = icons.diagnostics.Hint,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
inactive_winbar = {
|
||||
lualine_b = {
|
||||
{
|
||||
"filename",
|
||||
path = 1,
|
||||
symbols = {
|
||||
modified = " ●", -- Text to show when the buffer is modified
|
||||
alternate_file = "#", -- Text to show to identify the alternate file
|
||||
directory = "", -- Text to show when the buffer is a directory
|
||||
},
|
||||
},
|
||||
},
|
||||
lualine_y = {
|
||||
{
|
||||
"diff",
|
||||
symbols = {
|
||||
added = icons.git.added,
|
||||
modified = icons.git.modified,
|
||||
removed = icons.git.removed,
|
||||
},
|
||||
source = diff_source,
|
||||
},
|
||||
{
|
||||
"diagnostics",
|
||||
symbols = {
|
||||
error = icons.diagnostics.Error,
|
||||
warn = icons.diagnostics.Warn,
|
||||
info = icons.diagnostics.Info,
|
||||
hint = icons.diagnostics.Hint,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
extensions = {
|
||||
"neo-tree",
|
||||
"lazy",
|
||||
"fugitive",
|
||||
"fzf",
|
||||
"man",
|
||||
"mason",
|
||||
"nvim-tree",
|
||||
"quickfix",
|
||||
"symbols-outline",
|
||||
"trouble",
|
||||
},
|
||||
}
|
||||
end,
|
||||
}
|
||||
27
config/nvim/lua/aleidk/plugins/luasnip.lua
Normal file
27
config/nvim/lua/aleidk/plugins/luasnip.lua
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
return {
|
||||
"L3MON4D3/LuaSnip",
|
||||
dependencies = {
|
||||
"rafamadriz/friendly-snippets",
|
||||
config = function()
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
end,
|
||||
},
|
||||
opts = {
|
||||
history = true,
|
||||
delete_check_events = "TextChanged",
|
||||
},
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{
|
||||
"<tab>",
|
||||
function()
|
||||
return require("luasnip").jumpable(1) and "<Plug>luasnip-jump-next" or "<tab>"
|
||||
end,
|
||||
expr = true,
|
||||
silent = true,
|
||||
mode = "i",
|
||||
},
|
||||
{ "<tab>", function() require("luasnip").jump(1) end, mode = "s" },
|
||||
{ "<s-tab>", function() require("luasnip").jump(-1) end, mode = { "i", "s" } },
|
||||
},
|
||||
}
|
||||
44
config/nvim/lua/aleidk/plugins/markdown.lua
Normal file
44
config/nvim/lua/aleidk/plugins/markdown.lua
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
return {
|
||||
{
|
||||
"MeanderingProgrammer/markdown.nvim",
|
||||
name = "render-markdown", -- Only needed if you have another plugin named markdown.nvim
|
||||
-- dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.nvim' }, -- if you use the mini.nvim suite
|
||||
-- dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.icons' }, -- if you use standalone mini plugins
|
||||
dependencies = { "nvim-treesitter/nvim-treesitter", "nvim-tree/nvim-web-devicons" }, -- if you prefer nvim-web-devicons
|
||||
opts = {
|
||||
file_types = { 'markdown', 'codecompanion' },
|
||||
sign = {
|
||||
enabled = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"zk-org/zk-nvim",
|
||||
config = function()
|
||||
require("zk").setup({
|
||||
picker = "select",
|
||||
})
|
||||
|
||||
function MAP(mode, l, r, desc)
|
||||
vim.keymap.set(mode, l, r, { desc = desc, silent = true })
|
||||
end
|
||||
|
||||
MAP("n", "<CR>", "<Cmd>lua vim.lsp.buf.definition()<CR>", "Open the link under cursor")
|
||||
|
||||
MAP("n", "<leader>zn", "<Cmd>ZkNew { dir = vim.fn.expand('%:p:h'), title = vim.fn.input('Title: ') }<CR>",
|
||||
"Create new note")
|
||||
MAP("v", "<leader>zN",
|
||||
":'<,'>ZkNewFromContentSelection { dir = vim.fn.expand('%:p:h'), title = vim.fn.input('Title: ') }<CR>",
|
||||
"Create new note using selection as content")
|
||||
|
||||
MAP("n", "<leader>zl", "<Cmd>ZkInsertLink<CR>", "Insert Link into cursor position")
|
||||
MAP("v", "<leader>zl", ":'<,'>ZkInsertLinkAtSelection<CR>", "Insert Link into selection")
|
||||
|
||||
MAP("n", "<leader>zb", "<Cmd>ZkBacklinks<CR>", "Backlinks")
|
||||
MAP("n", "<leader>zo", "<Cmd>ZkLinks<CR>", "Outlinks")
|
||||
|
||||
MAP("n", "<leader>zf", "<Cmd>ZkNotes<CR>", "Find note")
|
||||
MAP("n", "<leader>zt", "<Cmd>ZkTags<CR>", "Find tags")
|
||||
end
|
||||
}
|
||||
}
|
||||
18
config/nvim/lua/aleidk/plugins/mason.lua
Normal file
18
config/nvim/lua/aleidk/plugins/mason.lua
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
return {
|
||||
"williamboman/mason.nvim",
|
||||
cmd = "Mason",
|
||||
keys = { { "<leader>um", "<cmd>Mason<cr>", desc = "Mason" } },
|
||||
build = ":MasonUpdate",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"blue",
|
||||
"ruff",
|
||||
"eslint_d",
|
||||
"markdownlint",
|
||||
"nimlsp",
|
||||
"prettierd",
|
||||
"shellcheck",
|
||||
"stylua",
|
||||
},
|
||||
},
|
||||
}
|
||||
123
config/nvim/lua/aleidk/plugins/noice.lua
Normal file
123
config/nvim/lua/aleidk/plugins/noice.lua
Normal file
|
|
@ -0,0 +1,123 @@
|
|||
return {
|
||||
"folke/noice.nvim",
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
-- if you lazy-load any plugin below, make sure to add proper `module="..."` entries
|
||||
"MunifTanjim/nui.nvim",
|
||||
},
|
||||
opts = {
|
||||
presets = {
|
||||
bottom_search = true,
|
||||
-- command_palette = true,
|
||||
long_message_to_split = true,
|
||||
inc_rename = true,
|
||||
},
|
||||
lsp = {
|
||||
override = {
|
||||
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
|
||||
["vim.lsp.util.stylize_markdown"] = true,
|
||||
["cmp.entry.get_documentation"] = true,
|
||||
},
|
||||
},
|
||||
routes = {
|
||||
{
|
||||
filter = {
|
||||
event = "msg_show",
|
||||
any = {
|
||||
{ find = "%d+L, %d+B" },
|
||||
{ find = "; after #%d+" },
|
||||
{ find = "; before #%d+" },
|
||||
},
|
||||
},
|
||||
view = "mini",
|
||||
},
|
||||
{
|
||||
filter = {
|
||||
event = "msg_show",
|
||||
kind = "search_count",
|
||||
},
|
||||
opts = { skip = true },
|
||||
},
|
||||
},
|
||||
views = {
|
||||
cmdline_popup = {
|
||||
position = {
|
||||
row = 5,
|
||||
col = "50%",
|
||||
},
|
||||
size = {
|
||||
width = 60,
|
||||
height = "auto",
|
||||
},
|
||||
},
|
||||
popupmenu = {
|
||||
relative = "editor",
|
||||
position = {
|
||||
row = 8,
|
||||
col = "50%",
|
||||
},
|
||||
size = {
|
||||
width = 60,
|
||||
height = 10,
|
||||
},
|
||||
border = {
|
||||
style = "rounded",
|
||||
padding = { 0, 1 },
|
||||
},
|
||||
win_options = {
|
||||
winhighlight = { Normal = "Normal", FloatBorder = "DiagnosticInfo" },
|
||||
},
|
||||
},
|
||||
notify = {
|
||||
enabled = false,
|
||||
},
|
||||
messages = {
|
||||
enabled = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{
|
||||
"<S-Enter>",
|
||||
function() require("noice").redirect(vim.fn.getcmdline()) end,
|
||||
mode = "c",
|
||||
desc =
|
||||
"Redirect Cmdline"
|
||||
},
|
||||
{
|
||||
"<leader>unl",
|
||||
function() require("noice").cmd("last") end,
|
||||
desc =
|
||||
"Noice Last Message"
|
||||
},
|
||||
{
|
||||
"<leader>unh",
|
||||
function() require("noice").cmd("history") end,
|
||||
desc =
|
||||
"Noice History"
|
||||
},
|
||||
{ "<leader>una", function() require("noice").cmd("all") end, desc = "Noice All" },
|
||||
{ "<leader>und", function() require("noice").cmd("dismiss") end, desc = "Dismiss All" },
|
||||
{
|
||||
"<c-f>",
|
||||
function() if not require("noice.lsp").scroll(4) then return "<c-f>" end end,
|
||||
silent = true,
|
||||
expr = true,
|
||||
desc =
|
||||
"Scroll forward",
|
||||
mode = {
|
||||
"i", "n", "s" }
|
||||
},
|
||||
{
|
||||
"<c-b>",
|
||||
function() if not require("noice.lsp").scroll(-4) then return "<c-b>" end end,
|
||||
silent = true,
|
||||
expr = true,
|
||||
desc =
|
||||
"Scroll backward",
|
||||
mode = {
|
||||
"i", "n", "s" }
|
||||
},
|
||||
},
|
||||
}
|
||||
43
config/nvim/lua/aleidk/plugins/pretty-fold.lua
Normal file
43
config/nvim/lua/aleidk/plugins/pretty-fold.lua
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
return {
|
||||
enabled = false,
|
||||
"anuvyklack/pretty-fold.nvim",
|
||||
opts = {
|
||||
sections = {
|
||||
left = {
|
||||
"+",
|
||||
function()
|
||||
return string.rep("-", vim.v.foldlevel)
|
||||
end,
|
||||
" ",
|
||||
"content",
|
||||
" ",
|
||||
"number_of_folded_lines",
|
||||
" ",
|
||||
function()
|
||||
return string.rep("-", vim.v.foldlevel)
|
||||
end,
|
||||
"+",
|
||||
},
|
||||
},
|
||||
fill_char = " ",
|
||||
|
||||
-- Possible values:
|
||||
-- "delete" : Delete all comment signs from the fold string.
|
||||
-- "spaces" : Replace all comment signs with equal number of spaces.
|
||||
-- false : Do nothing with comment signs.
|
||||
process_comment_signs = "delete",
|
||||
|
||||
-- List of patterns that will be removed from content foldtext section.
|
||||
stop_words = {
|
||||
"@brief%s*", -- (for C++) Remove '@brief' and all spaces after.
|
||||
},
|
||||
|
||||
matchup_patterns = {
|
||||
{ "{", "}" },
|
||||
{ "%(", ")" }, -- % to escape lua pattern char
|
||||
{ "%[", "]" }, -- % to escape lua pattern char
|
||||
},
|
||||
|
||||
ft_ignore = { "neorg" },
|
||||
},
|
||||
}
|
||||
89
config/nvim/lua/aleidk/plugins/quickfix.lua
Normal file
89
config/nvim/lua/aleidk/plugins/quickfix.lua
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
return {
|
||||
{
|
||||
"kevinhwang91/nvim-bqf",
|
||||
event = "VeryLazy",
|
||||
dependencies = {},
|
||||
config = function()
|
||||
local fn = vim.fn
|
||||
|
||||
function _G.qftf(info)
|
||||
local items
|
||||
local ret = {}
|
||||
-- The name of item in list is based on the directory of quickfix window.
|
||||
-- Change the directory for quickfix window make the name of item shorter.
|
||||
-- It's a good opportunity to change current directory in quickfixtextfunc :)
|
||||
--
|
||||
-- local alterBufnr = fn.bufname('#') -- alternative buffer is the buffer before enter qf window
|
||||
-- local root = getRootByAlterBufnr(alterBufnr)
|
||||
-- vim.cmd(('noa lcd %s'):format(fn.fnameescape(root)))
|
||||
--
|
||||
if info.quickfix == 1 then
|
||||
items = fn.getqflist({ id = info.id, items = 0 }).items
|
||||
else
|
||||
items = fn.getloclist(info.winid, { id = info.id, items = 0 }).items
|
||||
end
|
||||
local limit = 31
|
||||
local fnameFmt1, fnameFmt2 = "%-" .. limit .. "s", "…%." .. (limit - 1) .. "s"
|
||||
local validFmt = "%s │%5d:%-3d│%s %s"
|
||||
for i = info.start_idx, info.end_idx do
|
||||
local e = items[i]
|
||||
local fname = ""
|
||||
local str
|
||||
if e.valid == 1 then
|
||||
if e.bufnr > 0 then
|
||||
fname = fn.bufname(e.bufnr)
|
||||
if fname == "" then
|
||||
fname = "[No Name]"
|
||||
else
|
||||
fname = fname:gsub("^" .. vim.env.HOME, "~")
|
||||
end
|
||||
-- char in fname may occur more than 1 width, ignore this issue in order to keep performance
|
||||
if #fname <= limit then
|
||||
fname = fnameFmt1:format(fname)
|
||||
else
|
||||
fname = fnameFmt2:format(fname:sub(1 - limit))
|
||||
end
|
||||
end
|
||||
local lnum = e.lnum > 99999 and -1 or e.lnum
|
||||
local col = e.col > 999 and -1 or e.col
|
||||
local qtype = e.type == "" and "" or " " .. e.type:sub(1, 1):upper()
|
||||
str = validFmt:format(fname, lnum, col, qtype, e.text)
|
||||
else
|
||||
str = e.text
|
||||
end
|
||||
table.insert(ret, str)
|
||||
end
|
||||
return ret
|
||||
end
|
||||
|
||||
vim.o.qftf = "{info -> v:lua._G.qftf(info)}"
|
||||
|
||||
-- Adapt fzf's delimiter in nvim-bqf
|
||||
require("bqf").setup({
|
||||
filter = {
|
||||
fzf = {
|
||||
extra_opts = { "--bind", "ctrl-o:toggle-all", "--delimiter", "│" },
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
local toggle_qf = function()
|
||||
local qf_open = false
|
||||
for _, win in pairs(vim.fn.getwininfo()) do
|
||||
if win["quickfix"] == 1 then
|
||||
qf_open = true
|
||||
end
|
||||
end
|
||||
if qf_open == true then
|
||||
vim.cmd("cclose")
|
||||
return
|
||||
end
|
||||
if not vim.tbl_isempty(vim.fn.getqflist()) then
|
||||
vim.cmd("copen")
|
||||
end
|
||||
end
|
||||
|
||||
MAP("n", "<Leader>fQ", toggle_qf, "Toggle quickfix")
|
||||
end,
|
||||
},
|
||||
}
|
||||
8
config/nvim/lua/aleidk/plugins/remote-sshfs.lua
Normal file
8
config/nvim/lua/aleidk/plugins/remote-sshfs.lua
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
return {
|
||||
"nosduco/remote-sshfs.nvim",
|
||||
dependencies = { "nvim-telescope/telescope.nvim" },
|
||||
config = function()
|
||||
require("remote-sshfs").setup({})
|
||||
require("telescope").load_extension("remote-sshfs")
|
||||
end,
|
||||
}
|
||||
23
config/nvim/lua/aleidk/plugins/sessions.lua
Normal file
23
config/nvim/lua/aleidk/plugins/sessions.lua
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
return {
|
||||
-- sessions
|
||||
"rmagatti/auto-session",
|
||||
config = function()
|
||||
---@diagnostic disable-next-line: missing-fields
|
||||
require("auto-session").setup({
|
||||
log_level = "error",
|
||||
auto_session_suppress_dirs = {
|
||||
"/",
|
||||
"~/",
|
||||
"~/.config/**",
|
||||
"~/.local/share/chezmoi/",
|
||||
"~/.local/share/db_ui",
|
||||
"~/.local/share/db_ui/**",
|
||||
"~/Downloads",
|
||||
},
|
||||
bypass_session_save_file_types = {
|
||||
"NeogitStatus",
|
||||
"Lazy",
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
65
config/nvim/lua/aleidk/plugins/smart-splits.lua
Normal file
65
config/nvim/lua/aleidk/plugins/smart-splits.lua
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
-- Move to windows with Ctrl and hjkl
|
||||
-- Resize to windows with Alt and hjkl
|
||||
-- Tmux aware
|
||||
return {
|
||||
"mrjones2014/smart-splits.nvim",
|
||||
opts = { ignored_filetypes = { "nofile", "quickfix", "qf", "prompt" }, ignored_buftypes = { "nofile" } },
|
||||
keys = {
|
||||
{
|
||||
"<C-h>",
|
||||
function()
|
||||
require("smart-splits").move_cursor_left()
|
||||
end,
|
||||
desc = "Move to left window",
|
||||
},
|
||||
{
|
||||
"<C-j>",
|
||||
function()
|
||||
require("smart-splits").move_cursor_down()
|
||||
end,
|
||||
desc = "Move to bottom window",
|
||||
},
|
||||
{
|
||||
"<C-k>",
|
||||
function()
|
||||
require("smart-splits").move_cursor_up()
|
||||
end,
|
||||
desc = "Move to upper window",
|
||||
},
|
||||
{
|
||||
"<C-l>",
|
||||
function()
|
||||
require("smart-splits").move_cursor_right()
|
||||
end,
|
||||
desc = "Move to right window",
|
||||
},
|
||||
{
|
||||
"<A-h>",
|
||||
function()
|
||||
require("smart-splits").resize_left()
|
||||
end,
|
||||
desc = "Move to left window",
|
||||
},
|
||||
{
|
||||
"<A-j>",
|
||||
function()
|
||||
require("smart-splits").resize_down()
|
||||
end,
|
||||
desc = "Move to bottom window",
|
||||
},
|
||||
{
|
||||
"<A-k>",
|
||||
function()
|
||||
require("smart-splits").resize_up()
|
||||
end,
|
||||
desc = "Move to upper window",
|
||||
},
|
||||
{
|
||||
"<A-l>",
|
||||
function()
|
||||
require("smart-splits").resize_right()
|
||||
end,
|
||||
desc = "Move to right window",
|
||||
},
|
||||
},
|
||||
}
|
||||
6
config/nvim/lua/aleidk/plugins/surround.lua
Normal file
6
config/nvim/lua/aleidk/plugins/surround.lua
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
return {
|
||||
"echasnovski/mini.surround",
|
||||
disabled = true,
|
||||
version = "*",
|
||||
opts = {},
|
||||
}
|
||||
145
config/nvim/lua/aleidk/plugins/task-runner.lua
Normal file
145
config/nvim/lua/aleidk/plugins/task-runner.lua
Normal file
|
|
@ -0,0 +1,145 @@
|
|||
local function term_get_effective_line_count(bufnr)
|
||||
local linecount = vim.api.nvim_buf_line_count(bufnr)
|
||||
|
||||
local non_blank_lines = linecount
|
||||
for i = linecount, 1, -1 do
|
||||
local line = vim.api.nvim_buf_get_lines(bufnr, i - 1, i, true)[1]
|
||||
non_blank_lines = i
|
||||
if line ~= "" then
|
||||
break
|
||||
end
|
||||
end
|
||||
return non_blank_lines
|
||||
end
|
||||
|
||||
-- This is a copy of the original util function of overseer with the change that
|
||||
-- vim.api.nvim_win_set_cursor(winid, { lnum, 0 }) column is set to 0 so the output is visible
|
||||
-- the rest is the same
|
||||
local scroll_to_end = function(winid)
|
||||
winid = winid or 0
|
||||
local bufnr = vim.api.nvim_win_get_buf(winid)
|
||||
local lnum = vim.api.nvim_buf_line_count(bufnr)
|
||||
local last_line = vim.api.nvim_buf_get_lines(bufnr, -2, -1, true)[1]
|
||||
-- Hack: terminal buffers add a bunch of empty lines at the end. We need to ignore them so that
|
||||
-- we don't end up scrolling off the end of the useful output.
|
||||
local not_much_output = lnum < vim.o.lines + 6
|
||||
if vim.bo[bufnr].buftype == "terminal" and not_much_output then
|
||||
lnum = term_get_effective_line_count(bufnr)
|
||||
last_line = vim.api.nvim_buf_get_lines(bufnr, lnum - 1, lnum, true)[1]
|
||||
end
|
||||
local scrolloff = vim.api.nvim_get_option_value("scrolloff", { scope = "local", win = winid })
|
||||
vim.api.nvim_set_option_value("scrolloff", 0, { scope = "local", win = winid })
|
||||
vim.api.nvim_win_set_cursor(winid, { lnum, 0 })
|
||||
vim.api.nvim_set_option_value("scrolloff", scrolloff, { scope = "local", win = winid })
|
||||
end
|
||||
|
||||
local open_split = function(task, horizontal)
|
||||
local original_window = vim.api.nvim_get_current_win()
|
||||
if horizontal then
|
||||
-- horizontal split across all vertical splits
|
||||
vim.cmd([[botright split]])
|
||||
else
|
||||
-- vertical split across all horizontal splits
|
||||
vim.cmd([[vert botright split]])
|
||||
end
|
||||
|
||||
-- Update tasks buffer options
|
||||
vim.api.nvim_win_set_buf(0, task:get_bufnr())
|
||||
vim.api.nvim_set_option_value("number", false, { scope = "local", win = 0 })
|
||||
vim.api.nvim_set_option_value("relativenumber", false, { scope = "local", win = 0 })
|
||||
vim.api.nvim_set_option_value("signcolumn", "no", { scope = "local", win = 0 })
|
||||
scroll_to_end(0)
|
||||
|
||||
-- Go back to the original window
|
||||
vim.api.nvim_set_current_win(original_window)
|
||||
end
|
||||
|
||||
return {
|
||||
"stevearc/overseer.nvim",
|
||||
keys = {
|
||||
{ "<leader>pO", "<CMD>OverseerQuickAction hsplit<CR>", desc = "Open task in a hsplit" },
|
||||
{
|
||||
"<leader>pQ",
|
||||
"<CMD>OverseerQuickAction close win<CR><CMD>OverseerQuickAction dispose<CR>",
|
||||
desc = "Close and dispose task's windows",
|
||||
},
|
||||
{ "<leader>pW", "<CMD>OverseerQuickAction unwatch<CR>", desc = "Unwatch task" },
|
||||
{ "<leader>pf", "<CMD>OverseerQuickAction open float<CR>", desc = "Open task in a float window" },
|
||||
{ "<leader>pl", "<CMD>OverseerLoadBundle<CR>", desc = "Load tasks" },
|
||||
{ "<leader>pm", "<CMD>OverseerTaskAction<CR>", desc = "Manage task" },
|
||||
{ "<leader>po", "<CMD>OverseerQuickAction vsplit<CR>", desc = "Open task in a vsplit" },
|
||||
{ "<leader>pp", "<CMD>OverseerRun<CR>", desc = "Run task" },
|
||||
{ "<leader>pq", "<CMD>OverseerQuickAction close win<CR>", desc = "Close task's windows" },
|
||||
{ "<leader>ps", "<CMD>OverseerSaveBundle<CR>", desc = "Save tasks" },
|
||||
{ "<leader>pt", "<CMD>OverseerToggle<CR>", desc = "Toggle tasks list" },
|
||||
{ "<leader>pw", "<CMD>OverseerQuickAction watch<CR>", desc = "Watch task" },
|
||||
},
|
||||
opts = {
|
||||
actions = {
|
||||
["hsplit"] = {
|
||||
desc = "open terminal in a horizontal split",
|
||||
condition = function(task)
|
||||
local bufnr = task:get_bufnr()
|
||||
return bufnr and vim.api.nvim_buf_is_valid(bufnr)
|
||||
end,
|
||||
run = function(task)
|
||||
open_split(task, true)
|
||||
end,
|
||||
},
|
||||
["vsplit"] = {
|
||||
desc = "open terminal in a vertical split",
|
||||
condition = function(task)
|
||||
local bufnr = task:get_bufnr()
|
||||
return bufnr and vim.api.nvim_buf_is_valid(bufnr)
|
||||
end,
|
||||
run = function(task)
|
||||
open_split(task, false)
|
||||
end,
|
||||
},
|
||||
["close win"] = {
|
||||
desc = "open terminal in a vertical split",
|
||||
condition = function(task)
|
||||
local bufnr = task:get_bufnr()
|
||||
return bufnr and vim.api.nvim_buf_is_valid(bufnr)
|
||||
end,
|
||||
run = function(task)
|
||||
local buf = task:get_bufnr()
|
||||
-- iterar sobre todas las windows y ver si la window tiene attach el buf que quiero cerrar
|
||||
for _, win in ipairs(vim.api.nvim_list_wins()) do
|
||||
if buf == vim.api.nvim_win_get_buf(win) then
|
||||
vim.api.nvim_win_close(win, false)
|
||||
end
|
||||
end
|
||||
end,
|
||||
},
|
||||
},
|
||||
task_list = {
|
||||
direction = "bottom",
|
||||
bindings = {
|
||||
["?"] = "ShowHelp",
|
||||
["g?"] = "ShowHelp",
|
||||
["<CR>"] = "RunAction",
|
||||
["<C-e>"] = "Edit",
|
||||
["o"] = "Open",
|
||||
["<C-v>"] = "OpenVsplit",
|
||||
["<C-s>"] = "OpenSplit",
|
||||
["<C-f>"] = "OpenFloat",
|
||||
["<C-q>"] = "OpenQuickFix",
|
||||
["<TAB>"] = "TogglePreview",
|
||||
["p"] = "TogglePreview",
|
||||
["<C-l>"] = "IncreaseAllDetail",
|
||||
["<C-h>"] = "DecreaseAllDetail",
|
||||
["L"] = "IncreaseDetail",
|
||||
["H"] = "DecreaseDetail",
|
||||
["["] = "DecreaseWidth",
|
||||
["]"] = "IncreaseWidth",
|
||||
["{"] = "PrevTask",
|
||||
["}"] = "NextTask",
|
||||
["<C-u>"] = "ScrollOutputUp",
|
||||
["<C-d>"] = "ScrollOutputDown",
|
||||
["q"] = "Close",
|
||||
["d"] = "<CMD>OverseerQuickAction dispose<CR>",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
90
config/nvim/lua/aleidk/plugins/telescope.lua
Normal file
90
config/nvim/lua/aleidk/plugins/telescope.lua
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
-- Fuzzy Finder (files, lsp, etc)
|
||||
return {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
version = "*",
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
{ "nvim-lua/plenary.nvim" },
|
||||
{
|
||||
-- Blazingly Fast Fuzzy Finder Algorithm for Telescope
|
||||
"nvim-telescope/telescope-fzf-native.nvim",
|
||||
build = "make",
|
||||
cond = function()
|
||||
return vim.fn.executable("make") == 1
|
||||
end,
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
local actions = require("telescope.actions")
|
||||
local telescope = require("telescope")
|
||||
local builtin = require("telescope.builtin")
|
||||
|
||||
local opts = {
|
||||
defaults = {
|
||||
prompt_prefix = " ",
|
||||
selection_caret = " ",
|
||||
layout_strategy = "vertical",
|
||||
layout_config = { vertical = { height = 0.99, mirror = true, prompt_position = "top" } },
|
||||
mappings = {
|
||||
i = {
|
||||
["<c-u>"] = actions.preview_scrolling_up,
|
||||
["<c-d>"] = actions.preview_scrolling_down,
|
||||
["<C-j>"] = actions.move_selection_next,
|
||||
["<C-k>"] = actions.move_selection_previous,
|
||||
["<C-s>"] = actions.file_vsplit,
|
||||
["<C-v>"] = actions.file_split,
|
||||
["<ESC>"] = actions.close,
|
||||
["<C-q>"] = actions.send_to_qflist + actions.open_qflist,
|
||||
["<M-q>"] = actions.send_selected_to_qflist + actions.open_qflist,
|
||||
["<c-t>"] = function(...)
|
||||
return require("trouble.providers.telescope").open_with_trouble(...)
|
||||
end,
|
||||
["<a-t>"] = function(...)
|
||||
return require("trouble.providers.telescope").open_selected_with_trouble(...)
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
telescope.setup(opts)
|
||||
|
||||
-- Enable telescope fzf native, if installed
|
||||
pcall(telescope.load_extension, "fzf")
|
||||
|
||||
-- Find files
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<leader>fe",
|
||||
":Telescope file_browser path=%:p:h select_buffer=true<CR>",
|
||||
{ desc = "File Explorer" }
|
||||
)
|
||||
vim.keymap.set("n", "<leader>fb", builtin.buffers, { desc = "Find buffers" })
|
||||
vim.keymap.set("n", "<leader>ff", builtin.find_files, { desc = "Find files" })
|
||||
vim.keymap.set("n", "<leader>fF", function()
|
||||
builtin.find_files({ hidden = true, no_ignore = true })
|
||||
end, { desc = "Find all files" })
|
||||
|
||||
-- Search inside files
|
||||
vim.keymap.set("n", "<leader>fw", builtin.grep_string, { desc = "Find word under cursor" })
|
||||
vim.keymap.set("n", "<leader>fW", builtin.live_grep, { desc = "Find word (live grep)" })
|
||||
|
||||
-- Help
|
||||
vim.keymap.set("n", "<leader>fc", builtin.command_history, { desc = "Find in commands history" })
|
||||
vim.keymap.set("n", "<leader>fC", builtin.commands, { desc = "Find a command" })
|
||||
vim.keymap.set("n", "<leader>fh", builtin.help_tags, { desc = "Find Help" })
|
||||
vim.keymap.set("n", "<leader>fk", builtin.keymaps, { desc = "Find Keymaps" })
|
||||
|
||||
-- Git
|
||||
vim.keymap.set("n", "<leader>gb", builtin.git_branches, { desc = "Change branch" })
|
||||
|
||||
-- Diagnosticos
|
||||
-- Disabled, handle by trouble
|
||||
-- vim.keymap.set("n", "<leader>fD", function()
|
||||
-- builtin.diagnostics({ bufnr = 0 })
|
||||
-- end, { desc = "Find diagnostics (Telescope)" })
|
||||
-- vim.keymap.set("n", "<leader>fD", function()
|
||||
-- builtin.diagnostics({ bufnr = nil })
|
||||
-- end, { desc = "Find diagnostics in workspace (Telescope)" })
|
||||
-- vim.keymap.set("n", "<leader>fz", builtin.spell_suggest, { desc = "Find spell suggestion" })
|
||||
end,
|
||||
}
|
||||
13
config/nvim/lua/aleidk/plugins/todo-comments.lua
Normal file
13
config/nvim/lua/aleidk/plugins/todo-comments.lua
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
return {
|
||||
"folke/todo-comments.nvim",
|
||||
cmd = { "TodoTrouble", "TodoTelescope" },
|
||||
event = { "BufReadPost", "BufNewFile" },
|
||||
config = true,
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "]t", function() require("todo-comments").jump_next() end, desc = "Next todo comment" },
|
||||
{ "[t", function() require("todo-comments").jump_prev() end, desc = "Previous todo comment" },
|
||||
{ "<leader>ft", "<cmd>TodoTrouble<cr>", desc = "Find todos (Trouble)" },
|
||||
{ "<leader>fT", "<cmd>TodoTelescope<cr>", desc = "Find todos (Telescope)" },
|
||||
},
|
||||
}
|
||||
92
config/nvim/lua/aleidk/plugins/treesitter.lua
Normal file
92
config/nvim/lua/aleidk/plugins/treesitter.lua
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
return {
|
||||
-- Highlight, edit, and navigate code
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
event = { "BufReadPost", "BufNewFile", "BufWritePre", "VeryLazy" },
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||
"JoosepAlviste/nvim-ts-context-commentstring",
|
||||
"nvim-treesitter/nvim-treesitter-context",
|
||||
{ "windwp/nvim-ts-autotag", opts = {} },
|
||||
{ "nushell/tree-sitter-nu", build = ":TSUpdate nu" },
|
||||
},
|
||||
build = ":TSUpdate",
|
||||
config = function()
|
||||
---@diagnostic disable-next-line: missing-fields
|
||||
require("nvim-treesitter.configs").setup({
|
||||
-- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!)
|
||||
auto_install = true,
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
},
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim
|
||||
keymaps = {
|
||||
-- You can use the capture groups defined in textobjects.scm
|
||||
["aa"] = "@parameter.outer",
|
||||
["ia"] = "@parameter.inner",
|
||||
["af"] = "@function.outer",
|
||||
["if"] = "@function.inner",
|
||||
["ac"] = "@class.outer",
|
||||
["ic"] = "@class.inner",
|
||||
},
|
||||
},
|
||||
move = {
|
||||
enable = true,
|
||||
set_jumps = true, -- whether to set jumps in the jumplist
|
||||
goto_next_start = {
|
||||
["]m"] = "@function.outer",
|
||||
["]]"] = "@class.outer",
|
||||
},
|
||||
goto_next_end = {
|
||||
["]M"] = "@function.outer",
|
||||
["]["] = "@class.outer",
|
||||
},
|
||||
goto_previous_start = {
|
||||
["[m"] = "@function.outer",
|
||||
["[["] = "@class.outer",
|
||||
},
|
||||
goto_previous_end = {
|
||||
["[M"] = "@function.outer",
|
||||
["[]"] = "@class.outer",
|
||||
},
|
||||
},
|
||||
swap = {
|
||||
enable = true,
|
||||
swap_next = {
|
||||
["<leader>a"] = "@parameter.inner",
|
||||
},
|
||||
swap_previous = {
|
||||
["<leader>A"] = "@parameter.inner",
|
||||
},
|
||||
},
|
||||
},
|
||||
-- autotag = { enable = true },
|
||||
})
|
||||
|
||||
require('ts_context_commentstring').setup {
|
||||
enable_autocmd = false,
|
||||
}
|
||||
|
||||
vim.opt.foldmethod = "expr"
|
||||
vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
|
||||
|
||||
-- Uncoment this line to disable auto folding on file open
|
||||
vim.cmd("set nofoldenable")
|
||||
|
||||
-- TODO: remove this when blade treesitter is added to nvim-treesitter repo
|
||||
-- Also remove the "config/nvim/after/queries/blade" folder.
|
||||
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
|
||||
parser_config.blade = {
|
||||
install_info = {
|
||||
url = "https://github.com/EmranMR/tree-sitter-blade",
|
||||
files = { "src/parser.c" },
|
||||
branch = "main",
|
||||
},
|
||||
filetype = "blade",
|
||||
}
|
||||
end,
|
||||
}
|
||||
24
config/nvim/lua/aleidk/plugins/trouble.lua
Normal file
24
config/nvim/lua/aleidk/plugins/trouble.lua
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
return {
|
||||
"folke/trouble.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
cmd = { "TroubleToggle", "Trouble" },
|
||||
keys = {
|
||||
{ "<leader>fq", "<CMD>TroubleToggle<CR>", desc = "Toggle trouble" },
|
||||
{ "<leader>fd", "<CMD>TroubleToggle workspace_diagnostics<CR>", desc = "Find diagnostics" },
|
||||
{
|
||||
"<leader>fD",
|
||||
"<CMD>TroubleToggle document_diagnostics<CR>",
|
||||
desc = "Find diagnostics in workspace",
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
require("trouble").setup({
|
||||
mode = "document_diagnostics",
|
||||
action_keys = {
|
||||
open_split = "s",
|
||||
open_vsplit = "v",
|
||||
open_tab = "t",
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
23
config/nvim/lua/aleidk/plugins/ts-node-action.lua
Normal file
23
config/nvim/lua/aleidk/plugins/ts-node-action.lua
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
return {
|
||||
{
|
||||
"ckolkey/ts-node-action",
|
||||
dependencies = { "nvim-treesitter" },
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("ts-node-action").setup({})
|
||||
|
||||
vim.keymap.set({ "n" }, "<leader>lA", require("ts-node-action").node_action, { desc = "Node Action" })
|
||||
end,
|
||||
},
|
||||
{
|
||||
"Wansmer/treesj",
|
||||
cmd = { "TSJToggle" },
|
||||
keys = {
|
||||
{ "<leader>lm", "<CMD>TSJToggle<CR>", desc = "Toggle treesitter join" },
|
||||
},
|
||||
dependencies = { "nvim-treesitter/nvim-treesitter" },
|
||||
opts = {
|
||||
use_default_keymaps = true,
|
||||
},
|
||||
},
|
||||
}
|
||||
81
config/nvim/lua/aleidk/plugins/zen.lua
Normal file
81
config/nvim/lua/aleidk/plugins/zen.lua
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
return {
|
||||
"folke/zen-mode.nvim",
|
||||
dependencies = {
|
||||
{
|
||||
"folke/twilight.nvim",
|
||||
opts = {
|
||||
-- your configuration comes here
|
||||
-- or leave it empty to use the default settings
|
||||
-- refer to the configuration section below
|
||||
},
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
"<leader>uz",
|
||||
function()
|
||||
require("zen-mode").toggle({})
|
||||
end,
|
||||
desc = "Toggle zen mode",
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
window = {
|
||||
backdrop = 0.95, -- shade the backdrop of the Zen window. Set to 1 to keep the same as Normal
|
||||
-- height and width can be:
|
||||
-- * an absolute number of cells when > 1
|
||||
-- * a percentage of the width / height of the editor when <= 1
|
||||
-- * a function that returns the width or the height
|
||||
width = 0.8, -- width of the Zen window
|
||||
height = 1, -- height of the Zen window
|
||||
-- by default, no options are changed for the Zen window
|
||||
-- uncomment any of the options below, or add other vim.wo options you want to apply
|
||||
options = {
|
||||
-- signcolumn = "no", -- disable signcolumn
|
||||
-- number = false, -- disable number column
|
||||
-- relativenumber = false, -- disable relative numbers
|
||||
cursorline = false, -- disable cursorline
|
||||
-- cursorcolumn = false, -- disable cursor column
|
||||
-- foldcolumn = "0", -- disable fold column
|
||||
list = false, -- disable whitespace characters
|
||||
},
|
||||
},
|
||||
plugins = {
|
||||
-- disable some global vim options (vim.o...)
|
||||
-- comment the lines to not apply the options
|
||||
options = {
|
||||
enabled = true,
|
||||
ruler = true, -- disables the ruler text in the cmd line area
|
||||
showcmd = false, -- disables the command in the last line of the screen
|
||||
-- you may turn on/off statusline in zen mode by setting 'laststatus'
|
||||
-- statusline will be shown only if 'laststatus' == 3
|
||||
laststatus = 0, -- turn off the statusline in zen mode
|
||||
},
|
||||
twilight = { enabled = true }, -- enable to start Twilight when zen mode opens
|
||||
gitsigns = { enabled = false }, -- disables git signs
|
||||
tmux = { enabled = true }, -- disables the tmux statusline
|
||||
-- this will change the font size on kitty when in zen mode
|
||||
-- to make this work, you need to set the following kitty options:
|
||||
-- - allow_remote_control socket-only
|
||||
-- - listen_on unix:/tmp/kitty
|
||||
kitty = {
|
||||
enabled = true,
|
||||
font = "+8", -- font size increment
|
||||
},
|
||||
-- this will change the font size on alacritty when in zen mode
|
||||
-- requires Alacritty Version 0.10.0 or higher
|
||||
-- uses `alacritty msg` subcommand to change font size
|
||||
alacritty = {
|
||||
enabled = true,
|
||||
font = "14", -- font size
|
||||
},
|
||||
-- this will change the font size on wezterm when in zen mode
|
||||
-- See else also the Plugins/Wezterm section in this projects README
|
||||
wezterm = {
|
||||
enabled = true,
|
||||
-- can be either an absolute font size or the number of incremental steps
|
||||
font = "+4", -- (10% increase per step)
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue