From 198447271bb0ac6d2e6498be62e600a03a34d22c Mon Sep 17 00:00:00 2001 From: marekmichalski Date: Sun, 18 Feb 2024 10:08:20 +0100 Subject: [PATCH] custom settings --- lazy-lock.json | 30 ++++++++++++++++++++++++ lua/custom/init.lua | 3 +++ lua/custom/plugins/fugative.lua | 8 +++++++ lua/custom/plugins/harpoon.lua | 19 +++++++++++++++ lua/custom/plugins/undotree.lua | 8 +++++++ lua/custom/remap.lua | 41 +++++++++++++++++++++++++++++++++ lua/custom/set.lua | 29 +++++++++++++++++++++++ 7 files changed, 138 insertions(+) create mode 100644 lazy-lock.json create mode 100644 lua/custom/init.lua create mode 100644 lua/custom/plugins/fugative.lua create mode 100644 lua/custom/plugins/harpoon.lua create mode 100644 lua/custom/plugins/undotree.lua create mode 100644 lua/custom/remap.lua create mode 100644 lua/custom/set.lua diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 00000000..7559b757 --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,30 @@ +{ + "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, + "LuaSnip": { "branch": "master", "commit": "f3b3d3446bcbfa62d638b1903ff00a78b2b730a1" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, + "fidget.nvim": { "branch": "main", "commit": "4e854f3299e21d1c18279add340428a97520fc44" }, + "friendly-snippets": { "branch": "main", "commit": "dbd45e9ba76d535e4cba88afa1b7aa43bb765336" }, + "gitsigns.nvim": { "branch": "main", "commit": "2c2463dbd82eddd7dbab881c3a62cfbfbe3c67ae" }, + "harpoon": { "branch": "harpoon2", "commit": "a38be6e0dd4c6db66997deab71fc4453ace97f9c" }, + "indent-blankline.nvim": { "branch": "master", "commit": "821a7acd88587d966f7e464b0b3031dfe7f5680c" }, + "lazy.nvim": { "branch": "main", "commit": "aedcd79811d491b60d0a6577a9c1701063c2a609" }, + "lualine.nvim": { "branch": "master", "commit": "7d131a8d3ba5016229e8a1d08bf8782acea98852" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "fe4cce44dec93c69be17dad79b21de867dde118a" }, + "mason.nvim": { "branch": "main", "commit": "c43eeb5614a09dc17c03a7fb49de2e05de203924" }, + "neodev.nvim": { "branch": "main", "commit": "de3685b8c1cd439dd96b7958793f6f381f98652d" }, + "nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" }, + "nvim-lspconfig": { "branch": "master", "commit": "d1bab4cf4b69e49d6058028fd933d8ef5e74e680" }, + "nvim-treesitter": { "branch": "master", "commit": "eb1914bb10dc9b114a61197de0ec58a308c40071" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "7f00d94543f1fd37cab2afa2e9a6cd54e1c6b9ef" }, + "onedark.nvim": { "branch": "master", "commit": "1230aaf2a427b2c5b73aba6e4a9a5881d3e69429" }, + "plenary.nvim": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" }, + "telescope.nvim": { "branch": "0.1.x", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }, + "undotree": { "branch": "master", "commit": "9dbbf3b7d19dda0d22ceca461818e4739ad8154d" }, + "vim-fugitive": { "branch": "master", "commit": "011cf4fcb93a9649ffc6dcdff56ef948f5d0f7cc" }, + "vim-rhubarb": { "branch": "master", "commit": "ee69335de176d9325267b0fd2597a22901d927b1" }, + "vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" }, + "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } +} \ No newline at end of file diff --git a/lua/custom/init.lua b/lua/custom/init.lua new file mode 100644 index 00000000..dbbe78a9 --- /dev/null +++ b/lua/custom/init.lua @@ -0,0 +1,3 @@ +require("custom.remap") +require("custom.set") + diff --git a/lua/custom/plugins/fugative.lua b/lua/custom/plugins/fugative.lua new file mode 100644 index 00000000..d182475f --- /dev/null +++ b/lua/custom/plugins/fugative.lua @@ -0,0 +1,8 @@ +return { + { + 'vim-fugitive', + keys = { + {'gs', vim.cmd.Git, desc = 'open git'} + } + } +} diff --git a/lua/custom/plugins/harpoon.lua b/lua/custom/plugins/harpoon.lua new file mode 100644 index 00000000..48ac94e8 --- /dev/null +++ b/lua/custom/plugins/harpoon.lua @@ -0,0 +1,19 @@ +return { + { + "theprimeagen/harpoon", + branch = "harpoon2", + dependencies = { "nvim-lua/plenary.nvim" }, + config = function() + require("harpoon"):setup() + end, + keys = { + { "A", function() require("harpoon"):list():append() end, desc = "harpoon file", }, + { "a", function() local harpoon = require("harpoon") harpoon.ui:toggle_quick_menu(harpoon:list()) end, desc = "harpoon quick menu", }, + { "1", function() require("harpoon"):list():select(1) end, desc = "harpoon to file 1", }, + { "2", function() require("harpoon"):list():select(2) end, desc = "harpoon to file 2", }, + { "3", function() require("harpoon"):list():select(3) end, desc = "harpoon to file 3", }, + { "4", function() require("harpoon"):list():select(4) end, desc = "harpoon to file 4", }, + { "5", function() require("harpoon"):list():select(5) end, desc = "harpoon to file 5", }, + }, + }, +} diff --git a/lua/custom/plugins/undotree.lua b/lua/custom/plugins/undotree.lua new file mode 100644 index 00000000..01db41c1 --- /dev/null +++ b/lua/custom/plugins/undotree.lua @@ -0,0 +1,8 @@ +return { + { + 'mbbill/undotree', + keys = { + {'u',vim.cmd.UndotreeToggle, desc = 'toggle undotree'} + } + } +} diff --git a/lua/custom/remap.lua b/lua/custom/remap.lua new file mode 100644 index 00000000..da8e50bf --- /dev/null +++ b/lua/custom/remap.lua @@ -0,0 +1,41 @@ +vim.keymap.set("n", "pv", vim.cmd.Ex) + +vim.keymap.set("v", "J", ":m '>+1gv=gv") +vim.keymap.set("v", "K", ":m '<-2gv=gv") + +vim.keymap.set("n", "J", "mzJ`z") +vim.keymap.set("n", "", "zz") +vim.keymap.set("n", "", "zz") +vim.keymap.set("n", "n", "nzzzv") +vim.keymap.set("n", "N", "Nzzzv") + +-- greatest remap ever +vim.keymap.set("x", "p", [["_dP]]) + +-- next greatest remap ever : asbjornHaland +vim.keymap.set({"n", "v"}, "y", [["+y]]) +vim.keymap.set("n", "Y", [["+Y]]) + +vim.keymap.set({"n", "v"}, "d", [["_d]]) + +-- This is going to get me cancelled +vim.keymap.set("i", "", "") + +vim.keymap.set("n", "Q", "") +vim.keymap.set("n", "", "silent !tmux neww tmux-sessionizer") +vim.keymap.set("n", "f", vim.lsp.buf.format) + +vim.keymap.set("n", "", "cnextzz") +vim.keymap.set("n", "", "cprevzz") +vim.keymap.set("n", "k", "lnextzz") +vim.keymap.set("n", "j", "lprevzz") + +vim.keymap.set("n", "s", [[:%s/\<\>//gI]]) +vim.keymap.set("n", "x", "!chmod +x %", { silent = true }) + +vim.keymap.set("n", "vpp", "e ~/.dotfiles/nvim/.config/nvim/lua/theprimeagen/packer.lua"); +vim.keymap.set("n", "mr", "CellularAutomaton make_it_rain"); + +vim.keymap.set("n", "", function() + vim.cmd("so") +end) diff --git a/lua/custom/set.lua b/lua/custom/set.lua new file mode 100644 index 00000000..736d2adf --- /dev/null +++ b/lua/custom/set.lua @@ -0,0 +1,29 @@ +vim.opt.nu = true +vim.opt.relativenumber = true + +vim.opt.tabstop = 4 +vim.opt.softtabstop = 4 +vim.opt.shiftwidth = 4 +vim.opt.expandtab = true + +vim.opt.smartindent = true + +vim.opt.wrap = false + +vim.opt.swapfile = false +vim.opt.backup = false +vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir" +vim.opt.undofile = true + +vim.opt.hlsearch = false +vim.opt.incsearch = true + +vim.opt.termguicolors = true + +vim.opt.scrolloff = 8 +vim.opt.signcolumn = "yes" +vim.opt.isfname:append("@-@") + +vim.opt.updatetime = 50 + +vim.opt.colorcolumn = "80"