initial 0.11 rebuild
Some checks failed
Close stale issues and PRs / stale (push) Has been cancelled
Some checks failed
Close stale issues and PRs / stale (push) Has been cancelled
This commit is contained in:
24
LICENSE
Normal file
24
LICENSE
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
This is free and unencumbered software released into the public domain.
|
||||||
|
|
||||||
|
Anyone is free to copy, modify, publish, use, compile, sell, or
|
||||||
|
distribute this software, either in source code form or as a compiled
|
||||||
|
binary, for any purpose, commercial or non-commercial, and by any
|
||||||
|
means.
|
||||||
|
|
||||||
|
In jurisdictions that recognize copyright laws, the author or authors
|
||||||
|
of this software dedicate any and all copyright interest in the
|
||||||
|
software to the public domain. We make this dedication for the benefit
|
||||||
|
of the public at large and to the detriment of our heirs and
|
||||||
|
successors. We intend this dedication to be an overt act of
|
||||||
|
relinquishment in perpetuity of all present and future rights to this
|
||||||
|
software under copyright law.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||||
|
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||||
|
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||||
|
OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
For more information, please refer to <https://unlicense.org>
|
||||||
9
README.md
Normal file
9
README.md
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
**This repo is supposed to be used as config by NvChad users!**
|
||||||
|
|
||||||
|
- The main nvchad repo (NvChad/NvChad) is used as a plugin by this repo.
|
||||||
|
- So you just import its modules , like `require "nvchad.options" , require "nvchad.mappings"`
|
||||||
|
- So you can delete the .git from this repo ( when you clone it locally ) or fork it :)
|
||||||
|
|
||||||
|
# Credits
|
||||||
|
|
||||||
|
1) Lazyvim starter https://github.com/LazyVim/starter as nvchad's starter was inspired by Lazyvim's . It made a lot of things easier!
|
||||||
37
init.lua
Normal file
37
init.lua
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
vim.g.base46_cache = vim.fn.stdpath "data" .. "/base46/"
|
||||||
|
vim.g.mapleader = " "
|
||||||
|
|
||||||
|
-- bootstrap lazy and all plugins
|
||||||
|
local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim"
|
||||||
|
|
||||||
|
if not vim.uv.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",
|
||||||
|
},
|
||||||
|
|
||||||
|
{ import = "plugins" },
|
||||||
|
}, lazy_config)
|
||||||
|
|
||||||
|
-- load theme
|
||||||
|
dofile(vim.g.base46_cache .. "defaults")
|
||||||
|
dofile(vim.g.base46_cache .. "statusline")
|
||||||
|
|
||||||
|
require "options"
|
||||||
|
require "autocmds"
|
||||||
|
|
||||||
|
vim.schedule(function()
|
||||||
|
require "mappings"
|
||||||
|
end)
|
||||||
1
lua/autocmds.lua
Normal file
1
lua/autocmds.lua
Normal file
@@ -0,0 +1 @@
|
|||||||
|
require "nvchad.autocmds"
|
||||||
34
lua/chadrc.lua
Normal file
34
lua/chadrc.lua
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
-- This file needs to have same structure as nvconfig.lua
|
||||||
|
-- https://github.com/NvChad/ui/blob/v3.0/lua/nvconfig.lua
|
||||||
|
-- Please read that file to know all available options :(
|
||||||
|
|
||||||
|
---@type ChadrcConfig
|
||||||
|
local M = {}
|
||||||
|
-- ui = {
|
||||||
|
-- statusline = {
|
||||||
|
-- separator_style = "arrow",
|
||||||
|
-- theme = "vscode"
|
||||||
|
-- }
|
||||||
|
-- }
|
||||||
|
-- }
|
||||||
|
|
||||||
|
|
||||||
|
M.base46 = {
|
||||||
|
theme = "wombat",
|
||||||
|
|
||||||
|
-- hl_override = {
|
||||||
|
-- Comment = { italic = true },
|
||||||
|
-- ["@comment"] = { italic = true },
|
||||||
|
-- },
|
||||||
|
}
|
||||||
|
|
||||||
|
-- M.nvdash = { load_on_startup = true }
|
||||||
|
|
||||||
|
M.ui = {
|
||||||
|
statusline = {
|
||||||
|
separator_style = "block",
|
||||||
|
-- theme = "vscode_colored"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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,
|
||||||
|
-- },
|
||||||
|
}
|
||||||
|
|
||||||
|
return options
|
||||||
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",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
18
lua/configs/lspconfig.lua
Normal file
18
lua/configs/lspconfig.lua
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
require("nvchad.configs.lspconfig").defaults()
|
||||||
|
|
||||||
|
local servers = { "html", "cssls" }
|
||||||
|
vim.lsp.enable(servers)
|
||||||
|
|
||||||
|
-- vim.lsp.elixirls.setup({
|
||||||
|
-- cmd = { "elixir-ls" }, -- Path to the elixir-ls executable
|
||||||
|
-- filetypes = { "elixir", "eelixir" }, -- Filetypes associated with Elixir
|
||||||
|
-- settings = {
|
||||||
|
-- elixirLS = {
|
||||||
|
-- dialyzerEnabled = true,
|
||||||
|
-- fetchDeps = true,
|
||||||
|
-- enableTestLenses = true,
|
||||||
|
-- },
|
||||||
|
-- }
|
||||||
|
-- })
|
||||||
|
|
||||||
|
-- read :h vim.lsp.config for changing options of lsp servers
|
||||||
89
lua/mappings.lua
Normal file
89
lua/mappings.lua
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
require "nvchad.mappings"
|
||||||
|
|
||||||
|
-- add yours here
|
||||||
|
|
||||||
|
local map = vim.keymap.set
|
||||||
|
|
||||||
|
-- map("n", ";", ":", { desc = "CMD enter command mode" })
|
||||||
|
map("i", "jk", "<ESC>")
|
||||||
|
|
||||||
|
-- map({ "n", "i", "v" }, "<C-s>", "<cmd> w <cr>")
|
||||||
|
|
||||||
|
-- Insert mode: paste from OS without autopairing
|
||||||
|
map("i", "<c-r>", "<c-v>", { desc = "paste from OS without autopairing" })
|
||||||
|
|
||||||
|
-- Window management
|
||||||
|
map("n", "<leader>wv", "<C-w>v", { desc = "Split vertical" })
|
||||||
|
map("n", "<leader>ws", "<C-w>s", { desc = "Split horizontal" })
|
||||||
|
map("n", "<leader>wo", "<C-w>o", { desc = "Maximize split" })
|
||||||
|
map("n", "<leader>wc", "<C-w>c", { desc = "Close split" })
|
||||||
|
map("n", "<leader>wx", "<C-w>c", { desc = "Close split" })
|
||||||
|
map("n", "<leader>w=", "<C-w>=", { desc = "Even splits" })
|
||||||
|
map("n", "<leader>h", "<C-w>h", { desc = "Focus left split" })
|
||||||
|
map("n", "<leader>j", "<C-w>j", { desc = "Focus lower split" })
|
||||||
|
map("n", "<leader>k", "<C-w>k", { desc = "Focus upper split" })
|
||||||
|
map("n", "<leader>l", "<C-w>l", { desc = "Focus right split" })
|
||||||
|
|
||||||
|
-- File operations
|
||||||
|
map("n", "<leader>ee", ':e <C-R>=expand("%:p:h" . "/" <CR><CR>)', { desc = "Copy relative path to file" })
|
||||||
|
map("n", "<leader>er", ":!echo -n % | pbcopy<CR>", { desc = "Copy absolute path to file" })
|
||||||
|
map("n", "<leader>gn", ":Telescope resume<CR>", { desc = "Resume telescope" })
|
||||||
|
map("n", "<leader>eu", '!!python -c "import uuid; print(uuid.uuid4())"<CR>', { desc = "Drop fresh uuid4" })
|
||||||
|
|
||||||
|
-- Clipboard operations
|
||||||
|
map("n", "<c-c>", '"+y', { desc = "Copy to OS clipboard" })
|
||||||
|
|
||||||
|
-- Save
|
||||||
|
map("n", ",,", ":w<CR>", { desc = "Save" })
|
||||||
|
map("n", "<leader> ", ":w<CR>", { desc = "Save" })
|
||||||
|
|
||||||
|
-- NvimTree Toggle
|
||||||
|
map("n", "<leader>n", "<cmd> NvimTreeToggle <CR>", { desc = "Toggle NvimTree" })
|
||||||
|
|
||||||
|
-- Toggle line numbers
|
||||||
|
map("n", "<leader>N", "<cmd> set nu! <CR>", { desc = "Toggle line number" })
|
||||||
|
|
||||||
|
-- Buffer operations
|
||||||
|
map("n", "<leader>x", "<cmd>bdelete<CR>", { desc = "Close Buffer and window" })
|
||||||
|
map("n", "<leader>X", "<cmd>bdelete!<CR>", { desc = "Close Buffer and window!" })
|
||||||
|
map("n", "<leader>c", "<cmd>Bdelete<CR>", { desc = "Close Buffer" })
|
||||||
|
map("n", "<leader>b", "<cmd> Telescope buffers <CR>", { desc = "Find buffers" })
|
||||||
|
|
||||||
|
-- Git operations
|
||||||
|
map("n", "gb", "<cmd>Gitsigns blame<CR>", { desc = "Git blame" })
|
||||||
|
map("n", "gB", "<cmd>Gitsigns blame_line<CR>", { desc = "Git blame line" })
|
||||||
|
map("n", "gu", "<cmd>diffget //2<CR>", { desc = "Select left in conflict" })
|
||||||
|
map("n", "gh", "<cmd>diffget //3<CR>", { desc = "Select right in conflict" })
|
||||||
|
|
||||||
|
-- Floating diagnostics
|
||||||
|
map("n", "ge", function()
|
||||||
|
vim.diagnostic.open_float({ border = "rounded" })
|
||||||
|
end, { desc = "Floating diagnostic" })
|
||||||
|
|
||||||
|
-- Buffer navigation
|
||||||
|
map("n", ",z", ":bnext<CR>", { desc = "Next buffer" })
|
||||||
|
map("n", ",v", ":bprevious<CR>", { desc = "Previous buffer" })
|
||||||
|
map("n", "<leader>z", function()
|
||||||
|
require("nvchad.tabufline").tabuflineNext()
|
||||||
|
end, { desc = "Goto next buffer" })
|
||||||
|
map("n", "<leader>v", function()
|
||||||
|
require("nvchad.tabufline").tabuflinePrev()
|
||||||
|
end, { desc = "Goto prev buffer" })
|
||||||
|
|
||||||
|
-- Neotest commands
|
||||||
|
map("n", "<leader>tl", ":Neotest run last<CR>", { desc = "Neotest Run Last" })
|
||||||
|
map("n", "<leader>ts", ":Neotest summary<CR>", { desc = "Neotest Summary" })
|
||||||
|
map("n", "<leader>to", ":Neotest output<CR>", { desc = "Neotest Output" })
|
||||||
|
map("n", "<leader>ta", ":Neotest output-panel<CR>", { desc = "Neotest Output Panel" })
|
||||||
|
|
||||||
|
-- Visual Mode
|
||||||
|
map("v", ">", ">gv", { desc = "Indent" })
|
||||||
|
map("v", "<c-c>", '"+y', { desc = "Copy to OS clipboard" })
|
||||||
|
|
||||||
|
-- LSP
|
||||||
|
map("n", "<leader>ls", ":LspInfo<CR>", { desc = "Show LSP info" })
|
||||||
|
map("n", "go", vim.lsp.buf.format, { desc = "LSP formatting" })
|
||||||
|
map("n", "gd", vim.lsp.buf.definition, { desc = "Go to definition" })
|
||||||
|
map("n", "<leader>gr", vim.lsp.buf.references, { desc = "Find references" })
|
||||||
|
map("n", "<leader>rn", vim.lsp.buf.rename, { desc = "Rename symbol" })
|
||||||
|
|
||||||
9
lua/options.lua
Normal file
9
lua/options.lua
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
require "nvchad.options"
|
||||||
|
|
||||||
|
-- add yours here!
|
||||||
|
|
||||||
|
-- local o = vim.o
|
||||||
|
-- o.cursorlineopt ='both' -- to enable cursorline!
|
||||||
|
|
||||||
|
vim.g.lua_snippets_path = { vim.fn.stdpath "config" .. "/snippets" }
|
||||||
|
|
||||||
74
lua/plugins/init.lua
Normal file
74
lua/plugins/init.lua
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"stevearc/conform.nvim",
|
||||||
|
-- event = 'BufWritePre', -- uncomment for format on save
|
||||||
|
opts = require "configs.conform",
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
config = function()
|
||||||
|
require "configs.lspconfig"
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"elixir-tools/elixir-tools.nvim",
|
||||||
|
version = "*",
|
||||||
|
event = { "BufReadPre", "BufNewFile" },
|
||||||
|
config = function()
|
||||||
|
local elixir = require "elixir"
|
||||||
|
local elixirls = require "elixir.elixirls"
|
||||||
|
|
||||||
|
elixir.setup {
|
||||||
|
nextls = { enable = true },
|
||||||
|
credo = {},
|
||||||
|
elixirls = {
|
||||||
|
enable = true,
|
||||||
|
settings = elixirls.settings {
|
||||||
|
dialyzerEnabled = false,
|
||||||
|
enableTestLenses = false,
|
||||||
|
},
|
||||||
|
on_attach = function(client, bufnr)
|
||||||
|
vim.keymap.set("n", "<space>fp", ":ElixirFromPipe<cr>", { buffer = true, noremap = true })
|
||||||
|
vim.keymap.set("n", "<space>tp", ":ElixirToPipe<cr>", { buffer = true, noremap = true })
|
||||||
|
vim.keymap.set("v", "<space>em", ":ElixirExpandMacro<cr>", { buffer = true, noremap = true })
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
dependencies = {
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
{ "tpope/vim-surround", lazy = false },
|
||||||
|
{ "famiu/bufdelete.nvim", lazy = false },
|
||||||
|
|
||||||
|
{
|
||||||
|
"lewis6991/gitsigns.nvim",
|
||||||
|
config = function(_, opts)
|
||||||
|
require("gitsigns").setup(opts)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"lukas-reineke/indent-blankline.nvim",
|
||||||
|
enabled = false,
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-- test new blink
|
||||||
|
-- { import = "nvchad.blink.lazyspec" },
|
||||||
|
|
||||||
|
-- {
|
||||||
|
-- "nvim-treesitter/nvim-treesitter",
|
||||||
|
-- opts = {
|
||||||
|
-- ensure_installed = {
|
||||||
|
-- "vim", "lua", "vimdoc",
|
||||||
|
-- "html", "css"
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
}
|
||||||
13
snippets/elixir.lua
Normal file
13
snippets/elixir.lua
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
-- https://github.com/L3MON4D3/LuaSnip/blob/master/DOC.md
|
||||||
|
local ls = require "luasnip"
|
||||||
|
local s = ls.snippet
|
||||||
|
local t = ls.text_node
|
||||||
|
local i = ls.insert_node
|
||||||
|
|
||||||
|
return {
|
||||||
|
s("iip", {
|
||||||
|
t '|> IO.inspect(label: "',
|
||||||
|
i(1, "label"),
|
||||||
|
t '")',
|
||||||
|
}),
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user