Browse Source

init

init
scorpio 9 months ago
commit
725c64c7db

+ 15 - 0
init.lua

@@ -0,0 +1,15 @@
+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",
+		lazypath,
+	})
+end
+vim.opt.rtp:prepend(lazypath)
+require("vim-options")
+require("keymaps")
+require("lazy").setup("plugins")

+ 9 - 0
keymaps.lua

@@ -0,0 +1,9 @@
+local function map(mode, lhs, rhs, opts)
+    local options = { noremap = true, silent = true }
+    if opts then
+        options = vim.tbl_extend('force', options, opts)
+    end
+    vim.api.nvim_set_keymap(mode, lhs, rhs, options)
+end
+
+map("n", "<leader>gt", ":LazyGit<CR>", { desc = "Lazygit" })

+ 20 - 0
lazy-lock.json

@@ -0,0 +1,20 @@
+{
+  "LazyVim": { "branch": "main", "commit": "879e29504d43e9f178d967ecc34d482f902e5a91" },
+  "catppuccin": { "branch": "main", "commit": "079500a625f3ae5aa6efb758f1a17fe4c7a57e52" },
+  "dashboard-nvim": { "branch": "master", "commit": "63df28409d940f9cac0a925df09d3dc369db9841" },
+  "gruvbox.nvim": { "branch": "main", "commit": "0940564208a490c173216c3b7d2188b0a5ad3491" },
+  "indent-blankline.nvim": { "branch": "master", "commit": "ceaf730b13e332cd76600d9795722413c236c684" },
+  "lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" },
+  "lualine.nvim": { "branch": "master", "commit": "2248ef254d0a1488a72041cfb45ca9caada6d994" },
+  "mini.indentscope": { "branch": "main", "commit": "dc26fa1a6c8976f42930c9f53da88d3d441bb13f" },
+  "neo-tree.nvim": { "branch": "v3.x", "commit": "230ff118613fa07138ba579b89d13ec2201530b9" },
+  "noice.nvim": { "branch": "main", "commit": "6c87c1d11c38180fb72bf8f45518a0a3e081afc1" },
+  "nui.nvim": { "branch": "main", "commit": "698e75814cd7c56b0dd8af4936bcef2d13807f3c" },
+  "nvim-notify": { "branch": "master", "commit": "f3024b912073774111202f5fa6518b0cd2a74432" },
+  "nvim-treesitter": { "branch": "master", "commit": "a76db88548bb7fe008cd7e4f2d2ec2ccc080dede" },
+  "nvim-web-devicons": { "branch": "master", "commit": "2a125024a137677930efcfdf720f205504c97268" },
+  "plenary.nvim": { "branch": "master", "commit": "52544825d6b8be677eb395983515ad5e30ae1f2e" },
+  "telescope.nvim": { "branch": "master", "commit": "6d3fbffe426794296a77bb0b37b6ae0f4f14f807" },
+  "vim-floaterm": { "branch": "master", "commit": "3f01a623376957437f9376327637491b74719e38" },
+  "which-key.nvim": { "branch": "main", "commit": "e271c28118998c93a14d189af3395812a1aa646c" }
+}

+ 9 - 0
lazyvim.json

@@ -0,0 +1,9 @@
+{
+  "extras": [
+
+  ],
+  "news": {
+    "NEWS.md": "2123"
+  },
+  "version": 2
+}

+ 1 - 0
lua/plugins.lua

@@ -0,0 +1 @@
+return {}

+ 12 - 0
lua/plugins/catppuccin.lua

@@ -0,0 +1,12 @@
+return {
+  {
+    "catppuccin/nvim",
+    lazy = false,
+    name = "catppuccin",
+    priority = 1000,
+    config = function()
+      vim.cmd.colorscheme "catppuccin"
+    end
+  }
+}
+

+ 12 - 0
lua/plugins/colorscheme.lua

@@ -0,0 +1,12 @@
+return {
+  -- add gruvbox
+  { "ellisonleao/gruvbox.nvim" },
+
+  -- Configure LazyVim to load gruvbox
+  {
+    "LazyVim/LazyVim",
+    opts = {
+      colorscheme = "gruvbox",
+    },
+  }
+}

+ 51 - 0
lua/plugins/dashboard.lua

@@ -0,0 +1,51 @@
+return {
+  'nvimdev/dashboard-nvim',
+  event = 'VimEnter',
+  config = function()
+    require('dashboard').setup {
+      -- config
+      theme = 'doom',
+      config = {
+        header = { [[]], [[]], [[]], [[]], [[]], [[]], [[]], [[]],
+          [[          ▀████▀▄▄              ▄█ ]],
+          [[            █▀    ▀▀▄▄▄▄▄    ▄▄▀▀█ ]],
+          [[    ▄        █          ▀▀▀▀▄  ▄▀  ]],
+          [[   ▄▀ ▀▄      ▀▄              ▀▄▀  ]],
+          [[  ▄▀    █     █▀   ▄█▀▄      ▄█    ]],
+          [[  ▀▄     ▀▄  █     ▀██▀     ██▄█   ]],
+          [[   ▀▄    ▄▀ █   ▄██▄   ▄  ▄  ▀▀ █  ]],
+          [[    █  ▄▀  █    ▀██▀    ▀▀ ▀▀  ▄▀  ]],
+          [[   █   █  █      ▄▄           ▄▀   ]], [[]], [[]], [[]], [[]], [[]], [[]], [[]], [[]] }, -- your header
+        center = { {
+          icon = " ",
+          icon_hl = 'Title',
+          desc = 'Find File           ',
+          desc_hl = 'String',
+          key = 'f',
+          keymap = 'SPC f',
+          key_hl = 'Number',
+        }, {
+          icon = ' ',
+          desc = 'Find Word',
+          key = 'k',
+          keymap = 'SPC k',
+        }, {
+          icon = ' ',
+          desc = 'Project',
+          key = 'p',
+          keymap = 'SPC p',
+        }, {
+          icon = '󰚰 ',
+          desc = 'Plugins Update',
+          key = 'u',
+          name = "DsStore",
+          keymap = 'SPC u',
+        } } -- your footer
+      }
+    }
+  end,
+  dependencies = { { 'nvim-tree/nvim-web-devicons' } },
+  config = function()
+    vim.keymap.set("n", "<leader>hh", ":Dashboard<CR>", {})
+  end
+}

+ 8 - 0
lua/plugins/floaterm.lua

@@ -0,0 +1,8 @@
+return {
+    {
+        "voldikss/vim-floaterm",
+        config = function()
+            vim.keymap.set("n", "<leader>t", ":FloatermToggle<CR>", {})
+        end
+    }
+}

+ 25 - 0
lua/plugins/indent-blankline.lua

@@ -0,0 +1,25 @@
+return {
+  "lukas-reineke/indent-blankline.nvim",
+  opts = {
+    indent = {
+      char = "│",
+      tab_char = "│",
+    },
+    scope = { enabled = false },
+    exclude = {
+      filetypes = {
+        "help",
+        "alpha",
+        "dashboard",
+        "neo-tree",
+        "Trouble",
+        "trouble",
+        "lazy",
+        "mason",
+        "notify",
+        "toggleterm",
+        "lazyterm",
+      },
+    },
+  }
+}

+ 8 - 0
lua/plugins/lazygit.lua

@@ -0,0 +1,8 @@
+return
+{
+    "kdheepak/lazygit.nvim",
+    -- optional for floating window border decoration
+    dependencies = {
+        "nvim-lua/plenary.nvim",
+    },
+}

+ 10 - 0
lua/plugins/lualine.lua

@@ -0,0 +1,10 @@
+return {
+  "nvim-lualine/lualine.nvim",
+  config = function()
+    require("lualine").setup({
+      options = {
+        theme = 'catppuccin'
+      }
+    })
+  end
+}

+ 29 - 0
lua/plugins/mini-indentscope.lua

@@ -0,0 +1,29 @@
+return {
+  "echasnovski/mini.indentscope",
+  version = false, -- wait till new 0.7.0 release to put it back on semver
+  opts = {
+    -- symbol = "▏",
+    symbol = "│",
+    options = { try_as_border = true },
+  },
+  init = function()
+    vim.api.nvim_create_autocmd("FileType", {
+      pattern = {
+        "help",
+        "alpha",
+        "dashboard",
+        "neo-tree",
+        "Trouble",
+        "trouble",
+        "lazy",
+        "mason",
+        "notify",
+        "toggleterm",
+        "lazyterm",
+      },
+      callback = function()
+        vim.b.miniindentscope_disable = true
+      end,
+    })
+  end,
+}

+ 13 - 0
lua/plugins/neo-tree.lua

@@ -0,0 +1,13 @@
+return {
+  "nvim-neo-tree/neo-tree.nvim",
+  branch = "v3.x",
+  dependencies = {
+    "nvim-lua/plenary.nvim",
+    "nvim-tree/nvim-web-devicons",
+    "MunifTanjim/nui.nvim",
+  },
+  config = function()
+    vim.keymap.set('n', '<C-n>', ':Neotree filesystem reveal left<CR>', {})
+    vim.keymap.set('n', '<leader>bf', ':Neotree buffers reveal float<CR>', {})
+  end
+}

+ 42 - 0
lua/plugins/noice.lua

@@ -0,0 +1,42 @@
+return {
+  "folke/noice.nvim",
+  event = "VeryLazy",
+  opts = {
+    lsp = {
+      override = {
+        ["vim.lsp.util.convert_input_to_markdown_lines"] = true,
+        ["vim.lsp.util.stylize_markdown"] = true,
+        ["cmp.entry.get_documentation"] = true,
+      },
+    },
+    routes = {
+      {
+        filter = {
+          event = "msg_show",
+          any = {
+            { find = "%d+L, %d+B" },
+            { find = "; after #%d+" },
+            { find = "; before #%d+" },
+          },
+        },
+        view = "mini",
+      },
+    },
+    presets = {
+      bottom_search = true,
+      command_palette = true,
+      long_message_to_split = true,
+      inc_rename = true,
+    },
+  },
+  -- stylua: ignore
+  keys = {
+    { "<S-Enter>", function() require("noice").redirect(vim.fn.getcmdline()) end, mode = "c", desc = "Redirect Cmdline" },
+    { "<leader>snl", function() require("noice").cmd("last") end, desc = "Noice Last Message" },
+    { "<leader>snh", function() require("noice").cmd("history") end, desc = "Noice History" },
+    { "<leader>sna", function() require("noice").cmd("all") end, desc = "Noice All" },
+    { "<leader>snd", function() require("noice").cmd("dismiss") end, desc = "Dismiss All" },
+    { "<c-f>", function() if not require("noice.lsp").scroll(4) then return "<c-f>" end end, silent = true, expr = true, desc = "Scroll forward", mode = {"i", "n", "s"} },
+    { "<c-b>", function() if not require("noice.lsp").scroll(-4) then return "<c-b>" end end, silent = true, expr = true, desc = "Scroll backward", mode = {"i", "n", "s"}},
+  },
+}

+ 24 - 0
lua/plugins/nvim-notify.lua

@@ -0,0 +1,24 @@
+return {
+  "rcarriga/nvim-notify",
+  keys = {
+    {
+      "<leader>un",
+      function()
+        require("notify").dismiss({ silent = true, pending = true })
+      end,
+      desc = "Dismiss all Notifications",
+    },
+  },
+  opts = {
+    timeout = 3000,
+    max_height = function()
+      return math.floor(vim.o.lines * 0.75)
+    end,
+    max_width = function()
+      return math.floor(vim.o.columns * 0.75)
+    end,
+    on_open = function(win)
+      vim.api.nvim_win_set_config(win, { zindex = 100 })
+    end,
+  }
+}

+ 1 - 0
lua/plugins/nvim-web-devicons.lua

@@ -0,0 +1 @@
+return { "nvim-tree/nvim-web-devicons", lazy = true }

+ 12 - 0
lua/plugins/telescope.lua

@@ -0,0 +1,12 @@
+return {
+  {
+    'nvim-telescope/telescope.nvim',
+    tag = '0.1.5',
+    dependencies = { 'nvim-lua/plenary.nvim' },
+    config = function()
+      local builtin = require("telescope.builtin")
+      vim.keymap.set('n', '<leader>f', builtin.find_files, {})
+      vim.keymap.set('n', '<leader>fg', builtin.live_grep, {})
+    end
+  },
+}

+ 14 - 0
lua/plugins/treesitter.lua

@@ -0,0 +1,14 @@
+return {
+  {
+    "nvim-treesitter/nvim-treesitter",
+    build = ":TSUpdate",
+    config = function()
+      local config = require("nvim-treesitter.configs")
+      config.setup({
+        ensure_installed = { "lua", "javascript" },
+        highlight = { enable = true },
+        indent = { enable = true }
+      })
+    end
+  }
+}

+ 30 - 0
lua/plugins/whick-key.lua

@@ -0,0 +1,30 @@
+return {
+  "folke/which-key.nvim",
+  event = "VeryLazy",
+  opts = {
+    plugins = { spelling = true },
+    defaults = {
+      mode = { "n", "v" },
+      ["g"] = { name = "+goto" },
+      ["gs"] = { name = "+surround" },
+      ["]"] = { name = "+next" },
+      ["["] = { name = "+prev" },
+      ["<leader><tab>"] = { name = "+tabs" },
+      ["<leader>b"] = { name = "+buffer" },
+      ["<leader>c"] = { name = "+code" },
+      ["<leader>f"] = { name = "+file/find" },
+      ["<leader>g"] = { name = "+git" },
+      ["<leader>gh"] = { name = "+hunks" },
+      ["<leader>q"] = { name = "+quit/session" },
+      ["<leader>s"] = { name = "+search" },
+      ["<leader>u"] = { name = "+ui" },
+      ["<leader>w"] = { name = "+windows" },
+      ["<leader>x"] = { name = "+diagnostics/quickfix" },
+    },
+  },
+  config = function(_, opts)
+    local wk = require("which-key")
+    wk.setup(opts)
+    wk.register(opts.defaults)
+  end,
+}

+ 6 - 0
lua/vim-options.lua

@@ -0,0 +1,6 @@
+vim.cmd("set expandtab")
+vim.cmd("set tabstop=2")
+vim.cmd("set number")
+vim.cmd("set softtabstop=2")
+vim.cmd("set shiftwidth=2")
+vim.g.mapleader = " "