commit 82490d5b2180f9c9e6d59a55b7ab1a09c438a576 Author: timoxa0 Date: Fri Oct 25 16:48:49 2024 +0500 New pc rice diff --git a/.stylua.toml b/.stylua.toml new file mode 100644 index 0000000..ecb6dca --- /dev/null +++ b/.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/LICENSE b/LICENSE new file mode 100644 index 0000000..fdddb29 --- /dev/null +++ b/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/init.lua b/init.lua new file mode 100644 index 0000000..1152335 --- /dev/null +++ b/init.lua @@ -0,0 +1,39 @@ +vim.g.base46_cache = vim.fn.stdpath "data" .. "/nvchad/base46/" +vim.g.mapleader = " " + +-- bootstrap lazy and all plugins +local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim" + +if not vim.loop.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", + config = function() + require "options" + end, + }, + + { import = "plugins" }, +}, lazy_config) + +-- load theme +dofile(vim.g.base46_cache .. "defaults") +dofile(vim.g.base46_cache .. "statusline") + +require "nvchad.autocmds" + +vim.schedule(function() + require "mappings" +end) diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 0000000..751ea5a --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,30 @@ +{ + "LuaSnip": { "branch": "master", "commit": "e808bee352d1a6fcf902ca1a71cee76e60e24071" }, + "NvChad": { "branch": "v2.5", "commit": "8792679a08c6747ba3f5890a01561442abec6935" }, + "base46": { "branch": "v2.5", "commit": "fec9fa583025e69e0c4f902bd61990e8d13d1975" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, + "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, + "conform.nvim": { "branch": "master", "commit": "f5bd8419f8a29451e20bdb1061a54fe13d5c8de3" }, + "friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" }, + "gitsigns.nvim": { "branch": "main", "commit": "863903631e676b33e8be2acb17512fdc1b80b4fb" }, + "indent-blankline.nvim": { "branch": "master", "commit": "e7a4442e055ec953311e77791546238d1eaae507" }, + "lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" }, + "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, + "menu": { "branch": "main", "commit": "ee85b2e394fde354bd24e35ff7a688d10c9212fa" }, + "minty": { "branch": "main", "commit": "7c2a6452922313e10ff46aea49a4bb5e50e1ac68" }, + "nvim-autopairs": { "branch": "master", "commit": "ee297f215e95a60b01fde33275cc3c820eddeebe" }, + "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, + "nvim-lspconfig": { "branch": "master", "commit": "b55b9659de9ac17e05df4787bb023e4c7ef45329" }, + "nvim-tree.lua": { "branch": "master", "commit": "2a268f631da85e83b7a95291be589bcddfc785d8" }, + "nvim-treesitter": { "branch": "master", "commit": "68b2bdd99d889e9705f7e90ae64d990f3ff03cf3" }, + "nvim-web-devicons": { "branch": "master", "commit": "19d257cf889f79f4022163c3fbb5e08639077bd8" }, + "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, + "telescope.nvim": { "branch": "master", "commit": "df534c3042572fb958586facd02841e10186707c" }, + "ui": { "branch": "v3.0", "commit": "87578bb7e2bc106127f013f9a1edd7a716f4f6c6" }, + "vim-tmux-navigator": { "branch": "master", "commit": "a9b52e7d36114d40350099f254b5f299a35df978" }, + "volt": { "branch": "main", "commit": "43f72b49037c191eb3cfe26ba7a5574b4bfce226" }, + "which-key.nvim": { "branch": "main", "commit": "8badb359f7ab8711e2575ef75dfe6fbbd87e4821" } +} diff --git a/lua/chadrc.lua b/lua/chadrc.lua new file mode 100644 index 0000000..6bb2cf7 --- /dev/null +++ b/lua/chadrc.lua @@ -0,0 +1,16 @@ +-- This file needs to have same structure as nvconfig.lua +-- https://github.com/NvChad/ui/blob/v2.5/lua/nvconfig.lua + +---@type ChadrcConfig +local M = {} +M = { + base46 = { + theme = "catppuccin", + transparency = true + } + -- hl_override = { + -- Comment = { italic = true }, + -- ["@comment"] = { italic = true }, + -- }, +} +return M diff --git a/lua/configs/conform.lua b/lua/configs/conform.lua new file mode 100644 index 0000000..a000447 --- /dev/null +++ b/lua/configs/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, + -- }, +} + +require("conform").setup(options) diff --git a/lua/configs/lazy.lua b/lua/configs/lazy.lua new file mode 100644 index 0000000..cd170bd --- /dev/null +++ b/lua/configs/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/lua/configs/lspconfig.lua b/lua/configs/lspconfig.lua new file mode 100644 index 0000000..7d3a64f --- /dev/null +++ b/lua/configs/lspconfig.lua @@ -0,0 +1,29 @@ +-- EXAMPLE +local on_attach = require("nvchad.configs.lspconfig").on_attach +local on_init = require("nvchad.configs.lspconfig").on_init +local capabilities = require("nvchad.configs.lspconfig").capabilities + +local lspconfig = require "lspconfig" +local servers = { "html", "gopls" } + +-- lsps with default config +for _, lsp in ipairs(servers) do + lspconfig[lsp].setup { + on_attach = on_attach, + on_init = on_init, + capabilities = capabilities, + } +end + +-- typescript +lspconfig.ts_ls.setup { + on_attach = on_attach, + on_init = on_init, + capabilities = capabilities, +} + +lspconfig.pyright.setup({ + on_attach = on_attach, + capabilities = capabilities, + filetypes = {"python"}, +}) diff --git a/lua/mappings.lua b/lua/mappings.lua new file mode 100644 index 0000000..17728a0 --- /dev/null +++ b/lua/mappings.lua @@ -0,0 +1,15 @@ +require "nvchad.mappings" + +-- add yours here + +local map = vim.keymap.set + +map("n", ";", ":", { desc = "CMD enter command mode" }) +map("i", "jk", "") +map("n", "", "TmuxNavigateLeft", {desc = "Move tmux windows focus left"}) +map("n", "", "TmuxNavigateRight", {desc = "Move tmux windows focus right"}) +map("n", "", "TmuxNavigateDown", {desc = "Move tmux windows focus down"}) +map("n", "", "TmuxNavigateUp", {desc = "Move tmux windows focus up"}) + + +-- map({ "n", "i", "v" }, "", " w ") diff --git a/lua/options.lua b/lua/options.lua new file mode 100644 index 0000000..73c3a7b --- /dev/null +++ b/lua/options.lua @@ -0,0 +1,9 @@ +require "nvchad.options" +vim.o.tabstop = 4 -- A TAB character looks like 4 spaces +vim.o.expandtab = true -- Pressing the TAB key will insert spaces instead of a TAB character +vim.o.softtabstop = 4 -- Number of spaces inserted instead of a TAB character +vim.o.shiftwidth = 4 -- Number of spaces inserted when indenting +-- add yours here! + +-- local o = vim.o +-- o.cursorlineopt ='both' -- to enable cursorline! diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua new file mode 100644 index 0000000..e72b215 --- /dev/null +++ b/lua/plugins/init.lua @@ -0,0 +1,55 @@ +return { + { + "stevearc/conform.nvim", + -- event = 'BufWritePre', -- uncomment for format on save + config = function() + require "configs.conform" + end, + }, + { + "christoomey/vim-tmux-navigator", + lazy = false, + }, + { + "williamboman/mason.nvim", + opts = { + ensure_installed = { + "black", + "debugpy", + "mypy", + "ruff", + "pyright", + }, + }, + }, + + + -- These are some examples, uncomment them if you want to see them work! + { + "neovim/nvim-lspconfig", + config = function() + require("nvchad.configs.lspconfig").defaults() + require "configs.lspconfig" + end, + }, + -- + -- { + -- "williamboman/mason.nvim", + -- opts = { + -- ensure_installed = { + -- "lua-language-server", "stylua", + -- "html-lsp", "css-lsp" , "prettier" + -- }, + -- }, + -- }, + -- + { + "nvim-treesitter/nvim-treesitter", + opts = { + ensure_installed = { + "vim", "lua", "vimdoc", + "html", "css" + }, + }, + }, +}