diff --git a/modules/lazyvim/config/init.lua b/modules/lazyvim/config/init.lua deleted file mode 100644 index 2514f9e..0000000 --- a/modules/lazyvim/config/init.lua +++ /dev/null @@ -1,2 +0,0 @@ --- bootstrap lazy.nvim, LazyVim and your plugins -require("config.lazy") diff --git a/modules/lazyvim/config/lazyvim.json b/modules/lazyvim/config/lazyvim.json deleted file mode 100644 index 4e1938e..0000000 --- a/modules/lazyvim/config/lazyvim.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extras": [ - - ], - "version": 3 -} diff --git a/modules/lazyvim/config/lua/config/autocmds.lua b/modules/lazyvim/config/lua/config/autocmds.lua deleted file mode 100644 index 27e9e06..0000000 --- a/modules/lazyvim/config/lua/config/autocmds.lua +++ /dev/null @@ -1,3 +0,0 @@ --- Autocmds are automatically loaded on the VeryLazy event --- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua --- Add any additional autocmds here diff --git a/modules/lazyvim/config/lua/config/keymaps.lua b/modules/lazyvim/config/lua/config/keymaps.lua deleted file mode 100644 index 61e6a61..0000000 --- a/modules/lazyvim/config/lua/config/keymaps.lua +++ /dev/null @@ -1,65 +0,0 @@ --- Keymaps are automatically loaded on the VeryLazy event --- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua --- Add any additional keymaps here --- -vim.o.exrc = true -vim.o.hidden = true -vim.o.ignorecase = true -vim.o.incsearch = true -vim.o.listchars = "tab:▸ ,trail:·" -vim.o.backup = false -vim.o.hlsearch = false -vim.o.swapfile = false -vim.o.wrap = false -vim.o.number = true -vim.o.relativenumber = true -vim.o.scrolloff = 8 -vim.o.signcolumn = "yes:1" -vim.o.smartcase = true -vim.o.termguicolors = true - --- tabs -vim.o.tabstop = 2 -vim.o.softtabstop = 2 -vim.o.shiftwidth = 2 -vim.o.expandtab = true -vim.o.smartindent = true - -vim.o.clipboard = "unnamedplus" - --- markdown folding -vim.g.markdown_folding = true -vim.cmd([[ - au FileType markdown setlocal foldlevel=99 -]]) - -vim.g.mapleader = " " -function keymap(mode, lhs, rhs, opts) - vim.api.nvim_set_keymap(mode, lhs, rhs, vim.tbl_extend("keep", opts or {}, { noremap = true, silent = true })) -end - --- delete without yanking -keymap("n", "D", '"_D') -keymap("n", "d", '"_d') -keymap("v", "D", '"_D') -keymap("v", "d", '"_d') - --- reselect visual selection after indenting -keymap("v", "<", "", ">gv") - --- allow gf to open non-existent files -keymap("", "gF", ":edit %:p:h/") - --- disable annoying command line thing -keymap("n", "q:", ":q") - --- navigation -keymap("n", "h", "h") -keymap("n", "j", "j") -keymap("n", "k", "k") -keymap("n", "l", "l") -keymap("n", "o", "o") - --- match :qw as :wq -keymap("c", "qw", ":wq") diff --git a/modules/lazyvim/config/lua/config/lazy.lua b/modules/lazyvim/config/lua/config/lazy.lua deleted file mode 100644 index 7afcacf..0000000 --- a/modules/lazyvim/config/lua/config/lazy.lua +++ /dev/null @@ -1,56 +0,0 @@ -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not vim.loop.fs_stat(lazypath) then - -- bootstrap lazy.nvim - -- stylua: ignore - vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath }) -end -vim.opt.rtp:prepend(vim.env.LAZY or lazypath) - -require("lazy").setup({ - spec = { - { - "LazyVim/LazyVim", - import = "lazyvim.plugins", - opts = { - news = { - lazyvim = false, - neovim = false, - }, - }, - }, - { import = "lazyvim.plugins.extras.dap.core" }, - { import = "lazyvim.plugins.extras.lang.typescript" }, - { import = "lazyvim.plugins.extras.test.core" }, - { import = "lazyvim.plugins.extras.util.mini-hipatterns" }, - { import = "lazyvim.plugins.extras.util.project" }, - -- { import = "lazyvim.plugins.extras.coding.copilot" }, - -- { import = "lazyvim.plugins.extras.lang.json" }, - -- { import = "lazyvim.plugins.extras.ui.mini-animate" }, - -- import/override with your plugins - { import = "plugins" }, - }, - defaults = { - lazy = false, - -- It's recommended to leave version=false for now, since a lot the plugin that support versioning, - -- have outdated releases, which may break your Neovim install. - version = false, -- always use the latest git commit - -- version = "*", -- try installing the latest stable version for plugins that support semver - }, - install = { colorscheme = { "tokyonight", "habamax" } }, - checker = { enabled = true }, -- automatically check for plugin updates - performance = { - rtp = { - -- disable some rtp plugins - disabled_plugins = { - "gzip", - -- "matchit", - -- "matchparen", - -- "netrwPlugin", - "tarPlugin", - "tohtml", - "tutor", - "zipPlugin", - }, - }, - }, -}) diff --git a/modules/lazyvim/config/lua/config/options.lua b/modules/lazyvim/config/lua/config/options.lua deleted file mode 100644 index 3ea1454..0000000 --- a/modules/lazyvim/config/lua/config/options.lua +++ /dev/null @@ -1,3 +0,0 @@ --- Options are automatically loaded before lazy.nvim startup --- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua --- Add any additional options here diff --git a/modules/lazyvim/config/lua/plugins/copilot-chat.lua b/modules/lazyvim/config/lua/plugins/copilot-chat.lua deleted file mode 100644 index f0f5146..0000000 --- a/modules/lazyvim/config/lua/plugins/copilot-chat.lua +++ /dev/null @@ -1,62 +0,0 @@ -return { - { - "CopilotC-Nvim/CopilotChat.nvim", - enabled = false, - opts = { - show_help = "yes", -- Show help text for CopilotChatInPlace, default: yes - debug = false, -- Enable or disable debug mode, the log file will be in ~/.local/state/nvim/CopilotChat.nvim.log - disable_extra_info = "no", -- Disable extra information (e.g: system prompt) in the response. - -- proxy = "socks5://127.0.0.1:3000", -- Proxies requests via https or socks. - }, - build = function() - vim.notify("Please update the remote plugins by running ':UpdateRemotePlugins', then restart Neovim.") - end, - event = "VeryLazy", - keys = function() - local keybinds = { - { - "ccc", - ":CopilotChat ", - desc = "CopilotChat - Prompt", - }, - { - "ccc", - ":CopilotChatVisual ", - mode = "x", - desc = "CopilotChat - Prompt", - }, - } - local prompts = { - { prompt = "Simplify and improve readablilty.", desc = "Simplify", key = "s" }, - { prompt = "Optimize the code to improve performance and readablilty.", desc = "Optimize", key = "o" }, - { prompt = "Review the following code and provide concise suggestions.", desc = "Review", key = "r" }, - { prompt = "Find possible errors and fix them for me", desc = "Fix", key = "f" }, - { prompt = "Explain in detail.", desc = "Explain", key = "e" }, - { - prompt = "Generate extensive unit tests. Respond with just the code and do not explain the result.", - desc = "Test", - key = "t", - }, - { - prompt = "Generate extensive unit tests using `jest` with `@testing-libary/react` when needed. " - .. "Prefer to use global variable `screen` from `@testing-libary/react` when needed. " - .. "Prefer to use `jest.each` when iterating over similar test cases. " - .. "Prefer to use typescript. " - .. "Respond with just the code and do not explain the result.", - desc = "React", - key = "Tr", - }, - } - for _, v in pairs(prompts) do - table.insert(keybinds, { - "cc" .. v.key, - ":CopilotChatVisual " .. v.prompt .. "", - mode = "x", - desc = "CopilotChat - " .. v.desc, - silent = true, - }) - end - return keybinds - end, - }, -} diff --git a/modules/lazyvim/config/lua/plugins/general.lua b/modules/lazyvim/config/lua/plugins/general.lua deleted file mode 100644 index 95b0ae3..0000000 --- a/modules/lazyvim/config/lua/plugins/general.lua +++ /dev/null @@ -1,151 +0,0 @@ -local Util = require("lazyvim.util") - -return { - -- disabled plugins - { "folke/noice.nvim", enabled = false }, - - "tpope/vim-fugitive", - { - "hrsh7th/nvim-cmp", - dependencies = { "hrsh7th/cmp-emoji", "hrsh7th/cmp-nvim-lsp-signature-help" }, - ---@param opts cmp.ConfigSchema - opts = function(_, opts) - table.insert(opts.sources, { name = "emoji" }) - table.insert(opts.sources, { name = "nvim_lsp_signature_help" }) - end, - }, - { - "neovim/nvim-lspconfig", - opts = { - inlay_hints = { enabled = true }, - servers = { eslint = {} }, - setup = { - -- Add Eslint and use it for formatting - eslint = function() - require("lazyvim.util").lsp.on_attach(function(client) - if client.name == "eslint" then - client.server_capabilities.documentFormattingProvider = true - elseif client.name == "vtsls" then - client.server_capabilities.documentFormattingProvider = false - end - end) - end, - }, - }, - }, - { - "nvim-neo-tree/neo-tree.nvim", - branch = "v3.x", - cmd = "Neotree", - keys = { - { - "n", - function() - require("neo-tree.command").execute({ toggle = true, dir = Util.root() }) - end, - desc = "Explorer NeoTree (root dir)", - }, - { - "N", - function() - require("neo-tree.command").execute({ toggle = true, dir = vim.loop.cwd() }) - end, - desc = "Explorer NeoTree (cwd)", - }, - { - "ge", - function() - require("neo-tree.command").execute({ source = "git_status", toggle = true }) - end, - desc = "Git explorer", - }, - { - "be", - function() - require("neo-tree.command").execute({ source = "buffers", toggle = true }) - end, - desc = "Buffer explorer", - }, - }, - deactivate = function() - vim.cmd([[Neotree close]]) - end, - init = function() - if vim.fn.argc(-1) == 1 then - local stat = vim.loop.fs_stat(vim.fn.argv(0)) - if stat and stat.type == "directory" then - require("neo-tree") - end - end - end, - opts = { - sources = { "filesystem", "buffers", "git_status", "document_symbols" }, - open_files_do_not_replace_types = { "terminal", "Trouble", "trouble", "qf", "Outline" }, - filesystem = { - bind_to_cwd = false, - follow_current_file = { enabled = true }, - use_libuv_file_watcher = true, - }, - window = { - mappings = { - [""] = "none", - ["O"] = { - command = function(state) - local filepath = state.tree:get_node().path - local osType = vim.loop.os_uname().sysname - local command - - if osType == "Windows_NT" then - command = "start " .. filepath - elseif osType == "Darwin" then - command = "open " .. filepath - else - command = "xdg-open " .. filepath - end - os.execute(command) - end, - desc = "open_with_system_defaults", - }, - }, - }, - default_component_configs = { - indent = { - with_expanders = true, -- if nil and file nesting is enabled, will enable expanders - expander_collapsed = "", - expander_expanded = "", - expander_highlight = "NeoTreeExpander", - }, - }, - event_handlers = { - { - event = "file_opened", - handler = function() - --auto close - require("neo-tree").close_all() - end, - }, - }, - }, - config = function(_, opts) - local function on_move(data) - Util.lsp.on_rename(data.source, data.destination) - end - - local events = require("neo-tree.events") - opts.event_handlers = opts.event_handlers or {} - vim.list_extend(opts.event_handlers, { - { event = events.FILE_MOVED, handler = on_move }, - { event = events.FILE_RENAMED, handler = on_move }, - }) - require("neo-tree").setup(opts) - vim.api.nvim_create_autocmd("TermClose", { - pattern = "*lazygit", - callback = function() - if package.loaded["neo-tree.sources.git_status"] then - require("neo-tree.sources.git_status").refresh() - end - end, - }) - end, - }, -} diff --git a/modules/lazyvim/config/lua/plugins/harpoon.lua b/modules/lazyvim/config/lua/plugins/harpoon.lua deleted file mode 100644 index dfeaf0b..0000000 --- a/modules/lazyvim/config/lua/plugins/harpoon.lua +++ /dev/null @@ -1,110 +0,0 @@ -return { - { - "ThePrimeagen/harpoon", - branch = "harpoon2", - enabled = false, - dependencies = { "nvim-lua/plenary.nvim" }, - config = true, - keys = { - { - "a", - function() - require("harpoon"):list():add() - end, - desc = "Mark file with harpoon", - }, - { - "j", - function() - require("harpoon"):list():select(1) - end, - desc = "Select first mark", - }, - { - "J", - function() - require("harpoon"):list():replace_at(1) - end, - desc = "Replace first mark", - }, - { - "h", - function() - require("harpoon"):list():select(1) - end, - desc = "Select first mark", - }, - { - "H", - function() - require("harpoon"):list():replace_at(1) - end, - desc = "Replace first mark", - }, - { - "j", - function() - require("harpoon"):list():select(2) - end, - desc = "Select first mark", - }, - { - "J", - function() - require("harpoon"):list():replace_at(2) - end, - desc = "Replace first mark", - }, - { - "k", - function() - require("harpoon"):list():select(3) - end, - desc = "Select first mark", - }, - { - "K", - function() - require("harpoon"):list():replace_at(3) - end, - desc = "Replace first mark", - }, - { - "l", - function() - require("harpoon"):list():select(4) - end, - desc = "Select first mark", - }, - { - "L", - function() - require("harpoon"):list():replace_at(4) - end, - desc = "Replace first mark", - }, - { - ";", - function() - require("harpoon"):list():select(5) - end, - desc = "Select first mark", - }, - { - ":", - function() - require("harpoon"):list():replace_at(5) - end, - desc = "Replace first mark", - }, - { - "", - function() - local harpoon = require("harpoon") - harpoon.ui:toggle_quick_menu(harpoon:list()) - end, - desc = "Replace first mark", - }, - }, - }, -} diff --git a/modules/lazyvim/config/lua/plugins/test.lua b/modules/lazyvim/config/lua/plugins/test.lua deleted file mode 100644 index f625d0c..0000000 --- a/modules/lazyvim/config/lua/plugins/test.lua +++ /dev/null @@ -1,129 +0,0 @@ -return { - { - "nvim-neotest/neotest", - dependencies = { - "nvim-treesitter/nvim-treesitter", - { - "nvim-neotest/neotest-jest", - config = function() - require("neotest-jest").is_test_file = function(file_path) - for _, x in ipairs({ "spec", "test", "unit" }) do - for _, ext in ipairs({ "js", "jsx", "ts", "tsx" }) do - if string.match(file_path, "%." .. x .. "%." .. ext .. "$") then - return true - end - end - end - return false - end - end, - }, - }, - - opts = { - adapters = { - ["neotest-jest"] = { - jestCommand = "npm test -- --no-watch --no-watchAll", - env = { IS_CI = true }, - cwd = function() - local file = vim.fn.expand("%:p") - if string.find(file, "/packages/") then - return string.match(file, "(.-/[^/]+/)src") - end - return vim.fn.getcwd() - end, - }, - }, - discovery = { enabled = false }, - }, - - keys = function() - return { - { - "tf", - function() - require("neotest").run.run(vim.fn.expand("%")) - end, - desc = "Test File", - }, - { - "tn", - function() - require("neotest").run.run() - end, - desc = "Test Nearest", - }, - { - "ts", - function() - require("neotest").summary.toggle() - end, - desc = "Toggle Test Summary", - }, - { - "to", - function() - require("neotest").output.open({ enter = true, auto_close = true }) - end, - desc = "Show Test Output", - }, - { - "tO", - function() - require("neotest").output_panel.toggle() - end, - desc = "Toggle Output Panel", - }, - { - "tS", - function() - require("neotest").run.stop() - end, - desc = "Stop", - }, - -- { - -- "tT", - -- function() - -- require("neotest").run.stop(vim.loop.cwd()) - -- require("neotest").run.run(vim.loop.cwd()) - -- require("neotest").run.attach(vim.loop.cwd()) - -- end, - -- desc = "Run all", - -- }, - { - "ta", - function() - require("neotest").run.attach() - end, - desc = "Attach", - }, - { - "tl", - function() - require("neotest").run.run_last() - end, - desc = "Re-run last test", - }, - - -- { - -- "tw", - -- function() - -- require("neotest").watch() - -- end, - -- desc = "Watch", - -- }, - -- { - -- "tr", - -- function() - -- require("neotest").run.run({ - -- jestCommand = "npm test -- --no-watch --no-watchAll --findRelatedTests " .. vim.fn.expand("%"), - -- env = { IS_CI = "true" }, - -- }) - -- require("neotest").run.attach() - -- end, - -- desc = "Test related", - -- }, - } - end, - }, -} diff --git a/modules/lazyvim/config/lua/plugins/theme.lua b/modules/lazyvim/config/lua/plugins/theme.lua deleted file mode 100644 index 6715f2b..0000000 --- a/modules/lazyvim/config/lua/plugins/theme.lua +++ /dev/null @@ -1,6 +0,0 @@ -return { - "folke/tokyonight.nvim", - opts = { - transparent = true, - }, -} diff --git a/modules/lazyvim/config/lua/plugins/treesitter.lua b/modules/lazyvim/config/lua/plugins/treesitter.lua deleted file mode 100644 index ae5da4d..0000000 --- a/modules/lazyvim/config/lua/plugins/treesitter.lua +++ /dev/null @@ -1,16 +0,0 @@ -return { - { - "nvim-treesitter/nvim-treesitter", - opts = { - incremental_selection = { - enable = true, - keymaps = { - init_selection = "", - node_incremental = "", - scope_incremental = false, - node_decremental = "", - }, - }, - }, - }, -} diff --git a/modules/lazyvim/config/stylua.toml b/modules/lazyvim/config/stylua.toml deleted file mode 100644 index 5d6c50d..0000000 --- a/modules/lazyvim/config/stylua.toml +++ /dev/null @@ -1,3 +0,0 @@ -indent_type = "Spaces" -indent_width = 2 -column_width = 120 \ No newline at end of file diff --git a/modules/lazyvim/default.nix b/modules/lazyvim/default.nix deleted file mode 100644 index bfc3d33..0000000 --- a/modules/lazyvim/default.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ lib, username, pkgs, options, ... }: -{ - config = - let - lazyvim = (pkgs.unstable.neovim.override { - extraPython3Packages = (p: with p;[ - python-dotenv - requests - pkgs.unstable.python311Packages.pynvim - prompt-toolkit - ]); - }); - in - { - home-manager.users.${username} = { - home.packages = with pkgs; - [ - clang - cargo - rustc - ripgrep - ]; - - home.file."./.config/nvim/" = { - source = ./config; - recursive = true; - }; - programs.fish.shellAliases = { - lazyvim = "${lazyvim}/bin/nvim"; - }; - }; - } // lib.optionalAttrs (builtins.hasAttr "homebrew" options) { - # needed for spectre plugin on darwin - homebrew.brews = [ "gnu-sed" ]; - }; -} diff --git a/modules/nvim/plugins/telescope/config.lua b/modules/nvim/plugins/telescope/config.lua index e7fcfcc..c158ba4 100644 --- a/modules/nvim/plugins/telescope/config.lua +++ b/modules/nvim/plugins/telescope/config.lua @@ -11,7 +11,6 @@ vim.o.timeoutlen = 200 telescope.load_extension 'fzf' telescope.setup { defaults = defaults } --- keybinds initialy based on https://www.lazyvim.org/extras/editor/telescope wk.register({ [','] = { function() builtin.buffers { sort_mru = true, sort_lastused = true } end, diff --git a/presets/terminal.nix b/presets/terminal.nix index b24d730..ca2383b 100644 --- a/presets/terminal.nix +++ b/presets/terminal.nix @@ -4,7 +4,6 @@ ../modules/fish.nix ../modules/git ../modules/kitty - ../modules/lazyvim ../modules/nvim ];