vim.g.mapleader = " " vim.opt.title = true vim.opt.mouse="" vim.opt.wrap = true vim.opt.fileencoding = "utf-8" vim.opt.clipboard = "unnamedplus" vim.opt.completeopt = {"menu", "menuone", "preview", "noselect"} vim.opt.termguicolors = false vim.opt.laststatus = 3 --- Search vim.opt.ignorecase=true vim.opt.smartcase=true --- Numbers vim.opt.number=true vim.opt.relativenumber=true --- Tab Options vim.opt.smartindent = true vim.opt.smarttab = true vim.opt.expandtab = true vim.opt.tabstop = 2 vim.opt.shiftwidth = 2 vim.opt.softtabstop = 2 vim.opt.showtabline = 2 --- Explorer vim.g.netrw_banner = 0 vim.g.netrw_browse_split = 4 vim.g.netrw_altv = 1 vim.g.netrw_liststyle = 3 vim.g.netrw_winsize = 20 vim.opt.scrolloff = 6 vim.opt.sidescrolloff = 8 --- Swapfile vim.opt.swapfile = false vim.opt.backup = false --- Keymap -- Resource vim.keymap.set("n", "r", ":source ~/.config/nvim/init.lua") -- Explorer vim.keymap.set("n", "", ":Lexplore") -- Windows vim.keymap.set("n", "d", "h") vim.keymap.set("n", "c", "l") vim.keymap.set("n", "a", "k") vim.keymap.set("n", "b", "j") -- Resize vim.keymap.set("n", "-", ":vertical resize -3") vim.keymap.set("n", "+", ":vertical resize +3") -- Buffer vim.keymap.set("n", "", ":buffer ") -- Tabs vim.keymap.set("n", "tn", ":tabnew") vim.keymap.set("n", "tc", ":tabclose") vim.keymap.set("n", "", ":tabnext") -- Cheatsheet vim.keymap.set("n", "", ":terminal ~/.config/nvim/nvim_help.shi") -- No highlight vim.keymap.set("n", "nh", ":nohl") --- Automaticly close brackets --vim.keymap.set ("i", "'", "''") --vim.keymap.set ("i", "\"", "\"\"") --vim.keymap.set ("i", "(", "()") --vim.keymap.set ("i", "{", "{}") --vim.keymap.set ("i", "[", "[]") --- Statusline vim.cmd "highlight StatusNormal ctermbg=blue ctermfg=black" vim.cmd "highlight StatusModified ctermbg=red ctermfg=black" vim.cmd "highlight StatusGitBranch ctermbg=yellow ctermfg=black" vim.cmd "highlight StatusGitDiffAdd ctermbg=green ctermfg=black" vim.cmd "highlight StatusGitdiffRemove ctermbg=red ctermfg=black" local function command(cmd) local handle = io.popen(cmd) local result = handle:read() handle:close() return result or "" end vim.o.statusline = "%#StatusNormal# " .. "%#StatusGitBranch#" .. command("git branch 2> /dev/null | sed -e 's/..//'") .. "%#StatusNormal# " .. "%#StatusGitDiffAdd#" .. command("git diff --numstat | awk '{print \"+\"$1}'") .. "%#StatusNormal# " .. "%#StatusGitDiffRemove#" .. command("git diff --numstat | awk '{print \"-\"$2}'") .. "%#StatusNormal# " .. ">>" .. " %F " .. "%#StatusModified#" .. "%M" .. "%#StatusNormal#" .. " >>" .. "%=" .. "<<" .. " %Y " .. "<<" .. " %l,%c " .. "<<" .. " %p%% " require("core") require("lazy.load")