summaryrefslogtreecommitdiff
path: root/lua/config
diff options
context:
space:
mode:
Diffstat (limited to 'lua/config')
-rw-r--r--lua/config/keymap.lua14
-rw-r--r--lua/config/lazy.lua28
-rw-r--r--lua/config/opt.lua26
3 files changed, 68 insertions, 0 deletions
diff --git a/lua/config/keymap.lua b/lua/config/keymap.lua
new file mode 100644
index 0000000..cfe0692
--- /dev/null
+++ b/lua/config/keymap.lua
@@ -0,0 +1,14 @@
+-- Leaders
+vim.g.mapleader = " "
+vim.g.maplocalleader = "\\"
+
+-- Move lines up/down in visual mode
+vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
+vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
+
+-- Keep cursor position when joining
+vim.keymap.set("n", "J", "mzJ`z")
+
+-- Center search terms
+vim.keymap.set("n", "n", "nzz")
+vim.keymap.set("n", "N", "Nzz")
diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua
new file mode 100644
index 0000000..7e90925
--- /dev/null
+++ b/lua/config/lazy.lua
@@ -0,0 +1,28 @@
+-- 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)
+
+-- Setup lazy.nvim
+require("lazy").setup({
+ spec = {
+ -- import your plugins
+ { import = "plugins" },
+ },
+ -- Configure any other settings here. See the documentation for more details.
+ -- colorscheme that will be used when installing plugins.
+ install = { colorscheme = { "habamax" } },
+ checker = { enabled = false },
+})
diff --git a/lua/config/opt.lua b/lua/config/opt.lua
new file mode 100644
index 0000000..60b1d5b
--- /dev/null
+++ b/lua/config/opt.lua
@@ -0,0 +1,26 @@
+-- Relative line numbers
+vim.opt.number = true
+vim.opt.relativenumber = true
+
+-- 4 space tabs
+vim.opt.tabstop = 4
+vim.opt.softtabstop = 0
+vim.opt.shiftwidth = 4
+vim.opt.smarttab = true
+
+-- Smart indenting
+vim.opt.autoindent = true
+vim.opt.smartindent = true
+
+-- No line wrap
+vim.opt.wrap = false
+
+-- Search highlighting
+vim.opt.hlsearch = false
+vim.opt.incsearch = true
+
+-- Keep 9 lines on top/bottom
+vim.opt.scrolloff = 9
+
+-- 80 char col
+vim.opt.colorcolumn = "80"