-- space as a leader key vim.g.mapleader = " " vim.g.maplocalleader = " " -- flush buffer on focus change vim.g.autowrite = "on" -- Set to true if you have a Nerd Font installed and selected in the terminal vim.g.have_nerd_font = true vim.opt.completeopt = { "popup", "menu", "menuone", "noselect" } vim.opt.mouse = "a" -- allow the mouse to be used in Nvim -- Tab vim.opt.tabstop = 2 -- number of visual spaces per TAB vim.opt.softtabstop = 2 -- number of spaces in tab when editing vim.opt.shiftwidth = 2 -- insert 4 spaces on a tab vim.opt.expandtab = true -- tabs are spaces, mainly because of python -- UI config vim.opt.number = false -- show absolute number vim.opt.relativenumber = false -- add numbers to each line on the left side 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 vim.opt.showmode = false -- we are experienced, wo don't need the "-- INSERT --" mode hint vim.opt.wrap = false -- Sets how neovim will display certain whitespace characters in the editor. -- See `:help 'list'` -- and `:help 'listchars'` vim.opt.list = true vim.opt.listchars = { tab = "» ", trail = "·", nbsp = "␣" } -- Enable break indent -- Every wrapped line will continue visually indented (same amount of -- space as the beginning of that line), thus preserving horizontal blocks -- of text. vim.opt.breakindent = true -- Preview substitutions live, as you type! vim.opt.inccommand = "split" -- Searching vim.opt.incsearch = true -- search as characters are entered vim.opt.hlsearch = false -- 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 vim.g.clipboard = "wl-copy" vim.opt.clipboard:append("unnamedplus") vim.opt.backup = false -- Don't create backup files vim.opt.writebackup = false -- Don't create backup before writing vim.opt.swapfile = false -- Don't create swap files vim.opt.undofile = true -- Persistent undo -- Off signcolumn on by default vim.opt.signcolumn = "no" -- Decrease update time vim.opt.updatetime = 250 -- Decrease mapped sequence wait time -- Displays which-key popup sooner vim.opt.timeoutlen = 300 -- Minimal number of screen lines to keep above and below the cursor. vim.opt.scrolloff = 10 -- folds vim.opt.foldcolumn = "0" vim.opt.foldmethod = "expr" vim.opt.foldtext = "" -- vim.opt.foldnestmax = 3 vim.opt.foldlevel = 99 vim.opt.foldlevelstart = 99 vim.opt.splitright = true vim.opt.splitbelow = true vim.opt.cmdheight = 0 -- do not unload closed buffer from jumplist vim.opt.jumpoptions = "" vim.diagnostic.config({ virtual_text = true, underline = true }) vim.opt.sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions" vim.opt.switchbuf = "useopen,usetab" vim.cmd.packadd("cfilter") if vim.g.neovide then vim.g.neovide_scroll_animation_length = 0.1 -- Put anything you want to happen only in Neovide here vim.g.neovide_scroll_animation_far_lines = 1 vim.g.neovide_floating_shadow = false local function copy() vim.cmd([[normal! "+y]]) end local function paste() vim.api.nvim_paste(vim.fn.getreg("+"), true, -1) end vim.keymap.set("v", "", copy, { silent = true, desc = "Copy" }) vim.keymap.set({ "n", "i", "v", "c", "t" }, "", paste, { silent = true, desc = "Paste" }) end