diff options
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/alpha/harpoon.lua | 44 | ||||
| -rw-r--r-- | lua/alpha/snips/ft/go.lua | 9 | ||||
| -rw-r--r-- | lua/config/init.lua | 1 | ||||
| -rw-r--r-- | lua/config/options.lua | 1 | ||||
| -rw-r--r-- | lua/config/usercmds.lua | 0 | ||||
| -rw-r--r-- | lua/plugins/deadcolumn.lua | 4 | ||||
| -rw-r--r-- | lua/plugins/harpoon.lua | 64 | ||||
| -rw-r--r-- | lua/plugins/laravel.lua | 1 | ||||
| -rw-r--r-- | lua/plugins/smart-splits.lua | 30 |
9 files changed, 103 insertions, 51 deletions
diff --git a/lua/alpha/harpoon.lua b/lua/alpha/harpoon.lua deleted file mode 100644 index 78e6e9b..0000000 --- a/lua/alpha/harpoon.lua +++ /dev/null @@ -1,44 +0,0 @@ -local M = {} - --- changing this values will require re-compile packer -local terms = vim.g.harpoon_terms or 3 -local quick_binds = vim.g.harpoon_quick_binds or 5 - -M.keymaps = { - { "<leader>ss" }, - { "<leader>sa" }, -} - -for i = 1, terms do - table.insert(M.keymaps, { string.format("<leader><leader>%s", i) }) -end - -for i = 1, quick_binds do - table.insert(M.keymaps, { string.format("<leader>%s", i) }) -end - -M.setup = function() - require("harpoon").setup() - - vim.keymap.set( - "n", - "<leader>ss", - require("harpoon.ui").toggle_quick_menu, - { noremap = true, silent = true, expr = false } - ) - vim.keymap.set("n", "<leader>sa", require("harpoon.mark").add_file, { noremap = true, silent = true, expr = false }) - - for i = 1, terms do - vim.keymap.set("n", string.format("<leader><leader>%s", i), function() - require("harpoon.term").gotoTerminal(i) - end, { noremap = true, silent = true, expr = false }) - end - - for i = 1, quick_binds do - vim.keymap.set("n", string.format("<leader>%s", i), function() - require("harpoon.ui").nav_file(i) - end, { noremap = true, silent = true, expr = false }) - end -end - -return M diff --git a/lua/alpha/snips/ft/go.lua b/lua/alpha/snips/ft/go.lua index 58c6bfc..637f57d 100644 --- a/lua/alpha/snips/ft/go.lua +++ b/lua/alpha/snips/ft/go.lua @@ -13,7 +13,12 @@ local ts_utils = require "nvim-treesitter.ts_utils" local get_node_text = vim.treesitter.get_node_text -vim.treesitter.set_query( +if vim.fn.has "nvim-0.9.0" ~= 1 then + vim.treesitter.query.get = vim.treesitter.get_query + vim.treesitter.query.set = vim.treesitter.set_query +end + +vim.treesitter.query.set( "go", "LuaSnip_Result", [[ @@ -83,7 +88,7 @@ local function go_result_type(info) end end - local query = vim.treesitter.get_query("go", "LuaSnip_Result") + local query = vim.treesitter.query.get_query("go", "LuaSnip_Result") for _, node in query:iter_captures(function_node, 0) do if handlers[node:type()] then return handlers[node:type()](node, info) diff --git a/lua/config/init.lua b/lua/config/init.lua index 2028a53..008ebf5 100644 --- a/lua/config/init.lua +++ b/lua/config/init.lua @@ -5,6 +5,7 @@ vim.api.nvim_create_autocmd("User", { pattern = "VeryLazy", callback = function() require "config.autocmds" + require "config.usercmds" require "config.keymaps" require "config.diagnostic" end, diff --git a/lua/config/options.lua b/lua/config/options.lua index 30a3127..0768bc3 100644 --- a/lua/config/options.lua +++ b/lua/config/options.lua @@ -37,6 +37,7 @@ opt.cmdheight = 1 opt.updatetime = 50 opt.signcolumn = "yes" opt.equalalways = false +opt.colorcolumn = "80,120" if vim.fn.has "nvim-0.9.0" == 1 then opt.splitkeep = "screen" diff --git a/lua/config/usercmds.lua b/lua/config/usercmds.lua new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/lua/config/usercmds.lua diff --git a/lua/plugins/deadcolumn.lua b/lua/plugins/deadcolumn.lua new file mode 100644 index 0000000..4aa9d87 --- /dev/null +++ b/lua/plugins/deadcolumn.lua @@ -0,0 +1,4 @@ +return { + "Bekaboo/deadcolumn.nvim", + event = { "VeryLazy" }, +} diff --git a/lua/plugins/harpoon.lua b/lua/plugins/harpoon.lua index d8a4b70..06ec2aa 100644 --- a/lua/plugins/harpoon.lua +++ b/lua/plugins/harpoon.lua @@ -1,11 +1,67 @@ +local keys = {} +local terms = 3 +local binds = 5 + +table.insert(keys, { + "<leader>ss", + function() + require("harpoon.ui").toggle_quick_menu() + end, +}) + +table.insert(keys, { + "<leader>sa", + function() + require("harpoon.mark").add_file() + end, +}) + +table.insert(keys, { + "<leader>st", + function () + vim.api.nvim_command([[vsplit]]) + require("harpoon.term").gotoTerminal(1) + vim.api.nvim_command([[startinsert]]) + end +}) + +for i = 1, terms do + table.insert(keys, { + string.format("<leader><leader>%s", i), + function() + require("harpoon.term").gotoTerminal(i) + end, + }) +end + +for i = 1, binds do + table.insert(keys, { + string.format("<leader>%s", i), + function() + require("harpoon.ui").nav_file(i) + end, + }) +end + return { "ThePrimeagen/harpoon", dependencies = { "nvim-lua/plenary.nvim", "nvim-lua/popup.nvim", }, - keys = require("alpha.harpoon").keymaps, - config = function() - require("alpha.harpoon").setup() - end, + keys = keys, + opts = { + global_settings = { + enter_on_sendcmd = true, + }, + projects = { + ["$HOME/code/svelte/snippets"] = { + term = { + cmds = { + "npm run dev", + }, + }, + }, + }, + }, } diff --git a/lua/plugins/laravel.lua b/lua/plugins/laravel.lua index 055ef9a..b236e54 100644 --- a/lua/plugins/laravel.lua +++ b/lua/plugins/laravel.lua @@ -9,7 +9,6 @@ return { { "<leader>la", ":Laravel artisan<cr>" }, { "<leader>lr", ":Laravel routes<cr>" }, }, - event = { "VeryLazy" }, config = function() vim.g.laravel_log_level = "debug" require("laravel").setup() diff --git a/lua/plugins/smart-splits.lua b/lua/plugins/smart-splits.lua new file mode 100644 index 0000000..49e1df3 --- /dev/null +++ b/lua/plugins/smart-splits.lua @@ -0,0 +1,30 @@ +return { + "mrjones2014/smart-splits.nvim", + config = true, + keys = { + { + "<A-h>", + function() + require("smart-splits").resize_left() + end, + }, + { + "<A-j>", + function() + require("smart-splits").resize_down() + end, + }, + { + "<A-k>", + function() + require("smart-splits").resize_up() + end, + }, + { + "<A-l>", + function() + require("smart-splits").resize_right() + end, + }, + }, +} |