From a48619031d69de5d368822824687ad1d5eea75d3 Mon Sep 17 00:00:00 2001 From: Laily Date: Fri, 22 Mar 2024 11:05:02 +0800 Subject: [PATCH] fix: modify nvim config --- nvim/README.md | 20 -- nvim/get_packer_snapshot.sh | 11 - nvim/init.lua | 2 +- nvim/lazy-lock.json | 4 +- nvim/lock-v0.7.2.json | 1 - nvim/lock-v0.8.1.json | 1 - nvim/lock-v0.8.2.json | 1 - nvim/lock-v0.9.2.json | 1 - nvim/lua/config/autocmds.lua | 4 +- nvim/lua/config/keymaps.lua | 365 ++++++++++++--------------------- nvim/lua/config/options.lua | 54 ++--- nvim/lua/plugins/gitsigns.lua | 21 ++ nvim/lua/plugins/telescope.lua | 18 +- nvim/settings.lua | 65 ------ 14 files changed, 189 insertions(+), 379 deletions(-) delete mode 100644 nvim/README.md delete mode 100644 nvim/get_packer_snapshot.sh delete mode 100644 nvim/lock-v0.7.2.json delete mode 100644 nvim/lock-v0.8.1.json delete mode 100644 nvim/lock-v0.8.2.json delete mode 100644 nvim/lock-v0.9.2.json delete mode 100644 nvim/settings.lua diff --git a/nvim/README.md b/nvim/README.md deleted file mode 100644 index 1c4d666..0000000 --- a/nvim/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# Nvim config - -## Backup plugin version - -Because nvim have some breaking changes sometimes. I can not alwaexys use the latest version of plugins. - -### Backup - -Execute `get_packer_snapshot.sh`. And it will open vim, you should exit vim, and then it will backup all the plugin commit information to a json file. - -### Restore - -document: https://github.com/wbthomason/packer.nvim#usage - -``` -vim +"PackerSnapshot lock-${version}.json" -``` - - - diff --git a/nvim/get_packer_snapshot.sh b/nvim/get_packer_snapshot.sh deleted file mode 100644 index ce4a82b..0000000 --- a/nvim/get_packer_snapshot.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -version=$(nvim -v | awk 'NR==1{print $2}') - -path="$HOME/.cache/nvim/packer.nvim/lock-${version}.json" -rm -rf ${path} - -# this command will open vim, and you should quit it manualy -vim +"PackerSnapshot lock-${version}.json" -cp -f ${path} . - -echo 'file at '${path} diff --git a/nvim/init.lua b/nvim/init.lua index b0be348..c75c409 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -3,7 +3,7 @@ if vim.loader then end _G.dd = function(...) - require("util.debug").dump(...) + require("utils.debug").dump(...) end vim.print = _G.dd diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index 4e67b0f..8955bc2 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -40,11 +40,11 @@ "nui.nvim": { "branch": "main", "commit": "c3c7fd618dcb5a89e443a2e1033e7d11fdb0596b" }, "nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" }, "nvim-lint": { "branch": "master", "commit": "4dade85ff26e4bad40f895a6cc6762b7036237f4" }, - "nvim-lspconfig": { "branch": "master", "commit": "0ebcaedb2feb946e56658e0c9b6155fb6c8ad62b" }, + "nvim-lspconfig": { "branch": "master", "commit": "9553725789be682ecd945a527ec552e489ea8534" }, "nvim-notify": { "branch": "master", "commit": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15" }, "nvim-spectre": { "branch": "master", "commit": "3712ff0cdf4f9f877d9ca708d835a877d9a0abaf" }, "nvim-tree.lua": { "branch": "master", "commit": "d52fdeb0a300ac42b9cfa65ae0600a299f8e8677" }, - "nvim-treesitter": { "branch": "master", "commit": "d2f58c0b6507a4ad02ca0b647c130fb8396b4587" }, + "nvim-treesitter": { "branch": "master", "commit": "4a8901b0d5398b45e075fcdbf9b8fe546349cc14" }, "nvim-treesitter-context": { "branch": "master", "commit": "b8d1ffe58a88e0356da56b167373e89c4579ce15" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "95933e762e28f9d38b572d65e7e4da9d2f4d90cb" }, "nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" }, diff --git a/nvim/lock-v0.7.2.json b/nvim/lock-v0.7.2.json deleted file mode 100644 index 117f5c4..0000000 --- a/nvim/lock-v0.7.2.json +++ /dev/null @@ -1 +0,0 @@ -{"nvim-dap": {"commit": "2cfd770"}, "FixCursorHold.nvim": {"commit": "5aa5ff1"}, "nvcode-color-schemes.vim": {"commit": "3a0e624"}, "telescope-fzf-native.nvim": {"commit": "65c0ee3"}, "codi.vim": {"commit": "2898369"}, "packer.nvim": {"commit": "6afb674"}, "nvim-lspconfig": {"commit": "51775b1"}, "playground": {"commit": "bcfab84"}, "numb.nvim": {"commit": "453c50a"}, "nvim-dap-virtual-text": {"commit": "2971ce3"}, "which-key.nvim": {"commit": "92d924d"}, "telescope-file-browser.nvim": {"commit": "60bcf4e"}, "aerial.nvim": {"commit": "f7d6ca8"}, "nvim-autopairs": {"commit": "14cc2a4"}, "neotest-go": {"commit": "d506f83"}, "nvim-colorizer.lua": {"commit": "36c610a"}, "nvim-comment": {"commit": "e9ac16a"}, "tabular": {"commit": "339091a"}, "rnvimr": {"commit": "4ced809"}, "gitsigns.nvim": {"commit": "4d8a6e0"}, "glow.nvim": {"commit": "8dca358"}, "nvim-ts-autotag": {"commit": "fdefe46"}, "telescope.nvim": {"commit": "30e2dc5"}, "nvim-compe": {"commit": "d186d73"}, "telescope-project.nvim": {"commit": "91e9a97"}, "trouble.nvim": {"commit": "929315e"}, "nvim-ts-context-commentstring": {"commit": "4d3a68c"}, "lsp_signature.nvim": {"commit": "e65a638"}, "one-monokai-vim": {"commit": "4fdfd93"}, "gruvbox.nvim": {"commit": "c632f62"}, "hop.nvim": {"commit": "75f73d3"}, "lush.nvim": {"commit": "fabf012"}, "LuaSnip": {"commit": "e687d78"}, "vim-go-coverage": {"commit": "d9b0c9f"}, "vim-matchup": {"commit": "ab8575d"}, "popup.nvim": {"commit": "b7404d3"}, "nvim-bqf": {"commit": "aac1ff9"}, "FTerm.nvim": {"commit": "efd1065"}, "lua-dev.nvim": {"commit": "315ad43"}, "nvim-treesitter": {"commit": "8689f61"}, "neotest": {"commit": "15c0bb2"}, "nvim-dap-ui": {"commit": "ebebd42"}, "nvim-luapad": {"commit": "9815e26"}, "monokai.nvim": {"commit": "4fc970e"}, "lspsaga.nvim": {"commit": "9ec569a"}, "vim-markdown": {"commit": "8a0b434"}, "dashboard-nvim": {"commit": "d82ddae"}, "barbar.nvim": {"commit": "c41ad6e"}, "nvim-tree.lua": {"commit": "fb8735e"}, "bracey.vim": {"commit": "4e1a22a"}, "fzf-lua": {"commit": "9b23c2c"}, "nvim-lsp-installer": {"commit": "ae913cb"}, "lsp-rooter.nvim": {"commit": "7c83364"}, "toggleterm.nvim": {"commit": "f494c61"}, "plenary.nvim": {"commit": "62dc2a7"}, "telescope-dap.nvim": {"commit": "b4134ff"}, "markdown-preview.nvim": {"commit": "02cc387"}, "nvim-web-devicons": {"commit": "2d02a56"}, "DAPInstall.nvim": {"commit": "bbda2b0"}, "galaxyline.nvim": {"commit": "eb81be0"}} diff --git a/nvim/lock-v0.8.1.json b/nvim/lock-v0.8.1.json deleted file mode 100644 index baa075b..0000000 --- a/nvim/lock-v0.8.1.json +++ /dev/null @@ -1 +0,0 @@ -{"nvim-dap": {"commit": "8f396b7"}, "FixCursorHold.nvim": {"commit": "70a9516"}, "nvcode-color-schemes.vim": {"commit": "3a0e624"}, "telescope-fzf-native.nvim": {"commit": "7447fe7"}, "codi.vim": {"commit": "2898369"}, "packer.nvim": {"commit": "dcd2f38"}, "nvim-lspconfig": {"commit": "cb64ead"}, "playground": {"commit": "1290fdf"}, "numb.nvim": {"commit": "d95b7ea"}, "nvim-treesitter": {"commit": "7685324"}, "which-key.nvim": {"commit": "61553ae"}, "telescope-file-browser.nvim": {"commit": "8646e46"}, "fzf-lua": {"commit": "0c8b338"}, "nvim-autopairs": {"commit": "99f6963"}, "friendly-snippets": {"commit": "b4f857a"}, "vim-vsnip": {"commit": "e44026b"}, "nvim-colorizer.lua": {"commit": "36c610a"}, "toggleterm.nvim": {"commit": "f494c61"}, "tabular": {"commit": "339091a"}, "cmp-nvim-lsp": {"commit": "5922477"}, "vim-fugitive": {"commit": "49cc585"}, "neotest": {"commit": "a2559f0"}, "gitsigns.nvim": {"commit": "d076301"}, "glow.nvim": {"commit": "20d1cd0"}, "lspkind-nvim": {"commit": "c68b3a0"}, "cmp-cmdline": {"commit": "23c51b2"}, "telescope.nvim": {"commit": "3c2e5fb"}, "telescope-project.nvim": {"commit": "ff4d3ce"}, "trouble.nvim": {"commit": "897542f"}, "nvim-ts-context-commentstring": {"commit": "32d9627"}, "lsp_signature.nvim": {"commit": "2f3e574"}, "one-monokai-vim": {"commit": "4fdfd93"}, "gruvbox.nvim": {"commit": "02a9182"}, "nvim-bqf": {"commit": "448fa92"}, "aerial.nvim": {"commit": "38c6fe1"}, "hop.nvim": {"commit": "75f73d3"}, "lush.nvim": {"commit": "979f4d2"}, "LuaSnip": {"commit": "e687d78"}, "vim-go-coverage": {"commit": "d9b0c9f"}, "vim-matchup": {"commit": "55e3330"}, "popup.nvim": {"commit": "b7404d3"}, "cmp-vsnip": {"commit": "989a8a7"}, "nvim-web-devicons": {"commit": "189ad37"}, "FTerm.nvim": {"commit": "d132089"}, "nvim-dap-virtual-text": {"commit": "2971ce3"}, "neotest-go": {"commit": "4573733"}, "nvim-ts-autotag": {"commit": "fdefe46"}, "rnvimr": {"commit": "d78ca64"}, "nvim-dap-ui": {"commit": "54365d2"}, "barbar.nvim": {"commit": "9347ed8"}, "monokai.nvim": {"commit": "6fb4f7f"}, "lspsaga.nvim": {"commit": "9ec569a"}, "vim-markdown": {"commit": "df4be86"}, "dashboard-nvim": {"commit": "d82ddae"}, "nvim-luapad": {"commit": "6efe380"}, "nvim-tree.lua": {"commit": "829e9f6"}, "bracey.vim": {"commit": "4e1a22a"}, "nvim-lsp-installer": {"commit": "17e0bfa"}, "lsp-rooter.nvim": {"commit": "7c83364"}, "nvim-comment": {"commit": "e9ac16a"}, "plenary.nvim": {"commit": "4b7e520"}, "nvim-cmp": {"commit": "93f385c"}, "telescope-dap.nvim": {"commit": "b4134ff"}, "galaxyline.nvim": {"commit": "eb81be0"}, "markdown-preview.nvim": {"commit": "02cc387"}, "DAPInstall.nvim": {"commit": "bbda2b0"}, "neodev.nvim": {"commit": "dbed203"}, "cmp-path": {"commit": "91ff86c"}, "cmp-buffer": {"commit": "3022dbc"}} diff --git a/nvim/lock-v0.8.2.json b/nvim/lock-v0.8.2.json deleted file mode 100644 index f79e367..0000000 --- a/nvim/lock-v0.8.2.json +++ /dev/null @@ -1 +0,0 @@ -{"nvim-dap": {"commit": "69b7c68"}, "FixCursorHold.nvim": {"commit": "70a9516"}, "nvcode-color-schemes.vim": {"commit": "3a0e624"}, "telescope-fzf-native.nvim": {"commit": "fab3e22"}, "glow.nvim": {"commit": "20d1cd0"}, "packer.nvim": {"commit": "dac4088"}, "nvim-lspconfig": {"commit": "6b43ce5"}, "playground": {"commit": "8a887bc"}, "numb.nvim": {"commit": "d95b7ea"}, "nvim-treesitter": {"commit": "12e95e1"}, "which-key.nvim": {"commit": "8682d30"}, "telescope-file-browser.nvim": {"commit": "304508f"}, "aerial.nvim": {"commit": "6050ff7"}, "nvim-autopairs": {"commit": "03580d7"}, "neotest-go": {"commit": "981406c"}, "nvim-colorizer.lua": {"commit": "36c610a"}, "toggleterm.nvim": {"commit": "f494c61"}, "tabular": {"commit": "339091a"}, "vim-fugitive": {"commit": "99cdb88"}, "rnvimr": {"commit": "64579c4"}, "gitsigns.nvim": {"commit": "2ab3bdf"}, "codi.vim": {"commit": "6537ba6"}, "lspkind-nvim": {"commit": "c68b3a0"}, "cmp-cmdline": {"commit": "23c51b2"}, "telescope.nvim": {"commit": "a606bd1"}, "telescope-project.nvim": {"commit": "8e8ee37"}, "trouble.nvim": {"commit": "897542f"}, "nvim-ts-context-commentstring": {"commit": "4a42b30"}, "lsp_signature.nvim": {"commit": "1979f11"}, "nvim-lint": {"commit": "e03f265"}, "one-monokai-vim": {"commit": "4fdfd93"}, "gruvbox.nvim": {"commit": "c64ec55"}, "nvim-lsp-installer": {"commit": "17e0bfa"}, "cmp-nvim-lsp": {"commit": "5922477"}, "dashboard-nvim": {"commit": "d82ddae"}, "LuaSnip": {"commit": "e687d78"}, "vim-go-coverage": {"commit": "d9b0c9f"}, "vim-matchup": {"commit": "db5120d"}, "popup.nvim": {"commit": "b7404d3"}, "cmp-vsnip": {"commit": "989a8a7"}, "nvim-bqf": {"commit": "b418b0a"}, "FTerm.nvim": {"commit": "d132089"}, "nvim-dap-virtual-text": {"commit": "2971ce3"}, "vim-vsnip": {"commit": "8dde8c0"}, "nvim-ts-autotag": {"commit": "fdefe46"}, "neotest": {"commit": "414b43f"}, "nvim-dap-ui": {"commit": "54365d2"}, "barbar.nvim": {"commit": "bb2e5e4"}, "monokai.nvim": {"commit": "45427b2"}, "lspsaga.nvim": {"commit": "5faeec9"}, "vim-markdown": {"commit": "df4be86"}, "hop.nvim": {"commit": "75f73d3"}, "nvim-luapad": {"commit": "a5b3d6a"}, "nvim-tree.lua": {"commit": "bac962c"}, "bracey.vim": {"commit": "4e1a22a"}, "fzf-lua": {"commit": "7bb05a7"}, "lsp-rooter.nvim": {"commit": "7c83364"}, "nvim-comment": {"commit": "e9ac16a"}, "plenary.nvim": {"commit": "4b7e520"}, "nvim-cmp": {"commit": "c49ad26"}, "telescope-dap.nvim": {"commit": "313d2ea"}, "galaxyline.nvim": {"commit": "be96f3d"}, "markdown-preview.nvim": {"commit": "02cc387"}, "nvim-web-devicons": {"commit": "05e1072"}, "DAPInstall.nvim": {"commit": "bbda2b0"}, "neodev.nvim": {"commit": "c045c0f"}, "cmp-path": {"commit": "91ff86c"}, "cmp-buffer": {"commit": "3022dbc"}} diff --git a/nvim/lock-v0.9.2.json b/nvim/lock-v0.9.2.json deleted file mode 100644 index cff2237..0000000 --- a/nvim/lock-v0.9.2.json +++ /dev/null @@ -1 +0,0 @@ -{"nvim-dap": {"commit": "b3d4408"}, "FixCursorHold.nvim": {"commit": "1900f89"}, "nvcode-color-schemes.vim": {"commit": "3a0e624"}, "telescope-fzf-native.nvim": {"commit": "6c921ca"}, "glow.nvim": {"commit": "5b38fb7"}, "packer.nvim": {"commit": "ea0cc3c"}, "nvim-lspconfig": {"commit": "57139c6"}, "playground": {"commit": "429f3e7"}, "numb.nvim": {"commit": "3f7d4a7"}, "nvim-treesitter": {"commit": "5ec42175"}, "cmp-cmdline": {"commit": "8ee981b"}, "telescope-file-browser.nvim": {"commit": "ad7b637"}, "aerial.nvim": {"commit": "f34defe"}, "nvim-autopairs": {"commit": "defad64"}, "lspkind-nvim": {"commit": "57610d5"}, "neotest-go": {"commit": "1a15e11"}, "nvim-colorizer.lua": {"commit": "36c610a"}, "toggleterm.nvim": {"commit": "b90a138"}, "tabular": {"commit": "339091a"}, "cmp-nvim-lsp": {"commit": "44b16d1"}, "vim-fugitive": {"commit": "6fcb0ad"}, "rnvimr": {"commit": "5f0483d"}, "gitsigns.nvim": {"commit": "907ae86"}, "codi.vim": {"commit": "83b9859"}, "nvim-ts-autotag": {"commit": "6be1192"}, "which-key.nvim": {"commit": "7ccf476"}, "telescope.nvim": {"commit": "59812c2"}, "telescope-project.nvim": {"commit": "7c64b18"}, "trouble.nvim": {"commit": "3f85d8e"}, "nvim-ts-context-commentstring": {"commit": "95e9ba9"}, "lsp_signature.nvim": {"commit": "51784ba"}, "nvim-lint": {"commit": "12517fb"}, "one-monokai-vim": {"commit": "4fdfd93"}, "gruvbox.nvim": {"commit": "7fb36e0"}, "mason.nvim": {"commit": "d66c60e"}, "hop.nvim": {"commit": "75f73d3"}, "LuaSnip": {"commit": "e687d78"}, "nvim-bqf": {"commit": "a906a9d"}, "vim-matchup": {"commit": "6dbe108"}, "popup.nvim": {"commit": "b7404d3"}, "cmp-vsnip": {"commit": "989a8a7"}, "vim-go-coverage": {"commit": "d9b0c9f"}, "FTerm.nvim": {"commit": "d132089"}, "nvim-dap-virtual-text": {"commit": "57f1dbd"}, "vim-vsnip": {"commit": "be27746"}, "neotest": {"commit": "1e67a50"}, "nvim-dap-ui": {"commit": "34160a7"}, "barbar.nvim": {"commit": "283bcea"}, "monokai.nvim": {"commit": "b8bd44d"}, "lspsaga.nvim": {"commit": "5faeec9"}, "vim-markdown": {"commit": "cc82d88"}, "dashboard-nvim": {"commit": "d82ddae"}, "nvim-luapad": {"commit": "a5b3d6a"}, "nvim-tree.lua": {"commit": "94c7c81"}, "bracey.vim": {"commit": "4e1a22a"}, "fzf-lua": {"commit": "1e5347e"}, "lsp-rooter.nvim": {"commit": "7c83364"}, "nvim-comment": {"commit": "e9ac16a"}, "plenary.nvim": {"commit": "9ce85b0"}, "nvim-cmp": {"commit": "5dce1b7"}, "telescope-dap.nvim": {"commit": "4e2d5ef"}, "galaxyline.nvim": {"commit": "20f5f75"}, "markdown-preview.nvim": {"commit": "02cc387"}, "nvim-web-devicons": {"commit": "925e2aa"}, "neodev.nvim": {"commit": "471324e"}, "cmp-path": {"commit": "91ff86c"}, "cmp-buffer": {"commit": "3022dbc"}} diff --git a/nvim/lua/config/autocmds.lua b/nvim/lua/config/autocmds.lua index a9d3f98..244b795 100644 --- a/nvim/lua/config/autocmds.lua +++ b/nvim/lua/config/autocmds.lua @@ -7,8 +7,10 @@ vim.api.nvim_create_autocmd("InsertLeave", { -- Disable the concealing in some file formats -- The default conceallevel is 3 in LazyVim vim.api.nvim_create_autocmd("FileType", { - pattern = { "json", "jsonc", "markdown" }, + pattern = {"*.js","*.tsx","*.ts", "*.json", "*.jsonc", "*.markdown","*.md" }, callback = function() vim.opt.conceallevel = 0 + vim.o.tabstop = 2 + vim.o.shiftwidth = 2 end, }) diff --git a/nvim/lua/config/keymaps.lua b/nvim/lua/config/keymaps.lua index d866213..821d13a 100644 --- a/nvim/lua/config/keymaps.lua +++ b/nvim/lua/config/keymaps.lua @@ -1,273 +1,160 @@ -local opts = { - mode = "n", -- NORMAL mode - prefix = "", - buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings - silent = true, -- use `silent` when creating keymaps - noremap = true, -- use `noremap` when creating keymaps - nowait = false -- use `nowait` when creating keymaps -} - - - - - -local mappings = { - -- ["/"] = "Comment", - -- ["c"] = "Close Buffer", - ["e"] = "Explorer", - -- ["f"] = "Find File", - ["h"] = "No Highlight", - a = { - name = "+Action", - a = { "@:", "execute last command again" } - }, - b = { - name = "+Buffer", - q = { "q", "quit" }, - s = { "w", "save" }, - r = { "e!", "reload" }, - d = { "BufferClose", "close buffer" }, - z = { "CommentToggle", "toggle comment" }, - }, - D = { - name = "+Diagnostics", - t = { "TroubleToggle", "trouble" }, - w = { "TroubleToggle lsp_workspace_diagnostics", "workspace" }, - d = { "TroubleToggle lsp_document_diagnostics", "document" }, - q = { "TroubleToggle quickfix", "quickfix" }, - l = { "TroubleToggle loclist", "loclist" }, - r = { "TroubleToggle lsp_references", "references" }, - }, - d = { - name = "+Debug", - -- b = {"DebugToggleBreakpoint", "Toggle Breakpoint"}, - -- c = {"DebugContinue", "Continue"}, - -- i = {"DebugStepInto", "Step Into"}, - -- o = {"DebugStepOver", "Step Over"}, - -- r = {"DebugToggleRepl", "Toggle Repl"}, - -- s = {"DebugStart", "Start"} - d = { "lua vim.lsp.diagnostic.show_line_diagnostics()", "show diagnostics" }, - - c = { "lua require'dap'.continue()", "continue" }, - b = { ':lua require"dap".toggle_breakpoint()', "Toggle Breadpoint" }, - j = { ':lua require"dap".step_over()', "step over" }, - k = { ':lua require"dap".step_out()', "step out" }, - l = { ':lua require"dap".step_into()', "step into" }, - --', ':lua require"dap".continue()') - u = { ':lua require"dap".up()', "up" }, - -- d = {':lua require"dap".down()', "down"}, - _ = { ':lua require"dap".disconnect();require"dap".stop();require"dap".run_last()', "disconnect" }, - --r = {':lua require"dap".repl.open({}, "vsplit")l', "repl open"}, - i = { ':lua require"dap.ui.variables".visual_hover()', "visual_hover" }, - --? = {':lua require"dap.ui.variables".scopes()',"scopes"}, - -- e = {':lua require"dap".set_exception_breakpoints({"all"})',"esception bp"}, - -- a = {':lua require"debugHelper".attach()',"attach"}, - -- A = {':lua require"debugHelper".attachToRemote()',"attach to remote"}, - s = { ':lua local widgets=require"dap.ui.widgets";widgets.centered_float(widgets.scopes)', "centered_float" }, - }, - f = { - name = "+File", - m = { "lua require'utils'.open_md()", "open a markdown file in vscode" }, - s = { "w", "save file" }, - t = { "NvimTreeToggle", "toggle nvim tree" }, - r = { "RnvimrToggle", "toggle rnvimr" }, - y = { "lua require'utils'.yank_filepath()", "copy the file path" }, - d = { "lua require'utils'.yank_file_dir()", "copy the file path" }, - l = { "NvimTreeFindFile", "find file" }, - -- T = {"let @+ = 'go test -v -run='+expand('')", "get current word in go test"}, - }, - g = { - name = "+Git", - m = {"Gvdiff master:%", "Diff with master"}, - j = { "lua require 'gitsigns'.next_hunk()", "Next Hunk" }, - k = { "lua require 'gitsigns'.prev_hunk()", "Prev Hunk" }, - l = { "lua require 'gitsigns'.blame_line()", "Blame" }, - p = { "lua require 'gitsigns'.preview_hunk()", "Preview Hunk" }, - r = { "lua require 'gitsigns'.reset_hunk()", "Reset Hunk" }, - R = { "lua require 'gitsigns'.reset_buffer()", "Reset Buffer" }, - s = { "lua require 'gitsigns'.stage_hunk()", "Stage Hunk" }, - S = { "lua require 'gitsigns'.stage_buffer()", "Stage Buffer" }, - u = { - "lua require 'gitsigns'.undo_stage_hunk()", - "Undo Stage Hunk", - }, - o = { "Telescope git_status", "Open changed file" }, - b = { "Telescope git_branches", "Checkout branch" }, - c = { "Telescope git_commits", "Checkout commit" }, - C = { - "Telescope git_bcommits", - "Checkout commit(for current file)", - }, - d = { - "Gitsigns diffthis HEAD", - "Git Diff", - }, - }, - l = { - name = "+Language", - a = { "Lspsaga code_action", "Code Action" }, - A = { "Lspsaga range_code_action", "Selected Action" }, - d = { "Telescope lsp_document_diagnostics", "Document Diagnostics" }, - D = { "Telescope lsp_workspace_diagnostics", "Workspace Diagnostics" }, - f = { "LspFormatting", "Format" }, - F = { "Lspsaga lsp_finder", "LSP Finder" }, - -- i = {"Telescope lsp_implementations", "implement"}, - i = { "lua vim.lsp.buf.implementation()", "implement" }, - l = { "lua vim.lsp.buf.hover()", "hover" }, - L = { "Lspsaga show_line_diagnostics", "Line Diagnostics" }, - k = { ": LspRestart", "restart lsp server" }, - n = { "lua vim.lsp.diagnostic.goto_next()", "next diagnostic" }, - o = { ": SymbolsOutline", "symbols outline" }, - p = { "lua vim.lsp.diagnostic.goto_prev()", "prev diagnostic" }, - P = { "Lspsaga preview_definition", "Preview Definition" }, - q = { "Telescope quickfix", "Quickfix" }, - r = { "lua vim.lsp.buf.references()", "references" }, - R = { "Lspsaga rename", "Rename" }, - t = { "LspTypeDefinition", "Type Definition" }, - x = { "cclose", "Close Quickfix" }, - s = { "Telescope lsp_document_symbols", "Document Symbols" }, - S = { "Telescope lsp_dynamic_workspace_symbols", "Workspace Symbols" }, - z = { "LspInfo", "Info" }, - [","] = { "LspInstallInfo", "LSP servers" } - }, - p = { - name = "Packer", - c = { "PackerCompile", "Compile" }, - i = { "PackerInstall", "Install" }, - s = { "PackerSync", "Sync" }, - S = { "PackerStatus", "Status" }, - u = { "PackerUpdate", "Update" }, - }, - q = { - name = "quit", - q = { "qall", "quit" }, - }, - s = { - name = "+Search", - b = { "Telescope git_branches", "Checkout branch" }, - -- c = {"Telescope colorscheme", "Colorscheme"}, - c = { ":nohl", "no highlight" }, - d = { "Telescope lsp_document_diagnostics", "Document Diagnostics" }, - D = { "Telescope lsp_workspace_diagnostics", "Workspace Diagnostics" }, - f = { "Telescope find_files", "Find File" }, - m = { "Telescope marks", "Marks" }, - M = { "Telescope man_pages", "Man Pages" }, - -- r = { "Telescope oldfiles ", "Open Recent File" }, - R = { "Telescope registers", "Registers" }, - t = { "Telescope live_grep", "Text" }, - T = { "Telescope live_grep", "Text" }, - ["#"] = { "FzfLua grep_cword", "Search word under cursor" }, - }, - S = { - name = "+Session", - s = { "SessionSave", "Save Session" }, - l = { "SessionLoad", "Load Session" }, - }, - t = { - name = "+Test", - a = { "TestSuite -v -cover", "TestSuite" }, - t = { "lua require('neotest').run.run() ", "TestNearest" }, - f = { 'lua require("neotest").run.run(vim.fn.expand("%"))', "TestFile" }, - c = { "GoCover", "go coverage" }, - C = { "GoCoverClear", "go coverage clear" }, - b = { "lua require'dap'.toggle_breakpoint()", "set break point" }, - r = { "lua require'dap'.continue()", "continue" }, - }, - - -- extras - z = { - name = "+Zen", - s = { "TZBottom", "toggle status line" }, - t = { "TZTop", "toggle tab bar" }, - z = { "TZAtaraxis", "toggle zen" }, - } -} - -local wk = require("which-key") -wk.register(mappings, opts) - - local keymap = vim.keymap local opts = { noremap = true, silent = true } --- no hl -keymap.set('n', 'h', ':set hlsearch!', { noremap = true, silent = true }) +-- a +keymap.set('n', "aa", "@:", {desc="execute last command again" }) --- explorer -keymap.set('n', 'e', ':NvimTreeToggle', { noremap = true, silent = true }) +-- b for buffer +keymap.set('n', "bq", "q", {desc="quit" }) +keymap.set('n', "bs", "w", {desc="save" }) +keymap.set('n', "br", "e!", {desc="reload" }) +keymap.set('n', "bd", "BufferClose", {desc="close buffer" }) +keymap.set({'n','v'}, "b/", "CommentToggle", {desc="toggle comment" }) --- telescope --- keymap.set('n', '', ":lua require'telescope.builtin'.find_files()", {noremap = true, silent = true}) -keymap.set('n', '', ":Telescope find_files", { noremap = true, silent = true }) +-- D +keymap.set('n', "Dt", "TroubleToggle", {desc="trouble" }) +keymap.set('n', "Dw", "TroubleToggle lsp_workspace_diagnostics", {desc="workspace" }) +keymap.set('n', "Dd", "TroubleToggle lsp_document_diagnostics", {desc= "document" }) +keymap.set('n', "Dq", "TroubleToggle quickfix", {desc= "quickfix" }) +keymap.set('n', "Dl", "TroubleToggle loclist", {desc= "loclist" }) +keymap.set('n', "Dr", "TroubleToggle lsp_references", {desc= "references" }) --- dashboard +-- d +keymap.set('n', "dd", "lua vim.lsp.diagnostic.show_line_diagnostics()", {desc= "show diagnostics" }) +keymap.set('n', "dc", "lua require'dap'.continue()", {desc= "continue" }) +keymap.set('n', "db", ':lua require"dap".toggle_breakpoint()', {desc= "Toggle Breadpoint" }) +keymap.set('n', "dj", ':lua require"dap".step_over()', {desc= "step over" }) +keymap.set('n', "dk", ':lua require"dap".step_out()', {desc= "step out" }) +keymap.set('n', "dl", ':lua require"dap".step_into()', {desc= "step into" }) +keymap.set('n', "du", ':lua require"dap".up()', {desc= "up" }) +keymap.set('n', "d_", ':lua require"dap".disconnect();require"dap".stop();require"dap".run_last()', {desc= "disconnect" }) +keymap.set('n', "di", ':lua require"dap.ui.variables".visual_hover()', {desc= "visual_hover" }) +keymap.set('n', "ds", ':lua local widgets=require"dap.ui.widgets";widgets.centered_float(widgets.scopes)', {desc= "centered_float" }) + + +-- f +keymap.set('n', "fm", "lua require'utils'.open_md()", {desc= "open a markdown file in vscode" }) +keymap.set('n', "fs", "w", {desc= "save file" }) +keymap.set('n', "ft", "NvimTreeToggle", {desc= "toggle nvim tree" }) +keymap.set('n', "fr", "RnvimrToggle", {desc= "toggle rnvimr" }) +keymap.set('n', "fy", "lua require'utils'.yank_filepath()", {desc= "copy the file path" }) +keymap.set('n', "fd", "lua require'utils'.yank_file_dir()", {desc= "copy the file path" }) +keymap.set('n', "fl", "NvimTreeFindFile", {desc= "find file" }) + + +-- g +keymap.set('n', "gj", "lua require 'gitsigns'.next_hunk()", {desc= "Next Hunk" }) +keymap.set('n', "gk", "lua require 'gitsigns'.prev_hunk()", {desc= "Prev Hunk" }) +keymap.set('n', "gl", "lua require 'gitsigns'.blame_line()", {desc= "Blame" }) +keymap.set('n', "gp", "lua require 'gitsigns'.preview_hunk()", {desc= "Preview Hunk" }) +keymap.set('n', "gr", "lua require 'gitsigns'.reset_hunk()", {desc= "Reset Hunk" }) +keymap.set('n', "gR", "lua require 'gitsigns'.reset_buffer()", {desc= "Reset Buffer" }) +keymap.set('n', "gs", "lua require 'gitsigns'.stage_hunk()", {desc= "Stage Hunk" }) +keymap.set('n', "gS", "lua require 'gitsigns'.stage_buffer()", {desc= "Stage Buffer" }) +keymap.set('n', "gu", "lua require 'gitsigns'.undo_stage_hunk()", {desc= "Undo Stage Hunk", }) +keymap.set('n', "go", "Telescope git_status", {desc= "Open changed file" }) +keymap.set('n', "gb", "Telescope git_branches", {desc= "Checkout branch" }) +keymap.set('n', "gc", "Telescope git_commits", {desc= "Checkout commit" }) +keymap.set('n', "gC", "Telescope git_bcommits", {desc= "Checkout commit(for current file)", }) +keymap.set('n', "gd", "Gitsigns diffthis HEAD", {desc= "Git Diff", }) + +-- h +keymap.set('n', 'h', ':set hlsearch!', { noremap = true, silent = true }) -- no hl + +-- l for lsp +keymap.set('n', 'l', "", {desc="+Language"}) +keymap.set('n', 'la', "Lspsaga code_action", {desc="Code Action" }) +keymap.set('n', 'lA', "Lspsaga range_code_action", {desc="Selected Action" }) +keymap.set('n', 'ld', "Telescope lsp_document_diagnostics", {desc="Document Diagnostics" }) +keymap.set('n', 'lD', "Telescope lsp_workspace_diagnostics", {desc="Workspace Diagnostics" }) +keymap.set('n', 'lf', "LspFormatting", {desc="Format" }) +keymap.set('n', 'lF', "Lspsaga lsp_finder", {desc="LSP Finder" }) +keymap.set('n', 'li', "lua vim.lsp.buf.implementation()", {desc="implement" }) +keymap.set('n', 'll', "lua vim.lsp.buf.hover()", {desc="hover" }) +keymap.set('n', 'lL', "Lspsaga show_line_diagnostics", {desc="Line Diagnostics" }) +keymap.set('n', 'lk', ": LspRestart", {desc="restart lsp server" }) +keymap.set('n', 'ln', "lua vim.lsp.diagnostic.goto_next()", {desc="next diagnostic" }) +keymap.set('n', 'lo', ": SymbolsOutline", {desc="symbols outline" }) +keymap.set('n', 'lp', "lua vim.lsp.diagnostic.goto_prev()", {desc="prev diagnostic" }) +keymap.set('n', 'lP', "Lspsaga preview_definition", {desc="Preview Definition" }) +keymap.set('n', 'lq', "Telescope quickfix", {desc="Quickfix" }) +keymap.set('n', 'lr', "lua vim.lsp.buf.references()", {desc="references" }) +keymap.set('n', 'lR', "Lspsaga rename", {desc="Rename" }) +keymap.set('n', 'lt', "LspTypeDefinition", {desc="Type Definition" }) +keymap.set('n', 'lx', "cclose", {desc="Close Quickfix" }) +keymap.set('n', 'ls', "Telescope lsp_document_symbols", {desc="Document Symbols" }) +keymap.set('n', 'lS', "Telescope lsp_dynamic_workspace_symbols", {desc="Workspace Symbols" }) +keymap.set('n', 'lz', "LspInfo", {desc="Info" }) +keymap.set('n', 'l,', "LspInstallInfo", {desc="LSP servers" }) + +-- q +keymap.set('n', "qq", "qall", {desc= "quit" }) + + +-- s +keymap.set('n', "sb", "Telescope git_branches", {desc= "Checkout branch" }) +keymap.set('n', "sc", ":nohl", {desc= "no highlight" }) +keymap.set('n', "sd", "Telescope lsp_document_diagnostics", {desc= "Document Diagnostics" }) +keymap.set('n', "sD", "Telescope lsp_workspace_diagnostics", {desc= "Workspace Diagnostics" }) +keymap.set('n', "sf", "Telescope find_files", {desc= "Find File" }) +keymap.set('n', "sr", function() require("telescope.builtin").oldfiles({ cwd = vim.loop.cwd() }) end, {desc= "Old File" }) +keymap.set('n', "sm", "Telescope marks", {desc= "Marks" }) +keymap.set('n', "sM", "Telescope man_pages", {desc= "Man Pages" }) +keymap.set('n', "sR", "Telescope registers", {desc= "Registers" }) +keymap.set('n', "st", "Telescope live_grep", {desc= "Text" }) +keymap.set('n', "sT", "Telescope live_grep", {desc= "Text" }) +keymap.set('n', "s,", "FzfLua grep_cword", {desc= "Search word under cursor" }) + +-- S +keymap.set('n', "Ss", "SessionSave", {desc= "Save Session" }) +keymap.set('n', "Sl", "SessionLoad", {desc= "Load Session" }) + +-- t +keymap.set('n', "ta", "TestSuite -v -cover", {desc= "TestSuite" }) +keymap.set('n', "tt", "lua require('neotest').run.run() ", {desc= "TestNearest" }) +keymap.set('n', "tf", 'lua require("neotest").run.run(vim.fn.expand("%"))', {desc= "TestFile" }) +keymap.set('n', "tc", "GoCover", {desc="go coverage" }) +keymap.set('n', "tC", "GoCoverClear", {desc= "go coverage clear" }) +keymap.set('n', "tb", "lua require'dap'.toggle_breakpoint()", {desc= "set break point" }) +keymap.set('n', "tr", "lua require'dap'.continue()", {desc= "continue" }) +keymap.set('n', "zs", "TZBottom", {desc="toggle status line" }) +keymap.set('n', "zt", "TZTop", {desc= "toggle tab bar" }) +keymap.set('n', "zz", "TZAtaraxis", {desc= "toggle zen" }) + +-- ; keymap.set('n', ';', ':Dashboard', { noremap = true, silent = true }) --- Comments -keymap.set("n", "b/", ":CommentToggle", { noremap = true, silent = true }) -keymap.set("v", "b/", ":CommentToggle", { noremap = true, silent = true }) - --- close buffer -keymap.set("n", "c", ":BufferClose", { noremap = true, silent = true }) - -keymap.set('n', '-', ':RnvimrToggle', opts ) - +-- Ctrl +keymap.set('n', '', ":Telescope find_files", { noremap = true, silent = true }) -- better window movement keymap.set('n', '', 'h', { silent = true }) keymap.set('n', '', 'j', { silent = true }) keymap.set('n', '', 'k', { silent = true }) keymap.set('n', '', 'l', { silent = true }) - --- better edit -keymap.set('n', 'Y', 'y$', {}) - -- resize with arrows keymap.set('n', '', ':resize -2', { silent = true }) keymap.set('n', '', ':resize +2', { silent = true }) keymap.set('n', '', ':vertical resize -2', { silent = true }) keymap.set('n', '', ':vertical resize +2', { silent = true }) +keymap.set('n', '', ':call QuickFixToggle()', { noremap = true, silent = true }) + + +-- Other +-- better edit +keymap.set('n', 'Y', 'y$', {}) -- better indenting keymap.set('v', '<', '', '>gv', { noremap = true, silent = true }) - -- I hate escape keymap.set('i', 'jk', '', { noremap = true, silent = true }) keymap.set('i', 'kj', '', { noremap = true, silent = true }) keymap.set('i', 'jj', '', { noremap = true, silent = true }) - -- Tab switch buffer keymap.set('n', '', ':BufferNext', { noremap = true, silent = true }) keymap.set('n', '', ':BufferPrevious', { noremap = true, silent = true }) - -- Move selected line / block of text in visual mode keymap.set('x', 'K', ':move \'<-2gv-gv', { noremap = true, silent = true }) keymap.set('x', 'J', ':move \'>+1gv-gv', { noremap = true, silent = true }) -keymap.set('n', '', ':call QuickFixToggle()', { noremap = true, silent = true }) - --- keymap.set('n','',":Lspsaga diagnostic_jump_prev", opts ) --- keymap.set('n','',":Lspsaga diagnostic_jump_next", opts ) - - --- vim.cmd("nnoremap gd lua vim.lsp.buf.definition()") --- vim.cmd("nnoremap gD lua vim.lsp.buf.declaration()") --- vim.cmd("nnoremap gr lua vim.lsp.buf.references()") --- vim.cmd("nnoremap gi lua vim.lsp.buf.implementation()") --- vim.cmd("nnoremap ca :Lspsaga code_action") --- vim.cmd("nnoremap K :Lspsaga hover_doc") --- -- vim.cmd('nnoremap lua vim.lsp.buf.signature_help()') --- vim.cmd("nnoremap :Lspsaga diagnostic_jump_prev") --- -- scroll down hover doc or scroll in definition preview --- vim.cmd("nnoremap lua require('lspsaga.action').smart_scroll_with_saga(1)") --- -- scroll up hover doc --- vim.cmd("nnoremap lua require('lspsaga.action').smart_scroll_with_saga(-1)") --- vim.cmd('command! -nargs=0 LspVirtualTextToggle lua require("lsp/virtual_text").toggle()') - --- -- Better nav for omnicomplete --- vim.cmd('inoremap (\"\\\")') --- vim.cmd('inoremap (\"\\\")') - --- vim.cmd('vnoremap p "0p') --- vim.cmd('vnoremap P "0P') diff --git a/nvim/lua/config/options.lua b/nvim/lua/config/options.lua index 706aaa3..e81207d 100644 --- a/nvim/lua/config/options.lua +++ b/nvim/lua/config/options.lua @@ -1,46 +1,46 @@ vim.cmd('set iskeyword+=-') -- treat dash separated words as a word text object" vim.cmd('set shortmess+=c') -- Don't pass messages to |ins-completion-menu|. vim.cmd('set inccommand=split') -- Make substitution work in realtime -vim.o.hidden = true -- Required to keep multiple buffers open multiple buffers -vim.o.title = true +vim.opt.hidden = true -- Required to keep multiple buffers open multiple buffers +vim.opt.title = true TERMINAL = vim.fn.expand('$TERMINAL') vim.cmd('let &titleold="'..TERMINAL..'"') -vim.o.titlestring="%<%F%=%l/%L - nvim" +vim.opt.titlestring="%<%F%=%l/%L - nvim" vim.wo.wrap = true -- Display long lines as just one line vim.cmd('set whichwrap+=<,>,[,],h,l') -- move to next line with theses keys vim.cmd('syntax on') -- syntax highlighting -vim.o.pumheight = 10 -- Makes popup menu smaller -vim.o.fileencoding = "utf-8" -- The encoding written to file -vim.o.cmdheight = 2 -- More space for displaying messages +vim.opt.pumheight = 10 -- Makes popup menu smaller +vim.opt.fileencoding = "utf-8" -- The encoding written to file +vim.opt.cmdheight = 2 -- More space for displaying messages vim.cmd('set colorcolumn=99999') -- fix indentline for now -vim.o.mouse = "a" -- Enable your mouse -vim.o.splitbelow = true -- Horizontal splits will automatically be below -vim.o.termguicolors = true -- set term gui colors most terminals support this -vim.o.splitright = true -- Vertical splits will automatically be to the right --- vim.o.t_Co = "256" -- Support 256 colors -vim.o.conceallevel = 0 -- So that I can see `` in markdown files +vim.opt.mouse = "a" -- Enable your mouse +vim.opt.splitbelow = true -- Horizontal splits will automatically be below +vim.opt.termguicolors = true -- set term gui colors most terminals support this +vim.opt.splitright = true -- Vertical splits will automatically be to the right +-- vim.opt.t_Co = "256" -- Support 256 colors +vim.opt.conceallevel = 0 -- So that I can see `` in markdown files vim.o.tabstop = 4 -vim.o.shiftwidth = 4 -vim.o.expandtab = true +vim.opt.shiftwidth = 4 +vim.opt.expandtab = true vim.bo.smartindent = true -- Makes indenting smart vim.wo.number = true -- set numbered lines vim.wo.relativenumber = true -- set relative number vim.wo.cursorline = true -- Enable highlighting of the current line -vim.o.showtabline = 2 -- Always show tabs -vim.o.showmode = false -- We don't need to see things like -- INSERT -- anymore -vim.o.backup = false -- This is recommended by coc -vim.o.writebackup = false -- This is recommended by coc +vim.opt.showtabline = 2 -- Always show tabs +vim.opt.showmode = false -- We don't need to see things like -- INSERT -- anymore +vim.opt.backup = false -- This is recommended by coc +vim.opt.writebackup = false -- This is recommended by coc vim.wo.signcolumn = "yes" -- Always show the signcolumn, otherwise it would shift the text each time -vim.o.updatetime = 300 -- Faster completion -vim.o.timeoutlen = 100 -- By default timeoutlen is 1000 ms -vim.o.clipboard = "unnamedplus" -- Copy paste between vim and everything else +vim.opt.updatetime = 300 -- Faster completion +vim.opt.timeoutlen = 100 -- By default timeoutlen is 1000 ms +vim.opt.clipboard = "unnamedplus" -- Copy paste between vim and everything else vim.cmd('filetype plugin on') -- filetype detection --- vim.o.guifont = "JetBrainsMono\\ Nerd\\ Font\\ Mono:h18" --- vim.o.guifont = "Hack\\ Nerd\\ Font\\ Mono" --- vim.o.guifont = "SauceCodePro Nerd Font:h17" -vim.o.guifont = "FiraCode Nerd Font:h17" +-- vim.opt.guifont = "JetBrainsMono\\ Nerd\\ Font\\ Mono:h18" +-- vim.opt.guifont = "Hack\\ Nerd\\ Font\\ Mono" +-- vim.opt.guifont = "SauceCodePro Nerd Font:h17" +vim.opt.guifont = "FiraCode Nerd Font:h17" --- vim.o.guifont = "JetBrains\\ Mono\\ Regular\\ Nerd\\ Font\\ Complete" +-- vim.opt.guifont = "JetBrains\\ Mono\\ Regular\\ Nerd\\ Font\\ Complete" vim.g.vim_markdown_folding_disabled = 1 vim.g.vimspector_enable_mappings = 'HUMAN' @@ -58,5 +58,5 @@ autocmd BufReadPost * if line("'\"") >= 1 && line("'\"") <= line("$") | exe "no -- vim.cmd('let g:nvcode_termcolors=256') -- --local cc = 'gruvbox' -- local cc = 'lunar' --- vim.o.background="dark" +-- vim.opt.background="dark" -- vim.cmd('colorscheme ' .. cc) \ No newline at end of file diff --git a/nvim/lua/plugins/gitsigns.lua b/nvim/lua/plugins/gitsigns.lua index 6bf5066..f8fb6a9 100644 --- a/nvim/lua/plugins/gitsigns.lua +++ b/nvim/lua/plugins/gitsigns.lua @@ -18,6 +18,27 @@ return { sign_priority = 6, update_debounce = 200, status_formatter = nil, -- Use default + 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", "gj", gs.next_hunk, "Next Hunk") + map("n", "gh", gs.prev_hunk, "Prev Hunk") + map({ "n", "v" }, "ghs", ":Gitsigns stage_hunk", "Stage Hunk") + map({ "n", "v" }, "ghr", ":Gitsigns reset_hunk", "Reset Hunk") + map("n", "ghS", gs.stage_buffer, "Stage Buffer") + map("n", "ghu", gs.undo_stage_hunk, "Undo Stage Hunk") + map("n", "ghR", gs.reset_buffer, "Reset Buffer") + map("n", "gp", gs.preview_hunk_inline, "Preview Hunk Inline") + map("n", "ghb", function() gs.blame_line({ full = true }) end, "Blame Line") + map("n", "ghd", gs.diffthis, "Diff This") + map("n", "ghD", function() gs.diffthis("~") end, "Diff This ~") + map({ "o", "x" }, "ih", ":Gitsigns select_hunk", "GitSigns Select Hunk") + end, } } } \ No newline at end of file diff --git a/nvim/lua/plugins/telescope.lua b/nvim/lua/plugins/telescope.lua index e7a7ee3..88ee5a1 100644 --- a/nvim/lua/plugins/telescope.lua +++ b/nvim/lua/plugins/telescope.lua @@ -18,15 +18,15 @@ return { end, desc = "Find Plugin File", }, - { - "sr", - function() - require("telescope.builtin").oldfiles({ - cwd = vim.loop.cwd() - }) - end, - desc = "Find Recent File", - }, + -- { + -- "sr", + -- function() + -- require("telescope.builtin").oldfiles({ + -- cwd = vim.loop.cwd() + -- }) + -- end, + -- desc = "Find Recent File", + -- }, { ";f", function() diff --git a/nvim/settings.lua b/nvim/settings.lua deleted file mode 100644 index 4e645a9..0000000 --- a/nvim/settings.lua +++ /dev/null @@ -1,65 +0,0 @@ ---[[ -O is the global options object - -Formatters and linters should be -filled in as strings with either -a global executable or a path to -an executable -]] - --- general -O.auto_complete = true -O.auto_close_tree = 0 -O.wrap_lines = false -O.timeoutlen = 100 -O.document_highlight = true -O.extras = true - --- dashboard --- O.dashboard.custom_header = {""} --- O.dashboard.footer = {""} - - - -O.clang.diagnostics.virtual_text = false -O.clang.diagnostics.signs = false -O.clang.diagnostics.underline = false - --- python --- add things like O.python.formatter.yapf.exec_path --- add things like O.python.linter.flake8.exec_path --- add things like O.python.formatter.isort.exec_path -O.python.formatter = 'yapf' --- O.python.linter = 'flake8' -O.python.isort = true -O.python.autoformat = true -O.python.diagnostics.virtual_text = true -O.python.diagnostics.signs = true -O.python.diagnostics.underline = true -O.python.analysis.type_checking = "off" -O.python.analysis.auto_search_paths = true -O.python.analysis.use_library_code_types = true - --- lua --- TODO look into stylua -O.lua.formatter = 'lua-format' --- O.lua.formatter = 'lua-format' ---O.lua.autoformat = false - --- javascript -O.tsserver.formatter = 'prettier' -O.tsserver.linter = nil -O.tsserver.autoformat = true - --- json -O.json.autoformat = true - --- ruby -O.ruby.autoformat = true - --- go -O.go.autoformat = true --- create custom autocommand field (This would be easy with lua) - --- Turn off relative_numbers --- O.relative_number = false