diff --git a/.config/dot/packages/pacman b/.config/dot/packages/pacman index b80ce06..307bc24 100644 --- a/.config/dot/packages/pacman +++ b/.config/dot/packages/pacman @@ -1 +1,2 @@ +neovim tmux diff --git a/.config/fish/config.fish b/.config/fish/config.fish index 6519211..7a51d28 100644 --- a/.config/fish/config.fish +++ b/.config/fish/config.fish @@ -1,5 +1,8 @@ source /usr/share/cachyos-fish-config/cachyos-config.fish +set -gx EDITOR nvim +set -gx VISUAL nvim + # overwrite greeting # potentially disabling fastfetch #function fish_greeting diff --git a/.config/fish/functions/vim.fish b/.config/fish/functions/vim.fish new file mode 100644 index 0000000..5d72a1f --- /dev/null +++ b/.config/fish/functions/vim.fish @@ -0,0 +1,3 @@ +function vim --wraps=nvim + nvim $argv +end diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua new file mode 100644 index 0000000..688a7b5 --- /dev/null +++ b/.config/nvim/init.lua @@ -0,0 +1,2 @@ +require("config.options") +require("config.keymaps") diff --git a/.config/nvim/lua/config/keymaps.lua b/.config/nvim/lua/config/keymaps.lua new file mode 100644 index 0000000..0bd51a3 --- /dev/null +++ b/.config/nvim/lua/config/keymaps.lua @@ -0,0 +1,10 @@ +local map = vim.keymap.set + +map("n", "", "h", { desc = "Move focus left" }) +map("n", "", "j", { desc = "Move focus down" }) +map("n", "", "k", { desc = "Move focus up" }) +map("n", "", "l", { desc = "Move focus right" }) + +map("n", "", "nohlsearch", { desc = "Clear search highlight" }) + +map("n", "e", "Lexplore", { desc = "Toggle file explorer" }) diff --git a/.config/nvim/lua/config/options.lua b/.config/nvim/lua/config/options.lua new file mode 100644 index 0000000..220a058 --- /dev/null +++ b/.config/nvim/lua/config/options.lua @@ -0,0 +1,38 @@ +vim.g.mapleader = " " + +local opt = vim.opt + +-- Clipboard: use neovim's built-in OSC 52 provider, no external binary needed. +vim.g.clipboard = "osc52" +opt.clipboard = "unnamedplus" + +opt.number = true +opt.relativenumber = true + +opt.shiftwidth = 2 +opt.tabstop = 2 +opt.expandtab = true + +opt.mouse = "a" + +-- Neovim's built-in default colors paint their own dark/light background even +-- without a colorscheme; clear it so the terminal's own background shows through. +for _, group in ipairs({ "Normal", "NormalNC", "NormalFloat", "SignColumn" }) do + vim.api.nvim_set_hl(0, group, { bg = "none" }) +end + +opt.undofile = true + +opt.ignorecase = true +opt.smartcase = true + +opt.splitright = true +opt.splitbelow = true + +opt.wrap = false + +opt.scrolloff = 8 +opt.cursorline = true + +vim.g.netrw_banner = 0 +vim.g.netrw_liststyle = 3 diff --git a/.github/keybindings.md b/.github/keybindings.md index a555859..6b3b698 100644 --- a/.github/keybindings.md +++ b/.github/keybindings.md @@ -32,3 +32,6 @@ Comma-separated keys are pressed in sequence, not together. | `Ctrl` + `Space`, `s` | tmux | Interactive session list | | `Ctrl` + `Space`, `(` / `)` | tmux | Switch to previous / next session | | `Ctrl` + `Space`, `r` | tmux | Reload `tmux.conf` | +| `Ctrl` + `h` / `j` / `k` / `l` | neovim | Move focus between splits left / down / up / right | +| `Esc` | neovim | Clear search highlight | +| `Space`, `e` | neovim | Toggle file explorer (netrw) |