From 867a86f153624cab8c0c8ea2d9575ed90a2614b7 Mon Sep 17 00:00:00 2001
From: liv <shadows_withal@fastmail.com>
Date: Mon, 26 Feb 2024 13:39:06 +0100
Subject: [PATCH] update nvim config to use lazynvim

---
 .chezmoiignore                             |   1 +
 dot_config/fish/config.fish                |   1 +
 dot_config/nvim/README.md                  |   4 +
 dot_config/nvim/dot_neoconf.json           |  15 ++
 dot_config/nvim/init.lua                   |  11 +-
 dot_config/nvim/lazyvim.json               |  12 +
 dot_config/nvim/lua/config/autocmds.lua    |   3 +
 dot_config/nvim/lua/config/keymaps.lua     |   3 +
 dot_config/nvim/lua/config/lazy.lua        |  46 ++++
 dot_config/nvim/lua/config/options.lua     |  11 +
 dot_config/nvim/lua/keybinds.lua           |  52 ----
 dot_config/nvim/lua/options.lua            |  41 ----
 dot_config/nvim/lua/plugins.lua            |  80 -------
 dot_config/nvim/lua/plugins/completion.lua |  37 ---
 dot_config/nvim/lua/plugins/example.lua    | 265 +++++++++++++++++++++
 dot_config/nvim/lua/plugins/lsp.lua        |  42 ----
 dot_config/nvim/lua/utils.lua              |  12 -
 dot_config/nvim/stylua.toml                |   3 +
 18 files changed, 366 insertions(+), 273 deletions(-)
 create mode 100644 dot_config/nvim/README.md
 create mode 100644 dot_config/nvim/dot_neoconf.json
 create mode 100644 dot_config/nvim/lazyvim.json
 create mode 100644 dot_config/nvim/lua/config/autocmds.lua
 create mode 100644 dot_config/nvim/lua/config/keymaps.lua
 create mode 100644 dot_config/nvim/lua/config/lazy.lua
 create mode 100644 dot_config/nvim/lua/config/options.lua
 delete mode 100644 dot_config/nvim/lua/keybinds.lua
 delete mode 100644 dot_config/nvim/lua/options.lua
 delete mode 100644 dot_config/nvim/lua/plugins.lua
 delete mode 100644 dot_config/nvim/lua/plugins/completion.lua
 create mode 100644 dot_config/nvim/lua/plugins/example.lua
 delete mode 100644 dot_config/nvim/lua/plugins/lsp.lua
 delete mode 100644 dot_config/nvim/lua/utils.lua
 create mode 100644 dot_config/nvim/stylua.toml

diff --git a/.chezmoiignore b/.chezmoiignore
index b5b290b..84e4977 100644
--- a/.chezmoiignore
+++ b/.chezmoiignore
@@ -5,3 +5,4 @@ misc/
 dot_config/doom/init.el
 dot_config/doom/config.el
 dot_config/doom/packages.el
+dot_config/nvim/lazy-lock.json
diff --git a/dot_config/fish/config.fish b/dot_config/fish/config.fish
index 384e8ad..00dcc0f 100644
--- a/dot_config/fish/config.fish
+++ b/dot_config/fish/config.fish
@@ -25,6 +25,7 @@ setpath ~/.pyenv/shims
 setpath ~/.cargo/bin
 setpath ~/.local/bin
 setpath ~/.local/bin/elixir-ls
+setpath ~/.rye/shims
 # Both of these work now apparently?
 setpath ~/.emacs.d/bin
 setpath ~/.config/emacs/bin
diff --git a/dot_config/nvim/README.md b/dot_config/nvim/README.md
new file mode 100644
index 0000000..185280b
--- /dev/null
+++ b/dot_config/nvim/README.md
@@ -0,0 +1,4 @@
+# 💤 LazyVim
+
+A starter template for [LazyVim](https://github.com/LazyVim/LazyVim).
+Refer to the [documentation](https://lazyvim.github.io/installation) to get started.
diff --git a/dot_config/nvim/dot_neoconf.json b/dot_config/nvim/dot_neoconf.json
new file mode 100644
index 0000000..7c48087
--- /dev/null
+++ b/dot_config/nvim/dot_neoconf.json
@@ -0,0 +1,15 @@
+{
+  "neodev": {
+    "library": {
+      "enabled": true,
+      "plugins": true
+    }
+  },
+  "neoconf": {
+    "plugins": {
+      "lua_ls": {
+        "enabled": true
+      }
+    }
+  }
+}
diff --git a/dot_config/nvim/init.lua b/dot_config/nvim/init.lua
index 357165c..2514f9e 100644
--- a/dot_config/nvim/init.lua
+++ b/dot_config/nvim/init.lua
@@ -1,9 +1,2 @@
--- Load all required files
-
-require("options")
-require("utils")
-require("plugins")
-require("keybinds")
-
--- Load our color scheme
-vim.cmd("colorscheme base16-eighties")
+-- bootstrap lazy.nvim, LazyVim and your plugins
+require("config.lazy")
diff --git a/dot_config/nvim/lazyvim.json b/dot_config/nvim/lazyvim.json
new file mode 100644
index 0000000..e42209f
--- /dev/null
+++ b/dot_config/nvim/lazyvim.json
@@ -0,0 +1,12 @@
+{
+  "extras": [
+    "lazyvim.plugins.extras.coding.yanky",
+    "lazyvim.plugins.extras.editor.aerial",
+    "lazyvim.plugins.extras.editor.leap",
+    "lazyvim.plugins.extras.util.project"
+  ],
+  "news": {
+    "NEWS.md": "2123"
+  },
+  "version": 2
+}
\ No newline at end of file
diff --git a/dot_config/nvim/lua/config/autocmds.lua b/dot_config/nvim/lua/config/autocmds.lua
new file mode 100644
index 0000000..27e9e06
--- /dev/null
+++ b/dot_config/nvim/lua/config/autocmds.lua
@@ -0,0 +1,3 @@
+-- Autocmds are automatically loaded on the VeryLazy event
+-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua
+-- Add any additional autocmds here
diff --git a/dot_config/nvim/lua/config/keymaps.lua b/dot_config/nvim/lua/config/keymaps.lua
new file mode 100644
index 0000000..2c134f7
--- /dev/null
+++ b/dot_config/nvim/lua/config/keymaps.lua
@@ -0,0 +1,3 @@
+-- Keymaps are automatically loaded on the VeryLazy event
+-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
+-- Add any additional keymaps here
diff --git a/dot_config/nvim/lua/config/lazy.lua b/dot_config/nvim/lua/config/lazy.lua
new file mode 100644
index 0000000..891b190
--- /dev/null
+++ b/dot_config/nvim/lua/config/lazy.lua
@@ -0,0 +1,46 @@
+local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
+if not vim.loop.fs_stat(lazypath) then
+  -- bootstrap lazy.nvim
+  -- stylua: ignore
+  vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath })
+end
+vim.opt.rtp:prepend(vim.env.LAZY or lazypath)
+
+require("lazy").setup({
+  spec = {
+    -- add LazyVim and import its plugins
+    { "LazyVim/LazyVim", import = "lazyvim.plugins" },
+    -- import any extras modules here
+    -- { import = "lazyvim.plugins.extras.lang.typescript" },
+    -- { import = "lazyvim.plugins.extras.lang.json" },
+    -- { import = "lazyvim.plugins.extras.ui.mini-animate" },
+    -- import/override with your plugins
+    { import = "plugins" },
+  },
+  defaults = {
+    -- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
+    -- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.
+    lazy = false,
+    -- It's recommended to leave version=false for now, since a lot the plugin that support versioning,
+    -- have outdated releases, which may break your Neovim install.
+    version = false, -- always use the latest git commit
+    -- version = "*", -- try installing the latest stable version for plugins that support semver
+  },
+  install = { colorscheme = { "tokyonight", "habamax" } },
+  checker = { enabled = true }, -- automatically check for plugin updates
+  performance = {
+    rtp = {
+      -- disable some rtp plugins
+      disabled_plugins = {
+        "gzip",
+        -- "matchit",
+        -- "matchparen",
+        -- "netrwPlugin",
+        "tarPlugin",
+        "tohtml",
+        "tutor",
+        "zipPlugin",
+      },
+    },
+  },
+})
diff --git a/dot_config/nvim/lua/config/options.lua b/dot_config/nvim/lua/config/options.lua
new file mode 100644
index 0000000..9e53f28
--- /dev/null
+++ b/dot_config/nvim/lua/config/options.lua
@@ -0,0 +1,11 @@
+-- Options are automatically loaded before lazy.nvim startup
+-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua
+-- Add any additional options her
+
+-- Disable relative line numbers
+vim.o.relativenumber = false
+
+if vim.g.neovide then
+  -- Reduce neovide scroll animation length
+  vim.g.neovide_scroll_animation_length = 0.1
+end
diff --git a/dot_config/nvim/lua/keybinds.lua b/dot_config/nvim/lua/keybinds.lua
deleted file mode 100644
index 8a82162..0000000
--- a/dot_config/nvim/lua/keybinds.lua
+++ /dev/null
@@ -1,52 +0,0 @@
-vim.g.mapleader = " "
-vim.g.maplocalleader = " "
-vim.g.which_key_use_floating_win = 1
-vim.g.which_key_timeout = 300
-
-local wk = require("whichkey_setup")
-
-local leader_keymap = {
-  ["<space>"] = {"<cmd>Telescope find_files<CR>", "Find file"},
-  ["<tab><tab>"] = {"<cmd>b#<CR>", "Goto other buffer"},
-  ["<CR>"] = {"<cmd>Pounce<CR>", "Pounce"},
-  b = {
-    name = "+buffers",
-    b = {"<cmd>Telescope buffers<CR>", "List buffers"},
-    d = {"<cmd>bd<CR>", "Delete buffer"}
-  },
-  w = {
-    name = "+window",
-    v = {"<cmd>vsplit<CR>", "Split vertically"},
-    s = {"<cmd>split<CR>", "Split horizontally"},
-    q = {"<cmd>x<CR>", "Close window"}, -- No unsaved windows!!
-    h = {"<cmd>wincmd h<CR>", "Left"},
-    j = {"<cmd>wincmd j<CR>", "Down"},
-    k = {"<cmd>wincmd k<CR>", "Up"},
-    l = {"<cmd>wincmd l<CR>", "Right"},
-    H = {"<C-w>H", "Move Left"},
-    J = {"<C-w>J", "Move Down"},
-    K = {"<C-w>K", "Move Up"},
-    L = {"<C-w>L", "Move Right"},
-  },
-  l = {
-    name = "+lsp",
-    e = {"<cmd>lua vim.diagnostic.open_float()<CR>", "Show diagnostic at point"},
-    h = {"<cmd>lua vim.diagnostic.goto_prev()<CR>", "Goto prev diagnostic"},
-    l = {"<cmd>lua vim.diagnostic.goto_next()<CR>", "Goto next diagnostic"},
-    q = {"<cmd>Telescope diagnostics<CR>", "Show all diagnostics"},
-    a = {"<cmd>lua vim.lsp.add_workspace_folder()<CR>", "Add folder to workspace"},
-    r = {"<cmd>lua vim.lsp.remove_workspace_folder()<CR>", "Remove folder from workspace"},
-    R = {"<cmd>Telescope lsp_references<CR>", "List references"},
-    s = {"<cmd>Telescope lsp_document_symbols<CR>", "List document symbols"},
-    S = {"<cmd>Telescope lsp_workspace_symbols<CR>", "List workspace symbols"},
-    d = {"<cmd>Telescope lsp_definitions<CR>", "Goto definition"},
-  },
-  g = {
-    name = "+git",
-    s = {"<cmd>Telescope git_status<CR>", "Status"},
-    g = {"<cmd>Neogit<CR>", "Neogit"},
-    c = {"<cmd>Neogit commit<CR>", "Commit"},
-  },
-}
-
-wk.register_keymap("leader", leader_keymap)
diff --git a/dot_config/nvim/lua/options.lua b/dot_config/nvim/lua/options.lua
deleted file mode 100644
index fb32961..0000000
--- a/dot_config/nvim/lua/options.lua
+++ /dev/null
@@ -1,41 +0,0 @@
--- Visual
-vim.o.conceallevel = 0
-vim.o.cmdheight = 1
-vim.o.pumheight = 10
-vim.o.showmode = false
-vim.o.title = true
-vim.o.termguicolors = true
-vim.wo.number = true
-vim.wo.signcolumn = "yes"
-
--- Behaviour
-vim.o.hlsearch = true
-vim.o.ignorecase = true
-vim.o.smartcase = true
-vim.o.smarttab = true
-vim.o.smartindent = true
-vim.o.expandtab = true
-vim.o.tabstop = 2
-vim.o.softtabstop = 2
-vim.o.shiftwidth = 2
-vim.o.splitbelow = true
-vim.o.splitright = true
-vim.o.scrolloff = 12
-vim.o.sidescrolloff = 8
-vim.o.mouse = "a"
-
--- Vim specific
-vim.o.hidden = true
-vim.o.fileencoding = "utf-8"
-vim.o.spell = false
-vim.o.completeopt = "menuone,noinsert,noselect"
-vim.o.wildmode = "longest,full"
-vim.o.updatetime = 300
-
--- Disable inline error messages
-vim.diagnostic.config {
-  virtual_text = false,
-  underline = false,
-  signs = true,
-}
-
diff --git a/dot_config/nvim/lua/plugins.lua b/dot_config/nvim/lua/plugins.lua
deleted file mode 100644
index 78b6132..0000000
--- a/dot_config/nvim/lua/plugins.lua
+++ /dev/null
@@ -1,80 +0,0 @@
--- Plugin definitions and loading
-local cmd = vim.cmd
-
--- Rerun packer install when this file changes
-cmd([[
-  augroup packer_user_config
-    autocmd!
-    autocmd BufWritePost plugins.lua source <afile> | PackerCompile
-  augroup end
-]])
-
--- Load packer
-cmd([[packadd packer.nvim]])
-
--- Get plugins
-return require("packer").startup(function(use)
-  -- Dogfood packer
-  use({"wbthomason/packer.nvim", opt = true})
-
-  -- Dependencies
-  use "nvim-lua/plenary.nvim"
-
-  -- LSP stuff
-  use({"neovim/nvim-lspconfig", config = function() require("plugins.lsp") end})
-  use({"simrat39/rust-tools.nvim", config = function()
-    require("rust-tools").setup({})
-  end})
-  use({"j-hui/fidget.nvim", config = function()
-    require("fidget").setup({})
-  end})
-
-  -- Completion
-  use "hrsh7th/cmp-nvim-lsp"
-  use "hrsh7th/cmp-buffer"
-  use "hrsh7th/cmp-path"
-  use "hrsh7th/cmp-cmdline"
-  use({"hrsh7th/nvim-cmp", config = function() require("plugins.completion") end})
-
-  -- Text editing
-  use "tpope/vim-surround"
-  use "Raimondi/delimitMate"
-  use "rlane/pounce.nvim"
-
-  -- Fancy UI stuff
-  use "RRethy/nvim-base16"
-  use "stevearc/dressing.nvim"
-  use({"lewis6991/gitsigns.nvim", config = function() require("gitsigns").setup() end})
-  use({"nvim-lualine/lualine.nvim", config = function()
-    require("lualine").setup({
-      options = {
-        icons_enabled = false,
-      },
-      sections = {
-        lualine_x = {"filetype"},
-      },
-    })
-  end})
-  use({"kdheepak/tabline.nvim", config = function()
-    require("tabline").setup({
-      options = {
-        show_devicons = false,
-        modified_icon = "#",
-      },
-    })
-  end})
-
-  -- Keybinds
-  use({
-    "AckslD/nvim-whichkey-setup.lua",
-    requires = {"liuchengxu/vim-which-key"}
-  })
-
-  -- File interaction
-  use({"nvim-telescope/telescope.nvim", config = function () end})
-  use({"TimUntersberger/neogit", config = function () require("neogit").setup({}) end})
-
-  -- Lang support
-  use({"khaveesh/vim-fish-syntax"})
-end)
-
diff --git a/dot_config/nvim/lua/plugins/completion.lua b/dot_config/nvim/lua/plugins/completion.lua
deleted file mode 100644
index 93688fb..0000000
--- a/dot_config/nvim/lua/plugins/completion.lua
+++ /dev/null
@@ -1,37 +0,0 @@
-local cmp = require("cmp")
-
-cmp.setup({
-  mapping = {
-    ["<C-b>"] = cmp.mapping(cmp.mapping.scroll_docs(-4), {"i", "c"}),
-    ['<C-f>'] = cmp.mapping(cmp.mapping.scroll_docs(4), { 'i', 'c' }),
-    ['<C-Space>'] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }),
-    ['<C-y>'] = cmp.config.disable, -- Specify `cmp.config.disable` if you want to remove the default `<C-y>` mapping.
-    ['<C-e>'] = cmp.mapping({
-      i = cmp.mapping.abort(),
-      c = cmp.mapping.close(),
-    }),
-    ['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
-  },
-  sources = cmp.config.sources({
-    {name = "nvim_lsp"},
-  }, {
-    {name = "buffer"},
-  }),
-})
-
-cmp.setup.cmdline(":", {
-  sources = cmp.config.sources({
-    {name = "path"},
-  }, {
-    {name = "buffer"},
-  }),
-})
-
--- Setup lspconfig.
-local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())
-local lsps = {"sumneko_lua", "rust_analyzer"}
-for _, lsp in pairs(lsps) do
-  require('lspconfig')[lsp].setup {
-    capabilities = capabilities
-  }
-end
diff --git a/dot_config/nvim/lua/plugins/example.lua b/dot_config/nvim/lua/plugins/example.lua
new file mode 100644
index 0000000..6859c0e
--- /dev/null
+++ b/dot_config/nvim/lua/plugins/example.lua
@@ -0,0 +1,265 @@
+-- since this is just an example spec, don't actually load anything here and return an empty spec
+-- stylua: ignore
+if true then return {} end
+
+-- every spec file under the "plugins" directory will be loaded automatically by lazy.nvim
+--
+-- In your plugin files, you can:
+-- * add extra plugins
+-- * disable/enabled LazyVim plugins
+-- * override the configuration of LazyVim plugins
+return {
+  -- add gruvbox
+  { "ellisonleao/gruvbox.nvim" },
+
+  -- Configure LazyVim to load gruvbox
+  {
+    "LazyVim/LazyVim",
+    opts = {
+      colorscheme = "gruvbox",
+    },
+  },
+
+  -- change trouble config
+  {
+    "folke/trouble.nvim",
+    -- opts will be merged with the parent spec
+    opts = { use_diagnostic_signs = true },
+  },
+
+  -- disable trouble
+  { "folke/trouble.nvim", enabled = false },
+
+  -- add symbols-outline
+  {
+    "simrat39/symbols-outline.nvim",
+    cmd = "SymbolsOutline",
+    keys = { { "<leader>cs", "<cmd>SymbolsOutline<cr>", desc = "Symbols Outline" } },
+    config = true,
+  },
+
+  -- override nvim-cmp and add cmp-emoji
+  {
+    "hrsh7th/nvim-cmp",
+    dependencies = { "hrsh7th/cmp-emoji" },
+    ---@param opts cmp.ConfigSchema
+    opts = function(_, opts)
+      table.insert(opts.sources, { name = "emoji" })
+    end,
+  },
+
+  -- change some telescope options and a keymap to browse plugin files
+  {
+    "nvim-telescope/telescope.nvim",
+    keys = {
+      -- add a keymap to browse plugin files
+      -- stylua: ignore
+      {
+        "<leader>fp",
+        function() require("telescope.builtin").find_files({ cwd = require("lazy.core.config").options.root }) end,
+        desc = "Find Plugin File",
+      },
+    },
+    -- change some options
+    opts = {
+      defaults = {
+        layout_strategy = "horizontal",
+        layout_config = { prompt_position = "top" },
+        sorting_strategy = "ascending",
+        winblend = 0,
+      },
+    },
+  },
+
+  -- add telescope-fzf-native
+  {
+    "telescope.nvim",
+    dependencies = {
+      "nvim-telescope/telescope-fzf-native.nvim",
+      build = "make",
+      config = function()
+        require("telescope").load_extension("fzf")
+      end,
+    },
+  },
+
+  -- add pyright to lspconfig
+  {
+    "neovim/nvim-lspconfig",
+    ---@class PluginLspOpts
+    opts = {
+      ---@type lspconfig.options
+      servers = {
+        -- pyright will be automatically installed with mason and loaded with lspconfig
+        pyright = {},
+      },
+    },
+  },
+
+  -- add tsserver and setup with typescript.nvim instead of lspconfig
+  {
+    "neovim/nvim-lspconfig",
+    dependencies = {
+      "jose-elias-alvarez/typescript.nvim",
+      init = function()
+        require("lazyvim.util").lsp.on_attach(function(_, buffer)
+          -- stylua: ignore
+          vim.keymap.set( "n", "<leader>co", "TypescriptOrganizeImports", { buffer = buffer, desc = "Organize Imports" })
+          vim.keymap.set("n", "<leader>cR", "TypescriptRenameFile", { desc = "Rename File", buffer = buffer })
+        end)
+      end,
+    },
+    ---@class PluginLspOpts
+    opts = {
+      ---@type lspconfig.options
+      servers = {
+        -- tsserver will be automatically installed with mason and loaded with lspconfig
+        tsserver = {},
+      },
+      -- you can do any additional lsp server setup here
+      -- return true if you don't want this server to be setup with lspconfig
+      ---@type table<string, fun(server:string, opts:_.lspconfig.options):boolean?>
+      setup = {
+        -- example to setup with typescript.nvim
+        tsserver = function(_, opts)
+          require("typescript").setup({ server = opts })
+          return true
+        end,
+        -- Specify * to use this function as a fallback for any server
+        -- ["*"] = function(server, opts) end,
+      },
+    },
+  },
+
+  -- for typescript, LazyVim also includes extra specs to properly setup lspconfig,
+  -- treesitter, mason and typescript.nvim. So instead of the above, you can use:
+  { import = "lazyvim.plugins.extras.lang.typescript" },
+
+  -- add more treesitter parsers
+  {
+    "nvim-treesitter/nvim-treesitter",
+    opts = {
+      ensure_installed = {
+        "bash",
+        "html",
+        "javascript",
+        "json",
+        "lua",
+        "markdown",
+        "markdown_inline",
+        "python",
+        "query",
+        "regex",
+        "tsx",
+        "typescript",
+        "vim",
+        "yaml",
+      },
+    },
+  },
+
+  -- since `vim.tbl_deep_extend`, can only merge tables and not lists, the code above
+  -- would overwrite `ensure_installed` with the new value.
+  -- If you'd rather extend the default config, use the code below instead:
+  {
+    "nvim-treesitter/nvim-treesitter",
+    opts = function(_, opts)
+      -- add tsx and treesitter
+      vim.list_extend(opts.ensure_installed, {
+        "tsx",
+        "typescript",
+      })
+    end,
+  },
+
+  -- the opts function can also be used to change the default opts:
+  {
+    "nvim-lualine/lualine.nvim",
+    event = "VeryLazy",
+    opts = function(_, opts)
+      table.insert(opts.sections.lualine_x, "😄")
+    end,
+  },
+
+  -- or you can return new options to override all the defaults
+  {
+    "nvim-lualine/lualine.nvim",
+    event = "VeryLazy",
+    opts = function()
+      return {
+        --[[add your custom lualine config here]]
+      }
+    end,
+  },
+
+  -- use mini.starter instead of alpha
+  { import = "lazyvim.plugins.extras.ui.mini-starter" },
+
+  -- add jsonls and schemastore packages, and setup treesitter for json, json5 and jsonc
+  { import = "lazyvim.plugins.extras.lang.json" },
+
+  -- add any tools you want to have installed below
+  {
+    "williamboman/mason.nvim",
+    opts = {
+      ensure_installed = {
+        "stylua",
+        "shellcheck",
+        "shfmt",
+        "flake8",
+      },
+    },
+  },
+
+  -- Use <tab> for completion and snippets (supertab)
+  -- first: disable default <tab> and <s-tab> behavior in LuaSnip
+  {
+    "L3MON4D3/LuaSnip",
+    keys = function()
+      return {}
+    end,
+  },
+  -- then: setup supertab in cmp
+  {
+    "hrsh7th/nvim-cmp",
+    dependencies = {
+      "hrsh7th/cmp-emoji",
+    },
+    ---@param opts cmp.ConfigSchema
+    opts = function(_, opts)
+      local has_words_before = function()
+        unpack = unpack or table.unpack
+        local line, col = unpack(vim.api.nvim_win_get_cursor(0))
+        return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
+      end
+
+      local luasnip = require("luasnip")
+      local cmp = require("cmp")
+
+      opts.mapping = vim.tbl_extend("force", opts.mapping, {
+        ["<Tab>"] = cmp.mapping(function(fallback)
+          if cmp.visible() then
+            cmp.select_next_item()
+            -- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable()
+            -- this way you will only jump inside the snippet region
+          elseif luasnip.expand_or_jumpable() then
+            luasnip.expand_or_jump()
+          elseif has_words_before() then
+            cmp.complete()
+          else
+            fallback()
+          end
+        end, { "i", "s" }),
+        ["<S-Tab>"] = cmp.mapping(function(fallback)
+          if cmp.visible() then
+            cmp.select_prev_item()
+          elseif luasnip.jumpable(-1) then
+            luasnip.jump(-1)
+          else
+            fallback()
+          end
+        end, { "i", "s" }),
+      })
+    end,
+  },
+}
diff --git a/dot_config/nvim/lua/plugins/lsp.lua b/dot_config/nvim/lua/plugins/lsp.lua
deleted file mode 100644
index 468b9cf..0000000
--- a/dot_config/nvim/lua/plugins/lsp.lua
+++ /dev/null
@@ -1,42 +0,0 @@
--- Set the following keybinds only after LSP attachment
-local on_attach = function(_, bufnr)
-   -- Enable completion triggered by <c-x><c-o>
-  vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
-end
-
--- Initialize servers that don't need any extra config
-local simple_servers = {}
-for _, lsp in pairs(simple_servers) do
-  require("lspconfig")[lsp].setup {
-    on_attach = on_attach,
-    flags = {
-      debounce_text_changes = 150,
-    }
-  }
-end
-
--- LSP: Lua (Sumneko)
-local runtime_path = vim.split(package.path, ";")
-table.insert(runtime_path, "lua/?.lua")
-table.insert(runtime_path, "lua/?/init.lua")
-
-require("lspconfig").sumneko_lua.setup {
-  on_attach = on_attach,
-  settings = {
-    Lua = {
-      runtime = {
-        version = "LuaJIT",
-        path = runtime_path,
-      },
-      diagnostics = {
-        globals = {"vim"},
-      },
-      workspace = {
-        library = vim.api.nvim_get_runtime_file("", true),
-      },
-      telemetry = {
-        enable = false,
-      },
-    },
-  },
-}
diff --git a/dot_config/nvim/lua/utils.lua b/dot_config/nvim/lua/utils.lua
deleted file mode 100644
index a752943..0000000
--- a/dot_config/nvim/lua/utils.lua
+++ /dev/null
@@ -1,12 +0,0 @@
--- General utilities
-
-local M = {}
-
-function M.map(mode, lhs, rhs)
-  vim.api.nvim_set_keymap(mode, lhs, rhs, {silent = true})
-end
-
-function M.nmap(lhs, rhs) M.map("n", lhs, rhs) end
-function M.xmap(lhs, rhs) M.map("x", lhs, rhs) end
-
-return M
diff --git a/dot_config/nvim/stylua.toml b/dot_config/nvim/stylua.toml
new file mode 100644
index 0000000..5d6c50d
--- /dev/null
+++ b/dot_config/nvim/stylua.toml
@@ -0,0 +1,3 @@
+indent_type = "Spaces"
+indent_width = 2
+column_width = 120
\ No newline at end of file