Full Refactor and history reset
This commit is contained in:
7
dotfiles/nvim/ftplugin/elixir.lua
Normal file
7
dotfiles/nvim/ftplugin/elixir.lua
Normal file
@@ -0,0 +1,7 @@
|
||||
require("nvchad.mappings")
|
||||
|
||||
local map = vim.keymap.set
|
||||
|
||||
map("n", "<leader>tr", function()
|
||||
vim.lsp.codelens.run()
|
||||
end, { desc = "Run codelense" })
|
||||
7
dotfiles/nvim/ftplugin/rust.lua
Normal file
7
dotfiles/nvim/ftplugin/rust.lua
Normal file
@@ -0,0 +1,7 @@
|
||||
require("nvchad.mappings")
|
||||
|
||||
local map = vim.keymap.set
|
||||
|
||||
map("n", "<leader>ca", function()
|
||||
vim.cmd.RustLsp("codeAction")
|
||||
end, { silent = true, buffer = bufnr, desc = "LSP Code action" })
|
||||
2
dotfiles/nvim/init.lua
Normal file
2
dotfiles/nvim/init.lua
Normal file
@@ -0,0 +1,2 @@
|
||||
require "init"
|
||||
require "extraConfig"
|
||||
24
dotfiles/nvim/lua/chadrc.lua
Normal file
24
dotfiles/nvim/lua/chadrc.lua
Normal file
@@ -0,0 +1,24 @@
|
||||
-- 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 = {}
|
||||
|
||||
M.base46 = {
|
||||
theme = "catppuccin",
|
||||
|
||||
-- hl_override = {
|
||||
-- Comment = { italic = true },
|
||||
-- ["@comment"] = { italic = true },
|
||||
-- },
|
||||
}
|
||||
|
||||
-- M.nvdash = { load_on_startup = true }
|
||||
-- M.ui = {
|
||||
-- tabufline = {
|
||||
-- lazyload = false
|
||||
-- }
|
||||
--}
|
||||
|
||||
return M
|
||||
21
dotfiles/nvim/lua/configs/conform.lua
Normal file
21
dotfiles/nvim/lua/configs/conform.lua
Normal file
@@ -0,0 +1,21 @@
|
||||
local options = {
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
elixir = { "mix" },
|
||||
javascript = { "prettier" },
|
||||
css = { "prettier" },
|
||||
html = { "prettier" },
|
||||
html = { "prettier" },
|
||||
heex = { "mix" },
|
||||
nix = { "nixfmt" },
|
||||
json = { "prettier" },
|
||||
},
|
||||
|
||||
format_on_save = {
|
||||
-- These options will be passed to conform.format()
|
||||
timeout_ms = 2000,
|
||||
lsp_fallback = true,
|
||||
},
|
||||
}
|
||||
|
||||
return options
|
||||
47
dotfiles/nvim/lua/configs/lazy.lua
Normal file
47
dotfiles/nvim/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",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
28
dotfiles/nvim/lua/configs/lspconfig.lua
Normal file
28
dotfiles/nvim/lua/configs/lspconfig.lua
Normal file
@@ -0,0 +1,28 @@
|
||||
-- load defaults i.e lua_lsp
|
||||
require("nvchad.configs.lspconfig").defaults()
|
||||
|
||||
local lspconfig = require("lspconfig")
|
||||
|
||||
-- lspconfig.elixirls.setup({
|
||||
-- cmd = { "elixir-ls" },
|
||||
-- })
|
||||
|
||||
-- EXAMPLE
|
||||
local servers = { "html", "cssls" }
|
||||
local nvlsp = require("nvchad.configs.lspconfig")
|
||||
|
||||
-- lsps with default config
|
||||
for _, lsp in ipairs(servers) do
|
||||
lspconfig[lsp].setup({
|
||||
on_attach = nvlsp.on_attach,
|
||||
on_init = nvlsp.on_init,
|
||||
capabilities = nvlsp.capabilities,
|
||||
})
|
||||
end
|
||||
|
||||
-- configuring single server, example: typescript
|
||||
-- lspconfig.ts_ls.setup {
|
||||
-- on_attach = nvlsp.on_attach,
|
||||
-- on_init = nvlsp.on_init,
|
||||
-- capabilities = nvlsp.capabilities,
|
||||
-- }
|
||||
11
dotfiles/nvim/lua/extraConfig.lua
Normal file
11
dotfiles/nvim/lua/extraConfig.lua
Normal file
@@ -0,0 +1,11 @@
|
||||
require("telescope").setup({
|
||||
extensions = {
|
||||
fzf = {
|
||||
fuzzy = true, -- false will only do exact matching
|
||||
override_generic_sorter = true, -- override the generic sorter
|
||||
override_file_sorter = true, -- override the file sorter
|
||||
case_mode = "smart_case", -- or "ignore_case" or "respect_case"
|
||||
-- the default case_mode is "smart_case"
|
||||
},
|
||||
},
|
||||
})
|
||||
37
dotfiles/nvim/lua/init.lua
Normal file
37
dotfiles/nvim/lua/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("nvchad.autocmds")
|
||||
|
||||
vim.schedule(function()
|
||||
require("mappings")
|
||||
end)
|
||||
54
dotfiles/nvim/lua/mappings.lua
Normal file
54
dotfiles/nvim/lua/mappings.lua
Normal file
@@ -0,0 +1,54 @@
|
||||
require("nvchad.mappings")
|
||||
|
||||
-- add yours here
|
||||
|
||||
local map = vim.keymap.set
|
||||
local builtin = require("telescope.builtin")
|
||||
local nomap = vim.keymap.del
|
||||
local nvim_tmux_nav = require("nvim-tmux-navigation")
|
||||
|
||||
map("n", ";", ":", { desc = "CMD enter command mode" })
|
||||
map("i", "jk", "<ESC>")
|
||||
map("n", "<leader>tt", function()
|
||||
require("base46").toggle_transparency()
|
||||
end, { desc = "Toggle transparency" })
|
||||
|
||||
map("i", "<C-CR>", function()
|
||||
vim.fn.feedkeys(vim.fn["copilot#Accept"](), "")
|
||||
end, { desc = "Copilot Accept", silent = true, nowait = true, expr = true, noremap = true })
|
||||
|
||||
map("n", "@c", function()
|
||||
require("CopilotChat").open()
|
||||
end, { desc = "Copilot chat" })
|
||||
|
||||
map("n", "@p", function()
|
||||
require("copilot.panel").open()
|
||||
end, { desc = "Copilot chat" })
|
||||
|
||||
map("n", "@d", function()
|
||||
require("copilot.panel").ask("Create documentation for the this code")
|
||||
end, { desc = "Copilot chat" })
|
||||
|
||||
map("n", "<leader>si", function()
|
||||
builtin.lsp_document_symbols()
|
||||
end, { desc = "LSP Definitions" })
|
||||
|
||||
map("n", "<leader>sd", function()
|
||||
builtin.lsp_definitions()
|
||||
end, { desc = "LSP Definitions" })
|
||||
|
||||
map("n", "<leader>sr", function()
|
||||
builtin.lsp_references()
|
||||
end, { desc = "LSP References" })
|
||||
|
||||
map("n", "<leader>ss", function()
|
||||
builtin.lsp_workspace_symbols()
|
||||
end, { desc = "LSP workspace symbols" })
|
||||
|
||||
nomap("n", "<leader>h")
|
||||
nomap("n", "<leader>v")
|
||||
|
||||
map("n", "<C-h>", nvim_tmux_nav.NvimTmuxNavigateLeft, { desc = "Navigate left" })
|
||||
map("n", "<C-j>", nvim_tmux_nav.NvimTmuxNavigateDown, { desc = "Navigate down" })
|
||||
map("n", "<C-k>", nvim_tmux_nav.NvimTmuxNavigateUp, { desc = "Navigate up" })
|
||||
map("n", "<C-l>", nvim_tmux_nav.NvimTmuxNavigateRight, { desc = "Navigate right" })
|
||||
7
dotfiles/nvim/lua/options.lua
Normal file
7
dotfiles/nvim/lua/options.lua
Normal file
@@ -0,0 +1,7 @@
|
||||
require("nvchad.options")
|
||||
|
||||
-- add yours here!
|
||||
|
||||
-- local o = vim.o
|
||||
-- o.cursorlineopt ='both' -- to enable cursorline!
|
||||
--
|
||||
145
dotfiles/nvim/lua/plugins/base.lua
Normal file
145
dotfiles/nvim/lua/plugins/base.lua
Normal file
@@ -0,0 +1,145 @@
|
||||
return {
|
||||
{ import = "nvchad.blink.lazyspec" },
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
event = "BufWritePre", -- uncomment for format on save
|
||||
opts = require("configs.conform"),
|
||||
},
|
||||
-- These are some examples, uncomment them if you want to see them work!
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
config = function()
|
||||
require("configs.lspconfig")
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-tree/nvim-tree.lua",
|
||||
cmd = { "NvimTreeToggle", "NvimTreeFocus" },
|
||||
opts = function()
|
||||
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,
|
||||
adaptive_size = true,
|
||||
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 = "" },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
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 },
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
{
|
||||
"nvim-telescope/telescope-fzf-native.nvim",
|
||||
build = "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release",
|
||||
},
|
||||
{
|
||||
"NeogitOrg/neogit",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"sindrets/diffview.nvim",
|
||||
"nvim-telescope/telescope.nvim",
|
||||
},
|
||||
config = true,
|
||||
},
|
||||
{
|
||||
lazy = false,
|
||||
"CopilotC-Nvim/CopilotChat.nvim",
|
||||
dependencies = {
|
||||
{ "zbirenbaum/copilot.lua" }, -- or zbirenbaum/copilot.lua
|
||||
{ "nvim-lua/plenary.nvim", branch = "master" }, -- for curl, log and async functions
|
||||
},
|
||||
build = "make tiktoken", -- Only on MacOS or Linux
|
||||
opts = {
|
||||
-- See Configuration section for options
|
||||
},
|
||||
-- See Commands section for default commands if you want to lazy load on them
|
||||
},
|
||||
{
|
||||
"zbirenbaum/copilot.lua",
|
||||
cmd = "Copilot",
|
||||
event = "InsertEnter",
|
||||
config = function()
|
||||
require("copilot").setup({
|
||||
suggestion = { enabled = false },
|
||||
panel = { enabled = false },
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"giuxtaposition/blink-cmp-copilot",
|
||||
dependencies = {
|
||||
{ "zbirenbaum/copilot.lua" },
|
||||
},
|
||||
},
|
||||
-- {
|
||||
-- "zbirenbaum/copilot-cmp",
|
||||
-- config = function()
|
||||
-- require("copilot_cmp").setup()
|
||||
-- end,
|
||||
-- },
|
||||
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"vim",
|
||||
"lua",
|
||||
"vimdoc",
|
||||
"html",
|
||||
"css",
|
||||
"elixir",
|
||||
"rust",
|
||||
"heex",
|
||||
"javascript",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"alexghergh/nvim-tmux-navigation",
|
||||
lazy = false,
|
||||
},
|
||||
}
|
||||
33
dotfiles/nvim/lua/plugins/elixir.lua
Normal file
33
dotfiles/nvim/lua/plugins/elixir.lua
Normal file
@@ -0,0 +1,33 @@
|
||||
return {
|
||||
{
|
||||
"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 },
|
||||
elixirls = {
|
||||
enable = true,
|
||||
settings = elixirls.settings({
|
||||
dialyzerEnabled = false,
|
||||
enableTestLenses = true,
|
||||
}),
|
||||
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,
|
||||
},
|
||||
projectionist = {
|
||||
enable = true,
|
||||
},
|
||||
})
|
||||
end,
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
},
|
||||
},
|
||||
}
|
||||
7
dotfiles/nvim/lua/plugins/rust.lua
Normal file
7
dotfiles/nvim/lua/plugins/rust.lua
Normal file
@@ -0,0 +1,7 @@
|
||||
return {
|
||||
{
|
||||
"mrcjkb/rustaceanvim",
|
||||
version = "^5", -- Recommended
|
||||
lazy = false, -- This plugin is already lazy
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user