Add some further keybindinds and plugins

This commit is contained in:
Julian Raufelder 2023-09-03 00:41:35 +02:00
parent 9682dda165
commit 235b9c5f49
No known key found for this signature in database
1 changed files with 35 additions and 6 deletions

View File

@ -260,6 +260,14 @@ require('lazy').setup({
'tpope/vim-dadbod', 'tpope/vim-dadbod',
'kristijanhusak/vim-dadbod-ui', 'kristijanhusak/vim-dadbod-ui',
'kristijanhusak/vim-dadbod-completion', 'kristijanhusak/vim-dadbod-completion',
{
-- Highlight, edit, and navigate code
'ThePrimeagen/harpoon',
dependencies = {
'nvim-lua/plenary.nvim',
},
},
'mbbill/undotree',
-- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart -- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart
-- These are some example plugins that I've included in the kickstart repository. -- These are some example plugins that I've included in the kickstart repository.
@ -281,7 +289,7 @@ require('lazy').setup({
-- NOTE: You can change these options as you wish! -- NOTE: You can change these options as you wish!
-- Set highlight on search -- Set highlight on search
vim.o.hlsearch = true vim.o.hlsearch = false
-- Make line numbers default -- Make line numbers default
vim.wo.number = true vim.wo.number = true
@ -313,11 +321,6 @@ vim.api.nvim_create_autocmd({ "BufLeave", "FocusLost", "InsertEnter", "CmdlineEn
-- Enable mouse mode -- Enable mouse mode
vim.o.mouse = 'a' vim.o.mouse = 'a'
-- Sync clipboard between OS and Neovim.
-- Remove this option if you want your OS clipboard to remain independent.
-- See `:help 'clipboard'`
vim.o.clipboard = 'unnamedplus'
-- Enable break indent -- Enable break indent
vim.o.breakindent = true vim.o.breakindent = true
@ -646,6 +649,17 @@ cmp.setup {
vim.keymap.set('i', 'jj', '<esc>', { desc = 'Closes insert mode' }) vim.keymap.set('i', 'jj', '<esc>', { desc = 'Closes insert mode' })
vim.keymap.set('n', 'ec', ':', { desc = 'Execute command' }) vim.keymap.set('n', 'ec', ':', { desc = 'Execute command' })
vim.keymap.set('v', 'J', ":m '>+1<CR>gv=gv", { desc = 'Move line down' })
vim.keymap.set('v', 'K', ":m '<-2<CR>gv=gv", { desc = 'Move line up' })
vim.keymap.set('x', '<leader>p', "\"_dP", { desc = '[P]aste with previous still in buffer' })
vim.keymap.set('n', '<leader>y', "\"+y", { desc = '[Y]ank to system clipboard' })
vim.keymap.set('v', '<leader>y', "\"+y", { desc = '[Y]ank to system clipboard' })
vim.keymap.set('n', '<leader>Y', "\"+Y", { desc = '[Y]ank to system clipboard' })
vim.keymap.set('n', '<leader>rr', [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]], { desc = '[R]ename by [R]egex pattern' })
-- map capital b and e to end/start line, should be default? -- map capital b and e to end/start line, should be default?
vim.keymap.set('n', 'B', '_', { desc = 'Jump to line [B]eginning' }) vim.keymap.set('n', 'B', '_', { desc = 'Jump to line [B]eginning' })
vim.keymap.set('n', 'E', '$', { desc = 'Jump to line [E]nding' }) vim.keymap.set('n', 'E', '$', { desc = 'Jump to line [E]nding' })
@ -670,3 +684,18 @@ vim.keymap.set('n', '<leader>nu', '<Cmd>DBUIToggle<Cr>', { desc = 'Toggle UI' })
vim.keymap.set('n', '<leader>nf', '<Cmd>DBUIFindBuffer<Cr>', { desc = 'Find buffer' }) vim.keymap.set('n', '<leader>nf', '<Cmd>DBUIFindBuffer<Cr>', { desc = 'Find buffer' })
vim.keymap.set('n', '<leader>nr', '<Cmd>DBUIRenameBuffer<Cr>', { desc = 'Rename buffer' }) vim.keymap.set('n', '<leader>nr', '<Cmd>DBUIRenameBuffer<Cr>', { desc = 'Rename buffer' })
vim.keymap.set('n', '<leader>nq', '<Cmd>DBUILastQueryInfo<Cr>', { desc = 'Last query info' }) vim.keymap.set('n', '<leader>nq', '<Cmd>DBUILastQueryInfo<Cr>', { desc = 'Last query info' })
-- harpoon
local mark = require('harpoon.mark')
local ui = require('harpoon.ui')
vim.keymap.set('n', '<leader>h', mark.add_file, { desc = 'Add file to harpoon'})
vim.keymap.set('n', '<C-e>', ui.toggle_quick_menu, { desc = 'Toggle harpoon quick menu'})
vim.keymap.set('n', '<C-h>', function () ui.nav_file(1) end, { desc = 'Harpoon file 1'})
vim.keymap.set('n', '<C-t>', function () ui.nav_file(2) end, { desc = 'Harpoon file 2'})
vim.keymap.set('n', '<C-n>', function () ui.nav_file(3) end, { desc = 'Harpoon file 3'})
vim.keymap.set('n', '<C-s>', function () ui.nav_file(4) end, { desc = 'Harpoon file 4'})
-- undotree
vim.keymap.set('n', '<leader>u', vim.cmd.UndotreeToggle , { desc = 'Toggle Undotree'})