config-neovim-basic/init.lua
2024-09-08 00:08:47 +08:00

48 lines
1.6 KiB
Lua

-- enable 24-bit color for nvim-notify
vim.o.termguicolors = true
-- Disable intro message on startup, or many other plugins will
-- close this message on load, which may cause a flash of intro message.
vim.opt.shortmess:append({ I = true })
vim.o.tabstop = 4
vim.o.shiftwidth = 0
vim.o.softtabstop = -1
vim.o.shiftround = true
vim.o.expandtab = true
vim.o.autoindent = true
vim.o.smartindent = true
vim.o.list = true
vim.o.relativenumber = true
vim.o.number = true
vim.o.colorcolumn = "101"
vim.g.mapleader = " "
vim.g.maplocalleader = " "
vim.keymap.set("n", "\\\\", "<cmd>split<cr>", { silent = true })
vim.keymap.set("n", "||", "<cmd>vsplit<cr>", { silent = true })
vim.keymap.set("n", "<leader>q", "<cmd>wincmd q<cr>", { silent = true })
vim.keymap.set("n", "<C-h>", "<cmd>wincmd h<cr>", { silent = true })
vim.keymap.set("n", "<C-j>", "<cmd>wincmd j<cr>", { silent = true })
vim.keymap.set("n", "<C-k>", "<cmd>wincmd k<cr>", { silent = true })
vim.keymap.set("n", "<C-l>", "<cmd>wincmd l<cr>", { silent = true })
vim.keymap.set("n", "<leader><C-h>", "<cmd>wincmd H<cr>", { silent = true })
vim.keymap.set("n", "<leader><C-j>", "<cmd>wincmd J<cr>", { silent = true })
vim.keymap.set("n", "<leader><C-k>", "<cmd>wincmd K<cr>", { silent = true })
vim.keymap.set("n", "<leader><C-l>", "<cmd>wincmd L<cr>", { silent = true })
vim.keymap.set("n", "]b", "<cmd>bnext<cr>", { silent = true })
vim.keymap.set("n", "[b", "<cmd>bprevious<cr>", { silent = true })
vim.keymap.set("n", "<leader>c", "<cmd>bdelete<cr>", { silent = true })
vim.keymap.set("n", "<leader>nh", "<cmd>nohlsearch<cr>", { silent = true })
vim.cmd.colorscheme("minimalist")