diff --git a/init.lua b/init.lua index b5771fe..75bf5da 100644 --- a/init.lua +++ b/init.lua @@ -1,10 +1,13 @@ require("config.lazy") require("options") -vim.cmd[[colorscheme gruvbox]] require("globals") require("mappings") require("autocmd") +if vim.g.neovide then + require("config.neovide") +end + vim.filetype.add({ pattern = { [".*/hypr/.*%.conf"] = "hyprlang", @@ -12,3 +15,4 @@ vim.filetype.add({ } }) +vim.cmd[[colorscheme onedark]] diff --git a/lazyvim.json b/lazyvim.json new file mode 100644 index 0000000..a28f5eb --- /dev/null +++ b/lazyvim.json @@ -0,0 +1,9 @@ +{ + "extras": [ + + ], + "news": { + "NEWS.md": "10960" + }, + "version": 8 +} \ No newline at end of file diff --git a/lua/autocmd.lua b/lua/autocmd.lua index c12fd05..65d3738 100644 --- a/lua/autocmd.lua +++ b/lua/autocmd.lua @@ -54,3 +54,31 @@ vim.api.nvim_create_autocmd("VimLeave", { pattern = "*", command = "set guicursor=a:ver25" }) + +autocmd({"BufEnter", "BufRead", "BufNewFile" }, { + pattern = "*", + callback = function() + vim.bo.tabstop = 4 + vim.bo.shiftwidth = 4 + vim.bo.softtabstop = 4 + vim.bo.expandtab = true + vim.bo.smartindent = true + end, +}) + +autocmd("BufWritePre", { + pattern = {"*.zig", "*.zon"}, + callback = function(ev) + vim.lsp.buf.code_action({ + context = { only = { "source.organiceImports" }}, + apply = true, + }) + end, +}) + +-- autocmd("FileWrite", { +-- pattern = { "~/.config/waybar/testconfig/style.scss" }, +-- callback = function() +-- vim.cmd(":!sass ~/.config/waybar/testconfig/style.scss ~/.config/waybar/testconfig/teststyle.css") +-- end, +-- }) diff --git a/lua/config/cmp.lua b/lua/config/cmp.lua new file mode 100644 index 0000000..479c940 --- /dev/null +++ b/lua/config/cmp.lua @@ -0,0 +1,39 @@ +local cmp_kinds = { + Text = ' ', + Method = ' ', + Function = ' ', + Constructor = ' ', + Field = ' ', + Variable = ' ', + Class = ' ', + Interface = ' ', + Module = ' ', + Property = ' ', + Unit = ' ', + Value = ' ', + Enum = ' ', + Keyword = ' ', + Snippet = ' ', + Color = ' ', + File = ' ', + Reference = ' ', + Folder = ' ', + EnumMember = ' ', + Constant = ' ', + Struct = ' ', + Event = ' ', + Operator = ' ', + TypeParameter = ' ', +} + +local cmp = require('cmp') + +cmp.setup({ + formatting = { + fields = { 'kind', 'abbr' }, + format = function(_, vim_item) + vim_item.kind = cmp_kinds[vim_item.kind] or '' + return vim_item + end, + } +}) diff --git a/lua/config/copilotchat.lua b/lua/config/copilotchat.lua index 97d3110..e0572b7 100644 --- a/lua/config/copilotchat.lua +++ b/lua/config/copilotchat.lua @@ -1,5 +1,6 @@ require("CopilotChat").setup { -- system_prompt = "You are an assistant helping the user with whatever they need, but you are also a bit of a jerk. Do not use profanity.", + model = "claude-3.7-sonnet-thought", prompts = { CivitAI = { system_prompt = "You are an assistant helping with stable diffusion models and python to implement failsafes for a server regarding image generation.", diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua index f5ee74c..1d4f9bc 100644 --- a/lua/config/lazy.lua +++ b/lua/config/lazy.lua @@ -1,35 +1,30 @@ -- Bootstrap lazy.nvim 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 + 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 = "\\" --- Setup lazy.nvim require("lazy").setup({ - spec = { - -- import your plugins - { import = "plugins" }, - }, - -- Configure any other settings here. See the documentation for more details. - -- colorscheme that will be used when installing plugins. - install = { colorscheme = { "habamax" } }, - -- automatically check for plugin updates - checker = { enabled = true }, + spec = { + { import = "plugins" }, + }, + -- Configure any other settings here. See the documentation for more details. + -- colorscheme that will be used when installing plugins. + install = { colorscheme = { "onedark" } }, + -- automatically check for plugin updates + checker = { enabled = true }, }) diff --git a/lua/config/lspconfig.lua b/lua/config/lspconfig.lua index d81e552..4f82b5a 100644 --- a/lua/config/lspconfig.lua +++ b/lua/config/lspconfig.lua @@ -7,6 +7,34 @@ local capabilities = vim.tbl_deep_extend( cmp_lsp.default_capabilities() ) +local cmp_kinds = { + Text = ' ', + Method = ' ', + Function = ' ', + Constructor = ' ', + Field = ' ', + Variable = ' ', + Class = ' ', + Interface = ' ', + Module = ' ', + Property = ' ', + Unit = ' ', + Value = ' ', + Enum = ' ', + Keyword = ' ', + Snippet = ' ', + Color = ' ', + File = ' ', + Reference = ' ', + Folder = ' ', + EnumMember = ' ', + Constant = ' ', + Struct = ' ', + Event = ' ', + Operator = ' ', + TypeParameter = ' ', +} + require("fidget").setup({}) require("mason").setup() require("mason-lspconfig").setup({ @@ -25,6 +53,7 @@ require("mason-lspconfig").setup({ zls = function() local lspconfig = require("lspconfig") lspconfig.zls.setup({ + capabilities = capabilities, root_dir = lspconfig.util.root_pattern(".git", "build.zig", "zls.json"), settings = { zls = { @@ -56,6 +85,16 @@ require("mason-lspconfig").setup({ }) cmp.setup { + formatting = { + fields = { 'kind', 'abbr' }, + format = function(entry, vim_item) + vim_item.kind = cmp_kinds[vim_item.kind] or '' + if entry.completion_item.detail then + vim_item.menu = entry.completion_item.detail + end + return vim_item + end, + }, completion = { completeopt = "menu,menuone" }, snippet = { expand = function(args) @@ -105,6 +144,7 @@ cmp.setup { vim.diagnostic.config({ -- update_in_insert = true, + virtual_text = true, float = { focusable = false, style = "minimal", @@ -117,6 +157,27 @@ vim.diagnostic.config({ local lspconfig = require "lspconfig" +lspconfig.zls.setup({ + capabilities = capabilities, + root_dir = lspconfig.util.root_pattern(".git", "build.zig", "zls.json"), + settings = { + zls = { + enable_inlay_hints = true, + enable_snippets = true, + warn_style = true, + }, + }, +}) +-- lspconfig.zls.setup { +-- cmd = { "zls" }, +-- settings = { +-- zls = { +-- enable_build_on_save = true, +-- semantic_tokens = "partial", +-- }, +-- }, +-- } + -- EXAMPLE local servers = { "html", @@ -127,7 +188,6 @@ local servers = { "ts_ls", -- "jdtls", "sourcekit", - "zls", } for _, server in ipairs(servers) do diff --git a/lua/config/neovide.lua b/lua/config/neovide.lua new file mode 100644 index 0000000..a2f0b6b --- /dev/null +++ b/lua/config/neovide.lua @@ -0,0 +1,11 @@ +vim.g.neovide_cursor_trail_size = 0 +vim.g.neovide_floating_corner_radius = 0.4 +vim.o.guifont = "0xProto Nerd Font Mono:h12" +vim.g.neovide_refresh_rate = 144 +vim.g.neovide_refresh_rate_idle = 144 +vim.g.neovide_no_idle = true +vim.g.neovide_floating_blur_amount_x = 0 +vim.g.neovide_floating_blur_amount_y = 0 +vim.g.neovide_cursor_animation_length = 0.08 +vim.g.neovide_cursor_short_animation_length = 0.04 +vim.g.neovide_scroll_animation_length = 0.15 diff --git a/lua/config/noice.lua b/lua/config/noice.lua new file mode 100644 index 0000000..3ad7ccb --- /dev/null +++ b/lua/config/noice.lua @@ -0,0 +1,29 @@ +require("noice").setup({ + lsp = { + override = { + ["vim.lsp.util.convert_input_to_markdown_lines"] = true, + ["vim.lsp.util.stylize_markdown"] = true, + ["cmp.entry.get_documentation"] = true, + }, + }, + presets = { + bottom_search = true, + command_palette = true, + long_message_to_split = true, + inc_rename = false, + lsp_doc_border = false, + }, + views = { + popupmenu = { + enabled = true, + backend = "nui", + win_options = { + winblend = 0.5, + }, + border = { + style = "shadow", + padding = { 1, 2 }, + }, + }, + }, +}) diff --git a/lua/config/nui.lua b/lua/config/nui.lua new file mode 100644 index 0000000..49171de --- /dev/null +++ b/lua/config/nui.lua @@ -0,0 +1,7 @@ +local popup = require('nui.popup') + +local Popup = popup({ + border = { + style = "shadow", + } +}) diff --git a/lua/config/themelight.lua b/lua/config/themelight.lua index 23e7764..0cd5cc5 100644 --- a/lua/config/themelight.lua +++ b/lua/config/themelight.lua @@ -1,2 +1,8 @@ -- Lua -require('onedarkpro').setup({}) +require('onedarkpro').setup({ + highlights = { + Comment = { italic = true }, + Directory = { bold = false }, + ErrorMsg = { italic = true }, + }, +}) diff --git a/lua/globals.lua b/lua/globals.lua index 4e2b11c..682efad 100644 --- a/lua/globals.lua +++ b/lua/globals.lua @@ -5,6 +5,9 @@ vim.g.mapleader = " " vim.g.gruvbox_material_background = "medium" vim.g.coq_settings = { keymap = { recommended = false } } vim.g.gruvbox_material_foreground = "original" +vim.g.zig_fmt_parse_errors = 0 +vim.g.zig_fmt_autosave = 0 + vim.api.nvim_set_hl(0, 'GitGutterAdd', { fg = '#009900', ctermfg = 2 }) vim.api.nvim_set_hl(0, 'GitGutterChange', { fg = '#bbbb00', ctermfg = 3 }) vim.api.nvim_set_hl(0, 'GitGutterDelete', { fg = '#ff2222', ctermfg = 1 }) diff --git a/lua/options.lua b/lua/options.lua index 114dc6e..0a90b2b 100644 --- a/lua/options.lua +++ b/lua/options.lua @@ -1,3 +1,4 @@ +vim.o.pumblend = 50 vim.opt.relativenumber = true vim.opt.tabstop = 4 vim.opt.softtabstop = 4 diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index cfa5cf0..e0d4ac5 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -14,6 +14,7 @@ return { }, { "olimorris/onedarkpro.nvim", + priority = 1000, config = function() require("config.themelight") end, @@ -80,6 +81,7 @@ return { }, { "hiphish/rainbow-delimiters.nvim", + enabled = false, }, { "windwp/nvim-autopairs", @@ -171,6 +173,9 @@ return { { "notken12/base46-colors", }, + { + "hrsh7th/nvim-cmp", + }, { "neovim/nvim-lspconfig", dependencies = { @@ -220,4 +225,7 @@ return { require("config.colorizer") end, }, + { + "ziglang/zig.vim", + }, }