添加maps.lua映射插件快捷键

This commit is contained in:
Sakura 2022-09-22 12:01:44 +08:00
parent d0d6edfe8c
commit ba33951e86
3 changed files with 4 additions and 15 deletions

View File

@ -15,3 +15,5 @@ require "user.lualine"
require "config.init" require "config.init"
-- 按键映射 -- 按键映射
require "config.vimrc" require "config.vimrc"
-- 插件按键映射
require "config.maps"

View File

@ -6,7 +6,7 @@ vim.g.loaded_netrwPlugin = 1
-- Leader/local leader -- Leader/local leader
g.mapleader = [[ ]] g.mapleader = [[ ]]
g.maplocalleader = [[,]] g.maplocalleader = [[ ]]
-- Skip some remote provider loading -- Skip some remote provider loading
g.loaded_python3_provider = 0 g.loaded_python3_provider = 0
@ -56,19 +56,6 @@ local silent = {
local map = vim.api.nvim_set_keymap local map = vim.api.nvim_set_keymap
-- Save buffer
map('i', '<c-s>', '<esc><cmd>w<cr>a', silent)
map('n', '<leader>w', '<cmd>w<cr>', silent)
-- 退出、关闭缓冲区等。
map('n', '<leader>q', '<cmd>qa<cr>', silent)
map('n', '<leader>x', '<cmd>x!<cr>', silent)
map('n', '<leader>d', '<cmd>Sayonara<cr>', {
silent = true,
nowait = true,
noremap = true
})
-- utf8 -- utf8
vim.g.encoding = "UTF-8" vim.g.encoding = "UTF-8"
vim.o.fileencoding = 'utf-8' vim.o.fileencoding = 'utf-8'
@ -88,7 +75,7 @@ vim.wo.signcolumn = "yes:1"
-- vim.wo.colorcolumn = "80" -- vim.wo.colorcolumn = "80"
-- vim.opt.textwidth = 80 -- vim.opt.textwidth = 80
-- 预览命令的效果, 命令更改会在原位置显示 -- 预览命令的效果, 命令更改会在原位置显示 nosplit, split
vim.opt.inccommand = 'nosplit' vim.opt.inccommand = 'nosplit'
-- 如果光标移动到括号或者大括号,则会显示与它相匹配的另外一个括号或者大括号 -- 如果光标移动到括号或者大括号,则会显示与它相匹配的另外一个括号或者大括号
vim.opt.showmatch = true vim.opt.showmatch = true

0
lua/config/maps.lua Normal file
View File