From 535de78034b347a3407aa6ff5287a1b4897172ea Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Fri, 22 Mar 2024 01:25:05 +0100 Subject: First commit! --- after/plugin/autoclose.lua | 20 +++++++++++++++++++ after/plugin/gitsigns.lua | 21 ++++++++++++++++++++ after/plugin/harpoon.lua | 33 ++++++++++++++++++++++++++++++++ after/plugin/mini.lua | 14 ++++++++++++++ after/plugin/telescope.lua | 38 +++++++++++++++++++++++++++++++++++++ after/plugin/treesitter.lua | 10 ++++++++++ after/plugin/vim-tmux-navigator.lua | 6 ++++++ 7 files changed, 142 insertions(+) create mode 100644 after/plugin/autoclose.lua create mode 100644 after/plugin/gitsigns.lua create mode 100644 after/plugin/harpoon.lua create mode 100644 after/plugin/mini.lua create mode 100644 after/plugin/telescope.lua create mode 100644 after/plugin/treesitter.lua create mode 100644 after/plugin/vim-tmux-navigator.lua (limited to 'after/plugin') diff --git a/after/plugin/autoclose.lua b/after/plugin/autoclose.lua new file mode 100644 index 0000000..89078ef --- /dev/null +++ b/after/plugin/autoclose.lua @@ -0,0 +1,20 @@ +require("autoclose").setup({ + keys = { + ["("] = { escape = false, close = true, pair = "()"}, + ["["] = { escape = false, close = true, pair = "[]"}, + ["{"] = { escape = false, close = true, pair = "{}"}, + + [">"] = { escape = true, close = false, pair = "<>"}, + [")"] = { escape = true, close = false, pair = "()"}, + ["]"] = { escape = true, close = false, pair = "[]"}, + ["}"] = { escape = true, close = false, pair = "{}"}, + + ['"'] = { escape = true, close = true, pair = '""'}, + ["'"] = { escape = true, close = true, pair = "''"}, + ["`"] = { escape = true, close = true, pair = "``"}, + }, + options = { + disabled_filetypes = { "text", "telekasten", "groff", "diff", "gitcommit", "fugitive" }, + disable_when_touch = true, + }, +}) diff --git a/after/plugin/gitsigns.lua b/after/plugin/gitsigns.lua new file mode 100644 index 0000000..e7ab463 --- /dev/null +++ b/after/plugin/gitsigns.lua @@ -0,0 +1,21 @@ +require("gitsigns").setup({ + signs = { + add = { text = "▎" }, + change = { text = "▎" }, + delete = { text = "▎" }, + topdelete = { text = "▎" }, + changedelete = { text = "▎" }, + untracked = { text = "▎" }, + }, + on_attach = function(buffer) + local gs = package.loaded.gitsigns + + local function map(mode, l, r, desc) + vim.keymap.set(mode, l, r, { buffer = buffer, desc = desc }) + end + + -- stylua: ignore start + map("n", "]g", gs.next_hunk, "Next git hunk") + map("n", "[g", gs.prev_hunk, "Previous git hunk") + end, +}) diff --git a/after/plugin/harpoon.lua b/after/plugin/harpoon.lua new file mode 100644 index 0000000..bd5aeef --- /dev/null +++ b/after/plugin/harpoon.lua @@ -0,0 +1,33 @@ +local harpoon = require("harpoon") + +-- REQUIRED +harpoon:setup() +-- REQUIRED + +vim.keymap.set("n", "a", function() + harpoon:list():append() +end, { desc = "Append file to harpoon starred list" }) +vim.keymap.set("n", "", function() + harpoon.ui:toggle_quick_menu(harpoon:list()) +end, { desc = "Check the list of files in harpoon" }) + +vim.keymap.set("n", "", function() + harpoon:list():select(1) +end, { desc = "Harpoon to 1st file in list" }) +vim.keymap.set("n", "", function() + harpoon:list():select(2) +end, { desc = "Harpoon to 2nd file in list" }) +vim.keymap.set("n", "", function() + harpoon:list():select(3) +end, { desc = "Harpoon to 3rd file in list" }) +vim.keymap.set("n", "", function() + harpoon:list():select(4) +end, { desc = "Harpoon to 4th file in list" }) + +-- Toggle previous & next buffers stored within Harpoon list +vim.keymap.set("n", "", function() + harpoon:list():prev() +end, { desc = "Harpoon to previous file in list" }) +vim.keymap.set("n", "", function() + harpoon:list():next() +end, { desc = "Harpoon to next file in list" }) diff --git a/after/plugin/mini.lua b/after/plugin/mini.lua new file mode 100644 index 0000000..d695a5a --- /dev/null +++ b/after/plugin/mini.lua @@ -0,0 +1,14 @@ +-- Setup my mini.nvim settings +-- mini.nvim is amazing because it add's a lot of functionality while keeping itself as minimal as possible +-- because of it's modular nature and fact it has a lot of functionality it lower the amount of needed plugins even for advanced features + +-- mini.nvim statusline module +require("mini.statusline").setup({ + set_vim_settings = false, +}) + +-- mini.nvim commeting module +require("mini.comment").setup({}) + +-- mini.nvim surround module +require("mini.surround").setup({}) diff --git a/after/plugin/telescope.lua b/after/plugin/telescope.lua new file mode 100644 index 0000000..55e9586 --- /dev/null +++ b/after/plugin/telescope.lua @@ -0,0 +1,38 @@ +require('telescope').setup({ + defaults = { + path_display = { + shorten = { + len = 3, exclude = {1, -1} + }, + truncate = true + }, + dynamic_preview_title = true, + }, + extensions = { + ["ui-select"] = { + require("telescope.themes").get_dropdown({}), + }, + ["fzf"] = { + fuzzy = true, + override_generic_sorter = true, + override_file_sorter = true, + case_mode = "smart_case", + }, + }, +}) + +local builtin = require('telescope.builtin') +vim.keymap.set('n', 'ff', builtin.find_files) +vim.keymap.set('n', 'fb', builtin.buffers) +vim.keymap.set('n', 'fg', builtin.git_files) +vim.keymap.set('n', 'fw', builtin.live_grep) +vim.keymap.set("n", "", "Telescope git_files", { desc = "Find git files" }) +vim.keymap.set("n", "vh", builtin.help_tags, { desc = "Find help tags" }) + +-- symbols +vim.keymap.set("n", "tse", "lua require'telescope.builtin'.symbols{ sources = {'emoji', 'gitmoji'} }") +vim.keymap.set("n", "tsn", "lua require'telescope.builtin'.symbols{ sources = {'nerd'} }") +vim.keymap.set("n", "tsj", "lua require'telescope.builtin'.symbols{ sources = {'julia'} }") + +require("telescope").load_extension("ui-select") +require("telescope").load_extension("fzf") diff --git a/after/plugin/treesitter.lua b/after/plugin/treesitter.lua new file mode 100644 index 0000000..1eb6fa5 --- /dev/null +++ b/after/plugin/treesitter.lua @@ -0,0 +1,10 @@ +require("nvim-treesitter.configs").setup({ + ensure_installed = { "lua", "bash" }, + sync_install = false, + auto_install = true, + + highlight = { + enable = true, + additional_vim_regex_highlighting = false, + }, +}) diff --git a/after/plugin/vim-tmux-navigator.lua b/after/plugin/vim-tmux-navigator.lua new file mode 100644 index 0000000..c7042fd --- /dev/null +++ b/after/plugin/vim-tmux-navigator.lua @@ -0,0 +1,6 @@ +vim.cmd("let g:tmux_navigator_no_mappings = 1") +vim.keymap.set("n", "", ":TmuxNavigateLeft", {silent = true}) +vim.keymap.set("n", "", ":TmuxNavigateDown", {silent = true}) +vim.keymap.set("n", "", ":TmuxNavigateUp", {silent = true}) +vim.keymap.set("n", "", ":TmuxNavigateRight", {silent = true}) +vim.keymap.set("n", "", ":TmuxNavigatePrevious", {silent = true}) -- cgit v1.2.3