feat: some stuff

This commit is contained in:
max_richter 2023-01-05 16:16:28 +01:00
parent 64c34d4d18
commit 03ce5748b1
7 changed files with 70 additions and 46 deletions

View File

@ -1 +1,2 @@
vim.api.nvim_set_keymap("n", "I", "zo", { noremap = true, silent = true }) vim.api.nvim_set_keymap("n", "I", "zo", { noremap = true, silent = true, buffer = 0 })
vim.api.nvim_set_keymap("n", "<leader><leader>", "zo", { noremap = true, silent = true, buffer = 0 })

View File

@ -1,25 +1,25 @@
{ {
"ChatGPT.nvim": { "branch": "main", "commit": "e9feafe55e3b42f2b23dff74c5f975a93cc9967a" }, "ChatGPT.nvim": { "branch": "main", "commit": "6c7e326add8fbb8c6662d92dd6bd9e1eb15f7c5a" },
"Comment.nvim": { "branch": "master", "commit": "5f01c1a89adafc52bf34e3bf690f80d9d726715d" }, "Comment.nvim": { "branch": "master", "commit": "ab00bcf5aa979c53f2f40dc2655c03e24f4ef50f" },
"FixCursorHold.nvim": { "branch": "master", "commit": "70a9516a64668cbfe59f31b66d0a21678c5e9b12" }, "FixCursorHold.nvim": { "branch": "master", "commit": "70a9516a64668cbfe59f31b66d0a21678c5e9b12" },
"LuaSnip": { "branch": "master", "commit": "5570fd797eae0790affb54ea669a150cad76db5d" }, "LuaSnip": { "branch": "master", "commit": "5570fd797eae0790affb54ea669a150cad76db5d" },
"alpha-nvim": { "branch": "main", "commit": "21a0f2520ad3a7c32c0822f943368dc063a569fb" }, "alpha-nvim": { "branch": "main", "commit": "21a0f2520ad3a7c32c0822f943368dc063a569fb" },
"autolist.nvim": { "branch": "main", "commit": "f600383a7ad97de236e7d968a74a4c4f847ae03d" }, "autolist.nvim": { "branch": "main", "commit": "22e69de24e83230955d673d34c1bdebeed3f17ba" },
"boole.nvim": { "branch": "main", "commit": "d059fd7da634aaaabddbb280709f92effd9f2dba" }, "boole.nvim": { "branch": "main", "commit": "d059fd7da634aaaabddbb280709f92effd9f2dba" },
"catppuccin": { "branch": "main", "commit": "55f43a952856bc0029e6cef066297c6cfab3451d" }, "catppuccin": { "branch": "main", "commit": "3020af75aae098a77737d91ee37c7147c8450d99" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-nvim-lsp": { "branch": "main", "commit": "59224771f91b86d1de12570b4070fe4ad7cd1eeb" }, "cmp-nvim-lsp": { "branch": "main", "commit": "59224771f91b86d1de12570b4070fe4ad7cd1eeb" },
"cmp-nvim-lua": { "branch": "main", "commit": "d276254e7198ab7d00f117e88e223b4bd8c02d21" }, "cmp-nvim-lua": { "branch": "main", "commit": "d276254e7198ab7d00f117e88e223b4bd8c02d21" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" }, "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" },
"editorconfig-vim": { "branch": "master", "commit": "30ddc057f71287c3ac2beca876e7ae6d5abe26a0" }, "editorconfig-vim": { "branch": "master", "commit": "30ddc057f71287c3ac2beca876e7ae6d5abe26a0" },
"friendly-snippets": { "branch": "main", "commit": "1a6a02350568d6830bcfa167c72f9b6e75e454ae" }, "friendly-snippets": { "branch": "main", "commit": "484fb38b8f493ceeebf4e6fc499ebe41e10aae25" },
"fwatch.nvim": { "branch": "main", "commit": "a691f7349dc66285cd75a1a698dd28bca45f2bf8" }, "fwatch.nvim": { "branch": "main", "commit": "a691f7349dc66285cd75a1a698dd28bca45f2bf8" },
"fzf": { "branch": "master", "commit": "73162a4bc3403e3532afa8a95008a3b4a00d554a" }, "fzf": { "branch": "master", "commit": "ee5cdb9713715883ac6d2cd87bc8a091ff7c8361" },
"git-conflict.nvim": { "branch": "main", "commit": "77faa75c09a6af88e7b54d8d456327e06611f7ea" }, "git-conflict.nvim": { "branch": "main", "commit": "cbefa7075b67903ca27f6eefdc9c1bf0c4881017" },
"gitsigns.nvim": { "branch": "main", "commit": "2ab3bdf0a40bab53033048c6be75bda86316b55d" }, "gitsigns.nvim": { "branch": "main", "commit": "d4f8c01280413919349f5df7daccd0c172143d7c" },
"lazy.nvim": { "branch": "main", "commit": "e5dcc871491eadc5ed98e633afc519670e71c4a1" }, "lazy.nvim": { "branch": "main", "commit": "d3b0d3e851b5609a2630e0307e18dc852efd0bd0" },
"leap.nvim": { "branch": "main", "commit": "a5c9504290832e6bdbbb6265fd1ff02fc6485d20" }, "leap.nvim": { "branch": "main", "commit": "a968ab4250840dc879e805f918b4f3b892310a12" },
"litee-calltree.nvim": { "branch": "main", "commit": "e2dffec35740032258fee3a3c7f30123226f2271" }, "litee-calltree.nvim": { "branch": "main", "commit": "e2dffec35740032258fee3a3c7f30123226f2271" },
"litee-symboltree.nvim": { "branch": "main", "commit": "488a660afcfd54644e6b755256907d3c7d8cf8d0" }, "litee-symboltree.nvim": { "branch": "main", "commit": "488a660afcfd54644e6b755256907d3c7d8cf8d0" },
"litee.nvim": { "branch": "main", "commit": "bf366a1414fd0f9401631ac8884f2f9fa4bf18d2" }, "litee.nvim": { "branch": "main", "commit": "bf366a1414fd0f9401631ac8884f2f9fa4bf18d2" },
@ -29,36 +29,36 @@
"lspkind.nvim": { "branch": "master", "commit": "c68b3a003483cf382428a43035079f78474cd11e" }, "lspkind.nvim": { "branch": "master", "commit": "c68b3a003483cf382428a43035079f78474cd11e" },
"lspsaga.nvim": { "branch": "main", "commit": "b7b4777369b441341b2dcd45c738ea4167c11c9e" }, "lspsaga.nvim": { "branch": "main", "commit": "b7b4777369b441341b2dcd45c738ea4167c11c9e" },
"lualine-lsp-progress": { "branch": "master", "commit": "56842d097245a08d77912edf5f2a69ba29f275d7" }, "lualine-lsp-progress": { "branch": "master", "commit": "56842d097245a08d77912edf5f2a69ba29f275d7" },
"lualine.nvim": { "branch": "master", "commit": "fffbcb829288c3ca366f17cdb8d46aefb5c1d6f3" }, "lualine.nvim": { "branch": "master", "commit": "d8c392dd75778d6258da4e7c55522e94ac389732" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "5bea0e851b8f48479d2cb927cd26733b4058b2b3" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "aa25b4153d2f2636c3b3a8c8360349d2b29e7ae3" },
"mason.nvim": { "branch": "main", "commit": "e6f6f901959d39d112b096d26b909c65723981d3" }, "mason.nvim": { "branch": "main", "commit": "38f0d1e467d1d3c22724c467efab8a4671a3b7bb" },
"neotest": { "branch": "master", "commit": "de2f68fb13a05c361e0c096e167f7f79712f3a5c" }, "neotest": { "branch": "master", "commit": "414b43f99da0a827c3ce897161fc67c3bb6a5d83" },
"neotest-jest": { "branch": "main", "commit": "8b8926480865e56053681d0c56e3be0a3b5e716c" }, "neotest-jest": { "branch": "main", "commit": "8b8926480865e56053681d0c56e3be0a3b5e716c" },
"neotest-vitest": { "branch": "main", "commit": "d6577b191e16c174bffbec1eadfcd65c22fdcc0d" }, "neotest-vitest": { "branch": "main", "commit": "d6577b191e16c174bffbec1eadfcd65c22fdcc0d" },
"nui.nvim": { "branch": "main", "commit": "b12db5321c194c10eb34e610fb76ce2c058853fc" }, "nui.nvim": { "branch": "main", "commit": "257da38029d3859ed111804f9d4e95b0fa993a31" },
"nvim-cmp": { "branch": "main", "commit": "8868cf9a09e5f3c2612a22ccb82dcc6d9f0d0d35" }, "nvim-cmp": { "branch": "main", "commit": "c49ad26e894e137e401b1d294948c46327877eaf" },
"nvim-dap": { "branch": "master", "commit": "6f2ea9e33b48a51849ec93c6c38148a5372018e4" }, "nvim-dap": { "branch": "master", "commit": "1077a86c83f75a6eec36c91f91d6b728e2b02130" },
"nvim-dap-ui": { "branch": "master", "commit": "54365d2eb4cb9cfab0371306c6a76c913c5a67e3" }, "nvim-dap-ui": { "branch": "master", "commit": "f2206de65ea39093e3f13992507fc985c17aa763" },
"nvim-dap-vscode-js": { "branch": "main", "commit": "e7c05495934a658c8aa10afd995dacd796f76091" }, "nvim-dap-vscode-js": { "branch": "main", "commit": "e7c05495934a658c8aa10afd995dacd796f76091" },
"nvim-lastplace": { "branch": "main", "commit": "ecced899435c6bcdd81becb5efc6d5751d0dc4c8" }, "nvim-lastplace": { "branch": "main", "commit": "ecced899435c6bcdd81becb5efc6d5751d0dc4c8" },
"nvim-lspconfig": { "branch": "master", "commit": "25f0c65bd8fddadbafd0048a68560bf160ceb98c" }, "nvim-lspconfig": { "branch": "master", "commit": "e69978a39e4d3262b09ce6a316beff384f443e3b" },
"nvim-notify": { "branch": "master", "commit": "b005821516f1f37801a73067afd1cef2dbc4dfe8" }, "nvim-notify": { "branch": "master", "commit": "b005821516f1f37801a73067afd1cef2dbc4dfe8" },
"nvim-scrollbar": { "branch": "main", "commit": "f45aecbba9c402282dfc99721e0ad4c08710907c" }, "nvim-scrollbar": { "branch": "main", "commit": "6e704cdeb7114385b4b19f9dc4b8f0c442019edc" },
"nvim-toggleterm.lua": { "branch": "main", "commit": "b02a1674bd0010d7982b056fd3df4f717ff8a57a" }, "nvim-toggleterm.lua": { "branch": "main", "commit": "b02a1674bd0010d7982b056fd3df4f717ff8a57a" },
"nvim-tree.lua": { "branch": "master", "commit": "e14c2895b4f36a22001f7773244041c173dcf867" }, "nvim-tree.lua": { "branch": "master", "commit": "bac962caf472a4404ed3ce1ba2fcaf32f8002951" },
"nvim-treesitter": { "branch": "master", "commit": "895d4a1202f36df561ba032c93b9deb72e1edee8" }, "nvim-treesitter": { "branch": "master", "commit": "b1569394614804aaad4e994731161f253ff61bcc" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "d816761ec1ea4a605689bc5f4111088459cf74d4" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "d816761ec1ea4a605689bc5f4111088459cf74d4" },
"nvim-web-devicons": { "branch": "master", "commit": "05e1072f63f6c194ac6e867b567e6b437d3d4622" }, "nvim-web-devicons": { "branch": "master", "commit": "05e1072f63f6c194ac6e867b567e6b437d3d4622" },
"persisted.nvim": { "branch": "main", "commit": "558fc4b9f48e16008782240521cb72455d93b835" }, "persisted.nvim": { "branch": "main", "commit": "558fc4b9f48e16008782240521cb72455d93b835" },
"plenary.nvim": { "branch": "master", "commit": "4b7e52044bbb84242158d977a50c4cbcd85070c7" }, "plenary.nvim": { "branch": "master", "commit": "bb444796dc5746d969f0718913a31c8075741e36" },
"popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" },
"sniprun": { "branch": "master", "commit": "c37086a0d12b2053bf147c2f4643c0c92318c0c2" }, "sniprun": { "branch": "master", "commit": "79806dad094770a1563ac0227c9692f7592df744" },
"telescope.nvim": { "branch": "master", "commit": "e960efa60e97df58e089b00270f09d60f27202c8" }, "telescope.nvim": { "branch": "master", "commit": "a606bd10c79ec5989c76c49cc6f736e88b63f0da" },
"translate.nvim": { "branch": "main", "commit": "7b2fd50c21ecfe536d572d62dcd3fa83acad3743" }, "translate.nvim": { "branch": "main", "commit": "7b2fd50c21ecfe536d572d62dcd3fa83acad3743" },
"trouble.nvim": { "branch": "main", "commit": "897542f90050c3230856bc6e45de58b94c700bbf" }, "trouble.nvim": { "branch": "main", "commit": "83ec606e7065adf134d17f4af6bae510e3c491c1" },
"undotree": { "branch": "master", "commit": "1a23ea84bd02c34f50d8e10a8b4bfc89597ffe4e" }, "undotree": { "branch": "master", "commit": "1a23ea84bd02c34f50d8e10a8b4bfc89597ffe4e" },
"vim-dadbod": { "branch": "master", "commit": "34151ccce9f5ff16229b8e482a97e46997914cb3" }, "vim-dadbod": { "branch": "master", "commit": "a09e40664e9cd30cd2b3f8866b796598302070f6" },
"vim-dadbod-ui": { "branch": "master", "commit": "6a2b841d2f0b82386c637ce4e9954ae12c7eaee8" }, "vim-dadbod-ui": { "branch": "master", "commit": "ecf07480687a13fe1bd3899270a6c9c99de51f4b" },
"vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" },
"which-key.nvim": { "branch": "main", "commit": "b7e0b1f16c20bc1ea0515851bc5740d1c1f18444" } "which-key.nvim": { "branch": "main", "commit": "b7e0b1f16c20bc1ea0515851bc5740d1c1f18444" }
} }

View File

@ -23,6 +23,7 @@ local check_backspace = function()
return col == 0 or vim.fn.getline("."):sub(col, col):match("%s") return col == 0 or vim.fn.getline("."):sub(col, col):match("%s")
end end
cmp.setup({ cmp.setup({
window = { window = {
documentation = cmp.config.window.bordered(), documentation = cmp.config.window.bordered(),

View File

@ -39,3 +39,4 @@ require("nvim-tree").setup({
}) })
vim.cmd("NvimTreeOpen") vim.cmd("NvimTreeOpen")
vim.api.nvim_input("<C-l>")

View File

@ -1,3 +1,6 @@
local autocmd = vim.api.nvim_create_autocmd
local augroup = vim.api.nvim_create_augroup
local config_group = vim.api.nvim_create_augroup("Config", {}) local config_group = vim.api.nvim_create_augroup("Config", {})
vim.api.nvim_create_autocmd({ "TextYankPost" }, { vim.api.nvim_create_autocmd({ "TextYankPost" }, {
@ -7,18 +10,29 @@ vim.api.nvim_create_autocmd({ "TextYankPost" }, {
end, end,
}) })
local rememberFoldsGroup = vim.api.nvim_create_augroup("RememberFolds", { clear = true })
vim.api.nvim_create_autocmd({ "BufWinLeave", "BufLeave" }, { vim.api.nvim_create_autocmd({ "BufReadPost" }, {
pattern = "*", group = config_group,
group = rememberFoldsGroup, callback = function()
command = "mkview", vim.cmd("filetype detect")
end,
}) })
vim.api.nvim_create_autocmd("BufWinEnter", {
pattern = "*", local save_fold = augroup("Persistent Folds", { clear = true })
group = rememberFoldsGroup, autocmd("BufWinLeave", {
command = "silent! loadview", pattern = "*.*",
callback = function()
vim.cmd.mkview()
end,
group = save_fold,
})
autocmd("BufWinEnter", {
pattern = "*.*",
callback = function()
vim.cmd.loadview({ mods = { emsg_silent = true } })
end,
group = save_fold,
}) })
vim.cmd([[ vim.cmd([[

View File

@ -13,8 +13,6 @@ map("n", "<C-o>", ":Telescope find_files preview={timeout=1000}<CR>", opts)
map("n", "<C-f>", ":lua require'telescope.builtin'.live_grep{ cwd = vim.fn.getcwd() }<CR>", opts) map("n", "<C-f>", ":lua require'telescope.builtin'.live_grep{ cwd = vim.fn.getcwd() }<CR>", opts)
map("n", "<Leader><leader>", "za", opts) map("n", "<Leader><leader>", "za", opts)
map("n", "<Leader>is", "<cmd>lua require('litee.lib.lsp.wrappers').buf_document_symbol()<CR>", opts)
map("n", "<Leader>io", "<cmd>LSoutlineToggle<CR>", opts)
map("v", ">", ">gv", opts) map("v", ">", ">gv", opts)
map("v", "<", "<gv", opts) map("v", "<", "<gv", opts)
@ -31,8 +29,12 @@ map("n", "<Leader>e", "<cmd>lua vim.lsp.buf.hover()<CR>", { silent = true })
map("n", "<Leader>rn", "<cmd>lua vim.lsp.buf.rename()<CR>", opts) map("n", "<Leader>rn", "<cmd>lua vim.lsp.buf.rename()<CR>", opts)
map({ "n", "v" }, "<Leader>c", "<cmd>Lspsaga code_action<CR>", { silent = true }) map({ "n", "v" }, "<Leader>c", "<cmd>Lspsaga code_action<CR>", { silent = true })
map({ "n", "v" }, "gr", "<cmd>Lspsaga lsp_finder<CR>", opts) map({ "n", "v" }, "gr", "<cmd>Lspsaga lsp_finder<CR>", opts)
map("n", "<S-U>", ":UndotreeToggle<CR>", opts)
map("n", "<Leader>u", ":UndotreeToggle<CR>", opts)
-- This is my [i]nspect section, [i]nspect [s]ymbols, [
map("n", "<Leader>is", "<cmd>lua require('litee.lib.lsp.wrappers').buf_document_symbol()<CR>", opts)
map("n", "<Leader>io", "<cmd>Lspsaga outline<CR>", opts)
map("n", "<Leader>ip", ":TroubleToggle<CR>", opts) map("n", "<Leader>ip", ":TroubleToggle<CR>", opts)
map({ "n", "v" }, "<Leader>t", translate, opts) map({ "n", "v" }, "<Leader>t", translate, opts)
@ -79,11 +81,14 @@ map("n", "<Leader>j", "}", opts)
-- Move lines vscode style -- Move lines vscode style
map("n", "<A-j>", "<cmd>move +1<CR>", opts) map("n", "<A-j>", "<cmd>move +1<CR>", opts)
map("n", "<A-k>", "<cmd>move -2<CR>", opts) map("n", "<A-k>", "<cmd>move -2<CR>", opts)
map("n", "<A-S-K>", "yyP", opts)
map("n", "<A-S-J>", "yyp", opts)
map("i", "<A-j>", "<cmd>move +1<CR>", opts) map("i", "<A-j>", "<cmd>move +1<CR>", opts)
map("i", "<A-k>", "<cmd>move -2<CR>", opts) map("i", "<A-k>", "<cmd>move -2<CR>", opts)
map("v", "<A-j>", ":m '>+1<CR>gv=gv", opts) map("v", "<A-j>", ":m '>+1<CR>gv=gv", opts)
map("v", "<A-k>", ":m '<-2<CR>gv=gv", opts) map("v", "<A-k>", ":m '<-2<CR>gv=gv", opts)
-- If i paste with p, the replaced content doesnt replace my clipboard
map("v", "p", '"_dP', opts) map("v", "p", '"_dP', opts)
-- Faster git merge -- Faster git merge
@ -107,8 +112,8 @@ map("v", "<Leader>r", ":'<,'>SnipRun<CR>", opts)
-- Close on q -- Close on q
local function closeAll() local function closeAll()
vim.cmd("SessionSave") vim.cmd("SessionSave")
vim.cmd("qall") vim.cmd("qall")
end end
map("n", "<Leader>q", ":q<CR>", opts) map("n", "<Leader>q", ":q<CR>", opts)

View File

@ -113,9 +113,11 @@ local plugins = {
-- Lsp Setup -- -- Lsp Setup --
--------------- ---------------
{ "glepnir/lspsaga.nvim",
command = "Lspsaga"
}, -- better windows for lsp replace, goto definition etc...
{ "VonHeikemen/lsp-zero.nvim", { "VonHeikemen/lsp-zero.nvim",
dependencies = { dependencies = {
"glepnir/lspsaga.nvim", -- better windows for lsp replace, goto definition etc...
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
"arkav/lualine-lsp-progress", "arkav/lualine-lsp-progress",
"williamboman/mason.nvim", "williamboman/mason.nvim",
@ -131,7 +133,7 @@ local plugins = {
"rafamadriz/friendly-snippets", "rafamadriz/friendly-snippets",
{ "lukas-reineke/lsp-format.nvim", config = true }, { "lukas-reineke/lsp-format.nvim", config = true },
}, },
event = "InsertEnter", lazy = false,
config = function() config = function()
local lsp = require("lsp-zero") local lsp = require("lsp-zero")
lsp.preset("recommended") lsp.preset("recommended")
@ -145,7 +147,7 @@ local plugins = {
end }, end },
{ {
"folke/trouble.nvim", "folke/trouble.nvim",
event = "BufRead", command = "TroubleToggle",
dependencies = "kyazdani42/nvim-web-devicons", dependencies = "kyazdani42/nvim-web-devicons",
config = function() config = function()
require("trouble").setup({}) require("trouble").setup({})