-- 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) -- Make sure to setup `mapleader` and `maplocalleader` before -- loading lazy.nvim so that mappings are correct. vim.g.mapleader = " " vim.g.maplocalleader = "\\" vim.opt.hlsearch = false vim.opt.whichwrap:append("<,>,h,l") vim.opt.listchars = 'tab:┆-,trail:~,extends:>,precedes:<,nbsp:•' vim.opt.list = true vim.opt.expandtab = true vim.opt.tabstop = 2 vim.opt.shiftwidth = 2 vim.opt.softtabstop = 2 vim.opt.splitbelow = true vim.opt.splitright = true function tblmerge(x, y) for k,v in pairs(y) do x[k] = v end return x end local function map(mode, lhs, rhs, opts) vim.api.nvim_set_keymap(mode, lhs, rhs, tblmerge({ noremap = true, silent = true}, opts or {})) end function nmap(l, r, opt) map('n', l, r, opt) end function imap(l, r, opt) map('i', l, r, opt) end function vmap(l, r, opt) map('v', l, r, opt) end -- Treat long lines as broken lines so you can move in them nmap('j', 'gj') nmap('k', 'gk') -- maintain visual selection when changing indentation vmap('<', '', '>gv') nmap("w", ":w") nmap("tn", ":tabnew") nmap('te', ':tabedit =expand("%:p:h")/') -- Setup lazy.nvim require("lazy").setup({ spec = { { import = "plugins" }, }, install = { colorscheme = { "habamax" } }, checker = { enabled = false }, })