local api = vim.api local g = vim.g local opt = vim.opt -- Load Lazy 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) -- Remap leader and local leader to api.nvim_set_keymap("", "", "", { noremap = true, silent = true }) g.mapleader = " " g.maplocalleader = " " -- Load plugins require('lazy').setup('plugins') vim.cmd 'colorscheme catppuccin-mocha' -- 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 = "PragmataPro Mono Liga" -- 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("n", "fe", "Oil") 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, })