more mappings, using harpoon
This commit is contained in:
parent
6fa2c608ab
commit
d2ccdfe1eb
3 changed files with 62 additions and 6 deletions
40
init.lua
40
init.lua
|
@ -26,7 +26,6 @@ vim.cmd("autocmd FileType yaml,yaml.ansible setlocal indentkeys-=0#")
|
||||||
vim.opt.guicursor = ""
|
vim.opt.guicursor = ""
|
||||||
|
|
||||||
require('plugins')
|
require('plugins')
|
||||||
|
|
||||||
require("colorschemes")
|
require("colorschemes")
|
||||||
|
|
||||||
vim.cmd("hi MatchParen cterm=bold,underline gui=bold,underline")
|
vim.cmd("hi MatchParen cterm=bold,underline gui=bold,underline")
|
||||||
|
@ -34,7 +33,19 @@ vim.cmd("hi MatchParen cterm=bold,underline gui=bold,underline")
|
||||||
vim.api.nvim_set_keymap("n", "<SPACE>", "<Nop>", { noremap = true })
|
vim.api.nvim_set_keymap("n", "<SPACE>", "<Nop>", { noremap = true })
|
||||||
vim.g.mapleader = " "
|
vim.g.mapleader = " "
|
||||||
|
|
||||||
for _, mode in ipairs({"n", "i"}) do
|
local harpoon_ui = require("harpoon.ui")
|
||||||
|
local harpoon_mark = require("harpoon.mark")
|
||||||
|
for _, mode in ipairs({"n", "i", "v"}) do
|
||||||
|
vim.keymap.set(mode, '<A-h>', harpoon_ui.toggle_quick_menu)
|
||||||
|
vim.keymap.set(mode, '<A-m>', harpoon_mark.add_file)
|
||||||
|
vim.keymap.set(mode, '<A-a>', function() harpoon_ui.nav_file(1) end, { noremap = true })
|
||||||
|
vim.keymap.set(mode, '<A-s>', function() harpoon_ui.nav_file(2) end, { noremap = true })
|
||||||
|
vim.keymap.set(mode, '<A-d>', function() harpoon_ui.nav_file(3) end, { noremap = true })
|
||||||
|
vim.keymap.set(mode, '<A-f>', function() harpoon_ui.nav_file(4) end, { noremap = true })
|
||||||
|
vim.keymap.set(mode, '<A-g>', function() harpoon_ui.nav_file(5) end, { noremap = true })
|
||||||
|
end
|
||||||
|
|
||||||
|
for _, mode in ipairs({"n", "v"}) do
|
||||||
vim.api.nvim_set_keymap(mode, "<Up>", "g<Up>", { noremap = true })
|
vim.api.nvim_set_keymap(mode, "<Up>", "g<Up>", { noremap = true })
|
||||||
vim.api.nvim_set_keymap(mode, "<Down>", "g<Down>", { noremap = true })
|
vim.api.nvim_set_keymap(mode, "<Down>", "g<Down>", { noremap = true })
|
||||||
vim.api.nvim_set_keymap(mode, "<Left>", "<Nop>", { noremap = true })
|
vim.api.nvim_set_keymap(mode, "<Left>", "<Nop>", { noremap = true })
|
||||||
|
@ -43,11 +54,30 @@ for _, mode in ipairs({"n", "i"}) do
|
||||||
vim.api.nvim_set_keymap(mode, "<Up>", "<Nop>", { noremap = true })
|
vim.api.nvim_set_keymap(mode, "<Up>", "<Nop>", { noremap = true })
|
||||||
end
|
end
|
||||||
|
|
||||||
|
vim.api.nvim_set_keymap('v', "<M-j>", ":MoveBlock(1)<CR>", { noremap = true })
|
||||||
|
vim.api.nvim_set_keymap('v', "<M-k>", ":MoveBlock(-1)<CR>", { noremap = true })
|
||||||
|
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>o", "<Cmd>lua vim.diagnostic.open_float()<CR>", { noremap = true })
|
vim.api.nvim_set_keymap("n", "<Leader>o", "<Cmd>lua vim.diagnostic.open_float()<CR>", { noremap = true })
|
||||||
vim.api.nvim_set_keymap("n", "<M-o>", "<Cmd>lua vim.diagnostic.open_float()<CR>", { noremap = true })
|
vim.api.nvim_set_keymap("n", "<M-o>", "<Cmd>lua vim.diagnostic.open_float()<CR>", { noremap = true })
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>i", "<Cmd>lua vim.lsp.buf.code_action()<CR>", { noremap = true })
|
vim.api.nvim_set_keymap("n", "<Leader>i", "<Cmd>lua vim.lsp.buf.code_action()<CR>", { noremap = true })
|
||||||
vim.api.nvim_set_keymap("n", "<M-i>", "<Cmd>lua vim.lsp.buf.code_action()<CR>", { noremap = true })
|
vim.api.nvim_set_keymap("n", "<M-i>", "<Cmd>lua vim.lsp.buf.code_action()<CR>", { noremap = true })
|
||||||
|
|
||||||
|
require('telescope').setup({
|
||||||
|
initial_mode = "normal"
|
||||||
|
})
|
||||||
|
local builtin = require('telescope.builtin')
|
||||||
|
vim.keymap.set('n', '<Leader>p', builtin.find_files, {})
|
||||||
|
|
||||||
|
-- toggle numbers with Alt+N
|
||||||
|
vim.keymap.set(
|
||||||
|
"n",
|
||||||
|
"<M-n>",
|
||||||
|
function()
|
||||||
|
vim.o.number = not vim.o.number;
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
-- require'lspconfig'.pyright.setup{}
|
-- require'lspconfig'.pyright.setup{}
|
||||||
local nvim_lsp = require'lspconfig'
|
local nvim_lsp = require'lspconfig'
|
||||||
nvim_lsp.pyright.setup{}
|
nvim_lsp.pyright.setup{}
|
||||||
|
@ -94,6 +124,12 @@ vim.diagnostic.config({
|
||||||
|
|
||||||
require('treesitter')
|
require('treesitter')
|
||||||
|
|
||||||
|
require('nvim_comment').setup()
|
||||||
|
--vim.keymap.set('v', '<A-->', "<Cmd>'<,'>CommentToggle<CR>")
|
||||||
|
--vim.keymap.set('n', '<A-->', "<Cmd>CommentToggle<CR>")
|
||||||
|
|
||||||
|
-- require('nvim-tree').setup()
|
||||||
|
|
||||||
-- -- trouble.nvim mappings
|
-- -- trouble.nvim mappings
|
||||||
-- vim.api.nvim_set_keymap("n", "<leader>xx", "<cmd>Trouble<cr>",
|
-- vim.api.nvim_set_keymap("n", "<leader>xx", "<cmd>Trouble<cr>",
|
||||||
-- {silent = true, noremap = true}
|
-- {silent = true, noremap = true}
|
||||||
|
|
|
@ -13,6 +13,7 @@ packer.startup(
|
||||||
use 'dcampos/nvim-snippy'
|
use 'dcampos/nvim-snippy'
|
||||||
use 'dcampos/cmp-snippy'
|
use 'dcampos/cmp-snippy'
|
||||||
use 'folke/tokyonight.nvim'
|
use 'folke/tokyonight.nvim'
|
||||||
|
use 'fedepujol/move.nvim'
|
||||||
use { "catppuccin/nvim", as = "catppuccin" }
|
use { "catppuccin/nvim", as = "catppuccin" }
|
||||||
-- use 'bluz71/vim-moonfly-colors'
|
-- use 'bluz71/vim-moonfly-colors'
|
||||||
-- use 'NLKNguyen/papercolor-theme'
|
-- use 'NLKNguyen/papercolor-theme'
|
||||||
|
@ -24,9 +25,18 @@ packer.startup(
|
||||||
require('nvim-treesitter.install').update({ with_sync = true })
|
require('nvim-treesitter.install').update({ with_sync = true })
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
use {
|
||||||
|
'nvim-telescope/telescope.nvim', tag = '0.1.0',
|
||||||
|
requires = { {'nvim-lua/plenary.nvim'} }
|
||||||
|
}
|
||||||
|
use 'ThePrimeagen/harpoon'
|
||||||
|
use 'terrortylor/nvim-comment'
|
||||||
--use {
|
--use {
|
||||||
-- 'nvim-telescope/telescope.nvim', tag = '0.1.0',
|
-- 'kyazdani42/nvim-tree.lua',
|
||||||
-- requires = { {'nvim-lua/plenary.nvim'} }
|
-- --requires = {
|
||||||
|
-- -- 'kyazdani42/nvim-web-devicons', -- optional, for file icons
|
||||||
|
-- --},
|
||||||
|
-- --tag = 'nightly' -- optional, updated every week. (see issue #1193)
|
||||||
--}
|
--}
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
|
@ -30,4 +30,14 @@ require'nvim-treesitter.configs'.setup {
|
||||||
-- Instead of true it can also be a list of languages
|
-- Instead of true it can also be a list of languages
|
||||||
additional_vim_regex_highlighting = false,
|
additional_vim_regex_highlighting = false,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
textobjects = {
|
||||||
|
lsp_interop = {
|
||||||
|
enable = true,
|
||||||
|
peek_definition_code = {
|
||||||
|
["<leader>df"] = "@function.outer",
|
||||||
|
["<leader>dF"] = "@class.outer",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue