summaryrefslogtreecommitdiff
path: root/lua/config
diff options
context:
space:
mode:
Diffstat (limited to 'lua/config')
-rw-r--r--lua/config/keymaps.lua17
-rw-r--r--lua/config/lazy.lua27
-rw-r--r--lua/config/options.lua25
3 files changed, 69 insertions, 0 deletions
diff --git a/lua/config/keymaps.lua b/lua/config/keymaps.lua
new file mode 100644
index 0000000..af9a88e
--- /dev/null
+++ b/lua/config/keymaps.lua
@@ -0,0 +1,17 @@
+local map = vim.keymap.set
+
+-- move between windows
+map("n", "<C-h>", "<C-w>h")
+map("n", "<C-j>", "<C-w>j")
+map("n", "<C-k>", "<C-w>k")
+map("n", "<C-l>", "<C-w>l")
+
+-- clear highligths and command
+map("n", "<Esc>", "<cmd>nohlsearch<CR><cmd>echo<CR>")
+
+-- file explorer
+map("n", "-", "<cmd>Ex<CR>")
+
+-- copy and paste using the system clipboard
+map({"n", "v"}, "<leader>y", '"+y')
+map({"n", "v"}, "<leader>p", '"+p')
diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua
new file mode 100644
index 0000000..f82efed
--- /dev/null
+++ b/lua/config/lazy.lua
@@ -0,0 +1,27 @@
+-- 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" },
+ },
+ install = { colorscheme = { "gruvbox" } },
+ change_detection = { notify = false },
+ ui = { border = "rounded" }
+})
diff --git a/lua/config/options.lua b/lua/config/options.lua
new file mode 100644
index 0000000..00ebeff
--- /dev/null
+++ b/lua/config/options.lua
@@ -0,0 +1,25 @@
+vim.g.mapleader = " "
+
+local opt = vim.opt
+
+opt.expandtab = true
+opt.tabstop = 2
+opt.shiftwidth = 0
+
+opt.nu = true
+opt.rnu = true
+opt.signcolumn = "yes"
+
+opt.splitright = true
+opt.splitbelow = true
+
+opt.showmode = false
+
+opt.winborder = "rounded"
+
+opt.virtualedit = "block"
+
+-- netrw config
+vim.g.netrw_banner = 0
+
+vim.diagnostic.config({ virtual_text = true })