Updated config

This commit is contained in:
2024-03-02 17:06:30 +01:00
parent d6871eb3b9
commit 30c02876e8
15 changed files with 193 additions and 155 deletions

View File

@ -4,17 +4,28 @@ end
-- Basics
map("n", ";", ":", "Command mode")
map("n", "qq", "<cmd>qa!<cr>", "Quit all")
map("n", "U", "<cmd>redo<cr>", "Redo")
map({ "i", "n" }, "<esc>", "<cmd>noh<cr><esc>", "Clear search")
map({ "i", "n", "s", "v" }, "<C-s>", "<cmd>w<cr><esc>", "Save file")
map("n", "<C-l>", "^Da", "Rewrite line")
map("i", "<C-l>", "<esc>^Da", "Rewrite line")
map("n", "<C-a>", "ggVG", "Select all")
map("n", "<C-r>", ":%s/<C-R><C-W>//g<Left><Left>", "Replace word under cursor")
map({ "n", "v" }, "<C-b>", "^", "Beginning of line")
map("i", "<C-b>", "<esc>^i", "Beginning of line")
map({ "i", "n", "v" }, "<C-e>", "<end>", "End of line")
map("n", "qq", "<cmd>qa!<cr>", "Quit all")
-- Editing multiple instances
map("n", "<C-d>", "*#", "Search word under cursor")
map("n", "<C-r>", "*#:%s//<C-r><C-w>", "Replace word under cursor")
map("v", "<C-d>", "y/<C-r>\"<cr>N", "Search selection")
map("v", "<C-r>", "y/<C-r>\"<cr>N:%s//<C-r>\"", "Replace selection")
-- Increasing and decreasing numbers
map("n", "+", "<C-a>", "Increase number")
map("n", "-", "<C-x>", "Decrease number")
map("n", "<kPlus>", "<C-a>", "Increase number")
map("n", "<kMinus>", "<C-x>", "Decrease number")
-- Buffer management
map("n", "<C-n>", "<cmd>enew<cr>", "New file")

View File

@ -8,50 +8,46 @@ end
-- Options
local opt = vim.opt
opt.autoindent = true
opt.autowrite = false
opt.clipboard = "unnamedplus"
opt.completeopt = "menu,menuone,noinsert"
opt.conceallevel = 0
opt.cursorline = true
opt.cursorlineopt = "number"
opt.expandtab = false
opt.grepformat = "%f:%l:%c:%m"
opt.grepprg = "rg --grep"
opt.ignorecase = false
opt.mouse = "a"
opt.ruler = false
opt.sessionoptions = { "buffers", "curdir", "tabpages", "winsize" }
opt.shiftwidth = 4
opt.shortmess:append "scCFI"
opt.showmode = false
opt.showtabline = 0
opt.smartindent = true
opt.softtabstop = 4
opt.spell = false
opt.splitbelow = true
opt.splitright = true
opt.tabstop = 4
opt.termguicolors = true
opt.undofile = true
opt.undolevels = 10000
opt.updatetime = 250
opt.virtualedit = "onemore"
opt.wildmode = "longest:full,full"
opt.wrap = false
-- Indentation
opt.autoindent = true
opt.expandtab = false
opt.shiftwidth = 4
opt.smartindent = true
opt.softtabstop = 4
opt.tabstop = 4
-- UI
opt.fillchars = { eob = " ", vert = " " }
opt.laststatus = 0
opt.number = true
opt.relativenumber = false
opt.showtabline = 0
opt.signcolumn = "yes"
opt.statusline = "%{repeat('─',winwidth('.'))}"
-- Neovide
if g.neovide then
opt.linespace = 3
g.neovide_fullscreen = true
g.neovide_transparency = 0.92
vim.o.guifont = "UbuntuMono Nerd Font:h20:#h-none"
end
-- Undo
opt.undofile = true
opt.undolevels = 10000