-- ██ -- ░░ -- ███████ █████ ██████ ██ ██ ██ ██████████ -- ░░██░░░██ ██░░░██ ██░░░░██░██ ░██░██░░██░░██░░██ -- ░██ ░██░███████░██ ░██░░██ ░██ ░██ ░██ ░██ ░██ -- ░██ ░██░██░░░░ ░██ ░██ ░░████ ░██ ░██ ░██ ░██ -- ███ ░██░░██████░░██████ ░░██ ░██ ███ ░██ ░██ -- ░░░ ░░ ░░░░░░ ░░░░░░ ░░ ░░ ░░░ ░░ ░░ -- -- ▓▓▓▓▓▓▓▓▓▓ -- ░▓ author ▓ xero -- ░▓ code ▓ https://code.x-e.ro/dotfiles -- ░▓ mirror ▓ https://git.io/.files -- ░▓▓▓▓▓▓▓▓▓▓ -- ░░░░░░░░░░ -- local f = require("utils.functions") local r = require("utils.remaps") -- buffers r.noremap("n", "", ":bn", "next buffer") r.noremap("n", "", ":bp", "prev buffer") r.noremap("n", "", ":bd", "exit buffer") -- tabs r.noremap("n", "l", "tablast", "Last Tab") r.noremap("n", "f", "tabfirst", "First Tab") r.noremap("n", "", "tabnew", "New Tab") r.noremap("n", "]", "tabnext", "Next Tab") r.noremap("n", "d", "tabclose", "Close Tab") r.noremap("n", "[", "tabprevious", "Previous Tab") -- json pretty print r.noremap("n", "j", ":%!jq .", "jq format") -- remove highlighting r.noremap("n", "", ":nohlsearch", "remove highlighting", { silent = true }) -- remove trailing white space f.cmd("Nows", "%s/\\s\\+$//e", { desc = "remove trailing whitespace" }) -- remove blank lines f.cmd("Nobl", "g/^\\s*$/d", { desc = "remove blank lines" }) -- spell check f.cmd("Sp", "setlocal spell! spell?", { desc = "toggle spell check" }) r.noremap("n", "s", ":Sp", "toggle spell check") -- ios keeb r.noremap("n", "", "0", "ios home key") r.noremap("i", "", "0", "ios home key") -- pseudo tail functionality f.cmd("Tail", 'set autoread | au CursorHold * checktime | call feedkeys("G")', { desc = "pseudo tail functionality" }) -- make current buffer executable f.cmd("Chmodx", "!chmod a+x %", { desc = "make current buffer executable" }) r.noremap("n", "x", ":Chmodx", "chmod +x buffer") -- fix syntax highlighting f.cmd("FixSyntax", "syntax sync fromstart", { desc = "reload syntax highlighting" }) -- vertical term f.cmd("T", ":vs | :set nu! | :term", { desc = "vertical terminal" }) -- the worst place in the universe r.noremap("n", "Q", "", "") -- move blocks r.noremap("v", "J", ":m '>+1gv=gv", "move block up") r.noremap("v", "K", ":m '<-2gv=gv", "move block down") -- focus scrolling r.noremap("n", "", "zz", "scroll down") r.noremap("n", "", "zz", "scroll up") -- focus highlight searches r.noremap("n", "n", "nzzzv", "next match") r.noremap("n", "N", "Nzzzv", "prev match") -- remove trailing whitespaces and ^M chars f.autocmd({ "BufWritePre" }, { pattern = { "*" }, callback = function(_) local save_cursor = vim.fn.getpos(".") vim.cmd [[%s/\s\+$//e]] vim.fn.setpos(".", save_cursor) end, })