diff --git a/init.lua b/init.lua index 11b15b1..48ee312 100644 --- a/init.lua +++ b/init.lua @@ -1 +1,78 @@ -print("hello") +vim.g.mapleader = ' ' +vim.g.maplocalleader = ' ' + +vim.g.have_nerd_font = false + +-- show line numbers +vim.opt.number = true + +-- tabs +vim.opt.tabstop = 4 +vim.opt.softtabstop = 4 +vim.opt.shiftwidth = 4 +vim.opt.expandtab = true + +-- indent +vim.opt.smartindent = true + +-- enable mouse +vim.opt.mouse = 'a' + +-- don't show mode in bottom left +vim.opt.showmode = false + +--[[ +-- Every wrapped line will continue visually indented (same amount of +-- space as the beginning of that line), thus preserving horizontal blocks +-- of text. +--]] +vim.opt.breakindent = true + +-- save undo history +vim.opt.undofile = true + +-- Case-insensitive searching UNLESS \C or one or more capital letters in the search term +vim.opt.ignorecase = true +vim.opt.smartcase = true + +vim.opt.signcolumn = 'yes' + +-- decrease time until writing to swap file +vim.opt.updatetime = 250 + +-- decrease mapped sequence wait time +-- displays which-key popup sooner +vim.opt.timeoutlen = 300 + +-- Configure how new splits should be opened +vim.opt.splitright = true +vim.opt.splitbelow = true + +-- show whitespace +vim.opt.list = true +vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' } + +-- preview substitutions while typing +vim.opt.inccommand = 'split' + +-- Show which line your cursor is on +vim.opt.cursorline = true + +-- Minimal number of screen lines to keep above and below the cursor. +vim.opt.scrolloff = 5 + + +-- BASIC KEYMAPS -- + +-- Clear highlights on search when pressing in normal mode +vim.keymap.set('n', '', 'nohlsearch') + + +-- BASIC AUTOCOMMANDS -- +vim.api.nvim_create_autocmd('TextYankPost', { + desc = 'Highlight when yanking test', + group = vim.api.nvim_create_augroup('highlight-yank', { clear = true }), + callback = function() + vim.highlight.on_yank() + end, +})