Improve vim-motion-based line moving shortcuts
This commit is contained in:
parent
958eb8c791
commit
9732e4ae16
@ -14,18 +14,20 @@ end
|
|||||||
-- Move lines up and down
|
-- Move lines up and down
|
||||||
vim.api.nvim_set_keymap('n', '<A-Up>', ':m .-2<CR>==', { noremap = true, silent = true })
|
vim.api.nvim_set_keymap('n', '<A-Up>', ':m .-2<CR>==', { noremap = true, silent = true })
|
||||||
vim.api.nvim_set_keymap('n', '<A-Down>', ':m .+1<CR>==', { noremap = true, silent = true })
|
vim.api.nvim_set_keymap('n', '<A-Down>', ':m .+1<CR>==', { noremap = true, silent = true })
|
||||||
|
vim.api.nvim_set_keymap('n', '<A-k>', '<Esc>:m .-2<CR>i', { noremap = true, silent = true })
|
||||||
|
vim.api.nvim_set_keymap('n', '<A-j>', '<Esc>:m .+1<CR>i', { noremap = true, silent = true })
|
||||||
|
|
||||||
-- Move lines in insert mode
|
-- Move lines in insert mode
|
||||||
vim.api.nvim_set_keymap('i', '<A-Up>', '<Esc>:m .-2<CR>i', { noremap = true, silent = true })
|
vim.api.nvim_set_keymap('i', '<A-Up>', '<Esc>:m .-2<CR>i', { noremap = true, silent = true })
|
||||||
vim.api.nvim_set_keymap('i', '<A-Down>', '<Esc>:m .+1<CR>i', { noremap = true, silent = true })
|
vim.api.nvim_set_keymap('i', '<A-Down>', '<Esc>:m .+1<CR>i', { noremap = true, silent = true })
|
||||||
vim.api.nvim_set_keymap('i', '<A-S-k>', '<Esc>:m .-2<CR>i', { noremap = true, silent = true })
|
vim.api.nvim_set_keymap('i', '<A-k>', '<Esc>:m .-2<CR>i', { noremap = true, silent = true })
|
||||||
vim.api.nvim_set_keymap('i', '<A-S-j>', '<Esc>:m .+1<CR>i', { noremap = true, silent = true })
|
vim.api.nvim_set_keymap('i', '<A-j>', '<Esc>:m .+1<CR>i', { noremap = true, silent = true })
|
||||||
|
|
||||||
-- Copy lines up and down in normal mode
|
-- Copy lines up and down in normal mode
|
||||||
vim.api.nvim_set_keymap('n', '<C-A-S-Up>', ':t .-1<CR>', { noremap = true, silent = true })
|
vim.api.nvim_set_keymap('n', '<C-A-S-Up>', ':t .-1<CR>', { noremap = true, silent = true })
|
||||||
vim.api.nvim_set_keymap('n', '<C-A-S-Down>', ':t .-1<CR>', { noremap = true, silent = true })
|
vim.api.nvim_set_keymap('n', '<C-A-S-Down>', ':t .-1<CR>', { noremap = true, silent = true })
|
||||||
vim.api.nvim_set_keymap('n', '<C-A-S-k>', ':t .-1<CR>', { noremap = true, silent = true })
|
vim.api.nvim_set_keymap('n', '<C-A-S-k>', ':t .-1<CR>', { noremap = true, silent = true })
|
||||||
vim.api.nvim_set_keymap('n', '<C-A-S-j>', ':t .+1<CR>', { noremap = true, silent = true })
|
vim.api.nvim_set_keymap('n', '<C-A-S-j>', ':t .<CR>', { noremap = true, silent = true })
|
||||||
|
|
||||||
-- Copy lines up and down in insert mode
|
-- Copy lines up and down in insert mode
|
||||||
vim.api.nvim_set_keymap('i', '<C-A-S-Up>', '<Esc>:t.-1<CR>i', { noremap = true, silent = true })
|
vim.api.nvim_set_keymap('i', '<C-A-S-Up>', '<Esc>:t.-1<CR>i', { noremap = true, silent = true })
|
||||||
@ -66,8 +68,8 @@ keymap.set('n', '<leader><leader>m', ':MarkdownPreview<CR>', opts("Preview Markd
|
|||||||
|
|
||||||
-- window navigation
|
-- window navigation
|
||||||
keymap.set("n", "<A-h>", "<C-w>h", opts())
|
keymap.set("n", "<A-h>", "<C-w>h", opts())
|
||||||
keymap.set("n", "<A-j>", "<C-w>j", opts())
|
keymap.set("n", "<A-S-j>", "<C-w>j", opts())
|
||||||
keymap.set("n", "<A-k>", "<C-w>k", opts())
|
keymap.set("n", "<A-S-k>", "<C-w>k", opts())
|
||||||
keymap.set("n", "<A-l>", "<C-w>l", opts())
|
keymap.set("n", "<A-l>", "<C-w>l", opts())
|
||||||
|
|
||||||
-- window resize
|
-- window resize
|
||||||
|
@ -29,7 +29,16 @@ return {
|
|||||||
quotes = {
|
quotes = {
|
||||||
type = "text",
|
type = "text",
|
||||||
align = "center",
|
align = "center",
|
||||||
content = {[["It's not as hard as it looks..."]]},
|
content = function ()
|
||||||
|
local handle = io.popen("pwd")
|
||||||
|
if handle then
|
||||||
|
local cwd = handle:read("*l")
|
||||||
|
handle:close()
|
||||||
|
return {"Currently in " .. cwd}
|
||||||
|
else
|
||||||
|
return {"Error running command"}
|
||||||
|
end
|
||||||
|
end,
|
||||||
highlight = "String",
|
highlight = "String",
|
||||||
default_color = "#FFFFFF"
|
default_color = "#FFFFFF"
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user