Compare commits

...

4 Commits

Author SHA1 Message Date
venus
16e7916672 moved gitsigns out of lsp config 2026-06-02 01:37:32 -05:00
venus
bbed1e2083 added functionality to easily replay last command 2026-06-02 01:36:34 -05:00
venus
07940444c9 actually added keybind lol 2026-06-02 00:47:27 -05:00
venus
0e76ac466d added keybind to refresh current config page without restarting nvim 2026-06-02 00:45:28 -05:00
5 changed files with 71 additions and 45 deletions

View File

@@ -8,7 +8,7 @@
"diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" },
"distant.nvim": { "branch": "v0.3", "commit": "67d6b066e8490725718b79f643966f4eafc7da3c" },
"fd": { "branch": "master", "commit": "42b2ab8a84ddedf80eeed9079128c60161f64658" },
"fzf-lua": { "branch": "main", "commit": "fea9eedc6894c44d44cbb772a5cd11c93b82d7a1" },
"fzf-lua": { "branch": "main", "commit": "988416cc782dfe28bff3f0da9b8c943b236cd86a" },
"gemini-cli.nvim": { "branch": "main", "commit": "c9fd62adda823628f5131a939d9c56ef7a898600" },
"gitsigns.nvim": { "branch": "main", "commit": "dd3f588bacbeb041be6facf1742e42097f62165d" },
"guess-indent.nvim": { "branch": "main", "commit": "84a4987ff36798c2fc1169cbaff67960aed9776f" },
@@ -19,12 +19,13 @@
"inc-rename.nvim": { "branch": "main", "commit": "0074b551a17338ccdcd299bd86687cc651bcb33d" },
"jq.nvim": { "branch": "main", "commit": "70e12681b1026ba7c06c691fd815eed0e2244b81" },
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
"lazydev.nvim": { "branch": "main", "commit": "ff2cbcba459b637ec3fd165a2be59b7bbaeedf0d" },
"log-highlight.nvim": { "branch": "main", "commit": "b2e00cfd41ca94338265a595f3f3f423d9f9322e" },
"ltex-ls.nvim": { "branch": "main", "commit": "968eac261279d88d7f1ed556aa2dbc535a7489fe" },
"lualine.nvim": { "branch": "master", "commit": "131a558e13f9f28b15cd235557150ccb23f89286" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "7b01e2974a47d489bb92f47a41e4c0088ea8f86e" },
"mason.nvim": { "branch": "main", "commit": "bb639d4bf385a4d89f478b83af4d770be05ab7eb" },
"mini.nvim": { "branch": "main", "commit": "9d0b9b7188d5c24b5a87f0d8b383ec8bda7a0de4" },
"lualine.nvim": { "branch": "master", "commit": "221ce6b2d999187044529f49da6554a92f740a96" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "0a695750d747db1e7e70bcf0267ef8951c95fc83" },
"mason.nvim": { "branch": "main", "commit": "16ba83bfc8a25f52bb545134f5bee082b195c460" },
"mini.nvim": { "branch": "main", "commit": "232ceeb14f7f7e849056309b85cb2fed712db46f" },
"mini.pick": { "branch": "main", "commit": "26f94e9c84f529d713de00b900c0a307ca260f35" },
"neogit": { "branch": "master", "commit": "99326a1310fb2d616b455d2fd16d01bf00682f06" },
"neoscroll.nvim": { "branch": "master", "commit": "c8d29979cb0cb3a2437a8e0ae683fd82f340d3b8" },
@@ -39,7 +40,7 @@
"nvim-tree.lua": { "branch": "master", "commit": "07f541fcaa4a5ae019598240362449ab7e9812b3" },
"nvim-treesitter": { "branch": "main", "commit": "4916d6592ede8c07973490d9322f187e07dfefac" },
"nvim-web-devicons": { "branch": "master", "commit": "dfbfaa967a6f7ec50789bead7ef87e336c1fa63c" },
"obsidian.nvim": { "branch": "main", "commit": "d2349fdeb2c1e30cc2126fc6c7712f5103de8d15" },
"obsidian.nvim": { "branch": "main", "commit": "5c496925ee6ce475092c927de4ca05cfb6b12883" },
"plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" },
"presence.nvim": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" },
"render-markdown.nvim": { "branch": "main", "commit": "5adf0895310c1904e5abfaad40a2baad7fe44a07" },

View File

@@ -2,22 +2,20 @@
-- A library file with custom functions for cleaner code elsewhere
local C = {}
function C.runLastCommand()
-- TODO fix implementation
local term = require("toggleterm.terminal").get(1)-- Get terminal ID 1
-- Save position and buffer context
if term then
local original_window = vim.api.nvim_get_current_win()
local saved_view = vim.fn.winsaveview()
-- Using \r (carriage return) or \n\n often bypasses shell interceptors
-- term:send("clear\r")
term:send("test_dev.sh\r")
vim.api.nvim_set_current_win(original_window)
vim.fn.winrestview(saved_view)
else
vim.notify("Terminal 1 is not open yet!", vim.log.levels.WARN)
end
-- Return logic
function C.RunCommand(Command)
-- TODO IMplement an autocompiler function based on context
local tt = require("toggleterm")
local command = string.lower(Command)
if command == "l" or command == "last" then tt.exec("clear && fc -e -\r") end
if command == "c" or command == "compile" then tt.exec("clear && make\r") end
vim.defer_fn(function ()
vim.api.nvim_echo({
{ "▶ Terminal: ", "WarningMsg" },
{ "Running previous terminal command... ", "Normal" },
}, true, {})
end, 50)
return ""
end
return C

View File

@@ -1,6 +1,16 @@
--/lua/keybinds.lua
-- This file defines all of the kybinds for nvim.
-- vim.keymap.set('mode','<modifier>key','action', {desc = 'description'})
-- Add these lines at the very top of your keymaps file
vim.cmd('silent! unmapclear') -- Clears Normal, Visual, Select, and Operator-pending maps
vim.cmd('silent! cmapclear') -- Clears Command-line maps
vim.cmd('silent! imapclear') -- Clears Insert maps
vim.cmd('silent! tmapclear') -- Clears Terminal maps
-- ==========================================
-- Define your current keymaps below this line
-- ==========================================
vim.keymap.set('n', '<leader>w', ':w<CR>')
package.loaded["custom-functions"] = nil
local utils = require("custom-functions")
-- move betwwen buffer easier
@@ -16,12 +26,13 @@ vim.keymap.set('n','<M-Down>' ,"<cmd>lua require('resize').ResizeDown()<CR>")
vim.keymap.set('n','<Esc>' ,'<cmd>nohlsearch<CR>')
vim.keymap.set('t','<Esc><Esc>' ,'<C-\\><C-n>' ,{ desc = 'Exit terminal mode' })
vim.keymap.set('n','<leader>r' ,'<cmd>TermExec cmd="clear && make"<CR>' ,{ desc = '[r]un make in terminal' })
vim.keymap.set('n','<leader>l' ,function() utils.RunCommand("l") end ,{ desc = 'run [l]ast command in terminal' })
vim.keymap.set('n','<leader>n' ,'<cmd>ToggleTerm direction=vertical name=compile size=70<CR>', { desc = 'open a [n]ew terminal' })
vim.keymap.set('n','<leader>t' ,'<cmd>ToggleTerm<CR>' ,{desc = '[T]oggle all terminals'})
vim.keymap.set("n","<leader>e" ,"<cmd>NvimTreeToggle<CR>" ,{desc = 'open [E]xplorer'})
vim.keymap.set("n", "<leader>l" ,utils.runLastCommand ,{ desc = "Run [L]ast command in terminal 1" })
-- Diagnostic keymaps
vim.keymap.set('n', '<leader>q' ,vim.diagnostic.setloclist ,{ desc = 'Open diagnostic [Q]uickfix list' })
vim.keymap.set("n", "<leader>R" ,"<cmd>source %<Cr>:echo 'Config reloaded!'<CR>" ,{ desc = "[S]ource config file"})
-- Disable arrow keys in normal mode
vim.keymap.set('n','<left>' ,'<cmd>echo "Use h to move!!"<CR>')

12
lua/plugins/gitsigns.lua Normal file
View File

@@ -0,0 +1,12 @@
return { -- 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 = '~' },
},
},
}

View File

@@ -11,8 +11,8 @@ return { -- adds lsp functionality and api for included languages
{
keymap = {
preset = 'none',
['<CR>'] = { 'select_next', 'fallback' },
['<S-CR>'] = { 'select_prev', 'fallback' },
['<Down>'] = { 'select_next', 'fallback' },
['<Up>'] = { 'select_prev', 'fallback' },
['<Tab>'] = { 'accept', 'fallback' },
['<C-space>'] = { 'show', 'show_documentation', 'hide_documentation' },
},
@@ -26,26 +26,30 @@ return { -- adds lsp functionality and api for included languages
dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-mini/mini.nvim' }, -- if you use the mini.nvim suite
---@module 'render-markdown'
},
{ -- 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 = '~' },
},
},
},
}
},
{
'NMAC427/guess-indent.nvim',
config = function()
require('guess-indent').setup ({
filetype_exclude = {"lua"},
})
"folke/lazydev.nvim",
ft = "lua", -- only load on lua files
opts = {
library = {
-- Only load luvit types when the `vim.uv` word is found
{ path = "${3rd}/luv/library", words = { "vim%.uv" } },
-- always load the LazyVim library
"LazyVim",
-- Only load the lazyvim library when the `LazyVim` global is found
{ path = "LazyVim", words = { "LazyVim" } },
-- Load the wezterm types when the `wezterm` module is required
-- Needs `DrKJeff16/wezterm-types` to be installed
{ path = "wezterm-types", mods = { "wezterm" } },
-- Load the xmake types when opening file named `xmake.lua`
-- Needs `LelouchHe/xmake-luals-addon` to be installed
{ path = "xmake-luals-addon/library", files = { "xmake.lua" } },
},
-- disable when a .luarc.json file is found
enabled = function(root_dir)
return not vim.uv.fs_stat(root_dir .. "/.luarc.json")
end,
}, -- Detect tabstop and shiftwidth automatically
},
},
}