Initial commit
This commit is contained in:
4
lua/plugins/automkdir.lua
Normal file
4
lua/plugins/automkdir.lua
Normal file
@@ -0,0 +1,4 @@
|
||||
return {
|
||||
"mateuszwieloch/automkdir.nvim",
|
||||
opts = {},
|
||||
}
|
||||
18
lua/plugins/autopairs.lua
Normal file
18
lua/plugins/autopairs.lua
Normal 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
|
||||
}
|
||||
15
lua/plugins/cheatsheet.lua
Normal file
15
lua/plugins/cheatsheet.lua
Normal 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
6
lua/plugins/comment.lua
Normal file
@@ -0,0 +1,6 @@
|
||||
return {
|
||||
"numToStr/comment.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
opts = {},
|
||||
lazy = false
|
||||
}
|
||||
40
lua/plugins/completion.lua
Normal file
40
lua/plugins/completion.lua
Normal 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
42
lua/plugins/conform.lua
Normal 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
38
lua/plugins/gitsigns.lua
Normal 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,
|
||||
},
|
||||
}
|
||||
24
lua/plugins/indent-blankline.lua
Normal file
24
lua/plugins/indent-blankline.lua
Normal 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
20
lua/plugins/index.lua
Normal 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
117
lua/plugins/lsp.lua
Normal 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
253
lua/plugins/lualine.lua
Normal 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
4
lua/plugins/sleuth.lua
Normal file
@@ -0,0 +1,4 @@
|
||||
return {
|
||||
"tpope/vim-sleuth",
|
||||
event = { "BufReadPre", "BufNewFile" }
|
||||
}
|
||||
6
lua/plugins/surround.lua
Normal file
6
lua/plugins/surround.lua
Normal file
@@ -0,0 +1,6 @@
|
||||
return {
|
||||
"kylechui/nvim-surround",
|
||||
version = "*",
|
||||
event = "VeryLazy",
|
||||
opts = {}
|
||||
}
|
||||
44
lua/plugins/telescope.lua
Normal file
44
lua/plugins/telescope.lua
Normal 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,
|
||||
}
|
||||
37
lua/plugins/treesitter.lua
Normal file
37
lua/plugins/treesitter.lua
Normal 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
6
lua/plugins/undotree.lua
Normal 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
14
lua/plugins/which-key.lua
Normal file
@@ -0,0 +1,14 @@
|
||||
return {
|
||||
"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
preset = "classic",
|
||||
plugins = {
|
||||
presets = {
|
||||
operators = true,
|
||||
motions = true,
|
||||
text_objects = true
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user