Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
jpducky authored and jpducky committed Oct 11, 2023
1 parent 7695c47 commit 14f88fa
Show file tree
Hide file tree
Showing 27 changed files with 957 additions and 47 deletions.
1 change: 1 addition & 0 deletions Project Gutenberg.wiki
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
das auto
1 change: 1 addition & 0 deletions Tasks.wiki
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
aaayyyyy lmao
6 changes: 6 additions & 0 deletions index.wiki
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
test
blah
foo bar
baz
hit em wit da razzle daz

97 changes: 92 additions & 5 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,19 @@ vim.opt.scrolloff = 14

vim.opt.wrap = false

-- vim.g.netrw_banner = 0
-- vim.g.netrw_liststyle = 3
-- vim.g.netrw_browse_split = 4
-- vim.g.netrw_altv = 1
-- vim.g.netrw_winsize = 25
--
-- vim.cmd [[
-- augroup ProjectDrawer
-- autocmd!
-- autocmd VimEnter * :Vexplore
-- augroup END
-- ]]

-- Plugins:

-- NOTE: Here is where you install your plugins.
Expand Down Expand Up @@ -142,6 +155,13 @@ vim.o.completeopt = "menuone,noselect"
-- NOTE: You should make sure your terminal supports this
vim.o.termguicolors = true








-- [[ Basic Keymaps ]]

-- Keymaps for better default experience
Expand All @@ -152,6 +172,12 @@ vim.keymap.set({ "n", "v" }, "<Space>", "<Nop>", { silent = true })
-- vim.keymap.set("n", "k", "v:count == 0 ? "gk" : "k"", { expr = true, silent = true })
-- vim.keymap.set("n", "j", "v:count == 0 ? "gj" : "j"", { expr = true, silent = true })


-- [[ Autocommands ]]

local autocmds = require('after.plugins.functions.autocmds')
vim.notify = require("notify")

-- [[ Highlight on yank ]]
-- See `:help vim.highlight.on_yank()`
local highlight_group = vim.api.nvim_create_augroup("YankHighlight", { clear = true })
Expand All @@ -163,8 +189,69 @@ vim.api.nvim_create_autocmd("TextYankPost", {
pattern = "*",
})

-- Diagnostic keymaps
--vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, { desc = "Go to previous diagnostic message" })
--vim.keymap.set("n", "]d", vim.diagnostic.goto_next, { desc = "Go to next diagnostic message" })
--vim.keymap.set("n", "<leader>e", vim.diagnostic.open_float, { desc = "Open floating diagnostic message" })
--vim.keymap.set("n", "<leader>q", vim.diagnostic.setloclist, { desc = "Open diagnostics list" })
-- local help_portal = vim.api.nvim_create_augroup("HelpPortal", { clear = true })
-- vim.api.nvim_create_autocmd("BufWinEnter", {
-- callback = function()
-- vim.g.splitbelow = true
-- end,
-- group = help_portal,
-- pattern = "*help*",
-- })
--
-- vim.api.nvim_create_autocmd("BufWinLeave", {
-- callback = function()
-- vim.g.splitbelow = false
-- end,
-- group = help_portal,
-- pattern = "*help*",
-- })
--

-- local whichkey_ft = vim.api.nvim_create_augroup("WhichKeyFT", { clear = true })
-- vim.api.nvim_create_autocmd("FileType", {
-- callback = function()
-- vim.schedule(autocmds.WhichKeyFT)
-- end,
-- pattern = "*",
-- group = whichkey_ft,
-- })

local function vimwiki_create()
local cwd = vim.loop.cwd()
local git_dir = vim.fn.finddir(".git", cwd)
if git_dir ~= "" then
local wiki_path = cwd.."/wiki.md"

if vim.fn.filereadable(wiki_path) == 0 then
local file = io.open(wiki_path, "w")
if file then
file:write("# Project TaskWiki\n")
file:close()
vim.notify("Project Wiki Created", "info")
else
vim.notify("Failed to create wiki", "info")
end
end
end
end

local wiki_create = vim.api.nvim_create_augroup("WikiCreate", { clear = true })
vim.api.nvim_create_autocmd("VimEnter", {
callback = function()
vimwiki_create()
end,
group = wiki_create,
})

local help_split_group = vim.api.nvim_create_augroup("HelpSplit", { clear = true })

vim.api.nvim_create_autocmd("BufEnter", {
callback = function()
local bt = vim.bo.buftype
if bt == 'help' then
vim.api.nvim_command('wincmd L')
end
end,
group = help_split_group,
pattern = "*",
})
71 changes: 42 additions & 29 deletions lua/after/plugins/99-keybinds.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ local functions_module = require('after.plugins.functions.functions')
-- local project_keys = functions_module.project


-- this feels most naturally
vim.o.timeout = true
vim.o.timeoutlen = 550

Expand Down Expand Up @@ -53,6 +54,7 @@ return {
},
},

-- TODO: Move these::
-- non-which-key keymaps:

-- line bumpers
Expand Down Expand Up @@ -107,6 +109,12 @@ return {
-- telescope undo
-- vim.keymap.set('n', '<leader>uu', '<cmd>Telescope undo<cr>'),

-- Diagnostic keymaps
--vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, { desc = "Go to previous diagnostic message" })
--vim.keymap.set("n", "]d", vim.diagnostic.goto_next, { desc = "Go to next diagnostic message" })
--vim.keymap.set("n", "<leader>e", vim.diagnostic.open_float, { desc = "Open floating diagnostic message" })
--vim.keymap.set("n", "<leader>q", vim.diagnostic.setloclist, { desc = "Open diagnostics list" })

-- quick yoink
vim.keymap.set({ 'n', 'v' }, '<leader>y', '"+y', { desc = 'Yoink to System Clipboard' }),
vim.keymap.set({ 'n', 'v' }, '<leader>P', '"+p', { desc = 'Plop from System Clipboard' }),
Expand Down Expand Up @@ -174,25 +182,25 @@ return {
wk.register{
['<leader>'] = {
a = {
name = '+Actions',
name = '+[A]ctions',
},

b = {
name = '+Buffer',
name = '+[B]uffer',
d = "Delete Current Buff", --lazy, see file
D = "Delete Current Buffer (Force)", -- lazy, see file
g = { bufferline.pick, "Select Buffer" },
c = { bufferline.close_with_pick, "Close Select Buffer" },
},

c = {
name = '+Code',
name = '+[C]ode',
a = { vim.lsp.buf.code_action, "Action" },
t = { vim.lsp.buf.type_definition, "Type Definition" },
},

d = {
name = '+Debug',
name = '+[D]ebug',
d = { dapui.toggle, 'DAP UI Toggle' },
f = { dap.continue, 'Debug: Start/Continue' },
i = { dap.step_into, 'Debug: Step Into' },
Expand All @@ -203,34 +211,49 @@ return {
},

e = {
name = "+Editor",
name = "+[E]ditor",
c = { function() tele.colorscheme{} end, "Select colorscheme"}
},

f = {
name = '+File',
name = '+[F]ile',
s = { '<Cmd>w<CR><Esc>', 'File Save' },
},

--NOTE: Any of the telescope functions can have its theme changed to get_dropdown | get_cursor | get_ivy
g = {
name = "+Git",
name = "+[G]rep",
f = { function() tele.find_files(require('telescope.themes').get_dropdown({})) end, 'Grep file' },
-- s = { function() tele.grep_string{} end, 'Grep String' }, -- TODO: add to visual mode
s = { function() tele.live_grep(require('telescope.themes').get_dropdown({})) end, 'Live Grep' },
p = { function() tele.planets(require('telescope.themes').get_dropdown({})) end, "Search the planets..." },
g = { function() tele.git_files(require('telescope.themes').get_dropdown({})) end, "Grep git" },
c = { function() tele.current_buffer_fuzzy_find(require('telescope.themes').get_cursor({})) end, "Current Buffer" },
},

--NOTE: Any of the telescope functions can have its theme changed to get_dropdown | get_cursor | get_ivy
G = {
name = "+[G]it",
-- c = { function() tele.git_commits(require('telescope.themes').get_dropdown({})) end, "Commits"},
o = { function() tele.git_bcommits(require('telescope.themes').get_dropdown({})) end, "Buffer's Commits" },
b = { function() tele.git_branches(require('telescope.themes').get_dropdown({})) end, "Branches w/ Log Preview" },
s = { function() tele.git_status(require('telescope.themes').get_dropdown({})) end, "Show Current Changes" },
h = { function() tele.git_stash(require('telescope.themes').get_dropdown({})) end, "Show Stash Items in Current Repo" },
f = { function() tele.git_files(require('telescope.themes').get_dropdown({})) end, "Show files" },
},

h = {
name = "+[H]elp",
h = { function() tele.help_tags(require('telescope.themes').get_dropdown({})) end, "Search Help Files" },
c = { function() tele.commands(require('telescope.themes').get_dropdown({})) end, "List Available Plugin/User Commands" },
},

l = {
name = "+Lists",
name = "+[L]ists",
b = { function() tele.builtin(require('telescope.themes').get_ivy({})) end, "Built-Ins" },
d = { function() tele.diagnostics(require('telescope.themes').get_cursor({})) end, "List Diagnostics for all open Buffers" }, --NOTE: this may belong somewhere else
h = { function() tele.help_tags(require('telescope.themes').get_dropdown({})) end, "List help tags" },
j = { function() tele.jumplist(require('telescope.themes').get_cursor({})) end, "Jumplist" },
l = {
name = "+LSP Stuff",
name = "+[L]SP Stuff",
r = { function() tele.lsp_references(require('telescope.themes').get_cursor({})) end, "References" },
i = { function() tele.lsp_incoming_calls(require('telescope.themes').get_cursor({})) end, "Incoming Calls for word Under Cursor" },
o = { function() tele.lsp_outgoing_calls(require('telescope.themes').get_cursor({})) end, "Outgoing Calls for word Under Cursor" },
Expand All @@ -240,7 +263,7 @@ return {
},
m = { function() tele.marks(require('telescope.themes').get_dropdown({})) end, "List Marks" },
p = {
name = "+Pickers",
name = "+[P]ickers",
h = { function() tele.resume(require('telescope.themes').get_dropdown({})) end, "Results of Previous Picker" },
N = { function() tele.pickers(require('telescope.themes').get_dropdown({})) end, "Previous Pickers" },
},
Expand All @@ -252,11 +275,11 @@ return {
},

p = {
name = '+Personal',
name = '+[P]ersonal',
},

q = {
name = '+Quickfix',
name = '+[Q]uickfix',
q = { function() tele.quickfix(require('telescope.themes').get_dropdown({})) end, "Quickfix" },
h = { function() tele.quickfixhistory(require('telescope.themes').get_dropdown({})) end, "Quickfix History" },
l = { function() tele.loclist(require('telescope.themes').get_dropdown({})) end, "Current Window Location List" },
Expand All @@ -266,18 +289,8 @@ return {
n = { vim.lsp.buf.rename, "rename" },
},

s = {
name = "+Search",
f = { function() tele.find_files(require('telescope.themes').get_dropdown({})) end, 'Grep file' },
-- s = { function() tele.grep_string{} end, 'Grep String' }, -- TODO: add to visual mode
s = { function() tele.live_grep(require('telescope.themes').get_dropdown({})) end, 'Live Grep' },
p = { function() tele.planets(require('telescope.themes').get_dropdown({})) end, "Search the planets..." },
g = { function() tele.git_files(require('telescope.themes').get_dropdown({})) end, "Grep git" },
c = { function() tele.current_buffer_fuzzy_find(require('telescope.themes').get_cursor({})) end, "Current Buffer" },
},

t = {
name = '+Trouble/TODO',
name = '+[T]rouble/TODO',
n = { function() require('todo-comments').jump_next() end, 'Next TODO' },
N = { function() require('todo-comments').jump_prev() end, 'Previous TODO' },
T = { '<Cmd>TodoTrouble<CR>', "TodoTrouble" },
Expand All @@ -291,7 +304,7 @@ return {
},

u = {
name = '+UI',
name = '+[U]I',
n = { function() require('noice').cmd 'dismiss' end, 'Dismiss Notifications' },
e = { function() require('noice').cmd 'errors' end, 'Show errors' },
l = { function() require('noice').cmd 'last' end, 'Show last popup' },
Expand All @@ -302,18 +315,17 @@ return {
u = { function() require('telescope').extensions.undo.undo() end, "undo tree" },
},
v = {
name = "+Vim Locals",
name = "+[V]im Locals",
v = { function() tele.vim_options(require('telescope.themes').get_dropdown({})) end, "Vim Options" },
r = { function() tele.registers(require('telescope.themes').get_ivy({})) end, "Registers" },
a = { function() tele.autocommands(require('telescope.themes').get_ivy({})) end, "Autocommands" },
k = { function() tele.keymaps(require('telescope.themes').get_ivy({})) end, "Keymaps" },
f = { function() tele.filetypes(require('telescope.themes').get_dropdown({})) end, "Filetypes" },
i = { function() tele.highlights(require('telescope.themes').get_dropdown({})) end, "Highlights" },
c = { function() tele.commands(require('telescope.themes').get_dropdown({})) end, "List Cmd's" },
},

w = {
name = "+Workspace",
name = "+[W]orkspace",
a = { vim.lsp.buf.add_workspace_folder, "Add Folder to workspace" },
r = { vim.lsp.buf.remove_workspace_folder, "Remove Folder to workspace" },
l = { function() print(vim.inspect(vim.lsp.buf.list_workspace_folders())) end, 'Workspace List Folders'},
Expand All @@ -325,6 +337,7 @@ return {
--end leader setup
},

['<A-i>'] = { "<Cmd>FloatermToggle<CR>", "Float-Term Toggle" },
-- TODO: figure out what to do with these for window hopping easily
-- ["<C-h>"] = { '<C-w>h' },
-- ["<C-j>"] = { '<C-w>j' },
Expand Down
Loading

0 comments on commit 14f88fa

Please sign in to comment.