aboutsummaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
authorsinanmohd <sinan@sinanmohd.com>2024-02-29 22:18:05 +0530
committersinanmohd <sinan@sinanmohd.com>2024-02-29 22:18:05 +0530
commita2d4246a30cb6e4af050a3c1ab6b9f18817c9f3e (patch)
tree6888322225f09587c0daa866aae789523eed8d76 /lua
repo: init
Diffstat (limited to 'lua')
-rw-r--r--lua/core/init.lua2
-rw-r--r--lua/core/maps.lua24
-rw-r--r--lua/core/opts.lua25
-rw-r--r--lua/pacman.lua23
4 files changed, 74 insertions, 0 deletions
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 = {
+ ["<Esc>"] = { "<cmd> noh <CR>", "Clear highlights" },
+ },
+
+ t = {
+ ["<C-x>"] = {
+ vim.api.nvim_replace_termcodes("<C-\\><C-N>", true, true, true),
+ "Escape terminal mode"
+ },
+ },
+
+ v = {
+ ["<"] = { "<gv", "Indent line" },
+ [">"] = { ">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)