Skip to content

Commit 2cbdb13

Browse files
committed
housekeeping merge
1 parent 398616c commit 2cbdb13

6 files changed

Lines changed: 318 additions & 143 deletions

File tree

init.lua

Lines changed: 47 additions & 143 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<<<<<<< HEAD
12
-- Set <space> as the leader key
23
-- See `:help mapleader`
34
-- 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
124125

125126
-- [[ Basic Autocommands ]]
126127
-- See `:help lua-guide-autocommands`
128+
=======
129+
require 'core.globals'
130+
>>>>>>> b6fc317 (housekeeping)
127131

128132
-- Highlight when yanking (copying) text
129133
-- Try it with `yap` in normal mode
@@ -161,49 +165,7 @@ vim.opt.rtp:prepend(lazypath)
161165
-- NOTE: Here is where you install your plugins.
162166

163167
require('lazy').setup({
164-
-- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link).
165-
'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically
166-
167-
-- NOTE: Plugins can also be added by using a table,
168-
-- with the first argument being the link and the following
169-
-- keys can be used to configure plugin behavior/loading/etc.
170-
--
171-
-- Use `opts = {}` to force a plugin to be loaded.
172-
--
173-
174-
-- Here is a more advanced example where we pass configuration
175-
-- options to `gitsigns.nvim`. This is equivalent to the following Lua:
176-
-- require('gitsigns').setup({ ... })
177-
--
178-
-- See `:help gitsigns` to understand what the configuration keys do
179-
{ -- Adds git related signs to the gutter, as well as utilities for managing changes
180-
'lewis6991/gitsigns.nvim',
181-
opts = {
182-
signs = {
183-
add = { text = '+' },
184-
change = { text = '~' },
185-
delete = { text = '_' },
186-
topdelete = { text = '' },
187-
changedelete = { text = '~' },
188-
},
189-
},
190-
},
191-
192-
-- NOTE: Plugins can also be configured to run Lua code when they are loaded.
193-
--
194-
-- This is often very useful to both group configuration, as well as handle
195-
-- lazy loading plugins that don't need to be loaded immediately at startup.
196-
--
197-
-- For example, in the following configuration, we use:
198-
-- event = 'VimEnter'
199-
--
200-
-- which loads which-key before all the UI elements are loaded. Events can be
201-
-- normal autocommands events (`:help autocmd-events`).
202-
--
203-
-- Then, because we use the `opts` key (recommended), the configuration runs
204-
-- after the plugin has been loaded as `require(MODULE).setup(opts)`.
205-
206-
{ -- Useful plugin to show you pending keybinds.
168+
{
207169
'folke/which-key.nvim',
208170
event = 'VimEnter', -- Sets the loading event to 'VimEnter'
209171
opts = {
@@ -256,14 +218,6 @@ require('lazy').setup({
256218
},
257219
},
258220
},
259-
260-
-- NOTE: Plugins can specify dependencies.
261-
--
262-
-- The dependencies are proper plugin specifications as well - anything
263-
-- you do for a plugin at the top level, you can do for a dependency.
264-
--
265-
-- Use the `dependencies` key to specify the dependencies of a particular plugin
266-
267221
{ -- Fuzzy Finder (files, lsp, etc)
268222
'nvim-telescope/telescope.nvim',
269223
event = 'VimEnter',
@@ -332,43 +286,26 @@ require('lazy').setup({
332286
pcall(require('telescope').load_extension, 'ui-select')
333287

334288
-- See `:help telescope.builtin`
335-
local builtin = require 'telescope.builtin'
336-
vim.keymap.set('n', '<leader>sh', builtin.help_tags, { desc = '[S]earch [H]elp' })
337-
vim.keymap.set('n', '<leader>sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' })
338-
vim.keymap.set('n', '<leader>sf', builtin.find_files, { desc = '[S]earch [F]iles' })
339-
vim.keymap.set('n', '<leader>ss', builtin.builtin, { desc = '[S]earch [S]elect Telescope' })
340-
vim.keymap.set('n', '<leader>sw', builtin.grep_string, { desc = '[S]earch current [W]ord' })
341-
vim.keymap.set('n', '<leader>sg', builtin.live_grep, { desc = '[S]earch by [G]rep' })
342-
vim.keymap.set('n', '<leader>sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' })
343-
vim.keymap.set('n', '<leader>sr', builtin.resume, { desc = '[S]earch [R]esume' })
344-
vim.keymap.set('n', '<leader>s.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' })
345-
vim.keymap.set('n', '<leader><leader>', builtin.buffers, { desc = '[ ] Find existing buffers' })
346-
347-
-- Slightly advanced example of overriding default behavior and theme
348-
vim.keymap.set('n', '<leader>/', function()
349-
-- You can pass additional configuration to Telescope to change the theme, layout, etc.
350-
builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown {
351-
winblend = 10,
352-
previewer = false,
353-
})
354-
end, { desc = '[/] Fuzzily search in current buffer' })
355-
356-
-- It's also possible to pass additional configuration options.
357-
-- See `:help telescope.builtin.live_grep()` for information about particular keys
358-
vim.keymap.set('n', '<leader>s/', function()
359-
builtin.live_grep {
360-
grep_open_files = true,
361-
prompt_title = 'Live Grep in Open Files',
362-
}
363-
end, { desc = '[S]earch [/] in Open Files' })
364-
365-
-- Shortcut for searching your Neovim configuration files
366-
vim.keymap.set('n', '<leader>sn', function()
367-
builtin.find_files { cwd = vim.fn.stdpath 'config' }
368-
end, { desc = '[S]earch [N]eovim files' })
369289
end,
370290
},
291+
{
292+
'epwalsh/obsidian.nvim',
293+
version = '*', -- recommended, use latest release instead of latest commit
294+
lazy = true,
295+
ft = 'markdown',
296+
-- Replace the above line with this if you only want to load obsidian.nvim for markdown files in your vault:
297+
-- event = {
298+
-- -- If you want to use the home shortcut '~' here you need to call 'vim.fn.expand'.
299+
-- -- E.g. "BufReadPre " .. vim.fn.expand "~" .. "/my-vault/*.md"
300+
-- -- refer to `:h file-pattern` for more examples
301+
-- "BufReadPre path/to/my-vault/*.md",
302+
-- "BufNewFile path/to/my-vault/*.md",
303+
-- },
304+
dependencies = {
305+
-- Required.
306+
'nvim-lua/plenary.nvim',
371307

308+
<<<<<<< HEAD
372309
{
373310
'epwalsh/obsidian.nvim',
374311
version = '*', -- recommended, use latest release instead of latest commit
@@ -386,13 +323,19 @@ require('lazy').setup({
386323
-- Required.
387324
'nvim-lua/plenary.nvim',
388325

326+
=======
327+
>>>>>>> b6fc317 (housekeeping)
389328
-- see below for full list of optional dependencies 👇
390329
},
391330
opts = {
392331
workspaces = {
393332
{
394333
name = 'personal',
334+
<<<<<<< HEAD
395335
path = 'E:/Stories',
336+
=======
337+
path = 'C:/Users/Squirrel/Documents/Worldbuilding',
338+
>>>>>>> b6fc317 (housekeeping)
396339
},
397340
},
398341
-- A list of workspace names, paths, and configuration overrides.
@@ -436,6 +379,7 @@ require('lazy').setup({
436379

437380
-- Optional, configure key mappings. These are the defaults. If you don't want to set any keymappings this
438381
-- way then set 'mappings = {}'.
382+
<<<<<<< HEAD
439383
mappings = {
440384
-- Overrides the 'gf' mapping to work on markdown/wiki links within your vault.
441385
['gd'] = {
@@ -459,6 +403,8 @@ require('lazy').setup({
459403
opts = { buffer = true, expr = true },
460404
},
461405
},
406+
=======
407+
>>>>>>> b6fc317 (housekeeping)
462408

463409
-- Where to put new notes. Valid options are
464410
-- * "current_dir" - put new notes in same directory as the current buffer.
@@ -711,7 +657,10 @@ require('lazy').setup({
711657
},
712658
-- see below for full list of options 👇
713659
},
660+
<<<<<<< HEAD
714661

662+
=======
663+
>>>>>>> b6fc317 (housekeeping)
715664
-- LSP Plugins
716665
{
717666
-- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins
@@ -949,7 +898,6 @@ require('lazy').setup({
949898
}
950899
end,
951900
},
952-
953901
{ -- Autoformat
954902
'stevearc/conform.nvim',
955903
event = { 'BufWritePre' },
@@ -992,7 +940,6 @@ require('lazy').setup({
992940
},
993941
},
994942
},
995-
996943
{ -- Autocompletion
997944
'hrsh7th/nvim-cmp',
998945
event = 'InsertEnter',
@@ -1047,54 +994,6 @@ require('lazy').setup({
1047994
-- chosen, you will need to read `:help ins-completion`
1048995
--
1049996
-- No, but seriously. Please read `:help ins-completion`, it is really good!
1050-
mapping = cmp.mapping.preset.insert {
1051-
-- Select the [n]ext item
1052-
['<C-n>'] = cmp.mapping.select_next_item(),
1053-
-- Select the [p]revious item
1054-
['<C-p>'] = cmp.mapping.select_prev_item(),
1055-
1056-
-- Scroll the documentation window [b]ack / [f]orward
1057-
['<C-b>'] = cmp.mapping.scroll_docs(-4),
1058-
['<C-f>'] = cmp.mapping.scroll_docs(4),
1059-
1060-
-- Accept ([y]es) the completion.
1061-
-- This will auto-import if your LSP supports it.
1062-
-- This will expand snippets if the LSP sent a snippet.
1063-
['<C-y>'] = cmp.mapping.confirm { select = true },
1064-
1065-
-- If you prefer more traditional completion keymaps,
1066-
-- you can uncomment the following lines
1067-
--['<CR>'] = cmp.mapping.confirm { select = true },
1068-
--['<Tab>'] = cmp.mapping.select_next_item(),
1069-
--['<S-Tab>'] = cmp.mapping.select_prev_item(),
1070-
1071-
-- Manually trigger a completion from nvim-cmp.
1072-
-- Generally you don't need this, because nvim-cmp will display
1073-
-- completions whenever it has completion options available.
1074-
['<C-Space>'] = cmp.mapping.complete {},
1075-
1076-
-- Think of <c-l> as moving to the right of your snippet expansion.
1077-
-- So if you have a snippet that's like:
1078-
-- function $name($args)
1079-
-- $body
1080-
-- end
1081-
--
1082-
-- <c-l> will move you to the right of each of the expansion locations.
1083-
-- <c-h> is similar, except moving you backwards.
1084-
['<C-l>'] = cmp.mapping(function()
1085-
if luasnip.expand_or_locally_jumpable() then
1086-
luasnip.expand_or_jump()
1087-
end
1088-
end, { 'i', 's' }),
1089-
['<C-h>'] = cmp.mapping(function()
1090-
if luasnip.locally_jumpable(-1) then
1091-
luasnip.jump(-1)
1092-
end
1093-
end, { 'i', 's' }),
1094-
1095-
-- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see:
1096-
-- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
1097-
},
1098997
sources = {
1099998
{
1100999
name = 'lazydev',
@@ -1215,7 +1114,7 @@ require('lazy').setup({
12151114
-- This is the easiest way to modularize your config.
12161115
--
12171116
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
1218-
-- { import = 'custom.plugins' },
1117+
{ import = 'core.plugins' },
12191118
{
12201119
'mfussenegger/nvim-dap',
12211120
recommended = true,
@@ -1235,7 +1134,6 @@ require('lazy').setup({
12351134
keys = {
12361135
{ "<leader>dB", function() require("dap").set_breakpoint(vim.fn.input('Breakpoint condition: ')) end, desc = "Breakpoint Condition" },
12371136
{ "<F9>", function() require("dap").toggle_breakpoint() end, desc = "Toggle Breakpoint" },
1238-
{ "<C-F9>", function() require("dap").clear_breakpoints() end, desc = "Clear All Breakpoints" },
12391137
{ "<F5>", function() require("dap").continue() end, desc = "Run/Continue" },
12401138
{ "<leader>da", function() require("dap").continue({ before = get_args }) end, desc = "Run with Args" },
12411139
{ "<leader>dC", function() require("dap").run_to_cursor() end, desc = "Run to Cursor" },
@@ -1246,7 +1144,6 @@ require('lazy').setup({
12461144
{ "<leader>dl", function() require("dap").run_last() end, desc = "Run Last" },
12471145
{ "<S-F11>", function() require("dap").step_out() end, desc = "Step Out" },
12481146
{ "<F10>", function() require("dap").step_over() end, desc = "Step Over" },
1249-
{ "<leader>dP", function() require("dap").pause() end, desc = "Pause" },
12501147
{ "<leader>dr", function() require("dap").repl.toggle() end, desc = "Toggle REPL" },
12511148
{ "<leader>ds", function() require("dap").session() end, desc = "Session" },
12521149
{ "<S-F5>", function() require("dap").terminate() end, desc = "Terminate" },
@@ -1315,6 +1212,7 @@ require('lazy').setup({
13151212
}
13161213
end,
13171214
},
1215+
<<<<<<< HEAD
13181216
{
13191217
'stevearc/oil.nvim',
13201218
---@module 'oil'
@@ -1343,6 +1241,8 @@ require('lazy').setup({
13431241
vim.keymap.set('n', '<leader>o', '<CMD>Oil<CR>', { desc = 'Open parent directory' }),
13441242
-- dependencies = { "nvim-tree/nvim-web-devicons" }, -- use if prefer nvim-web-devicons
13451243
}, --
1244+
=======
1245+
>>>>>>> b6fc317 (housekeeping)
13461246
-- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec`
13471247
-- Or use telescope!
13481248
-- In normal mode type `<space>sh` then write `lazy.nvim-plugin`
@@ -1369,11 +1269,6 @@ require('lazy').setup({
13691269
},
13701270
})
13711271
require('nvim-treesitter.install').compilers = { 'clang' }
1372-
local builtin = require 'telescope.builtin'
1373-
vim.keymap.set('n', '<leader>ff', builtin.find_files, { desc = 'Telescope find files' })
1374-
vim.keymap.set('n', '<leader>fg', builtin.live_grep, { desc = 'Telescope live grep' })
1375-
vim.keymap.set('n', '<leader>fb', builtin.buffers, { desc = 'Telescope buffers' })
1376-
vim.keymap.set('n', '<leader>fh', builtin.help_tags, { desc = 'Telescope help tags' })
13771272
require('telescope').setup {
13781273
defaults = {
13791274
file_ignore_patterns = {
@@ -1387,8 +1282,17 @@ require('telescope').setup {
13871282
},
13881283
}
13891284
vim.fn.sign_define('DapBreakpoint', { text = '🛑', texthl = '', linehl = '', numhl = '' })
1285+
<<<<<<< HEAD
13901286
vim.keymap.set('n', '<leader>rn', vim.lsp.buf.rename, {})
13911287

13921288
-- The line beneath this is called `modeline`. See `:help modeline`
13931289
-- vim: ts=2 sts=2 sw=2 et
13941290
require 'oil'
1291+
=======
1292+
-- vim.keymap.set('n', '<leader>rn', vim.lsp.buf.rename, {})
1293+
1294+
-- The line beneath this is called `modeline`. See `:help modeline`
1295+
-- vim: ts=2 sts=2 sw=2 et
1296+
require 'core.options'
1297+
require 'core.keymaps'
1298+
>>>>>>> b6fc317 (housekeeping)

lua/core/globals.lua

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
vim.g.mapleader = ' '
2+
vim.g.maplocalleader = ' '
3+
4+
if vim.fn.exists 'g:os' == 0 then
5+
local is_windows = vim.fn.has 'win64' == 1 or vim.fn.has 'win32' == 1 or vim.fn.has 'win16' == 1
6+
if is_windows then
7+
vim.g.os = 'Windows'
8+
else
9+
local uname_output = vim.fn.system 'uname'
10+
vim.g.os = string.gsub(uname_output, '\n', '')
11+
end
12+
end
13+
14+
-- Set to true if you have a Nerd Font installed and selected in the terminal
15+
vim.g.have_nerd_font = true

0 commit comments

Comments
 (0)