From 9f4a6acb47e403ed9552e71f4b9c9546536500cd Mon Sep 17 00:00:00 2001 From: unintendedfraud Date: Sun, 1 Sep 2024 18:28:59 +0200 Subject: [PATCH] fix config, use symlink --- nvim/after/plugin/comment.lua | 1 - nvim/after/plugin/fugitive.lua | 1 - nvim/after/plugin/harpoon.lua | 10 - nvim/after/plugin/lsp.lua | 90 ------- nvim/after/plugin/lualine.lua | 8 - nvim/after/plugin/nullls.lua | 55 ---- nvim/after/plugin/nvimtree.lua | 246 ------------------ nvim/after/plugin/telescope.lua | 8 - nvim/after/plugin/treesitter.lua | 22 -- nvim/after/plugin/undotree.lua | 1 - nvim/lazy-lock.json | 26 ++ nvim/lua/mimu/init.lua | 50 +++- nvim/{nvim => }/lua/mimu/lazy.lua | 0 nvim/lua/mimu/packer.lua | 90 ------- nvim/lua/mimu/plugins.lua | 141 ---------- nvim/{nvim => }/lua/mimu/plugins/basics.lua | 29 +-- nvim/{nvim => }/lua/mimu/plugins/fugitive.lua | 0 nvim/{nvim => }/lua/mimu/plugins/harpoon.lua | 14 +- nvim/lua/mimu/plugins/lsp.lua | 147 +++++++++++ .../mimu/plugins/lualina.lua} | 0 .../{nvim => }/lua/mimu/plugins/nvim-tree.lua | 0 .../{nvim => }/lua/mimu/plugins/telescope.lua | 0 .../lua/mimu/plugins/treesitter.lua | 0 nvim/{nvim => }/lua/mimu/plugins/trouble.lua | 0 nvim/lua/mimu/set.lua | 8 +- nvim/nvim/after_copy/plugin/comment.lua | 1 - nvim/nvim/after_copy/plugin/fugitive.lua | 1 - nvim/nvim/after_copy/plugin/harpoon.lua | 10 - nvim/nvim/after_copy/plugin/lsp.lua | 90 ------- nvim/nvim/after_copy/plugin/lualine.lua | 8 - nvim/nvim/after_copy/plugin/nvimtree.lua | 246 ------------------ nvim/nvim/after_copy/plugin/telescope.lua | 8 - nvim/nvim/after_copy/plugin/treesitter.lua | 22 -- nvim/nvim/init.lua | 1 - nvim/nvim/lazy-lock.json | 27 -- nvim/nvim/lua/mimu/init.lua | 27 -- nvim/nvim/lua/mimu/packer.lua | 43 --- nvim/nvim/lua/mimu/plugins/lsp.lua | 98 ------- nvim/nvim/lua/mimu/remap.lua | 34 --- nvim/nvim/lua/mimu/set.lua | 25 -- nvim/plugin/packer_compiled.lua | 234 ----------------- 41 files changed, 244 insertions(+), 1578 deletions(-) delete mode 100644 nvim/after/plugin/comment.lua delete mode 100644 nvim/after/plugin/fugitive.lua delete mode 100644 nvim/after/plugin/harpoon.lua delete mode 100644 nvim/after/plugin/lsp.lua delete mode 100644 nvim/after/plugin/lualine.lua delete mode 100644 nvim/after/plugin/nullls.lua delete mode 100644 nvim/after/plugin/nvimtree.lua delete mode 100644 nvim/after/plugin/telescope.lua delete mode 100644 nvim/after/plugin/treesitter.lua delete mode 100644 nvim/after/plugin/undotree.lua create mode 100644 nvim/lazy-lock.json rename nvim/{nvim => }/lua/mimu/lazy.lua (100%) delete mode 100644 nvim/lua/mimu/packer.lua delete mode 100644 nvim/lua/mimu/plugins.lua rename nvim/{nvim => }/lua/mimu/plugins/basics.lua (52%) rename nvim/{nvim => }/lua/mimu/plugins/fugitive.lua (100%) rename nvim/{nvim => }/lua/mimu/plugins/harpoon.lua (89%) create mode 100644 nvim/lua/mimu/plugins/lsp.lua rename nvim/{nvim/lua/mimu/plugins/lualine.lua => lua/mimu/plugins/lualina.lua} (100%) rename nvim/{nvim => }/lua/mimu/plugins/nvim-tree.lua (100%) rename nvim/{nvim => }/lua/mimu/plugins/telescope.lua (100%) rename nvim/{nvim => }/lua/mimu/plugins/treesitter.lua (100%) rename nvim/{nvim => }/lua/mimu/plugins/trouble.lua (100%) delete mode 100644 nvim/nvim/after_copy/plugin/comment.lua delete mode 100644 nvim/nvim/after_copy/plugin/fugitive.lua delete mode 100644 nvim/nvim/after_copy/plugin/harpoon.lua delete mode 100644 nvim/nvim/after_copy/plugin/lsp.lua delete mode 100644 nvim/nvim/after_copy/plugin/lualine.lua delete mode 100644 nvim/nvim/after_copy/plugin/nvimtree.lua delete mode 100644 nvim/nvim/after_copy/plugin/telescope.lua delete mode 100644 nvim/nvim/after_copy/plugin/treesitter.lua delete mode 100644 nvim/nvim/init.lua delete mode 100644 nvim/nvim/lazy-lock.json delete mode 100644 nvim/nvim/lua/mimu/init.lua delete mode 100644 nvim/nvim/lua/mimu/packer.lua delete mode 100644 nvim/nvim/lua/mimu/plugins/lsp.lua delete mode 100644 nvim/nvim/lua/mimu/remap.lua delete mode 100644 nvim/nvim/lua/mimu/set.lua delete mode 100644 nvim/plugin/packer_compiled.lua diff --git a/nvim/after/plugin/comment.lua b/nvim/after/plugin/comment.lua deleted file mode 100644 index 9086261..0000000 --- a/nvim/after/plugin/comment.lua +++ /dev/null @@ -1 +0,0 @@ -require("Comment").setup(); diff --git a/nvim/after/plugin/fugitive.lua b/nvim/after/plugin/fugitive.lua deleted file mode 100644 index 73b78b8..0000000 --- a/nvim/after/plugin/fugitive.lua +++ /dev/null @@ -1 +0,0 @@ -vim.keymap.set("n", "gs", vim.cmd.Git); diff --git a/nvim/after/plugin/harpoon.lua b/nvim/after/plugin/harpoon.lua deleted file mode 100644 index 9b5f34a..0000000 --- a/nvim/after/plugin/harpoon.lua +++ /dev/null @@ -1,10 +0,0 @@ -local mark = require("harpoon.mark") -local ui = require("harpoon.ui") - -vim.keymap.set("n", "a", mark.add_file) -vim.keymap.set("n", "", ui.toggle_quick_menu) - -vim.keymap.set("n", "", function() ui.nav_file(1) end) -vim.keymap.set("n", "", function() ui.nav_file(2) end) -vim.keymap.set("n", "", function() ui.nav_file(3) end) -vim.keymap.set("n", "", function() ui.nav_file(4) end) diff --git a/nvim/after/plugin/lsp.lua b/nvim/after/plugin/lsp.lua deleted file mode 100644 index 32b483b..0000000 --- a/nvim/after/plugin/lsp.lua +++ /dev/null @@ -1,90 +0,0 @@ --- Learn the keybindings, see :help lsp-zero-keybindings --- Learn to configure LSP servers, see :help lsp-zero-api-showcase -local lsp = require("lsp-zero") - -lsp.preset({ - manage_nvim_cmp = { - set_sources = "lsp", - }, -}) - -lsp.ensure_installed({ - "tsserver", - "eslint", - "lua_ls", - "rust_analyzer", - "gopls", -}) - -local cmp = require("cmp") -local cmp_select = { behaviour = cmp.SelectBehavior.Select } -local cmp_mappings = lsp.defaults.cmp_mappings({ - ["vws", function() - vim.lsp.buf.workspace_symbol() - end, opts) - vim.keymap.set("n", "vd", function() - vim.lsp.diagnostic.open_float() - end, opts) - vim.keymap.set("n", "[d", function() - vim.lsp.diagnostic.goto_next() - end, opts) - vim.keymap.set("n", "]d", function() - vim.lsp.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() - -vim.diagnostic.config({ - virtual_text = true, - signs = false, - update_in_insert = false, - underline = true, - severity_sort = true, - float = { - focusable = false, - style = "minimal", - border = "rounded", - source = "always", - header = "", - prefix = "", - }, -}) diff --git a/nvim/after/plugin/lualine.lua b/nvim/after/plugin/lualine.lua deleted file mode 100644 index 215dfd3..0000000 --- a/nvim/after/plugin/lualine.lua +++ /dev/null @@ -1,8 +0,0 @@ -require("lualine").setup({ - options = { - icons_enabled = false, - theme = "onedark", - component_separators = "|", - section_separators = "", - } -}); diff --git a/nvim/after/plugin/nullls.lua b/nvim/after/plugin/nullls.lua deleted file mode 100644 index 0c3e27f..0000000 --- a/nvim/after/plugin/nullls.lua +++ /dev/null @@ -1,55 +0,0 @@ --- null-ls setup -local null_ls = require("null-ls") - --- for conciseness -local formatting = null_ls.builtins.formatting -- to setup formatters -local diagnostics = null_ls.builtins.diagnostics -- to setup linters - --- to setup format on save -local augroup = vim.api.nvim_create_augroup("LspFormatting", {}) - --- configure null_ls -null_ls.setup({ - debug = true, - - -- setup formatters & linters - sources = { - -- to disable file types use - -- "formatting.prettier.with({disabled_filetypes: {}})" (see null-ls docs) - formatting.prettier, -- js/ts formatter - formatting.rustfmt, -- rust formatter - formatting.stylua, -- lua formatter - formatting.gofumpt, -- go formatter - formatting.goimports, -- go auto-imports - 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") -- change file extension if you use something else - end, - }), - }, - - -- you can reuse a shared lspconfig on_attach callback here - on_attach = function(current_client, bufnr) - if current_client.supports_method("textDocument/formatting") then - vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr }) - vim.api.nvim_create_autocmd("BufWritePre", { - group = augroup, - buffer = bufnr, - callback = function() - -- on 0.8, you should use vim.lsp.buf.format({ bufnr = bufnr }) instead - -- on later neovim version, you should use vim.lsp.buf.format({ async = false }) instead - vim.lsp.buf.format({ - bufnr = bufnr, - async = false, - filter = function(client) - return client.name == "null-ls" - end, - }) - -- vim.lsp.buf.formatting_sync() - end, - }) - end - end, -}) diff --git a/nvim/after/plugin/nvimtree.lua b/nvim/after/plugin/nvimtree.lua deleted file mode 100644 index c6e6a99..0000000 --- a/nvim/after/plugin/nvimtree.lua +++ /dev/null @@ -1,246 +0,0 @@ -local nvimtree = require('nvim-tree') - --- disable netrw at the very start of your init.lua (strongly advised) -vim.g.loaded_netrw = 1 -vim.g.loaded_netrwPlugin = 1 - -require("nvim-tree").setup { -- BEGIN_DEFAULT_OPTS - auto_reload_on_write = true, - disable_netrw = false, - hijack_cursor = false, - hijack_netrw = true, - hijack_unnamed_buffer_when_opening = false, - sort_by = "name", - root_dirs = {}, - prefer_startup_root = false, - sync_root_with_cwd = false, - reload_on_bufenter = false, - respect_buf_cwd = true, - on_attach = "default", - remove_keymaps = false, - select_prompts = false, - view = { - centralize_selection = false, - cursorline = true, - debounce_delay = 15, - width = 30, - hide_root_folder = false, - side = "left", - preserve_window_proportions = false, - number = false, - relativenumber = false, - signcolumn = "yes", - mappings = { - custom_only = false, - list = { - -- user mappings go here - }, - }, - float = { - enable = false, - quit_on_focus_loss = true, - open_win_config = { - relative = "editor", - border = "rounded", - width = 30, - height = 30, - row = 1, - col = 1, - }, - }, - }, - renderer = { - add_trailing = false, - group_empty = true, - highlight_git = false, - full_name = false, - highlight_opened_files = "none", - highlight_modified = "none", - root_folder_label = ":~:s?$?/..?", - indent_width = 2, - indent_markers = { - enable = false, - inline_arrows = true, - icons = { - corner = "└", - edge = "│", - item = "│", - bottom = "─", - none = " ", - }, - }, - icons = { - webdev_colors = false, - git_placement = "before", - modified_placement = "after", - padding = " ", - symlink_arrow = " ➛ ", - show = { - file = false, - folder = false, - folder_arrow = false, - git = false, - modified = false, - }, - glyphs = { - default = " ", - symlink = " ", - bookmark = " ", - modified = "●", - folder = { - arrow_closed = " ", - arrow_open = " ", - default = " ", - open = " ", - empty = " ", - empty_open = " ", - symlink = " ", - symlink_open = " ", - }, - git = { - unstaged = "✗", - staged = "✓", - unmerged = "", - renamed = "➜", - untracked = "★", - deleted = "", - ignored = "◌", - }, - }, - }, - special_files = {}, - symlink_destination = true, - }, - hijack_directories = { - enable = true, - auto_open = true, - }, - update_focused_file = { - enable = false, - update_root = false, - ignore_list = {}, - }, - system_open = { - cmd = "", - args = {}, - }, - diagnostics = { - enable = false, - show_on_dirs = false, - show_on_open_dirs = true, - debounce_delay = 50, - severity = { - min = vim.diagnostic.severity.HINT, - max = vim.diagnostic.severity.ERROR, - }, - icons = { - hint = "", - info = "", - warning = "", - error = "", - }, - }, - filters = { - dotfiles = false, - git_clean = false, - no_buffer = false, - custom = {}, - exclude = {}, - }, - filesystem_watchers = { - enable = true, - debounce_delay = 50, - ignore_dirs = {}, - }, - git = { - enable = false, - ignore = true, - show_on_dirs = true, - show_on_open_dirs = true, - timeout = 400, - }, - modified = { - enable = false, - show_on_dirs = true, - show_on_open_dirs = true, - }, - actions = { - use_system_clipboard = true, - change_dir = { - enable = true, - global = false, - restrict_above_cwd = false, - }, - expand_all = { - max_folder_discovery = 300, - exclude = {}, - }, - file_popup = { - open_win_config = { - col = 1, - row = 1, - relative = "cursor", - border = "shadow", - style = "minimal", - }, - }, - open_file = { - quit_on_open = false, - resize_window = true, - window_picker = { - enable = true, - picker = "default", - chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890", - exclude = { - filetype = { "notify", "packer", "qf", "diff", "fugitive", "fugitiveblame" }, - buftype = { "nofile", "terminal", "help" }, - }, - }, - }, - remove_file = { - close_window = true, - }, - }, - trash = { - cmd = "gio trash", - }, - live_filter = { - prefix = "[FILTER]: ", - always_show_folders = true, - }, - tab = { - sync = { - open = false, - close = false, - ignore = {}, - }, - }, - notify = { - threshold = vim.log.levels.INFO, - }, - ui = { - confirm = { - remove = true, - trash = true, - }, - }, - experimental = { - git = { - async = true, - }, - }, - log = { - enable = false, - truncate = false, - types = { - all = false, - config = false, - copy_paste = false, - dev = false, - diagnostics = false, - git = false, - profile = false, - watcher = false, - }, - }, -} -- END_DEFAULT_OPTS diff --git a/nvim/after/plugin/telescope.lua b/nvim/after/plugin/telescope.lua deleted file mode 100644 index 3679413..0000000 --- a/nvim/after/plugin/telescope.lua +++ /dev/null @@ -1,8 +0,0 @@ -local builtin = require("telescope.builtin") -vim.keymap.set("n", "pf", builtin.find_files, {}) -vim.keymap.set("n", "", builtin.git_files, {}) -vim.keymap.set("n", "pb", builtin.buffers, {}) -vim.keymap.set("n", "pd", builtin.diagnostics, {}) -vim.keymap.set("n", "ps", function() - builtin.grep_string({ search = vim.fn.input("Grep > ") }) -end) diff --git a/nvim/after/plugin/treesitter.lua b/nvim/after/plugin/treesitter.lua deleted file mode 100644 index a4709cc..0000000 --- a/nvim/after/plugin/treesitter.lua +++ /dev/null @@ -1,22 +0,0 @@ -require 'nvim-treesitter.configs'.setup { - -- A list of parser names, or "all" (the four listed parsers should always be installed) - ensure_installed = { "javascript", "typescript", "c", "lua", "vim", "rust", "go" }, - - -- Install parsers synchronously (only applied to `ensure_installed`) - sync_install = false, - - -- Automatically install missing parsers when entering buffer - -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally - auto_install = true, - - highlight = { - -- `false` will disable the whole extension - enable = true, - - -- Setting this to true will run `:h syntax` and tree-sitter at the same time. - -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). - -- Using this option may slow down your editor, and you may see some duplicate highlights. - -- Instead of true it can also be a list of languages - additional_vim_regex_highlighting = false, - }, -} diff --git a/nvim/after/plugin/undotree.lua b/nvim/after/plugin/undotree.lua deleted file mode 100644 index b6b9276..0000000 --- a/nvim/after/plugin/undotree.lua +++ /dev/null @@ -1 +0,0 @@ -vim.keymap.set("n", "u", vim.cmd.UndotreeToggle) diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json new file mode 100644 index 0000000..cf99c3a --- /dev/null +++ b/nvim/lazy-lock.json @@ -0,0 +1,26 @@ +{ + "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, + "LuaSnip": { "branch": "master", "commit": "7b1dda0dfdefc10b2501295eba5e463dbd7c338f" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, + "fidget.nvim": { "branch": "main", "commit": "1ba38e4cbb24683973e00c2e36f53ae64da38ef5" }, + "gitsigns": { "branch": "main", "commit": "805610a9393fa231f2c2b49cb521bfa413fadb3d" }, + "harpoon": { "branch": "master", "commit": "ccae1b9bec717ae284906b0bf83d720e59d12b91" }, + "lazy.nvim": { "branch": "main", "commit": "e44636a43376e8a1e851958f7e9cbe996751d59f" }, + "lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" }, + "lush": { "branch": "main", "commit": "7c0e27f50901481fe83b974493c4ea67a4296aeb" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "9ae570e206360e47d30b4c35a4550c165f4ea7b7" }, + "mason.nvim": { "branch": "main", "commit": "49ff59aded1047a773670651cfa40e76e63c6377" }, + "mellifluous.nvim": { "branch": "main", "commit": "454cb9f1c2bade9d8ad99f6a3ce9c5d5509196d8" }, + "nvim-cmp": { "branch": "main", "commit": "24122371810089d390847d8ba66325c1f1aa64c0" }, + "nvim-lspconfig": { "branch": "master", "commit": "a27179f56c6f98a4cdcc79ee2971b514815a4940" }, + "nvim-tree.lua": { "branch": "master", "commit": "2bc725a3ebc23f0172fb0ab4d1134b81bcc13812" }, + "nvim-treesitter": { "branch": "master", "commit": "c26cfc75bc77b3538f4f288b013bc927a371bf2e" }, + "plenary": { "branch": "master", "commit": "08e301982b9a057110ede7a735dd1b5285eb341f" }, + "telescope.nvim": { "branch": "master", "commit": "6f6bb8065567b56c42e283b06e8a1c670c0092a1" }, + "trouble.nvim": { "branch": "main", "commit": "b9cf677f20bb2faa2dacfa870b084e568dca9572" }, + "vim-fugitive": { "branch": "master", "commit": "ce882460cf3db12e99f8bf579cbf99e331f6dd4f" } +} \ No newline at end of file diff --git a/nvim/lua/mimu/init.lua b/nvim/lua/mimu/init.lua index cbdf8e7..683e857 100644 --- a/nvim/lua/mimu/init.lua +++ b/nvim/lua/mimu/init.lua @@ -1,4 +1,50 @@ -require("mimu.packer") -require("mimu.remap") require("mimu.set") +require("mimu.remap") +require("mimu.lazy") +local augroup = vim.api.nvim_create_augroup +local MimuGroup = augroup("mimu", {}) + +local autocmd = vim.api.nvim_create_autocmd + +vim.cmd [[autocmd BufWritePre * lua vim.lsp.buf.format()]] + +autocmd("LspAttach", { + group = MimuGroup, + callback = function(e) + local opts = { buffer = e.buf } + vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts) + vim.keymap.set("n", "gr", function() vim.lsp.buf.references() end, opts) + vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts) + vim.keymap.set("n", "vws", function() vim.lsp.buf.workspace_symbol() end, opts) + vim.keymap.set("n", "vd", function() vim.lsp.diagnostic.open_float() end, opts) + -- vim.keymap.set("n", "[d", function() vim.lsp.diagnostic.goto_next() end, opts) + -- vim.keymap.set("n", "]d", function() vim.lsp.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 +}) + +autocmd("BufWritePre", { + pattern = "*.go", + callback = function() + local params = vim.lsp.util.make_range_params() + params.context = { only = { "source.organizeImports" } } + -- buf_request_sync defaults to a 1000ms timeout. Depending on your + -- machine and codebase, you may want longer. Add an additional + -- argument after params if you find that you have to write the file + -- twice for changes to be saved. + -- E.g., vim.lsp.buf_request_sync(0, "textDocument/codeAction", params, 3000) + local result = vim.lsp.buf_request_sync(0, "textDocument/codeAction", params) + for cid, res in pairs(result or {}) do + for _, r in pairs(res.result or {}) do + if r.edit then + local enc = (vim.lsp.get_client_by_id(cid) or {}).offset_encoding or "utf-16" + vim.lsp.util.apply_workspace_edit(r.edit, enc) + end + end + end + vim.lsp.buf.format({ async = false }) + end +}) diff --git a/nvim/nvim/lua/mimu/lazy.lua b/nvim/lua/mimu/lazy.lua similarity index 100% rename from nvim/nvim/lua/mimu/lazy.lua rename to nvim/lua/mimu/lazy.lua diff --git a/nvim/lua/mimu/packer.lua b/nvim/lua/mimu/packer.lua deleted file mode 100644 index f7a0977..0000000 --- a/nvim/lua/mimu/packer.lua +++ /dev/null @@ -1,90 +0,0 @@ --- This file can be loaded by calling `lua require('plugins')` from your init.vim - --- Only required if you have packer configured as `opt` -vim.cmd [[packadd packer.nvim]] - -return require('packer').startup(function(use) - -- Packer can manage itself - use 'wbthomason/packer.nvim' - - -- telescope - use { - 'nvim-telescope/telescope.nvim', tag = '0.1.1', - -- or , branch = '0.1.x', - requires = { { 'nvim-lua/plenary.nvim' } } - } - - -- theme - use({ - 'ramojus/mellifluous.nvim', - requires = { 'rktjmp/lush.nvim' }, - config = function() - require 'mellifluous'.setup({ - styles = { - comments = '', - }, - }) -- optional, see configuration section. - vim.cmd('colorscheme mellifluous') - end - }) - - - -- treesitter - use('nvim-treesitter/nvim-treesitter', { run = ':TSUpdate' }) - - -- nvim-tree - use { - 'nvim-tree/nvim-tree.lua', - config = function() - require("nvim-tree").setup {} - end - } - - -- harpoon - use("theprimeagen/harpoon") - - -- null-ls, depends on plenary - use("nvim-lua/plenary.nvim") - use("jose-elias-alvarez/null-ls.nvim") - - -- git / vim-fugitive - use("tpope/vim-fugitive") - use { - 'lewis6991/gitsigns.nvim', - config = function() - require('gitsigns').setup({ - current_line_blame = true, - }) - end - } - - -- lualine - use { 'nvim-lualine/lualine.nvim' } - - -- Comment - use { 'numToStr/Comment.nvim' } - - -- LSP - use { - 'VonHeikemen/lsp-zero.nvim', - branch = 'v1.x', - requires = { - -- LSP Support - { 'neovim/nvim-lspconfig' }, -- Required - { 'williamboman/mason.nvim' }, -- Optional - { 'williamboman/mason-lspconfig.nvim' }, -- Optional - - -- Autocompletion - { 'hrsh7th/nvim-cmp' }, -- Required - { 'hrsh7th/cmp-nvim-lsp' }, -- Required - { 'hrsh7th/cmp-buffer' }, -- Optional - { 'hrsh7th/cmp-path' }, -- Optional - { 'saadparwaiz1/cmp_luasnip' }, -- Optional - { 'hrsh7th/cmp-nvim-lua' }, -- Optional - - -- Snippets - { 'L3MON4D3/LuaSnip' }, -- Required - { 'rafamadriz/friendly-snippets' }, -- Optional - } - } -end) diff --git a/nvim/lua/mimu/plugins.lua b/nvim/lua/mimu/plugins.lua deleted file mode 100644 index fd39a10..0000000 --- a/nvim/lua/mimu/plugins.lua +++ /dev/null @@ -1,141 +0,0 @@ -local fzf_make_cmd = "make" -if vim.loop.os_uname().machine == "arm64" then - fzf_make_cmd = " arch -arm64 make" -end - -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not vim.loop.fs_stat(lazypath) then - vim.fn.system({ - "git", - "clone", - "--filter=blob:none", - "https://github.com/folke/lazy.nvim.git", - "--branch=stable", -- latest stable release - lazypath, - }) -end -vim.opt.rtp:prepend(lazypath) - -return require("lazy").setup({ - defaults = { - lazy = true, - }, - - -- telescope - { - "nvim-telescope/telescope.nvim", - tag = "0.1.1", - opts = { - defaults = { - file_ignore_patterns = { - ".git/worktrees", - ".git/COMMIT_EDITMSG", - }, - }, - extensions = { - fzf = { - fuzzy = true, -- false will only do exact matching - override_generic_sorter = true, -- override the generic sorter - override_file_sorter = true, -- override the file sorter - case_mode = "smart_case", -- or "ignore_case" or "respect_case" - }, - }, - }, - dependencies = { - "nvim-lua/plenary.nvim", - { "nvim-telescope/telescope-fzf-native.nvim", build = fzf_make_cmd }, -- Fzf native - }, - }, - - -- theme - { - "ramojus/mellifluous.nvim", - lazy = false, - priority = 1000, - dependencies = { "rktjmp/lush.nvim" }, - config = function() - require("mellifluous").setup({ - styles = { - comments = "", - }, - }) -- optional, see configuration section. - vim.cmd("colorscheme mellifluous") - end, - }, - - -- treesitter - { - "nvim-treesitter/nvim-treesitter", - event = { "BufReadPost", "BufNewFile" }, - build = function() - require("nvim-treesitter.install").update({ with_sync = true }) - end, - }, - - -- nvim-tree - { - "nvim-tree/nvim-tree.lua", - dependencies = { - "nvim-tree/nvim-web-devicons", -- optional - }, - config = function() - require("nvim-tree").setup({}) - end, - }, - - -- harpoon - { - "theprimeagen/harpoon", - event = "BufRead", - dependencies = { - "nvim-lua/plenary.nvim", - }, - }, - - -- undotree - "mbbill/undotree", - - -- git / vim-fugitive - { - "tpope/vim-fugitive", - event = { "BufReadPre", "BufNewFile" }, - dependencies = { - "lewis6991/gitsigns.nvim", - }, - config = function() - require("gitsigns").setup({ - current_line_blame = true, - }) - end, - }, - - -- lualine - "nvim-lualine/lualine.nvim", - - -- Comment - { "numToStr/Comment.nvim", event = "BufRead" }, - - -- LSP - { - "VonHeikemen/lsp-zero.nvim", - branch = "v1.x", - dependencies = { - -- LSP Support - { "neovim/nvim-lspconfig" }, -- Required - { "williamboman/mason.nvim" }, -- Optional - { "williamboman/mason-lspconfig.nvim" }, -- Optional - - -- Autocompletion - { "hrsh7th/nvim-cmp" }, -- Required - { "hrsh7th/cmp-nvim-lsp" }, -- Required - { "hrsh7th/cmp-buffer" }, -- Optional - { "hrsh7th/cmp-path" }, -- Optional - { "saadparwaiz1/cmp_luasnip" }, -- Optional - { "hrsh7th/cmp-nvim-lua" }, -- Optional - - -- Snippets - { "L3MON4D3/LuaSnip" }, -- Required - { "rafamadriz/friendly-snippets" }, -- Optional - }, - }, -}) diff --git a/nvim/nvim/lua/mimu/plugins/basics.lua b/nvim/lua/mimu/plugins/basics.lua similarity index 52% rename from nvim/nvim/lua/mimu/plugins/basics.lua rename to nvim/lua/mimu/plugins/basics.lua index 15bee4e..60df703 100644 --- a/nvim/nvim/lua/mimu/plugins/basics.lua +++ b/nvim/lua/mimu/plugins/basics.lua @@ -1,19 +1,19 @@ return { -- Color scheme - { - "rktjmp/lush.nvim", - name = "lush", - priority = 1000, - }, + { + "rktjmp/lush.nvim", + name = "lush", + priority = 1000, + }, { - "ramojus/mellifluous.nvim", + "ramojus/mellifluous.nvim", dependencies = { "lush" }, - config = function() - vim.cmd("colorscheme mellifluous") - end, + config = function() + vim.cmd("colorscheme mellifluous") + end, }, { @@ -22,20 +22,17 @@ return { }, { - "lewis6991/gitsigns.nvim", + "lewis6991/gitsigns.nvim", name = "gitsigns", }, - -- Comment - { - "numToStr/Comment.nvim", + -- Comment + { + "numToStr/Comment.nvim", event = "BufRead", config = function() require("Comment").setup() end }, - "github/copilot.vim", - - } diff --git a/nvim/nvim/lua/mimu/plugins/fugitive.lua b/nvim/lua/mimu/plugins/fugitive.lua similarity index 100% rename from nvim/nvim/lua/mimu/plugins/fugitive.lua rename to nvim/lua/mimu/plugins/fugitive.lua diff --git a/nvim/nvim/lua/mimu/plugins/harpoon.lua b/nvim/lua/mimu/plugins/harpoon.lua similarity index 89% rename from nvim/nvim/lua/mimu/plugins/harpoon.lua rename to nvim/lua/mimu/plugins/harpoon.lua index 1fdee9d..d2945d8 100644 --- a/nvim/nvim/lua/mimu/plugins/harpoon.lua +++ b/nvim/lua/mimu/plugins/harpoon.lua @@ -1,9 +1,9 @@ return { "theprimeagen/harpoon", - event = "BufRead", - dependencies = { + event = "BufRead", + dependencies = { "plenary", - }, + }, config = function() local mark = require("harpoon.mark") @@ -12,9 +12,9 @@ return { vim.keymap.set("n", "a", mark.add_file) vim.keymap.set("n", "", ui.toggle_quick_menu) - vim.keymap.set("n", "", function() ui.nav_file(1) end) - vim.keymap.set("n", "", function() ui.nav_file(2) end) - vim.keymap.set("n", "", function() ui.nav_file(3) end) - vim.keymap.set("n", "", function() ui.nav_file(4) end) + vim.keymap.set("n", "", function() ui.nav_file(1) end) + vim.keymap.set("n", "", function() ui.nav_file(2) end) + vim.keymap.set("n", "", function() ui.nav_file(3) end) + vim.keymap.set("n", "", function() ui.nav_file(4) end) end } diff --git a/nvim/lua/mimu/plugins/lsp.lua b/nvim/lua/mimu/plugins/lsp.lua new file mode 100644 index 0000000..9b55958 --- /dev/null +++ b/nvim/lua/mimu/plugins/lsp.lua @@ -0,0 +1,147 @@ +return { + "neovim/nvim-lspconfig", + dependencies = { + "williamboman/mason.nvim", + "williamboman/mason-lspconfig.nvim", + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "hrsh7th/cmp-cmdline", + "hrsh7th/nvim-cmp", + "j-hui/fidget.nvim", + "L3MON4D3/LuaSnip", + "saadparwaiz1/cmp_luasnip", + }, + + config = function() + local capabilities = require('cmp_nvim_lsp').default_capabilities() + local lspconfig = require("lspconfig") + local configs = require("lspconfig.configs") + + -- elixir config + local lexical_config = { + filetypes = { "elixir", "eelixir", "heex" }, + cmd = { "/home/mimu/.local/share/nvim/mason/packages/lexical/libexec/lexical/bin/start_lexical.sh" }, + settings = {}, + } + + if not configs.lexical then + configs.lexical = { + default_config = { + filetypes = lexical_config.filetypes, + cmd = lexical_config.cmd, + root_dir = function(fname) + return lspconfig.util.root_pattern("mix.exs", ".git")(fname) or vim.loop.os_homedir() + end, + -- optional settings + settings = lexical_config.settings, + }, + } + end + + lspconfig.lexical.setup({}) + + require("fidget").setup() + require("mason").setup() + require("mason-lspconfig").setup({ + ensure_installed = { + "lua_ls", + "rust_analyzer", + "clangd", + "gopls", + "lexical", + "tsserver", + "intelephense", + }, + handlers = { + function(server_name) -- default handler (optional) + require("lspconfig")[server_name].setup { + capabilities = capabilities + } + end, + + ["intelephense"] = function() + lspconfig.intelephense.setup { + root_dir = function(fname) + return lspconfig.util.find_git_ancestor(fname) or + lspconfig.util.root_pattern("composer.json", ".git")(fname) or + lspconfig.util.path.dirname(fname) + end + } + end, + + ["gopls"] = function() + lspconfig.gopls.setup { + settings = { + gopls = { + analyses = { + unusedparams = true, + }, + staticcheck = true, + gofumpt = true, + } + } + } + end, + + ["lua_ls"] = function() + lspconfig.lua_ls.setup { + settings = { + Lua = { + diagnostics = { + globals = { "vim" } + } + } + } + } + end, + } + }) + + local cmp = require("cmp") + local cmp_select = { behaviour = cmp.SelectBehavior.Select } + cmp.setup({ + snippet = { + -- REQUIRED - you must specify a snippet engine + expand = function(args) + require('luasnip').lsp_expand(args.body) -- For `luasnip` users. + end, + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.confirm({ select = true }), + [""] = function(fallback) + if cmp.visible() then + cmp.select_next_item() + else + fallback() + end + end, + }), + sources = cmp.config.sources({ + { name = "nvim_lsp" }, + { name = "luasnip" }, + }, { + { name = "buffer" }, + }) + }) + + vim.diagnostic.config({ + virtual_text = true, + update_on_insert = true, + float = { + focusable = false, + style = "minimal", + border = "rounded", + source = "always", + header = "", + prefix = "", + }, + }) + end +} diff --git a/nvim/nvim/lua/mimu/plugins/lualine.lua b/nvim/lua/mimu/plugins/lualina.lua similarity index 100% rename from nvim/nvim/lua/mimu/plugins/lualine.lua rename to nvim/lua/mimu/plugins/lualina.lua diff --git a/nvim/nvim/lua/mimu/plugins/nvim-tree.lua b/nvim/lua/mimu/plugins/nvim-tree.lua similarity index 100% rename from nvim/nvim/lua/mimu/plugins/nvim-tree.lua rename to nvim/lua/mimu/plugins/nvim-tree.lua diff --git a/nvim/nvim/lua/mimu/plugins/telescope.lua b/nvim/lua/mimu/plugins/telescope.lua similarity index 100% rename from nvim/nvim/lua/mimu/plugins/telescope.lua rename to nvim/lua/mimu/plugins/telescope.lua diff --git a/nvim/nvim/lua/mimu/plugins/treesitter.lua b/nvim/lua/mimu/plugins/treesitter.lua similarity index 100% rename from nvim/nvim/lua/mimu/plugins/treesitter.lua rename to nvim/lua/mimu/plugins/treesitter.lua diff --git a/nvim/nvim/lua/mimu/plugins/trouble.lua b/nvim/lua/mimu/plugins/trouble.lua similarity index 100% rename from nvim/nvim/lua/mimu/plugins/trouble.lua rename to nvim/lua/mimu/plugins/trouble.lua diff --git a/nvim/lua/mimu/set.lua b/nvim/lua/mimu/set.lua index 300f32d..cea4de0 100644 --- a/nvim/lua/mimu/set.lua +++ b/nvim/lua/mimu/set.lua @@ -1,11 +1,9 @@ -vim.cmd [[autocmd BufWritePre lua vim.lsp.buf.format()]] - vim.opt.nu = true vim.opt.relativenumber = true -vim.opt.tabstop = 2 -vim.opt.softtabstop = 2 -vim.opt.shiftwidth = 2 +vim.opt.tabstop = 4 +vim.opt.softtabstop = 4 +vim.opt.shiftwidth = 4 vim.opt.expandtab = true -- highlight search diff --git a/nvim/nvim/after_copy/plugin/comment.lua b/nvim/nvim/after_copy/plugin/comment.lua deleted file mode 100644 index 9086261..0000000 --- a/nvim/nvim/after_copy/plugin/comment.lua +++ /dev/null @@ -1 +0,0 @@ -require("Comment").setup(); diff --git a/nvim/nvim/after_copy/plugin/fugitive.lua b/nvim/nvim/after_copy/plugin/fugitive.lua deleted file mode 100644 index 73b78b8..0000000 --- a/nvim/nvim/after_copy/plugin/fugitive.lua +++ /dev/null @@ -1 +0,0 @@ -vim.keymap.set("n", "gs", vim.cmd.Git); diff --git a/nvim/nvim/after_copy/plugin/harpoon.lua b/nvim/nvim/after_copy/plugin/harpoon.lua deleted file mode 100644 index 9b5f34a..0000000 --- a/nvim/nvim/after_copy/plugin/harpoon.lua +++ /dev/null @@ -1,10 +0,0 @@ -local mark = require("harpoon.mark") -local ui = require("harpoon.ui") - -vim.keymap.set("n", "a", mark.add_file) -vim.keymap.set("n", "", ui.toggle_quick_menu) - -vim.keymap.set("n", "", function() ui.nav_file(1) end) -vim.keymap.set("n", "", function() ui.nav_file(2) end) -vim.keymap.set("n", "", function() ui.nav_file(3) end) -vim.keymap.set("n", "", function() ui.nav_file(4) end) diff --git a/nvim/nvim/after_copy/plugin/lsp.lua b/nvim/nvim/after_copy/plugin/lsp.lua deleted file mode 100644 index 32b483b..0000000 --- a/nvim/nvim/after_copy/plugin/lsp.lua +++ /dev/null @@ -1,90 +0,0 @@ --- Learn the keybindings, see :help lsp-zero-keybindings --- Learn to configure LSP servers, see :help lsp-zero-api-showcase -local lsp = require("lsp-zero") - -lsp.preset({ - manage_nvim_cmp = { - set_sources = "lsp", - }, -}) - -lsp.ensure_installed({ - "tsserver", - "eslint", - "lua_ls", - "rust_analyzer", - "gopls", -}) - -local cmp = require("cmp") -local cmp_select = { behaviour = cmp.SelectBehavior.Select } -local cmp_mappings = lsp.defaults.cmp_mappings({ - ["vws", function() - vim.lsp.buf.workspace_symbol() - end, opts) - vim.keymap.set("n", "vd", function() - vim.lsp.diagnostic.open_float() - end, opts) - vim.keymap.set("n", "[d", function() - vim.lsp.diagnostic.goto_next() - end, opts) - vim.keymap.set("n", "]d", function() - vim.lsp.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() - -vim.diagnostic.config({ - virtual_text = true, - signs = false, - update_in_insert = false, - underline = true, - severity_sort = true, - float = { - focusable = false, - style = "minimal", - border = "rounded", - source = "always", - header = "", - prefix = "", - }, -}) diff --git a/nvim/nvim/after_copy/plugin/lualine.lua b/nvim/nvim/after_copy/plugin/lualine.lua deleted file mode 100644 index 215dfd3..0000000 --- a/nvim/nvim/after_copy/plugin/lualine.lua +++ /dev/null @@ -1,8 +0,0 @@ -require("lualine").setup({ - options = { - icons_enabled = false, - theme = "onedark", - component_separators = "|", - section_separators = "", - } -}); diff --git a/nvim/nvim/after_copy/plugin/nvimtree.lua b/nvim/nvim/after_copy/plugin/nvimtree.lua deleted file mode 100644 index c6e6a99..0000000 --- a/nvim/nvim/after_copy/plugin/nvimtree.lua +++ /dev/null @@ -1,246 +0,0 @@ -local nvimtree = require('nvim-tree') - --- disable netrw at the very start of your init.lua (strongly advised) -vim.g.loaded_netrw = 1 -vim.g.loaded_netrwPlugin = 1 - -require("nvim-tree").setup { -- BEGIN_DEFAULT_OPTS - auto_reload_on_write = true, - disable_netrw = false, - hijack_cursor = false, - hijack_netrw = true, - hijack_unnamed_buffer_when_opening = false, - sort_by = "name", - root_dirs = {}, - prefer_startup_root = false, - sync_root_with_cwd = false, - reload_on_bufenter = false, - respect_buf_cwd = true, - on_attach = "default", - remove_keymaps = false, - select_prompts = false, - view = { - centralize_selection = false, - cursorline = true, - debounce_delay = 15, - width = 30, - hide_root_folder = false, - side = "left", - preserve_window_proportions = false, - number = false, - relativenumber = false, - signcolumn = "yes", - mappings = { - custom_only = false, - list = { - -- user mappings go here - }, - }, - float = { - enable = false, - quit_on_focus_loss = true, - open_win_config = { - relative = "editor", - border = "rounded", - width = 30, - height = 30, - row = 1, - col = 1, - }, - }, - }, - renderer = { - add_trailing = false, - group_empty = true, - highlight_git = false, - full_name = false, - highlight_opened_files = "none", - highlight_modified = "none", - root_folder_label = ":~:s?$?/..?", - indent_width = 2, - indent_markers = { - enable = false, - inline_arrows = true, - icons = { - corner = "└", - edge = "│", - item = "│", - bottom = "─", - none = " ", - }, - }, - icons = { - webdev_colors = false, - git_placement = "before", - modified_placement = "after", - padding = " ", - symlink_arrow = " ➛ ", - show = { - file = false, - folder = false, - folder_arrow = false, - git = false, - modified = false, - }, - glyphs = { - default = " ", - symlink = " ", - bookmark = " ", - modified = "●", - folder = { - arrow_closed = " ", - arrow_open = " ", - default = " ", - open = " ", - empty = " ", - empty_open = " ", - symlink = " ", - symlink_open = " ", - }, - git = { - unstaged = "✗", - staged = "✓", - unmerged = "", - renamed = "➜", - untracked = "★", - deleted = "", - ignored = "◌", - }, - }, - }, - special_files = {}, - symlink_destination = true, - }, - hijack_directories = { - enable = true, - auto_open = true, - }, - update_focused_file = { - enable = false, - update_root = false, - ignore_list = {}, - }, - system_open = { - cmd = "", - args = {}, - }, - diagnostics = { - enable = false, - show_on_dirs = false, - show_on_open_dirs = true, - debounce_delay = 50, - severity = { - min = vim.diagnostic.severity.HINT, - max = vim.diagnostic.severity.ERROR, - }, - icons = { - hint = "", - info = "", - warning = "", - error = "", - }, - }, - filters = { - dotfiles = false, - git_clean = false, - no_buffer = false, - custom = {}, - exclude = {}, - }, - filesystem_watchers = { - enable = true, - debounce_delay = 50, - ignore_dirs = {}, - }, - git = { - enable = false, - ignore = true, - show_on_dirs = true, - show_on_open_dirs = true, - timeout = 400, - }, - modified = { - enable = false, - show_on_dirs = true, - show_on_open_dirs = true, - }, - actions = { - use_system_clipboard = true, - change_dir = { - enable = true, - global = false, - restrict_above_cwd = false, - }, - expand_all = { - max_folder_discovery = 300, - exclude = {}, - }, - file_popup = { - open_win_config = { - col = 1, - row = 1, - relative = "cursor", - border = "shadow", - style = "minimal", - }, - }, - open_file = { - quit_on_open = false, - resize_window = true, - window_picker = { - enable = true, - picker = "default", - chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890", - exclude = { - filetype = { "notify", "packer", "qf", "diff", "fugitive", "fugitiveblame" }, - buftype = { "nofile", "terminal", "help" }, - }, - }, - }, - remove_file = { - close_window = true, - }, - }, - trash = { - cmd = "gio trash", - }, - live_filter = { - prefix = "[FILTER]: ", - always_show_folders = true, - }, - tab = { - sync = { - open = false, - close = false, - ignore = {}, - }, - }, - notify = { - threshold = vim.log.levels.INFO, - }, - ui = { - confirm = { - remove = true, - trash = true, - }, - }, - experimental = { - git = { - async = true, - }, - }, - log = { - enable = false, - truncate = false, - types = { - all = false, - config = false, - copy_paste = false, - dev = false, - diagnostics = false, - git = false, - profile = false, - watcher = false, - }, - }, -} -- END_DEFAULT_OPTS diff --git a/nvim/nvim/after_copy/plugin/telescope.lua b/nvim/nvim/after_copy/plugin/telescope.lua deleted file mode 100644 index 3679413..0000000 --- a/nvim/nvim/after_copy/plugin/telescope.lua +++ /dev/null @@ -1,8 +0,0 @@ -local builtin = require("telescope.builtin") -vim.keymap.set("n", "pf", builtin.find_files, {}) -vim.keymap.set("n", "", builtin.git_files, {}) -vim.keymap.set("n", "pb", builtin.buffers, {}) -vim.keymap.set("n", "pd", builtin.diagnostics, {}) -vim.keymap.set("n", "ps", function() - builtin.grep_string({ search = vim.fn.input("Grep > ") }) -end) diff --git a/nvim/nvim/after_copy/plugin/treesitter.lua b/nvim/nvim/after_copy/plugin/treesitter.lua deleted file mode 100644 index a4709cc..0000000 --- a/nvim/nvim/after_copy/plugin/treesitter.lua +++ /dev/null @@ -1,22 +0,0 @@ -require 'nvim-treesitter.configs'.setup { - -- A list of parser names, or "all" (the four listed parsers should always be installed) - ensure_installed = { "javascript", "typescript", "c", "lua", "vim", "rust", "go" }, - - -- Install parsers synchronously (only applied to `ensure_installed`) - sync_install = false, - - -- Automatically install missing parsers when entering buffer - -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally - auto_install = true, - - highlight = { - -- `false` will disable the whole extension - enable = true, - - -- Setting this to true will run `:h syntax` and tree-sitter at the same time. - -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). - -- Using this option may slow down your editor, and you may see some duplicate highlights. - -- Instead of true it can also be a list of languages - additional_vim_regex_highlighting = false, - }, -} diff --git a/nvim/nvim/init.lua b/nvim/nvim/init.lua deleted file mode 100644 index 9a65128..0000000 --- a/nvim/nvim/init.lua +++ /dev/null @@ -1 +0,0 @@ -require("mimu") diff --git a/nvim/nvim/lazy-lock.json b/nvim/nvim/lazy-lock.json deleted file mode 100644 index 93e223e..0000000 --- a/nvim/nvim/lazy-lock.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, - "LuaSnip": { "branch": "master", "commit": "82108e7e31cc6fc223cc5df5cae6d89f70bb199f" }, - "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, - "cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, - "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, - "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "copilot.vim": { "branch": "release", "commit": "1a55183ef9347d6f420406a3746474b6b9fb9ef5" }, - "fidget.nvim": { "branch": "main", "commit": "3a93300c076109d86c7ce35ec67a8034ae6ba9db" }, - "gitsigns": { "branch": "main", "commit": "3e6e91b09f0468c32d3b96dcacf4b947f037ce25" }, - "harpoon": { "branch": "master", "commit": "ccae1b9bec717ae284906b0bf83d720e59d12b91" }, - "lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" }, - "lualine.nvim": { "branch": "master", "commit": "566b7036f717f3d676362742630518a47f132fff" }, - "lush": { "branch": "main", "commit": "e8a58f36c256af65cda36878f6f2024a612154c3" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "0989bdf4fdf7b5aa4c74131d7ffccc3f399ac788" }, - "mason.nvim": { "branch": "main", "commit": "e110bc3be1a7309617cecd77bfe4bf86ba1b8134" }, - "mellifluous.nvim": { "branch": "main", "commit": "d4a52152997907598715d341cad10a4000cf7152" }, - "nvim-cmp": { "branch": "main", "commit": "538e37ba87284942c1d76ed38dd497e54e65b891" }, - "nvim-lspconfig": { "branch": "master", "commit": "796394fd19fb878e8dbc4fd1e9c9c186ed07a5f4" }, - "nvim-tree.lua": { "branch": "master", "commit": "b8c3a23e76f861d5f0ff3f6714b9b56388984d0b" }, - "nvim-treesitter": { "branch": "master", "commit": "8cd2b230174efbf7b5d9f49fe2f90bda6b5eb16e" }, - "plenary": { "branch": "master", "commit": "55d9fe89e33efd26f532ef20223e5f9430c8b0c0" }, - "telescope.nvim": { "branch": "master", "commit": "b3ff5f33201f474d58f5be96244869f189bbc091" }, - "trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" }, - "vim-fugitive": { "branch": "master", "commit": "59659093581aad2afacedc81f009ed6a4bfad275" } -} \ No newline at end of file diff --git a/nvim/nvim/lua/mimu/init.lua b/nvim/nvim/lua/mimu/init.lua deleted file mode 100644 index 3034ddc..0000000 --- a/nvim/nvim/lua/mimu/init.lua +++ /dev/null @@ -1,27 +0,0 @@ -require("mimu.set") -require("mimu.remap") -require("mimu.lazy") - -local augroup = vim.api.nvim_create_augroup -local MimuGroup = augroup("mimu", {}) - -local autocmd = vim.api.nvim_create_autocmd - -vim.cmd [[autocmd BufWritePre * lua vim.lsp.buf.format()]] - -autocmd("LspAttach", { - group = MimuGroup, - callback = function(e) - local opts = { buffer = e.buf } - vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts) - vim.keymap.set("n", "gr", function() vim.lsp.buf.references() end, opts) - vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts) - vim.keymap.set("n", "vws", function() vim.lsp.buf.workspace_symbol() end, opts) - vim.keymap.set("n", "vd", function() vim.lsp.diagnostic.open_float() end, opts) - -- vim.keymap.set("n", "[d", function() vim.lsp.diagnostic.goto_next() end, opts) - -- vim.keymap.set("n", "]d", function() vim.lsp.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 -}) diff --git a/nvim/nvim/lua/mimu/packer.lua b/nvim/nvim/lua/mimu/packer.lua deleted file mode 100644 index 7128853..0000000 --- a/nvim/nvim/lua/mimu/packer.lua +++ /dev/null @@ -1,43 +0,0 @@ -local fzf_make_cmd = "make" -if vim.loop.os_uname().machine == "arm64" then - plenaryzf_make_cmd = " arch -arm64 make" -end - -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not vim.loop.fs_stat(lazypath) then - vim.fn.system({ - "git", - "clone", - "--filter=blob:none", - "https://github.com/folke/lazy.nvim.git", - "--branch=stable", -- latest stable release - lazypath, - }) -end -vim.opt.rtp:prepend(lazypath) - -return require("lazy").setup({ - -- LSP - -- { - -- "VonHeikemen/lsp-zero.nvim", - -- branch = "v1.x", - -- dependencies = { - -- -- LSP Support - -- { "neovim/nvim-lspconfig" }, -- Required - -- { "williamboman/mason.nvim" }, -- Optional - -- { "williamboman/mason-lspconfig.nvim" }, -- Optional - -- - -- -- Autocompletion - -- { "hrsh7th/nvim-cmp" }, -- Required - -- { "hrsh7th/cmp-nvim-lsp" }, -- Required - -- { "hrsh7th/cmp-buffer" }, -- Optional - -- { "hrsh7th/cmp-path" }, -- Optional - -- { "saadparwaiz1/cmp_luasnip" }, -- Optional - -- { "hrsh7th/cmp-nvim-lua" }, -- Optional - -- - -- -- Snippets - -- { "L3MON4D3/LuaSnip" }, -- Required - -- { "rafamadriz/friendly-snippets" }, -- Optional - -- }, - -- }, -}) diff --git a/nvim/nvim/lua/mimu/plugins/lsp.lua b/nvim/nvim/lua/mimu/plugins/lsp.lua deleted file mode 100644 index 3bea636..0000000 --- a/nvim/nvim/lua/mimu/plugins/lsp.lua +++ /dev/null @@ -1,98 +0,0 @@ -return { - "neovim/nvim-lspconfig", - dependencies = { - "williamboman/mason.nvim", - "williamboman/mason-lspconfig.nvim", - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-path", - "hrsh7th/cmp-cmdline", - "hrsh7th/nvim-cmp", - "j-hui/fidget.nvim", - "L3MON4D3/LuaSnip", - "saadparwaiz1/cmp_luasnip", - }, - - config = function() - local capabilities = require('cmp_nvim_lsp').default_capabilities() - - require("fidget").setup() - require("mason").setup() - require("mason-lspconfig").setup({ - ensure_installed = { - "lua_ls", - "rust_analyzer", - "clangd", - "gopls", - "tsserver", - }, - handlers = { - function (server_name) -- default handler (optional) - - require("lspconfig")[server_name].setup { - capabilities = capabilities - } - end, - - ["lua_ls"] = function () - local lspconfig = require("lspconfig") - lspconfig.lua_ls.setup { - settings = { - Lua = { - diagnostics = { - globals = { "vim" } - } - } - } - } - end, - } - }) - - local cmp = require("cmp") - local cmp_select = { behaviour = cmp.SelectBehavior.Select } - cmp.setup({ - snippet = { - -- REQUIRED - you must specify a snippet engine - expand = function(args) - require('luasnip').lsp_expand(args.body) -- For `luasnip` users. - end, - }, - mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping.confirm({ select = true }), - [""] = function(fallback) - if cmp.visible() then - cmp.select_next_item() - else - fallback() - end - end, - }), - sources = cmp.config.sources({ - { name = "nvim_lsp" }, - { name = "luasnip" }, - }, { - { name = "buffer" }, - }) - }) - - vim.diagnostic.config({ - virtual_text = true, - update_on_insert = true, - float = { - focusable = false, - style = "minimal", - border = "rounded", - source = "always", - header = "", - prefix = "", - }, - }) - end -} diff --git a/nvim/nvim/lua/mimu/remap.lua b/nvim/nvim/lua/mimu/remap.lua deleted file mode 100644 index 2435bda..0000000 --- a/nvim/nvim/lua/mimu/remap.lua +++ /dev/null @@ -1,34 +0,0 @@ -vim.keymap.set("n", "pv", vim.cmd.Ex) - --- allow to move selected lines up and down -vim.keymap.set("v", "J", ":m '>+1gv=gv") -vim.keymap.set("v", "K", ":m '<-2gv=gv") - -vim.keymap.set("n", "J", "mzJ`z") - -vim.keymap.set("n", "", "zz") -vim.keymap.set("n", "", "zz") - --- keep search term in the middle -vim.keymap.set("n", "n", "nzzzv") -vim.keymap.set("n", "N", "Nzzzv") - --- paste without losing the copied stuff -vim.keymap.set("x", "p", "\"_dp") - --- copy to system clipboard instead of vim -vim.keymap.set("n", "y", "\"+y") -vim.keymap.set("v", "y", "\"+y") -vim.keymap.set("n", "Y", "\"+Y") - --- quick fix navigation -vim.keymap.set("n", "", "cnextzz") -vim.keymap.set("n", "", "cprevzz") -vim.keymap.set("n", "k", "lnextzz") -vim.keymap.set("n", "j", "lprevzz") - --- replace in file -vim.keymap.set("n", "s", [[:%s/\<\>//gI]]) - --- toggle nvim-tree -vim.keymap.set("n", "", "NvimTreeFindFileToggle") diff --git a/nvim/nvim/lua/mimu/set.lua b/nvim/nvim/lua/mimu/set.lua deleted file mode 100644 index cea4de0..0000000 --- a/nvim/nvim/lua/mimu/set.lua +++ /dev/null @@ -1,25 +0,0 @@ -vim.opt.nu = true -vim.opt.relativenumber = true - -vim.opt.tabstop = 4 -vim.opt.softtabstop = 4 -vim.opt.shiftwidth = 4 -vim.opt.expandtab = true - --- highlight search -vim.opt.hlsearch = false -vim.opt.incsearch = true - -vim.opt.termguicolors = true - -vim.opt.scrolloff = 10 --- vim.opt.signcolumn = "yes" -vim.opt.isfname:append("@-@") - -vim.opt.updatetime = 50 - -vim.opt.colorcolumn = "120" - -vim.g.mapleader = " " - -vim.o.cmdheight = 0 diff --git a/nvim/plugin/packer_compiled.lua b/nvim/plugin/packer_compiled.lua deleted file mode 100644 index 6d57bfb..0000000 --- a/nvim/plugin/packer_compiled.lua +++ /dev/null @@ -1,234 +0,0 @@ --- Automatically generated packer.nvim plugin loader code - -if vim.api.nvim_call_function('has', {'nvim-0.5'}) ~= 1 then - vim.api.nvim_command('echohl WarningMsg | echom "Invalid Neovim version for packer.nvim! | echohl None"') - return -end - -vim.api.nvim_command('packadd packer.nvim') - -local no_errors, error_msg = pcall(function() - -_G._packer = _G._packer or {} -_G._packer.inside_compile = true - -local time -local profile_info -local should_profile = false -if should_profile then - local hrtime = vim.loop.hrtime - profile_info = {} - time = function(chunk, start) - if start then - profile_info[chunk] = hrtime() - else - profile_info[chunk] = (hrtime() - profile_info[chunk]) / 1e6 - end - end -else - time = function(chunk, start) end -end - -local function save_profiles(threshold) - local sorted_times = {} - for chunk_name, time_taken in pairs(profile_info) do - sorted_times[#sorted_times + 1] = {chunk_name, time_taken} - end - table.sort(sorted_times, function(a, b) return a[2] > b[2] end) - local results = {} - for i, elem in ipairs(sorted_times) do - if not threshold or threshold and elem[2] > threshold then - results[i] = elem[1] .. ' took ' .. elem[2] .. 'ms' - end - end - if threshold then - table.insert(results, '(Only showing plugins that took longer than ' .. threshold .. ' ms ' .. 'to load)') - end - - _G._packer.profile_output = results -end - -time([[Luarocks path setup]], true) -local package_path_str = "/Users/brice/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?.lua;/Users/brice/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?/init.lua;/Users/brice/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?.lua;/Users/brice/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?/init.lua" -local install_cpath_pattern = "/Users/brice/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/?.so" -if not string.find(package.path, package_path_str, 1, true) then - package.path = package.path .. ';' .. package_path_str -end - -if not string.find(package.cpath, install_cpath_pattern, 1, true) then - package.cpath = package.cpath .. ';' .. install_cpath_pattern -end - -time([[Luarocks path setup]], false) -time([[try_loadstring definition]], true) -local function try_loadstring(s, component, name) - local success, result = pcall(loadstring(s), name, _G.packer_plugins[name]) - if not success then - vim.schedule(function() - vim.api.nvim_notify('packer.nvim: Error running ' .. component .. ' for ' .. name .. ': ' .. result, vim.log.levels.ERROR, {}) - end) - end - return result -end - -time([[try_loadstring definition]], false) -time([[Defining packer_plugins]], true) -_G.packer_plugins = { - ["Comment.nvim"] = { - loaded = true, - path = "/Users/brice/.local/share/nvim/site/pack/packer/start/Comment.nvim", - url = "https://github.com/numToStr/Comment.nvim" - }, - LuaSnip = { - loaded = true, - path = "/Users/brice/.local/share/nvim/site/pack/packer/start/LuaSnip", - url = "https://github.com/L3MON4D3/LuaSnip" - }, - ["cmp-buffer"] = { - loaded = true, - path = "/Users/brice/.local/share/nvim/site/pack/packer/start/cmp-buffer", - url = "https://github.com/hrsh7th/cmp-buffer" - }, - ["cmp-nvim-lsp"] = { - loaded = true, - path = "/Users/brice/.local/share/nvim/site/pack/packer/start/cmp-nvim-lsp", - url = "https://github.com/hrsh7th/cmp-nvim-lsp" - }, - ["cmp-nvim-lua"] = { - loaded = true, - path = "/Users/brice/.local/share/nvim/site/pack/packer/start/cmp-nvim-lua", - url = "https://github.com/hrsh7th/cmp-nvim-lua" - }, - ["cmp-path"] = { - loaded = true, - path = "/Users/brice/.local/share/nvim/site/pack/packer/start/cmp-path", - url = "https://github.com/hrsh7th/cmp-path" - }, - cmp_luasnip = { - loaded = true, - path = "/Users/brice/.local/share/nvim/site/pack/packer/start/cmp_luasnip", - url = "https://github.com/saadparwaiz1/cmp_luasnip" - }, - ["friendly-snippets"] = { - loaded = true, - path = "/Users/brice/.local/share/nvim/site/pack/packer/start/friendly-snippets", - url = "https://github.com/rafamadriz/friendly-snippets" - }, - ["gitsigns.nvim"] = { - config = { "\27LJ\2\nQ\0\0\3\0\4\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0005\2\3\0B\0\2\1K\0\1\0\1\0\1\23current_line_blame\2\nsetup\rgitsigns\frequire\0" }, - loaded = true, - path = "/Users/brice/.local/share/nvim/site/pack/packer/start/gitsigns.nvim", - url = "https://github.com/lewis6991/gitsigns.nvim" - }, - harpoon = { - loaded = true, - path = "/Users/brice/.local/share/nvim/site/pack/packer/start/harpoon", - url = "https://github.com/theprimeagen/harpoon" - }, - ["lsp-zero.nvim"] = { - loaded = true, - path = "/Users/brice/.local/share/nvim/site/pack/packer/start/lsp-zero.nvim", - url = "https://github.com/VonHeikemen/lsp-zero.nvim" - }, - ["lualine.nvim"] = { - loaded = true, - path = "/Users/brice/.local/share/nvim/site/pack/packer/start/lualine.nvim", - url = "https://github.com/nvim-lualine/lualine.nvim" - }, - ["lush.nvim"] = { - loaded = true, - path = "/Users/brice/.local/share/nvim/site/pack/packer/start/lush.nvim", - url = "https://github.com/rktjmp/lush.nvim" - }, - ["mason-lspconfig.nvim"] = { - loaded = true, - path = "/Users/brice/.local/share/nvim/site/pack/packer/start/mason-lspconfig.nvim", - url = "https://github.com/williamboman/mason-lspconfig.nvim" - }, - ["mason.nvim"] = { - loaded = true, - path = "/Users/brice/.local/share/nvim/site/pack/packer/start/mason.nvim", - url = "https://github.com/williamboman/mason.nvim" - }, - ["mellifluous.nvim"] = { - config = { "\27LJ\2\nŒ\1\0\0\4\0\t\0\r6\0\0\0'\2\1\0B\0\2\0029\0\2\0005\2\4\0005\3\3\0=\3\5\2B\0\2\0016\0\6\0009\0\a\0'\2\b\0B\0\2\1K\0\1\0\28colorscheme mellifluous\bcmd\bvim\vstyles\1\0\0\1\0\1\rcomments\5\nsetup\16mellifluous\frequire\0" }, - loaded = true, - path = "/Users/brice/.local/share/nvim/site/pack/packer/start/mellifluous.nvim", - url = "https://github.com/ramojus/mellifluous.nvim" - }, - ["null-ls.nvim"] = { - loaded = true, - path = "/Users/brice/.local/share/nvim/site/pack/packer/start/null-ls.nvim", - url = "https://github.com/jose-elias-alvarez/null-ls.nvim" - }, - ["nvim-cmp"] = { - loaded = true, - path = "/Users/brice/.local/share/nvim/site/pack/packer/start/nvim-cmp", - url = "https://github.com/hrsh7th/nvim-cmp" - }, - ["nvim-lspconfig"] = { - loaded = true, - path = "/Users/brice/.local/share/nvim/site/pack/packer/start/nvim-lspconfig", - url = "https://github.com/neovim/nvim-lspconfig" - }, - ["nvim-tree.lua"] = { - config = { "\27LJ\2\n;\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\14nvim-tree\frequire\0" }, - loaded = true, - path = "/Users/brice/.local/share/nvim/site/pack/packer/start/nvim-tree.lua", - url = "https://github.com/nvim-tree/nvim-tree.lua" - }, - ["nvim-treesitter"] = { - loaded = true, - path = "/Users/brice/.local/share/nvim/site/pack/packer/start/nvim-treesitter", - url = "https://github.com/nvim-treesitter/nvim-treesitter" - }, - ["packer.nvim"] = { - loaded = true, - path = "/Users/brice/.local/share/nvim/site/pack/packer/start/packer.nvim", - url = "https://github.com/wbthomason/packer.nvim" - }, - ["plenary.nvim"] = { - loaded = true, - path = "/Users/brice/.local/share/nvim/site/pack/packer/start/plenary.nvim", - url = "https://github.com/nvim-lua/plenary.nvim" - }, - ["telescope.nvim"] = { - loaded = true, - path = "/Users/brice/.local/share/nvim/site/pack/packer/start/telescope.nvim", - url = "https://github.com/nvim-telescope/telescope.nvim" - }, - ["vim-fugitive"] = { - loaded = true, - path = "/Users/brice/.local/share/nvim/site/pack/packer/start/vim-fugitive", - url = "https://github.com/tpope/vim-fugitive" - } -} - -time([[Defining packer_plugins]], false) --- Config for: gitsigns.nvim -time([[Config for gitsigns.nvim]], true) -try_loadstring("\27LJ\2\nQ\0\0\3\0\4\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0005\2\3\0B\0\2\1K\0\1\0\1\0\1\23current_line_blame\2\nsetup\rgitsigns\frequire\0", "config", "gitsigns.nvim") -time([[Config for gitsigns.nvim]], false) --- Config for: mellifluous.nvim -time([[Config for mellifluous.nvim]], true) -try_loadstring("\27LJ\2\nŒ\1\0\0\4\0\t\0\r6\0\0\0'\2\1\0B\0\2\0029\0\2\0005\2\4\0005\3\3\0=\3\5\2B\0\2\0016\0\6\0009\0\a\0'\2\b\0B\0\2\1K\0\1\0\28colorscheme mellifluous\bcmd\bvim\vstyles\1\0\0\1\0\1\rcomments\5\nsetup\16mellifluous\frequire\0", "config", "mellifluous.nvim") -time([[Config for mellifluous.nvim]], false) --- Config for: nvim-tree.lua -time([[Config for nvim-tree.lua]], true) -try_loadstring("\27LJ\2\n;\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\14nvim-tree\frequire\0", "config", "nvim-tree.lua") -time([[Config for nvim-tree.lua]], false) - -_G._packer.inside_compile = false -if _G._packer.needs_bufread == true then - vim.cmd("doautocmd BufRead") -end -_G._packer.needs_bufread = false - -if should_profile then save_profiles() end - -end) - -if not no_errors then - error_msg = error_msg:gsub('"', '\\"') - vim.api.nvim_command('echohl ErrorMsg | echom "Error in packer_compiled: '..error_msg..'" | echom "Please check your config for correctness" | echohl None') -end