-- Load tokyonight color scheme plugin vim.opt.rtp:prepend("~/.config/nvim/holtrop.nvim/tokyonight.nvim") vim.cmd([[colorscheme tokyonight-night]]) -- Load fzf-lua plugin vim.opt.rtp:prepend("~/.config/nvim/holtrop.nvim/fzf-lua.nvim") vim.cmd([[runtime plugin/fzf-lua.lua]]) -- Show titlestring in GUI window title vim.opt.title = true vim.opt.titlestring = "%t%m%r%{exists('g:project_name') ? ' : '.g:project_name : ''}" vim.opt.modeline = false vim.opt.colorcolumn = "80" vim.opt.cursorcolumn = true vim.opt.cursorline = true vim.opt.so = 8 vim.opt.wildmode = {'list:longest'} vim.opt.splitbelow = true vim.opt.splitright = true vim.g.editorconfig = false local holtrop_bufread_group = vim.api.nvim_create_augroup("holtrop_bufread_group", { clear = true }) vim.api.nvim_create_autocmd({ "BufReadPost", "BufNewFile" }, { group = holtrop_bufread_group, pattern = "*", callback = function() vim.schedule(function() if vim.bo.filetype ~= "make" then vim.opt_local.expandtab = true end vim.opt_local.ts = 4 vim.opt_local.sw = 4 vim.opt_local.sts = 4 vim.opt_local.cinoptions = ":0,g0" end) end, }) -- Shortcuts vim.cmd([[map :FzfLua combine pickers=buffers,git_files]]) vim.cmd([[map f :FzfLua combine pickers=buffers,files]]) vim.cmd([[inoremap O]]) vim.cmd([[vnoremap < >gv]]) vim.cmd([[nnoremap ,t :tabn]]) vim.cmd([[nnoremap ,T :tabp]]) vim.cmd([[nnoremap :tabmove -1]]) vim.cmd([[nnoremap :tabmove +1]]) -- Use system clipboard for unnamed register vim.opt.clipboard = "unnamedplus" -- Reload file automatically if changed externally vim.o.autoread = true vim.api.nvim_create_autocmd({ "FocusGained", "BufEnter" }, { group = vim.api.nvim_create_augroup("AutoRead", { clear = true }), callback = function() if vim.fn.mode() ~= 'c' then vim.cmd("checktime") end end, }) vim.filetype.add({filename = {["Rsconscript"] = "ruby"}})