diff options
author | Tyler Davis <tyler@gluecode.net> | 2025-03-16 03:36:10 +0000 |
---|---|---|
committer | Tyler Davis <tyler@gluecode.net> | 2025-03-16 03:36:10 +0000 |
commit | b64f6533406d7affc7c7c6011ee9a6d8bfc8e78f (patch) | |
tree | 51257b65f1ce82e57be8ce20457b3d71821a2d74 /.config/nvim/lua/wavefunction | |
parent | 88e15be0f0fd9ff137acb29aba6a69a0080927ca (diff) | |
download | dotfiles-b64f6533406d7affc7c7c6011ee9a6d8bfc8e78f.tar.gz dotfiles-b64f6533406d7affc7c7c6011ee9a6d8bfc8e78f.zip |
neovim: more configs
Diffstat (limited to '.config/nvim/lua/wavefunction')
-rw-r--r-- | .config/nvim/lua/wavefunction/init.lua | 2 | ||||
-rw-r--r-- | .config/nvim/lua/wavefunction/lazy.nvim | 17 | ||||
-rw-r--r-- | .config/nvim/lua/wavefunction/lazy/init.lua | 4 | ||||
-rw-r--r-- | .config/nvim/lua/wavefunction/lazy/lsp.lua | 113 | ||||
-rw-r--r-- | .config/nvim/lua/wavefunction/lazy_init.lua | 26 | ||||
-rw-r--r-- | .config/nvim/lua/wavefunction/remap.lua | 32 | ||||
-rw-r--r-- | .config/nvim/lua/wavefunction/set.lua | 31 |
7 files changed, 64 insertions, 161 deletions
diff --git a/.config/nvim/lua/wavefunction/init.lua b/.config/nvim/lua/wavefunction/init.lua index e69de29..b206d42 100644 --- a/.config/nvim/lua/wavefunction/init.lua +++ b/.config/nvim/lua/wavefunction/init.lua @@ -0,0 +1,2 @@ +require("wavefunction.remap") +require("wavefunction.lazy_init") diff --git a/.config/nvim/lua/wavefunction/lazy.nvim b/.config/nvim/lua/wavefunction/lazy.nvim deleted file mode 100644 index 8f2e68d..0000000 --- a/.config/nvim/lua/wavefunction/lazy.nvim +++ /dev/null @@ -1,17 +0,0 @@ -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", -- latest stable release - lazypath, - }) -end -vim.opt.rtp:prepend(lazypath) - -require("lazy").setup({ - spec = "wavefunction.lazy", - change_detection = { notify = false } -}) diff --git a/.config/nvim/lua/wavefunction/lazy/init.lua b/.config/nvim/lua/wavefunction/lazy/init.lua new file mode 100644 index 0000000..9179e0f --- /dev/null +++ b/.config/nvim/lua/wavefunction/lazy/init.lua @@ -0,0 +1,4 @@ +return{ + { 'hrsh7th/cmp-nvim-lsp' }, + { 'hrsh7th/nvim-cmp' }, +} diff --git a/.config/nvim/lua/wavefunction/lazy/lsp.lua b/.config/nvim/lua/wavefunction/lazy/lsp.lua deleted file mode 100644 index 264ff22..0000000 --- a/.config/nvim/lua/wavefunction/lazy/lsp.lua +++ /dev/null @@ -1,113 +0,0 @@ -return { - "neovim/nvim-lspconfig", - dependencies = { - "stevearc/conform.nvim", - "williamboman/mason.nvim", - "williamboman/mason-lspconfig.nvim", - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-path", - "hrsh7th/cmp-cmdline", - "hrsh7th/nvim-cmp", - "L3MON4D3/LuaSnip", - "saadparwaiz1/cmp_luasnip", - "j-hui/fidget.nvim", - }, - - config = function() - require("conform").setup({ - formatters_by_ft = { - } - }) - local cmp = require('cmp') - local cmp_lsp = require("cmp_nvim_lsp") - local capabilities = vim.tbl_deep_extend( - "force", - {}, - vim.lsp.protocol.make_client_capabilities(), - cmp_lsp.default_capabilities()) - - require("fidget").setup({}) - require("mason").setup() - require("mason-lspconfig").setup({ - ensure_installed = { - "lua_ls", - "rust_analyzer", - "gopls", - }, - handlers = { - function(server_name) -- default handler (optional) - require("lspconfig")[server_name].setup { - capabilities = capabilities - } - end, - - zls = function() - local lspconfig = require("lspconfig") - lspconfig.zls.setup({ - root_dir = lspconfig.util.root_pattern(".git", "build.zig", "zls.json"), - settings = { - zls = { - enable_inlay_hints = true, - enable_snippets = true, - warn_style = true, - }, - }, - }) - vim.g.zig_fmt_parse_errors = 0 - vim.g.zig_fmt_autosave = 0 - - end, - ["lua_ls"] = function() - local lspconfig = require("lspconfig") - lspconfig.lua_ls.setup { - capabilities = capabilities, - settings = { - Lua = { - runtime = { version = "Lua 5.1" }, - diagnostics = { - globals = { "bit", "vim", "it", "describe", "before_each", "after_each" }, - } - } - } - } - end, - } - }) - - local cmp_select = { behavior = cmp.SelectBehavior.Select } - - cmp.setup({ - snippet = { - expand = function(args) - require('luasnip').lsp_expand(args.body) -- For `luasnip` users. - end, - }, - mapping = cmp.mapping.preset.insert({ - ['<C-p>'] = cmp.mapping.select_prev_item(cmp_select), - ['<C-n>'] = cmp.mapping.select_next_item(cmp_select), - ['<C-y>'] = cmp.mapping.confirm({ select = true }), - ["<C-Space>"] = cmp.mapping.complete(), - }), - sources = cmp.config.sources({ - { name = "copilot", group_index = 2 }, - { name = 'nvim_lsp' }, - { name = 'luasnip' }, -- For luasnip users. - }, { - { name = 'buffer' }, - }) - }) - - vim.diagnostic.config({ - -- update_in_insert = true, - float = { - focusable = false, - style = "minimal", - border = "rounded", - source = "always", - header = "", - prefix = "", - }, - }) - end -} diff --git a/.config/nvim/lua/wavefunction/lazy_init.lua b/.config/nvim/lua/wavefunction/lazy_init.lua new file mode 100644 index 0000000..8d87526 --- /dev/null +++ b/.config/nvim/lua/wavefunction/lazy_init.lua @@ -0,0 +1,26 @@ +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not (vim.uv or vim.loop).fs_stat(lazypath) then + local lazyrepo = "https://github.com/folke/lazy.nvim.git" + local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) + if vim.v.shell_error ~= 0 then + vim.api.nvim_echo({ + { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, + { out, "WarningMsg" }, + { "\nPress any key to exit..." }, + }, true, {}) + vim.fn.getchar() + os.exit(1) + end +end +vim.opt.rtp:prepend(lazypath) + +-- Make sure to setup `mapleader` and `maplocalleader` before +-- loading lazy.nvim so that mappings are correct. +-- This is also a good place to setup other settings (vim.opt) +vim.g.mapleader = " " +vim.g.maplocalleader = "\\" + +require("lazy").setup({ + spec = "wavefunction.lazy", + change_detection = { notify = false } +}) diff --git a/.config/nvim/lua/wavefunction/remap.lua b/.config/nvim/lua/wavefunction/remap.lua index 7088a1a..c553f04 100644 --- a/.config/nvim/lua/wavefunction/remap.lua +++ b/.config/nvim/lua/wavefunction/remap.lua @@ -1 +1,33 @@ vim.g.mapleader = "\\" + +vim.opt.guicursor = "" + +vim.opt.nu = true +vim.opt.relativenumber = true + +vim.opt.tabstop = 4 +vim.opt.softtabstop = 4 +vim.opt.shiftwidth = 4 +vim.opt.expandtab = true + +vim.opt.smartindent = true + +vim.opt.wrap = false + +vim.opt.swapfile = false +vim.opt.backup = false +vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir" +vim.opt.undofile = true + +vim.opt.hlsearch = false +vim.opt.incsearch = true + +vim.opt.termguicolors = true + +vim.opt.scrolloff = 8 +vim.opt.signcolumn = "yes" +vim.opt.isfname:append("@-@") + +vim.opt.updatetime = 50 + +vim.opt.colorcolumn = "80" diff --git a/.config/nvim/lua/wavefunction/set.lua b/.config/nvim/lua/wavefunction/set.lua deleted file mode 100644 index 2c9ad6e..0000000 --- a/.config/nvim/lua/wavefunction/set.lua +++ /dev/null @@ -1,31 +0,0 @@ -vim.opt.guicursor = "" - -vim.opt.nu = true -vim.opt.relativenumber = true - -vim.opt.tabstop = 4 -vim.opt.softtabstop = 4 -vim.opt.shiftwidth = 4 -vim.opt.expandtab = true - -vim.opt.smartindent = true - -vim.opt.wrap = false - -vim.opt.swapfile = false -vim.opt.backup = false -vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir" -vim.opt.undofile = true - -vim.opt.hlsearch = false -vim.opt.incsearch = true - -vim.opt.termguicolors = true - -vim.opt.scrolloff = 8 -vim.opt.signcolumn = "yes" -vim.opt.isfname:append("@-@") - -vim.opt.updatetime = 50 - -vim.opt.colorcolumn = "80" |