--local fn = vim.fn -- to call Vim functions e.g. fn.bufnr() local function map(mode, lhs, rhs, opts) local options = {noremap = true} if opts then options = vim.tbl_extend("force", options, opts) end vim.api.nvim_set_keymap(mode, lhs, rhs, options) end vim.g.mapleader = "," map("v", "", '"+y') map("n", "", ":bnext") map("n", "", ":bprevious") map("n", "", ":noh", {silent = true}) --After searching, pressing escape stops the highlight map("n", "w", [[:%s/\s\+$//e ]]) map("n", "x", ":Bclose ") map("n", "t", ":tabnew ") -- Split navigations map("n", "", "") map("n", "", "") map("n", "", "") map("n", "", "") -- Resize split map("n", "", "-") map("n", "", "+") map("n", "", "<") map("n", "", ">") -- Scroll viewport map("n", "", "") map("n", "", "") map("v", "", "") map("v", "", "") map("i", "", "") map("i", "", "") -- Make visual yanks place the cursor back where started map("v", "y", "ygv") -- map Enter to switch tabs --map("n", "", ":tabnext") --map("n", "", ":tabprevious") --------- -- HOP -- --------- local hopword = [[lua require'hop'.hint_words()]] local hopline = [[lua require'hop'.hint_lines_skip_whitespace()]] --map("n", "", hopline, {silent = true}) --map("v", "", hopline, {silent = true}) --map("n", "", hopword, {silent = true}) --map("v", "", hopword, {silent = true}) map("n", "W", hopline, {silent = true}) map("v", "W", hopline, {silent = true}) map("n", "w", hopword, {silent = true}) map("v", "w", hopword, {silent = true}) --------- -- FZF -- --------- map("n", "o", ":Files ") map("n", "O", [[:lua vim.fn['fzf#vim#files']('~/') ]]) map("n", "g", ":GFiles ") map("n", "p", ":Buffers ") map("n", "h", ":Helptags ") map("n", ";", ":History: ") map("n", "c", ":Commands ") map("n", "s", ":Rg ") --map("n", "[", ":Windows ") --------- -- ALE -- --------- --map("n", "", ":ALEPreviousWrap ", {silent = true}) --map("n", "", ":ALENextWrap ", {silent = true})