init.lua (1263B)
1 -- Load my vim config 2 vim.cmd([[ 3 set runtimepath^=~/.vim runtimepath+=~/.vim/after 4 let &packpath = &runtimepath 5 call setenv("MYOLDVIMRC", "~/.vim/vimrc") 6 source $MYOLDVIMRC 7 ]]) 8 9 if vim.version() >= vim.version.parse("0.12") then 10 require("vim._core.ui2").enable({}) 11 end 12 13 -- Set <space> as the leader key 14 -- See `:help mapleader` 15 -- NOTE: Must happen before plugins are required (otherwise wrong leader will be used) 16 vim.g.mapleader = " " 17 vim.keymap.set({ "n", "v" }, "<Space>", "<Nop>", { silent = true }) 18 19 -- Install Lazy 20 local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" 21 if not (vim.uv or vim.loop).fs_stat(lazypath) then 22 local lazyrepo = "https://github.com/folke/lazy.nvim.git" 23 local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) 24 if vim.v.shell_error ~= 0 then 25 error("Error cloning lazy.nvim:\n" .. out) 26 end 27 end 28 vim.opt.rtp:prepend(lazypath) 29 30 -- Load everything from ./lua/plugins.lua, ./lua/plugins/*.lua 31 require("lazy").setup("plugins", { 32 performance = { 33 rtp = { 34 reset = false, 35 }, 36 }, 37 }) 38 39 -- Set completeopt to have a better completion experience 40 vim.o.completeopt = "menuone,noselect" 41 42 require("highlight_on_yank") 43 require("mappings") 44 require("netrw_target")