adding init work

This commit is contained in:
Aadi Rave 2025-03-16 04:30:29 -04:00
parent 38f4744e25
commit 285c67a2a9
2 changed files with 202 additions and 6 deletions

View File

@ -90,8 +90,10 @@ P.S. You can delete this when you're done too. It's your config now! :)
vim.g.mapleader = ' '
vim.g.maplocalleader = ' '
vim.g.tabstop = 2
-- Set to true if you have a Nerd Font installed and selected in the terminal
vim.g.have_nerd_font = false
vim.g.have_nerd_font = true
-- [[ Setting options ]]
-- See `:help vim.opt`
@ -102,7 +104,7 @@ vim.g.have_nerd_font = false
vim.opt.number = true
-- You can also add relative line numbers, to help with jumping.
-- Experiment for yourself to see if you like it!
-- vim.opt.relativenumber = true
vim.opt.relativenumber = true
-- Enable mouse mode, can be useful for resizing splits for example!
vim.opt.mouse = 'a'
@ -743,7 +745,7 @@ require('lazy').setup({
},
},
opts = {
notify_on_error = false,
notify_on_error = true,
format_on_save = function(bufnr)
-- Disable "format_on_save lsp_fallback" for languages that don't
-- have a well standardized coding style. You can add additional
@ -957,7 +959,7 @@ require('lazy').setup({
main = 'nvim-treesitter.configs', -- Sets main module to use for opts
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`
opts = {
ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' },
ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc', 'ocaml' },
-- Autoinstall languages that are not installed
auto_install = true,
highlight = {
@ -997,7 +999,7 @@ require('lazy').setup({
-- This is the easiest way to modularize your config.
--
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
-- { import = 'custom.plugins' },
{ import = 'custom.plugins' },
--
-- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec`
-- Or use telescope!

View File

@ -2,4 +2,198 @@
-- I promise not to create any merge conflicts in this directory :)
--
-- See the kickstart.nvim README for more information
return {}
return {
'folke/snacks.nvim',
lazy = false,
priority = 1000,
---@type snacks.Config
opts = {
bigfile = { enabled = true },
dashboard = { enabled = true },
explorer = { enabled = true },
indent = { enabled = true },
input = { enabled = true },
notifier = {
enabled = true,
timeout = 3000,
},
picker = { enabled = true },
quickfile = { enabled = true },
scope = { enabled = true },
scroll = { enabled = true },
statuscolumn = { enabled = true },
words = { enabled = true },
styles = {
notification = {
-- wo = { wrap = true } -- Wrap notifications
},
},
},
keys = {
-- git
{
'<leader>gb',
function()
Snacks.picker.git_branches()
end,
desc = 'Git Branches',
},
{
'<leader>gl',
function()
Snacks.picker.git_log()
end,
desc = 'Git Log',
},
{
'<leader>gL',
function()
Snacks.picker.git_log_line()
end,
desc = 'Git Log Line',
},
{
'<leader>gs',
function()
Snacks.picker.git_status()
end,
desc = 'Git Status',
},
{
'<leader>gS',
function()
Snacks.picker.git_stash()
end,
desc = 'Git Stash',
},
{
'<leader>gd',
function()
Snacks.picker.git_diff()
end,
desc = 'Git Diff (Hunks)',
},
{
'<leader>gf',
function()
Snacks.picker.git_log_file()
end,
desc = 'Git Log File',
},
-- Grep
{
'<leader>sb',
function()
Snacks.picker.lines()
end,
desc = 'Buffer Lines',
},
{
'<leader>sB',
function()
Snacks.picker.grep_buffers()
end,
desc = 'Grep Open Buffers',
},
{
'<leader>sg',
function()
Snacks.picker.grep()
end,
desc = 'Grep',
},
{
'<leader>sw',
function()
Snacks.picker.grep_word()
end,
desc = 'Visual selection or word',
mode = { 'n', 'x' },
},
-- Other
{
'<leader>z',
function()
Snacks.zen()
end,
desc = 'Toggle Zen Mode',
},
{
'<leader>gB',
function()
Snacks.gitbrowse()
end,
desc = 'Git Browse',
mode = { 'n', 'v' },
},
{
'<leader>gg',
function()
Snacks.lazygit()
end,
desc = 'Lazygit',
},
{
']]',
function()
Snacks.words.jump(vim.v.count1)
end,
desc = 'Next Reference',
mode = { 'n', 't' },
},
{
'[[',
function()
Snacks.words.jump(-vim.v.count1)
end,
desc = 'Prev Reference',
mode = { 'n', 't' },
},
{
'<leader>N',
desc = 'Neovim News',
function()
Snacks.win {
file = vim.api.nvim_get_runtime_file('doc/news.txt', false)[1],
width = 0.6,
height = 0.6,
wo = {
spell = false,
wrap = false,
signcolumn = 'yes',
statuscolumn = ' ',
conceallevel = 3,
},
}
end,
},
},
init = function()
vim.api.nvim_create_autocmd('User', {
pattern = 'VeryLazy',
callback = function()
-- Setup some globals for debugging (lazy-loaded)
_G.dd = function(...)
Snacks.debug.inspect(...)
end
_G.bt = function()
Snacks.debug.backtrace()
end
vim.print = _G.dd -- Override print to use snacks for `:=` command
-- Create some toggle mappings
Snacks.toggle.option('spell', { name = 'Spelling' }):map '<leader>us'
Snacks.toggle.option('wrap', { name = 'Wrap' }):map '<leader>uw'
Snacks.toggle.option('relativenumber', { name = 'Relative Number' }):map '<leader>uL'
Snacks.toggle.diagnostics():map '<leader>ud'
Snacks.toggle.line_number():map '<leader>ul'
Snacks.toggle.option('conceallevel', { off = 0, on = vim.o.conceallevel > 0 and vim.o.conceallevel or 2 }):map '<leader>uc'
Snacks.toggle.treesitter():map '<leader>uT'
Snacks.toggle.option('background', { off = 'light', on = 'dark', name = 'Dark Background' }):map '<leader>ub'
Snacks.toggle.inlay_hints():map '<leader>uh'
Snacks.toggle.indent():map '<leader>ug'
Snacks.toggle.dim():map '<leader>uD'
end,
})
end,
}