add personalize mappings and plugins
This commit is contained in:
parent
ac78e7d9e7
commit
b1bbff8470
57
init.lua
57
init.lua
|
@ -91,7 +91,7 @@ vim.g.mapleader = ' '
|
||||||
vim.g.maplocalleader = ' '
|
vim.g.maplocalleader = ' '
|
||||||
|
|
||||||
-- Set to true if you have a Nerd Font installed and selected in the terminal
|
-- Set to true if you have a Nerd Font installed and selected in the terminal
|
||||||
vim.g.have_nerd_font = false
|
vim.g.have_nerd_font = true
|
||||||
|
|
||||||
-- [[ Setting options ]]
|
-- [[ Setting options ]]
|
||||||
-- See `:help vim.opt`
|
-- See `:help vim.opt`
|
||||||
|
@ -102,7 +102,7 @@ vim.g.have_nerd_font = false
|
||||||
vim.opt.number = true
|
vim.opt.number = true
|
||||||
-- You can also add relative line numbers, to help with jumping.
|
-- You can also add relative line numbers, to help with jumping.
|
||||||
-- Experiment for yourself to see if you like it!
|
-- Experiment for yourself to see if you like it!
|
||||||
-- vim.opt.relativenumber = true
|
vim.opt.relativenumber = true
|
||||||
|
|
||||||
-- Enable mouse mode, can be useful for resizing splits for example!
|
-- Enable mouse mode, can be useful for resizing splits for example!
|
||||||
vim.opt.mouse = 'a'
|
vim.opt.mouse = 'a'
|
||||||
|
@ -176,19 +176,44 @@ vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagn
|
||||||
vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' })
|
vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' })
|
||||||
|
|
||||||
-- TIP: Disable arrow keys in normal mode
|
-- TIP: Disable arrow keys in normal mode
|
||||||
-- vim.keymap.set('n', '<left>', '<cmd>echo "Use h to move!!"<CR>')
|
vim.keymap.set('n', '<left>', '<cmd>echo "Use h to move!!"<CR>')
|
||||||
-- vim.keymap.set('n', '<right>', '<cmd>echo "Use l to move!!"<CR>')
|
vim.keymap.set('n', '<right>', '<cmd>echo "Use l to move!!"<CR>')
|
||||||
-- vim.keymap.set('n', '<up>', '<cmd>echo "Use k to move!!"<CR>')
|
vim.keymap.set('n', '<up>', '<cmd>echo "Use k to move!!"<CR>')
|
||||||
-- vim.keymap.set('n', '<down>', '<cmd>echo "Use j to move!!"<CR>')
|
vim.keymap.set('n', '<down>', '<cmd>echo "Use j to move!!"<CR>')
|
||||||
|
|
||||||
|
|
||||||
|
vim.g.mapleader = ' '
|
||||||
|
vim.keymap.set('n', '<leader>pv', vim.cmd.Ex)
|
||||||
|
|
||||||
|
vim.keymap.set('v', 'J', ":m '>+1<CR>gv=gv")
|
||||||
|
vim.keymap.set('v', 'K', ":m '<-2<CR>gv=gv")
|
||||||
|
|
||||||
|
vim.keymap.set('n', 'J', 'mzJ`z')
|
||||||
|
vim.keymap.set('n', '<C-d>', '<C-d>zz')
|
||||||
|
vim.keymap.set('n', '<C-u>', '<C-u>zz')
|
||||||
|
vim.keymap.set('n', 'n', 'nzzzv')
|
||||||
|
vim.keymap.set('n', 'N', 'Nzzzv')
|
||||||
|
-- greatest remap ever
|
||||||
|
vim.keymap.set('x', '<leader>p', [["_dP]])
|
||||||
|
|
||||||
|
vim.keymap.set('n', 'Q', '<nop>')
|
||||||
|
vim.keymap.set('n', '<leader>f', '<cmd>FormatWrite<CR>')
|
||||||
|
|
||||||
|
vim.keymap.set('n', '<C-k>', '<cmd>cnext<CR>zz')
|
||||||
|
vim.keymap.set('n', '<C-j>', '<cmd>cprev<CR>zz')
|
||||||
|
vim.keymap.set('n', '<leader>k', '<cmd>lnext<CR>zz')
|
||||||
|
vim.keymap.set('n', '<leader>j', '<cmd>lprev<CR>zz')
|
||||||
|
|
||||||
|
vim.keymap.set('n', '<leader>x', '<cmd>!chmod +x %<CR>', { silent = true })
|
||||||
|
|
||||||
-- Keybinds to make split navigation easier.
|
-- Keybinds to make split navigation easier.
|
||||||
-- Use CTRL+<hjkl> to switch between windows
|
-- Use CTRL+<hjkl> to switch between windows
|
||||||
--
|
--
|
||||||
-- See `:help wincmd` for a list of all window commands
|
-- See `:help wincmd` for a list of all window commands
|
||||||
vim.keymap.set('n', '<C-h>', '<C-w><C-h>', { desc = 'Move focus to the left window' })
|
-- vim.keymap.set('n', '<C-h>', '<C-w><C-h>', { desc = 'Move focus to the left window' })
|
||||||
vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right window' })
|
-- vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right window' })
|
||||||
vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { desc = 'Move focus to the lower window' })
|
-- vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { desc = 'Move focus to the lower window' })
|
||||||
vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' })
|
-- vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' })
|
||||||
|
|
||||||
-- [[ Basic Autocommands ]]
|
-- [[ Basic Autocommands ]]
|
||||||
-- See `:help lua-guide-autocommands`
|
-- See `:help lua-guide-autocommands`
|
||||||
|
@ -912,11 +937,13 @@ require('lazy').setup({
|
||||||
-- Here are some example plugins that I've included in the Kickstart repository.
|
-- Here are some example plugins that I've included in the Kickstart repository.
|
||||||
-- Uncomment any of the lines below to enable them (you will need to restart nvim).
|
-- Uncomment any of the lines below to enable them (you will need to restart nvim).
|
||||||
--
|
--
|
||||||
-- require 'kickstart.plugins.debug',
|
require 'kickstart.plugins.debug',
|
||||||
-- require 'kickstart.plugins.indent_line',
|
require 'kickstart.plugins.indent_line',
|
||||||
-- require 'kickstart.plugins.lint',
|
require 'kickstart.plugins.lint',
|
||||||
-- require 'kickstart.plugins.autopairs',
|
require 'kickstart.plugins.autopairs',
|
||||||
-- require 'kickstart.plugins.neo-tree',
|
require 'kickstart.plugins.neo-tree',
|
||||||
|
require 'custom.plugins.harpoon',
|
||||||
|
require 'custom.plugins.copilot',
|
||||||
-- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
|
-- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
|
||||||
|
|
||||||
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
|
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
-- You can add your own plugins here or in other files in this directory!
|
||||||
|
-- I promise not to create any merge conflicts in this directory :)
|
||||||
|
--
|
||||||
|
-- See the kickstart.nvim README for more information
|
||||||
|
return {
|
||||||
|
'github/copilot.vim',
|
||||||
|
config = function()
|
||||||
|
end,
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
-- You can add your own plugins here or in other files in this directory!
|
||||||
|
-- I promise not to create any merge conflicts in this directory :)
|
||||||
|
--
|
||||||
|
-- See the kickstart.nvim README for more information
|
||||||
|
return {
|
||||||
|
'theprimeagen/harpoon',
|
||||||
|
config = function()
|
||||||
|
require('harpoon').setup {}
|
||||||
|
|
||||||
|
local mark = require 'harpoon.mark'
|
||||||
|
local ui = require 'harpoon.ui'
|
||||||
|
|
||||||
|
vim.keymap.set('n', '<leader>a', mark.add_file)
|
||||||
|
vim.keymap.set('n', '<C-e>', ui.toggle_quick_menu)
|
||||||
|
end,
|
||||||
|
}
|
Loading…
Reference in New Issue