owenrusk.dev

dotfiles

shell, editor, ssh.

git clone https://owenrusk.dev/dotfiles.git

commit 1693b0d767e1028cf3d54cd218b8fd4648d9baa9
parent ee6167325616681bd8b9b1ba8c23838225d143e4
author Owen Rusk <owen@papermothgames.com>
date   2024-03-04 20:31:05 -0600
nvim: options and a few keymaps
install.sh+1-0
nvim/init.lua+3-0
nvim/lua/owen/keymaps.lua+18-0
nvim/lua/owen/options.lua+32-0
diff --git a/install.sh b/install.sh
index 666ce09..8175593 100755
--- a/install.sh
+++ b/install.sh
@@ -10,4 +10,5 @@ link() {
 
 link zsh/zshenv "$HOME/.zshenv"
 link zsh/zshrc "$HOME/.zshrc"
+link nvim "$HOME/.config/nvim"
 link git/config "$HOME/.config/git/config"
diff --git a/nvim/init.lua b/nvim/init.lua
new file mode 100644
index 0000000..a05f9cf
--- /dev/null
+++ b/nvim/init.lua
@@ -0,0 +1,3 @@
+-- no plugins. neovim does enough on its own.
+require("owen.options")
+require("owen.keymaps")
diff --git a/nvim/lua/owen/keymaps.lua b/nvim/lua/owen/keymaps.lua
new file mode 100644
index 0000000..10c0a43
--- /dev/null
+++ b/nvim/lua/owen/keymaps.lua
@@ -0,0 +1,18 @@
+vim.g.mapleader = " "
+
+local map = vim.keymap.set
+
+map("n", "<Esc>", "<cmd>nohlsearch<cr>")
+map("n", "<leader>w", "<cmd>write<cr>")
+map("n", "<leader>e", "<cmd>Explore<cr>")
+map("n", "<leader>f", ":find ")
+map("n", "<leader>b", ":buffer ")
+
+-- keep the selection when indenting
+map("v", "<", "<gv")
+map("v", ">", ">gv")
+
+map("n", "]q", "<cmd>cnext<cr>")
+map("n", "[q", "<cmd>cprev<cr>")
+
+map("t", "<Esc><Esc>", [[<C-\><C-n>]])
diff --git a/nvim/lua/owen/options.lua b/nvim/lua/owen/options.lua
new file mode 100644
index 0000000..89da8b7
--- /dev/null
+++ b/nvim/lua/owen/options.lua
@@ -0,0 +1,32 @@
+local o = vim.opt
+
+o.number = true
+o.signcolumn = "yes"
+o.mouse = "a"
+o.clipboard = "unnamedplus"
+
+o.expandtab = true
+o.shiftwidth = 4
+o.tabstop = 4
+o.softtabstop = 4
+o.smartindent = true
+
+o.ignorecase = true
+o.smartcase = true
+o.inccommand = "split"
+o.path:append("**")
+
+o.undofile = true
+o.swapfile = false
+o.splitright = true
+o.splitbelow = true
+o.scrolloff = 5
+o.wrap = false
+o.list = true
+o.listchars = { tab = "> ", trail = "·", nbsp = "+" }
+o.updatetime = 300
+o.termguicolors = true
+
+vim.g.netrw_banner = 0
+
+vim.cmd.colorscheme("habamax")