Files
2026-08-17 12:19:37 +04:00

45 lines
1.7 KiB
Lua

-- Use OSC52 only when we are in an SSH session
-- Without this part clipboard via SSH doesn't work properly
-- But if don't use SSH (X11 or Wayland session) then this part would only mess things up
if vim.env.SSH_CLIENT or vim.env.SSH_TTY then
vim.g.clipboard = {
name = "OSC52",
copy = {
["+"] = require("vim.ui.clipboard.osc52").copy("+"),
["*"] = require("vim.ui.clipboard.osc52").copy("*"),
},
paste = {
["+"] = require("vim.ui.clipboard.osc52").paste("+"),
["*"] = require("vim.ui.clipboard.osc52").paste("*"),
},
}
end
vim.opt.clipboard = "unnamedplus"
vim.opt.completeopt = {'menu', 'menuone', 'noselect'}
-- Tab
vim.opt.tabstop = 2 -- number of visual spaces per TAB
vim.opt.softtabstop = 2 -- number of spacesin tab when editing
vim.opt.shiftwidth = 2 -- insert 2 spaces on a tab
vim.opt.expandtab = true -- tabs are spaces, mainly because of python
-- UI config
vim.opt.number = true -- show absolute number
vim.opt.cursorline = true -- highlight cursor line underneath the cursor horizontally
vim.opt.splitbelow = true -- open new vertical split bottom
vim.opt.splitright = true -- open new horizontal splits right
vim.opt.termguicolors = true -- enable 24-bit RGB color in the TUI
-- Searching
vim.opt.incsearch = true -- search as characters are entered
vim.opt.hlsearch = true -- do (not) highlight matches
vim.opt.ignorecase = true -- ignore case in searches by default
vim.opt.smartcase = true -- but make it case sensitive if an uppercase is entered
-- Code folding
vim.opt.foldmethod = "indent"