Merge pull request #186 from Akianonymus/main

Use jdhao/better-escape.vim | Allow moving the cursor through wrapped lines normally
This commit is contained in:
siduck76 2021-07-26 15:26:21 +05:30 committed by GitHub
commit 22ea576682
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 6 deletions

View File

@ -18,14 +18,17 @@ map("v", "x", [=[ "_x ]=], opt)
this line too ]] this line too ]]
-- --
-- escape with 'jk' mapping
vim.api.nvim_set_keymap("i", "jk", "<esc>", {})
vim.api.nvim_set_keymap("v", "jk", "<esc>", {})
vim.api.nvim_set_keymap("t", "jk", "<esc>", {})
-- Don't copy the replaced text after pasting in visual mode -- Don't copy the replaced text after pasting in visual mode
map("v", "p", '"_dP', opt) map("v", "p", '"_dP', opt)
-- Allow moving the cursor through wrapped lines with j, k, <Up> and <Down>
-- http://www.reddit.com/r/vim/comments/2k4cbr/problem_with_gj_and_gk/
-- empty mode is same as using :map
map("", "j", 'v:count ? "j" : "gj"', {expr = true})
map("", "k", 'v:count ? "k" : "gk"', {expr = true})
map("", "<Down>", 'v:count ? "j" : "gj"', {expr = true})
map("", "<Up>", 'v:count ? "k" : "gk"', {expr = true})
-- OPEN TERMINALS -- -- OPEN TERMINALS --
map("n", "<C-l>", ":vnew +terminal | setlocal nobuflisted <CR>", opt) -- term over right map("n", "<C-l>", ":vnew +terminal | setlocal nobuflisted <CR>", opt) -- term over right
map("n", "<C-x>", ":10new +terminal | setlocal nobuflisted <CR>", opt) -- term bottom map("n", "<C-x>", ":10new +terminal | setlocal nobuflisted <CR>", opt) -- term bottom

View File

@ -16,6 +16,14 @@ return packer.startup(
event = "VimEnter" event = "VimEnter"
} }
use {
"jdhao/better-escape.vim",
event = "InsertEnter",
config = function()
require "plugins.others".escape()
end
}
use { use {
"akinsho/nvim-bufferline.lua", "akinsho/nvim-bufferline.lua",
after = "nvim-base16.lua", after = "nvim-base16.lua",

View File

@ -15,6 +15,11 @@ M.comment = function()
end end
end end
M.escape = function()
vim.g.better_escape_interval = 300
vim.g.better_escape_shortcut = {"jk"}
end
M.lspkind = function() M.lspkind = function()
local present, lspkind = pcall(require, "lspkind") local present, lspkind = pcall(require, "lspkind")
if present then if present then