-- Change diagnostic signs. vim.fn.sign_define("DiagnosticSignError", { text = "✗", texthl = "DiagnosticSignError" }) vim.fn.sign_define("DiagnosticSignWarn", { text = "!", texthl = "DiagnosticSignWarn" }) vim.fn.sign_define("DiagnosticSignInformation", { text = "", texthl = "DiagnosticSignInfo" }) vim.fn.sign_define("DiagnosticSignHint", { text = "", texthl = "DiagnosticSignHint" }) -- global config for diagnostic vim.diagnostic.config({ underline = false, virtual_text = true, signs = true, severity_sort = true, }) -- Variables HOME = os.getenv("HOME") -- Basic Functions/Settings vim.opt.backspace = "indent,eol,start" -- backspace works on every char in insert mode vim.opt.completeopt = 'menuone,noselect' vim.opt.history = 1000 vim.opt.startofline = true -- UI vim.opt.background= 'dark' vim.opt.termguicolors = true vim.opt.ttyfast = true vim.opt.autoread = true vim.opt.hlsearch = true vim.opt.number = true vim.opt.title = true vim.opt.scrolloff = 1000 -- center current line in screen vim.opt.synmaxcol = 300 -- stop syntax highlight after x lines for performance vim.opt.laststatus = 2 -- always show status line -- Styleguide/Preferences vim.opt.autoindent = true -- Localization vim.opt.encoding = "utf-8" vim.opt.dictionary = '/usr/share/dict/words' vim.opt.spelllang = 'en_ca' -- Define files to spellcheck vim.api.nvim_create_autocmd( { "BufRead", "BufNewFile" },{ pattern = { "gitcommit", "gitrebase", "*.txt", "*.md", "*.tex" }, command = "setlocal spell" } ) -- Mapping Timeouts vim.opt.timeout = false vim.opt.ttimeout = true vim.opt.ttimeoutlen = 100 -- Display Hints/Highlights vim.opt.colorcolumn="101" vim.api.nvim_set_hl(0, 'ColorColumn', { bg='red' }) vim.api.nvim_set_hl(0, 'TODO', { bg='white' }) vim.api.nvim_set_hl(0, 'ExtraWhitespace', { bg='lightred' }) vim.cmd[[ match ExtraWhitespace /\s\+\%#\@i mmgg=G`m vim.g.mapleader = ',' vim.g.maplocalleader = '\\' vim.keymap.set("i", "kj", "", { silent = true }) -- Configure tabline vim.cmd([[ set showtabline=2 let g:tablabel = "%N%{flagship#tabmodified()} %{flagship#tabcwds('shorten',',')}" ]])