-- these are my custom functions require("functions") --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", "", ":lua harpoon_bnext()") --map("n", "", ":lua harpoon_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", "x", ":bp|bd #") map("n", "t", ":tabnew") -- Move split map("n", "", "") map("n", "", "") map("n", "", "") map("n", "", "") -- 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") -- Terminal binds local term_command = "split | set norelativenumber | set nonumber | term" map("t", "", [[]]) map("n", [[\]], ":" .. term_command .. "") map("n", [[|]], ":v" .. term_command .. "") --------- -- HOP -- --------- local hop_opts = "{ create_hl_autocmd = true }" local hopword = [[lua require'hop'.hint_words(]] .. hop_opts .. [[)]] local hopline = [[lua require'hop'.hint_lines_skip_whitespace(]] .. hop_opts .. [[)]] 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", ":Files ~/") map("n", "p", ":Buffers") map("n", "h", ":Helptags") map("n", ";", ":History:") map("n", "c", ":Commands") map("n", "r", ":Rg ") map("n", "R", ":Rg") map("n", "s", ":Lines") map("n", "gf", ":GFiles") map("n", "gn", ":GFiles?") map("n", "gc", ":Commits") ------------------ -- FZF-CHECKOUT -- ------------------ map("n", "gb", ":GBranches") ------------- -- HARPOON -- ------------- --map("n", "m", [[:lua require("harpoon.mark").add_file() ]]) --map("n", "x", ":lua harpoon_rm_file()") --map("n", "ma", [[:lua harpoon_toggle_file()]]) --map("n", "mc", [[:lua harpoon_clear_all()]]) --map("n", "ml", [[:lua require("harpoon.ui").toggle_quick_menu()]]) --map("n", "mt", [[:lua harpoon_btoggle()]]) --map("n", "n", [[:lua require("harpoon.ui").nav_next() ]]) --map("n", "N", [[:lua require("harpoon.ui").nav_prev() ]]) -------------- -- NVIM FZF -- -------------- --map("n", "mm", [[:lua fzf_buffer_add_to_harpoon()]]) --map("n", "mo", [[:lua fzf_files_to_harpoon()]]) --map("n", "ml", [[:lua fzf_select_harpoon_mark()]]) -- RNVIMR -- https://github.com/kevinhwang91/rnvimr map("n", "f", [[:RnvimrToggle]])