diff --git a/GEMINI.md b/GEMINI.md new file mode 100644 index 000000000..ff4711b13 --- /dev/null +++ b/GEMINI.md @@ -0,0 +1,31 @@ +# GEMINI Analysis of Neovim Configuration + +## Project Overview + +This directory contains a Neovim configuration based on the [LazyVim](https://github.com/LazyVim/LazyVim) starter template. It uses `lazy.nvim` for plugin management and is structured in Lua. The configuration is designed to be modular, with plugins, options, keymaps, and autocommands separated into different files. + +## Key Files + +* `init.lua`: The main entry point for the Neovim configuration. It bootstraps `lazy.nvim` and loads the configuration. +* `lazy-lock.json`: This file is automatically generated by `lazy.nvim` and locks the versions of all installed plugins, ensuring a reproducible environment. +* `lua/config/lazy.lua`: This file contains the setup for `lazy.nvim`. It specifies the plugins to be loaded, including LazyVim itself and any custom plugins in the `lua/plugins` directory. +* `lua/config/options.lua`: This file is for setting Neovim's options. +* `lua/config/keymaps.lua`: This file is for defining custom keymaps. +* `lua/config/autocmds.lua`: This file is for defining custom autocommands. +* `lua/plugins/`: This directory contains custom plugin specifications. Each file in this directory can add new plugins, disable or enable LazyVim plugins, or override their configurations. The `example.lua` file provides a good starting point for how to structure these files. +* `lua/plugins/nvim-tree.lua`: This file contains the configuration for the `nvim-tree.lua` plugin, which provides a file explorer. + +## Building and Running + +This is a Neovim configuration, so there is no "building" or "running" in the traditional sense. To use this configuration, you need to have Neovim installed. Once Neovim is installed, you can clone this repository to `~/.config/nvim` and start Neovim. The plugins will be automatically installed on the first run. + +## Development Conventions + +* **Plugin Management:** Plugins are managed using `lazy.nvim`. To add a new plugin, create a new file in the `lua/plugins/` directory or add it to an existing one. +* **Configuration:** The configuration is modular. Options, keymaps, and autocommands should be defined in their respective files in the `lua/config/` directory. +* **Customization:** The `lua/plugins/` directory is the primary place for customization. You can override the default LazyVim plugins or add new ones here. The `example.lua` file shows how to do this. +* **Styling:** The `stylua.toml` file suggests that the Lua code is formatted with `stylua`. + +## Keymaps + +* `e`: Toggle file explorer (`nvim-tree`). \ No newline at end of file diff --git a/init.lua b/init.lua index 2514f9ed9..d4bae5307 100644 --- a/init.lua +++ b/init.lua @@ -1,2 +1,3 @@ -- bootstrap lazy.nvim, LazyVim and your plugins require("config.lazy") + diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 000000000..4efe333ec --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,41 @@ +{ + "CopilotChat.nvim": { "branch": "main", "commit": "5f3c57083515ea511deda291ae72434db568ee6f" }, + "LazyVim": { "branch": "main", "commit": "25abbf546d564dc484cf903804661ba12de45507" }, + "blink-cmp-copilot": { "branch": "main", "commit": "439cff78780c033aa23cf061d7315314b347e3c1" }, + "blink.cmp": { "branch": "main", "commit": "bae4bae0eedd1fa55f34b685862e94a222d5c6f8" }, + "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, + "catppuccin": { "branch": "main", "commit": "3aaf3ab60221bca8edb1354e41bd514a22c89de2" }, + "conform.nvim": { "branch": "master", "commit": "973f3cb73887d510321653044791d7937c7ec0fa" }, + "dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" }, + "flash.nvim": { "branch": "main", "commit": "3c942666f115e2811e959eabbdd361a025db8b63" }, + "flutter-tools.nvim": { "branch": "main", "commit": "65b7399804315a1160933b64292d3c5330aa4e9f" }, + "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, + "gitsigns.nvim": { "branch": "main", "commit": "6e3c66548035e50db7bd8e360a29aec6620c3641" }, + "grug-far.nvim": { "branch": "main", "commit": "385d1949dc21d0c39e7a74b4f4a25da18817bc86" }, + "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, + "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, + "lualine.nvim": { "branch": "master", "commit": "b8c23159c0161f4b89196f74ee3a6d02cdc3a955" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" }, + "mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" }, + "mini.ai": { "branch": "main", "commit": "1cd4f021a05c29acd4ab511c0981da14217daf38" }, + "mini.icons": { "branch": "main", "commit": "b8f6fa6f5a3fd0c56936252edcd691184e5aac0c" }, + "mini.pairs": { "branch": "main", "commit": "1e1ca3f60f58d4050bf814902b472eec9963a5dd" }, + "noice.nvim": { "branch": "main", "commit": "0427460c2d7f673ad60eb02b35f5e9926cf67c59" }, + "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, + "nvim-lint": { "branch": "master", "commit": "7ef127aaede2a4d5ad8df8321e2eb4e567f29594" }, + "nvim-lspconfig": { "branch": "master", "commit": "45ff1914044de7dbd4cd85053dc09f47312a2f4d" }, + "nvim-tree.lua": { "branch": "master", "commit": "321bc61580fd066b76861c32de3319c3a6d089e7" }, + "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "71385f191ec06ffc60e80e6b0c9a9d5daed4824c" }, + "nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" }, + "nvim-web-devicons": { "branch": "master", "commit": "c2599a81ecabaae07c49ff9b45dcd032a8d90f1a" }, + "persistence.nvim": { "branch": "main", "commit": "166a79a55bfa7a4db3e26fc031b4d92af71d0b51" }, + "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, + "snacks.nvim": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" }, + "todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" }, + "tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" }, + "trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" }, + "ts-comments.nvim": { "branch": "main", "commit": "1bd9d0ba1d8b336c3db50692ffd0955fe1bb9f0c" }, + "typescript.nvim": { "branch": "main", "commit": "4de85ef699d7e6010528dcfbddc2ed4c2c421467" }, + "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" } +} diff --git a/lazyvim.json b/lazyvim.json new file mode 100644 index 000000000..6206f7edc --- /dev/null +++ b/lazyvim.json @@ -0,0 +1,10 @@ +{ + "extras": [ + + ], + "install_version": 8, + "news": { + "NEWS.md": "10960" + }, + "version": 8 +} \ No newline at end of file diff --git a/lua/config/keymaps.lua b/lua/config/keymaps.lua index 2c134f7bc..7471e9183 100644 --- a/lua/config/keymaps.lua +++ b/lua/config/keymaps.lua @@ -1,3 +1,5 @@ -- 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.keymap.set("n", "e", ":NvimTreeToggle", { desc = "Toggle file explorer" }) \ No newline at end of file diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua index d73bfa104..808affe9a 100644 --- a/lua/config/lazy.lua +++ b/lua/config/lazy.lua @@ -18,6 +18,9 @@ require("lazy").setup({ spec = { -- add LazyVim and import its plugins { "LazyVim/LazyVim", import = "lazyvim.plugins" }, + { import = "lazyvim.plugins.extras.lang.typescript" }, + { import = "lazyvim.plugins.extras.ai.copilot" }, + { import = "lazyvim.plugins.extras.ai.copilot-chat" }, -- import/override with your plugins { import = "plugins" }, }, @@ -30,7 +33,7 @@ require("lazy").setup({ version = false, -- always use the latest git commit -- version = "*", -- try installing the latest stable version for plugins that support semver }, - install = { colorscheme = { "tokyonight", "habamax" } }, + install = { colorscheme = { "tokyonight", "habamax" } , timeout = 600000 }, checker = { enabled = true, -- check for plugin updates periodically notify = false, -- notify on update diff --git a/lua/plugins/example.lua b/lua/plugins/example.lua deleted file mode 100644 index 17f53d6f6..000000000 --- a/lua/plugins/example.lua +++ /dev/null @@ -1,197 +0,0 @@ --- since this is just an example spec, don't actually load anything here and return an empty spec --- stylua: ignore -if true then return {} end - --- every spec file under the "plugins" directory will be loaded automatically by lazy.nvim --- --- In your plugin files, you can: --- * add extra plugins --- * disable/enabled LazyVim plugins --- * override the configuration of LazyVim plugins -return { - -- add gruvbox - { "ellisonleao/gruvbox.nvim" }, - - -- Configure LazyVim to load gruvbox - { - "LazyVim/LazyVim", - opts = { - colorscheme = "gruvbox", - }, - }, - - -- change trouble config - { - "folke/trouble.nvim", - -- opts will be merged with the parent spec - opts = { use_diagnostic_signs = true }, - }, - - -- disable trouble - { "folke/trouble.nvim", enabled = false }, - - -- override nvim-cmp and add cmp-emoji - { - "hrsh7th/nvim-cmp", - dependencies = { "hrsh7th/cmp-emoji" }, - ---@param opts cmp.ConfigSchema - opts = function(_, opts) - table.insert(opts.sources, { name = "emoji" }) - end, - }, - - -- change some telescope options and a keymap to browse plugin files - { - "nvim-telescope/telescope.nvim", - keys = { - -- add a keymap to browse plugin files - -- stylua: ignore - { - "fp", - function() require("telescope.builtin").find_files({ cwd = require("lazy.core.config").options.root }) end, - desc = "Find Plugin File", - }, - }, - -- change some options - opts = { - defaults = { - layout_strategy = "horizontal", - layout_config = { prompt_position = "top" }, - sorting_strategy = "ascending", - winblend = 0, - }, - }, - }, - - -- add pyright to lspconfig - { - "neovim/nvim-lspconfig", - ---@class PluginLspOpts - opts = { - ---@type lspconfig.options - servers = { - -- pyright will be automatically installed with mason and loaded with lspconfig - pyright = {}, - }, - }, - }, - - -- add tsserver and setup with typescript.nvim instead of lspconfig - { - "neovim/nvim-lspconfig", - dependencies = { - "jose-elias-alvarez/typescript.nvim", - init = function() - require("lazyvim.util").lsp.on_attach(function(_, buffer) - -- stylua: ignore - vim.keymap.set( "n", "co", "TypescriptOrganizeImports", { buffer = buffer, desc = "Organize Imports" }) - vim.keymap.set("n", "cR", "TypescriptRenameFile", { desc = "Rename File", buffer = buffer }) - end) - end, - }, - ---@class PluginLspOpts - opts = { - ---@type lspconfig.options - servers = { - -- tsserver will be automatically installed with mason and loaded with lspconfig - tsserver = {}, - }, - -- you can do any additional lsp server setup here - -- return true if you don't want this server to be setup with lspconfig - ---@type table - setup = { - -- example to setup with typescript.nvim - tsserver = function(_, opts) - require("typescript").setup({ server = opts }) - return true - end, - -- Specify * to use this function as a fallback for any server - -- ["*"] = function(server, opts) end, - }, - }, - }, - - -- for typescript, LazyVim also includes extra specs to properly setup lspconfig, - -- treesitter, mason and typescript.nvim. So instead of the above, you can use: - { import = "lazyvim.plugins.extras.lang.typescript" }, - - -- add more treesitter parsers - { - "nvim-treesitter/nvim-treesitter", - opts = { - ensure_installed = { - "bash", - "html", - "javascript", - "json", - "lua", - "markdown", - "markdown_inline", - "python", - "query", - "regex", - "tsx", - "typescript", - "vim", - "yaml", - }, - }, - }, - - -- since `vim.tbl_deep_extend`, can only merge tables and not lists, the code above - -- would overwrite `ensure_installed` with the new value. - -- If you'd rather extend the default config, use the code below instead: - { - "nvim-treesitter/nvim-treesitter", - opts = function(_, opts) - -- add tsx and treesitter - vim.list_extend(opts.ensure_installed, { - "tsx", - "typescript", - }) - end, - }, - - -- the opts function can also be used to change the default opts: - { - "nvim-lualine/lualine.nvim", - event = "VeryLazy", - opts = function(_, opts) - table.insert(opts.sections.lualine_x, { - function() - return "😄" - end, - }) - end, - }, - - -- or you can return new options to override all the defaults - { - "nvim-lualine/lualine.nvim", - event = "VeryLazy", - opts = function() - return { - --[[add your custom lualine config here]] - } - end, - }, - - -- use mini.starter instead of alpha - { import = "lazyvim.plugins.extras.ui.mini-starter" }, - - -- add jsonls and schemastore packages, and setup treesitter for json, json5 and jsonc - { import = "lazyvim.plugins.extras.lang.json" }, - - -- add any tools you want to have installed below - { - "williamboman/mason.nvim", - opts = { - ensure_installed = { - "stylua", - "shellcheck", - "shfmt", - "flake8", - }, - }, - }, -} diff --git a/lua/plugins/flutter.lua b/lua/plugins/flutter.lua new file mode 100644 index 000000000..3df469d54 --- /dev/null +++ b/lua/plugins/flutter.lua @@ -0,0 +1,17 @@ +return { + { + "akinsho/flutter-tools.nvim", + lazy = false, + dependencies = { + "nvim-lua/plenary.nvim", + "stevearc/dressing.nvim", -- optional for better UI + }, + config = function() + require("flutter-tools").setup({ + dev_log = { + open_cmd = "botright 8split", + }, + }) + end, + }, +} diff --git a/lua/plugins/languages.lua b/lua/plugins/languages.lua new file mode 100644 index 000000000..a4a2ca917 --- /dev/null +++ b/lua/plugins/languages.lua @@ -0,0 +1,105 @@ +return { + -- add pyright to lspconfig + { + "neovim/nvim-lspconfig", + ---@class PluginLspOpts + opts = { + ---@type lspconfig.options + servers = { + -- pyright will be automatically installed with mason and loaded with lspconfig + pyright = {}, + tsserver = {}, + + }, + }, + }, + + -- add tsserver and setup with typescript.nvim instead of lspconfig + { + "neovim/nvim-lspconfig", + dependencies = { + "jose-elias-alvarez/typescript.nvim", + init = function() + require("lazyvim.util").lsp.on_attach(function(_, buffer) + -- stylua: ignore + vim.keymap.set( "n", "co", "TypescriptOrganizeImports", { buffer = buffer, desc = "Organize Imports" }) + vim.keymap.set("n", "cR", "TypescriptRenameFile", { desc = "Rename File", buffer = buffer }) + end) + end, + }, + ---@class PluginLspOpts + opts = { + ---@type lspconfig.options + servers = { + -- tsserver will be automatically installed with mason and loaded with lspconfig + tsserver = {}, + }, + -- you can do any additional lsp server setup here + -- return true if you don't want this server to be setup with lspconfig + ---@type table + setup = { + -- example to setup with typescript.nvim + tsserver = function(_, opts) + require("typescript").setup({ server = opts }) + return true + end, + -- Specify * to use this function as a fallback for any server + -- ["*"] = function(server, opts) end, + }, + }, + }, + + + + -- add more treesitter parsers + { + "nvim-treesitter/nvim-treesitter", + opts = { + ensure_installed = { + "bash", + "html", + "javascript", + "json", + "lua", + "markdown", + "markdown_inline", + "python", + "query", + "regex", + "tsx", + "typescript", + "vim", + "yaml", + "dart", + "comment", + }, + incremental_selection = { + enable = true, + keymaps = { + init_selection = "", + node_incremental = "", + scope_incremental = "", + node_decremental = "", + }, + }, + }, + }, + + -- add any tools you want to have installed below + { + "williamboman/mason.nvim", + opts = { + ensure_installed = { + "stylua", + "shellcheck", + "shfmt", + "flake8", + "eslint-lsp", + "prettierd", + "black", + "isort", + "dart-debug-adapter", + }, + }, + }, +} diff --git a/lua/plugins/nvim-tree.lua b/lua/plugins/nvim-tree.lua new file mode 100644 index 000000000..93604bbc5 --- /dev/null +++ b/lua/plugins/nvim-tree.lua @@ -0,0 +1,11 @@ +return { + "nvim-tree/nvim-tree.lua", + version = "*", + lazy = false, + dependencies = { + "nvim-tree/nvim-web-devicons", + }, + config = function() + require("nvim-tree").setup {} + end, +}