----------------------------------------------------------- -- General ----------------------------------------------------------- vim.opt.mouse = "a" -- Enable mouse support vim.opt.clipboard = "unnamedplus" -- Copy/paste to system clipboard vim.opt.termguicolors = true -- Enable 24-bit RGB colors vim.o.background = "light" vim.opt.hidden = true vim.opt.number = true vim.o.cursorlineopt = "both" vim.opt.conceallevel = 0 vim.opt.relativenumber = true vim.opt.showcmd = true vim.opt.showmode = true vim.opt.colorcolumn = "80" vim.opt.cursorline = true vim.opt.foldlevelstart = 99 vim.opt.showtabline = 1 vim.opt.laststatus = 3 -- Single status line across all buffers vim.opt.undofile = true vim.opt.list = true -- Show some invisible characters like tabs vim.opt.undodir = vim.fn.stdpath("config") .. "/undo" vim.o.sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal" -- TODO make it pretty with the highlights --vim.opt.winbar = '%!luaeval("_winbar()")' -- The winbar text, I don't know if it is possible to embed it directly here :( --vim.opt.winbar = "%=%m %t%=" ----------------------------------------------------------- -- Tabs, indent ----------------------------------------------------------- vim.opt.expandtab = true -- Use spaces instead of tabs vim.opt.shiftwidth = 2 -- Shift 4 spaces when tab vim.opt.tabstop = 2 -- 1 tab == 4 spaces vim.opt.smartindent = true -- Autoindent new lines ----------------------------------------------------------- -- Custom keymaps ----------------------------------------------------------- vim.api.nvim_set_keymap("i", "jk", "", {}) -- Use jk to exit insert mode vim.api.nvim_set_keymap("i", "kj", "", {}) -- Use kj to exit insert mode vim.api.nvim_set_keymap("t", "jk", "", {}) -- Use jk to exit terminal mode vim.api.nvim_set_keymap("t", "kj", "", {}) -- Use kj to exit terminal mode vim.api.nvim_set_keymap("t", "", "", { noremap = true }) -- Use Esc to exit terminal mode vim.api.nvim_set_keymap("i", "", ":tabnew", {}) -- New tab vim.api.nvim_set_keymap("n", "", ":tabnew", {}) -- New tab -- No arrow keys for movement --nnoremap --nnoremap --inoremap --inoremap --inoremap --inoremap --Left and right to switch buffers --nnoremap :bp --nnoremap :bn --_winbar = function() -- My custom winbar text --local filename = vim.fn.expand('%') --return string.gsub(filename, 'term://.*:', '') --end require("core.disable_builtin")