From a2d4246a30cb6e4af050a3c1ab6b9f18817c9f3e Mon Sep 17 00:00:00 2001 From: sinanmohd Date: Thu, 29 Feb 2024 22:18:05 +0530 Subject: repo: init --- lua/core/init.lua | 2 ++ lua/core/maps.lua | 24 ++++++++++++++++++++++++ lua/core/opts.lua | 25 +++++++++++++++++++++++++ lua/pacman.lua | 23 +++++++++++++++++++++++ 4 files changed, 74 insertions(+) create mode 100644 lua/core/init.lua create mode 100644 lua/core/maps.lua create mode 100644 lua/core/opts.lua create mode 100644 lua/pacman.lua (limited to 'lua') diff --git a/lua/core/init.lua b/lua/core/init.lua new file mode 100644 index 0000000..c296ffb --- /dev/null +++ b/lua/core/init.lua @@ -0,0 +1,2 @@ +require "core.opts" +require "core.maps" diff --git a/lua/core/maps.lua b/lua/core/maps.lua new file mode 100644 index 0000000..57c9b94 --- /dev/null +++ b/lua/core/maps.lua @@ -0,0 +1,24 @@ +local maps = { + n = { + [""] = { " noh ", "Clear highlights" }, + }, + + t = { + [""] = { + vim.api.nvim_replace_termcodes("", true, true, true), + "Escape terminal mode" + }, + }, + + v = { + ["<"] = { ""] = { ">gv", "Indent line" }, + }, +} + + +for mode, keytab in pairs(maps) do + for key, fun in pairs(keytab) do + vim.keymap.set(mode, key, fun[1], { desc = fun[2] }) + end +end diff --git a/lua/core/opts.lua b/lua/core/opts.lua new file mode 100644 index 0000000..11c8413 --- /dev/null +++ b/lua/core/opts.lua @@ -0,0 +1,25 @@ +-- functional +vim.g.mapleader = " " +vim.o.ignorecase = true +vim.o.smartcase = true +vim.o.clipboard = "unnamedplus" +vim.o.undofile = true +vim.o.mouse = false +vim.o.number = true +vim.o.relativenumber = true +vim.o.signcolumn = "yes" + +-- termux like +vim.o.splitright = true +vim.o.splitbelow = true + +-- non-functional +vim.g.netrw_banner = 0 +vim.g.netrw_liststyle = 3 +vim.g.netrw_winsize = 25 +vim.o.breakindent = true +vim.o.termguicolors = true +vim.o.guicursor = false +vim.o.showmode = false +vim.o.numberwidth = 2 +vim.o.ruler = false diff --git a/lua/pacman.lua b/lua/pacman.lua new file mode 100644 index 0000000..b494ae5 --- /dev/null +++ b/lua/pacman.lua @@ -0,0 +1,23 @@ +local path = vim.fn.stdpath "data" .. "/lazy/lazy.nvim" +local repo = "https://github.com/folke/lazy.nvim.git" + +local lazy_init = function() + vim.print " 󰦗 downloading lazy.nvim" + + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + repo, + "--branch=stable", + path, + }) + + vim.print "" + vim.cmd "redraw" +end + +if not vim.loop.fs_stat(path) then + lazy_init() +end +vim.opt.rtp:prepend(path) -- cgit v1.2.3