From 1b5fa30fba9984f6f7cc32d1d76114c439ce101d Mon Sep 17 00:00:00 2001 From: ooks-io Date: Mon, 28 Aug 2023 00:23:16 +1200 Subject: [PATCH] remove: nvchad --- pkgs/nvchad/custom/chadrc.lua | 30 --- pkgs/nvchad/custom/init.lua | 37 --- pkgs/nvchad/custom/mappings.lua | 187 --------------- pkgs/nvchad/custom/plugins.lua | 396 -------------------------------- pkgs/nvchad/custom/term.lua | 29 --- pkgs/nvchad/default.nix | 30 --- 6 files changed, 709 deletions(-) delete mode 100644 pkgs/nvchad/custom/chadrc.lua delete mode 100644 pkgs/nvchad/custom/init.lua delete mode 100644 pkgs/nvchad/custom/mappings.lua delete mode 100644 pkgs/nvchad/custom/plugins.lua delete mode 100644 pkgs/nvchad/custom/term.lua delete mode 100644 pkgs/nvchad/default.nix diff --git a/pkgs/nvchad/custom/chadrc.lua b/pkgs/nvchad/custom/chadrc.lua deleted file mode 100644 index e316284..0000000 --- a/pkgs/nvchad/custom/chadrc.lua +++ /dev/null @@ -1,30 +0,0 @@ ----@type ChadrcConfig -local M = {} - -M.ui = { - theme_toggle = {}, - theme = "gruvbox", - transparency = false, - - changed_themes = { - everforest = { - base_30 = { - darker_black = "#272f35", - black = "#252e34", -- nvim bg - black2 = "#323a40", - one_bg = "#363e44", - one_bg2 = "#363e44", - one_bg3 = "#3a4248", - }, - }, - }, -} - -M.plugins = "custom.plugins" -M.mappings = require("custom.mappings") - -M.lazy_nvim = { - lockfile = vim.fn.stdpath("data") .. "/lazy-lock.json", -} - -return M diff --git a/pkgs/nvchad/custom/init.lua b/pkgs/nvchad/custom/init.lua deleted file mode 100644 index bb906cf..0000000 --- a/pkgs/nvchad/custom/init.lua +++ /dev/null @@ -1,37 +0,0 @@ -local autocmd = vim.api.nvim_create_autocmd - -vim.api.nvim_create_autocmd("BufWritePre", { - pattern = "*", - command = ":%s/s+$//e", -}) - --- remove trailing whitespace -local remove_spaces_group = vim.api.nvim_create_augroup("RemoveSpaces", { clear = true }) -vim.api.nvim_create_autocmd("BufWritePre", { - pattern = "*", - command = ":%s/s+$//e", - group = remove_spaces_group, -}) - --- [[ Highlight on yank ]] --- See `:help vim.highlight.on_yank()` -local highlight_group = vim.api.nvim_create_augroup("YankHighlight", { clear = true }) -vim.api.nvim_create_autocmd("TextYankPost", { - callback = function() - vim.highlight.on_yank() - end, - group = highlight_group, - pattern = "*", -}) - --- Options - --- Relative number -vim.wo.relativenumber = true -vim.opt.relativenumber = true - --- Notify me for line length -vim.opt.colorcolumn = "80" - --- Cursor -vim.opt.guicursor = "" diff --git a/pkgs/nvchad/custom/mappings.lua b/pkgs/nvchad/custom/mappings.lua deleted file mode 100644 index 84dd3f1..0000000 --- a/pkgs/nvchad/custom/mappings.lua +++ /dev/null @@ -1,187 +0,0 @@ ----@type MappingsConfig -local M = {} - -M.general = { - n = { - [";"] = { ":", "enter command mode", opts = { nowait = true } }, - ["gc"] = { - function() - require("Comment.api").toggle.linewise.current() - end, - "toggle comment", - }, - ["gcc"] = { - function() - require("Comment.api").toggle.linewise.current() - end, - "toggle comment", - }, - }, - v = { - ["gc"] = { - "lua require('Comment.api').toggle.linewise(vim.fn.visualmode())", - "toggle comment", - }, - ["gcc"] = { - "lua require('Comment.api').toggle.linewise(vim.fn.visualmode())", - "toggle comment", - }, - }, -} - -M.file = { - n = { - -- file / directory - ["fF"] = { - function() - require("telescope.builtin").find_files({ cwd = vim.fn.expand("%:p:h") }) - end, - "[F]ind [F]iles in current directory", - }, - ["fo"] = { - function() - require("telescope.builtin").oldfiles() - end, - "[F]ind recently [o]pened files", - }, - ["fs"] = { " :w ", "[F]ile [S]ave" }, - ["fw"] = { function() end, "Nothing" }, - }, -} - -M.search = { - n = { - -- search - ["sd"] = { - function() - require("telescope.builtin").diagnostics() - end, - "[S]earch [D]iagnostics", - }, - ["sf"] = { - function() - require("telescope.builtin").find_files() - end, - "[S]earch [F]iles", - }, - ["sh"] = { - function() - require("telescope.builtin").help_tags() - end, - "[S]earch [H]elp", - }, - ["sw"] = { - function() - require("telescope.builtin").grep_string() - end, - "[S]earch current [W]ord", - }, - ["sp"] = { - function() - require("telescope.builtin").live_grep() - end, - "[S]earch by gre[p]", - }, - ["sg"] = { - function() - require("telescope.builtin").live_grep() - end, - "[S]earch by [g]rep", - }, - ["so"] = { - function() - require("telescope.builtin").oldfiles() - end, - "[S]earch recently [o]pened files", - }, - ["sG"] = { - function() - require("telescope").extensions.live_grep_args.live_grep_args({ cwd = vim.fn.expand("%:p:h") }) - end, - "[S]earch by [G]rep in current directory", - }, - }, -} - -M.buffer = { - n = { - ["bd"] = { "bpspbnbd", "[B]uffer [D]elete" }, - ["bb"] = { - function() - require("telescope.builtin").buffers() - end, - "[B]rowse [B]uffers", - }, - }, -} - -M.window = { - n = { - ["ws"] = { " :split ", "[W]indow Horizontal [S]plit" }, -- split horizontal - ["wv"] = { " :vsplit ", "[W]indow [V]ertical Split" }, -- split vertical - ["wh"] = { " :TmuxNavigateLeft", "Go to Left [W]indow" }, - ["wj"] = { " :TmuxNavigateDown", "Go to [W]indow Below" }, - ["wk"] = { " :TmuxNavigateUp", "Go to Top [W]indow" }, - ["wl"] = { " :TmuxNavigateRight", "Go to Right [W]indow" }, - ["wq"] = { "q", "[W]indow [Q]uit" }, -- quit - }, -} - -M.term = { - n = { - ["tf"] = { " :ToggleTerm direction=float", "[T]erm [F]loat" }, - ["tt"] = { " :ToggleTerm direction=tab", "[T]erm [T]ab" }, - ["th"] = { " :ToggleTerm direction=horizontal", "[T]erm [H]orizontal" }, - ["tv"] = { " :ToggleTerm direction=vertical", "[T]erm [V]ertical" }, - ["ht"] = { - function() - require("custom.term").htop:toggle() - end, - "[H]top", - }, - [""] = { " :ToggleTerm direction=horizontal", "[T]erm [H]orizontal" }, - }, -} - -M.git = { - n = { - ["gg"] = { - function() - require("custom.term").lazygit:toggle() - end, - "Lazy[G]it", - }, - ["gl"] = { - function() - require("custom.term").lazygit:toggle() - end, - "[L]azy[G]it", - }, - }, -} - -M.lsp = { - n = { - -- ["gD"] = { - -- function() - -- vim.lsp.buf.declaration() - -- end, - -- "lsp declaration", - -- }, - -- - -- ["gd"] = { - -- function() - -- vim.lsp.buf.definition() - -- end, - -- "lsp definition", - -- }, - - ["gh"] = { "Lspsaga lsp_finder" }, - -- ["K"] = { "Lspsaga hover_doc", "Hover Documentation" }, - ["ld"] = { "Lspsaga show_line_diagnostics", "[L]ine [D]iagnostics" }, - ["cd"] = { "Lspsaga show_cursor_diagnostics", "[C]ursor [D]iagnostics" }, - ["ad"] = { "Lspsaga show_buffer_diagnostics", "Buffer [D]iagnostics" }, - }, -} - -return M diff --git a/pkgs/nvchad/custom/plugins.lua b/pkgs/nvchad/custom/plugins.lua deleted file mode 100644 index 2c0d145..0000000 --- a/pkgs/nvchad/custom/plugins.lua +++ /dev/null @@ -1,396 +0,0 @@ -return { - { "preservim/vimux" }, - { - "christoomey/vim-tmux-navigator", - cmd = { "TmuxNavigateLeft", "TmuxNavigateDown", "TmuxNavigateUp", "TmuxNavigateRight" }, - keys = { "", "", "", "" }, - }, - { "JoosepAlviste/nvim-ts-context-commentstring" }, - { "nvim-treesitter/nvim-treesitter-textobjects" }, - { "mrjones2014/nvim-ts-rainbow" }, - { "nvim-treesitter/nvim-treesitter-context" }, - - { - "glepnir/lspsaga.nvim", - event = "BufRead", - cmd = { "Lspsaga" }, - config = function() - require("lspsaga").setup({}) - end, - dependencies = { - { "nvim-tree/nvim-web-devicons" }, - { "nvim-treesitter/nvim-treesitter" }, - }, - }, - - -- Copilot - { - "zbirenbaum/copilot.lua", - event = "VimEnter", - config = function() - vim.defer_fn(function() - require("copilot").setup({ - suggestion = { - keymap = { - accept = "", - accept_word = false, - accept_line = false, - next = "", - prev = "", - dismiss = "", - }, - -- auto_trigger = true, - }, - }) - end, 100) - end, - }, - { - "zbirenbaum/copilot-cmp", - event = "VeryLazy", - dependencies = { "zbirenbaum/copilot.lua" }, - config = function() - require("copilot_cmp").setup() - end, - }, - - -- Git - { "tpope/vim-fugitive" }, - { "tpope/vim-rhubarb" }, - { "lewis6991/gitsigns.nvim" }, - - -- theme - -- { - -- "sainnhe/everforest", - -- lazy = false, - -- priority = 1000, - -- config = function() - -- vim.g.everforest_background = "hard" - -- vim.cmd([[colorscheme everforest]]) - -- end, - -- }, - - -- Others - { - "Pocco81/TrueZen.nvim", - cmd = { "TZNarrow", "TZFocus", "TZMinimalist", "TZAtaraxis" }, - config = true, - }, - { - "nathom/filetype.nvim", - opts = function() - return { - overrides = { - extensions = { - mdx = "markdown", - }, - function_complex = { - [".*blade.php"] = function() - vim.bo.filetype = "blade" - end, - }, - }, - } - end, - }, - { - "mg979/vim-visual-multi", - -- keys = { "" }, - lazy = false, - init = function(_) - vim.g.VM_Mono_hl = "Substitute" - vim.g.VM_Cursor_hl = "IncSearch" - - vim.g.VM_maps = { - ["Find Under"] = "", - ["Find Subword Under"] = "", - ["Next"] = "n", - ["Previous"] = "N", - ["Skip"] = "q", - -- ["Add Cursor Down"] = "", - -- ["Add Cursor Up"] = "", - -- ["Select l"] = "", - -- ["Select r"] = "", - -- ["Add Cursor at Position"] = [[\\\]], - ["Select All"] = "", - ["Visual All"] = "", - ["Exit"] = "", - } - end, - }, - { - "akinsho/toggleterm.nvim", - event = "VeryLazy", - cmd = { "ToggleTerm" }, - version = "*", - config = true, - --opts = function() - -- require("toggleterm").setup() - --end, - }, - { - "tpope/vim-surround", - dependencies = { - "tpope/vim-repeat", - }, - }, - { - "iamcco/markdown-preview.nvim", - build = "cd app && npm install", - config = function() - vim.g.mkdp_filetypes = { "markdown" } - end, - ft = { "markdown" }, - }, - { - "ggandor/leap.nvim", - config = function() - require("leap").add_default_mappings() - end, - }, - - -- LSPs - { - "neovim/nvim-lspconfig", - config = function(_, _) - require("plugins.configs.lspconfig") - local on_attach = require("plugins.configs.lspconfig").on_attach - local capabilities = require("plugins.configs.lspconfig").capabilities - - local lspconfig = require("lspconfig") - local servers = { - -- lua stuff - "lua_ls", - - -- shell - "bashls", - -- "awk_ls", - - -- c - "clangd", - - -- rust - "rust_analyzer", - - -- web dev - "cssls", - "html", - "tsserver", - "jsonls", - "tailwindcss", - "eslint", - - -- python - "pyright", - - -- yaml - "yamlls", - } - - for _, lsp in ipairs(servers) do - lspconfig[lsp].setup({ - on_attach = on_attach, - capabilities = capabilities, - }) - end - end, - }, - { - "jose-elias-alvarez/null-ls.nvim", - event = { "BufReadPre", "BufNewFile" }, - dependencies = { - "neovim/nvim-lspconfig", - "mason.nvim", - }, - opts = function() - -- null-ls - -- to setup format on save - local null_ls = require("null-ls") - - local formatting = null_ls.builtins.formatting -- to setup formatters - local diagnostics = null_ls.builtins.diagnostics -- to setup linters - local code_actions = null_ls.builtins.code_actions -- to setup code actions - local completion = null_ls.builtins.completion -- to setup completions - - local lsp_formatting_group = vim.api.nvim_create_augroup("LspFormatting", {}) - - -- configure null_ls - return { - debug = false, - -- setup formatters & linters - sources = { - completion.spell, - code_actions.gitsigns, - - -- lua - formatting.stylua, - - -- web stuffs - formatting.prettier.with({ - extra_filetypes = { "svelte" }, - }), -- js/ts formatter - diagnostics.eslint_d.with({ -- js/ts linter - -- only enable eslint if root has .eslintrc.js (not in youtube nvim video) - condition = function(utils) - return utils.root_has_file(".eslintrc.js") or utils.root_has_file(".eslintrc.cjs") -- change file extension if you use something else - end, - filetypes = { - "javascript", - "javascriptreact", - "typescript", - "typescriptreact", - "vue", - "svelte", - }, - }), - code_actions.eslint_d.with({ - filetypes = { - "javascript", - "javascriptreact", - "typescript", - "typescriptreact", - "vue", - "svelte", - }, - }), - - -- php - diagnostics.php, - formatting.blade_formatter, - -- formatting.pint, - - -- python - formatting.black, - - -- shell - formatting.shfmt, - formatting.jq, - - -- rust - formatting.rustfmt, - - -- c / c++ - formatting.clang_format, - - -- nix - formatting.nixpkgs_fmt, - -- formatting.nixfmt, - - -- config - formatting.taplo, - }, - -- configure format on save - on_attach = function(current_client, bufnr) - if current_client.supports_method("textDocument/formatting") then - vim.api.nvim_clear_autocmds({ group = lsp_formatting_group, buffer = bufnr }) - vim.api.nvim_create_autocmd("BufWritePre", { - group = lsp_formatting_group, - buffer = bufnr, - callback = function() - -- print("HERE 1", current_client.name) - -- vim.lsp.buf.formatting_sync() - vim.lsp.buf.format({ - bufnr = bufnr, - filter = function(client) - -- print("HERE 2", current_client.name, client.name) - -- only use null-ls for formatting instead of lsp server - return client.name == "null-ls" - end, - }) - end, - }) - end - end, - } - end, - }, - - { - "williamboman/mason.nvim", - opts = function() - return { - ensure_installed = { - -- lua stuff - "lua-language-server", - "stylua", - - -- shell - "bash-language-server", - -- "awk-language-server", - "shfmt", - "shellcheck", - - -- c - "clangd", - - -- rust - "rust-analyzer", - "rustfmt", - - -- web dev - "css-lsp", - "html-lsp", - "typescript-language-server", - "json-lsp", - "tailwindcss-language-server", - "eslint-lsp", - - -- python - "pyright", - - -- javascript - "prettier", - "prettierd", - - -- yaml - "yaml-language-server", - - -- toml - "taplo", - }, - } - end, - }, - { - "nvim-treesitter/nvim-treesitter", - opts = function(_, opts) - - opts.ignore_install = { 'help' } - - return vim.tbl_deep_extend("force", require("plugins.configs.treesitter"), { - ensure_installed = { - "c", - "cpp", - "css", - "go", - "lua", - "python", - "rust", - "typescript", - "svelte", - "html", - "java", - "help", - "nix", - "markdown", - "markdown_inline", - }, - }) - end, - }, - { - "hrsh7th/nvim-cmp", - opts = function() - return vim.tbl_deep_extend("force", require("plugins.configs.cmp"), { - sources = { - { name = "luasnip" }, - { name = "copilot" }, - { name = "nvim_lsp" }, - { name = "buffer" }, - { name = "nvim_lua" }, - { name = "path" }, - }, - }) - end, - }, -} diff --git a/pkgs/nvchad/custom/term.lua b/pkgs/nvchad/custom/term.lua deleted file mode 100644 index d66e590..0000000 --- a/pkgs/nvchad/custom/term.lua +++ /dev/null @@ -1,29 +0,0 @@ -local Terminal = require("toggleterm.terminal").Terminal - -local M = {} - -M.lazygit = Terminal:new({ - cmd = "lazygit", - hidden = true, - direction = "float", - float_opts = { - border = "double", - }, - -- function to run on opening the terminal - on_open = function(term) - vim.cmd("startinsert!") - vim.api.nvim_buf_set_keymap(term.bufnr, "n", "q", "close", { noremap = true, silent = true }) - end, - -- function to run on closing the terminal - on_close = function(_) - vim.cmd("startinsert!") - end, -}) - -M.htop = Terminal:new({ - cmd = "htop", - hidden = true, - direction = "float", -}) - -return M diff --git a/pkgs/nvchad/default.nix b/pkgs/nvchad/default.nix deleted file mode 100644 index 3927b00..0000000 --- a/pkgs/nvchad/default.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ lib, stdenv, pkgs }: - -let - custom = ./custom; -in -stdenv.mkDerivation { - pname = "nvchad"; - version = "2.0.0"; - - src = pkgs.fetchFromGitHub { - owner = "NvChad"; - repo = "NvChad"; - rev = "refs/heads/v2.0"; - sha256 = "sha256-tKMvKdB3jPSvcyewaOe8oak3pXhjAcLyyxgGMiMeqeU="; - }; - - installPhase = '' - mkdir $out - cp -r * "$out/" - mkdir -p "$out/lua/custom" - cp -r ${custom}/* "$out/lua/custom/" - ''; - - meta = with lib; { - description = "NvChad"; - homepage = "https://github.com/NvChad/NvChad"; - platforms = platforms.all; - license = licenses.gpl3; - }; -}