Initial commit
This commit is contained in:
commit
c0aafb6b3d
18 changed files with 582 additions and 0 deletions
38
init.lua
Normal file
38
init.lua
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
vim.g.base46_cache = vim.fn.stdpath "data" .. "/nvchad/base46/"
|
||||
vim.g.mapleader = " "
|
||||
|
||||
-- bootstrap lazy and all plugins
|
||||
local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim"
|
||||
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
local repo = "https://github.com/folke/lazy.nvim.git"
|
||||
vim.fn.system { "git", "clone", "--filter=blob:none", repo, "--branch=stable", lazypath }
|
||||
end
|
||||
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
local lazy_config = require("configs.lazy")
|
||||
|
||||
-- load plugins
|
||||
require("lazy").setup({
|
||||
{
|
||||
"NvChad/NvChad",
|
||||
lazy = false,
|
||||
branch = "v2.5",
|
||||
import = "nvchad.plugins",
|
||||
config = function()
|
||||
require "options"
|
||||
end,
|
||||
},
|
||||
{ import = "plugins" },
|
||||
}, lazy_config)
|
||||
|
||||
-- load theme
|
||||
dofile(vim.g.base46_cache .. "defaults")
|
||||
dofile(vim.g.base46_cache .. "statusline")
|
||||
|
||||
require("autocmds")
|
||||
|
||||
vim.schedule(function()
|
||||
require("mappings")
|
||||
end)
|
||||
41
lazy-lock.json
Normal file
41
lazy-lock.json
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
{
|
||||
"LuaSnip": { "branch": "master", "commit": "ce0a05ab4e2839e1c48d072c5236cce846a387bc" },
|
||||
"NvChad": { "branch": "v2.5", "commit": "0ef037c6db092f0ea627d3f81ce8e7db45e9b187" },
|
||||
"base46": { "branch": "v2.5", "commit": "b17df65f6d423055e9fdfa4e7f55967c03862f29" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
|
||||
"cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" },
|
||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
|
||||
"conform.nvim": { "branch": "master", "commit": "cd75be867f2331b22905f47d28c0c270a69466aa" },
|
||||
"copilot-cmp": { "branch": "master", "commit": "b6e5286b3d74b04256d0a7e3bd2908eabec34b44" },
|
||||
"copilot.lua": { "branch": "master", "commit": "86537b286f18783f8b67bccd78a4ef4345679625" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "45a1b96e46efe5fce8af325d4bed45feb9d29d0f" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "7178d1a430dcfff8a4c92d78b9e39e0297a779c0" },
|
||||
"gv.vim": { "branch": "master", "commit": "b6bb6664e2c95aa584059f195eb3a9f3cb133994" },
|
||||
"harpoon": { "branch": "harpoon2", "commit": "0378a6c428a0bed6a2781d459d7943843f374bce" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "65e20ab94a26d0e14acac5049b8641336819dfc7" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "d1de92dffab5a862332fdd1892889d362369c12f" },
|
||||
"markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "37a336b653f8594df75c827ed589f1c91d91ff6c" },
|
||||
"mason.nvim": { "branch": "main", "commit": "f96a31855fa8aea55599cea412fe611b85a874ed" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "78a4507bb9ffc9b00f11ae0ac48243d00cb9194d" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "a110e12d0b58eefcf5b771f533fc2cf3050680ac" },
|
||||
"nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "cf97d2485fc3f6d4df1b79a3ea183e24c272215e" },
|
||||
"nvim-numbertoggle": { "branch": "main", "commit": "c5827153f8a955886f1b38eaea6998c067d2992f" },
|
||||
"nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" },
|
||||
"nvim-tree.lua": { "branch": "master", "commit": "f9ff00bc06d7cb70548a3847d7a2a05e928bc988" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "465840f8c14126e5193d777bbff94036eb875bd5" },
|
||||
"nvim-ufo": { "branch": "main", "commit": "a57e088487f099197246fd24be7423c6c4dedcef" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "c0cfc1738361b5da1cd0a962dd6f774cc444f856" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" },
|
||||
"promise-async": { "branch": "main", "commit": "28c1d5a295eb5310afa2523d4ae9aa41ec5a9de2" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "bfcc7d5c6f12209139f175e6123a7b7de6d9c18a" },
|
||||
"trouble.nvim": { "branch": "main", "commit": "4453fea6bb597830fbd58d2c484612f37b97bd8c" },
|
||||
"ui": { "branch": "v2.5", "commit": "6c1a615319796a627adb221f04ab2d962db86c9d" },
|
||||
"undotree": { "branch": "master", "commit": "56c684a805fe948936cda0d1b19505b84ad7e065" },
|
||||
"vim-fugitive": { "branch": "master", "commit": "8c8cdf4405cb8bdb70dd9812a33bb52363a87dbc" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "af4ded85542d40e190014c732fa051bdbf88be3d" },
|
||||
"zen-mode.nvim": { "branch": "main", "commit": "21976479c7a0146b05a42707cf91c86b1e510945" }
|
||||
}
|
||||
33
lua/autocmds.lua
Normal file
33
lua/autocmds.lua
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
require "nvchad.autocmds"
|
||||
|
||||
local autocmd = vim.api.nvim_create_autocmd
|
||||
|
||||
autocmd({ "TextYankPost" }, {
|
||||
group = vim.api.nvim_create_augroup("HighlightYank", { clear = true }),
|
||||
callback = function()
|
||||
vim.highlight.on_yank({
|
||||
higroup = "IncSearch",
|
||||
timeout = 40,
|
||||
})
|
||||
end
|
||||
})
|
||||
|
||||
autocmd({ "BufWinEnter" }, {
|
||||
group = vim.api.nvim_create_augroup("Fugitive", {}),
|
||||
callback = function()
|
||||
if vim.bo.ft ~= 'fugitive' then
|
||||
return
|
||||
end
|
||||
|
||||
vim.keymap.set('n', '<leader>p', '<cmd>Git pull<CR>', { desc = "Fugitive Git pull" })
|
||||
vim.keymap.set('n', '<leader>P', '<cmd>Git push<CR>', { desc = "Fugitive Git push" })
|
||||
end
|
||||
})
|
||||
|
||||
autocmd({ "LspAttach" }, {
|
||||
group = vim.api.nvim_create_augroup("Lsp", {}),
|
||||
callback = function(e)
|
||||
local opts = { buffer = e.buf, }
|
||||
vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts)
|
||||
end
|
||||
})
|
||||
23
lua/chadrc.lua
Normal file
23
lua/chadrc.lua
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
---@type ChadrcConfig
|
||||
local M = {}
|
||||
|
||||
M.ui = {
|
||||
theme = "tokyonight",
|
||||
tabufline = {
|
||||
enabled = false,
|
||||
},
|
||||
}
|
||||
|
||||
M.copilot = {
|
||||
i = {
|
||||
["<C-l>"] = {
|
||||
function()
|
||||
vim.fn.feedkeys(vim.fn['copilot#Accept'](), '')
|
||||
end,
|
||||
"Copilot Accept",
|
||||
{ replace_keycodes = true, nowait = true, silent = true, expr = true, noremap = true }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return M
|
||||
15
lua/configs/conform.lua
Normal file
15
lua/configs/conform.lua
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
local options = {
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
-- css = { "prettier" },
|
||||
-- html = { "prettier" },
|
||||
},
|
||||
|
||||
-- format_on_save = {
|
||||
-- -- These options will be passed to conform.format()
|
||||
-- timeout_ms = 500,
|
||||
-- lsp_fallback = true,
|
||||
-- },
|
||||
}
|
||||
|
||||
require("conform").setup(options)
|
||||
15
lua/configs/harpoon.lua
Normal file
15
lua/configs/harpoon.lua
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
local harpoon = require("harpoon")
|
||||
local set = vim.keymap.set
|
||||
|
||||
harpoon:setup()
|
||||
|
||||
set("n", "<leader>a", function() harpoon:list():add() end, { desc = "Harpoon Add new entry" })
|
||||
set("n", "<C-e>", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end, { desc = "Harpoon Open quick menu" })
|
||||
set("n", "<C-j>", function() harpoon:list():select(1) end, { desc = "Harpoon Select entry 1" })
|
||||
set("n", "<C-k>", function() harpoon:list():select(2) end, { desc = "Harpoon Select entry 2" })
|
||||
set("n", "<C-l>", function() harpoon:list():select(3) end, { desc = "Harpoon Select entry 3" })
|
||||
set("n", "<C-;>", function() harpoon:list():select(4) end, { desc = "Harpoon Select entry 4" })
|
||||
set("n", "<leader><C-j>", function() harpoon:list():replace_at(1) end, { desc = "Harpoon Replace entry 1" })
|
||||
set("n", "<leader><C-k>", function() harpoon:list():replace_at(2) end, { desc = "Harpoon Replace entry 2" })
|
||||
set("n", "<leader><C-l>", function() harpoon:list():replace_at(3) end, { desc = "Harpoon Replace entry 3" })
|
||||
set("n", "<leader><C-;>", function() harpoon:list():replace_at(4) end, { desc = "Harpoon Replace entry 4" })
|
||||
47
lua/configs/lazy.lua
Normal file
47
lua/configs/lazy.lua
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
return {
|
||||
defaults = { lazy = true },
|
||||
install = { colorscheme = { "nvchad" } },
|
||||
|
||||
ui = {
|
||||
icons = {
|
||||
ft = "",
|
||||
lazy = " ",
|
||||
loaded = "",
|
||||
not_loaded = "",
|
||||
},
|
||||
},
|
||||
|
||||
performance = {
|
||||
rtp = {
|
||||
disabled_plugins = {
|
||||
"2html_plugin",
|
||||
"tohtml",
|
||||
"getscript",
|
||||
"getscriptPlugin",
|
||||
"gzip",
|
||||
"logipat",
|
||||
"netrw",
|
||||
"netrwPlugin",
|
||||
"netrwSettings",
|
||||
"netrwFileHandlers",
|
||||
"matchit",
|
||||
"tar",
|
||||
"tarPlugin",
|
||||
"rrhelper",
|
||||
"spellfile_plugin",
|
||||
"vimball",
|
||||
"vimballPlugin",
|
||||
"zip",
|
||||
"zipPlugin",
|
||||
"tutor",
|
||||
"rplugin",
|
||||
"syntax",
|
||||
"synmenu",
|
||||
"optwin",
|
||||
"compiler",
|
||||
"bugreport",
|
||||
"ftplugin",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
45
lua/configs/lspconfig.lua
Normal file
45
lua/configs/lspconfig.lua
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
local on_attach = require("nvchad.configs.lspconfig").on_attach
|
||||
local on_init = require("nvchad.configs.lspconfig").on_init
|
||||
local capabilities = require("nvchad.configs.lspconfig").capabilities
|
||||
|
||||
require("mason-lspconfig").setup({
|
||||
ensure_installed = { "lua_ls", "html", "cssls", "pylsp", "java_language_server", "sqlls", "gopls" },
|
||||
handlers = {
|
||||
function(server_name) -- default handler (optional)
|
||||
require("lspconfig")[server_name].setup {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
on_init = on_init,
|
||||
}
|
||||
end,
|
||||
zls = function()
|
||||
local lspconfig = require("lspconfig")
|
||||
lspconfig.zls.setup({
|
||||
root_dir = lspconfig.util.root_pattern(".git", "build.zig", "zls.json"),
|
||||
settings = {
|
||||
zls = {
|
||||
enable_inlay_hints = true,
|
||||
enable_snippets = true,
|
||||
warn_style = true,
|
||||
},
|
||||
},
|
||||
})
|
||||
vim.g.zig_fmt_parse_errors = 0
|
||||
vim.g.zig_fmt_autosave = 0
|
||||
end,
|
||||
["lua_ls"] = function()
|
||||
local lspconfig = require("lspconfig")
|
||||
lspconfig.lua_ls.setup {
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = { version = "Lua 5.1" },
|
||||
diagnostics = {
|
||||
globals = { "bit", "vim", "it", "describe", "before_each", "after_each" },
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end,
|
||||
}
|
||||
})
|
||||
0
lua/configs/nvim-cmp.lua
Normal file
0
lua/configs/nvim-cmp.lua
Normal file
1
lua/configs/nvim-surround.lua
Normal file
1
lua/configs/nvim-surround.lua
Normal file
|
|
@ -0,0 +1 @@
|
|||
require("nvim-surround").setup({})
|
||||
83
lua/configs/nvimtree.lua
Normal file
83
lua/configs/nvimtree.lua
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
local options = {
|
||||
filters = {
|
||||
dotfiles = false,
|
||||
git_ignored = true,
|
||||
custom = { ".git", "node_modules", "venv", "__pycache__" },
|
||||
exclude = { ".github", ".gitignore", ".gitmodules", ".gitattributes" },
|
||||
},
|
||||
disable_netrw = true,
|
||||
hijack_netrw = true,
|
||||
hijack_cursor = true,
|
||||
hijack_unnamed_buffer_when_opening = false,
|
||||
sync_root_with_cwd = true,
|
||||
update_focused_file = {
|
||||
enable = true,
|
||||
update_root = false,
|
||||
},
|
||||
view = {
|
||||
side = "right",
|
||||
width = 60,
|
||||
number = true,
|
||||
adaptive_size = false,
|
||||
preserve_window_proportions = true,
|
||||
},
|
||||
git = {
|
||||
enable = true,
|
||||
ignore = true,
|
||||
},
|
||||
sort = {
|
||||
sorter = "case_sensitive",
|
||||
},
|
||||
filesystem_watchers = {
|
||||
enable = true,
|
||||
},
|
||||
actions = {
|
||||
open_file = {
|
||||
resize_window = true,
|
||||
},
|
||||
},
|
||||
renderer = {
|
||||
root_folder_label = false,
|
||||
group_empty = true,
|
||||
indent_width = 2,
|
||||
highlight_git = true,
|
||||
highlight_opened_files = "none",
|
||||
indent_markers = {
|
||||
enable = true,
|
||||
},
|
||||
icons = {
|
||||
show = {
|
||||
file = true,
|
||||
folder = true,
|
||||
folder_arrow = true,
|
||||
git = true,
|
||||
},
|
||||
|
||||
glyphs = {
|
||||
default = "",
|
||||
symlink = "",
|
||||
folder = {
|
||||
default = "",
|
||||
empty = "",
|
||||
empty_open = "",
|
||||
open = "",
|
||||
symlink = "",
|
||||
symlink_open = "",
|
||||
arrow_open = "",
|
||||
arrow_closed = "",
|
||||
},
|
||||
git = {
|
||||
unstaged = "✗",
|
||||
staged = "✓",
|
||||
unmerged = "",
|
||||
renamed = "➜",
|
||||
untracked = "★",
|
||||
deleted = "",
|
||||
ignored = "◌",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
require("nvim-tree").setup(options)
|
||||
12
lua/configs/overrides.lua
Normal file
12
lua/configs/overrides.lua
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
local M = {}
|
||||
|
||||
M.copilot = {
|
||||
suggestion = {
|
||||
enable = false,
|
||||
},
|
||||
panel = {
|
||||
enable = false,
|
||||
},
|
||||
}
|
||||
|
||||
return M
|
||||
1
lua/configs/trouble.lua
Normal file
1
lua/configs/trouble.lua
Normal file
|
|
@ -0,0 +1 @@
|
|||
require("trouble").setup({})
|
||||
9
lua/configs/ufo.lua
Normal file
9
lua/configs/ufo.lua
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
require("ufo").setup({
|
||||
provider_selector = function(bufnr, filetype, buftype)
|
||||
return { 'treesitter', 'indent' }
|
||||
end
|
||||
})
|
||||
|
||||
local set = vim.keymap.set
|
||||
set("n", "zR", require("ufo").openAllFolds)
|
||||
set("n", "zM", require("ufo").closeAllFolds)
|
||||
15
lua/configs/zenmode.lua
Normal file
15
lua/configs/zenmode.lua
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
local set = vim.keymap.set
|
||||
require("zen-mode").setup({
|
||||
window = {
|
||||
width = 150,
|
||||
options = {}
|
||||
},
|
||||
})
|
||||
|
||||
set("n", "<leader>zz", function()
|
||||
require("zen-mode").toggle()
|
||||
|
||||
vim.wo.wrap = false
|
||||
vim.wo.number = true
|
||||
vim.wo.rnu = true
|
||||
end)
|
||||
86
lua/mappings.lua
Normal file
86
lua/mappings.lua
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
local map = vim.keymap.set
|
||||
|
||||
-- General
|
||||
map("n", ";", ":", { desc = "General Enter command mode" })
|
||||
map("n", "<Esc>", "<cmd>noh<CR>", { desc = "General Clear highlights" })
|
||||
map("n", "<leader>ch", "<cmd>NvCheatsheet<CR>", { desc = "General Toggle nvcheatsheet" })
|
||||
|
||||
-- File
|
||||
map("n", "<C-s>", "<cmd>w<CR>", { desc = "File Save" })
|
||||
map("n", "<leader>f", function() require("conform").format({ lsp_fallback = true }) end, { desc = "File Format" })
|
||||
|
||||
-- Buffer
|
||||
map("n", "<leader>b", "<cmd>enew<CR>", { desc = "Buffer new" })
|
||||
map("n", "<tab>", function() require("nvchad.tabufline").next() end, { desc = "Buffer goto next" })
|
||||
map("n", "<S-tab>", function() require("nvchad.tabufline").prev() end, { desc = "Buffer goto prev" })
|
||||
map("n", "<leader>x", function() require("nvchad.tabufline").close_buffer() end, { desc = "Buffer Close" })
|
||||
|
||||
-- nvimtree
|
||||
map("n", "<leader>pv", "<cmd>NvimTreeToggle<CR>", { desc = "nvimtree toggle window" })
|
||||
|
||||
-- Terminal
|
||||
map("t", "<C-x>", "<C-\\><C-N>", { desc = "Terminal Escape terminal mode" })
|
||||
map("n", "<leader>h", function() require("nvchad.term").new { pos = "sp" } end, { desc = "Terminal New horizontal term" })
|
||||
map({ "n", "t" }, "<A-h>", function() require("nvchad.term").toggle { pos = "sp", id = "htoggleTerm" } end,
|
||||
{ desc = "Terminal New horizontal term" })
|
||||
map({ "n", "t" }, "<A-i>", function() require("nvchad.term").toggle { pos = "float", id = "floatTerm" } end,
|
||||
{ desc = "Terminal Toggle floating term" })
|
||||
|
||||
-- Vertical
|
||||
map("n", "<C-d>", "<C-d>zz", { desc = "Vertical Scroll down and keep cursor in same position" })
|
||||
map("n", "<C-u>", "<C-u>zz", { desc = "Vertical Scroll up and keep cursor in same position" })
|
||||
|
||||
-- Find/Replace
|
||||
map("n", "n", "nzzzv", { desc = "Find/Replace Move to next match" })
|
||||
map("n", "N", "Nzzzv", { desc = "Find/Replace Move to previous match" })
|
||||
map("n", "<leader>s", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]],
|
||||
{ desc = "Find/Replace Replace current word" })
|
||||
|
||||
-- Editing
|
||||
map("v", "J", ":m '>+1<CR>gv=gv", { desc = "Editing Move line down" })
|
||||
map("v", "K", ":m '<-2<CR>gv=gv", { desc = "Editing Move line up" })
|
||||
map("n", "<leader>Y", [["+Y]], { desc = "Editing Copy line to system clipboard" })
|
||||
map("v", "<leader>p", [["_dP]], { desc = "Editing Replace text with paste buffer" })
|
||||
map({ "n", "v" }, "<leader>y", [["+y]], { desc = "Editing Copy to system clipboard" })
|
||||
map({ "n", "v" }, "<leader>d", [["_d]], { desc = "Editing Delete selected to void buffer" })
|
||||
|
||||
-- Navigation
|
||||
map("n", "<C-S-k>", "<cmd>cnext<CR>zz", { desc = "Navigation Move to next in quickfix list" })
|
||||
map("n", "<C-S-j>", "<cmd>cprev<CR>zz", { desc = "Navigation Move to previous in quickfix list" })
|
||||
map("n", "<leader>k", "<cmd>lnext<CR>zz", { desc = "Navigation Move to next in location list" })
|
||||
map("n", "<leader>j", "<cmd>lprev<CR>zz", { desc = "Navigation Move to previous in location list" })
|
||||
|
||||
-- Telescope
|
||||
map("n", "<leader>pf", "<cmd>Telescope find_files<CR>", { desc = "Telescope Find files" })
|
||||
map("n", "<leader>pa", "<cmd>Telescope find_files follow=true no_ignore=true hidden=true<CR>",
|
||||
{ desc = "Telescope Find all files" })
|
||||
map("n", "<leader>ps", "<cmd>Telescope live_grep<CR>", { desc = "Telescope Live grep" })
|
||||
map("n", "<leader>pz", "<cmd>Telescope current_buffer_fuzzy_find<CR>", { desc = "Telescope Find in current buffer" })
|
||||
map("n", "<leader>pws", function()
|
||||
local word = vim.fn.expand("<cword>")
|
||||
require('telescope.builtin').grep_string({ search = word })
|
||||
end, { desc = "Telescope Search for current word" })
|
||||
map("n", "<leader>pWs", function()
|
||||
local word = vim.fn.expand("<cWORD>")
|
||||
require('telescope.builtin').grep_string({ search = word })
|
||||
end, { desc = "Telescope Search for current WORD" })
|
||||
map("n", "ws", function()
|
||||
require('telescope.builtin').lsp_document_symbols({ ignore_symbols = 'variable' })
|
||||
end, { desc = "Telescope View workspace symbols" })
|
||||
|
||||
-- Undotree
|
||||
map("n", "<leader>u", "<cmd>UndotreeToggle<CR>", { desc = "Undotree Toggle window Open diagnostics" })
|
||||
|
||||
-- Trouble
|
||||
map("n", "<leader>tt", "<cmd>Trouble diagnostics toggle<CR>", { desc = "Errors Open diagnostics" })
|
||||
map("n", "<leader>tf", "<cmd>Trouble diagnostics toggle filter.buf=0<CR>", { desc = "Errors Open buffer diagnostics" })
|
||||
map("n", "<leader>tl", "<cmd>Trouble loclist toggle<CR>", { desc = "Errors Open location list" })
|
||||
map("n", "<leader>tq", "<cmd>Trouble qflist toggle<CR>", { desc = "Errors Open quickfix fist" })
|
||||
|
||||
-- Fugitive
|
||||
map("n", "<leader>gs", "<cmd>Git<CR>", { desc = "Fugitive Git Toggle window" })
|
||||
map("n", "gu", "<cmd> diffget //2<CR>", { desc = "Fugitive Git grab right" })
|
||||
map("n", "gu", "<cmd> diffget //3<CR>", { desc = "Fugitive Git grab left" })
|
||||
|
||||
-- ZenMode
|
||||
map("n", "<leader>zz", "<cmd>ZenMode<CR>", { desc = "ZenMode Toggle window" })
|
||||
39
lua/options.lua
Normal file
39
lua/options.lua
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
require "nvchad.options"
|
||||
|
||||
local o = vim.o
|
||||
local opt = vim.opt
|
||||
local g = vim.g
|
||||
|
||||
g.mapleader = ' '
|
||||
g.maplocalleader = ' '
|
||||
|
||||
opt.nu = true
|
||||
opt.relativenumber = true
|
||||
|
||||
o.tabstop = 4
|
||||
o.softtabstop = 4
|
||||
o.shiftwidth = 4
|
||||
|
||||
opt.wrap = false
|
||||
|
||||
opt.swapfile = false
|
||||
opt.backup = false
|
||||
opt.undodir = os.getenv("HOME") .. "/.vim/undodir"
|
||||
opt.undofile = true
|
||||
|
||||
opt.hlsearch = false
|
||||
opt.incsearch = true
|
||||
|
||||
opt.termguicolors = true
|
||||
|
||||
opt.scrolloff = 8
|
||||
opt.isfname:append("@-@")
|
||||
|
||||
o.foldcolumn = '0'
|
||||
o.foldlevel = 99
|
||||
o.foldlevelstart = 99
|
||||
o.foldenable = true
|
||||
|
||||
g.undotree_WindowLayout = 4
|
||||
g.undotree_DiffpanelHeight = 15
|
||||
g.undotree_SplitWidth = 60
|
||||
79
lua/plugins/init.lua
Normal file
79
lua/plugins/init.lua
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
return {
|
||||
{ "sitiom/nvim-numbertoggle", lazy = false, },
|
||||
{ "zbirenbaum/copilot.lua", event = "InsertEnter", opts = require("configs.overrides").copilot },
|
||||
{ "junegunn/gv.vim", cmd = { "GV" } },
|
||||
{ "mbbill/undotree", cmd = { "UndotreeToggle" } },
|
||||
{ "nvim-tree/nvim-tree.lua", cmd = { "NvimTreeToggle", "NvimTreeFocus" }, opts = require("configs.nvimtree") },
|
||||
{ "folke/trouble.nvim", cmd = { "Trouble" }, opts = {}, },
|
||||
{ "folke/zen-mode.nvim", keys = { "<leader>zz" }, config = function() require( "configs.zenmode") end },
|
||||
{ "stevearc/conform.nvim", config = function() require("configs.conform") end },
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
dependencies = {
|
||||
{
|
||||
"zbirenbaum/copilot-cmp",
|
||||
config = function()
|
||||
require("copilot_cmp").setup()
|
||||
end,
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
sources = {
|
||||
{ name = "nvim_lsp", group_index = 2 },
|
||||
{ name = "copilot", group_index = 2 },
|
||||
{ name = "luasnip", group_index = 2 },
|
||||
{ name = "buffer", group_index = 2 },
|
||||
{ name = "nvim_lua", group_index = 2 },
|
||||
{ name = "path", group_index = 2 },
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"kylechui/nvim-surround",
|
||||
version = "*",
|
||||
event = "VeryLazy",
|
||||
config = function() require("configs.nvim-surround") end
|
||||
},
|
||||
{
|
||||
"iamcco/markdown-preview.nvim",
|
||||
cmd = { "MarkdownPreview", "MarkdownPreviewToggle", "MarkdownPreviewStop" },
|
||||
ft = { "markdown" },
|
||||
build = function() vim.fn["mkdp#util#install"]() end,
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
"williamboman/mason.nvim",
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
},
|
||||
config = function()
|
||||
require("nvchad.configs.lspconfig").defaults()
|
||||
require("configs.lspconfig")
|
||||
end,
|
||||
},
|
||||
{
|
||||
'tpope/vim-fugitive',
|
||||
keys = {
|
||||
{ "<leader>gs", "<cmd>Git<CR>", desc = "Git Toggle window" },
|
||||
{ "gu", "<cmd>diffget //2<CR>", desc = "Git Diff right side" },
|
||||
{ "gh", "<cmd>diffget //3<CR>", desc = "Git Diff left side" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"ThePrimeagen/harpoon",
|
||||
branch = "harpoon2",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
keys = { "<leader>a", "<C-e>", "<C-j>", "<C-k>", "<C-l>", "<C-;>", "<leader><C-j>", "<leader><C-k>", "<leader><C-l>", "<leader><C-;>" },
|
||||
config = function()
|
||||
require("configs.harpoon")
|
||||
end,
|
||||
},
|
||||
{
|
||||
"kevinhwang91/nvim-ufo",
|
||||
dependencies = { "kevinhwang91/promise-async" },
|
||||
lazy = false,
|
||||
config = function()
|
||||
require("configs.ufo")
|
||||
end
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue