# HG changeset patch # User Meredith Howard # Date 1676234551 21600 # Node ID b57969db48dbe48155e8e520067dc85a5cc22daa # Parent 125540e1a1a71eb3aea0315f142ac6ec327245d7 start nvim config diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua new file mode 100644 --- /dev/null +++ b/.config/nvim/init.lua @@ -0,0 +1,2 @@ +require("config.options") +require("config.lazy") diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json 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 diff --git a/.config/nvim/lua/config/lazy.lua b/.config/nvim/lua/config/lazy.lua 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", + }, + }, + }, +}) + diff --git a/.config/nvim/lua/config/options.lua b/.config/nvim/lua/config/options.lua 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, +}) diff --git a/.config/nvim/lua/lazy-bootstrap.lua b/.config/nvim/lua/lazy-bootstrap.lua 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") diff --git a/.config/nvim/lua/plugins/editing.lua b/.config/nvim/lua/plugins/editing.lua new file mode 100644 --- /dev/null +++ b/.config/nvim/lua/plugins/editing.lua @@ -0,0 +1,4 @@ +return { + "tpope/vim-vinegar", + "tpope/vim-unimpaired", +} diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua 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({ + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.select_next_item(), + [""] = cmp.mapping.select_prev_item(), + [""] = cmp.mapping.abort(), + [""] = cmp.mapping.confirm({select = false}), + [""] = 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, + }, +} diff --git a/.config/nvim/lua/plugins/ui.lua b/.config/nvim/lua/plugins/ui.lua 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 = { + {"ig", "IndentBlanklineToggle"}, + }, + 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, + }, +}