|
|
|
@ -8,42 +8,29 @@ vim.g.maplocalleader = ' '
|
|
|
|
|
|
|
|
|
|
vim.g.have_nerd_font = true
|
|
|
|
|
|
|
|
|
|
vim.opt.shiftwidth = 4
|
|
|
|
|
vim.opt.tabstop = 4
|
|
|
|
|
|
|
|
|
|
vim.g.mapleader = ' '
|
|
|
|
|
vim.g.maplocalleader = ' '
|
|
|
|
|
|
|
|
|
|
vim.g.have_nerd_font = true
|
|
|
|
|
|
|
|
|
|
-- tabs appear as 4 spaces
|
|
|
|
|
vim.opt.tabstop = 4
|
|
|
|
|
vim.opt.shiftwidth = 4
|
|
|
|
|
|
|
|
|
|
-- Make line numbers default
|
|
|
|
|
vim.opt.number = true
|
|
|
|
|
vim.opt.relativenumber = true
|
|
|
|
|
vim.opt.signcolumn = 'yes'
|
|
|
|
|
|
|
|
|
|
vim.opt.mouse = 'a'
|
|
|
|
|
vim.opt.showmode = true
|
|
|
|
|
|
|
|
|
|
-- Supposedly reduces load time
|
|
|
|
|
vim.schedule(function()
|
|
|
|
|
vim.opt.clipboard = 'unnamedplus'
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
vim.opt.breakindent = true
|
|
|
|
|
vim.opt.undofile = true
|
|
|
|
|
vim.opt.tabstop = 4
|
|
|
|
|
vim.opt.shiftwidth = 4
|
|
|
|
|
|
|
|
|
|
vim.opt.undofile = true
|
|
|
|
|
vim.opt.ignorecase = true
|
|
|
|
|
vim.opt.smartcase = true
|
|
|
|
|
|
|
|
|
|
vim.opt.signcolumn = 'yes'
|
|
|
|
|
|
|
|
|
|
vim.opt.updatetime = 250
|
|
|
|
|
vim.opt.timeoutlen = 300
|
|
|
|
|
|
|
|
|
|
vim.opt.splitright = true
|
|
|
|
|
vim.opt.splitbelow = true
|
|
|
|
|
|
|
|
|
|
vim.opt.list = true
|
|
|
|
|
vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '·' }
|
|
|
|
|
|
|
|
|
@ -51,7 +38,6 @@ vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '·' }
|
|
|
|
|
vim.opt.inccommand = 'split'
|
|
|
|
|
|
|
|
|
|
vim.opt.cursorline = true
|
|
|
|
|
|
|
|
|
|
vim.opt.scrolloff = 6
|
|
|
|
|
|
|
|
|
|
-- Clear highlights on search when pressing <Esc> in normal mode
|
|
|
|
@ -60,9 +46,6 @@ vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
|
|
|
|
|
-- Diagnostic keymaps
|
|
|
|
|
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })
|
|
|
|
|
|
|
|
|
|
-- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier
|
|
|
|
|
-- for people to discover. Otherwise, you normally need to press <C-\><C-n>, which
|
|
|
|
|
-- is not what someone will guess without a bit more experience.
|
|
|
|
|
-- NOTE: This won't work in all terminal emulators/tmux/etc. Try your own mapping
|
|
|
|
|
-- or just use <C-\><C-n> to exit terminal mode
|
|
|
|
|
vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' })
|
|
|
|
@ -77,6 +60,7 @@ vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right win
|
|
|
|
|
vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { desc = 'Move focus to the lower window' })
|
|
|
|
|
vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' })
|
|
|
|
|
|
|
|
|
|
-- highlight on yank
|
|
|
|
|
vim.api.nvim_create_autocmd('TextYankPost', {
|
|
|
|
|
desc = 'Highlight when yanking (copying) text',
|
|
|
|
|
group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }),
|
|
|
|
@ -85,6 +69,7 @@ vim.api.nvim_create_autocmd('TextYankPost', {
|
|
|
|
|
end,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
-- bootstrap lazy
|
|
|
|
|
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
|
|
|
|
|
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
|
|
|
|
local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
|
|
|
|
@ -96,11 +81,9 @@ end ---@diagnostic disable-next-line: undefined-field
|
|
|
|
|
vim.opt.rtp:prepend(lazypath)
|
|
|
|
|
|
|
|
|
|
require('lazy').setup({
|
|
|
|
|
-- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link).
|
|
|
|
|
'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically
|
|
|
|
|
'tpope/vim-sleuth',
|
|
|
|
|
|
|
|
|
|
-- See `:help gitsigns` to understand what the configuration keys do
|
|
|
|
|
{ -- Adds git related signs to the gutter, as well as utilities for managing changes
|
|
|
|
|
{
|
|
|
|
|
'lewis6991/gitsigns.nvim',
|
|
|
|
|
opts = {
|
|
|
|
|
signs = {
|
|
|
|
|