Skip to content

Instantly share code, notes, and snippets.

@prakritidev
Last active September 11, 2024 19:57
Show Gist options
  • Save prakritidev/a1a4d735bb26dbcb5eca37cb2048ba0a to your computer and use it in GitHub Desktop.
Save prakritidev/a1a4d735bb26dbcb5eca37cb2048ba0a to your computer and use it in GitHub Desktop.
Neovim Configs
return {
"0xstepit/flow.nvim",
lazy = false,
priority = 1000,
opts = {},
config = function()
require("flow").setup({
transparent = true,
fluo_color = "pink",
mode = "normal",
aggressive_spell = false,
})
vim.cmd("colorscheme flow")
end,
}
return {
{
"kdheepak/lazygit.nvim",
-- lazygit requires certain dependencies and setup
dependencies = { "nvim-lua/plenary.nvim" },
cmd = "LazyGit",
config = function()
vim.api.nvim_set_keymap("n", "<leader>lg", ":LazyGit<CR>", { noremap = true, silent = true })
end,
},
{
"lewis6991/gitsigns.nvim",
config = function()
require("gitsigns").setup({
signs = {
add = { hl = "GitGutterAdd", text = "+" },
change = { hl = "GitGutterChange", text = "~" },
delete = { hl = "GitGutterDelete", text = "_" },
topdelete = { hl = "GitGutterDelete", text = "‾" },
changedelete = { hl = "GitGutterChange", text = "~" },
},
numhl = false,
linehl = false,
keymaps = {
-- Default keymap options
noremap = true,
buffer = true,
},
watch_gitdir = {
interval = 1000,
follow_files = true,
},
attach_to_untracked = true,
current_line_blame = false,
current_line_blame_opts = {
virt_text = true,
virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align'
delay = 1000,
},
current_line_blame_formatter = "<author>, <author_time:%Y-%m-%d> - <summary>",
sign_priority = 6,
update_debounce = 100,
status_formatter = nil, -- Use default
max_file_length = 40000, -- Disable if file is longer than this (in lines)
preview_config = {
-- Options passed to nvim_open_win
border = "single",
style = "minimal",
relative = "cursor",
row = 0,
col = 1,
},
yadm = {
enable = false,
},
})
end,
},
{
"tpope/vim-fugitive",
cmd = { "Git", "G" },
},
}
require("plugins/terminal")
vim.api.nvim_set_keymap("n", "<leader>t", ":ToggleTerm<CR>", { noremap = true, silent = true })
-- terminal.lua in the plugins folder
--return {
--"akinsho/toggleterm.nvim",
--tag = "*",
--config = function()
-- require("toggleterm").setup({
-- size = 20, -- Height of the terminal
-- open_mapping = [[<c-\>]], -- Keybinding to open terminal
-- direction = "horizontal", -- Terminal opens at the bottom
-- shade_terminals = true, -- Shade the terminal background
-- shading_factor = "1", -- Level of shading
-- })
-- end,
--}
-- My own setup
--
--
return {
"akinsho/toggleterm.nvim",
tag = "*",
config = function()
require("toggleterm").setup({
-- Size configuration as a function to handle different directions
size = function(term)
if term.direction == "horizontal" then
return 15
elseif term.direction == "vertical" then
return vim.o.columns * 0.4
end
end,
-- Key mapping to open terminal
open_mapping = [[<c-\>]],
open_horizontal = [[<c-h>]],
open_vertical = [[<c-v>]],
open_float = [[<c-f>]],
-- Callbacks for terminal events
on_create = function(t) end,
on_open = function(t) end,
on_close = function(t) end,
on_stdout = function(t, job, data, name) end,
on_stderr = function(t, job, data, name) end,
on_exit = function(t, job, exit_code, name) end,
-- Appearance settings
hide_numbers = true,
shade_filetypes = {},
autochdir = false,
highlights = {
Normal = {
guibg = "#1e1e1e", -- Example color
},
NormalFloat = {
link = "Normal",
},
FloatBorder = {
guifg = "#ff0000", -- Example color
guibg = "#1e1e1e", -- Example color
},
},
shade_terminals = true,
shading_factor = -30,
shading_ratio = -3,
-- Terminal behavior settings
start_in_insert = true,
insert_mappings = true,
terminal_mappings = true,
persist_size = true,
persist_mode = true,
direction = "horizontal", -- or 'vertical', 'tab', 'float'
close_on_exit = true,
clear_env = false,
shell = vim.o.shell,
auto_scroll = true,
-- Floating window options
float_opts = {
border = "curved", -- 'single', 'double', 'shadow', 'curved'
width = 80,
height = 20,
row = 5,
col = 5,
winblend = 3,
zindex = 50,
title_pos = "center",
},
-- Winbar settings
winbar = {
enabled = false,
name_formatter = function(term)
return term.name
end,
},
})
end,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment