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

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
*.log

16
README.md Normal file
View File

@@ -0,0 +1,16 @@
# README
## Deps
- [Emmet language server](https://github.com/olrtg/emmet-language-server)
### Language servers
This list is arbitrary and will depend on the current state of the lsp folder:
- `# pacman -S lua-language-server bash-language-server typescript-language-server vscode-html-language-server vscode-css-language-server pyright-langserver gopls astro-ls jdtls rust-analyzer solargraph vue-language-server vscode-json-languageserver`
- `# npm i -g emmet-language-server emmet-ls`
## Relevant docs
- [LSP config](https://lsp-zero.netlify.app/blog/lsp-config-overview.html): the new nvim integration with LSP makes it unnecessary to rely on third party tools like `lsp-config` or `lsp-zero`.

66
init.lua Normal file
View File

@@ -0,0 +1,66 @@
-- ╭──────╮
-- │ Init │
-- ╰──────╯
vim.g.loaded_netrwPlugin = 0
vim.g.loaded_netrw = 0
vim.cmd("set termguicolors")
require("config")
-- ╭─────────╮
-- │ Generic │
-- ╰─────────╯
vim.cmd("set rnu")
vim.cmd("set textwidth=0")
vim.cmd("set wrapmargin=0")
vim.cmd("set linebreak")
-- vim.cmd("set colorcolumn=85")
vim.cmd("set conceallevel=0") -- DONT hide characters in MD
vim.cmd("set tabstop=4")
vim.cmd("set shiftwidth=4")
vim.cmd("set expandtab")
vim.cmd("set wrap")
vim.lsp.inlay_hint.enable(false)
-- ╭─────────────╮
-- │ Colorscheme │
-- ╰─────────────╯
vim.cmd("colorscheme rose-pine")
-- ╭───────────────────╮
-- │ Default clipboard │
-- ╰───────────────────╯
vim.cmd("set clipboard=unnamedplus")
-- ╭───────╮
-- │ Chars │
-- ╰───────╯
vim.opt.fillchars = {
horiz = "",
vert = "",
stl = " ",
eob = " ",
}
vim.opt.listchars = {
tab = "> ",
trail = " ",
nbsp = "+",
}
-- ╭─────╮
-- │ LSP │
-- ╰─────╯
vim.lsp.enable('astro')
vim.lsp.enable('bashls')
vim.lsp.enable('clangd')
vim.lsp.enable('cssls')
vim.lsp.enable('emmet')
vim.lsp.enable('gopls')
vim.lsp.enable('html')
vim.lsp.enable('jdtls')
vim.lsp.enable('luals')
vim.lsp.enable('pyright')
vim.lsp.enable('rust_analyzer')
vim.lsp.enable('solargraph')
vim.lsp.enable('tsserver')
vim.lsp.enable('volar')
vim.lsp.enable('json')

44
lazy-lock.json Normal file
View File

@@ -0,0 +1,44 @@
{
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
"LuaSnip": { "branch": "master", "commit": "faf3c94a44508cec1b961406d36cc65113ff3b98" },
"aerial.nvim": { "branch": "master", "commit": "2e00d1d4248f08dddfceacb8d2996e51e13e00f6" },
"auto-session": { "branch": "main", "commit": "00334ee24b9a05001ad50221c8daffbeedaa0842" },
"autoclose.nvim": { "branch": "main", "commit": "b2077aa2c83df7ebc19b2a20a3a0654b24ae9c8f" },
"blueprints": { "branch": "main", "commit": "e5825c30464f98e77e8b5ffb88d59fd98df6c802" },
"bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
"cmp-cmdline": { "branch": "main", "commit": "d126061b624e0af6c3a556428712dd4d4194ec6d" },
"cmp-emoji": { "branch": "main", "commit": "e8398e2adf512a03bb4e1728ca017ffeac670a9f" },
"cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" },
"cmp-path": { "branch": "main", "commit": "c6635aae33a50d6010bf1aa756ac2398a2d54c32" },
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
"conform.nvim": { "branch": "master", "commit": "6feb2f28f9a9385e401857b21eeac3c1b66dd628" },
"diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" },
"flash.nvim": { "branch": "main", "commit": "3c942666f115e2811e959eabbdd361a025db8b63" },
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
"gitsigns.nvim": { "branch": "main", "commit": "8bdaccdb897945a3c99c1ad8df94db0ddf5c8790" },
"indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" },
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
"lualine.nvim": { "branch": "master", "commit": "0c6cca9f2c63dadeb9225c45bc92bb95a151d4af" },
"neo-tree.nvim": { "branch": "main", "commit": "3f1dd2de5045659e00bfbe27c8aca3b52c1fdbde" },
"no-neck-pain.nvim": { "branch": "main", "commit": "c824c54d837160ac32d0f877574ccfa2ecce9947" },
"noice.nvim": { "branch": "main", "commit": "0427460c2d7f673ad60eb02b35f5e9926cf67c59" },
"nui.nvim": { "branch": "main", "commit": "7cd18e73cfbd70e1546931b7268b3eebaeff9391" },
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
"nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" },
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
"nvim-treesitter-context": { "branch": "master", "commit": "ed1cf48d5af252248c55f50b9427e8ce883a2c6b" },
"nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" },
"nvim-web-devicons": { "branch": "master", "commit": "1fb58cca9aebbc4fd32b086cb413548ce132c127" },
"nvim-window-picker": { "branch": "main", "commit": "6382540b2ae5de6c793d4aa2e3fe6dbb518505ec" },
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
"scope.nvim": { "branch": "main", "commit": "6b4208f017da9b122d69ddc5841e040dffe7313c" },
"smear-cursor.nvim": { "branch": "main", "commit": "162703638203060b1d3412e73429d232bbd2627e" },
"snacks.nvim": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" },
"telescope-git-file-history.nvim": { "branch": "master", "commit": "e7d495319f2a04df96402057a6992ea970f8914d" },
"telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" },
"trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" },
"vim-fugitive": { "branch": "master", "commit": "4a745ea72fa93bb15dd077109afbb3d1809383f2" },
"which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }
}

5
lsp/astro.lua Normal file
View File

@@ -0,0 +1,5 @@
return {
cmd = { 'astro-ls', '--stdio' },
filetypes = { 'astro' },
root_markers = { '.git', 'astro.config.mjs', 'astro.config.js', 'astro.config.ts' },
}

5
lsp/bashls.lua Normal file
View File

@@ -0,0 +1,5 @@
return {
cmd = { 'bash-language-server', 'start' },
filetypes = { 'sh', 'bash' },
root_markers = { '.bashrc', '.bash_profile', '.profile' },
}

5
lsp/clangd.lua Normal file
View File

@@ -0,0 +1,5 @@
return {
cmd = { 'clangd' },
filetypes = { 'c', 'cpp', 'objc', 'objcpp' },
root_markers = { 'compile_commands.json', '.git', 'compile_flags.txt' },
}

5
lsp/cssls.lua Normal file
View File

@@ -0,0 +1,5 @@
return {
cmd = { 'vscode-css-language-server', '--stdio' },
filetypes = { 'css', 'scss', 'sass' },
root_markers = { '.git' },
}

5
lsp/emmet.lua Normal file
View File

@@ -0,0 +1,5 @@
return {
cmd = { 'emmet-ls', '--stdio' },
filetypes = { 'html', 'css', 'scss', 'less' },
root_markers = { '.git' },
}

5
lsp/gopls.lua Normal file
View File

@@ -0,0 +1,5 @@
return {
cmd = { 'gopls' },
filetypes = { 'go', 'gomod', 'gowork', 'gotmpl' },
root_markers = { 'go.mod', '.git' },
}

5
lsp/html.lua Normal file
View File

@@ -0,0 +1,5 @@
return {
cmd = { 'vscode-html-language-server', '--stdio' },
filetypes = { 'html', 'htm', 'xhtml' },
root_markers = { '.git', 'index.html' },
}

5
lsp/jdtls.lua Normal file
View File

@@ -0,0 +1,5 @@
return {
cmd = { 'jdtls' },
filetypes = { 'java' },
root_markers = { 'pom.xml', 'build.gradle', '.git', 'mvnw', 'gradlew' },
}

4
lsp/jsonls.lua Normal file
View File

@@ -0,0 +1,4 @@
return {
cmd = { 'vscode-json-language-server', '--stdio' },
filetypes = { 'json', 'jsonc' },
}

5
lsp/luals.lua Normal file
View File

@@ -0,0 +1,5 @@
return {
cmd = { 'lua-language-server' },
filetypes = { 'lua' },
root_markers = { '.luarc.json', '.luarc.jsonc', 'init.lua' },
}

5
lsp/pyright.lua Normal file
View File

@@ -0,0 +1,5 @@
return {
cmd = { 'pyright-langserver', '--stdio' },
filetypes = { 'python' },
root_markers = { 'setup.py', 'setup.cfg', 'requirements.txt', '.git' },
}

5
lsp/rust_analyzer.lua Normal file
View File

@@ -0,0 +1,5 @@
return {
cmd = { 'rust-analyzer' },
filetypes = { 'rust' },
root_markers = { 'Cargo.toml', 'rust-project.json', '.git' },
}

5
lsp/solargraph.lua Normal file
View File

@@ -0,0 +1,5 @@
return {
cmd = { 'solargraph', 'stdio' },
filetypes = { 'ruby' },
root_markers = { 'Gemfile', '.git' },
}

5
lsp/tsserver.lua Normal file
View File

@@ -0,0 +1,5 @@
return {
cmd = { 'typescript-language-server', '--stdio' },
filetypes = { 'typescript', 'typescriptreact', 'typescript.tsx', 'javascript', 'javascriptreact', 'javascript.jsx', 'js', 'jsx', 'ts','tsx' },
root_markers = { 'package.json', 'tsconfig.json', 'jsconfig.json', '.git' },
}

5
lsp/volar.lua Normal file
View File

@@ -0,0 +1,5 @@
return {
cmd = { 'vue-language-server', '--stdio' },
filetypes = { 'vue' },
root_markers = { 'package.json', 'vue.config.js', 'vue.config.ts', '.git' },
}

11
lua/config/autocmds.lua Normal file
View File

@@ -0,0 +1,11 @@
vim.api.nvim_create_autocmd("ModeChanged", {
callback = function(opts)
require("lualine").refresh()
end,
})
vim.api.nvim_create_autocmd("CursorMoved", {
callback = function(opts)
require("lualine").refresh()
end,
})

3
lua/config/init.lua Normal file
View File

@@ -0,0 +1,3 @@
require("config.autocmds")
require("config.remap")
require("config.lazy")

35
lua/config/lazy.lua Normal file
View File

@@ -0,0 +1,35 @@
-- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
-- Make sure to setup `mapleader` and `maplocalleader` before
-- loading lazy.nvim so that mappings are correct.
-- This is also a good place to setup other settings (vim.opt)
vim.g.mapleader = " "
vim.g.maplocalleader = "\\"
-- Setup lazy.nvim
require("lazy").setup({
spec = {
-- import your plugins
{ import = "plugins" },
},
-- Configure any other settings here. See the documentation for more details.
-- colorscheme that will be used when installing plugins.
install = { colorscheme = { "habamax" } },
-- automatically check for plugin updates
checker = { enabled = true },
})

374
lua/config/remap.lua Normal file
View File

@@ -0,0 +1,374 @@
vim.g.mapleader = " "
local map = vim.keymap.set
---- Bufferline ----
map("n", "bg", "<CMD>BufferLinePick<CR>")
map("n", "<leader>bpx", "<CMD>BufferLinePickClose<CR>")
map("n", "<leader>box", "<CMD>BufferLineCloseOthers<CR>")
map("n", "<Tab>", "<CMD>BufferLineCycleNext<CR>")
map("n", "<S-Tab>", "<CMD>BufferLineCyclePrev<CR>")
map("n", "bsd", "<CMD>BufferLineSortByDirectory<CR>")
map("n", "bse", "<CMD>BufferLineSortByExtension<CR>")
map("n", "bsr", "<CMD>BufferLineSortByRelativeDirectory<CR>")
map("n", "bst", "<CMD>BufferLineSortByTabs<CR>")
-- buffers
map("n", "<S-h>", "<cmd>BufferLineMovePrev<cr>", { desc = "Move buffer to left" })
map("n", "<S-l>", "<cmd>BufferLineMoveNext<cr>", { desc = "Move buffer to right" })
map("n", "[b", "<cmd>bprevious<cr>", { desc = "Prev Buffer" })
map("n", "]b", "<cmd>bnext<cr>", { desc = "Next Buffer" })
map("n", "<leader>bd", function()
Snacks.bufdelete()
end, { desc = "Delete Buffer" })
map("n", "<leader>x", function()
Snacks.bufdelete()
end, { desc = "Delete Buffer" })
-- cant have C-w to delete buffer since in being used to navigate windows
-- map("n", "<C-w>", function()
-- Snacks.bufdelete()
-- end, { desc = "Go to Left Window", remap = true })
map("n", "<C-x>", function()
Snacks.bufdelete()
end, { desc = "Delete Buffer" })
map("n", "<leader>bD", "<cmd>:bd<cr>", { desc = "Delete Buffer and Window" })
-- tabpages
map("n", "]<Tab>", "<cmd>:+tabnext<cr>", { desc = "Goes to the next tabpage" })
map("n", "[<Tab>", "<cmd>:-tabnext<cr>", { desc = "Goes to the previous tabpage" })
map("n", "<leader>nt", "<cmd>:tabnew<cr>", { desc = "Create new tabpage" })
---------------------------------------------------------------------------
-- Treesitter context
map("n", "<leader>tc", "<cmd>TSContextToggle<CR>", { desc = "Toggle treesitter context" })
-- Regex search and replace
map("n", "<leader>fs", "<cmd>GrugFar<CR>", { desc = "Search all with replace option" })
-- Blueprints
map("n", "<leader>ct", "<cmd>lua require('blueprints').createFromTemplateTelescope()<CR>", { desc = "Nvim blueprints" })
---- Git ----
map("n", "<leader>gb", "<CMD>Gitsigns blame<CR>")
map("n", "<leader>gd", "<CMD>DiffviewOpen<CR>")
map("n", "<leader>gx", "<CMD>DiffviewClose<CR>")
map("n", "K", "<CMD>Gitsigns blame_line<CR>")
map("n", "<leader>gtb", "<CMD>Gitsigns toggle_current_line_blame<CR>")
map("n", "<leader>gtd", "<CMD>Gitsigns toggle_deleted")
map("n", "<leader>gc", "<cmd>Telescope git_commits <CR>", { desc = "Git commits" })
map("n", "<leader>gs", "<cmd>Telescope git_status <CR>", { desc = "Git status" })
-- lazygit
map("n", "<leader>gg", function()
Snacks.lazygit({ cwd = LazyVim.root.git() })
end, { desc = "Lazygit (Root Dir)" })
map("n", "<leader>gG", function()
Snacks.lazygit()
end, { desc = "Lazygit (cwd)" })
map("n", "<leader>gb", function()
Snacks.lazygit.blame_line()
end, { desc = "Git Blame Line" })
map("n", "<leader>gB", function()
Snacks.lazygit.browse()
end, { desc = "Git Browse" })
map("n", "<leader>gf", function()
local git_path = vim.api.nvim_buf_get_name(0)
Snacks.lazygit({ args = { "-f", vim.trim(git_path) } })
end, { desc = "Lazygit Current File History" })
map("n", "<leader>gl", function()
Snacks.lazygit({ args = { "log" }, cwd = LazyVim.root.git() })
end, { desc = "Lazygit Log" })
map("n", "<leader>gL", function()
Snacks.lazygit({ args = { "log" } })
end, { desc = "Lazygit Log (cwd)" })
---------------------------------------------------------------------------
-- Neotree
map("n", "<C-n>", "<cmd>Neotree toggle<cr>", { desc = "Toggle Neotree open" })
map("n", "<leader>e", "<cmd>Neotree focus<cr>", { desc = "Focus neotree" })
-- LSP
map("n", "gD", function()
vim.lsp.buf.declaration()
end, { desc = "LSP declaration" })
map("n", "gd", function()
vim.lsp.buf.definition()
end, { desc = "LSP definition" })
map("n", "gr", function()
vim.lsp.buf.references()
end, { desc = "LSP references" })
map("n", "K", function()
vim.lsp.buf.hover()
end, { desc = "LSP hover" })
map("n", "gi", function()
vim.lsp.buf.implementation()
end, { desc = "LSP implementation" })
map("n", "<leader>ls", function()
vim.lsp.buf.signature_help()
end, { desc = "LSP signature help" })
map("n", "<leader>lf", function()
vim.diagnostic.open_float({ border = "rounded" })
end, { desc = "Floating diagnostics" })
map("n", "<leader>D", function()
vim.lsp.buf.type_definition()
end, { desc = "LSP type definition" })
map("n", "<leader>ca", function()
vim.lsp.buf.code_action()
end, { desc = "LSP code actions" })
map("n", "[d", function()
vim.diagnostic.goto_prev({ float = { border = "rounded" } })
end, { desc = "Goto prev diagnostic" })
map("n", "]d", function()
vim.diagnostic.goto_next({ float = { border = "rounded" } })
end, { desc = "Goto next diagnostic" })
map("v", "<leader>ca", function()
vim.lsp.buf.code_action()
end, { desc = "LSP code action" })
map("n", "<leader>r", function()
-- when rename opens the prompt, this autocommand will trigger
-- it will "press" CTRL-F to enter the command-line window `:h cmdwin`
-- in this window I can use normal mode keybindings
local cmdId
cmdId = vim.api.nvim_create_autocmd({ "CmdlineEnter" }, {
callback = function()
local key = vim.api.nvim_replace_termcodes("<C-f>", true, false, true)
vim.api.nvim_feedkeys(key, "c", false)
vim.api.nvim_feedkeys("0", "n", false)
-- autocmd was triggered and so we can remove the ID and return true to delete the autocmd
cmdId = nil
return true
end,
})
vim.lsp.buf.rename()
-- if LPS couldn't trigger rename on the symbol, clear the autocmd
vim.defer_fn(function()
-- the cmdId is not nil only if the LSP failed to rename
if cmdId then
vim.api.nvim_del_autocmd(cmdId)
end
end, 500)
end, { desc = "Rename symbol" })
map("n", "<leader>wa", function()
vim.lsp.buf.add_workspace_folder()
end, { desc = "Add workspace folder" })
map("n", "<leader>wr", function()
vim.lsp.buf.remove_workspace_folder()
end, { desc = "Remove workspace folder" })
map("n", "<leader>wl", function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, { desc = "List workspace folders" })
---- Debugging with dap ----
map("n", "<Leader>cdt", ":DapToggleBreakpoint<CR>")
map("n", "<Leader>cdx", ":DapTerminate<CR>")
map("n", "<Leader>cdo", ":DapStepOver<CR>")
---- Completion ----
-- map({ "i", "s" }, "<Tab>", function()
-- if require("cmp").visible() then
-- require("nvim-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), "")
-- end
-- end, { desc = "Next completion item" })
---- Telescope find ----
map("n", "<leader>ff", "<cmd> Telescope find_files <CR>", { desc = "Find files" })
map("n", "<leader>fa", "<cmd> Telescope find_files follow=true no_ignore=true hidden=true <CR>", { desc = "Find all" })
map("n", "<leader>fw", "<cmd> Telescope live_grep <CR>", { desc = "Live grep" })
map("n", "<leader>fb", "<cmd> Telescope buffers <CR>", { desc = "Find buffers" })
map("n", "<leader><leader>", "<cmd> Telescope buffers <CR>", { desc = "Find buffers" })
map("n", "<leader>fh", "<cmd> Telescope help_tags <CR>", { desc = "Help page" })
map("n", "<leader>fo", "<cmd> Telescope oldfiles <CR>", { desc = "Fild old files" })
map("n", "<leader>fz", "<cmd> Telescope current_buffer_fuzzy_find <CR>", { desc = "Find in current buffer" })
-----------------------------------------------------------
-- better up/down
-- map({ "n", "x" }, "j", "v:count == 0 ? 'gj' : 'j'", { desc = "Down", expr = true, silent = true })
-- map({ "n", "x" }, "<Down>", "v:count == 0 ? 'gj' : 'j'", { desc = "Down", expr = true, silent = true })
-- map({ "n", "x" }, "k", "v:count == 0 ? 'gk' : 'k'", { desc = "Up", expr = true, silent = true })
-- map({ "n", "x" }, "<Up>", "v:count == 0 ? 'gk' : 'k'", { desc = "Up", expr = true, silent = true })
---- Movement ----
-- Move Lines
map("n", "<A-j>", "<cmd>m .+1<cr>==", { desc = "Move Down" })
map("n", "<A-k>", "<cmd>m .-2<cr>==", { desc = "Move Up" })
map("i", "<A-j>", "<esc><cmd>m .+1<cr>==gi", { desc = "Move Down" })
map("i", "<A-k>", "<esc><cmd>m .-2<cr>==gi", { desc = "Move Up" })
map("v", "<A-j>", ":m '>+1<cr>gv=gv", { desc = "Move Down" })
map("v", "<A-k>", ":m '<-2<cr>gv=gv", { desc = "Move Up" })
-- Clear search with <esc>
map({ "i", "n" }, "<esc>", "<cmd>noh<cr><esc>", { desc = "Escape and Clear hlsearch" })
-- Clear search, diff update and redraw
-- taken from runtime/lua/_editor.lua
map(
"n",
"<leader>ur",
"<Cmd>nohlsearch<Bar>diffupdate<Bar>normal! <C-L><CR>",
{ desc = "Redraw / Clear hlsearch / Diff Update" }
)
-- https://github.com/mhinz/vim-galore#saner-behavior-of-n-and-n
map("n", "n", "'Nn'[v:searchforward].'zv'", { expr = true, desc = "Next Search Result" })
map("x", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next Search Result" })
map("o", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next Search Result" })
map("n", "N", "'nN'[v:searchforward].'zv'", { expr = true, desc = "Prev Search Result" })
map("x", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev Search Result" })
map("o", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev Search Result" })
-----------------------------------------------------------
-- save file
map({ "i", "x", "n", "s" }, "<C-s>", "<cmd>w<cr><esc>", { desc = "Save File" })
-- better indenting
map("v", "<", "<gv")
map("v", ">", ">gv")
-- new file
map("n", "<leader>nf", "<cmd>enew<cr>", { desc = "New File" })
map("n", "<C-t>", "<cmd>enew<cr>", { desc = "New File" })
map("n", "[q", vim.cmd.cprev, { desc = "Previous Quickfix" })
map("n", "]q", vim.cmd.cnext, { desc = "Next Quickfix" })
---- Code ----
-- formatting
map({ "n", "v" }, "<leader>cf", function()
require("conform").format()
end, { desc = "Format" })
-- diagnostic
local diagnostic_goto = function(next, severity)
local go = next and vim.diagnostic.goto_next or vim.diagnostic.goto_prev
severity = severity and vim.diagnostic.severity[severity] or nil
return function()
go({ severity = severity })
end
end
map("n", "<leader>cd", vim.diagnostic.open_float, { desc = "Line Diagnostics" })
map("n", "]d", diagnostic_goto(true), { desc = "Next Diagnostic" })
map("n", "[d", diagnostic_goto(false), { desc = "Prev Diagnostic" })
map("n", "]e", diagnostic_goto(true, "ERROR"), { desc = "Next Error" })
map("n", "[e", diagnostic_goto(false, "ERROR"), { desc = "Prev Error" })
map("n", "]w", diagnostic_goto(true, "WARN"), { desc = "Next Warning" })
map("n", "[w", diagnostic_goto(false, "WARN"), { desc = "Prev Warning" })
---- Toggle options ----
map("n", "<leader>uf", function()
LazyVim.format.toggle()
end, { desc = "Toggle Auto Format (Global)" })
map("n", "<leader>uF", function()
LazyVim.format.toggle(true)
end, { desc = "Toggle Auto Format (Buffer)" })
map("n", "<leader>us", function()
LazyVim.toggle("spell")
end, { desc = "Toggle Spelling" })
map("n", "<leader>uw", function()
LazyVim.toggle("wrap")
end, { desc = "Toggle Word Wrap" })
map("n", "<leader>uL", function()
LazyVim.toggle("relativenumber")
end, { desc = "Toggle Relative Line Numbers" })
map("n", "<leader>ul", function()
LazyVim.toggle.number()
end, { desc = "Toggle Line Numbers" })
map("n", "<leader>ud", function()
LazyVim.toggle.diagnostics()
end, { desc = "Toggle Diagnostics" })
local conceallevel = vim.o.conceallevel > 0 and vim.o.conceallevel or 3
map("n", "<leader>uc", function()
LazyVim.toggle("conceallevel", false, { 0, conceallevel })
end, { desc = "Toggle Conceal" })
if vim.lsp.buf.inlay_hint or vim.lsp.inlay_hint then
map("n", "<leader>uh", function()
LazyVim.toggle.inlay_hints()
end, { desc = "Toggle Inlay Hints" })
end
map("n", "<leader>uT", function()
if vim.b.ts_highlight then
vim.treesitter.stop()
else
vim.treesitter.start()
end
end, { desc = "Toggle Treesitter Highlight" })
map("n", "<leader>ub", function()
LazyVim.toggle("background", false, { "light", "dark" })
end, { desc = "Toggle Background" })
-- aerial
map("n", "<leader>ua", "<cmd>AerialToggle<cr>", { desc = "Toggle aerial view" })
---------------------------------------------------------------------------
-- highlights under cursor
map("n", "<leader>ui", vim.show_pos, { desc = "Inspect Pos" })
map("n", "<leader>uI", "<cmd>InspectTree<cr>", { desc = "Inspect Tree" })
---- Terminal ----
map("n", "<leader>nz", "<cmd>terminal<CR>", { desc = "Open new terminal" })
-- Terminal Mappings
map("t", "<esc><esc>", "<c-\\><c-n>", { desc = "Enter Normal Mode" })
map("t", "<C-h>", "<cmd>wincmd h<cr>", { desc = "Go to Left Window" })
map("t", "<C-j>", "<cmd>wincmd j<cr>", { desc = "Go to Lower Window" })
map("t", "<C-k>", "<cmd>wincmd k<cr>", { desc = "Go to Upper Window" })
map("t", "<C-l>", "<cmd>wincmd l<cr>", { desc = "Go to Right Window" })
map("t", "<C-/>", "<cmd>close<cr>", { desc = "Hide Terminal" })
map("t", "<c-_>", "<cmd>close<cr>", { desc = "which_key_ignore" })
---------------------------------------------------------------------------
---- Windows ----
map("n", "<leader>ww", "<C-W>p", { desc = "Other Window", remap = true })
map("n", "<leader>wd", "<C-W>c", { desc = "Delete Window", remap = true })
map("n", "<leader>w-", "<C-W>s", { desc = "Split Window Below", remap = true })
map("n", "<leader>w|", "<C-W>v", { desc = "Split Window Right", remap = true })
map("n", "<leader>-", "<C-W>s", { desc = "Split Window Below", remap = true })
map("n", "<leader>|", "<C-W>v", { desc = "Split Window Right", remap = true })
map("n", "<leader>wm", function()
LazyVim.toggle.maximize()
end, { desc = "Maximize Toggle" })
-- Move to window using the <ctrl> hjkl keys
map("n", "<C-h>", "<C-w>h", { desc = "Go to Left Window", remap = true })
map("n", "<C-j>", "<C-w>j", { desc = "Go to Lower Window", remap = true })
map("n", "<C-k>", "<C-w>k", { desc = "Go to Upper Window", remap = true })
map("n", "<C-l>", "<C-w>l", { desc = "Go to Right Window", remap = true })
map("n", "<C-A-k>", "<cmd>resize +2<cr>", { desc = "Increase Window Height" })
map("n", "<C-A-j>", "<cmd>resize -2<cr>", { desc = "Decrease Window Height" })
map("n", "<C-A-h>", "<cmd>vertical resize -2<cr>", { desc = "Decrease Window Width" })
map("n", "<C-A-l>", "<cmd>vertical resize +2<cr>", { desc = "Increase Window Width" })
-- Resize window using <ctrl> arrow keys
map("n", "<C-Up>", "<cmd>resize +2<cr>", { desc = "Increase Window Height" })
map("n", "<C-Down>", "<cmd>resize -2<cr>", { desc = "Decrease Window Height" })
map("n", "<C-Left>", "<cmd>vertical resize -2<cr>", { desc = "Decrease Window Width" })
map("n", "<C-Right>", "<cmd>vertical resize +2<cr>", { desc = "Increase Window Width" })
-- quit
map("n", "<leader>qq", "<cmd>qa<cr>", { desc = "Quit All" })
---------------------------------------------------------------------------
---- Utils ----
-- undotree
map("n", "<leader>ut", "<cmd>UndotreeToggle<cr>", { desc = "Toggle undotree" })
-- aerial
map("n", "<leader>a", "<cmd>AerialToggle<cr>", { desc = "Toggle aerial view" })
map("n", "]a", "<cmd>AerialNext<cr>", { desc = "Next aerial view" })
map("n", "[a", "<cmd>AerialPrev<cr>", { desc = "Prev aerial view" })

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
},
},
}