neovim-config/init.lua

91 lines
2.0 KiB
Lua
Raw Normal View History

2024-09-26 03:32:48 +00:00
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 <Esc> in normal mode
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
2024-09-26 03:53:04 +00:00
-- file browser
vim.keymap.set('n', '<leader>pv', '<cmd>Ex<CR>')
2024-09-27 03:07:26 +00:00
-- switch between buffers
vim.keymap.set('n', '<A-n>', '<cmd>bnext<CR>')
vim.keymap.set('n', '<A-p>', '<cmd>bprev<CR>')
2024-09-26 03:32:48 +00:00
-- 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,
})
2024-09-26 03:53:04 +00:00
-- OTHER THINGS --
require("shillerben.lazy")
require("shillerben.lsp")