-- (VIM) Remaps Space bar as the Leader command vim.keymap.set("n", "pv", vim.cmd.Ex) --(NAVIGATION) --Switches to the Left window vim.keymap.set("n","h", ":wincmd h",{ silent = true }) --Switches to the Bottom window vim.keymap.set("n","j", ":wincmd j",{ silent = true } ) --Switches to the Top window vim.keymap.set("n","k", ":wincmd k",{ silent = true }) --Switches to the Right window vim.keymap.set("n","l", ":wincmd l",{ silent = true }) --(FILES) vim.keymap.set("n", "pf", ":Sex! :vertical resize 30") --(POSITION) --[P]ut one line [U]p everything from the cursor till the end of the line vim.keymap.set("n","pu", "d$Op") --[P]ut one line [D]own everything from the cursor till the end of the line vim.keymap.set("n","pd", "d$op") --Put at then end of the [L]ine [U]pper from the cursor (everything from the cursor till the end of the line) vim.keymap.set("n","lu", "DkApjddkI") --Put at then end of the [L]ine [D]own(er) from the cursor (everything from the cursor till the end of the line) vim.keymap.set("n","ld", "DjApkddjI") -- Classic Vim's Windo [U]p and [D]onw controls but keeps the cursor in the middle vim.keymap.set("n", "", "zz") vim.keymap.set("n", "", "zz") -- Classic Vim's [n]ext and [N]previous controls but keeps the cursor in the middle vim.keymap.set("n", "n", "nzzzv") vim.keymap.set("n", "N", "Nzzzv") -- Mooves what's under the cursor vim.keymap.set("v", "J", ":m '>+1gv=gv") vim.keymap.set("v", "K", ":m '<-2gv=gv") --(COPY PASTE) -- Copy to your clipboard of your system and not in the internal buffer of vim vim.keymap.set({"n", "v"}, "y", [["+y]]) vim.keymap.set("n", "Y", [["+Y]]) --(WORD) Manipulation --[W]ord [R]reformat for word under the cursor -- Replace Madness from the primeagen vim.keymap.set("n", "wr", [[:%s/\<\>//gI]]) --[C]hange [W]ord in registered buffer To be more similar to whant vim implment vim.keymap.set("n","cw", "ebvey/0Ncw") --[C]hange [N]ext word in registered buffer To be more similar to what vim implements vim.keymap.set("n","cn", "ncw") --[W]ord [N]ext occurence for word under the cursor vim.keymap.set("n","wn", "ebvey/0") --[W]ord [P]revious occurence for word under the cursor vim.keymap.set("n","wp", "ebvey/0NN") --[W]ord [S]earch for word under the cursor vim.keymap.set("n","ws", "ebvey/0") --[W]ord [F]ind [F]irst for word under the cursor vim.keymap.set("n","wff", "ebveyG/0", { silent = true }) --[W]ord [F]ind [L]ast for word under the cursor vim.keymap.set("n","wfl", "ebveyG/0N",{ silent = true }) --(ADDERS) --[A]dds a [)] at the end of the line vim.keymap.set("n","a)", "A)I") --[A]dds a [}] at the end of the line vim.keymap.set("n","a}", "A}I") --[A]dds a ["]"] at the end of the line vim.keymap.set("n","a]", "A]I") --(DEBUGER) vim.keymap.set("n","db", ":Termdebug :vertical resize 30") vim.keymap.set("n","ts", ":Step", { silent = true }) vim.keymap.set("n","to", ":Over", { silent = true }) vim.keymap.set("n","tn", ":Next", { silent = true }) vim.keymap.set("n","tc", ":Cont", { silent = true }) --QUICKFIX Navigation for going to the next errors and so on vim.keymap.set("n", "ne", "cnextzz") vim.keymap.set("n", "me", "cprevzz") vim.keymap.set("n", "nl", "lnextzz") vim.keymap.set("n", "ml", "lprevzz") --(TERMINAL COMMANDS) -- Makes current file executable vim.keymap.set("n", "x", "!chmod +x %", { silent = true }) --SNIPPETS------------------------------------------------------------ -- Command Read template move cursor vim.keymap.set("n","shs", ":-1read $HOME/.config/nvim/snippets/html_skeleton.html5jwf>a") vim.keymap.set("n","shb", ":-1read $HOME/.config/nvim/snippets/html_vertical_bracets.html:s/VARTOCHANGE//g") vim.keymap.set("n","sht", ":-1read $HOME/.config/nvim/snippets/html_horizontal_bracets.html:.,+2s/VARTOCHANGE//g") vim.keymap.set("n","scf", ":-1read $HOME/.config/nvim/snippets/c_for.cyi)/0N:s/VARTOCHANGE//g") vim.keymap.set("n","scs", ":-1read $HOME/.config/nvim/snippets/c_switch.cyi)/0Ncw") vim.keymap.set("n","scw", ":-1read $HOME/.config/nvim/snippets/c_while.cyi)/0Ncw") ----------------------------------------------------------------------