start nvim config

Sun, 12 Feb 2023 14:42:31 -0600

author
Meredith Howard <mhoward@roomag.org>
date
Sun, 12 Feb 2023 14:42:31 -0600
changeset 1014
b57969db48db
parent 1013
125540e1a1a7
child 1015
21950cadff6b

start nvim config

.config/nvim/init.lua file | annotate | diff | comparison | revisions
.config/nvim/lazy-lock.json file | annotate | diff | comparison | revisions
.config/nvim/lua/config/lazy.lua file | annotate | diff | comparison | revisions
.config/nvim/lua/config/options.lua file | annotate | diff | comparison | revisions
.config/nvim/lua/lazy-bootstrap.lua file | annotate | diff | comparison | revisions
.config/nvim/lua/plugins/editing.lua file | annotate | diff | comparison | revisions
.config/nvim/lua/plugins/lsp.lua file | annotate | diff | comparison | revisions
.config/nvim/lua/plugins/ui.lua file | annotate | diff | comparison | revisions
new file mode 100644
--- /dev/null
+++ b/.config/nvim/init.lua
@@ -0,0 +1,2 @@
+require("config.options")
+require("config.lazy")
new file mode 100644
--- /dev/null
+++ b/.config/nvim/lazy-lock.json
@@ -0,0 +1,18 @@
+{
+  "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
+  "cmp-nvim-lsp": { "branch": "main", "commit": "0e6b2ed705ddcff9738ec4ea838141654f12eeef" },
+  "cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "3d8912ebeb56e5ae08ef0906e3a54de1c66b92f1" },
+  "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
+  "fidget.nvim": { "branch": "main", "commit": "9dc6d15fdb877b2fb09ea0ba2dfde9beccb5965a" },
+  "indent-blankline.nvim": { "branch": "master", "commit": "8299fe7703dfff4b1752aeed271c3b95281a952d" },
+  "jellybeans.vim": { "branch": "master", "commit": "ef83bf4dc8b3eacffc97bf5c96ab2581b415c9fa" },
+  "lazy.nvim": { "branch": "main", "commit": "4917222c7e5c924bf7471b72a5e2d3e661530b40" },
+  "lualine.nvim": { "branch": "master", "commit": "0050b308552e45f7128f399886c86afefc3eb988" },
+  "mason-lspconfig.nvim": { "branch": "main", "commit": "d2d55255a0295ba0a75ef2dd5535e4c89c46e773" },
+  "mason.nvim": { "branch": "main", "commit": "47e9f6bc4c5bb3d6453949f07b8280c725ef7490" },
+  "mini.indentscope": { "branch": "main", "commit": "f3bbd793fac80638bb5f4ef173eb514170aa22b3" },
+  "nvim-cmp": { "branch": "main", "commit": "aae0c3e4e778ca4be6fabc52e388cbd5b844b7a5" },
+  "nvim-lspconfig": { "branch": "master", "commit": "27e6eb27f31d1ef41427e1008029284c02dc856f" },
+  "vim-unimpaired": { "branch": "master", "commit": "6d44a6dc2ec34607c41ec78acf81657248580bf1" },
+  "vim-vinegar": { "branch": "master", "commit": "bb1bcddf43cfebe05eb565a84ab069b357d0b3d6" }
+}
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/.config/nvim/lua/config/lazy.lua
@@ -0,0 +1,21 @@
+require("lazy-bootstrap").setup({
+  spec = {
+    { "nanotech/jellybeans.vim",
+      priority = 1000,
+      config = function() vim.cmd.colorscheme("jellybeans") end },
+    { import = "plugins" }
+  },
+  change_detection = { enabled = false },
+  performance = {
+    rtp = {
+      disabled_plugins = {
+        "gzip",
+        "tarPlugin",
+        "tohtml",
+        "zipPlugin",
+        "tutor",
+      },
+    },
+  },
+})
+
new file mode 100644
--- /dev/null
+++ b/.config/nvim/lua/config/options.lua
@@ -0,0 +1,46 @@
+vim.g.mapleader = "\\"
+vim.g.maplocalleader = "\\"
+
+local o = vim.opt
+
+-- Editing
+o.expandtab = true
+o.shiftround = true
+o.shiftwidth = 2
+
+-- Display
+o.breakindent = true
+o.breakindentopt = "min:66,shift:2"
+o.diffopt:append("algorithm:patience")
+o.fillchars = "fold: ,vert:│"
+o.linebreak = true
+o.listchars = "tab:⇥·,trail:◼,nbsp:◻,extends:»,precedes:«"
+o.showbreak = "» "
+o.termguicolors = true
+o.signcolumn = "number"
+
+-- set font etc
+if vim.fn.has("gui") then
+  o.number = true
+end
+
+-- Behavior
+o.autowriteall = true
+o.ignorecase = true
+o.scrolloff = 15
+o.sidescrolloff = 10
+o.smartcase = true
+o.splitbelow = true
+o.splitright = true
+o.wildignorecase = true
+
+-- Paths
+o.tags:append(".tags,./.tags;")
+o.wildignore = "*~,*.o,*.pyc,.git/*,hg/*,.svn/*"
+
+vim.api.nvim_create_autocmd("LspAttach", {
+  once = true,
+  callback = function(args)
+    vim.opt.number = true
+  end,
+})
new file mode 100644
--- /dev/null
+++ b/.config/nvim/lua/lazy-bootstrap.lua
@@ -0,0 +1,7 @@
+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(vim.env.LAZY or lazypath)
+
+return require("lazy")
new file mode 100644
--- /dev/null
+++ b/.config/nvim/lua/plugins/editing.lua
@@ -0,0 +1,4 @@
+return {
+  "tpope/vim-vinegar",
+  "tpope/vim-unimpaired",
+}
new file mode 100644
--- /dev/null
+++ b/.config/nvim/lua/plugins/lsp.lua
@@ -0,0 +1,55 @@
+return {
+  "neovim/nvim-lspconfig",
+  {"williamboman/mason.nvim", config = true},
+  {"j-hui/fidget.nvim", config = true},
+
+  {
+    "williamboman/mason-lspconfig.nvim",
+    config = function(plugin, opts)
+      require("mason-lspconfig").setup_handlers({
+        function(server)
+          require("lspconfig")[server].setup({})
+        end,
+      })
+    end,
+  },
+
+  {
+    "hrsh7th/nvim-cmp",
+    event = "InsertEnter",
+    dependencies = {
+      "hrsh7th/cmp-buffer",
+      "hrsh7th/cmp-path",
+      "hrsh7th/cmp-nvim-lsp",
+      "hrsh7th/cmp-nvim-lsp-signature-help",
+    },
+    opts = function()
+      local cmp = require("cmp")
+      return {
+        completion = {
+          completeopt = "menu,menuone,noinsert,noselect",
+        },
+        mapping = cmp.mapping.preset.insert({
+          ["<C-b>"] = cmp.mapping.scroll_docs(-4),
+          ["<C-f>"] = cmp.mapping.scroll_docs(4),
+          ["<Tab>"] = cmp.mapping.select_next_item(),
+          ["<S-Tab>"] = cmp.mapping.select_prev_item(),
+          ["<C-g>"] = cmp.mapping.abort(),
+          ["<Space>"] = cmp.mapping.confirm({select = false}),
+          ["<Right>"] = cmp.mapping.confirm({select = true}),
+        }),
+	sources = cmp.config.sources({
+	  { name = "nvim_lsp" },
+	  { name = "nvim_lsp_signature_help" },
+	  { name = "buffer" },
+	  { name = "path" },
+	}),
+	experimental = {
+	  ghost_text = {
+	    hl_group = "LspCodeLens",
+	  },
+	},
+      }
+    end,
+  },
+}
new file mode 100644
--- /dev/null
+++ b/.config/nvim/lua/plugins/ui.lua
@@ -0,0 +1,55 @@
+return {
+  {
+    "nvim-lualine/lualine.nvim",
+    opts = {
+      options = {
+        theme = "auto",
+        icons_enabled = false,
+        section_separators = "",
+        component_separators = "",
+        globalstatus = true
+      },
+      tabline = {
+        lualine_a = { {'buffers', mode = 4} },
+      }
+    }
+  },
+
+  {
+    "lukas-reineke/indent-blankline.nvim",
+    event = "BufReadPost",
+    keys = {
+      {"<leader>ig", "<cmd>IndentBlanklineToggle<cr>"},
+    },
+    opts = {
+      enabled = false,
+      char = "│",
+      filetype_exclude = { "help", "alpha", "dashboard", "neo-tree", "Trouble", "lazy" },
+      show_trailing_blankline_indent = false,
+      show_current_context = false,
+    },
+  },
+
+  {
+    "echasnovski/mini.indentscope",
+    version = false, -- wait till new 0.7.0 release to put it back on semver
+    event = "BufReadPre",
+    opts = {
+      symbol = "│",
+      -- symbol = "▏",
+      options = { try_as_border = true },
+      draw = {
+        animation = function() return 2 end,
+      },
+    },
+    config = function(_, opts)
+      vim.api.nvim_create_autocmd("FileType", {
+        pattern = { "help", "alpha", "dashboard", "neo-tree", "Trouble", "lazy", "mason" },
+        callback = function()
+          vim.b.miniindentscope_disable = true
+        end,
+      })
+      require("mini.indentscope").setup(opts)
+    end,
+  },
+}

mercurial