dotvim/lua/config/common.lua

64 lines
1.7 KiB
Lua
Raw Permalink Normal View History

2022-10-22 05:45:38 +00:00
-- colors
2022-12-22 23:51:53 +00:00
vim.cmd.colorscheme('nightfox')
2022-10-22 05:45:38 +00:00
-- leader
vim.g.mapleader = ' '
2023-10-13 17:47:36 +00:00
-- editorconfig
vim.g.editorconfig = false
2022-10-22 05:45:38 +00:00
-- options
2024-08-05 00:59:34 +00:00
vim.opt.autoread = true
2022-10-22 05:45:38 +00:00
vim.opt.autowrite = true
2024-08-05 00:59:34 +00:00
vim.opt.clipboard = 'unnamedplus'
2022-10-22 05:45:38 +00:00
vim.opt.completeopt = 'menuone,noselect'
vim.opt.expandtab = true
vim.opt.fileformats = 'unix,dos,mac'
vim.opt.foldenable = false
vim.opt.guicursor = 'n:blinkon0'
2024-10-03 17:21:10 +00:00
vim.opt.ignorecase = true
2022-10-22 05:45:38 +00:00
vim.opt.linebreak = true
2023-04-23 02:37:53 +00:00
vim.opt.listchars = 'tab:» ,eol:↲,space:·'
2022-10-22 05:45:38 +00:00
vim.opt.modeline = false
vim.opt.modelines = 0
2023-05-03 03:51:18 +00:00
vim.opt.mouse = 'nv'
vim.opt.mousemodel = 'extend'
2022-10-22 05:45:38 +00:00
vim.opt.number = true
vim.opt.shiftround = true
vim.opt.shiftwidth = 4
2022-11-06 17:37:29 +00:00
vim.opt.showmode = false
2024-10-03 17:21:10 +00:00
vim.opt.smartcase = true
2022-12-23 05:54:32 +00:00
vim.opt.spell = false
2022-10-22 05:45:38 +00:00
vim.opt.swapfile = false
vim.opt.tabstop = 4
vim.opt.termguicolors = true
vim.opt.updatetime = 300
vim.opt.wrap = false
vim.opt.writebackup = false
-- common keymaps
vim.keymap.set('i', '<c-c>', '<esc>')
2024-10-03 00:33:07 +00:00
vim.keymap.set('n', '<bs>', '<cmd>bp|bd#<cr>')
2022-10-22 05:45:38 +00:00
vim.keymap.set('n', '<c-c><c-c>', '<cmd>nohlsearch<cr>')
vim.keymap.set('n', '<leader><leader>', '<cmd>b#<cr>')
vim.keymap.set('n', '<leader>w', '<cmd>w<cr>')
vim.keymap.set('n', '<leader>x', '<cmd>x<cr>')
2024-10-03 00:33:07 +00:00
vim.keymap.set('n', '<c-bs>', '<cmd>BuffDeleteAllButCurrent<cr>')
2023-12-01 05:56:44 +00:00
vim.keymap.set('n', 'Y', 'y$')
2022-10-22 05:45:38 +00:00
vim.keymap.set('n', 'j', 'gj')
vim.keymap.set('n', 'k', 'gk')
-- split keymaps
vim.keymap.set('n', '<a-=>', '<c-w><c-=>')
vim.keymap.set('n', '<a-h>', '<c-w><')
vim.keymap.set('n', '<a-j>', '<c-w>+')
vim.keymap.set('n', '<a-k>', '<c-w>-')
vim.keymap.set('n', '<a-l>', '<c-w>>')
vim.keymap.set('n', '<c-h>', '<c-w>h')
vim.keymap.set('n', '<c-j>', '<c-w>j')
vim.keymap.set('n', '<c-k>', '<c-w>k')
vim.keymap.set('n', '<c-l>', '<c-w>l')
2024-10-01 05:21:11 +00:00
-- terminal keymaps
vim.keymap.set('t', '<esc>', '<c-\\><c-n>')