intial rip from kickstart

This commit is contained in:
Donelson berger 2024-12-28 13:19:38 -08:00
parent de44f49101
commit c0ad86ac7c
23 changed files with 2080 additions and 1210 deletions

View file

@ -0,0 +1,13 @@
-- [[ Basic Autocommands ]]
-- See `:help lua-guide-autocommands`
-- Highlight when yanking (copying) text
-- Try it with `yap` in normal mode
-- See `:help vim.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 }),
callback = function()
vim.highlight.on_yank()
end,
})

View file

@ -0,0 +1,20 @@
-----------------
-- KEY MAPPIGNS
-----------------
vim.g.mapleader = ' '
vim.g.maplocalleader = ' ' -- not using local leader
-- Clear highlights on search when pressing <Esc> in normal mode
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' })
vim.keymap.set('n', '<C-h>', '<C-w><C-h>', { desc = 'Move focus to the left window' })
vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right window' })
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' })
vim.keymap.set('i', 'jk', '<Esc>', { desc = 'leave insert mode' })
vim.keymap.set('i', 'kj', '<Esc>', { desc = 'leave insert mode' })

View file

@ -0,0 +1,71 @@
-----------------
-- BASE SETTINGS
-----------------
-- Visual Enhancements
vim.g.have_nerd_font = true -- Enable nerd font support
vim.opt.cursorline = false -- Disable highlighting of current line
vim.opt.list = true -- Show invisible characters
vim.opt.listchars = { -- Define how to show invisible characters
tab = '» ',
trail = '·',
nbsp = '',
}
vim.opt.signcolumn = 'yes' -- Always show the signcolumn
-- Line Numbers
vim.opt.relativenumber = true -- Show relative line numbers
vim.opt.number = true -- Show current line number
-- Search and Replace
vim.opt.ignorecase = true -- Ignore case in search
vim.opt.smartcase = true -- Override ignorecase if search has uppercase
vim.opt.inccommand = 'split' -- Show preview of substitutions in split
-- Editor Behavior
vim.opt.breakindent = true -- Maintain indent when wrapping lines
vim.opt.showmode = false -- Don't show mode (use statusline instead)
vim.opt.undofile = true -- Persistent undo history
vim.opt.updatetime = 250 -- Faster update time for CursorHold events
vim.opt.timeoutlen = 300 -- Time to wait for mapped sequences
-- Window Management
vim.opt.splitright = true -- New vertical splits open to the right
vim.opt.splitbelow = true -- New horizontal splits open below
-- Editor Behavior
vim.opt.shiftwidth = 2 -- Number of spaces for auto-indent
vim.opt.softtabstop = 2 -- Number of spaces for <Tab> key
vim.opt.scrolloff = 8 -- Keep 8 lines above/below cursor
vim.opt.sidescrolloff = 8 -- Keep 8 columns left/right of cursor
-- Search
vim.opt.hlsearch = false -- Don't highlight search results
vim.opt.incsearch = true -- Incremental search
-- Visual
vim.opt.termguicolors = true -- Enable 24-bit RGB color
vim.opt.wrap = false -- Don't wrap long lines
-- Completion
vim.opt.completeopt = { -- Better completion experience
'menuone',
'noselect',
'noinsert',
}
vim.opt.wildmode = { -- Better command-line completion
'longest',
'list',
'full',
}
-- Performance
vim.opt.lazyredraw = true -- Don't redraw during macros
-- Backups
vim.opt.backup = true
vim.opt.writebackup = true
vim.opt.swapfile = true
-- Mouse
vim.opt.mouse = 'a' -- Enable mouse in all modes

View file

@ -0,0 +1,72 @@
-----------------
-- BASE SETTINGS
-----------------
-- Visual Enhancements
vim.g.have_nerd_font = true -- Enable nerd font support
vim.opt.cursorline = false -- Disable highlighting of current line
vim.opt.list = true -- Show invisible characters
vim.opt.listchars = { -- Define how to show invisible characters
tab = '» ',
trail = '·',
nbsp = '',
}
vim.opt.signcolumn = 'yes' -- Always show the signcolumn
-- Line Numbers
vim.opt.relativenumber = true -- Show relative line numbers
vim.opt.number = true -- Show current line number
-- Search and Replace
vim.opt.ignorecase = true -- Ignore case in search
vim.opt.smartcase = true -- Override ignorecase if search has uppercase
vim.opt.inccommand = 'split' -- Show preview of substitutions in split
-- Editor Behavior
vim.opt.breakindent = true -- Maintain indent when wrapping lines
vim.opt.showmode = false -- Don't show mode (use statusline instead)
vim.opt.undofile = true -- Persistent undo history
vim.opt.updatetime = 250 -- Faster update time for CursorHold events
vim.opt.timeoutlen = 300 -- Time to wait for mapped sequences
-- Window Management
vim.opt.splitright = true -- New vertical splits open to the right
vim.opt.splitbelow = true -- New horizontal splits open below
-- Editor Behavior
vim.opt.shiftwidth = 2 -- Number of spaces for auto-indent
vim.opt.softtabstop = 2 -- Number of spaces for <Tab> key
vim.opt.scrolloff = 8 -- Keep 8 lines above/below cursor
vim.opt.sidescrolloff = 8 -- Keep 8 columns left/right of cursor
-- Search
vim.opt.hlsearch = false -- Don't highlight search results
vim.opt.incsearch = true -- Incremental search
-- Visual
vim.opt.termguicolors = true -- Enable 24-bit RGB color
vim.opt.colorcolumn = '80' -- Show line length marker
vim.opt.wrap = false -- Don't wrap long lines
-- Completion
vim.opt.completeopt = { -- Better completion experience
'menuone',
'noselect',
'noinsert',
}
vim.opt.wildmode = { -- Better command-line completion
'longest',
'list',
'full',
}
-- Performance
vim.opt.lazyredraw = true -- Don't redraw during macros
-- Backups
vim.opt.backup = true
vim.opt.writebackup = true
vim.opt.swapfile = true
-- Mouse
vim.opt.mouse = 'a' -- Enable mouse in all modes