housekeeping merge

This commit is contained in:
bridge4 2025-03-31 02:31:41 +03:00
parent 398616cfcd
commit 2cbdb13009
6 changed files with 319 additions and 144 deletions

192
init.lua
View file

@ -1,3 +1,4 @@
<<<<<<< HEAD
-- Set <space> as the leader key
-- See `:help mapleader`
-- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used)
@ -124,6 +125,9 @@ vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper win
-- [[ Basic Autocommands ]]
-- See `:help lua-guide-autocommands`
=======
require 'core.globals'
>>>>>>> b6fc317 (housekeeping)
-- Highlight when yanking (copying) text
-- Try it with `yap` in normal mode
@ -161,49 +165,7 @@ vim.opt.rtp:prepend(lazypath)
-- NOTE: Here is where you install your plugins.
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
-- NOTE: Plugins can also be added by using a table,
-- with the first argument being the link and the following
-- keys can be used to configure plugin behavior/loading/etc.
--
-- Use `opts = {}` to force a plugin to be loaded.
--
-- Here is a more advanced example where we pass configuration
-- options to `gitsigns.nvim`. This is equivalent to the following Lua:
-- require('gitsigns').setup({ ... })
--
-- 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 = {
add = { text = '+' },
change = { text = '~' },
delete = { text = '_' },
topdelete = { text = '' },
changedelete = { text = '~' },
},
},
},
-- NOTE: Plugins can also be configured to run Lua code when they are loaded.
--
-- This is often very useful to both group configuration, as well as handle
-- lazy loading plugins that don't need to be loaded immediately at startup.
--
-- For example, in the following configuration, we use:
-- event = 'VimEnter'
--
-- which loads which-key before all the UI elements are loaded. Events can be
-- normal autocommands events (`:help autocmd-events`).
--
-- Then, because we use the `opts` key (recommended), the configuration runs
-- after the plugin has been loaded as `require(MODULE).setup(opts)`.
{ -- Useful plugin to show you pending keybinds.
{
'folke/which-key.nvim',
event = 'VimEnter', -- Sets the loading event to 'VimEnter'
opts = {
@ -256,14 +218,6 @@ require('lazy').setup({
},
},
},
-- NOTE: Plugins can specify dependencies.
--
-- The dependencies are proper plugin specifications as well - anything
-- you do for a plugin at the top level, you can do for a dependency.
--
-- Use the `dependencies` key to specify the dependencies of a particular plugin
{ -- Fuzzy Finder (files, lsp, etc)
'nvim-telescope/telescope.nvim',
event = 'VimEnter',
@ -332,43 +286,8 @@ require('lazy').setup({
pcall(require('telescope').load_extension, 'ui-select')
-- See `:help telescope.builtin`
local builtin = require 'telescope.builtin'
vim.keymap.set('n', '<leader>sh', builtin.help_tags, { desc = '[S]earch [H]elp' })
vim.keymap.set('n', '<leader>sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' })
vim.keymap.set('n', '<leader>sf', builtin.find_files, { desc = '[S]earch [F]iles' })
vim.keymap.set('n', '<leader>ss', builtin.builtin, { desc = '[S]earch [S]elect Telescope' })
vim.keymap.set('n', '<leader>sw', builtin.grep_string, { desc = '[S]earch current [W]ord' })
vim.keymap.set('n', '<leader>sg', builtin.live_grep, { desc = '[S]earch by [G]rep' })
vim.keymap.set('n', '<leader>sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' })
vim.keymap.set('n', '<leader>sr', builtin.resume, { desc = '[S]earch [R]esume' })
vim.keymap.set('n', '<leader>s.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' })
vim.keymap.set('n', '<leader><leader>', builtin.buffers, { desc = '[ ] Find existing buffers' })
-- Slightly advanced example of overriding default behavior and theme
vim.keymap.set('n', '<leader>/', function()
-- You can pass additional configuration to Telescope to change the theme, layout, etc.
builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown {
winblend = 10,
previewer = false,
})
end, { desc = '[/] Fuzzily search in current buffer' })
-- It's also possible to pass additional configuration options.
-- See `:help telescope.builtin.live_grep()` for information about particular keys
vim.keymap.set('n', '<leader>s/', function()
builtin.live_grep {
grep_open_files = true,
prompt_title = 'Live Grep in Open Files',
}
end, { desc = '[S]earch [/] in Open Files' })
-- Shortcut for searching your Neovim configuration files
vim.keymap.set('n', '<leader>sn', function()
builtin.find_files { cwd = vim.fn.stdpath 'config' }
end, { desc = '[S]earch [N]eovim files' })
end,
},
{
'epwalsh/obsidian.nvim',
version = '*', -- recommended, use latest release instead of latest commit
@ -386,13 +305,37 @@ require('lazy').setup({
-- Required.
'nvim-lua/plenary.nvim',
<<<<<<< HEAD
{
'epwalsh/obsidian.nvim',
version = '*', -- recommended, use latest release instead of latest commit
lazy = true,
ft = 'markdown',
-- Replace the above line with this if you only want to load obsidian.nvim for markdown files in your vault:
-- event = {
-- -- If you want to use the home shortcut '~' here you need to call 'vim.fn.expand'.
-- -- E.g. "BufReadPre " .. vim.fn.expand "~" .. "/my-vault/*.md"
-- -- refer to `:h file-pattern` for more examples
-- "BufReadPre path/to/my-vault/*.md",
-- "BufNewFile path/to/my-vault/*.md",
-- },
dependencies = {
-- Required.
'nvim-lua/plenary.nvim',
=======
>>>>>>> b6fc317 (housekeeping)
-- see below for full list of optional dependencies 👇
},
opts = {
workspaces = {
{
name = 'personal',
<<<<<<< HEAD
path = 'E:/Stories',
=======
path = 'C:/Users/Squirrel/Documents/Worldbuilding',
>>>>>>> b6fc317 (housekeeping)
},
},
-- A list of workspace names, paths, and configuration overrides.
@ -436,6 +379,7 @@ require('lazy').setup({
-- Optional, configure key mappings. These are the defaults. If you don't want to set any keymappings this
-- way then set 'mappings = {}'.
<<<<<<< HEAD
mappings = {
-- Overrides the 'gf' mapping to work on markdown/wiki links within your vault.
['gd'] = {
@ -459,6 +403,8 @@ require('lazy').setup({
opts = { buffer = true, expr = true },
},
},
=======
>>>>>>> b6fc317 (housekeeping)
-- Where to put new notes. Valid options are
-- * "current_dir" - put new notes in same directory as the current buffer.
@ -711,7 +657,10 @@ require('lazy').setup({
},
-- see below for full list of options 👇
},
<<<<<<< HEAD
=======
>>>>>>> b6fc317 (housekeeping)
-- LSP Plugins
{
-- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins
@ -949,7 +898,6 @@ require('lazy').setup({
}
end,
},
{ -- Autoformat
'stevearc/conform.nvim',
event = { 'BufWritePre' },
@ -992,7 +940,6 @@ require('lazy').setup({
},
},
},
{ -- Autocompletion
'hrsh7th/nvim-cmp',
event = 'InsertEnter',
@ -1047,54 +994,6 @@ require('lazy').setup({
-- chosen, you will need to read `:help ins-completion`
--
-- No, but seriously. Please read `:help ins-completion`, it is really good!
mapping = cmp.mapping.preset.insert {
-- Select the [n]ext item
['<C-n>'] = cmp.mapping.select_next_item(),
-- Select the [p]revious item
['<C-p>'] = cmp.mapping.select_prev_item(),
-- Scroll the documentation window [b]ack / [f]orward
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
-- Accept ([y]es) the completion.
-- This will auto-import if your LSP supports it.
-- This will expand snippets if the LSP sent a snippet.
['<C-y>'] = cmp.mapping.confirm { select = true },
-- If you prefer more traditional completion keymaps,
-- you can uncomment the following lines
--['<CR>'] = cmp.mapping.confirm { select = true },
--['<Tab>'] = cmp.mapping.select_next_item(),
--['<S-Tab>'] = cmp.mapping.select_prev_item(),
-- Manually trigger a completion from nvim-cmp.
-- Generally you don't need this, because nvim-cmp will display
-- completions whenever it has completion options available.
['<C-Space>'] = cmp.mapping.complete {},
-- Think of <c-l> as moving to the right of your snippet expansion.
-- So if you have a snippet that's like:
-- function $name($args)
-- $body
-- end
--
-- <c-l> will move you to the right of each of the expansion locations.
-- <c-h> is similar, except moving you backwards.
['<C-l>'] = cmp.mapping(function()
if luasnip.expand_or_locally_jumpable() then
luasnip.expand_or_jump()
end
end, { 'i', 's' }),
['<C-h>'] = cmp.mapping(function()
if luasnip.locally_jumpable(-1) then
luasnip.jump(-1)
end
end, { 'i', 's' }),
-- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see:
-- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
},
sources = {
{
name = 'lazydev',
@ -1215,7 +1114,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 = 'core.plugins' },
{
'mfussenegger/nvim-dap',
recommended = true,
@ -1235,7 +1134,6 @@ require('lazy').setup({
keys = {
{ "<leader>dB", function() require("dap").set_breakpoint(vim.fn.input('Breakpoint condition: ')) end, desc = "Breakpoint Condition" },
{ "<F9>", function() require("dap").toggle_breakpoint() end, desc = "Toggle Breakpoint" },
{ "<C-F9>", function() require("dap").clear_breakpoints() end, desc = "Clear All Breakpoints" },
{ "<F5>", function() require("dap").continue() end, desc = "Run/Continue" },
{ "<leader>da", function() require("dap").continue({ before = get_args }) end, desc = "Run with Args" },
{ "<leader>dC", function() require("dap").run_to_cursor() end, desc = "Run to Cursor" },
@ -1246,7 +1144,6 @@ require('lazy').setup({
{ "<leader>dl", function() require("dap").run_last() end, desc = "Run Last" },
{ "<S-F11>", function() require("dap").step_out() end, desc = "Step Out" },
{ "<F10>", function() require("dap").step_over() end, desc = "Step Over" },
{ "<leader>dP", function() require("dap").pause() end, desc = "Pause" },
{ "<leader>dr", function() require("dap").repl.toggle() end, desc = "Toggle REPL" },
{ "<leader>ds", function() require("dap").session() end, desc = "Session" },
{ "<S-F5>", function() require("dap").terminate() end, desc = "Terminate" },
@ -1315,6 +1212,7 @@ require('lazy').setup({
}
end,
},
<<<<<<< HEAD
{
'stevearc/oil.nvim',
---@module 'oil'
@ -1343,6 +1241,8 @@ require('lazy').setup({
vim.keymap.set('n', '<leader>o', '<CMD>Oil<CR>', { desc = 'Open parent directory' }),
-- dependencies = { "nvim-tree/nvim-web-devicons" }, -- use if prefer nvim-web-devicons
}, --
=======
>>>>>>> b6fc317 (housekeeping)
-- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec`
-- Or use telescope!
-- In normal mode type `<space>sh` then write `lazy.nvim-plugin`
@ -1369,11 +1269,6 @@ require('lazy').setup({
},
})
require('nvim-treesitter.install').compilers = { 'clang' }
local builtin = require 'telescope.builtin'
vim.keymap.set('n', '<leader>ff', builtin.find_files, { desc = 'Telescope find files' })
vim.keymap.set('n', '<leader>fg', builtin.live_grep, { desc = 'Telescope live grep' })
vim.keymap.set('n', '<leader>fb', builtin.buffers, { desc = 'Telescope buffers' })
vim.keymap.set('n', '<leader>fh', builtin.help_tags, { desc = 'Telescope help tags' })
require('telescope').setup {
defaults = {
file_ignore_patterns = {
@ -1387,8 +1282,17 @@ require('telescope').setup {
},
}
vim.fn.sign_define('DapBreakpoint', { text = '🛑', texthl = '', linehl = '', numhl = '' })
<<<<<<< HEAD
vim.keymap.set('n', '<leader>rn', vim.lsp.buf.rename, {})
-- The line beneath this is called `modeline`. See `:help modeline`
-- vim: ts=2 sts=2 sw=2 et
require 'oil'
=======
-- vim.keymap.set('n', '<leader>rn', vim.lsp.buf.rename, {})
-- The line beneath this is called `modeline`. See `:help modeline`
-- vim: ts=2 sts=2 sw=2 et
require 'core.options'
require 'core.keymaps'
>>>>>>> b6fc317 (housekeeping)