local api = vim.api local g = vim.g local opt = vim.opt -- 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 end vim.opt.rtp:prepend(lazypath) -- Remap leader and local leader to api.nvim_set_keymap("", "", "", { noremap = true, silent = true }) g.mapleader = " " g.maplocalleader = "," -- Setup lazy.nvim require("lazy").setup({ spec = { { import = "plugins" }, }, install = { colorscheme = { "habamax" } }, checker = { enabled = true }, }) vim.cmd 'colorscheme catppuccin-frappe' -- Load core settings opt.termguicolors = true -- Enable colors in terminal opt.hlsearch = false -- turn off highlight on search opt.incsearch = true -- Keep incremental highlighting on search opt.number = true --Make line numbers default opt.relativenumber = true --Make relative number default opt.mouse = "a" --Enable mouse mode opt.breakindent = true --Enable break indent opt.undofile = true --Save undo history opt.ignorecase = true --Case insensitive searching unless /C or capital in search opt.smartcase = true -- Smart case opt.updatetime = 50 --Decrease update time opt.signcolumn = 'yes' -- Always show sign column opt.clipboard = 'unnamedplus' -- Access system clipboard opt.laststatus = 3 -- Global status line opt.swapfile = false opt.wrap = false vim.opt_local.conceallevel = 2 vim.opt.inccommand = 'split' -- Time in milliseconds to wait for a mapped sequence to complete. opt.timeoutlen = 300 opt.showmode = false -- Do not need to show the mode. We use the statusline instead. opt.scrolloff = 10 -- Lines of context opt.smartindent = true --Smart indent opt.expandtab = true opt.smarttab = true opt.textwidth = 0 opt.autoindent = true opt.shiftwidth = 2 opt.tabstop = 2 opt.softtabstop = 2 opt.splitbelow = true opt.splitright = true opt.cursorline = true opt.guifont = "Iosevka Nerd Font Mono" -- Remappings vim.keymap.set("v", "J", ":m '>+1gv=gv") vim.keymap.set("v", "K", ":m '<-2gv=gv") vim.keymap.set("n", "", "zz") vim.keymap.set("n", "", "zz") vim.keymap.set("n", "n", "nzzzv") vim.keymap.set("n", "N", "Nzzzv") vim.keymap.set("x", "p", [["_dP]]) vim.keymap.set({"n", "v"}, "y", [["+y]]) vim.keymap.set("n", "Y", [["+Y]]) vim.keymap.set({"n", "v"}, "d", [["_d]]) vim.keymap.set("n", "Q", "") vim.keymap.set("n", "", "") vim.keymap.set("n", "", "silent !tmux neww tmux-sessionizer") vim.keymap.set("n", "J", "mzJ`z") vim.keymap.set("i", "jk", "") vim.api.nvim_create_autocmd('TextYankPost', { desc = 'Highlight when yanking (copying) text', group = vim.api.nvim_create_augroup('highlight-yank', { clear = true }), callback = function() vim.highlight.on_yank() end, })