-- Options local o = vim.opt local g = vim.g g.mapleader = " " g.loaded_perl_provider = 0 g.loaded_ruby_provider = 0 g.clipboard = "osc52" o.number = true o.winborder = "rounded" o.expandtab = true o.shiftwidth = 2 o.tabstop = 4 o.softtabstop = 4 o.completeopt = { "menuone", "noselect", "noinsert" } o.updatetime = 100 o.timeoutlen = 300 o.clipboard = "unnamedplus" o.foldenable = false o.list = true o.listchars = { tab = "→ ", eol = " ", space = " ", nbsp = "␣", trail = "·", lead = "·", } o.scroll = 5 o.smoothscroll = true o.termguicolors = true o.laststatus = 3 o.mousescroll = "ver:0,hor:0" vim.lsp.semantic_tokens.enable = false vim.diagnostic.config({ float = { border = "rounded", }, }) vim.g.rainbow_delimiters = { highlight = { "RainbowDelimiterYellow", "RainbowDelimiterBlue", "RainbowDelimiterOrange", "RainbowDelimiterGreen", "RainbowDelimiterViolet", "RainbowDelimiterCyan", "RainbowDelimiterRed", }, } vim.diagnostic.config({ virtual_text = true, signs = { text = { [vim.diagnostic.severity.ERROR] = "󰅚 ", [vim.diagnostic.severity.WARN] = "󰀪 ", [vim.diagnostic.severity.INFO] = "󰋽 ", [vim.diagnostic.severity.HINT] = "󰌶 ", }, }, underline = true, update_in_insert = true, severity_sort = true, }) -- LSP config local capabilities = require("cmp_nvim_lsp").default_capabilities() vim.lsp.config("lua_ls", { capabilities = capabilities, settings = { Lua = { diagnostics = { globals = { "vim", }, }, workspace = { library = vim.api.nvim_get_runtime_file("", true), }, telemetry = { enable = false, }, }, }, }) vim.lsp.config("clangd", { capabilities = capabilities, }) vim.lsp.enable("lua_ls") vim.lsp.enable("clangd") -- Plugins require("picvim").setup({}) require("notify").setup({}) require("gitsigns").setup({}) require("mini.pairs").setup({}) require("rainbow-delimiters.setup").setup({}) require("neo-tree").setup({ filesystem = { filtered_items = { visible = true, }, }, }) require("lualine").setup({ options = { theme = "auto", }, sections = { lualine_b = { { "branch" }, { "diff", symbols = { added = " ", modified = " ", removed = " ", }, diff_color = { added = { fg = "#a6e3a1" }, modified = { fg = "#f9e2af" }, removed = { fg = "#f38ca8" }, }, }, }, }, }) require("nvim-cursorline").setup({ cursorline = { enable = true, timeout = 0, number = false, }, cursorword = { enable = true, min_length = 1, hl = { underline = true, }, }, }) require("conform").setup({ formatters_by_ft = { lua = { "stylua" }, }, format_on_save = { timeout_ms = 500, lsp_fallback = true, }, }) local cmp = require("cmp") cmp.setup({ window = { completion = cmp.config.window.bordered({ border = "rounded", }), documentation = cmp.config.window.bordered({ border = "rounded", }), }, mapping = cmp.mapping.preset.insert({ [""] = cmp.mapping.confirm({ select = true, }), [""] = cmp.mapping.select_next_item(), [""] = cmp.mapping.select_prev_item(), }), sources = { { name = "nvim_lsp", }, { name = "clangd", }, }, }) local neoscroll = require("neoscroll") neoscroll.setup({ mappings = { "", "", "", "", "", "", "zt", "zz", "zb", }, }) -- Keymaps local map = vim.keymap.set map({ "n", "i", "v" }, "", "w") map("n", ";", ":") map("n", "", ":move-2") map("n", "", ":move+1") map("x", "", ":move '<-2gv") map("x", "", ":move '>+1gv") map("i", "", ":move-2") map("i", "", ":move+1") map("n", ">", ">>") map("v", ">", ">gv") map("n", "<", "<<") map("v", "<", ">") map("v", ".", ">gv") map("n", ",", "<<") map("v", ",", "", "nohlsearch") map("n", "u", "ggVG") map("n", "z", "u") map("n", "d", "red") map("n", "q", "Neotree") map("n", "", "Minuet virtualtext toggle") map("x", "p", '"_dP') map("x", "P", '"_dP') map("n", "\\", function() vim.cmd([[ Neotree close mksession! p.vim echo "saved session" ]]) end) map("n", "", function() neoscroll.scroll(-0.05, { move_cursor = false, duration = 20 }) end) map("n", "", function() neoscroll.scroll(0.05, { move_cursor = false, duration = 20 }) end) map("n", "", function() neoscroll.scroll(-0.1, { move_cursor = false, duration = 50 }) end) map("n", "", function() neoscroll.scroll(0.1, { move_cursor = false, duration = 50 }) end) -- Vimscript stuff vim.cmd([[ aunmenu PopUp colorscheme tokyonight-night ]]) -- AutoCMD's local autocmd = vim.api.nvim_create_autocmd autocmd("CursorHold", { callback = function() vim.diagnostic.open_float(nil, { focusable = false, border = "rounded", source = "if_many", }) end, })