-- settings vim.o.nu = true -- truecolor vim.o.termguicolors = true -- color scheme --vim.g.colors_name = "jellybeans" --vim.api.nvim_command("color jellybeans") vim.api.nvim_command("let g:dracula_colorterm = 0") vim.api.nvim_command("color dracula") vim.o.hlsearch = true --vim.g.syntax = "on" -- unknown how to do this in lua, but is default on vim.o.expandtab = true vim.o.tabstop = 4 vim.o.softtabstop = 4 vim.o.shiftwidth = 4 vim.o.colorcolumn = "80" vim.o.scrolloff = 4 vim.o.mouse = "a" vim.o.guifont = "JetBrainsMono 10" vim.api.nvim_command('au BufEnter * hi ColorColumn guibg=red ctermbg=red') -- git commit vim.api.nvim_command('autocmd FileType gitcommit setlocal colorcolumn=50,72') -- Allow tabs in Makefiles. vim.api.nvim_command('autocmd FileType make,automake set noexpandtab shiftwidth=4 softtabstop=4') -- Trailing whitespace and tabs are forbidden, so highlight them. vim.api.nvim_command('highlight ForbiddenWhitespace ctermbg=yellow guibg=yellow') vim.api.nvim_command('match ForbiddenWhitespace /\\s\\+$\\|\\t/') -- Do not highlight spaces at the end of line while typing on that line. vim.api.nvim_command('autocmd InsertEnter * match ForbiddenWhitespace /\\t\\|\\s\\+\\%#\\@/dev/null' let l:output = system(l:cmd) let l:output = substitute(l:output, '[\r\n]*$', '', '') execute 'normal i' . l:output endfunction nmap i :call CJKInput() ]]) --vim.cmd('nmap q :echo "I accidentally hit q, I don\'t use macros"') --vim.cmd('vmap q :echo "I accidentally hit q, I don\'t use macros"') vim.cmd('nmap q :lua vim.g.quickcomment_togglecommentline()') vim.cmd('vmap q :luado vim.g.quickcomment_togglecommentline(linenr)') vim.g.quickcomment_whitespaceprefix = 1 require'nvim-treesitter.configs'.setup { ensure_installed = { "c", "cpp", "rust", "lua" }, sync_install = false, ignore_install = { "javascript" }, highlight = { enable = true, disable = {}, additional_vim_regex_highlighting = false, }, } vim.g.foldmethod_treesitter_fn = function () vim.opt.foldmethod = "expr" vim.opt.foldexpr = "nvim_treesitter#foldexpr()" end