This commit is contained in:
Alexander Gehrke 2023-09-08 12:06:53 +02:00
parent daa9394fd5
commit 41d779e3c7
4 changed files with 72 additions and 132 deletions

View file

@ -20,7 +20,7 @@ vim.opt.rtp:prepend(lazypath)
require("lazy").setup("plugins", {
dev = {
path = "~/projects/nvim/",
patterns = {"crater2150"},
patterns = { "crater2150" },
fallback = true
}
})
@ -45,6 +45,9 @@ vim.opt.shell = "/bin/zsh"
vim.opt.ignorecase = true
vim.opt.smartcase = true
vim.opt.inccommand = "split"
vim.opt.listchars = "tab:⇥\\ ,trail:-,nbsp:+,lead:␣"
vim.opt.list = true
vim.cmd [[hi link Whitespace Comment]]
vim.opt.wildmode = { "list:longest", "list:full" }
vim.opt.wildignore = { "*.so", "*.swp", "*.zip", "*.o" }
@ -76,35 +79,35 @@ vim.g.tex_flavor = 'latex'
local key = vim.keymap.set
key('n', '<space>', 'za', { desc = 'toggle fold' })
key('v', '.', '<cmd>normal .<CR>', { desc = 'repeat last command in visual mode' })
key('n', 'cy', '"*y', { desc = 'copy to system clipboard' })
key('n', '<space>', 'za', { desc = 'toggle fold' })
key('v', '.', '<cmd>normal .<CR>', { desc = 'repeat last command in visual mode' })
key('n', 'cy', '"*y', { desc = 'copy to system clipboard' })
key('t', '<C-q>', '<C-\\><C-n>', { desc = 'exit terminal mode' })
key('t', '<C-q>', '<C-\\><C-n>', { desc = 'exit terminal mode' })
-- Arrow keys for window movement and resizing
key('n', '<Left>', '<C-w>h')
key('n', '<Down>', '<C-w>j')
key('n', '<Up>', '<C-w>k')
key('n', '<Right>', '<C-w>l')
key('n', '<Left>', '<C-w>h')
key('n', '<Down>', '<C-w>j')
key('n', '<Up>', '<C-w>k')
key('n', '<Right>', '<C-w>l')
--
key('n', '<S-Left>', "<C-w><")
key('n', '<S-Left>', "<C-w><")
key('n', '<S-Right>', "<C-w>>")
key('n', '<S-Down>', "<C-w>-")
key('n', '<S-Up>', "<C-w>+")
key('n', '<S-Down>', "<C-w>-")
key('n', '<S-Up>', "<C-w>+")
key('n', '<M-[>', function() vim.fn.search('^[^[:space:])\\]}]', 'be') end, { desc = 'jump to previous unindented line' })
key('n', '<M-]>', function() vim.fn.search('^[^[:space:])\\]}]', 'e') end, { desc = 'jump to next unindented line' })
key('n', '<M-[>', function() vim.fn.search('^[^[:space:])\\]}]', 'be') end, { desc = 'jump to previous unindented line' })
key('n', '<M-]>', function() vim.fn.search('^[^[:space:])\\]}]', 'e') end, { desc = 'jump to next unindented line' })
key('i', '<C-U>', '<C-G>u<C-U>')
key('n', '&', ':&&<CR>')
key('x', '&', ':&&<CR>')
key('n', 'Y', 'y$')
key('i', '<C-U>', '<C-G>u<C-U>')
key('n', '&', ':&&<CR>')
key('x', '&', ':&&<CR>')
key('n', 'Y', 'y$')
key('i', '<C-Space>', '<C-x><C-o>', { desc = 'completion' })
key('n', '<C-l>', '<cmd>noh<CR><cmd>redraw!<CR>', { desc = 'clear search highlight' })
key('v', 'gs', "<cmd>'<,'>sort<CR>", { desc = 'sort selection' })
key('n', '<C-l>', '<cmd>noh<CR><cmd>redraw!<CR>', { desc = 'clear search highlight' })
key('v', 'gs', "<cmd>'<,'>sort<CR>", { desc = 'sort selection' })
key({ 'n', 'x' }, '<M-a>', "<Plug>(EasyAlign)", { desc = 'align selection' })
key({ 'n', 'x' }, '<M-a>', "<Plug>(EasyAlign)", { desc = 'align selection' })