Add some further keybindinds and plugins
This commit is contained in:
parent
c0300b52cb
commit
ce1d0686fd
41
init.lua
41
init.lua
|
@ -243,6 +243,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.
|
||||||
|
@ -264,7 +272,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
|
||||||
|
@ -296,11 +304,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
|
||||||
|
|
||||||
|
@ -609,6 +612,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' })
|
||||||
|
@ -633,3 +647,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'})
|
||||||
|
|
Loading…
Reference in New Issue