Last active
September 11, 2025 03:21
-
-
Save Finchasaurus/73f5da32a09c36f3540d1f0f653b94bd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- I use this for school on my work laptop which means no WSL and I must put up with PS :( | |
| vim.api.nvim_create_user_command("Preview", function() | |
| vim.cmd([[!powershell -Command "$d = Split-Path '%:p'; $f = Get-ChildItem $d -Filter *.html | Select-Object -First 1; if ($f) { start chrome $f.FullName } else { Write-Host 'No HTML file found' }"]]) | |
| end, {}) | |
| vim.cmd("colorscheme sorbet") | |
| vim.opt.tabstop = 2 | |
| vim.opt.shiftwidth = 2 | |
| vim.opt.expandtab = false | |
| vim.opt.number = true | |
| vim.opt.relativenumber = true | |
| vim.opt.splitright = true | |
| vim.opt.splitbelow = true | |
| vim.opt.undofile = true | |
| vim.opt.undodir = vim.fn.stdpath("config").."/undo" | |
| vim.opt.wrap = false | |
| vim.g.mapleader = " " | |
| local map = vim.keymap.set | |
| map({ "n", "i", "v" }, "<C-s>", "<Cmd>w<CR>") -- Ctrl+S = save | |
| map("n", "<C-q>", "<Cmd>q<CR>") -- Ctrl+Q = quit | |
| map("n", "<C-a>", "ggVG") -- Ctrl+A = select all | |
| map("i", "<C-z>", "<Esc>u") -- Ctrl+Z = undo | |
| map("i", "<S-Tab>", "<C-d>") -- Shift+Tab = outdent | |
| map("v", "<S-Tab>", "<gv") -- Shift+Tab = outdent selection | |
| map("n", "<C-h>", "<C-w>h") -- Ctrl+H = move window left | |
| map("n", "<C-j>", "<C-w>j") -- Ctrl+J = move window down | |
| map("n", "<C-k>", "<C-w>k") -- Ctrl+K = move window up | |
| map("n", "<C-l>", "<C-w>l") -- Ctrl+L = move window right | |
| map("n", "<Tab>", "<Cmd>bnext<CR>") -- Tab = next buffer | |
| map("n", "<S-Tab>", "<Cmd>bprevious<CR>") -- Shift+Tab = prev buffer | |
| map("v", "<C-c>", '"+y') -- Ctrl+C = copy | |
| map("n", "<C-v>", '"+p') -- Ctrl+V = paste | |
| map("i", "<C-v>", '<Esc>"+pa') -- Ctrl+V = paste in insert mode | |
| map("n", "<leader>tn", "<Cmd>tabnext<CR>") -- Leader + tn = next tab page | |
| map("n", "<leader>tp", "<Cmd>tabprevious<CR>") -- Leader + tp = previous tab page |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment