From 0c2019394a1a812fd39220c8a04e57d80422adf4 Mon Sep 17 00:00:00 2001 From: roukydesbois Date: Sun, 16 Mar 2025 07:58:40 +0100 Subject: [PATCH] Added phone's nvim config --- .../private_nvim/private_LICENSE | 24 ++++++++++ .../private_nvim/private_README.md | 9 ++++ .../private_nvim/private_dot_stylua.toml | 6 +++ .../private_nvim/private_init.lua | 37 +++++++++++++++ .../private_nvim/private_lazy-lock.json | 30 ++++++++++++ .../private_lua/private_chadrc.lua | 24 ++++++++++ .../private_configs/private_conform.lua | 15 ++++++ .../private_configs/private_lazy.lua | 47 +++++++++++++++++++ .../private_configs/private_lspconfig.lua | 24 ++++++++++ .../private_lua/private_mappings.lua | 16 +++++++ .../private_lua/private_options.lua | 9 ++++ .../private_plugins/private_init.lua | 34 ++++++++++++++ 12 files changed, 275 insertions(+) create mode 100644 private_dot_config/private_nvim/private_LICENSE create mode 100644 private_dot_config/private_nvim/private_README.md create mode 100644 private_dot_config/private_nvim/private_dot_stylua.toml create mode 100644 private_dot_config/private_nvim/private_init.lua create mode 100644 private_dot_config/private_nvim/private_lazy-lock.json create mode 100644 private_dot_config/private_nvim/private_lua/private_chadrc.lua create mode 100644 private_dot_config/private_nvim/private_lua/private_configs/private_conform.lua create mode 100644 private_dot_config/private_nvim/private_lua/private_configs/private_lazy.lua create mode 100644 private_dot_config/private_nvim/private_lua/private_configs/private_lspconfig.lua create mode 100644 private_dot_config/private_nvim/private_lua/private_mappings.lua create mode 100644 private_dot_config/private_nvim/private_lua/private_options.lua create mode 100644 private_dot_config/private_nvim/private_lua/private_plugins/private_init.lua diff --git a/private_dot_config/private_nvim/private_LICENSE b/private_dot_config/private_nvim/private_LICENSE new file mode 100644 index 0000000..fdddb29 --- /dev/null +++ b/private_dot_config/private_nvim/private_LICENSE @@ -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 diff --git a/private_dot_config/private_nvim/private_README.md b/private_dot_config/private_nvim/private_README.md new file mode 100644 index 0000000..dc0deaa --- /dev/null +++ b/private_dot_config/private_nvim/private_README.md @@ -0,0 +1,9 @@ +**This repo is supposed to 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! diff --git a/private_dot_config/private_nvim/private_dot_stylua.toml b/private_dot_config/private_nvim/private_dot_stylua.toml new file mode 100644 index 0000000..ecb6dca --- /dev/null +++ b/private_dot_config/private_nvim/private_dot_stylua.toml @@ -0,0 +1,6 @@ +column_width = 120 +line_endings = "Unix" +indent_type = "Spaces" +indent_width = 2 +quote_style = "AutoPreferDouble" +call_parentheses = "None" diff --git a/private_dot_config/private_nvim/private_init.lua b/private_dot_config/private_nvim/private_init.lua new file mode 100644 index 0000000..0fda20c --- /dev/null +++ b/private_dot_config/private_nvim/private_init.lua @@ -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) diff --git a/private_dot_config/private_nvim/private_lazy-lock.json b/private_dot_config/private_nvim/private_lazy-lock.json new file mode 100644 index 0000000..c092413 --- /dev/null +++ b/private_dot_config/private_nvim/private_lazy-lock.json @@ -0,0 +1,30 @@ +{ + "LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" }, + "NvChad": { "branch": "v2.5", "commit": "6f25b2739684389ca69ea8229386c098c566c408" }, + "base46": { "branch": "v3.0", "commit": "59566882e09a8a77dbdb33b678a93680c36ae089" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" }, + "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, + "conform.nvim": { "branch": "master", "commit": "db8a4a9edb217067b1d7a2e0362c74bfe9cc944d" }, + "copilot.vim": { "branch": "release", "commit": "5015939f131627a6a332c9e3ecad9a7cb4c2e549" }, + "friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" }, + "gitsigns.nvim": { "branch": "main", "commit": "011dc6718bcebdf92a5336bb0da79189c3afe621" }, + "indent-blankline.nvim": { "branch": "master", "commit": "e10626f7fcd51ccd56d7ffc00883ba7e0aa28f78" }, + "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, + "mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" }, + "menu": { "branch": "main", "commit": "7769b17c2a131108c02b10e9f844e504aa605cc2" }, + "minty": { "branch": "main", "commit": "aafc9e8e0afe6bf57580858a2849578d8d8db9e0" }, + "nvim-autopairs": { "branch": "master", "commit": "68f0e5c3dab23261a945272032ee6700af86227a" }, + "nvim-cmp": { "branch": "main", "commit": "1e1900b0769324a9675ef85b38f99cca29e203b3" }, + "nvim-lspconfig": { "branch": "master", "commit": "8a1529e46eef5efc86c34c8d9bdd313abc2ecba0" }, + "nvim-tree.lua": { "branch": "master", "commit": "c09ff35de503a41fa62465c6b4ae72d96e7a7ce4" }, + "nvim-treesitter": { "branch": "master", "commit": "845356a256ed6ff5868da582cb62a31d762e1804" }, + "nvim-web-devicons": { "branch": "master", "commit": "d0cafff5c4347a604a07edf7bb9a91fda7eb577e" }, + "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, + "telescope.nvim": { "branch": "master", "commit": "814f102cd1da3dc78c7d2f20f2ef3ed3cdf0e6e4" }, + "ui": { "branch": "v3.0", "commit": "75233833d84b930bc37fecdcd7eb73b5714e92e4" }, + "volt": { "branch": "main", "commit": "21a2351697abfed26d4469b88d3ab124d55a1b3f" }, + "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" } +} diff --git a/private_dot_config/private_nvim/private_lua/private_chadrc.lua b/private_dot_config/private_nvim/private_lua/private_chadrc.lua new file mode 100644 index 0000000..29b83c6 --- /dev/null +++ b/private_dot_config/private_nvim/private_lua/private_chadrc.lua @@ -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 = "onedark", + + -- hl_override = { + -- Comment = { italic = true }, + -- ["@comment"] = { italic = true }, + -- }, +} + +-- M.nvdash = { load_on_startup = true } +-- M.ui = { +-- tabufline = { +-- lazyload = false +-- } +--} + +return M diff --git a/private_dot_config/private_nvim/private_lua/private_configs/private_conform.lua b/private_dot_config/private_nvim/private_lua/private_configs/private_conform.lua new file mode 100644 index 0000000..35ba6cf --- /dev/null +++ b/private_dot_config/private_nvim/private_lua/private_configs/private_conform.lua @@ -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 diff --git a/private_dot_config/private_nvim/private_lua/private_configs/private_lazy.lua b/private_dot_config/private_nvim/private_lua/private_configs/private_lazy.lua new file mode 100644 index 0000000..cd170bd --- /dev/null +++ b/private_dot_config/private_nvim/private_lua/private_configs/private_lazy.lua @@ -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", + }, + }, + }, +} diff --git a/private_dot_config/private_nvim/private_lua/private_configs/private_lspconfig.lua b/private_dot_config/private_nvim/private_lua/private_configs/private_lspconfig.lua new file mode 100644 index 0000000..531bdf3 --- /dev/null +++ b/private_dot_config/private_nvim/private_lua/private_configs/private_lspconfig.lua @@ -0,0 +1,24 @@ +-- load defaults i.e lua_lsp +require("nvchad.configs.lspconfig").defaults() + +local lspconfig = require "lspconfig" + +-- EXAMPLE +local servers = { "html", "cssls", "terraformls", "yamlls" } +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, +-- } diff --git a/private_dot_config/private_nvim/private_lua/private_mappings.lua b/private_dot_config/private_nvim/private_lua/private_mappings.lua new file mode 100644 index 0000000..b942373 --- /dev/null +++ b/private_dot_config/private_nvim/private_lua/private_mappings.lua @@ -0,0 +1,16 @@ +require "nvchad.mappings" + +-- add yours here + +local map = vim.keymap.set + +map("n", ";", ":", { desc = "CMD enter command mode" }) +map("i", "jk", "") + +-- map({ "n", "i", "v" }, "", " w ") + +-- Copilot Suggestion Acceptance Key +map('i', '', function () + vim.fn.feedkeys(vim.fn['copilot#Accept'](), '') +end, { desc = 'Copilot Accept', noremap = true, silent = true }) + diff --git a/private_dot_config/private_nvim/private_lua/private_options.lua b/private_dot_config/private_nvim/private_lua/private_options.lua new file mode 100644 index 0000000..95c982c --- /dev/null +++ b/private_dot_config/private_nvim/private_lua/private_options.lua @@ -0,0 +1,9 @@ +require "nvchad.options" + +-- add yours here! + +-- local o = vim.o +-- o.cursorlineopt ='both' -- to enable cursorline! +-- Copilot Suggestion Colors +vim.api.nvim_set_hl(0, "CopilotSuggestion", { fg = "#83a598" }) +vim.api.nvim_set_hl(0, "CopilotAnnotation", { fg = "#83a598" }) diff --git a/private_dot_config/private_nvim/private_lua/private_plugins/private_init.lua b/private_dot_config/private_nvim/private_lua/private_plugins/private_init.lua new file mode 100644 index 0000000..10411ba --- /dev/null +++ b/private_dot_config/private_nvim/private_lua/private_plugins/private_init.lua @@ -0,0 +1,34 @@ +return { + { + "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-treesitter/nvim-treesitter", + opts = { + ensure_installed = { + "vim", "lua", "vimdoc", + "html", "css" + }, + }, + }, + -- Enable Copilot + { + "github/copilot.vim", + lazy = false, + config = function() + vim.g.copilot_no_tab_map = true + vim.g.copilot_assume_mapped = true + end + } +}