local u = require 'config.utils' local o = vim.o -- basic stuff o.number = true vim.cmd('filetype plugin on') vim.cmd('syntax on') o.cmdheight = 2 vim.g.mapleader = ' ' -- line break (wrapping) settings o.linebreak = true o.breakindent = true o.showbreak = '\\ ' -- lines after end of file empty instead of ~ (fillchars) o.fcs = 'eob: ' -- tab o.expandtab = true o.softtabstop = 4 o.shiftwidth = 4 -- turn of gui colors if in tty if os.getenv('TERM') ~= 'linux' then o.termguicolors = true else o.termguicolors = false end -- diagnostics local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " } for type, icon in pairs(signs) do local hl = "DiagnosticSign" .. type vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl }) end vim.diagnostic.config({ virtual_text = { prefix = '●' }; }) -- terminal local m = u.mapping m.map('t', '', '') m.map('t', '', 'h') m.map('t', '', 'j') m.map('t', '', 'k') m.map('t', '', 'l') m.nmap('tm', 'belowright 7sptermsetlocal nonuA') -- off search highlight when escape is pressed m.nmap('', 'noh') -- yank to clipboard m.map('v', 'y', '"+y') -- spell checking m.cmd('sp', 'setlocal spell spelllang=en_us') m.cmd('nsp', 'setlocal nospell') -- colemak-dh local l = u.layout l.swap('n', 'h') l.swap('e', 'j') l.swap('i', 'k') l.swap('o', 'l') l.swap('n', 'h') l.swap('e', 'j') l.swap('i', 'k') l.swap('o', 'l') l.swap('N', 'H') l.swap('E', 'J') l.swap('I', 'K') l.swap('O', 'L') l.swap('N', 'H') l.swap('O', 'L') l.swap('', 'h') l.swap('', 'j') l.swap('', 'k') l.swap('', 'l')