diff --git a/.gitignore b/.gitignore deleted file mode 100644 index fe8d138..0000000 --- a/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/plugin -plugin/packer_compiled.lua diff --git a/after/plugin/flutter.lua b/after/plugin/flutter.lua deleted file mode 100644 index 1b92abb..0000000 --- a/after/plugin/flutter.lua +++ /dev/null @@ -1,103 +0,0 @@ --- alternatively you can override the default configs -require("flutter-tools").setup { - ui = { - -- the border type to use for all floating windows, the same options/formats - -- used for ":h nvim_open_win" e.g. "single" | "shadow" | {} - border = "rounded", - -- This determines whether notifications are show with `vim.notify` or with the plugin's custom UI - -- please note that this option is eventually going to be deprecated and users will need to - -- depend on plugins like `nvim-notify` instead. - notification_style = 'native' -- | 'plugin' - }, - decorations = { - statusline = { - -- set to true to be able use the 'flutter_tools_decorations.app_version' in your statusline - -- this will show the current version of the flutter app from the pubspec.yaml file - app_version = false, - -- set to true to be able use the 'flutter_tools_decorations.device' in your statusline - -- this will show the currently running device if an application was started with a specific - -- device - device = false, - -- set to true to be able use the 'flutter_tools_decorations.project_config' in your statusline - -- this will show the currently selected project configuration - project_config = false, - } - }, - debugger = { -- integrate with nvim dap + install dart code debugger - enabled = false, - -- if empty dap will not stop on any exceptions, otherwise it will stop on those specified - -- see |:help dap.set_exception_breakpoints()| for more info - exception_breakpoints = {}, - -- Whether to call toString() on objects in debug views like hovers and the - -- variables list. - -- Invoking toString() has a performance cost and may introduce side-effects, - -- although users may expected this functionality. null is treated like false. - evaluate_to_string_in_debug_views = true, - -- You can use the `debugger.register_configurations` to register custom runner configuration (for example for different targets or flavor). Plugin automatically registers the default configuration, but you can override it or add new ones. - -- register_configurations = function(paths) - -- require("dap").configurations.dart = { - -- -- your custom configuration - -- } - -- end, - }, - -- flutter_path = "/opt/flutter", -- <-- this takes priority over the lookup - -- flutter_lookup_cmd = nil, -- example "dirname $(which flutter)" or "asdf where flutter" - root_patterns = { ".git", "pubspec.yaml" }, -- patterns to find the root of your flutter project - fvm = false, -- takes priority over path, uses /.fvm/flutter_sdk if enabled - default_run_args= nil, -- Default options for run command (i.e `{ flutter = "--no-version-check" }`). Configured separately for `dart run` and `flutter run`. - widget_guides = { - enabled = false, - }, - closing_tags = { - highlight = "ErrorMsg", -- highlight for the closing tag - prefix = ">", -- character to use for close tag e.g. > Widget - priority = 10, -- priority of virtual text in current line - -- consider to configure this when there is a possibility of multiple virtual text items in one line - -- see `priority` option in |:help nvim_buf_set_extmark| for more info - enabled = true -- set to false to disable - }, - dev_log = { - enabled = true, - filter = nil, -- optional callback to filter the log - -- takes a log_line as string argument; returns a boolean or nil; - -- the log_line is only added to the output if the function returns true - notify_errors = false, -- if there is an error whilst running then notify the user - open_cmd = "15split", -- command to use to open the log buffer - focus_on_open = true, -- focus on the newly opened log window - }, - dev_tools = { - autostart = false, -- autostart devtools server if not detected - auto_open_browser = false, -- Automatically opens devtools in the browser - }, - outline = { - open_cmd = "30vnew", -- command to use to open the outline buffer - auto_open = false -- if true this will open the outline automatically when it is first populated - }, - lsp = { - color = { -- show the derived colours for dart variables - enabled = false, -- whether or not to highlight color variables at all, only supported on flutter >= 2.10 - background = false, -- highlight the background - background_color = nil, -- required, when background is transparent (i.e. background_color = { r = 19, g = 17, b = 24},) - foreground = false, -- highlight the foreground - virtual_text = true, -- show the highlight using virtual text - virtual_text_str = "■", -- the virtual text character to highlight - }, - on_attach = my_custom_on_attach, - capabilities = my_custom_capabilities, -- e.g. lsp_status capabilities - --- OR you can specify a function to deactivate or change or control how the config is created - capabilities = function(config) - config.specificThingIDontWant = false - return config - end, - -- see the link below for details on each option: - -- https://github.com/dart-lang/sdk/blob/master/pkg/analysis_server/tool/lsp_spec/README.md#client-workspace-configuration - -- settings = { - -- showTodos = true, - -- completeFunctionCalls = true, - -- analysisExcludedFolders = {""}, - -- renameFilesWithClasses = "prompt", -- "always" - -- enableSnippets = true, - -- updateImportsOnRename = true, -- Whether to update imports and other directives when files are renamed. Required for `FlutterRename` command. - -- } - } -} diff --git a/after/plugin/llm.lua b/after/plugin/llm.lua deleted file mode 100644 index 6d8f185..0000000 --- a/after/plugin/llm.lua +++ /dev/null @@ -1,44 +0,0 @@ --- local llm = require('llm') --- --- llm.setup({ --- api_token = nil, -- cf Install paragraph --- model = "codellama:7b-code", -- the model ID, behavior depends on backend --- backend = "ollama", -- backend ID, "huggingface" | "ollama" | "openai" | "tgi" --- url = "", -- the http url of the backend --- --- tokens_to_clear = { "" }, -- tokens to remove from the model's output --- -- parameters that are added to the request body, values are arbitrary, you can set any field:value pair here it will be passed as is to the backend --- request_body = { --- parameters = { --- max_new_tokens = 120, --- temperature = 0.2, --- top_p = 0.95, --- rope_frequency_base = 1000000 --- }, --- }, --- -- set this if the model supports fill in the middle --- fim = { --- enabled = true, --- prefix = "
 ",
---         middle = " ",
---         suffix = " ",
---
---     },
---     debounce_ms = 500,
---     accept_keymap = "",
---     dismiss_keymap = "",
---     tls_skip_verify_insecure = false,
---     -- llm-ls configuration, cf llm-ls section
---     lsp = {
---         bin_path = nil,
---         host = nil,
---         port = nil,
---         cmd_env = nil, -- or { LLM_LOG_LEVEL = "DEBUG" } to set the log level of llm-ls
---         version = "0.5.3",
---     },
---     tokenizer = nil,                   -- cf Tokenizer paragraph
---     context_window = 4048,             -- max number of tokens for the context window
---     enable_suggestions_on_startup = true,
---     enable_suggestions_on_files = "*", -- pattern matching syntax to enable suggestions on specific files, either a string or a list of strings
---     disable_url_path_completion = false, -- cf Backend
--- })
diff --git a/after/plugin/lsp.lua b/after/plugin/lsp.lua
index 2545204..9fa33d9 100644
--- a/after/plugin/lsp.lua
+++ b/after/plugin/lsp.lua
@@ -1,24 +1,44 @@
-local lsp = require("lsp-zero")
-
-lsp.preset("recommended")
-
-require("mason").setup({})
-require("mason-lspconfig").setup({
-    ensure_installed = {
-        "ts_ls",
-        "eslint",
-        "lua_ls",
-        "rust_analyzer",
-        "ast_grep"
-    },
-    handlers = {
-        function(server_name)
-            require("lspconfig")[server_name].setup({})
-        end,
-    }
+vim.diagnostic.config({
+    virtual_text = true,
+    signs = true,
+    underline = true,
 })
 
-local cmp = require('cmp')
+local servers = {
+    ts_ls = {},
+    eslint = {},
+    lua_ls = {
+        cmd = { "lua-language-server" },
+        filetypes = { "lua" }
+    },
+    rust_analyzer = {},
+    ast_grep = {},
+}
+
+---@type lsp.ClientCapabilities
+local capabilities = require("cmp_nvim_lsp").default_capabilities()
+for server, config in pairs(servers) do
+    servers[server].capabilities = capabilities
+    vim.lsp.config(server, config)
+    vim.lsp.enable(server)
+end
+
+vim.api.nvim_create_autocmd("LspAttach", {
+    callback = function(args)
+        local opts = { buffer = args.buf }
+
+        vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
+        vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
+        vim.keymap.set("n", "rn", vim.lsp.buf.rename, opts)
+        vim.keymap.set("n", "ca", vim.lsp.buf.code_action, opts)
+
+        -- vim.keymap.set("n", "[d", function() vim.diagnostic.jump({ count = 1, float = true }) end, opts)
+        -- vim.keymap.set("n", "]d", function() vim.diagnostic.jump({ count = -1, float = true }) end, opts)
+        vim.keymap.set("n", "d", vim.diagnostic.open_float, opts)
+    end
+})
+
+local cmp = require("cmp")
 
 cmp.setup({
     window = {
@@ -26,53 +46,35 @@ cmp.setup({
         documentation = cmp.config.window.bordered(),
     },
     mapping = cmp.mapping.preset.insert({
-        [''] = cmp.mapping.select_prev_item(),
-        [''] = cmp.mapping.select_next_item(),
-        [''] = cmp.mapping.confirm({ select = true }),
-        [""] = cmp.mapping.complete(),
+        [""] = cmp.mapping.select_next_item(),
+        [""] = cmp.mapping.select_prev_item(),
+        [""] = cmp.mapping.confirm(),
     }),
-    snippet = {
-        expand = function(args)
-            require('luasnip').lsp_expand(args.body)
-        end,
-    },
+    sources = {
+        { name = "nvim_lsp" },
+        { name = "luasnip" },
+    }
 })
 
-lsp.extend_lspconfig()
+require("mason").setup()
 
-lsp.set_preferences({
-    sign_icons = {}
-})
-
-local builtin = require('telescope.builtin')
-vim.keymap.set("n", "gd", builtin.lsp_definitions, {})
-
-lsp.on_attach(function(client, bufnr)
-    lsp.default_keymaps({ buffer = bufnr })
-
-    local opts = { buffer = bufnr, remap = false }
-
-    vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts)
-    vim.keymap.set("n", "gd", builtin.lsp_definitions, {})
-    vim.keymap.set('n', 'cf', builtin.lsp_incoming_calls)
-    vim.keymap.set("n", "vws", function() vim.lsp.buf.workspace_symbol() end, opts)
-    vim.keymap.set("n", "vd", function() vim.diagnostic.open_float() end, opts)
-    vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts)
-    vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts)
-    vim.keymap.set("n", "vca", function() vim.lsp.buf.code_action() end, opts)
-    vim.keymap.set("n", "vrn", function() vim.lsp.buf.rename() end, opts)
-    vim.keymap.set("i", "", function() vim.lsp.buf.signature_help() end, opts)
-end)
-
-lsp.setup()
-
--- Function to restart all active LSP clients
-local function restart_lsp()
-    for _, client in pairs(vim.lsp.get_active_clients()) do
-        client.stop()
-    end
-    vim.cmd("edit") -- Reload the current buffer to reattach the LSP clients
-end
-
--- Create a Neovim command to restart LSP
-vim.api.nvim_create_user_command('LspRestart', restart_lsp, {})
+local ensure_installed = {
+    "ast-grep",
+    "clangd",
+    "diagnostic-languageserver",
+    "eslint-lsp",
+    "jdtls",
+    "json-lsp",
+    "lua-language-server",
+    "python-lsp-server",
+    "some-sass-language-server",
+    "tombi",
+    "rust-analyzer",
+    "typescript-language-server",
+    "yaml-language-server",
+    "jinja-lsp"
+}
+vim.api.nvim_create_user_command("MasonInstallAll", function()
+    local packages = table.concat(ensure_installed, " ")
+    vim.cmd("MasonInstall " .. packages)
+end, {})
diff --git a/after/plugin/minialign.lua b/after/plugin/minialign.lua
deleted file mode 100644
index b0e8640..0000000
--- a/after/plugin/minialign.lua
+++ /dev/null
@@ -1 +0,0 @@
--- require("mini.align").setup()
diff --git a/after/plugin/netrw.lua b/after/plugin/netrw.lua
deleted file mode 100644
index 9cb317e..0000000
--- a/after/plugin/netrw.lua
+++ /dev/null
@@ -1,43 +0,0 @@
--- local g = vim.g
---
--- local options_append = {
--- 	netrw_keepdir = 0, --Keep the current directory and the browsing directory synced
--- 	netrw_winsize = "17", -- 17% size
--- 	netrw_localmkdir = "mkdir -p", -- change mkdir cmd
--- 	netrw_localcopycmd = "cp -r", -- change copy command
--- 	netrw_localrmdir = "rm -r", -- change delete command
--- 	netrw_list_hide = [['\(^\|\s\s\)\zs\.\S\+']], -- don't show hidden
--- 	--netrw_banner = 0, -- hide banner
--- 	--netrw_liststyle = 3, -- how files are open
--- 	--netrw_browse_split = 0, -- open new files in vertical split
--- --	netrw_altv = 1,
--- 	netrw_bufsettings = "noma nomod nu nobl nowrap ro", -- line number
--- }
---
--- for k, v in pairs(options_append) do
--- 	g[k] = v
--- end
---
--- local bind = function(lhs, rhs)
--- 	vim.keymap.set("n", lhs, rhs, { remap = true, buffer = true })
--- end
---
--- -- Navigation
--- bind("l", "") -- open file or dir
--- bind(".", "gh") -- toggle dotfiles
--- bind("H", "u") -- preview dir
--- bind("h", "-^") -- go up
--- bind("[f", ":Explore") -- close if open
---
--- -- Marks
--- bind("", "mf") -- toggle mark
--- bind("", "mF") -- unmark
--- bind("", "mu") -- unmark all
---
--- -- Files
--- bind("ff", ":!touch ") -- create file
--- bind("fd", ":!mkdir -p ") -- create folder
--- bind("fm", ":!mv ") -- move/rename
--- bind("fc", ":!cp -r ") -- copy
--- bind("D", ":!rm -r ") -- delete
--- bind("f;", "mx") -- run command
diff --git a/lazy-lock.json b/lazy-lock.json
deleted file mode 100644
index e521e08..0000000
--- a/lazy-lock.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
-  "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
-  "LuaSnip": { "branch": "master", "commit": "a62e1083a3cfe8b6b206e7d3d33a51091df25357" },
-  "alpha-nvim": { "branch": "main", "commit": "6c6a89d5b068b5251c8bdf0dd57bb921bcfeeb09" },
-  "cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" },
-  "flutter-tools.nvim": { "branch": "main", "commit": "677cc07c16e8b89999108d2ebeefcfc5f539b73c" },
-  "harpoon": { "branch": "harpoon2", "commit": "87b1a3506211538f460786c23f98ec63ad9af4e5" },
-  "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
-  "lsp-zero.nvim": { "branch": "v3.x", "commit": "77550f2f6cbf0959ef1583d845661af075f3442b" },
-  "mason-lspconfig.nvim": { "branch": "main", "commit": "0a3b42c3e503df87aef6d6513e13148381495c3a" },
-  "mason.nvim": { "branch": "main", "commit": "b03fb0f20bc1d43daf558cda981a2be22e73ac42" },
-  "mini.icons": { "branch": "main", "commit": "bac6317300e205335df425296570d84322730067" },
-  "nvim-cmp": { "branch": "main", "commit": "a1d504892f2bc56c2e79b65c6faded2fd21f3eca" },
-  "nvim-ghost.nvim": { "branch": "main", "commit": "bdba2a8ad0eec84379d65e7aa9b76a17b11b653a" },
-  "nvim-lspconfig": { "branch": "master", "commit": "4b7fbaa239c5db6b36f424a4521ca9f1a401be33" },
-  "nvim-treesitter": { "branch": "main", "commit": "4916d6592ede8c07973490d9322f187e07dfefac" },
-  "oil.nvim": { "branch": "master", "commit": "0fcc83805ad11cf714a949c98c605ed717e0b83e" },
-  "plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" },
-  "presence.nvim": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" },
-  "rose-pine": { "branch": "main", "commit": "9504524e5ed0e326534698f637f9d038ba4cd0ee" },
-  "telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" },
-  "telescope.nvim": { "branch": "master", "commit": "3333a52ff548ba0a68af6d8da1e54f9cd96e9179" },
-  "undotree": { "branch": "master", "commit": "6fa6b57cda8459e1e4b2ca34df702f55242f4e4d" },
-  "vim-fugitive": { "branch": "master", "commit": "3b753cf8c6a4dcde6edee8827d464ba9b8c4a6f0" },
-  "vim-maximizer": { "branch": "master", "commit": "2e54952fe91e140a2e69f35f22131219fcd9c5f1" }
-}
diff --git a/lua/nami/lazy.lua b/lua/nami/lazy.lua
index 837d75e..9619366 100755
--- a/lua/nami/lazy.lua
+++ b/lua/nami/lazy.lua
@@ -64,25 +64,9 @@ local plugins = {
             { "z", "MaximizerToggle" },
         }
     },
-    {
-        "VonHeikemen/lsp-zero.nvim",
-        branch = "v3.x",
-        dependencies = {
-            { "williamboman/mason.nvim" },
-            { "williamboman/mason-lspconfig.nvim" },
-            { "neovim/nvim-lspconfig" },
-            { "hrsh7th/nvim-cmp" },
-            { "hrsh7th/cmp-nvim-lsp" },
-            { "L3MON4D3/LuaSnip" },
-        }
-    },
-    {
-        "nvim-flutter/flutter-tools.nvim",
-        dependencies = {
-            "nvim-lua/plenary.nvim",
-        },
-        lazy = true
-    },
+    { "williamboman/mason.nvim" },
+    { "hrsh7th/cmp-nvim-lsp" },
+    { "hrsh7th/nvim-cmp" },
     {
         "goolord/alpha-nvim",
         lazy = true,