[wip] rebuild from scratch

scratch
Gabe Farrell 2 years ago
parent 5c607d047b
commit 91ba5541a3

@ -1,39 +1,45 @@
vim.g.base46_cache = vim.fn.stdpath "data" .. "/nvchad/base46/" vim.g.loaded_netrw = 1
vim.g.mapleader = " " vim.g.loaded_netrwPlugin = 1
vim.opt.termguicolors = true
-- bootstrap lazy and all plugins -- nvchad ui stuff
local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim" vim.g.base46_cache = vim.fn.stdpath('data') .. '/base46_cache/'
if not vim.loop.fs_stat(lazypath) then vim.g.mapleader = " "
local repo = "https://github.com/folke/lazy.nvim.git" vim.keymap.set({'n', 'v'}, "<Left>", "")
vim.fn.system { "git", "clone", "--filter=blob:none", repo, "--branch=stable", lazypath } vim.keymap.set({'n', 'v'}, "<Down>", "")
vim.keymap.set({'n', 'v'}, "<Up>", "")
vim.keymap.set({'n', 'v'}, "<Right>", "")
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end end
vim.opt.rtp:prepend(lazypath) vim.opt.rtp:prepend(lazypath)
require("lazy").setup({ import = "plugins" })
local lazy_config = require "configs.lazy" -- more nvchad ui stuff
-- dofile(vim.g.base46_cache .. "defaults")
-- dofile(vim.g.base46_cache .. "syntax")
-- dofile(vim.g.base46_cache .. "treesitter")
-- dofile(vim.g.base46_cache .. "git")
-- dofile(vim.g.base46_cache .. "nvimtree")
-- load plugins -- or if you want to load all base46 integrations at startup itself
require("lazy").setup({ local integrations = require("nvconfig").base46.integrations
{
"NvChad/NvChad",
lazy = false,
branch = "v2.5",
import = "nvchad.plugins",
config = function()
require "options"
end,
},
{ import = "plugins" }, for _, name in ipairs(integrations) do
}, lazy_config) dofile(vim.g.base46_cache .. name)
end
-- load theme
dofile(vim.g.base46_cache .. "defaults")
dofile(vim.g.base46_cache .. "statusline")
require "nvchad.autocmds"
vim.schedule(function() vim.o.number = true
require "mappings" -- require("nvim-tree.api").tree.open() -- open tree on start
end) require "options"
require "remaps"

@ -1,34 +1,22 @@
{ {
"Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
"LuaSnip": { "branch": "master", "commit": "be7be2ca7f55bb881a7ffc16b2efa5af034ab06b" }, "LuaSnip": { "branch": "master", "commit": "be7be2ca7f55bb881a7ffc16b2efa5af034ab06b" },
"NvChad": { "branch": "v2.5", "commit": "0b1f669caa312ca11be79b3833296d1271bf4c75" },
"base46": { "branch": "v2.5", "commit": "adb64a6ae70f8c61c5ab8892f07d29dafd4d47ad" }, "base46": { "branch": "v2.5", "commit": "adb64a6ae70f8c61c5ab8892f07d29dafd4d47ad" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
"cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, "conform.nvim": { "branch": "master", "commit": "820eec990d5f332d30cf939954c8672a43a0459e" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
"conform.nvim": { "branch": "master", "commit": "9d5ba06d6ee7418c674f498634617416d15b6239" },
"friendly-snippets": { "branch": "main", "commit": "ea068f1becd91bcd4591fceb6420d4335e2e14d3" },
"gitsigns.nvim": { "branch": "main", "commit": "d96ef3bbff0bdbc3916a220f5c74a04c4db033f2" }, "gitsigns.nvim": { "branch": "main", "commit": "d96ef3bbff0bdbc3916a220f5c74a04c4db033f2" },
"go.nvim": { "branch": "master", "commit": "591a0b837420f27c734600fa5c6de87f18352e50" },
"guihua.lua": { "branch": "master", "commit": "3b3126ae87c254f6849e708549ba76c39e3f42f8" },
"indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" },
"lazy.nvim": { "branch": "main", "commit": "31ddbea7c10b6920c9077b66c97951ca8682d5c8" }, "lazy.nvim": { "branch": "main", "commit": "31ddbea7c10b6920c9077b66c97951ca8682d5c8" },
"markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, "lsp-zero.nvim": { "branch": "v3.x", "commit": "ca9eaccc154578064366d99de7b02f8231c383eb" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "44509689b9bf3984d729cc264aacb31cb7f41668" },
"mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" }, "mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" },
"nvim-autopairs": { "branch": "master", "commit": "4f41e5940bc0443fdbe5f995e2a596847215cd2a" },
"nvim-cmp": { "branch": "main", "commit": "ce16de5665c766f39c271705b17fff06f7bcb84f" }, "nvim-cmp": { "branch": "main", "commit": "ce16de5665c766f39c271705b17fff06f7bcb84f" },
"nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" }, "nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" },
"nvim-lspconfig": { "branch": "master", "commit": "b3014f2209503944f2714cf27c95591433a0c7d8" }, "nvim-lspconfig": { "branch": "master", "commit": "b3014f2209503944f2714cf27c95591433a0c7d8" },
"nvim-tree.lua": { "branch": "master", "commit": "81eb8d519233c105f30dc0a278607e62b20502fd" }, "nvim-tree.lua": { "branch": "master", "commit": "ddd1d6eb21c45433bdc65cc8015f2457998f2bf2" },
"nvim-treesitter": { "branch": "master", "commit": "ef267f0c285928ea3a0d3362a260a0728fd4a146" }, "nvim-treesitter": { "branch": "master", "commit": "f08a9d97f7a2ac02115a5c1c8e3973b2634d996b" },
"nvim-web-devicons": { "branch": "master", "commit": "6e355632387a085f15a66ad68cf681c1d7374a04" }, "nvim-web-devicons": { "branch": "master", "commit": "6e355632387a085f15a66ad68cf681c1d7374a04" },
"plenary.nvim": { "branch": "master", "commit": "8aad4396840be7fc42896e3011751b7609ca4119" }, "plenary.nvim": { "branch": "master", "commit": "8aad4396840be7fc42896e3011751b7609ca4119" },
"telescope.nvim": { "branch": "master", "commit": "5a701e99906961218b55d7ad6c2a998f066c6fe0" }, "telescope.nvim": { "branch": "master", "commit": "4d4ade7f2b8f403e8816ca50c05ed16e259b21fb" },
"todo-comments.nvim": { "branch": "main", "commit": "a7e39ae9e74f2c8c6dc4eea6d40c3971ae84752d" }, "ui": { "branch": "v2.5", "commit": "e1af69426b3c4b55c88bd1c81790c1c73b30bfa8" }
"trouble.nvim": { "branch": "dev", "commit": "10eff94809ecd6ee6cc59f42e9521b9b8a14e9ce" },
"ui": { "branch": "v2.5", "commit": "e1af69426b3c4b55c88bd1c81790c1c73b30bfa8" },
"vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" },
"which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" }
} }

@ -0,0 +1,23 @@
local lsp_zero = require('lsp-zero')
lsp_zero.on_attach(function(client, bufnr)
-- see :help lsp-zero-keybindings
-- to learn the available actions
lsp_zero.default_keymaps({buffer = bufnr})
end)
-- here you can setup the language servers
require('mason').setup({})
require('mason-lspconfig').setup({
ensure_installed = {
'tsserver',
'rust_analyzer',
'gopls',
'clangd',
}
handlers = {
function(server_name)
require('lspconfig')[server_name].setup({})
end,
}
})

@ -1,42 +1,6 @@
-- This file needs to have same structure as nvconfig.lua -- this file exists so base64 telescope theme swap works :P
-- https://github.com/NvChad/NvChad/blob/v2.5/lua/nvconfig.lua
---@type ChadrcConfig
local M = {} local M = {}
M.ui = { M.ui = { theme = "your_needy_pop_star" }
theme = "your_needy_pop_star",
hl_override = {
Comment = { italic = true },
["@comment"] = { italic = true },
},
tabufline = {
lazyload = false,
},
nvdash = {
load_on_startup = true,
header = {
[[ ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ]],
[[ ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ]],
[[ ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ]],
[[ ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ]],
[[ ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ]],
[[ ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ]],
},
buttons = {
{ " Find File", "Spc f f", "Telescope find_files" },
{ "󰈚 Recent Files", "Spc f o", "Telescope oldfiles" },
{ "󰈭 Find Word", "Spc f w", "Telescope live_grep" },
{ " Bookmarks", "Spc m a", "Telescope marks" },
{ " Themes", "Spc t h", "Telescope themes" },
{ " Mappings", "Spc c h", "NvCheatsheet" },
},
},
telescope = {
style = "bordered",
},
}
return M return M

@ -1,15 +0,0 @@
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)

@ -0,0 +1,24 @@
return {
signs = {
add = { text = "" },
change = { text = "" },
delete = { text = "󰍵" },
topdelete = { text = "" },
changedelete = { text = "~" },
untracked = { text = "" },
},
on_attach = function(bufnr)
local gs = package.loaded.gitsigns
local function opts(desc)
return { buffer = bufnr, desc = desc }
end
local map = vim.keymap.set
map("n", "<leader>rh", gs.reset_hunk, opts "Reset Hunk")
map("n", "<leader>ph", gs.preview_hunk, opts "Preview Hunk")
map("n", "<leader>gb", gs.blame_line, opts "Blame Line")
end,
}

@ -1 +0,0 @@
require("go").setup()

@ -1,47 +0,0 @@
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",
},
},
},
}

@ -1,62 +0,0 @@
local map = vim.keymap.set
local conf = require("nvconfig").ui.lsp
local on_attach = function(client, bufnr)
local function opts(desc)
return { buffer = bufnr, desc = desc }
end
map("n", "gD", vim.lsp.buf.declaration, opts "Lsp Go to declaration")
map("n", "gd", vim.lsp.buf.definition, opts "Lsp Go to definition")
map("n", "K", vim.lsp.buf.hover, opts "Lsp hover information")
map("n", "gi", vim.lsp.buf.implementation, opts "Lsp Go to implementation")
map("n", "<leader>sh", vim.lsp.buf.signature_help, opts "Lsp Show signature help")
map("n", "<leader>wa", vim.lsp.buf.add_workspace_folder, opts "Lsp Add workspace folder")
map("n", "<leader>wr", vim.lsp.buf.remove_workspace_folder, opts "Lsp Remove workspace folder")
map("n", "<leader>wl", function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, opts "Lsp List workspace folders")
map("n", "<leader>D", vim.lsp.buf.type_definition, opts "Lsp Go to type definition")
map("n", "<leader>ra", function()
require "nvchad.lsp.renamer"()
end, opts "Lsp NvRenamer")
map({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, opts "Lsp Code action")
map("n", "gr", "<cmd>Telescope lsp_references<CR>", opts "[G]et [R]eferences")
-- setup signature popup
if conf.signature and client.server_capabilities.signatureHelpProvider then
require("nvchad.lsp.signature").setup(client, bufnr)
end
end
local on_init = require("nvchad.configs.lspconfig").on_init
local capabilities = require("nvchad.configs.lspconfig").capabilities
local lspconfig = require "lspconfig"
local servers = { "html", "cssls", "gopls", "tsserver" }
-- lsps with default config
for _, lsp in ipairs(servers) do
lspconfig[lsp].setup {
on_attach = on_attach,
on_init = on_init,
capabilities = capabilities,
}
end
-- rust
lspconfig.rust_analyzer.setup {
settings = {
["rust-analyzer"] = {},
},
}
-- typescript
-- lspconfig.tsserver.setup {
-- on_attach = on_attach,
-- on_init = on_init,
-- capabilities = capabilities,
-- }

@ -0,0 +1,27 @@
local function on_attach(bufnr)
local api = require "nvim-tree.api"
api.config.mappings.default_on_attach(bufnr)
end
local M = {
disable_netrw = true,
on_attach = on_attach,
git = { ignore = false },
renderer = {
icons = {
glyphs = {
git = { -- this is so stupid lmao
unstaged = "😴",
staged = "😎",
unmerged = "😈",
untracked = "😭",
renamed = "😶",
deleted = "😵",
},
},
},
},
}
return M

@ -0,0 +1,12 @@
return {
ensure_installed = {
"lua", "luadoc", "printf",
"vim", "vimdoc", "go",
"ruby", "rust", "cpp",
},
highlight = {
enable = true,
use_languagetree = true,
},
indent = { { enable = true } },
}

@ -1,31 +0,0 @@
require "nvchad.mappings"
-- add yours here
local map = vim.keymap.set
-- disable arrow keys
map("n", "<Up>", "<nop>")
map("n", "<Down>", "<nop>")
map("n", "<Left>", "<nop>")
map("n", "<Right>", "<nop>")
map("n", ";", ":", { desc = "CMD enter command mode" })
map("i", "jk", "<ESC>")
-- custom Leader binds
map("n", "<Leader>sd", ":s/", { desc = "Shortcut to sed" })
map("n", "<Leader>qq", ":qa<CR>", { desc = "Write all and quit all" })
-- map({ "n", "i", "v" }, "<C-s>", "<cmd> w <cr>")
vim.keymap.set("n", "]t", function()
require("todo-comments").jump_next()
end, { desc = "Next todo comment" })
vim.keymap.set("n", "[t", function()
require("todo-comments").jump_prev()
end, { desc = "Previous todo comment" })
map("n", "<Leader>tt", ":TodoTelescope<CR>", { desc = "View [T]odos in [T]elescope" })
-- map("n", "<Leader>tT", ":TodoTrouble<CR>", { desc = "View [t]odos in [T]rouble" })
-- map("n", "gr", "<cmd>Telescope lsp_references<CR>", { desc = "[G]oto [R]eferences" })

@ -0,0 +1,99 @@
local M = {}
M.ui = {
------------------------------- base46 -------------------------------------
-- hl = highlights
hl_add = {},
hl_override = {
Comment = { italic = true },
['@comment'] = { italic = true },
},
changed_themes = {},
theme_toggle = { "onedark", "one_light" },
theme = "yoru", -- default theme (chadrc.lua controls theme, not this)
transparency = false,
cmp = {
icons = true,
lspkind_text = true,
style = "default", -- default/flat_light/flat_dark/atom/atom_colored
},
telescope = { style = "bordered" }, -- borderless / bordered
------------------------------- nvchad_ui modules -----------------------------
statusline = {
theme = "default", -- default/vscode/vscode_colored/minimal
-- default/round/block/arrow separators work only for default statusline theme
-- round and block will work for minimal theme only
separator_style = "default",
order = nil,
modules = nil,
},
-- lazyload it when there are 1+ buffers
tabufline = {
enabled = true,
lazyload = false,
order = { "treeOffset", "buffers", "tabs", "btns" },
modules = nil,
},
nvdash = {
load_on_startup = true,
header = {
[[ ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ]],
[[ ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ]],
[[ ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ]],
[[ ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ]],
[[ ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ]],
[[ ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ]], },
buttons = {
{ " Find File", "Spc f f", "Telescope find_files" },
{ "󰈚 Recent Files", "Spc f o", "Telescope oldfiles" },
{ "󰈭 Find Word", "Spc f w", "Telescope live_grep" },
{ " Bookmarks", "Spc m a", "Telescope marks" },
{ " Themes", "Spc t h", "Telescope themes" },
{ " Mappings", "Spc c h", "NvCheatsheet" },
},
},
cheatsheet = { theme = "grid" }, -- simple/grid
lsp = { signature = true },
term = {
hl = "Normal:term,WinSeparator:WinSeparator",
sizes = { sp = 0.3, vsp = 0.2 },
float = {
relative = "editor",
row = 0.3,
col = 0.25,
width = 0.5,
height = 0.4,
border = "single",
},
},
}
M.base46 = {
integrations = {
"nvimtree",
"treesitter",
"blankline",
"git",
"lsp",
"nvdash",
"syntax",
"statusline",
"tbline",
"telescope",
"devicons",
"mason",
"defaults",
},
}
return M

@ -1,71 +1,53 @@
require "nvchad.options"
-- add yours here!
vim.o.mouse = "nv" vim.o.mouse = "nv"
vim.o.mousemodel = "extend" vim.o.mousemodel = "extend"
-- tabsize
-- vim.opt.shiftwidth = 4
-- vim.opt.tabstop = 4
-- optimization for WSL -- optimization for WSL
vim.api.nvim_create_autocmd({ "BufReadPost", "BufNewFile" }, { -- vim.api.nvim_create_autocmd({ "BufReadPost", "BufNewFile" }, {
once = true, -- once = true,
callback = function() -- callback = function()
if vim.fn.has "win32" == 1 or vim.fn.has "wsl" == 1 then -- if vim.fn.has "win32" == 1 or vim.fn.has "wsl" == 1 then
vim.g.clipboard = { -- vim.g.clipboard = {
copy = { -- copy = {
["+"] = "win32yank.exe -i --crlf", -- ["+"] = "win32yank.exe -i --crlf",
["*"] = "win32yank.exe -i --crlf", -- ["*"] = "win32yank.exe -i --crlf",
}, -- },
paste = { -- paste = {
["+"] = "win32yank.exe -o --lf", -- ["+"] = "win32yank.exe -o --lf",
["*"] = "win32yank.exe -o --lf", -- ["*"] = "win32yank.exe -o --lf",
}, -- },
} -- }
elseif vim.fn.has "unix" == 1 then -- elseif vim.fn.has "unix" == 1 then
if vim.fn.executable "xclip" == 1 then -- if vim.fn.executable "xclip" == 1 then
vim.g.clipboard = { -- vim.g.clipboard = {
copy = { -- copy = {
["+"] = "xclip -selection clipboard", -- ["+"] = "xclip -selection clipboard",
["*"] = "xclip -selection clipboard", -- ["*"] = "xclip -selection clipboard",
}, -- },
paste = { -- paste = {
["+"] = "xclip -selection clipboard -o", -- ["+"] = "xclip -selection clipboard -o",
["*"] = "xclip -selection clipboard -o", -- ["*"] = "xclip -selection clipboard -o",
}, -- },
} -- }
elseif vim.fn.executable "xsel" == 1 then -- elseif vim.fn.executable "xsel" == 1 then
vim.g.clipboard = { -- vim.g.clipboard = {
copy = { -- copy = {
["+"] = "xsel --clipboard --input", -- ["+"] = "xsel --clipboard --input",
["*"] = "xsel --clipboard --input", -- ["*"] = "xsel --clipboard --input",
}, -- },
paste = { -- paste = {
["+"] = "xsel --clipboard --output", -- ["+"] = "xsel --clipboard --output",
["*"] = "xsel --clipboard --output", -- ["*"] = "xsel --clipboard --output",
}, -- },
} -- }
end -- end
end -- end
-- vim.opt.clipboard = "unnamedplus"
vim.opt.clipboard = "unnamedplus" -- end,
end, -- desc = "Lazy load clipboard",
desc = "Lazy load clipboard", --})
})
-- enable cursor line
-- go.nvim opts vim.o.cursorlineopt = "both"
local format_sync_grp = vim.api.nvim_create_augroup("goimports", {})
vim.api.nvim_create_autocmd("BufWritePre", {
pattern = "*.go",
callback = function()
require("go.format").goimports()
end,
group = format_sync_grp,
})
local o = vim.o
o.cursorlineopt = "both" -- to enable cursorline!
-- Highlight on yank -- Highlight on yank
vim.api.nvim_create_autocmd("TextYankPost", { vim.api.nvim_create_autocmd("TextYankPost", {
@ -75,5 +57,3 @@ vim.api.nvim_create_autocmd("TextYankPost", {
vim.highlight.on_yank { timeout = 500 } vim.highlight.on_yank { timeout = 500 }
end, end,
}) })
-- require("nvim-tree").setup(require "configs.nvimtree")

@ -0,0 +1,8 @@
return {
"NvChad/base46",
branch = "v2.5",
lazy = true,
build = function()
require("base46").load_all_highlights()
end,
}

@ -1,30 +0,0 @@
return {
"hrsh7th/nvim-cmp",
config = function(_, opts)
local cmp = require "cmp"
opts.mapping["<CR>"] = cmp.mapping {
i = function(fallback)
if cmp.visible() and cmp.get_active_entry() then
cmp.confirm { behavior = cmp.ConfirmBehavior.Replace, select = false }
else
fallback()
end
end,
s = cmp.mapping.confirm { select = true },
c = cmp.mapping.confirm { behavior = cmp.ConfirmBehavior.Replace, select = true },
}
opts.mapping["<Tab>"] = cmp.mapping(function(fallback)
-- This little snippet will confirm with tab, and if no entry is selected, will confirm the first item
if cmp.visible() then
local entry = cmp.get_selected_entry()
if not entry then
cmp.select_next_item { behavior = cmp.SelectBehavior.Select }
end
cmp.confirm()
else
fallback()
end
end, { "i", "s", "c" })
require("cmp").setup(opts)
end,
}

@ -0,0 +1,14 @@
return {
"numToStr/Comment.nvim",
keys = {
{ "gcc", mode = "n", desc = "Comment toggle current line" },
{ "gc", mode = { "n", "o" }, desc = "Comment toggle linewise" },
{ "gc", mode = "x", desc = "Comment toggle linewise (visual)" },
{ "gbc", mode = "n", desc = "Comment toggle current block" },
{ "gb", mode = { "n", "o" }, desc = "Comment toggle blockwise" },
{ "gb", mode = "x", desc = "Comment toggle blockwise (visual)" },
},
config = function(_, opts)
require("Comment").setup(opts)
end,
}

@ -0,0 +1,11 @@
return {
"stevearc/conform.nvim",
opts = {
formatters_by_ft = {
lua = { "stylua" },
},
},
config = function(_, opts)
require("conform").setup(opts)
end,
}

@ -0,0 +1,11 @@
return {
"lewis6991/gitsigns.nvim",
event = "User FilePost",
opts = function()
return require("configs.gitsigns")
end,
config = function(_, opts)
dofile(vim.g.base46_cache .. "git")
require("gitsigns").setup(opts)
end,
}

@ -1,15 +0,0 @@
return {
"ray-x/go.nvim",
lazy = false,
dependencies = { -- optional packages
"ray-x/guihua.lua",
"neovim/nvim-lspconfig",
"nvim-treesitter/nvim-treesitter",
},
config = function()
require "configs.go"
end,
event = { "CmdlineEnter" },
ft = { "go", "gomod", "gowork", "gotmpl" },
build = ':lua require("go.install").update_all_sync()', -- if you need to install/update all binaries
}

@ -0,0 +1,18 @@
return {
"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,
}

@ -1,27 +0,0 @@
return {
{
"stevearc/conform.nvim",
event = "BufWritePre", -- uncomment for format on save
config = function()
require "configs.conform"
end,
},
{
"nvim-treesitter/nvim-treesitter",
opts = {
ensure_installed = {
"vim",
"lua",
"vimdoc",
"html",
"css",
"c",
"go",
"rust",
"javascript",
"gomod",
"ruby",
},
},
},
}

@ -1,7 +0,0 @@
return {
"neovim/nvim-lspconfig",
config = function()
require("nvchad.configs.lspconfig").defaults()
require "configs.lspconfig"
end,
}

@ -0,0 +1,16 @@
return {
{
'williamboman/mason.nvim',
cmd = { "Mason", "MasonInstall", "MasonUpdate" },
config = function(_, opts_)
dofile(vim.g.base46_cache .. "mason")
require('mason').setup(opts)
end,
},
{'williamboman/mason-lspconfig.nvim'},
{'VonHeikemen/lsp-zero.nvim', branch = 'v3.x'},
{'neovim/nvim-lspconfig'},
{'hrsh7th/cmp-nvim-lsp'},
{'hrsh7th/nvim-cmp'},
{'L3MON4D3/LuaSnip'},
}

@ -1,9 +0,0 @@
return {
"iamcco/markdown-preview.nvim",
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
build = "cd app && yarn install",
init = function()
vim.g.mkdp_filetypes = { "markdown" }
end,
ft = { "markdown" },
}

@ -1,16 +0,0 @@
return {
"williamboman/mason.nvim",
opts = {
ensure_installed = {
"lua-language-server",
"stylua",
"html-lsp",
"css-lsp",
"prettier",
"gopls",
"goimports",
"golines",
"gofumpt",
},
},
}

@ -0,0 +1,12 @@
return {
"NvChad/nvim-colorizer.lua",
-- event = "User FilePost",
-- opts = { user_default_options = { names = false } },
-- config = function(_, opts)
-- require('colorizer').setup(opts)
--
-- vim.defer_fn(function()
-- require('colorizer').attach_to_buffer(0)
-- end, 0)
-- end,
}

@ -1,20 +1,23 @@
return { return {
"nvim-tree/nvim-tree.lua", "nvim-tree/nvim-tree.lua",
opts = { version = "*",
git = { ignore = false }, lazy = false,
renderer = { dependencies = {
icons = { "nvim-tree/nvim-web-devicons",
glyphs = { lazy = true,
git = { -- this is so stupid lmao opts = function()
unstaged = "😴", return { override = require "nvchad.icons.devicons" }
staged = "😎", end,
unmerged = "😈", -- opts = {},
untracked = "😭", config = function(_, opts)
renamed = "😶", dofile(vim.g.base46_cache .. "devicons")
deleted = "😵", require("nvim-web-devicons").setup(opts)
}, end
}, },
}, opts = function()
}, return require "configs.nvim-tree"
}, end,
config = function(_, opts)
require("nvim-tree").setup(opts)
end,
} }

@ -0,0 +1,5 @@
local map = vim.keymap.set
return {
"nvim-telescope/telescope.nvim",
dependencies = { 'nvim-lua/plenary.nvim' },
}

@ -1,10 +0,0 @@
return {
"folke/todo-comments.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
lazy = false,
opts = {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
},
}

@ -0,0 +1,15 @@
return {
"nvim-treesitter/nvim-treesitter",
event = { "BufReadPost", "BufNewFile" },
cmd = { "TSInstall", "TSBufEnable", "TSBufDisable", "TSModuleInfo" },
build = ":TSUpdate",
opts = function()
return require "configs.treesitter"
end,
config = function(_, opts)
dofile(vim.g.base46_cache .. "syntax")
dofile(vim.g.base46_cache .. "treesitter")
require("nvim-treesitter.configs").setup(opts)
end,
}

@ -1,37 +0,0 @@
return {
"folke/trouble.nvim",
branch = "dev", -- IMPORTANT!
keys = {
{
"<leader>tx",
"<cmd>Trouble diagnostics toggle<cr>",
desc = "Diagnostics (Trouble)",
},
{
"<leader>tX",
"<cmd>Trouble diagnostics toggle filter.buf=0<cr>",
desc = "Buffer Diagnostics (Trouble)",
},
{
"<leader>cs",
"<cmd>Trouble symbols toggle focus=false<cr>",
desc = "Symbols (Trouble)",
},
{
"<leader>cl",
"<cmd>Trouble lsp toggle focus=false win.position=right<cr>",
desc = "LSP Definitions / references / ... (Trouble)",
},
{
"<leader>tL",
"<cmd>Trouble loclist toggle<cr>",
desc = "Location List (Trouble)",
},
{
"<leader>tQ",
"<cmd>Trouble qflist toggle<cr>",
desc = "Quickfix List (Trouble)",
},
},
opts = {}, -- for default options, refer to the configuration section for custom setup.
}

@ -0,0 +1,8 @@
return {
"NvChad/ui",
lazy = false,
branch = "v2.5",
config = function()
require "nvchad"
end,
}

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

@ -0,0 +1,55 @@
local map = vim.keymap.set
-- general mappings
map('n', ';', ':')
map("n", "<leader>rn", "<cmd>set rnu!<CR>", { desc = "Toggle Relative number" })
map("n", "<C-s>", "<cmd>w<CR>", { desc = "File Save" })
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", "<leader>qq", ":wa<CR>:qa<CR>" )
-- telescope keybinds
local builtin = require('telescope.builtin')
map('n', '<leader>ff', builtin.find_files, { desc = '[f]ind [f]ile' })
map('n', '<leader>pg', builtin.live_grep, { desc = '[p]roject [g]rep' })
map('n', '<leader>fb', builtin.buffers, { desc = '[f]ind [b]uffer' })
map('n', '<leader>fh', builtin.help_tags, { desc = '[f]ind [h]elp' })
map("n", "<leader>fg", "<cmd>Telescope current_buffer_fuzzy_find<CR>", { desc = "[f]ile [g]rep" })
-- base46 maps
map('n', '<leader>th', '<cmd>Telescope themes<CR>', { desc = '[th]emes' })
-- nvim-tree mapping
map('n', '<leader>e', '<cmd>NvimTreeOpen<CR>')
-- comment
map("n", "<leader>/", function()
require("Comment.api").toggle.linewise.current()
end, { desc = "Comment Toggle" })
-- tabufline
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" })
-- lsp
map("n", "<leader>lf", vim.diagnostic.open_float, { desc = "Lsp floating diagnostics" })
map("n", "[d", vim.diagnostic.goto_prev, { desc = "Lsp prev diagnostic" })
map("n", "]d", vim.diagnostic.goto_next, { desc = "Lsp next diagnostic" })
map("n", "<leader>q", vim.diagnostic.setloclist, { desc = "Lsp diagnostic loclist" })
map(
"v",
"<leader>/",
"<ESC><cmd>lua require('Comment.api').toggle.linewise(vim.fn.visualmode())<CR>",
{ desc = "Comment Toggle" }
)
Loading…
Cancel
Save