diff --git a/.config/nvim/after/plugin/autopairs.lua b/.config/nvim/after/plugin/autopairs.lua deleted file mode 100644 index 27d0f7f2..00000000 --- a/.config/nvim/after/plugin/autopairs.lua +++ /dev/null @@ -1,3 +0,0 @@ -require("nvim-autopairs").setup({ - ignored_next_char = "[%w%\"]" -}) diff --git a/.config/nvim/after/plugin/colorizer.lua b/.config/nvim/after/plugin/colorizer.lua deleted file mode 100644 index 2720b604..00000000 --- a/.config/nvim/after/plugin/colorizer.lua +++ /dev/null @@ -1,6 +0,0 @@ -require'colorizer'.setup({ - '*'; - css = { css = true; }; - html = { css = true; }; - javascript = { css = true; }; -}) diff --git a/.config/nvim/after/plugin/conform.lua b/.config/nvim/after/plugin/conform.lua deleted file mode 100644 index cfe822a3..00000000 --- a/.config/nvim/after/plugin/conform.lua +++ /dev/null @@ -1,28 +0,0 @@ -require("conform").setup({ - formatters_by_ft = { - python = { "isort", "black" }, - lua = { "stylua" }, - css = { "prettierd" }, - javascript = { "prettierd", "prettier", stop_after_first = true }, - typescript = { "prettierd", "prettier", stop_after_first = true }, - javascriptreact = { "prettierd", "prettier", stop_after_first = true }, - typescriptreact = { "prettierd", "prettier", stop_after_first = true }, - html = { "prettierd", "prettier", stop_after_first = true }, - pug = { "prettierd", "prettier", stop_after_first = true }, - vue = { "prettierd", "prettier", stop_after_first = true }, - sql = { "sql_formatter" }, - rust = { "rustfmt" }, - golang = { "gofmt" }, - sh = { "shfmt" }, - json = { "jq", "deno_fmt", stop_after_first = true }, - toml = { "taplo" }, - yaml = { "yq" }, - markdown = { "deno_fmt" }, - }, - format_on_save = { - -- These options will be passed to conform.format() - timeout_ms = 500, - async = false, - lsp_format = "fallback", - }, -}) diff --git a/.config/nvim/after/plugin/crates.lua b/.config/nvim/after/plugin/crates.lua deleted file mode 100644 index a2669a9c..00000000 --- a/.config/nvim/after/plugin/crates.lua +++ /dev/null @@ -1 +0,0 @@ -require("crates").setup() diff --git a/.config/nvim/after/plugin/gitblame.lua b/.config/nvim/after/plugin/gitblame.lua deleted file mode 100644 index 726ca609..00000000 --- a/.config/nvim/after/plugin/gitblame.lua +++ /dev/null @@ -1,3 +0,0 @@ -require("gitblame").setup({ - enabled = false, -}) diff --git a/.config/nvim/after/plugin/harpoon.lua b/.config/nvim/after/plugin/harpoon.lua deleted file mode 100644 index d9165f01..00000000 --- a/.config/nvim/after/plugin/harpoon.lua +++ /dev/null @@ -1,14 +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", "j", function() ui.nav_file(1) end) -vim.keymap.set("n", "k", function() ui.nav_file(2) end) -vim.keymap.set("n", "l", function() ui.nav_file(3) end) -vim.keymap.set("n", ";", function() ui.nav_file(4) end) -vim.keymap.set("n", "m", function() ui.nav_file(5) end) -vim.keymap.set("n", ",", function() ui.nav_file(6) end) -vim.keymap.set("n", ".", function() ui.nav_file(7) end) -vim.keymap.set("n", "/", function() ui.nav_file(8) end) diff --git a/.config/nvim/after/plugin/indentline.lua b/.config/nvim/after/plugin/indentline.lua deleted file mode 100644 index 62ddc1b8..00000000 --- a/.config/nvim/after/plugin/indentline.lua +++ /dev/null @@ -1,3 +0,0 @@ -require("ibl").setup({ - indent = { char = "¦" }, -}) diff --git a/.config/nvim/after/plugin/lsp.lua b/.config/nvim/after/plugin/lsp.lua index 756ee446..1571ad16 100644 --- a/.config/nvim/after/plugin/lsp.lua +++ b/.config/nvim/after/plugin/lsp.lua @@ -1,59 +1,4 @@ -local lsp = require("lsp-zero") -local lspconfig = require("lspconfig") local cmp = require("cmp") -require("mason").setup() - --- https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md -local servers = { - "bashls", - "biome", - "clangd", - "cssls", - "dockerls", - "emmet_ls", - "eslint", - "gopls", - "jqls", - "lua_ls", - "pyright", - "quick_lint_js", - "rust_analyzer", - "stylelint_lsp", - "svelte", - "ts_ls", - "zls", -} - -for _, server in ipairs(servers) do - lspconfig[server].setup({}) -end - -require("mason-lspconfig").setup({ - ensure_installed = servers, -}) - -cmp.setup({ - window = { - completion = cmp.config.window.bordered(), - documentation = cmp.config.window.bordered(), - }, - sources = cmp.config.sources({ - { name = "nvim_lsp" }, - { name = "luasnip" }, - { name = "buffer" }, - { name = "path" }, - { name = "vsnip" }, - }), - mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping.select_prev_item(), - [""] = cmp.mapping.select_next_item(), - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.complete(), - [""] = cmp.mapping.abort(), - [""] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. - }), -}) -- function that is used with keybinding cm to toggle autocompletion Mode = require("cmp.types").cmp.TriggerEvent.TextChanged @@ -76,50 +21,3 @@ function SetAutoCmp(mode) end SetAutoCmp(Mode) -lsp.setup() - --- configure diagnostic lsp err msgs -vim.diagnostic.config({ - underline = true, - virtual_text = true, - float = { - source = "always", - focusable = false, - }, -}) - --- toggles floating error messages -vim.keymap.set("n", "e", "lua vim.diagnostic.open_float()") - --- LSP Specific Settings --- require("mason-lspconfig").setup_handlers({} - --- Vue TypeScript Setup --- https://lsp-zero.netlify.app/blog/configure-volar-v2.html --- NOTE: Don't install volar through Mason, this is done manually: --- npm install -g @vue/language-server --- npm install -g @vue/typescript-plugin -local vue_typescript_plugin = "/usr/lib/node_modules" - .. "/usr/lib/node_modules/@vue/language-server" - .. "/usr/lib/node_modules/@vue/typescript-plugin" - -lspconfig.ts_ls.setup({ - init_options = { - plugins = { - { - name = "@vue/typescript-plugin", - location = vue_typescript_plugin, - languages = { "javascript", "typescript", "vue" }, - }, - }, - }, - filetypes = { - "javascript", - "javascriptreact", - "javascript.jsx", - "typescript", - "typescriptreact", - "typescript.tsx", - "vue", - }, -}) diff --git a/.config/nvim/after/plugin/lualine.lua b/.config/nvim/after/plugin/lualine.lua deleted file mode 100644 index 614ab8b8..00000000 --- a/.config/nvim/after/plugin/lualine.lua +++ /dev/null @@ -1,17 +0,0 @@ -local function show_codeium_status() - return "{…}" .. vim.fn["codeium#GetStatusString"]() -end - -require("lualine").setup({ - options = { theme = "nord" }, - sections = { - lualine_x = { - { - show_codeium_status, - cond = function() - return vim.bo.filetype ~= "TelescopePrompt" - end, - }, - }, - }, -}) diff --git a/.config/nvim/after/plugin/mardownpreview.lua b/.config/nvim/after/plugin/mardownpreview.lua deleted file mode 100644 index abf1fa36..00000000 --- a/.config/nvim/after/plugin/mardownpreview.lua +++ /dev/null @@ -1,2 +0,0 @@ -vim.g.mkdp_browser = "librewolf" -vim.g.mkdp_theme = "dark" diff --git a/.config/nvim/after/plugin/multicursor.lua b/.config/nvim/after/plugin/multicursor.lua deleted file mode 100644 index 162339af..00000000 --- a/.config/nvim/after/plugin/multicursor.lua +++ /dev/null @@ -1 +0,0 @@ -vim.opt.cursorcolumn = true diff --git a/.config/nvim/after/plugin/nerdcommenter.lua b/.config/nvim/after/plugin/nerdcommenter.lua deleted file mode 100644 index 12bcba65..00000000 --- a/.config/nvim/after/plugin/nerdcommenter.lua +++ /dev/null @@ -1,6 +0,0 @@ --- Create Default Mappings for NerdCommenter -vim.g.NERDCreateDefaultMappings = 1 --- Add spaces after NerdCommenter delimiters by default -vim.g.NERDSpaceDelims = 1 --- Enable Comments with Italics --- vim.cmd[[highlight Comment cterm=italic gui=italic]] diff --git a/.config/nvim/after/plugin/nvimtree.lua b/.config/nvim/after/plugin/nvimtree.lua deleted file mode 100644 index a8d4916a..00000000 --- a/.config/nvim/after/plugin/nvimtree.lua +++ /dev/null @@ -1,113 +0,0 @@ --- Nvim_Tree configuration: -- setup with all defaults --- each of these are documented in `:help nvim-tree.OPTION_NAME` -require("nvim-tree").setup({ -- BEGIN_DEFAULT_OPTS - auto_reload_on_write = true, - disable_netrw = false, - -- hide_root_folder = false, - hijack_cursor = false, - hijack_netrw = true, - hijack_unnamed_buffer_when_opening = false, - open_on_tab = false, - sort_by = "name", - update_cwd = false, - view = { - width = 25, - -- height = 30, - side = "right", - preserve_window_proportions = true, - number = false, - relativenumber = false, - signcolumn = "yes", - -- mappings = { - -- custom_only = false, - -- list = { - -- user mappings go here - -- }, - -- }, - }, - renderer = { - indent_markers = { - enable = false, - icons = { - corner = "└ ", - edge = "│ ", - none = " ", - }, - }, - icons = { - webdev_colors = true, - }, - }, - hijack_directories = { - enable = true, - auto_open = true, - }, - update_focused_file = { - enable = false, - update_cwd = false, - ignore_list = {}, - }, - system_open = { - cmd = nil, - args = {}, - }, - diagnostics = { - enable = false, - show_on_dirs = false, - icons = { - hint = "", - info = "", - warning = "", - error = "", - }, - }, - filters = { - dotfiles = false, - custom = {}, - exclude = {}, - }, - git = { - enable = true, - ignore = true, - timeout = 400, - }, - actions = { - use_system_clipboard = true, - change_dir = { - enable = true, - global = false, - restrict_above_cwd = false, - }, - open_file = { - quit_on_open = false, - resize_window = false, - window_picker = { - enable = true, - chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890", - exclude = { - filetype = { "notify", "packer", "qf", "diff", "fugitive", "fugitiveblame" }, - buftype = { "nofile", "terminal", "help" }, - }, - }, - }, - }, - trash = { - cmd = "trash", - require_confirm = true, - }, - log = { - enable = false, - truncate = false, - types = { - all = false, - config = false, - copy_paste = false, - diagnostics = false, - git = false, - profile = false, - }, - }, -}) -- END_DEFAULT_OPTS for Nvim_Tree - --- Automatically closes Nvim tree if last window open -vim.cmd([[autocmd BufEnter * ++nested if winnr('$') == 1 && bufname() == 'NvimTree_' . tabpagenr() | quit | endif]]) diff --git a/.config/nvim/after/plugin/rainbow.lua b/.config/nvim/after/plugin/rainbow.lua deleted file mode 100644 index 3a0549cf..00000000 --- a/.config/nvim/after/plugin/rainbow.lua +++ /dev/null @@ -1 +0,0 @@ -vim.g.rainbow_active = 1 diff --git a/.config/nvim/after/plugin/ripgrep.lua b/.config/nvim/after/plugin/ripgrep.lua deleted file mode 100644 index 2bc6cab8..00000000 --- a/.config/nvim/after/plugin/ripgrep.lua +++ /dev/null @@ -1,12 +0,0 @@ --- Enable use of ripgrep -require("nvim-ripgrep").setup({ - runner = require("nvim-ripgrep.run").ripgrep, -- grep command - prompt = "❯ ", -- prompt - window = { - width = 0.8, - border = "rounded", - }, - open_qf_fn = function() - return vim.api.nvim_command("copen") - end, -}) diff --git a/.config/nvim/after/plugin/telescope.lua b/.config/nvim/after/plugin/telescope.lua deleted file mode 100644 index 8359ab48..00000000 --- a/.config/nvim/after/plugin/telescope.lua +++ /dev/null @@ -1,10 +0,0 @@ -require("telescope").setup({ - extensions = { - undo = { - layout_strategy = "vertical", - layout_config = { - preview_height = 0.8, - }, - }, - }, -}) diff --git a/.config/nvim/after/plugin/undotree.lua b/.config/nvim/after/plugin/undotree.lua deleted file mode 100644 index b61d7e89..00000000 --- a/.config/nvim/after/plugin/undotree.lua +++ /dev/null @@ -1,2 +0,0 @@ -vim.g.undotree_DiffAutoOpen = 0 -vim.g.undotree_SetFocusWhenToggle = 1 diff --git a/.config/nvim/after/plugin/vimsmoothie.lua b/.config/nvim/after/plugin/vimsmoothie.lua deleted file mode 100644 index 23b06127..00000000 --- a/.config/nvim/after/plugin/vimsmoothie.lua +++ /dev/null @@ -1,2 +0,0 @@ --- Use experimental features of vim-smoothie (gg and G) -vim.g.smoothie_experimental_mappings = 1 diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index ba15ffbd..5108fbf1 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -1,2 +1,2 @@ -require("neovim") +require("config.lazy") vim.loader.enable() diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index e9367c09..21465ab2 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -9,6 +9,7 @@ "conform.nvim": { "branch": "master", "commit": "f9ef25a7ef00267b7d13bfc00b0dea22d78702d5" }, "crates.nvim": { "branch": "main", "commit": "fd2bbca7aa588f24ffc3517831934b4c4a9588e9" }, "ctrlp.vim": { "branch": "master", "commit": "564176f01d7f3f7f8ab452ff4e1f5314de7b0981" }, + "fzf": { "branch": "master", "commit": "ba6d1b8772ce5e75ff999dcca21c0fadb689d7bf" }, "fzf.vim": { "branch": "master", "commit": "1fff637559f29d5edbdb05e03327954a8cd9e406" }, "git-blame.nvim": { "branch": "master", "commit": "b12da2156ec1c3f53f42c129201ff0bfed69c86e" }, "go.nvim": { "branch": "master", "commit": "0d426e87227dd14584881ecc595c173121456111" }, @@ -28,7 +29,7 @@ "nvim-autopairs": { "branch": "master", "commit": "6522027785b305269fa17088395dfc0f456cedd2" }, "nvim-cmp": { "branch": "main", "commit": "1e1900b0769324a9675ef85b38f99cca29e203b3" }, "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, - "nvim-lspconfig": { "branch": "master", "commit": "d7c610491c4cbcd1dcd278eeecbab78814437bc4" }, + "nvim-lspconfig": { "branch": "master", "commit": "0a1ac55d7d4ec2b2ed9616dfc5406791234d1d2b" }, "nvim-ripgrep": { "branch": "main", "commit": "7a1b0a4da8858e3501b593c25d7ed66bc91a221d" }, "nvim-silicon": { "branch": "main", "commit": "7f66bda8f60c97a5bf4b37e5b8acb0e829ae3c32" }, "nvim-tree.lua": { "branch": "master", "commit": "44d9b58f11d5a426c297aafd0be1c9d45617a849" }, diff --git a/.config/nvim/lua/neovim/remap.lua b/.config/nvim/lua/config/keymaps.lua similarity index 100% rename from .config/nvim/lua/neovim/remap.lua rename to .config/nvim/lua/config/keymaps.lua diff --git a/.config/nvim/lua/neovim/init.lua b/.config/nvim/lua/config/lazy.lua similarity index 84% rename from .config/nvim/lua/neovim/init.lua rename to .config/nvim/lua/config/lazy.lua index 5f3cadec..d10173ff 100644 --- a/.config/nvim/lua/neovim/init.lua +++ b/.config/nvim/lua/config/lazy.lua @@ -14,11 +14,13 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then end vim.opt.rtp:prepend(lazypath) -require("neovim.remap") -require("neovim.set") +require("config.keymaps") +require("config.options") require("lazy").setup({ spec = { + + { import = "plugins" }, { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate", event = "BufReadPost" }, { "nvim-treesitter/playground" }, { @@ -28,34 +30,22 @@ require("lazy").setup({ end, }, { "preservim/nerdcommenter", event = "VeryLazy" }, - { "nvim-lualine/lualine.nvim", event = "VeryLazy" }, { "kyazdani42/nvim-web-devicons", opt = true, event = "VeryLazy" }, - { "kyazdani42/nvim-tree.lua", cmd = { "NvimTreeToggle" } }, { "psliwka/vim-smoothie", event = "VeryLazy" }, - { "mg979/vim-visual-multi", keys = { "", "" } }, - { "lukas-reineke/indent-blankline.nvim", event = "BufRead" }, + { "mg979/vim-visual-multi" }, { "airblade/vim-gitgutter", event = "BufReadPre" }, - { "f-person/git-blame.nvim", cmd = { "GitBlameToggle" } }, { "kkoomen/vim-doge", build = ":call doge#install()" }, - { "norcalli/nvim-colorizer.lua", cmd = { "ColorizerToggle" } }, - { "windwp/nvim-autopairs", event = "InsertEnter" }, { "simeji/winresizer" }, - { "stevearc/conform.nvim" }, { "rhysd/vim-clang-format" }, { "sangdol/mintabline.vim" }, { "nvim-lua/plenary.nvim" }, - { "ThePrimeagen/harpoon" }, - { - "nvim-telescope/telescope.nvim", - tag = "0.1.0", - }, { "tpope/vim-fugitive" }, { "tpope/vim-surround", keys = { "cs", "ds", "ys" } }, { "lambdalisue/suda.vim" }, + { "junegunn/fzf" }, { "junegunn/fzf.vim" }, { "junegunn/gv.vim" }, { "kien/ctrlp.vim" }, - { "rinx/nvim-ripgrep" }, { "mbbill/undotree", cmd = { "UndotreeToggle" } }, { "williamboman/mason.nvim", event = "VeryLazy" }, { "williamboman/mason-lspconfig.nvim", event = "VeryLazy" }, @@ -88,7 +78,6 @@ require("lazy").setup({ { "ray-x/guihua.lua" }, -- rustlang { "rust-lang/rust.vim" }, - { "saecki/crates.nvim" }, -- code snippet screenshots -- capture code snippets using :Silicon, -- in Visual mode highlight then enter command diff --git a/.config/nvim/lua/neovim/set.lua b/.config/nvim/lua/config/options.lua similarity index 84% rename from .config/nvim/lua/neovim/set.lua rename to .config/nvim/lua/config/options.lua index 39857599..6dda9de9 100644 --- a/.config/nvim/lua/neovim/set.lua +++ b/.config/nvim/lua/config/options.lua @@ -40,6 +40,8 @@ vim.opt.cursorcolumn = true vim.opt.splitbelow = true vim.opt.splitright = true +vim.opt.cursorcolumn = true + -- Removes trailing spaces vim.api.nvim_create_autocmd({ "BufWritePre" }, { pattern = { "*" }, @@ -112,6 +114,9 @@ vim.api.nvim_create_autocmd("BufReadPost", { end, }) +-- Automatically closes Nvim tree if last window open +vim.cmd([[autocmd BufEnter * ++nested if winnr('$') == 1 && bufname() == 'NvimTree_' . tabpagenr() | quit | endif]]) + -- turns off LSP semantic tokens by default -- vim.api.nvim_create_autocmd("LspAttach", { -- callback = function(args) @@ -148,3 +153,23 @@ augroup END vim.g.codeium_disable_bindings = 1 -- codeium enable(1)/disable(0) by default vim.g.codeium_enabled = 0 + +-- Markdown Previewer settings +vim.g.mkdp_browser = "librewolf" +vim.g.mkdp_theme = "dark" + +-- Create Default Mappings for NerdCommenter +vim.g.NERDCreateDefaultMappings = 1 +-- Add spaces after NerdCommenter delimiters by default +vim.g.NERDSpaceDelims = 1 +-- Enable Comments with Italics +-- vim.cmd[[highlight Comment cterm=italic gui=italic]] + +vim.g.rainbow_active = 1 + +-- UndoTree Settings +vim.g.undotree_DiffAutoOpen = 0 +vim.g.undotree_SetFocusWhenToggle = 1 + +-- Vim Smoothie Settings +vim.g.smoothie_experimental_mappings = 1 diff --git a/.config/nvim/lua/plugins/autopairs.lua b/.config/nvim/lua/plugins/autopairs.lua new file mode 100644 index 00000000..8dc83ac9 --- /dev/null +++ b/.config/nvim/lua/plugins/autopairs.lua @@ -0,0 +1,3 @@ +return { "windwp/nvim-autopairs", event = "InsertEnter", opts = { + ignored_next_char = '[%w%"]', +} } diff --git a/.config/nvim/lua/plugins/colorizer.lua b/.config/nvim/lua/plugins/colorizer.lua new file mode 100644 index 00000000..056c1fa7 --- /dev/null +++ b/.config/nvim/lua/plugins/colorizer.lua @@ -0,0 +1,11 @@ +return { + "norcalli/nvim-colorizer.lua", + config = function() + require("colorizer").setup({ + "*", + css = { css = true }, + html = { css = true }, + javascript = { css = true }, + }) + end, +} diff --git a/.config/nvim/lua/plugins/conform.lua b/.config/nvim/lua/plugins/conform.lua new file mode 100644 index 00000000..45bc746e --- /dev/null +++ b/.config/nvim/lua/plugins/conform.lua @@ -0,0 +1,33 @@ +return { + "stevearc/conform.nvim", + config = function() + require("conform").setup({ + formatters_by_ft = { + python = { "isort", "black" }, + lua = { "stylua" }, + css = { "prettierd" }, + javascript = { "prettierd", "prettier", stop_after_first = true }, + typescript = { "prettierd", "prettier", stop_after_first = true }, + javascriptreact = { "prettierd", "prettier", stop_after_first = true }, + typescriptreact = { "prettierd", "prettier", stop_after_first = true }, + html = { "prettierd", "prettier", stop_after_first = true }, + pug = { "prettierd", "prettier", stop_after_first = true }, + vue = { "prettierd", "prettier", stop_after_first = true }, + sql = { "sql_formatter" }, + rust = { "rustfmt" }, + golang = { "gofmt" }, + sh = { "shfmt" }, + json = { "jq", "deno_fmt", stop_after_first = true }, + toml = { "taplo" }, + yaml = { "yq" }, + markdown = { "deno_fmt" }, + }, + format_on_save = { + -- These options will be passed to conform.format() + timeout_ms = 500, + async = false, + lsp_format = "fallback", + }, + }) + end, +} diff --git a/.config/nvim/lua/plugins/crates.lua b/.config/nvim/lua/plugins/crates.lua new file mode 100644 index 00000000..f1b8b6da --- /dev/null +++ b/.config/nvim/lua/plugins/crates.lua @@ -0,0 +1,6 @@ +return { + "saecki/crates.nvim", + config = function() + require("crates").setup() + end, +} diff --git a/.config/nvim/lua/plugins/gitblame.lua b/.config/nvim/lua/plugins/gitblame.lua new file mode 100644 index 00000000..0179bed9 --- /dev/null +++ b/.config/nvim/lua/plugins/gitblame.lua @@ -0,0 +1,3 @@ +return { "f-person/git-blame.nvim", cmd = { "GitBlameToggle" }, opts = { + enabled = false, +} } diff --git a/.config/nvim/lua/plugins/harpoon.lua b/.config/nvim/lua/plugins/harpoon.lua new file mode 100644 index 00000000..882ee413 --- /dev/null +++ b/.config/nvim/lua/plugins/harpoon.lua @@ -0,0 +1,35 @@ +return { + "ThePrimeagen/harpoon", + config = function() + 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", "j", function() + ui.nav_file(1) + end) + vim.keymap.set("n", "k", function() + ui.nav_file(2) + end) + vim.keymap.set("n", "l", function() + ui.nav_file(3) + end) + vim.keymap.set("n", ";", function() + ui.nav_file(4) + end) + vim.keymap.set("n", "m", function() + ui.nav_file(5) + end) + vim.keymap.set("n", ",", function() + ui.nav_file(6) + end) + vim.keymap.set("n", ".", function() + ui.nav_file(7) + end) + vim.keymap.set("n", "/", function() + ui.nav_file(8) + end) + end, +} diff --git a/.config/nvim/lua/plugins/indentline.lua b/.config/nvim/lua/plugins/indentline.lua new file mode 100644 index 00000000..bf6642df --- /dev/null +++ b/.config/nvim/lua/plugins/indentline.lua @@ -0,0 +1,9 @@ +return { + "lukas-reineke/indent-blankline.nvim", + event = "BufRead", + config = function() + require("ibl").setup({ + indent = { char = "¦" }, + }) + end, +} diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua new file mode 100644 index 00000000..afddd9bc --- /dev/null +++ b/.config/nvim/lua/plugins/lsp.lua @@ -0,0 +1,107 @@ +local servers = { + "bashls", + "biome", + "clangd", + "cssls", + "dockerls", + "emmet_ls", + "eslint", + "gopls", + "jqls", + "lua_ls", + "pyright", + "quick_lint_js", + "rust_analyzer", + "stylelint_lsp", + "svelte", + "ts_ls", + "zls", +} + +return { + "neovim/nvim-lspconfig", + dependencies = { + "williamboman/mason.nvim", + "williamboman/mason-lspconfig.nvim", + "hrsh7th/nvim-cmp", + "hrsh7th/cmp-nvim-lsp", + "VonHeikemen/lsp-zero.nvim", + }, + event = { "BufReadPre", "BufNewFile" }, -- Load on opening files + config = function() + local lsp = require("lsp-zero") + local lspconfig = require("lspconfig") + local cmp = require("cmp") + + require("mason").setup() + require("mason-lspconfig").setup({ + ensure_installed = servers, + }) + + for _, server in ipairs(servers) do + lspconfig[server].setup({}) + end + + cmp.setup({ + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + }, + sources = cmp.config.sources({ + { name = "nvim_lsp" }, + { name = "luasnip" }, + { name = "buffer" }, + { name = "path" }, + { name = "vsnip" }, + }), + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.select_prev_item(), + [""] = cmp.mapping.select_next_item(), + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.abort(), + [""] = cmp.mapping.confirm({ select = true }), + }), + }) + + -- Floating error messages + vim.diagnostic.config({ + underline = true, + virtual_text = true, + float = { + source = "always", + focusable = false, + }, + }) + + -- Keybinding for diagnostics + vim.keymap.set("n", "e", "lua vim.diagnostic.open_float()") + + -- Vue TypeScript Setup + local vue_typescript_plugin = "/usr/lib/node_modules/@vue/language-server" + .. "/usr/lib/node_modules/@vue/typescript-plugin" + + lspconfig.tsserver.setup({ + init_options = { + plugins = { + { + name = "@vue/typescript-plugin", + location = vue_typescript_plugin, + languages = { "javascript", "typescript", "vue" }, + }, + }, + }, + filetypes = { + "javascript", + "javascriptreact", + "javascript.jsx", + "typescript", + "typescriptreact", + "typescript.tsx", + "vue", + }, + }) + lsp.setup() + end, +} diff --git a/.config/nvim/lua/plugins/lualine.lua b/.config/nvim/lua/plugins/lualine.lua new file mode 100644 index 00000000..43788b91 --- /dev/null +++ b/.config/nvim/lua/plugins/lualine.lua @@ -0,0 +1,23 @@ +local function show_codeium_status() + return "{…}" .. vim.fn["codeium#GetStatusString"]() +end + +return { + "nvim-lualine/lualine.nvim", + event = "VeryLazy", + opts = function() + return { + options = { theme = "nord" }, + sections = { + lualine_x = { + { + show_codeium_status, + cond = function() + return vim.bo.filetype ~= "TelescopePrompt" + end, + }, + }, + }, + } + end, +} diff --git a/.config/nvim/lua/plugins/markdownpreview.lua b/.config/nvim/lua/plugins/markdownpreview.lua new file mode 100644 index 00000000..8c713c8b --- /dev/null +++ b/.config/nvim/lua/plugins/markdownpreview.lua @@ -0,0 +1,11 @@ +return { + "iamcco/markdown-preview.nvim", + cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, + build = "cd app && npm install && git restore .", + -- or if you use yarn: (I have not checked this, I use npm) + -- build = "cd app && yarn install && git restore .", + init = function() + vim.g.mkdp_filetypes = { "markdown" } + end, + ft = { "markdown" }, +} diff --git a/.config/nvim/lua/plugins/nvimtree.lua b/.config/nvim/lua/plugins/nvimtree.lua new file mode 100644 index 00000000..7834152e --- /dev/null +++ b/.config/nvim/lua/plugins/nvimtree.lua @@ -0,0 +1,116 @@ +return { + "kyazdani42/nvim-tree.lua", + cmd = { "NvimTreeToggle" }, + config = function() + -- Nvim_Tree configuration: -- setup with all defaults + -- each of these are documented in `:help nvim-tree.OPTION_NAME` + require("nvim-tree").setup({ -- BEGIN_DEFAULT_OPTS + auto_reload_on_write = true, + disable_netrw = false, + -- hide_root_folder = false, + hijack_cursor = false, + hijack_netrw = true, + hijack_unnamed_buffer_when_opening = false, + open_on_tab = false, + sort_by = "name", + update_cwd = false, + view = { + width = 25, + -- height = 30, + side = "right", + preserve_window_proportions = true, + number = false, + relativenumber = false, + signcolumn = "yes", + -- mappings = { + -- custom_only = false, + -- list = { + -- user mappings go here + -- }, + -- }, + }, + renderer = { + indent_markers = { + enable = false, + icons = { + corner = "└ ", + edge = "│ ", + none = " ", + }, + }, + icons = { + webdev_colors = true, + }, + }, + hijack_directories = { + enable = true, + auto_open = true, + }, + update_focused_file = { + enable = false, + update_cwd = false, + ignore_list = {}, + }, + system_open = { + cmd = nil, + args = {}, + }, + diagnostics = { + enable = false, + show_on_dirs = false, + icons = { + hint = "", + info = "", + warning = "", + error = "", + }, + }, + filters = { + dotfiles = false, + custom = {}, + exclude = {}, + }, + git = { + enable = true, + ignore = true, + timeout = 400, + }, + actions = { + use_system_clipboard = true, + change_dir = { + enable = true, + global = false, + restrict_above_cwd = false, + }, + open_file = { + quit_on_open = false, + resize_window = false, + window_picker = { + enable = true, + chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890", + exclude = { + filetype = { "notify", "packer", "qf", "diff", "fugitive", "fugitiveblame" }, + buftype = { "nofile", "terminal", "help" }, + }, + }, + }, + }, + trash = { + cmd = "trash", + require_confirm = true, + }, + log = { + enable = false, + truncate = false, + types = { + all = false, + config = false, + copy_paste = false, + diagnostics = false, + git = false, + profile = false, + }, + }, + }) -- END_DEFAULT_OPTS for Nvim_Tree + end, +} diff --git a/.config/nvim/lua/plugins/ripgrep.lua b/.config/nvim/lua/plugins/ripgrep.lua new file mode 100644 index 00000000..16fe6552 --- /dev/null +++ b/.config/nvim/lua/plugins/ripgrep.lua @@ -0,0 +1,16 @@ +return { + "rinx/nvim-ripgrep", + config = function() + require("nvim-ripgrep").setup({ + runner = require("nvim-ripgrep.run").ripgrep, -- grep command + prompt = "❯ ", -- prompt + window = { + width = 0.8, + border = "rounded", + }, + open_qf_fn = function() + return vim.api.nvim_command("copen") + end, + }) + end, +} diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua new file mode 100644 index 00000000..c3ad7c3a --- /dev/null +++ b/.config/nvim/lua/plugins/telescope.lua @@ -0,0 +1,16 @@ +return { + "nvim-telescope/telescope.nvim", + tag = "0.1.0", + config = function() + require("telescope").setup({ + extensions = { + undo = { + layout_strategy = "vertical", + layout_config = { + preview_height = 0.8, + }, + }, + }, + }) + end, +} diff --git a/.config/nvim/lua/plugins/treesitter.lua b/.config/nvim/lua/plugins/treesitter.lua new file mode 100644 index 00000000..d7f9d3f8 --- /dev/null +++ b/.config/nvim/lua/plugins/treesitter.lua @@ -0,0 +1,64 @@ +return { + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + event = "BufReadPost", + config = function() + vim.treesitter.query.set("javascript", "injections", "") + vim.treesitter.query.set("typescript", "injections", "") + vim.treesitter.query.set("tsx", "injections", "") + vim.treesitter.query.set("lua", "injections", "") + require("nvim-treesitter.configs").setup({ + -- A list of parser names, or "all" + ensure_installed = { + "bash", + "c", + "c_sharp", + "cmake", + "cpp", + "css", + "dockerfile", + "go", + "html", + "http", + "java", + "javascript", + "json", + "json5", + "jsonc", + "lua", + "make", + "perl", + "php", + "pug", + "python", + "ruby", + "toml", + "tsx", + "typescript", + "rust", + "vim", + "vue", + "yaml", + "zig", + }, + + -- 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, + }, + }) + end, +}