init.lua: move mappings to lua/mappings.lua
This commit is contained in:
parent
686b31c6e0
commit
c0c294c4c8
17
init.lua
17
init.lua
@ -33,21 +33,7 @@ require('lazy-config')
|
||||
-- [[ Setting options ]]
|
||||
require('general-options')
|
||||
-- [[ Basic Keymaps ]]
|
||||
|
||||
-- Keymaps for better default experience
|
||||
-- See `:help vim.keymap.set()`
|
||||
vim.keymap.set({ 'n', 'v' }, '<Space>', '<Nop>', { silent = true })
|
||||
|
||||
-- Remap for dealing with word wrap
|
||||
vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
|
||||
vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
|
||||
|
||||
-- Diagnostic keymaps
|
||||
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic message' })
|
||||
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnostic message' })
|
||||
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' })
|
||||
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' })
|
||||
|
||||
require('mappings')
|
||||
-- [[ Highlight on yank ]]
|
||||
-- See `:help vim.highlight.on_yank()`
|
||||
local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true })
|
||||
@ -381,7 +367,6 @@ cmp.setup {
|
||||
|
||||
-- Personnalisation
|
||||
require('bepo')
|
||||
require('mappings')
|
||||
require('restore-position')
|
||||
|
||||
-- The line beneath this is called `modeline`. See `:help modeline`
|
||||
|
@ -7,7 +7,22 @@ for key, binding in pairs(map_list) do
|
||||
vim.api.nvim_set_keymap("n", key, binding .. "<CR>", {noremap = true, silent = true})
|
||||
end
|
||||
|
||||
-- vim.api.nvim_set_keymap("n", "<Leader>y", '"+y', {noremap = true, silent = true})
|
||||
-- vim.api.nvim_set_keymap("v", "<Leader>y", '"+y', {noremap = true, silent = true})
|
||||
-- vim.api.nvim_set_keymap("n", "<Leader>pp", '"+p', {noremap = true, silent = true})
|
||||
-- vim.api.nvim_set_keymap("v", "<Leader>pp", '"+p', {noremap = true, silent = true})
|
||||
-- [[ kickstart.nvim ]]
|
||||
-- Keymaps for better default experience
|
||||
-- See `:help vim.keymap.set()`
|
||||
vim.keymap.set({ 'n', 'v' }, '<Space>', '<Nop>', { silent = true })
|
||||
|
||||
-- Remap for dealing with word wrap
|
||||
vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
|
||||
vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
|
||||
|
||||
-- Diagnostic keymaps
|
||||
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic message' })
|
||||
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnostic message' })
|
||||
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' })
|
||||
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' })
|
||||
|
||||
vim.api.nvim_set_keymap("n", "<Leader>y", '"+y', {noremap = true, silent = true})
|
||||
vim.api.nvim_set_keymap("v", "<Leader>y", '"+y', {noremap = true, silent = true})
|
||||
vim.api.nvim_set_keymap("n", "<Leader>pp", '"+p', {noremap = true, silent = true})
|
||||
vim.api.nvim_set_keymap("v", "<Leader>pp", '"+p', {noremap = true, silent = true})
|
||||
|
Loading…
Reference in New Issue
Block a user