Skip to content

Commit

Permalink
Add undotree and DAP configs
Browse files Browse the repository at this point in the history
  • Loading branch information
lgegrtnr committed Jul 13, 2023
1 parent c043563 commit 9e3c6e6
Show file tree
Hide file tree
Showing 3 changed files with 202 additions and 167 deletions.
2 changes: 2 additions & 0 deletions nvim-lua/custom/configs/vim-tmux-navigator.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
vim.g.tmux_navigator_no_wrap = 1
vim.g.tmux_navigator_disable_when_zoomed = 1
345 changes: 178 additions & 167 deletions nvim-lua/custom/plugins.lua
Original file line number Diff line number Diff line change
@@ -1,179 +1,190 @@
local overrides = require "custom.configs.overrides"
local overrides = require("custom.configs.overrides")

---@type NvPluginSpec[]
local plugins = {

-- Override plugin definition options
{
"neovim/nvim-lspconfig",
dependencies = {
-- format & linting
{
"jose-elias-alvarez/null-ls.nvim",
config = function()
require "custom.configs.null-ls"
end,
},
},
config = function()
require "plugins.configs.lspconfig"
require "custom.configs.lspconfig"
end,
},
-- Override plugin definition options
{
"neovim/nvim-lspconfig",
dependencies = {
-- format & linting
{
"jose-elias-alvarez/null-ls.nvim",
config = function()
require("custom.configs.null-ls")
end,
},
},
config = function()
require("plugins.configs.lspconfig")
require("custom.configs.lspconfig")
end,
},

-- override plugin configs
{
"williamboman/mason.nvim",
opts = overrides.mason,
},
{
"nvim-treesitter/nvim-treesitter",
opts = overrides.treesitter,
},
{
"nvim-tree/nvim-tree.lua",
opts = overrides.nvimtree,
cmd = { "NvimTreeFindFile", "NvimTreeToggle", "NvimTreeFocus" },
},
{
"numToStr/Comment.nvim",
dependencies = {
"JoosepAlviste/nvim-ts-context-commentstring",
},
config = function()
require("Comment").setup {
pre_hook = require("ts_context_commentstring.integrations.comment_nvim").create_pre_hook(),
}
end,
keys = {
{ "gc", mode = "n" },
},
},
-- override plugin configs
{
"williamboman/mason.nvim",
opts = overrides.mason,
},
{
"nvim-treesitter/nvim-treesitter",
opts = overrides.treesitter,
},
{
"nvim-tree/nvim-tree.lua",
opts = overrides.nvimtree,
cmd = { "NvimTreeFindFile", "NvimTreeToggle", "NvimTreeFocus" },
},
{
"numToStr/Comment.nvim",
dependencies = {
"JoosepAlviste/nvim-ts-context-commentstring",
},
config = function()
require("Comment").setup({
pre_hook = require("ts_context_commentstring.integrations.comment_nvim").create_pre_hook(),
})
end,
keys = {
{ "gc", mode = "n" },
},
},

-- Install a plugin
{
"max397574/better-escape.nvim",
event = "InsertEnter",
config = function()
require("better_escape").setup()
end,
},
-- Tpope
{
"tpope/vim-fugitive",
event = "VeryLazy",
},
{
"tpope/vim-surround",
event = "VeryLazy",
},
{
"tpope/vim-speeddating",
event = "VeryLazy",
},
{
"tpope/vim-repeat",
event = "VeryLazy",
},
{
"tpope/vim-abolish",
event = "VeryLazy",
},
{
"preservim/vim-markdown",
ft = "markdown",
config = function()
require "custom.configs.vim-markdown"
end,
},
{
"iamcco/markdown-preview.nvim",
ft = "markdown",
config = function()
vim.cmd ":call mkdp#util#install()"
end,
},
{
"ggandor/leap.nvim",
event = "VeryLazy",
config = function()
require("leap").add_default_mappings()
end,
},
{
"christoomey/vim-tmux-navigator",
event = "VeryLazy",
},
{
"Wansmer/treesj",
cmd = { "TSJToggle", "TSJSplit", "TSJJoin" },
opts = {
use_default_keymaps = false,
},
keys = {
{ "<leader>fj", mode = { "n" } },
},
dependencies = { "nvim-treesitter/nvim-treesitter" },
config = function(_, opts)
require("treesj").setup(opts)
require("core.utils").load_mappings "treesj"
end,
},
-- Install a plugin
{
"max397574/better-escape.nvim",
event = "InsertEnter",
config = function()
require("better_escape").setup()
end,
},
-- Tpope
{
"tpope/vim-fugitive",
event = "VeryLazy",
},
{
"tpope/vim-surround",
event = "VeryLazy",
},
{
"tpope/vim-speeddating",
event = "VeryLazy",
},
{
"tpope/vim-repeat",
event = "VeryLazy",
},
{
"tpope/vim-abolish",
event = "VeryLazy",
},
{
"preservim/vim-markdown",
ft = "markdown",
config = function()
require("custom.configs.vim-markdown")
end,
},
{
"iamcco/markdown-preview.nvim",
ft = "markdown",
config = function()
vim.cmd(":call mkdp#util#install()")
end,
},
{
"ggandor/leap.nvim",
event = "VeryLazy",
config = function()
require("leap").add_default_mappings()
end,
},
{
"christoomey/vim-tmux-navigator",
event = "VeryLazy",
config = function()
require("custom.configs.vim-tmux-navigator")
end,
},
{
"Wansmer/treesj",
cmd = { "TSJToggle", "TSJSplit", "TSJJoin" },
opts = {
use_default_keymaps = false,
},
keys = {
{ "<leader>fj", mode = { "n" } },
},
dependencies = { "nvim-treesitter/nvim-treesitter" },
config = function(_, opts)
require("treesj").setup(opts)
require("core.utils").load_mappings("treesj")
end,
},
{
"mbbill/undotree",
event = "VeryLazy",
config = function(_, _)
require("core.utils").load_mappings("undotree")
end,
},

-- DAP
{
"mfussenegger/nvim-dap",
config = function()
require("core.utils").load_mappings "dap"
end,
},
{
"rcarriga/nvim-dap-ui",
event = "VeryLazy",
dependencies = {
"mfussenegger/nvim-dap",
},
config = function()
local dap = require "dap"
local dapui = require "dapui"
dapui.setup()
dap.listeners.after.event_initialized["dapui_config"] = function()
dapui.open()
end
dap.listeners.before.event_initialized["dapui_config"] = function()
dapui.close()
end
dap.listeners.before.event_exited["dapui_config"] = function()
dapui.close()
end
end,
},
{
"jay-babu/mason-nvim-dap.nvim",
event = "VeryLazy",
dependencies = {
"williamboman/mason.nvim",
"mfussenegger/nvim-dap",
},
opts = {
handlers = {},
-- ensure_installed = { "node2" }, -- in Mason overrides
automatic_installation = true,
},
},
-- DAP
{
"mfussenegger/nvim-dap",
config = function()
require("core.utils").load_mappings("dap")
end,
},
{
"rcarriga/nvim-dap-ui",
event = "VeryLazy",
dependencies = {
"mfussenegger/nvim-dap",
},
config = function()
local dap = require("dap")
local dapui = require("dapui")
dapui.setup()
dap.listeners.after.event_initialized["dapui_config"] = function()
dapui.open()
end
dap.listeners.before.event_initialized["dapui_config"] = function()
dapui.close()
end
dap.listeners.before.event_exited["dapui_config"] = function()
dapui.close()
end
end,
},
{
"jay-babu/mason-nvim-dap.nvim",
event = "VeryLazy",
dependencies = {
"williamboman/mason.nvim",
"mfussenegger/nvim-dap",
},
opts = {
-- handlers = {}, -- pilla los defaults
handlers = nil, -- machaca todos los handlers
-- ensure_installed = { "node2" }, -- in Mason overrides
automatic_installation = true,
},
},

-- {
-- "NvChad/nvim-colorizer.lua",
-- enabled = false
-- },
-- {
-- "NvChad/nvim-colorizer.lua",
-- enabled = false
-- },

-- All NvChad plugins are lazy-loaded by default
-- For a plugin to be loaded, you will need to set either `ft`, `cmd`, `keys`, `event`, or set `lazy = false`
-- {
-- "mg979/vim-visual-multi",
-- lazy = false,
-- enabled = false
-- }
-- All NvChad plugins are lazy-loaded by default
-- For a plugin to be loaded, you will need to set either `ft`, `cmd`, `keys`, `event`, or set `lazy = false`
-- {
-- "mg979/vim-visual-multi",
-- lazy = false,
-- enabled = false
-- }
}

return plugins
22 changes: 22 additions & 0 deletions tmux.conf
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,28 @@ bind-key -r G neww -c "#{pane_current_path}" "lazygit"
bind-key -r C run-shell "tmux neww cht.sh"

### Plugins configuration

# Navigator
bind C-l send-keys 'C-l'

unbind-key -n 'C-h'
unbind-key -n 'C-j'
unbind-key -n 'C-k'
unbind-key -n 'C-l'

## Prevent wrapping around panes
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|l?n?vim?x?)(diff)?$'"
bind-key -n 'C-h' if-shell "$is_vim" { send-keys C-h } { if-shell -F '#{pane_at_left}' {} { select-pane -L } }
bind-key -n 'C-j' if-shell "$is_vim" { send-keys C-j } { if-shell -F '#{pane_at_bottom}' {} { select-pane -D } }
bind-key -n 'C-k' if-shell "$is_vim" { send-keys C-k } { if-shell -F '#{pane_at_top}' {} { select-pane -U } }
bind-key -n 'C-l' if-shell "$is_vim" { send-keys C-l } { if-shell -F '#{pane_at_right}' {} { select-pane -R } }

bind-key -T copy-mode-vi 'C-h' if-shell -F '#{pane_at_left}' {} { select-pane -L }
bind-key -T copy-mode-vi 'C-j' if-shell -F '#{pane_at_bottom}' {} { select-pane -D }
bind-key -T copy-mode-vi 'C-k' if-shell -F '#{pane_at_top}' {} { select-pane -U }
bind-key -T copy-mode-vi 'C-l' if-shell -F '#{pane_at_right}' {} { select-pane -R }

# Theme
# set-option -g @catppuccin_flavour 'mocha' # machiatto | frappe | latte
set-option -g @catppuccin_flavour 'frappe' # machiatto | frappe | latte
Expand Down

0 comments on commit 9e3c6e6

Please sign in to comment.