Initial commit

This commit is contained in:
2025-11-04 11:44:29 +01:00
commit 04a2178f3a
23 changed files with 1099 additions and 0 deletions

100
lua/config/keymaps.lua Normal file
View File

@@ -0,0 +1,100 @@
-- Universal Operations
-- n => new/create
-- q => quit/close
-- s => save/write
-- x => exit (save&quit)
-- d => delete/remove
-- r => rename/reload/refresh
-- o => open
-- a => add
-- A => all
-- e => edit
-- t => toggle
-- h/l => previous/next
-- j/k => last/first
local map = vim.keymap.set
-- Leader Key Groups
map("n", "<leader>b", "<Nop>", { desc = "+buffers" })
map("n", "<leader>c", "<Nop>", { desc = "+code" })
map("n", "<leader>d", "<Nop>", { desc = "+diagnostics" })
map("n", "<leader>e", "<Nop>", { desc = "+file actions" })
map("n", "<leader>f", "<Nop>", { desc = "+find" })
map("n", "<leader>g", "<Nop>", { desc = "+git" })
map("n", "<leader>l", "<Nop>", { desc = "+lazy" })
map("n", "<leader>m", "<Nop>", { desc = "+movement" })
map("n", "<leader>s", "<Nop>", { desc = "+search" })
map("n", "<leader>t", "<Nop>", { desc = "+tabs" })
map("n", "<leader>u", "<Nop>", { desc = "+ui" })
map("n", "<leader>w", "<Nop>", { desc = "+windows" })
map("n", "<leader>x", "<Nop>", { desc = "+quickfix" })
-- MacOs Style
map({ "n", "i", "v", "s" }, "<D-s>", "<cmd>w<cr><esc>", { desc = "Save File" })
map("n", "<D-z>", "u", { desc = "Undo" })
map("n", "<D-S-z>", "<C-r>", { desc = "Redo" })
map("n", "<D-a>", "gg<S-v>G", { desc = "Select all" })
map("n", "<C-j>", "<C-w>j", { desc = "Clear search highlight" })
-- Window
map("n", "<leader>wh", "<C-w>h", { desc = "Go to left window" })
map("n", "<leader>wj", "<C-w>j", { desc = "Go to lower window" })
map("n", "<leader>wk", "<C-w>k", { desc = "Go to upper window" })
map("n", "<leader>wl", "<C-w>l", { desc = "Go to right window" })
map("n", "<leader>w|", "<C-w>v", { desc = "Split vertically" })
map("n", "<leader>w-", "<C-w>s", { desc = "Split horizontally" })
map("n", "<leader>wq", "<C-w>c", { desc = "Close window" })
map("n", "<leader>wQ", "<C-w>o", { desc = "Close other windows" })
map("n", "<leader>w=", "<C-w>=", { desc = "Equal width/height" })
map("n", "<leader>ww", "<C-w>w", { desc = "Switch windows" })
map("n", "<M-h>", "<cmd>vertical resize -2<cr>", { desc = "Decrease width" })
map("n", "<M-l>", "<cmd>vertical resize +2<cr>", { desc = "Increase width" })
map("n", "<M-j>", "<cmd>resize -2<cr>", { desc = "Decrease height" })
map("n", "<M-k>", "<cmd>resize +2<cr>", { desc = "Increase height" })
-- Buffer
map("n", "<leader>bA", "<cmd>buffers<cr>", { desc = "List buffers" })
map("n", "<leader>bh", "<cmd>bprevious<cr>", { desc = "Previous buffer" })
map("n", "<leader>bl", "<cmd>bnext<cr>", { desc = "Next buffer" })
map("n", "<leader>bk", "<cmd>bfirst<cr>", { desc = "First buffer" })
map("n", "<leader>bj", "<cmd>blast<cr>", { desc = "Last buffer" })
map("n", "<leader>bd", "<cmd>bdelete<cr>", { desc = "Delete buffer" })
map("n", "<leader>bk", "<cmd>bprevious<cr>", { desc = "Previous buffer" })
-- Tabs
map("n", "<leader>tn", "<cmd>tabnew<cr>", { desc = "New Tab" })
map("n", "<leader>tq", "<cmd>tabclose<cr>", { desc = "Close tab" })
map("n", "<leader>tk", "<cmd>tabfirst<cr>", { desc = "First tab" })
map("n", "<leader>tj", "<cmd>tabfirst<cr>", { desc = "Last tab" })
map("n", "<leader>th", "<cmd>tabprevious<cr>", { desc = "Previous tab" })
map("n", "<leader>tl", "<cmd>tabnext<cr>", { desc = "Next tab" })
-- File Actions
map("n", "<leader>en", "<cmd>enew<cr>", { desc = "New file" })
map("n", "<leader>eq", "<cmd>q<cr>", { desc = "Quit file" })
map("n", "<leader>eQ", "<cmd>qa!<cr>", { desc = "Quit all" })
map("n", "<leader>ex", "<cmd>wq<cr>", { desc = "Save + quit file" })
-- Lazy
map("n", "<leader>ll", "<cmd>Lazy<cr>", { desc = "Lazy Plugin Manager" })
-- UI
map("n", "<leader>uw", "<cmd>set wrap!<cr>", { desc = "Toggle word wrap" })
map("n", "<leader>un", "<cmd>set number!<cr>", { desc = "Toggle line numbers" })
map("n", "<leader>ur", "<cmd>set relativenumber!<cr>", { desc = "Toggle relative number" })
-- Quickfixes
map("n", "<leader>xl", "<cmd>cnext<cr>", { desc = "Next quickfix" })
map("n", "<leader>xh", "<cmd>cprev<cr>", { desc = "Previous quickfix" })
map("n", "<leader>xo", "<cmd>copen<cr>", { desc = "Open quickfix" })
map("n", "<leader>xq", "<cmd>cclose<cr>", { desc = "Close quickfix" })
-- Movement
map("n", "j", "gj", { desc = "Move down (Wrapped Line)" })
map("n", "k", "gk", { desc = "Move up (Wrapped Line)" })
map("n", "<leader>mj", "<cmd>m .+1<cr>==", { desc = "Move line down" })
map("n", "<leader>mk", "<cmd>m .-2<cr>==", { desc = "Move line up" })
map("n", "<leader>mh", "{", { desc = "Previous paragraph" })
map("n", "<leader>ml", "}", { desc = "Next paragraph" })
map("v", "<leader>mj", ":m '>.+1<cr>gv=gv", { desc = "Move selection down" })
map("v", "<leader>mk", ":m '<-2<cr>gv=gv", { desc = "Move selection up" })
-- Identing
map("v", "<", "<gv", { desc = "Indent left" })
map("v", ">", ">gv", { desc = "Indent right" })
map("v", "<Tab>", ">gv", { desc = "Indent right" })
map("v", "<S-Tab>", "<gv", { desc = "Indent left" })
-- Help/Documentation
map("n", "<leader>?", "<cmd>Cheatsheet<cr>", { desc = "Show cheatsheet" })
-- Search for selection
map("v", "//", 'y/\\V<C-R>=escape(@",\'/\\\')<CR><CR>', { desc = "Search selection" })

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

@@ -0,0 +1,30 @@
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, "WarningsMsg" },
{ "\nPress any key to exit" },
}, true, {})
vim.gn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
vim.g.mapleader = " "
vim.g.maplocalleader = ","
require("lazy").setup({
spec = {
import = "plugins"
},
checker = { enabled = true }
})

28
lua/config/options.lua Normal file
View File

@@ -0,0 +1,28 @@
local opt = vim.opt
opt.termguicolors = true
opt.number = true
opt.relativenumber = true
opt.tabstop = 2
opt.shiftwidth = 2
opt.wrap = false
opt.expandtab = true
opt.smartindent = true
opt.ignorecase = true
opt.smartcase = true
opt.scrolloff = 8
opt.sidescrolloff = 8
opt.cursorline = true
opt.signcolumn = "yes"
opt.splitbelow = true
opt.splitright = true
opt.hlsearch = true
opt.incsearch = true
opt.clipboard = "unnamedplus"
opt.completeopt = "menuone,noselect"
opt.updatetime = 50
opt.swapfile = false
opt.backup = false
opt.undofile = true
opt.splitright = true
opt.splitbelow = true

View File

@@ -0,0 +1,4 @@
return {
"mateuszwieloch/automkdir.nvim",
opts = {},
}

18
lua/plugins/autopairs.lua Normal file
View File

@@ -0,0 +1,18 @@
return {
"windwp/nvim-autopairs",
event = "InsertEnter",
opts = {
check_ts = true,
ts_config = {
lua = { "string" },
javascript = { "template_string" }
},
},
config = function (_, opts)
local npairs = require("nvim-autopairs")
npairs.setup(opts)
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
local cmp = require("cmp")
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
end
}

View File

@@ -0,0 +1,15 @@
return {
"sudormrfbin/cheatsheet.nvim",
cmd = { "Cheatsheet" },
dependencies = {
"nvim-telescope/telescope.nvim",
"nvim-lua/popup.nvim",
"nvim-lua/plenary.nvim",
},
config = function()
require("cheatsheet").setup({
bundled_cheatsheets = true,
bundled_plugin_cheatsheets = true,
})
end,
}

6
lua/plugins/comment.lua Normal file
View File

@@ -0,0 +1,6 @@
return {
"numToStr/comment.nvim",
event = { "BufReadPre", "BufNewFile" },
opts = {},
lazy = false
}

View File

@@ -0,0 +1,40 @@
return {
"hrsh7th/nvim-cmp",
event = "InsertEnter",
dependencies = {
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"L3MON4D3/LuaSnip",
"saadparwaiz1/cmp_luasnip",
},
config = function()
local cmp = require("cmp")
local luasnip = require("luasnip")
cmp.setup({
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert({
["<C-n>"] = cmp.mapping.select_next_item(),
["<C-p>"] = cmp.mapping.select_prev_item(),
["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.abort(),
["<CR>"] = cmp.mapping.confirm({ select = false }),
}),
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "path" },
}, {
{ name = "buffer" },
}),
})
end,
}

42
lua/plugins/conform.lua Normal file
View File

@@ -0,0 +1,42 @@
return {
"stevearc/conform.nvim",
event = { "BufWritePre" },
keys = {
{
"<leader>cf",
function()
require("conform").format({ async = true, lsp_fallback = true })
end,
desc = "Format buffer"
},
{
"<leader>cF",
function()
require("conform").format({ formatters = { "injected" } })
end,
desc = "Format injected langs"
},
},
opts = {
formatters_by_ft = {
javascript = { "prettier" },
typescript = { "prettier" },
javascriptreact = { "prettier" },
typescriptreact = { "prettier" },
css = { "prettier" },
html = { "prettier" },
json = { "prettier" },
yaml = { "prettier" },
markdown = { "prettier" },
lua = { "stylelua" },
python = { "black" },
php = { "php_cs_fixer" },
go = { "gofmt" },
rurst = { "rustfmt" },
},
format_on_save = {
timeout_ms = 500,
lsp_fallback = true
}
}
}

38
lua/plugins/gitsigns.lua Normal file
View File

@@ -0,0 +1,38 @@
return {
"lewis6991/gitsigns.nvim",
event = { "BufReadPre", "BufNewFile" },
opts = {
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, l, r, { buffer = buffer, desc = desc })
end
map("n", "<leader>gh", gs.prev_hunk, "Previous hunk")
map("n", "<leader>gl", gs.next_hunk, "Next hunk")
-- Git actions
map("n", "<leader>ga", gs.stage_hunk, "Add/stage hunk")
map("n", "<leader>gr", gs.reset_hunk, "Reset hunk")
map("n", "<leader>gA", gs.stage_buffer, "Add/stage all")
map("n", "<leader>gR", gs.reset_buffer, "Reset all")
map("n", "<leader>gu", gs.undo_stage_hunk, "Undo stage")
map("n", "<leader>gp", gs.preview_hunk, "Preview hunk")
map("n", "<leader>gb", function() gs.blame_line({ full = true }) end, "Blame line")
map("n", "<leader>gd", gs.diffthis, "Diff this")
map("n", "<leader>gD", function() gs.diffthis("~") end, "Diff this ~")
map("n", "<leader>gt", gs.toggle_deleted, "Toggle deleted")
-- Visual mode
map("v", "<leader>ga", function() gs.stage_hunk({ vim.fn.line("."), vim.fn.line("v") }) end, "Add/stage")
map("v", "<leader>gr", function() gs.reset_hunk({ vim.fn.line("."), vim.fn.line("v") }) end, "Reset")
-- Text object
map({ "o", "x" }, "ih", ":<C-U>Gitsigns select_hunk<CR>", "Select hunk")
end,
},
}

View File

@@ -0,0 +1,24 @@
return {
"lukas-reineke/indent-blankline.nvim",
main = "ibl",
event = { "BufReadPost", "BufNewFile" },
opt = {
indent = {
char = "|",
tab_char = "|"
},
scope = {
enabled = true,
show_start = false,
show_end = false,
},
exlude = {
filetypes = {
"help",
"lazy",
"mason",
"notify",
},
},
},
}

20
lua/plugins/index.lua Normal file
View File

@@ -0,0 +1,20 @@
return {
-- Install Order
-- 1. Treesitter [✓]
-- 2. LSP Minimal [✓]
-- 3. Completions [✓]
-- 4. Autopairs [✓]
-- 5. Telescope [✓]
-- 6. Which-Key [✓]
-- 7. Comment [✓]
-- 8. Surround
-- 9. Vim-Sleuth
-- 10. Nvim-Lint
-- 11. Git-Signs
-- 12. Lualine
-- 13. Ident-Blankline
-- 14. Autommkdir | Mkdir
-- 15. Cheatsheet | neodev
-- 16. Replace | Simple Format
-- 17. vim-be-good
}

117
lua/plugins/lsp.lua Normal file
View File

@@ -0,0 +1,117 @@
return {
"neovim/nvim-lspconfig",
event = { "BufReadPre", "BufNewFile" },
dependencies = {
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim",
"hrsh7th/cmp-nvim-lsp",
},
config = function()
require("mason").setup()
local capabilities = require("cmp_nvim_lsp").default_capabilities()
local lspconfig = require("lspconfig")
vim.api.nvim_create_autocmd("LspAttach", {
callback = function(event)
local map = function(keys, func, desc)
vim.keymap.set("n", keys, func, {buffer = event.buf, desc = desc})
end
-- Navigation
map("gd", vim.lsp.buf.definition, "Go to definition")
map("gD", vim.lsp.buf.declaration, "Go to declatation")
map("gi", vim.lsp.buf.implementation, "Go to implementation")
map("gr", vim.lsp.buf.definition, "Go to references")
map("gt", vim.lsp.buf.type_definition, "Go to type definition")
-- Documentation
map("K", vim.lsp.buf.hover, "Hover documentation")
map("<leader>K", vim.lsp.buf.signature_help, "Signature help")
-- LSP Actions
map("<leader>ca", vim.lsp.buf.code_action, "Code action")
map("<leader>cr", vim.lsp.buf.rename, "Rename")
map("<leader>cf", vim.lsp.buf.format, "Format")
-- Diagnostics
map("<leader>do", vim.diagnostic.open_float, "Show diagnostics")
map("<leader>dl", vim.diagnostic.goto_next, "Next diagnostic")
map("<leader>dh", vim.diagnostic.goto_prev, "Previous diagnostic")
map("<leader>dF", vim.diagnostic.setloclist, "Quickfix diagnostics")
map("<leader>da", vim.diagnostic.setloclist, "List diagnostics")
end,
})
local servers = {
-- Javascript/TypeScript/React
ts_ls = {
settings = {
typescript = {
inlayHints = {
includeInlayParameterNameHints = "all",
includeInlayParameterNameHintsWhenArgumentMatchesName = false,
includeInlayFunctionParameterTypeHints = true,
includeInlayVariableTypeHints = true,
},
},
},
},
-- Hyprland
hyprls = {},
-- CSS/SCSS
cssls = {},
-- stylelint
stylelint_lsp = {},
-- HTML
html = {},
-- PHP
intelephense = {
settings = {
php = {
validate = {
enable = true,
run = "onSave",
},
},
},
},
-- Python
pyright = {},
-- JSON
jsonls = {},
-- TOML
taplo = {},
-- YAML
yamlls = {},
-- Rust
rust_analyzer = {
settings = {
["rust_analyzer"] = {
check = {
command = "clippy"
},
},
},
},
-- Go
gopls = {},
-- Markdown
marksman = {},
-- Lua
lua_ls = {
settings = {
Lua = {
diagnostics = { globals = { "vim" } },
workspace = { checkThirdParty = false },
telemetry = { enable = false },
},
},
},
}
require("mason-lspconfig").setup({
ensure_installed = vim.tbl_keys(servers),
handlers = {
function(server_name)
local config = servers[server_name] or {}
config.capabilities = capabilities
lspconfig[server_name].setup(config)
end,
},
})
end,
}

253
lua/plugins/lualine.lua Normal file
View File

@@ -0,0 +1,253 @@
return {
"nvim-lualine/lualine.nvim",
event = "VeryLazy",
dependencies = {
"nvim-tree/nvim-web-devicons"
},
config = function()
local lualine = require("lualine")
local colors = {
lime = "#71f79f",
red = "#ed254e",
orange = "#ff6a00",
yellow = "#f9dc5c",
purple = "#c74ded",
dark_purple = "#7b7bbd",
blue = "#7cb7ff",
cyan = "#00c1e4",
teal = "#00e8c6",
watermelon = "#ff4d7a",
white = "#fefefe",
text = "#c3c7d1",
subtext1 = "#a8b2c0",
subtext0 = "#8a96a8",
base = "#161925",
mantle = "#121520",
surface0 = "#1a1f2e",
surface1 = "#222e39",
surface2 = "#31363d",
}
local conditions = {
buffer_not_empty = function()
return vim.fn.empty(vim.fn.expand("%:t")) ~= 1
end,
hide_in_width = function()
return vim.fn.winwidth(0) > 80
end,
check_git_workspace = function()
local filepath = vim.fn.expand("%:p:h")
local gitdir = vim.fn.finddir(".git", filepath .. ";")
return gitdir and #gitdir > 0 and #gitdir < #filepath
end,
is_code_file = function()
local ft = vim.bo.filetype
return ft == "javascript" or ft == "typescript" or ft == "lua" or ft == "python" or ft == "jsx" or ft == "tsx"
end,
}
local config = {
options = {
component_separators = "",
section_separators = "",
theme = {
normal = { c = { fg = colors.fg, bg = colors.bg } },
inactive = { c = { fg = colors.fg, bg = colors.bg } },
},
},
sections = {
lualine_a = {},
lualine_b = {},
lualine_y = {},
lualine_z = {},
lualine_c = {},
lualine_x = {},
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_y = {},
lualine_z = {},
lualine_c = {},
lualine_x = {},
},
}
local function ins_left(component)
table.insert(config.sections.lualine_c, component)
end
local function ins_right(component)
table.insert(config.sections.lualine_x, component)
end
-- Left Side
-- Component: Mode
ins_left {
"mode",
color = function()
local mode_color = {
n = colors.lime,
i = colors.blue,
v = colors.purple,
[''] = colors.purple,
V = colors.purple,
c = colors.yellow,
R = colors.red,
t = colors.teal
}
return { bg = colors.mantle, fg = mode_color[vim.fn.mode()], gui = "bold" }
end,
padding = { left = 1, right = 1 }
}
-- Separator Mode->Filename
ins_left {
function() return "" end,
color = { fg = colors.mantle, bg = colors.orange },
padding = 0
}
-- Component: Filename
ins_left {
"filename",
path = 1,
shorting_target = 32,
file_status = true,
symbols = {
modified = "[+]",
readonly = "[RO]",
unnamed = "[No Name]"
},
cond = conditions.buffer_not_empty,
color = { fg = colors.mantle, bg = colors.orange, gui = "bold" },
padding = { left = 1, right = 1 }
}
-- Seperator Filename -> Git
ins_left {
function() return "" end,
color = { fg = colors.orange, bg = colors.lime },
padding = 0
}
-- Component: Git Branch
ins_left {
"branch",
color = { fg = colors.mantle, bg = colors.lime },
padding = { left = 1, right = 1 }
}
-- Component: Git diff status
ins_left {
"diff",
symbols = {
added = '+',
modified = '!',
removed = '-'
},
diff_color = {
added = { fg = colors.bg, bg = colors.lime },
modified = { fg = colors.dark_purple, bg = colors.lime },
removed = { fg = colors.red, bg = colors.lime },
},
cond = conditions.check_git_workspace,
padding = { left = 0, right = 1 },
}
-- Seperator Git -> Function
ins_left {
function() return "" end,
color = { fg = colors.lime, bg = colors.watermelon },
padding = 0
}
-- Component: Current Function
ins_left {
function()
local ft = vim.bo.filetype
local is_code_file = ft == "javascript" or ft == "typescript" or ft == "lua" or ft == "python" or ft == "jsx" or
ft == "tsx"
if not is_code_file then
return ""
end
local ts_utils = require("nvim-treesitter.ts_utils")
local current_node = ts_utils.get_node_at_cursor()
if not current_node then return "" end
local function_node = current_node
while function_node do
local node_type = function_node:type()
if node_type == "function_declaration" or
node_type == "function_expression" or
node_type == "arrow_function" or
node_type == "method_definition" then
break
end
function_node = function_node:parent()
end
if function_node then
local name_node = function_node:field("name")[1]
if name_node then
local name = vim.treesitter.get_node_text(name_node, 0)
return name:sub(1, 20)
end
end
return "󰈙"
end,
icon = "󰊕",
color = { fg = colors.mantle, bg = colors.watermelon, gui = "bold" },
}
-- Seperator End
ins_left {
function() return "" end,
color = { fg = colors.watermelon, bg = colors.surface1 },
padding = { left = 0, right = 1 }
}
-- Right Side
-- Seperator Start
ins_right {
function() return "" end,
color = { fg = colors.teal, bg = colors.surface1 },
padding = 0
}
-- Component: Encoding
ins_right {
"encoding",
color = { fg = colors.mantle, bg = colors.teal, gui = "bold" },
}
-- Component: Filetype
ins_right {
"filetype",
color = { fg = colors.mantle, bg = colors.teal, gui = "bold" },
}
-- Separator: Filetype -> LSP Status
ins_right {
function() return "" end,
color = { fg = colors.dark_purple, bg = colors.teal },
padding = 0
}
-- Component: LSP Status
ins_right {
"lsp_status",
color = { fg = colors.text, bg = colors.dark_purple, gui = "bold" }
}
-- Seperator: LSP Status -> Diagnostics
ins_right {
function() return "" end,
color = { bg = colors.dark_purple, fg = colors.surface0 },
padding = 0
}
-- Component: Diagnostics
ins_right {
"diagnostics",
always_visible = true,
symbols = {
error = "[E]",
warn = "[W]",
info = "[I]",
hint = "[H]"
},
color = { bg = colors.surface0, gui = "bold" }
}
-- Seperator: Diagnostics -> Location
ins_right {
function() return "" end,
color = { fg = colors.white, bg = colors.surface0 },
padding = 0
}
-- Component: Location
ins_right {
"location",
color = { fg = colors.mantle, bg = colors.white, gui = "bold" }
}
lualine.setup(config)
end,
}

4
lua/plugins/sleuth.lua Normal file
View File

@@ -0,0 +1,4 @@
return {
"tpope/vim-sleuth",
event = { "BufReadPre", "BufNewFile" }
}

6
lua/plugins/surround.lua Normal file
View File

@@ -0,0 +1,6 @@
return {
"kylechui/nvim-surround",
version = "*",
event = "VeryLazy",
opts = {}
}

44
lua/plugins/telescope.lua Normal file
View File

@@ -0,0 +1,44 @@
return {
"nvim-telescope/telescope.nvim",
cmd = "Telescope",
dependencies = {
"nvim-lua/plenary.nvim",
{
"nvim-telescope/telescope-fzf-native.nvim",
build = "make"
},
},
keys = {
-- File Finding
{ "<leader>ff", "<cmd>Telescope find_files<cr>", desc = "Files" },
{ "<leader>fr", "<cmd>Telescope oldfiles<cr>", desc = "Recent files" },
{ "<leader>fg", "<cmd>Telescope live_grep<cr>", desc = "Grep text" },
{ "<leader>fw", "<cmd>Telescope grep_string<cr>", desc = "Current word" },
{ "<leader>fb", "<cmd>Telescope buffers<cr>", desc = "Buffers" },
{ "<leader>f?", "<cmd>Telescope help_tags<cr>", desc = "Help pages" },
{ "<leader>fk", "<cmd>Telescope keymaps<cr>", desc = "Keymaps" },
{ "<leader>fc", "<cmd>Telescope commands<cr>", desc = "Commands" },
{ "<leader>fo", "<cmd>Telescope vim_options<cr>", desc = "Options" },
{ "<leader>fm", "<cmd>Telescope marks<cr>", desc = "Marks" },
-- Git
{ "<leader>gs", "<cmd>Telescope git_status<cr>", desc = "Status" },
{ "<leader>gc", "<cmd>Telescope git_commits<cr>", desc = "Commits" },
{ "<leader>gb", "<cmd>Telescope git_branches<cr>", desc = "Branches" },
-- Search
{ "<leader>sr", "<cmd>Telescope resume<cr>", desc = "Resume last search" },
{ "<leader>sw", "<cmd>Telescope grep_string<cr>", desc = "Current word" },
{ "<leader>sd", "<cmd>Telescope diagnostics<cr>", desc = "Diagnostics" },
},
opts = {
defaults = {
prompt_prefix = " ",
selection_caret = " ",
path_display = { "truncate" }
},
},
config = function(_, opts)
local telescope = require("telescope")
telescope.setup(opts)
telescope.load_extension("fzf")
end,
}

View File

@@ -0,0 +1,37 @@
return {
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
event = { "BufReadPost", "BufNewFile" },
config = function()
require("nvim-treesitter.configs").setup({
ensure_installed = {
"lua",
"vim",
"vimdoc",
"hyprlang",
"nginx",
"yaml",
"bash",
"toml",
"regex",
"comment",
"json",
"html",
"xml",
"css",
"javascript",
"typescript",
"tsx",
"markdown",
"markdown_inline",
"sql",
"graphql",
"go",
"rust",
},
auto_install = true,
highlight = { enable = true},
indent = { enable = true},
})
end,
}

6
lua/plugins/undotree.lua Normal file
View File

@@ -0,0 +1,6 @@
return {
"mbbill/undotree",
config = function ()
vim.keymap.set("n", "<leader>z", vim.cmd.UndotreeToggle, { desc = "Toggle untotree" })
end
}

14
lua/plugins/which-key.lua Normal file
View File

@@ -0,0 +1,14 @@
return {
"folke/which-key.nvim",
event = "VeryLazy",
opts = {
preset = "classic",
plugins = {
presets = {
operators = true,
motions = true,
text_objects = true
},
},
},
}