mirror of
https://git.aramjonghu.nl/AramJonghu/nvim.git
synced 2026-03-22 01:39:54 +01:00
fix dots
This commit is contained in:
@@ -16,16 +16,8 @@ vim.opt.rtp:prepend(lazypath)
|
|||||||
|
|
||||||
local lazy_config = require "configs.lazy"
|
local lazy_config = require "configs.lazy"
|
||||||
|
|
||||||
|
|
||||||
-- load plugins
|
-- load plugins
|
||||||
require("lazy").setup({
|
require("lazy").setup({
|
||||||
{
|
|
||||||
"NvChad/NvChad",
|
|
||||||
lazy = false,
|
|
||||||
branch = "v2.5",
|
|
||||||
import = "nvchad.plugins",
|
|
||||||
},
|
|
||||||
|
|
||||||
{ import = "plugins" },
|
{ import = "plugins" },
|
||||||
}, lazy_config)
|
}, lazy_config)
|
||||||
|
|
||||||
@@ -41,3 +33,4 @@ require("configs.set")
|
|||||||
vim.schedule(function()
|
vim.schedule(function()
|
||||||
require "mappings"
|
require "mappings"
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|||||||
+4
-5
@@ -1,7 +1,6 @@
|
|||||||
{
|
{
|
||||||
"CopilotChat.nvim": { "branch": "main", "commit": "834ba1bc71e1a146831be0ebfeb456ad252c3c56" },
|
"CopilotChat.nvim": { "branch": "main", "commit": "dbce8a231d1ac72c68ce00b86b415c9304417102" },
|
||||||
"LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" },
|
"LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" },
|
||||||
"NvChad": { "branch": "v2.5", "commit": "6f25b2739684389ca69ea8229386c098c566c408" },
|
|
||||||
"auto-session": { "branch": "main", "commit": "82630e2f70be140f8dcc75a12e2ee2839e8488c2" },
|
"auto-session": { "branch": "main", "commit": "82630e2f70be140f8dcc75a12e2ee2839e8488c2" },
|
||||||
"base46": { "branch": "v2.5", "commit": "fde7a2cd54599e148d376f82980407c2d24b0fa2" },
|
"base46": { "branch": "v2.5", "commit": "fde7a2cd54599e148d376f82980407c2d24b0fa2" },
|
||||||
"bufresize.nvim": { "branch": "master", "commit": "3b19527ab936d6910484dcc20fb59bdb12322d8b" },
|
"bufresize.nvim": { "branch": "master", "commit": "3b19527ab936d6910484dcc20fb59bdb12322d8b" },
|
||||||
@@ -19,7 +18,7 @@
|
|||||||
"focus.nvim": { "branch": "master", "commit": "d76338e58e49f844e8f6a7aff16a74a2a55a80ef" },
|
"focus.nvim": { "branch": "master", "commit": "d76338e58e49f844e8f6a7aff16a74a2a55a80ef" },
|
||||||
"friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" },
|
"friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" },
|
||||||
"fzf-lua": { "branch": "main", "commit": "1176d512b1390f992c775f08dcb155d4e0ba01cf" },
|
"fzf-lua": { "branch": "main", "commit": "1176d512b1390f992c775f08dcb155d4e0ba01cf" },
|
||||||
"gitsigns.nvim": { "branch": "main", "commit": "fc56fc25cfc3dc3f24266508aa4a7096102eb6a6" },
|
"gitsigns.nvim": { "branch": "main", "commit": "c23bbd3ed2c7a3fdc3399e97e24f9e158f57612f" },
|
||||||
"indent-blankline.nvim": { "branch": "master", "commit": "e10626f7fcd51ccd56d7ffc00883ba7e0aa28f78" },
|
"indent-blankline.nvim": { "branch": "master", "commit": "e10626f7fcd51ccd56d7ffc00883ba7e0aa28f78" },
|
||||||
"lazy.nvim": { "branch": "main", "commit": "f15a93907ddad3d9139aea465ae18336d87f5ce6" },
|
"lazy.nvim": { "branch": "main", "commit": "f15a93907ddad3d9139aea465ae18336d87f5ce6" },
|
||||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "f75e877f5266e87523eb5a18fcde2081820d087b" },
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "f75e877f5266e87523eb5a18fcde2081820d087b" },
|
||||||
@@ -32,10 +31,10 @@
|
|||||||
"nvim-bufdel": { "branch": "main", "commit": "523d58e94e7212fff3e05c247b962dc8f93bcfde" },
|
"nvim-bufdel": { "branch": "main", "commit": "523d58e94e7212fff3e05c247b962dc8f93bcfde" },
|
||||||
"nvim-cmp": { "branch": "main", "commit": "12509903a5723a876abd65953109f926f4634c30" },
|
"nvim-cmp": { "branch": "main", "commit": "12509903a5723a876abd65953109f926f4634c30" },
|
||||||
"nvim-dap": { "branch": "master", "commit": "52302f02fea3a490e55475de52fa4deb8af2eb11" },
|
"nvim-dap": { "branch": "master", "commit": "52302f02fea3a490e55475de52fa4deb8af2eb11" },
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "696ac53289280a29a349f3e68624e23129341126" },
|
"nvim-lspconfig": { "branch": "master", "commit": "75edb91a3d2deabe76a9911cde2c13d411b3b097" },
|
||||||
"nvim-notify": { "branch": "master", "commit": "22f29093eae7785773ee9d543f8750348b1a195c" },
|
"nvim-notify": { "branch": "master", "commit": "22f29093eae7785773ee9d543f8750348b1a195c" },
|
||||||
"nvim-tree.lua": { "branch": "master", "commit": "70825f23db61ecd900c4cfea169bffe931926a9d" },
|
"nvim-tree.lua": { "branch": "master", "commit": "70825f23db61ecd900c4cfea169bffe931926a9d" },
|
||||||
"nvim-treesitter": { "branch": "master", "commit": "824bf8455fd670186986fb3eb46fcaa4c5460949" },
|
"nvim-treesitter": { "branch": "master", "commit": "62911c78a868bac24c8a86f2c1c412d0b799f885" },
|
||||||
"nvim-web-devicons": { "branch": "master", "commit": "402377242b04be3f4f0f3720bd952df86e946c30" },
|
"nvim-web-devicons": { "branch": "master", "commit": "402377242b04be3f4f0f3720bd952df86e946c30" },
|
||||||
"plenary.nvim": { "branch": "master", "commit": "3707cdb1e43f5cea73afb6037e6494e7ce847a66" },
|
"plenary.nvim": { "branch": "master", "commit": "3707cdb1e43f5cea73afb6037e6494e7ce847a66" },
|
||||||
"presence.nvim": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" },
|
"presence.nvim": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" },
|
||||||
|
|||||||
@@ -102,11 +102,11 @@ local servers = {
|
|||||||
"zls",
|
"zls",
|
||||||
}
|
}
|
||||||
|
|
||||||
lspconfig.hyprls.setup {
|
-- lspconfig.hyprls.setup {
|
||||||
root_dir = vim.fs.root( 0, 'hyprland.conf' ),
|
-- root_dir = vim.fs.root( 0, 'hyprland.conf' ),
|
||||||
single_file_support = false,
|
-- single_file_support = false,
|
||||||
filetypes = { "conf" },
|
-- filetypes = { "conf" },
|
||||||
}
|
-- }
|
||||||
|
|
||||||
-- lsps with default config
|
-- lsps with default config
|
||||||
for _, lsp in ipairs(servers) do
|
for _, lsp in ipairs(servers) do
|
||||||
|
|||||||
+2
-2
@@ -27,8 +27,8 @@ vim.opt.updatetime = 50
|
|||||||
|
|
||||||
vim.opt.colorcolumn = "80"
|
vim.opt.colorcolumn = "80"
|
||||||
|
|
||||||
vim.opt.textwidth = 80
|
vim.opt.textwidth = 0
|
||||||
vim.opt.formatoptions = "tcrqnja"
|
vim.opt.formatoptions = "tcrqnj"
|
||||||
|
|
||||||
vim.o.sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions"
|
vim.o.sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions"
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
pcall(function()
|
||||||
|
dofile(vim.g.base46_cache .. "syntax")
|
||||||
|
dofile(vim.g.base46_cache .. "treesitter")
|
||||||
|
end)
|
||||||
|
|
||||||
|
return {
|
||||||
|
ensure_installed = "all",
|
||||||
|
sync_install = false,
|
||||||
|
auto_install = true,
|
||||||
|
highlight = {
|
||||||
|
enable = true,
|
||||||
|
additional_vim_regex_highlighting = false,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
@@ -14,3 +14,7 @@ autocmd('LspAttach', {
|
|||||||
vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts)
|
vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts)
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
vim.filetype.add({
|
||||||
|
pattern = { [".*/hypr/.*%.conf$"] = "hyprlang" },
|
||||||
|
})
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
local autocmd = vim.api.nvim_create_autocmd
|
||||||
|
|
||||||
|
-- user event that loads after UIEnter + only if file buf is there
|
||||||
|
autocmd({ "UIEnter", "BufReadPost", "BufNewFile" }, {
|
||||||
|
group = vim.api.nvim_create_augroup("NvFilePost", { clear = true }),
|
||||||
|
callback = function(args)
|
||||||
|
local file = vim.api.nvim_buf_get_name(args.buf)
|
||||||
|
local buftype = vim.api.nvim_get_option_value("buftype", { buf = args.buf })
|
||||||
|
|
||||||
|
if not vim.g.ui_entered and args.event == "UIEnter" then
|
||||||
|
vim.g.ui_entered = true
|
||||||
|
end
|
||||||
|
|
||||||
|
if file ~= "" and buftype ~= "nofile" and vim.g.ui_entered then
|
||||||
|
vim.api.nvim_exec_autocmds("User", { pattern = "FilePost", modeline = false })
|
||||||
|
vim.api.nvim_del_augroup_by_name "NvFilePost"
|
||||||
|
|
||||||
|
vim.schedule(function()
|
||||||
|
vim.api.nvim_exec_autocmds("FileType", {})
|
||||||
|
|
||||||
|
if vim.g.editorconfig then
|
||||||
|
require("editorconfig").config(args.buf)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
dofile(vim.g.base46_cache .. "cmp")
|
||||||
|
|
||||||
|
local cmp = require "cmp"
|
||||||
|
|
||||||
|
local options = {
|
||||||
|
completion = { completeopt = "menu,menuone" },
|
||||||
|
|
||||||
|
snippet = {
|
||||||
|
expand = function(args)
|
||||||
|
require("luasnip").lsp_expand(args.body)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
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
|
||||||
|
require("luasnip").expand_or_jump()
|
||||||
|
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
|
||||||
|
require("luasnip").jump(-1)
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, { "i", "s" }),
|
||||||
|
},
|
||||||
|
|
||||||
|
sources = {
|
||||||
|
{ name = "nvim_lsp" },
|
||||||
|
{ name = "luasnip" },
|
||||||
|
{ name = "buffer" },
|
||||||
|
{ name = "nvim_lua" },
|
||||||
|
{ name = "path" },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
return vim.tbl_deep_extend("force", options, require "nvchad.cmp")
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
dofile(vim.g.base46_cache .. "git")
|
||||||
|
|
||||||
|
return {
|
||||||
|
signs = {
|
||||||
|
delete = { text = "" },
|
||||||
|
changedelete = { text = "" },
|
||||||
|
},
|
||||||
|
attach_to_untracked = true,
|
||||||
|
}
|
||||||
@@ -0,0 +1,85 @@
|
|||||||
|
local M = {}
|
||||||
|
local map = vim.keymap.set
|
||||||
|
|
||||||
|
-- export on_attach & capabilities
|
||||||
|
M.on_attach = function(_, bufnr)
|
||||||
|
local function opts(desc)
|
||||||
|
return { buffer = bufnr, desc = "LSP " .. desc }
|
||||||
|
end
|
||||||
|
|
||||||
|
map("n", "gD", vim.lsp.buf.declaration, opts "Go to declaration")
|
||||||
|
map("n", "gd", vim.lsp.buf.definition, opts "Go to definition")
|
||||||
|
map("n", "gi", vim.lsp.buf.implementation, opts "Go to implementation")
|
||||||
|
map("n", "<leader>sh", vim.lsp.buf.signature_help, opts "Show signature help")
|
||||||
|
map("n", "<leader>wa", vim.lsp.buf.add_workspace_folder, opts "Add workspace folder")
|
||||||
|
map("n", "<leader>wr", vim.lsp.buf.remove_workspace_folder, opts "Remove workspace folder")
|
||||||
|
|
||||||
|
map("n", "<leader>wl", function()
|
||||||
|
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||||
|
end, opts "List workspace folders")
|
||||||
|
|
||||||
|
map("n", "<leader>D", vim.lsp.buf.type_definition, opts "Go to type definition")
|
||||||
|
map("n", "<leader>ra", require "nvchad.lsp.renamer", opts "NvRenamer")
|
||||||
|
|
||||||
|
map({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, opts "Code action")
|
||||||
|
map("n", "gr", vim.lsp.buf.references, opts "Show references")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- disable semanticTokens
|
||||||
|
M.on_init = function(client, _)
|
||||||
|
if client.supports_method "textDocument/semanticTokens" then
|
||||||
|
client.server_capabilities.semanticTokensProvider = nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
M.capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||||
|
|
||||||
|
M.capabilities.textDocument.completion.completionItem = {
|
||||||
|
documentationFormat = { "markdown", "plaintext" },
|
||||||
|
snippetSupport = true,
|
||||||
|
preselectSupport = true,
|
||||||
|
insertReplaceSupport = true,
|
||||||
|
labelDetailsSupport = true,
|
||||||
|
deprecatedSupport = true,
|
||||||
|
commitCharactersSupport = true,
|
||||||
|
tagSupport = { valueSet = { 1 } },
|
||||||
|
resolveSupport = {
|
||||||
|
properties = {
|
||||||
|
"documentation",
|
||||||
|
"detail",
|
||||||
|
"additionalTextEdits",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
M.defaults = function()
|
||||||
|
dofile(vim.g.base46_cache .. "lsp")
|
||||||
|
require("nvchad.lsp").diagnostic_config()
|
||||||
|
|
||||||
|
require("lspconfig").lua_ls.setup {
|
||||||
|
on_attach = M.on_attach,
|
||||||
|
capabilities = M.capabilities,
|
||||||
|
on_init = M.on_init,
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
diagnostics = {
|
||||||
|
globals = { "vim" },
|
||||||
|
},
|
||||||
|
workspace = {
|
||||||
|
library = {
|
||||||
|
vim.fn.expand "$VIMRUNTIME/lua",
|
||||||
|
vim.fn.expand "$VIMRUNTIME/lua/vim/lsp",
|
||||||
|
vim.fn.stdpath "data" .. "/lazy/ui/nvchad_types",
|
||||||
|
vim.fn.stdpath "data" .. "/lazy/lazy.nvim/lua/lazy",
|
||||||
|
"${3rd}/luv/library",
|
||||||
|
},
|
||||||
|
maxPreload = 100000,
|
||||||
|
preloadFileSize = 10000,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
-- vscode format
|
||||||
|
require("luasnip.loaders.from_vscode").lazy_load { exclude = vim.g.vscode_snippets_exclude or {} }
|
||||||
|
require("luasnip.loaders.from_vscode").lazy_load { paths = vim.g.vscode_snippets_path or "" }
|
||||||
|
|
||||||
|
-- snipmate format
|
||||||
|
require("luasnip.loaders.from_snipmate").load()
|
||||||
|
require("luasnip.loaders.from_snipmate").lazy_load { paths = vim.g.snipmate_snippets_path or "" }
|
||||||
|
|
||||||
|
-- lua format
|
||||||
|
require("luasnip.loaders.from_lua").load()
|
||||||
|
require("luasnip.loaders.from_lua").lazy_load { paths = vim.g.lua_snippets_path or "" }
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("InsertLeave", {
|
||||||
|
callback = function()
|
||||||
|
if
|
||||||
|
require("luasnip").session.current_nodes[vim.api.nvim_get_current_buf()]
|
||||||
|
and not require("luasnip").session.jump_active
|
||||||
|
then
|
||||||
|
require("luasnip").unlink_current()
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
dofile(vim.g.base46_cache .. "mason")
|
||||||
|
|
||||||
|
return {
|
||||||
|
PATH = "skip",
|
||||||
|
|
||||||
|
ui = {
|
||||||
|
icons = {
|
||||||
|
package_pending = " ",
|
||||||
|
package_installed = " ",
|
||||||
|
package_uninstalled = " ",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
max_concurrent_installers = 10,
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
dofile(vim.g.base46_cache .. "nvimtree")
|
||||||
|
|
||||||
|
return {
|
||||||
|
filters = { dotfiles = false },
|
||||||
|
disable_netrw = true,
|
||||||
|
hijack_cursor = true,
|
||||||
|
sync_root_with_cwd = true,
|
||||||
|
update_focused_file = {
|
||||||
|
enable = true,
|
||||||
|
update_root = false,
|
||||||
|
},
|
||||||
|
view = {
|
||||||
|
width = 30,
|
||||||
|
preserve_window_proportions = true,
|
||||||
|
},
|
||||||
|
renderer = {
|
||||||
|
root_folder_label = false,
|
||||||
|
highlight_git = true,
|
||||||
|
indent_markers = { enable = true },
|
||||||
|
icons = {
|
||||||
|
glyphs = {
|
||||||
|
default = "",
|
||||||
|
folder = {
|
||||||
|
default = "",
|
||||||
|
empty = "",
|
||||||
|
empty_open = "",
|
||||||
|
open = "",
|
||||||
|
symlink = "",
|
||||||
|
},
|
||||||
|
git = { unmerged = "" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
dofile(vim.g.base46_cache .. "telescope")
|
||||||
|
|
||||||
|
return {
|
||||||
|
defaults = {
|
||||||
|
prompt_prefix = " ",
|
||||||
|
selection_caret = " ",
|
||||||
|
entry_prefix = " ",
|
||||||
|
sorting_strategy = "ascending",
|
||||||
|
layout_config = {
|
||||||
|
horizontal = {
|
||||||
|
prompt_position = "top",
|
||||||
|
preview_width = 0.55,
|
||||||
|
},
|
||||||
|
width = 0.87,
|
||||||
|
height = 0.80,
|
||||||
|
},
|
||||||
|
mappings = {
|
||||||
|
n = { ["q"] = require("telescope.actions").close },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
extensions_list = { "themes", "terms" },
|
||||||
|
extensions = {},
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
pcall(function()
|
||||||
|
dofile(vim.g.base46_cache .. "syntax")
|
||||||
|
dofile(vim.g.base46_cache .. "treesitter")
|
||||||
|
end)
|
||||||
|
|
||||||
|
return {
|
||||||
|
ensure_installed = { "lua", "luadoc", "printf", "vim", "vimdoc" },
|
||||||
|
|
||||||
|
highlight = {
|
||||||
|
enable = true,
|
||||||
|
use_languagetree = true,
|
||||||
|
},
|
||||||
|
|
||||||
|
indent = { enable = true },
|
||||||
|
}
|
||||||
@@ -0,0 +1,107 @@
|
|||||||
|
local map = vim.keymap.set
|
||||||
|
|
||||||
|
map("i", "<C-b>", "<ESC>^i", { desc = "move beginning of line" })
|
||||||
|
map("i", "<C-e>", "<End>", { desc = "move end of line" })
|
||||||
|
map("i", "<C-h>", "<Left>", { desc = "move left" })
|
||||||
|
map("i", "<C-l>", "<Right>", { desc = "move right" })
|
||||||
|
map("i", "<C-j>", "<Down>", { desc = "move down" })
|
||||||
|
map("i", "<C-k>", "<Up>", { desc = "move up" })
|
||||||
|
|
||||||
|
map("n", "<C-h>", "<C-w>h", { desc = "switch window left" })
|
||||||
|
map("n", "<C-l>", "<C-w>l", { desc = "switch window right" })
|
||||||
|
map("n", "<C-j>", "<C-w>j", { desc = "switch window down" })
|
||||||
|
map("n", "<C-k>", "<C-w>k", { desc = "switch window up" })
|
||||||
|
|
||||||
|
map("n", "<Esc>", "<cmd>noh<CR>", { desc = "general clear highlights" })
|
||||||
|
|
||||||
|
map("n", "<C-s>", "<cmd>w<CR>", { desc = "general save file" })
|
||||||
|
map("n", "<C-c>", "<cmd>%y+<CR>", { desc = "general copy whole file" })
|
||||||
|
|
||||||
|
map("n", "<leader>n", "<cmd>set nu!<CR>", { desc = "toggle line number" })
|
||||||
|
map("n", "<leader>rn", "<cmd>set rnu!<CR>", { desc = "toggle relative number" })
|
||||||
|
map("n", "<leader>ch", "<cmd>NvCheatsheet<CR>", { desc = "toggle nvcheatsheet" })
|
||||||
|
|
||||||
|
map("n", "<leader>fm", function()
|
||||||
|
require("conform").format { lsp_fallback = true }
|
||||||
|
end, { desc = "general format file" })
|
||||||
|
|
||||||
|
-- global lsp mappings
|
||||||
|
map("n", "<leader>ds", vim.diagnostic.setloclist, { desc = "LSP diagnostic loclist" })
|
||||||
|
|
||||||
|
-- tabufline
|
||||||
|
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" })
|
||||||
|
|
||||||
|
-- Comment
|
||||||
|
map("n", "<leader>/", "gcc", { desc = "toggle comment", remap = true })
|
||||||
|
map("v", "<leader>/", "gc", { desc = "toggle comment", remap = true })
|
||||||
|
|
||||||
|
-- nvimtree
|
||||||
|
map("n", "<C-n>", "<cmd>NvimTreeToggle<CR>", { desc = "nvimtree toggle window" })
|
||||||
|
map("n", "<leader>e", "<cmd>NvimTreeFocus<CR>", { desc = "nvimtree focus window" })
|
||||||
|
|
||||||
|
-- telescope
|
||||||
|
map("n", "<leader>fw", "<cmd>Telescope live_grep<CR>", { desc = "telescope live grep" })
|
||||||
|
map("n", "<leader>fb", "<cmd>Telescope buffers<CR>", { desc = "telescope find buffers" })
|
||||||
|
map("n", "<leader>fh", "<cmd>Telescope help_tags<CR>", { desc = "telescope help page" })
|
||||||
|
map("n", "<leader>ma", "<cmd>Telescope marks<CR>", { desc = "telescope find marks" })
|
||||||
|
map("n", "<leader>fo", "<cmd>Telescope oldfiles<CR>", { desc = "telescope find oldfiles" })
|
||||||
|
map("n", "<leader>fz", "<cmd>Telescope current_buffer_fuzzy_find<CR>", { desc = "telescope find in current buffer" })
|
||||||
|
map("n", "<leader>cm", "<cmd>Telescope git_commits<CR>", { desc = "telescope git commits" })
|
||||||
|
map("n", "<leader>gt", "<cmd>Telescope git_status<CR>", { desc = "telescope git status" })
|
||||||
|
map("n", "<leader>pt", "<cmd>Telescope terms<CR>", { desc = "telescope pick hidden term" })
|
||||||
|
|
||||||
|
map("n", "<leader>th", function()
|
||||||
|
require("nvchad.themes").open()
|
||||||
|
end, { desc = "telescope nvchad themes" })
|
||||||
|
|
||||||
|
map("n", "<leader>ff", "<cmd>Telescope find_files<cr>", { desc = "telescope find files" })
|
||||||
|
map(
|
||||||
|
"n",
|
||||||
|
"<leader>fa",
|
||||||
|
"<cmd>Telescope find_files follow=true no_ignore=true hidden=true<CR>",
|
||||||
|
{ desc = "telescope find all files" }
|
||||||
|
)
|
||||||
|
|
||||||
|
-- terminal
|
||||||
|
map("t", "<C-x>", "<C-\\><C-N>", { desc = "terminal escape terminal mode" })
|
||||||
|
|
||||||
|
-- new terminals
|
||||||
|
map("n", "<leader>h", function()
|
||||||
|
require("nvchad.term").new { pos = "sp" }
|
||||||
|
end, { desc = "terminal new horizontal term" })
|
||||||
|
|
||||||
|
map("n", "<leader>v", function()
|
||||||
|
require("nvchad.term").new { pos = "vsp" }
|
||||||
|
end, { desc = "terminal new vertical term" })
|
||||||
|
|
||||||
|
-- toggleable
|
||||||
|
map({ "n", "t" }, "<A-v>", function()
|
||||||
|
require("nvchad.term").toggle { pos = "vsp", id = "vtoggleTerm" }
|
||||||
|
end, { desc = "terminal toggleable vertical term" })
|
||||||
|
|
||||||
|
map({ "n", "t" }, "<A-h>", function()
|
||||||
|
require("nvchad.term").toggle { pos = "sp", id = "htoggleTerm" }
|
||||||
|
end, { desc = "terminal toggleable horizontal term" })
|
||||||
|
|
||||||
|
map({ "n", "t" }, "<A-i>", function()
|
||||||
|
require("nvchad.term").toggle { pos = "float", id = "floatTerm" }
|
||||||
|
end, { desc = "terminal toggle floating term" })
|
||||||
|
|
||||||
|
-- whichkey
|
||||||
|
map("n", "<leader>wK", "<cmd>WhichKey <CR>", { desc = "whichkey all keymaps" })
|
||||||
|
|
||||||
|
map("n", "<leader>wk", function()
|
||||||
|
vim.cmd("WhichKey " .. vim.fn.input "WhichKey: ")
|
||||||
|
end, { desc = "whichkey query lookup" })
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
-------------------------------------- options
|
||||||
|
---------------------------------------------
|
||||||
@@ -0,0 +1,169 @@
|
|||||||
|
return {
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
|
||||||
|
{
|
||||||
|
"nvchad/base46",
|
||||||
|
build = function()
|
||||||
|
require("base46").load_all_highlights()
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"nvchad/ui",
|
||||||
|
lazy = false,
|
||||||
|
config = function()
|
||||||
|
require "nvchad"
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
"nvzone/volt",
|
||||||
|
"nvzone/menu",
|
||||||
|
{ "nvzone/minty", cmd = { "Huefy", "Shades" } },
|
||||||
|
|
||||||
|
{
|
||||||
|
"nvim-tree/nvim-web-devicons",
|
||||||
|
opts = function()
|
||||||
|
dofile(vim.g.base46_cache .. "devicons")
|
||||||
|
return { override = require "nvchad.icons.devicons" }
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"lukas-reineke/indent-blankline.nvim",
|
||||||
|
event = "User FilePost",
|
||||||
|
opts = {
|
||||||
|
indent = { char = "│", highlight = "IblChar" },
|
||||||
|
scope = { char = "│", highlight = "IblScopeChar" },
|
||||||
|
},
|
||||||
|
config = function(_, opts)
|
||||||
|
dofile(vim.g.base46_cache .. "blankline")
|
||||||
|
|
||||||
|
local hooks = require "ibl.hooks"
|
||||||
|
hooks.register(hooks.type.WHITESPACE, hooks.builtin.hide_first_space_indent_level)
|
||||||
|
require("ibl").setup(opts)
|
||||||
|
|
||||||
|
dofile(vim.g.base46_cache .. "blankline")
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- file managing , picker etc
|
||||||
|
{
|
||||||
|
"nvim-tree/nvim-tree.lua",
|
||||||
|
cmd = { "NvimTreeToggle", "NvimTreeFocus" },
|
||||||
|
opts = function()
|
||||||
|
return require "nvchad.configs.nvimtree"
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"folke/which-key.nvim",
|
||||||
|
keys = { "<leader>", "<c-w>", '"', "'", "`", "c", "v", "g" },
|
||||||
|
cmd = "WhichKey",
|
||||||
|
opts = function()
|
||||||
|
dofile(vim.g.base46_cache .. "whichkey")
|
||||||
|
return {}
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- formatting!
|
||||||
|
{
|
||||||
|
"stevearc/conform.nvim",
|
||||||
|
opts = {
|
||||||
|
formatters_by_ft = { lua = { "stylua" } },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- git stuff
|
||||||
|
{
|
||||||
|
"lewis6991/gitsigns.nvim",
|
||||||
|
event = "User FilePost",
|
||||||
|
opts = function()
|
||||||
|
return require "nvchad.configs.gitsigns"
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- lsp stuff
|
||||||
|
{
|
||||||
|
"williamboman/mason.nvim",
|
||||||
|
cmd = { "Mason", "MasonInstall", "MasonUpdate" },
|
||||||
|
opts = function()
|
||||||
|
return require "nvchad.configs.mason"
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
event = "User FilePost",
|
||||||
|
config = function()
|
||||||
|
require("nvchad.configs.lspconfig").defaults()
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- load luasnips + cmp related in insert mode only
|
||||||
|
{
|
||||||
|
"hrsh7th/nvim-cmp",
|
||||||
|
event = "InsertEnter",
|
||||||
|
dependencies = {
|
||||||
|
{
|
||||||
|
-- snippet plugin
|
||||||
|
"L3MON4D3/LuaSnip",
|
||||||
|
dependencies = "rafamadriz/friendly-snippets",
|
||||||
|
opts = { history = true, updateevents = "TextChanged,TextChangedI" },
|
||||||
|
config = function(_, opts)
|
||||||
|
require("luasnip").config.set_config(opts)
|
||||||
|
require "nvchad.configs.luasnip"
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- autopairing of (){}[] etc
|
||||||
|
{
|
||||||
|
"windwp/nvim-autopairs",
|
||||||
|
opts = {
|
||||||
|
fast_wrap = {},
|
||||||
|
disable_filetype = { "TelescopePrompt", "vim" },
|
||||||
|
},
|
||||||
|
config = function(_, opts)
|
||||||
|
require("nvim-autopairs").setup(opts)
|
||||||
|
|
||||||
|
-- setup cmp for autopairs
|
||||||
|
local cmp_autopairs = require "nvim-autopairs.completion.cmp"
|
||||||
|
require("cmp").event:on("confirm_done", cmp_autopairs.on_confirm_done())
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- cmp sources plugins
|
||||||
|
{
|
||||||
|
"saadparwaiz1/cmp_luasnip",
|
||||||
|
"hrsh7th/cmp-nvim-lua",
|
||||||
|
"hrsh7th/cmp-nvim-lsp",
|
||||||
|
"hrsh7th/cmp-buffer",
|
||||||
|
"hrsh7th/cmp-path",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
opts = function()
|
||||||
|
return require "nvchad.configs.cmp"
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"nvim-telescope/telescope.nvim",
|
||||||
|
dependencies = { "nvim-treesitter/nvim-treesitter" },
|
||||||
|
cmd = "Telescope",
|
||||||
|
opts = function()
|
||||||
|
return require "nvchad.configs.telescope"
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- {
|
||||||
|
-- "nvim-treesitter/nvim-treesitter",
|
||||||
|
-- event = { "BufReadPost", "BufNewFile" },
|
||||||
|
-- cmd = { "TSInstall", "TSBufEnable", "TSBufDisable", "TSModuleInfo" },
|
||||||
|
-- build = ":TSUpdate",
|
||||||
|
-- opts = function()
|
||||||
|
-- return require "nvchad.configs.treesitter"
|
||||||
|
-- end,
|
||||||
|
-- config = function(_, opts)
|
||||||
|
-- require("nvim-treesitter.configs").setup(opts)
|
||||||
|
-- end,
|
||||||
|
-- },
|
||||||
|
}
|
||||||
+144
-6
@@ -144,14 +144,152 @@ return {
|
|||||||
|
|
||||||
{
|
{
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
opts = function()
|
||||||
|
require "configs.treesitter"
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"nvchad/base46",
|
||||||
|
build = function()
|
||||||
|
require("base46").load_all_highlights()
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"nvchad/ui",
|
||||||
|
lazy = false,
|
||||||
|
config = function()
|
||||||
|
require "nvchad"
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
"nvzone/volt",
|
||||||
|
"nvzone/menu",
|
||||||
|
{ "nvzone/minty", cmd = { "Huefy", "Shades" } },
|
||||||
|
|
||||||
|
{
|
||||||
|
"nvim-tree/nvim-web-devicons",
|
||||||
|
opts = function()
|
||||||
|
dofile(vim.g.base46_cache .. "devicons")
|
||||||
|
return { override = require "nvchad.icons.devicons" }
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"lukas-reineke/indent-blankline.nvim",
|
||||||
|
event = "User FilePost",
|
||||||
opts = {
|
opts = {
|
||||||
ensure_installed = "all",
|
indent = { char = "│", highlight = "IblChar" },
|
||||||
sync_install = false,
|
scope = { char = "│", highlight = "IblScopeChar" },
|
||||||
auto_install = true,
|
},
|
||||||
highlight = {
|
config = function(_, opts)
|
||||||
enable = true,
|
dofile(vim.g.base46_cache .. "blankline")
|
||||||
additional_vim_regex_highlighting = false,
|
|
||||||
|
local hooks = require "ibl.hooks"
|
||||||
|
hooks.register(hooks.type.WHITESPACE, hooks.builtin.hide_first_space_indent_level)
|
||||||
|
require("ibl").setup(opts)
|
||||||
|
|
||||||
|
dofile(vim.g.base46_cache .. "blankline")
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- file managing , picker etc
|
||||||
|
{
|
||||||
|
"nvim-tree/nvim-tree.lua",
|
||||||
|
cmd = { "NvimTreeToggle", "NvimTreeFocus" },
|
||||||
|
opts = function()
|
||||||
|
return require "nvchad.configs.nvimtree"
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"folke/which-key.nvim",
|
||||||
|
keys = { "<leader>", "<c-w>", '"', "'", "`", "c", "v", "g" },
|
||||||
|
cmd = "WhichKey",
|
||||||
|
opts = function()
|
||||||
|
dofile(vim.g.base46_cache .. "whichkey")
|
||||||
|
return {}
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- git stuff
|
||||||
|
{
|
||||||
|
"lewis6991/gitsigns.nvim",
|
||||||
|
event = "User FilePost",
|
||||||
|
opts = function()
|
||||||
|
return require "nvchad.configs.gitsigns"
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- lsp stuff
|
||||||
|
{
|
||||||
|
"williamboman/mason.nvim",
|
||||||
|
cmd = { "Mason", "MasonInstall", "MasonUpdate" },
|
||||||
|
opts = function()
|
||||||
|
return require "nvchad.configs.mason"
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
event = "User FilePost",
|
||||||
|
config = function()
|
||||||
|
require("nvchad.configs.lspconfig").defaults()
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- load luasnips + cmp related in insert mode only
|
||||||
|
{
|
||||||
|
"hrsh7th/nvim-cmp",
|
||||||
|
event = "InsertEnter",
|
||||||
|
dependencies = {
|
||||||
|
{
|
||||||
|
-- snippet plugin
|
||||||
|
"L3MON4D3/LuaSnip",
|
||||||
|
dependencies = "rafamadriz/friendly-snippets",
|
||||||
|
opts = { history = true, updateevents = "TextChanged,TextChangedI" },
|
||||||
|
config = function(_, opts)
|
||||||
|
require("luasnip").config.set_config(opts)
|
||||||
|
require "nvchad.configs.luasnip"
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- autopairing of (){}[] etc
|
||||||
|
{
|
||||||
|
"windwp/nvim-autopairs",
|
||||||
|
opts = {
|
||||||
|
fast_wrap = {},
|
||||||
|
disable_filetype = { "TelescopePrompt", "vim" },
|
||||||
|
},
|
||||||
|
config = function(_, opts)
|
||||||
|
require("nvim-autopairs").setup(opts)
|
||||||
|
|
||||||
|
-- setup cmp for autopairs
|
||||||
|
local cmp_autopairs = require "nvim-autopairs.completion.cmp"
|
||||||
|
require("cmp").event:on("confirm_done", cmp_autopairs.on_confirm_done())
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- cmp sources plugins
|
||||||
|
{
|
||||||
|
"saadparwaiz1/cmp_luasnip",
|
||||||
|
"hrsh7th/cmp-nvim-lua",
|
||||||
|
"hrsh7th/cmp-nvim-lsp",
|
||||||
|
"hrsh7th/cmp-buffer",
|
||||||
|
"hrsh7th/cmp-path",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
opts = function()
|
||||||
|
return require "nvchad.configs.cmp"
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"nvim-telescope/telescope.nvim",
|
||||||
|
dependencies = { "nvim-treesitter/nvim-treesitter" },
|
||||||
|
cmd = "Telescope",
|
||||||
|
opts = function()
|
||||||
|
return require "nvchad.configs.telescope"
|
||||||
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user