fix: modify nvim config
This commit is contained in:
@@ -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"
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -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}
|
|
||||||
+1
-1
@@ -3,7 +3,7 @@ if vim.loader then
|
|||||||
end
|
end
|
||||||
|
|
||||||
_G.dd = function(...)
|
_G.dd = function(...)
|
||||||
require("util.debug").dump(...)
|
require("utils.debug").dump(...)
|
||||||
end
|
end
|
||||||
vim.print = _G.dd
|
vim.print = _G.dd
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -40,11 +40,11 @@
|
|||||||
"nui.nvim": { "branch": "main", "commit": "c3c7fd618dcb5a89e443a2e1033e7d11fdb0596b" },
|
"nui.nvim": { "branch": "main", "commit": "c3c7fd618dcb5a89e443a2e1033e7d11fdb0596b" },
|
||||||
"nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" },
|
"nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" },
|
||||||
"nvim-lint": { "branch": "master", "commit": "4dade85ff26e4bad40f895a6cc6762b7036237f4" },
|
"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-notify": { "branch": "master", "commit": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15" },
|
||||||
"nvim-spectre": { "branch": "master", "commit": "3712ff0cdf4f9f877d9ca708d835a877d9a0abaf" },
|
"nvim-spectre": { "branch": "master", "commit": "3712ff0cdf4f9f877d9ca708d835a877d9a0abaf" },
|
||||||
"nvim-tree.lua": { "branch": "master", "commit": "d52fdeb0a300ac42b9cfa65ae0600a299f8e8677" },
|
"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-context": { "branch": "master", "commit": "b8d1ffe58a88e0356da56b167373e89c4579ce15" },
|
||||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "95933e762e28f9d38b572d65e7e4da9d2f4d90cb" },
|
"nvim-treesitter-textobjects": { "branch": "master", "commit": "95933e762e28f9d38b572d65e7e4da9d2f4d90cb" },
|
||||||
"nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" },
|
"nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" },
|
||||||
|
|||||||
@@ -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"}}
|
|
||||||
@@ -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"}}
|
|
||||||
@@ -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"}}
|
|
||||||
@@ -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"}}
|
|
||||||
@@ -7,8 +7,10 @@ vim.api.nvim_create_autocmd("InsertLeave", {
|
|||||||
-- Disable the concealing in some file formats
|
-- Disable the concealing in some file formats
|
||||||
-- The default conceallevel is 3 in LazyVim
|
-- The default conceallevel is 3 in LazyVim
|
||||||
vim.api.nvim_create_autocmd("FileType", {
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
pattern = { "json", "jsonc", "markdown" },
|
pattern = {"*.js","*.tsx","*.ts", "*.json", "*.jsonc", "*.markdown","*.md" },
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.opt.conceallevel = 0
|
vim.opt.conceallevel = 0
|
||||||
|
vim.o.tabstop = 2
|
||||||
|
vim.o.shiftwidth = 2
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|||||||
+126
-239
@@ -1,273 +1,160 @@
|
|||||||
|
|
||||||
local opts = {
|
|
||||||
mode = "n", -- NORMAL mode
|
|
||||||
prefix = "<leader>",
|
|
||||||
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 = { "<cmd>@:<cr>", "execute last command again" }
|
|
||||||
},
|
|
||||||
b = {
|
|
||||||
name = "+Buffer",
|
|
||||||
q = { "<cmd>q<cr>", "quit" },
|
|
||||||
s = { "<cmd>w<cr>", "save" },
|
|
||||||
r = { "<cmd>e!<cr>", "reload" },
|
|
||||||
d = { "<cmd>BufferClose<cr>", "close buffer" },
|
|
||||||
z = { "<cmd>CommentToggle<CR>", "toggle comment" },
|
|
||||||
},
|
|
||||||
D = {
|
|
||||||
name = "+Diagnostics",
|
|
||||||
t = { "<cmd>TroubleToggle<cr>", "trouble" },
|
|
||||||
w = { "<cmd>TroubleToggle lsp_workspace_diagnostics<cr>", "workspace" },
|
|
||||||
d = { "<cmd>TroubleToggle lsp_document_diagnostics<cr>", "document" },
|
|
||||||
q = { "<cmd>TroubleToggle quickfix<cr>", "quickfix" },
|
|
||||||
l = { "<cmd>TroubleToggle loclist<cr>", "loclist" },
|
|
||||||
r = { "<cmd>TroubleToggle lsp_references<cr>", "references" },
|
|
||||||
},
|
|
||||||
d = {
|
|
||||||
name = "+Debug",
|
|
||||||
-- b = {"<cmd>DebugToggleBreakpoint<cr>", "Toggle Breakpoint"},
|
|
||||||
-- c = {"<cmd>DebugContinue<cr>", "Continue"},
|
|
||||||
-- i = {"<cmd>DebugStepInto<cr>", "Step Into"},
|
|
||||||
-- o = {"<cmd>DebugStepOver<cr>", "Step Over"},
|
|
||||||
-- r = {"<cmd>DebugToggleRepl<cr>", "Toggle Repl"},
|
|
||||||
-- s = {"<cmd>DebugStart<cr>", "Start"}
|
|
||||||
d = { "<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<cr>", "show diagnostics" },
|
|
||||||
|
|
||||||
c = { "<cmd>lua require'dap'.continue()<cr>", "continue" },
|
|
||||||
b = { ':lua require"dap".toggle_breakpoint()<CR>', "Toggle Breadpoint" },
|
|
||||||
j = { ':lua require"dap".step_over()<CR>', "step over" },
|
|
||||||
k = { ':lua require"dap".step_out()<CR>', "step out" },
|
|
||||||
l = { ':lua require"dap".step_into()<CR>', "step into" },
|
|
||||||
--<c-h>', ':lua require"dap".continue()<CR>')
|
|
||||||
u = { ':lua require"dap".up()<CR>', "up" },
|
|
||||||
-- d = {':lua require"dap".down()<CR>', "down"},
|
|
||||||
_ = { ':lua require"dap".disconnect();require"dap".stop();require"dap".run_last()<CR>', "disconnect" },
|
|
||||||
--r = {':lua require"dap".repl.open({}, "vsplit")<CR><C-w>l', "repl open"},
|
|
||||||
i = { ':lua require"dap.ui.variables".visual_hover()<CR>', "visual_hover" },
|
|
||||||
--? = {':lua require"dap.ui.variables".scopes()<CR>',"scopes"},
|
|
||||||
-- e = {':lua require"dap".set_exception_breakpoints({"all"})<CR>',"esception bp"},
|
|
||||||
-- a = {':lua require"debugHelper".attach()<CR>',"attach"},
|
|
||||||
-- A = {':lua require"debugHelper".attachToRemote()<CR>',"attach to remote"},
|
|
||||||
s = { ':lua local widgets=require"dap.ui.widgets";widgets.centered_float(widgets.scopes)<CR>', "centered_float" },
|
|
||||||
},
|
|
||||||
f = {
|
|
||||||
name = "+File",
|
|
||||||
m = { "<cmd>lua require'utils'.open_md()<cr>", "open a markdown file in vscode" },
|
|
||||||
s = { "<cmd>w<cr>", "save file" },
|
|
||||||
t = { "<cmd>NvimTreeToggle<cr>", "toggle nvim tree" },
|
|
||||||
r = { "<cmd>RnvimrToggle<cr>", "toggle rnvimr" },
|
|
||||||
y = { "<cmd>lua require'utils'.yank_filepath()<cr>", "copy the file path" },
|
|
||||||
d = { "<cmd>lua require'utils'.yank_file_dir()<cr>", "copy the file path" },
|
|
||||||
l = { "<cmd>NvimTreeFindFile<CR>", "find file" },
|
|
||||||
-- T = {"<cmd>let @+ = 'go test -v -run='+expand('<cword>')<cr>", "get current word in go test"},
|
|
||||||
},
|
|
||||||
g = {
|
|
||||||
name = "+Git",
|
|
||||||
m = {"<cmd>Gvdiff master:%<cr>", "Diff with master"},
|
|
||||||
j = { "<cmd>lua require 'gitsigns'.next_hunk()<cr>", "Next Hunk" },
|
|
||||||
k = { "<cmd>lua require 'gitsigns'.prev_hunk()<cr>", "Prev Hunk" },
|
|
||||||
l = { "<cmd>lua require 'gitsigns'.blame_line()<cr>", "Blame" },
|
|
||||||
p = { "<cmd>lua require 'gitsigns'.preview_hunk()<cr>", "Preview Hunk" },
|
|
||||||
r = { "<cmd>lua require 'gitsigns'.reset_hunk()<cr>", "Reset Hunk" },
|
|
||||||
R = { "<cmd>lua require 'gitsigns'.reset_buffer()<cr>", "Reset Buffer" },
|
|
||||||
s = { "<cmd>lua require 'gitsigns'.stage_hunk()<cr>", "Stage Hunk" },
|
|
||||||
S = { "<cmd>lua require 'gitsigns'.stage_buffer()<cr>", "Stage Buffer" },
|
|
||||||
u = {
|
|
||||||
"<cmd>lua require 'gitsigns'.undo_stage_hunk()<cr>",
|
|
||||||
"Undo Stage Hunk",
|
|
||||||
},
|
|
||||||
o = { "<cmd>Telescope git_status<cr>", "Open changed file" },
|
|
||||||
b = { "<cmd>Telescope git_branches<cr>", "Checkout branch" },
|
|
||||||
c = { "<cmd>Telescope git_commits<cr>", "Checkout commit" },
|
|
||||||
C = {
|
|
||||||
"<cmd>Telescope git_bcommits<cr>",
|
|
||||||
"Checkout commit(for current file)",
|
|
||||||
},
|
|
||||||
d = {
|
|
||||||
"<cmd>Gitsigns diffthis HEAD<cr>",
|
|
||||||
"Git Diff",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
l = {
|
|
||||||
name = "+Language",
|
|
||||||
a = { "<cmd>Lspsaga code_action<cr>", "Code Action" },
|
|
||||||
A = { "<cmd>Lspsaga range_code_action<cr>", "Selected Action" },
|
|
||||||
d = { "<cmd>Telescope lsp_document_diagnostics<cr>", "Document Diagnostics" },
|
|
||||||
D = { "<cmd>Telescope lsp_workspace_diagnostics<cr>", "Workspace Diagnostics" },
|
|
||||||
f = { "<cmd>LspFormatting<cr>", "Format" },
|
|
||||||
F = { "<cmd>Lspsaga lsp_finder<cr>", "LSP Finder" },
|
|
||||||
-- i = {"<cmd>Telescope lsp_implementations<cr>", "implement"},
|
|
||||||
i = { "<cmd>lua vim.lsp.buf.implementation()<cr>", "implement" },
|
|
||||||
l = { "<cmd>lua vim.lsp.buf.hover()<cr>", "hover" },
|
|
||||||
L = { "<cmd>Lspsaga show_line_diagnostics<cr>", "Line Diagnostics" },
|
|
||||||
k = { "<cmd>: LspRestart<cr>", "restart lsp server" },
|
|
||||||
n = { "<cmd>lua vim.lsp.diagnostic.goto_next()<cr>", "next diagnostic" },
|
|
||||||
o = { "<cmd>: SymbolsOutline<cr>", "symbols outline" },
|
|
||||||
p = { "<cmd>lua vim.lsp.diagnostic.goto_prev()<cr>", "prev diagnostic" },
|
|
||||||
P = { "<cmd>Lspsaga preview_definition<cr>", "Preview Definition" },
|
|
||||||
q = { "<cmd>Telescope quickfix<cr>", "Quickfix" },
|
|
||||||
r = { "<cmd>lua vim.lsp.buf.references()<cr>", "references" },
|
|
||||||
R = { "<cmd>Lspsaga rename<cr>", "Rename" },
|
|
||||||
t = { "<cmd>LspTypeDefinition<cr>", "Type Definition" },
|
|
||||||
x = { "<cmd>cclose<cr>", "Close Quickfix" },
|
|
||||||
s = { "<cmd>Telescope lsp_document_symbols<cr>", "Document Symbols" },
|
|
||||||
S = { "<cmd>Telescope lsp_dynamic_workspace_symbols<cr>", "Workspace Symbols" },
|
|
||||||
z = { "<cmd>LspInfo<cr>", "Info" },
|
|
||||||
[","] = { "<cmd>LspInstallInfo<cr>", "LSP servers" }
|
|
||||||
},
|
|
||||||
p = {
|
|
||||||
name = "Packer",
|
|
||||||
c = { "<cmd>PackerCompile<cr>", "Compile" },
|
|
||||||
i = { "<cmd>PackerInstall<cr>", "Install" },
|
|
||||||
s = { "<cmd>PackerSync<cr>", "Sync" },
|
|
||||||
S = { "<cmd>PackerStatus<cr>", "Status" },
|
|
||||||
u = { "<cmd>PackerUpdate<cr>", "Update" },
|
|
||||||
},
|
|
||||||
q = {
|
|
||||||
name = "quit",
|
|
||||||
q = { "<cmd>qall<cr>", "quit" },
|
|
||||||
},
|
|
||||||
s = {
|
|
||||||
name = "+Search",
|
|
||||||
b = { "<cmd>Telescope git_branches<cr>", "Checkout branch" },
|
|
||||||
-- c = {"<cmd>Telescope colorscheme<cr>", "Colorscheme"},
|
|
||||||
c = { "<cmd>:nohl<cr>", "no highlight" },
|
|
||||||
d = { "<cmd>Telescope lsp_document_diagnostics<cr>", "Document Diagnostics" },
|
|
||||||
D = { "<cmd>Telescope lsp_workspace_diagnostics<cr>", "Workspace Diagnostics" },
|
|
||||||
f = { "<cmd>Telescope find_files<CR><cr>", "Find File" },
|
|
||||||
m = { "<cmd>Telescope marks<cr>", "Marks" },
|
|
||||||
M = { "<cmd>Telescope man_pages<cr>", "Man Pages" },
|
|
||||||
-- r = { "<cmd>Telescope oldfiles <cr>", "Open Recent File" },
|
|
||||||
R = { "<cmd>Telescope registers<cr>", "Registers" },
|
|
||||||
t = { "<cmd>Telescope live_grep<cr>", "Text" },
|
|
||||||
T = { "<cmd>Telescope live_grep<cr>", "Text" },
|
|
||||||
["#"] = { "<cmd>FzfLua grep_cword<cr>", "Search word under cursor" },
|
|
||||||
},
|
|
||||||
S = {
|
|
||||||
name = "+Session",
|
|
||||||
s = { "<cmd>SessionSave<cr>", "Save Session" },
|
|
||||||
l = { "<cmd>SessionLoad<cr>", "Load Session" },
|
|
||||||
},
|
|
||||||
t = {
|
|
||||||
name = "+Test",
|
|
||||||
a = { "<cmd>TestSuite -v -cover<cr>", "TestSuite" },
|
|
||||||
t = { "<cmd>lua require('neotest').run.run() <cr>", "TestNearest" },
|
|
||||||
f = { '<cmd>lua require("neotest").run.run(vim.fn.expand("%"))<cr>', "TestFile" },
|
|
||||||
c = { "<cmd>GoCover<cr>", "go coverage" },
|
|
||||||
C = { "<cmd>GoCoverClear<cr>", "go coverage clear" },
|
|
||||||
b = { "<cmd>lua require'dap'.toggle_breakpoint()<cr>", "set break point" },
|
|
||||||
r = { "<cmd>lua require'dap'.continue()<cr>", "continue" },
|
|
||||||
},
|
|
||||||
|
|
||||||
-- extras
|
|
||||||
z = {
|
|
||||||
name = "+Zen",
|
|
||||||
s = { "<cmd>TZBottom<cr>", "toggle status line" },
|
|
||||||
t = { "<cmd>TZTop<cr>", "toggle tab bar" },
|
|
||||||
z = { "<cmd>TZAtaraxis<cr>", "toggle zen" },
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
local wk = require("which-key")
|
|
||||||
wk.register(mappings, opts)
|
|
||||||
|
|
||||||
|
|
||||||
local keymap = vim.keymap
|
local keymap = vim.keymap
|
||||||
local opts = { noremap = true, silent = true }
|
local opts = { noremap = true, silent = true }
|
||||||
|
|
||||||
-- no hl
|
-- <Leader>a
|
||||||
keymap.set('n', '<Leader>h', ':set hlsearch!<CR>', { noremap = true, silent = true })
|
keymap.set('n', "<Leader>aa", "<cmd>@:<cr>", {desc="execute last command again" })
|
||||||
|
|
||||||
-- explorer
|
-- <Leader>b for buffer
|
||||||
keymap.set('n', '<Leader>e', ':NvimTreeToggle<CR>', { noremap = true, silent = true })
|
keymap.set('n', "<Leader>bq", "<cmd>q<cr>", {desc="quit" })
|
||||||
|
keymap.set('n', "<Leader>bs", "<cmd>w<cr>", {desc="save" })
|
||||||
|
keymap.set('n', "<Leader>br", "<cmd>e!<cr>", {desc="reload" })
|
||||||
|
keymap.set('n', "<Leader>bd", "<cmd>BufferClose<cr>", {desc="close buffer" })
|
||||||
|
keymap.set({'n','v'}, "<Leader>b/", "<cmd>CommentToggle<CR>", {desc="toggle comment" })
|
||||||
|
|
||||||
-- telescope
|
-- <Leader>D
|
||||||
-- keymap.set('n', '<C-p>', ":lua require'telescope.builtin'.find_files()<CR>", {noremap = true, silent = true})
|
keymap.set('n', "<Leader>Dt", "<cmd>TroubleToggle<cr>", {desc="trouble" })
|
||||||
keymap.set('n', '<C-p>', ":Telescope find_files<CR>", { noremap = true, silent = true })
|
keymap.set('n', "<Leader>Dw", "<cmd>TroubleToggle lsp_workspace_diagnostics<cr>", {desc="workspace" })
|
||||||
|
keymap.set('n', "<Leader>Dd", "<cmd>TroubleToggle lsp_document_diagnostics<cr>", {desc= "document" })
|
||||||
|
keymap.set('n', "<Leader>Dq", "<cmd>TroubleToggle quickfix<cr>", {desc= "quickfix" })
|
||||||
|
keymap.set('n', "<Leader>Dl", "<cmd>TroubleToggle loclist<cr>", {desc= "loclist" })
|
||||||
|
keymap.set('n', "<Leader>Dr", "<cmd>TroubleToggle lsp_references<cr>", {desc= "references" })
|
||||||
|
|
||||||
-- dashboard
|
-- <Leader>d
|
||||||
|
keymap.set('n', "<Leader>dd", "<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<cr>", {desc= "show diagnostics" })
|
||||||
|
keymap.set('n', "<Leader>dc", "<cmd>lua require'dap'.continue()<cr>", {desc= "continue" })
|
||||||
|
keymap.set('n', "<Leader>db", ':lua require"dap".toggle_breakpoint()<CR>', {desc= "Toggle Breadpoint" })
|
||||||
|
keymap.set('n', "<Leader>dj", ':lua require"dap".step_over()<CR>', {desc= "step over" })
|
||||||
|
keymap.set('n', "<Leader>dk", ':lua require"dap".step_out()<CR>', {desc= "step out" })
|
||||||
|
keymap.set('n', "<Leader>dl", ':lua require"dap".step_into()<CR>', {desc= "step into" })
|
||||||
|
keymap.set('n', "<Leader>du", ':lua require"dap".up()<CR>', {desc= "up" })
|
||||||
|
keymap.set('n', "<Leader>d_", ':lua require"dap".disconnect();require"dap".stop();require"dap".run_last()<CR>', {desc= "disconnect" })
|
||||||
|
keymap.set('n', "<Leader>di", ':lua require"dap.ui.variables".visual_hover()<CR>', {desc= "visual_hover" })
|
||||||
|
keymap.set('n', "<Leader>ds", ':lua local widgets=require"dap.ui.widgets";widgets.centered_float(widgets.scopes)<CR>', {desc= "centered_float" })
|
||||||
|
|
||||||
|
|
||||||
|
-- <Leader>f
|
||||||
|
keymap.set('n', "<Leader>fm", "<cmd>lua require'utils'.open_md()<cr>", {desc= "open a markdown file in vscode" })
|
||||||
|
keymap.set('n', "<Leader>fs", "<cmd>w<cr>", {desc= "save file" })
|
||||||
|
keymap.set('n', "<Leader>ft", "<cmd>NvimTreeToggle<cr>", {desc= "toggle nvim tree" })
|
||||||
|
keymap.set('n', "<Leader>fr", "<cmd>RnvimrToggle<cr>", {desc= "toggle rnvimr" })
|
||||||
|
keymap.set('n', "<Leader>fy", "<cmd>lua require'utils'.yank_filepath()<cr>", {desc= "copy the file path" })
|
||||||
|
keymap.set('n', "<Leader>fd", "<cmd>lua require'utils'.yank_file_dir()<cr>", {desc= "copy the file path" })
|
||||||
|
keymap.set('n', "<Leader>fl", "<cmd>NvimTreeFindFile<CR>", {desc= "find file" })
|
||||||
|
|
||||||
|
|
||||||
|
-- <Leader>g
|
||||||
|
keymap.set('n', "<Leader>gj", "<cmd>lua require 'gitsigns'.next_hunk()<cr>", {desc= "Next Hunk" })
|
||||||
|
keymap.set('n', "<Leader>gk", "<cmd>lua require 'gitsigns'.prev_hunk()<cr>", {desc= "Prev Hunk" })
|
||||||
|
keymap.set('n', "<Leader>gl", "<cmd>lua require 'gitsigns'.blame_line()<cr>", {desc= "Blame" })
|
||||||
|
keymap.set('n', "<Leader>gp", "<cmd>lua require 'gitsigns'.preview_hunk()<cr>", {desc= "Preview Hunk" })
|
||||||
|
keymap.set('n', "<Leader>gr", "<cmd>lua require 'gitsigns'.reset_hunk()<cr>", {desc= "Reset Hunk" })
|
||||||
|
keymap.set('n', "<Leader>gR", "<cmd>lua require 'gitsigns'.reset_buffer()<cr>", {desc= "Reset Buffer" })
|
||||||
|
keymap.set('n', "<Leader>gs", "<cmd>lua require 'gitsigns'.stage_hunk()<cr>", {desc= "Stage Hunk" })
|
||||||
|
keymap.set('n', "<Leader>gS", "<cmd>lua require 'gitsigns'.stage_buffer()<cr>", {desc= "Stage Buffer" })
|
||||||
|
keymap.set('n', "<Leader>gu", "<cmd>lua require 'gitsigns'.undo_stage_hunk()<cr>", {desc= "Undo Stage Hunk", })
|
||||||
|
keymap.set('n', "<Leader>go", "<cmd>Telescope git_status<cr>", {desc= "Open changed file" })
|
||||||
|
keymap.set('n', "<Leader>gb", "<cmd>Telescope git_branches<cr>", {desc= "Checkout branch" })
|
||||||
|
keymap.set('n', "<Leader>gc", "<cmd>Telescope git_commits<cr>", {desc= "Checkout commit" })
|
||||||
|
keymap.set('n', "<Leader>gC", "<cmd>Telescope git_bcommits<cr>", {desc= "Checkout commit(for current file)", })
|
||||||
|
keymap.set('n', "<Leader>gd", "<cmd>Gitsigns diffthis HEAD<cr>", {desc= "Git Diff", })
|
||||||
|
|
||||||
|
-- <Leader>h
|
||||||
|
keymap.set('n', '<Leader>h', ':set hlsearch!<CR>', { noremap = true, silent = true }) -- no hl
|
||||||
|
|
||||||
|
-- <Leader>l for lsp
|
||||||
|
keymap.set('n', '<Leader>l', "", {desc="+Language"})
|
||||||
|
keymap.set('n', '<Leader>la', "<cmd>Lspsaga code_action<cr>", {desc="Code Action" })
|
||||||
|
keymap.set('n', '<Leader>lA', "<cmd>Lspsaga range_code_action<cr>", {desc="Selected Action" })
|
||||||
|
keymap.set('n', '<Leader>ld', "<cmd>Telescope lsp_document_diagnostics<cr>", {desc="Document Diagnostics" })
|
||||||
|
keymap.set('n', '<Leader>lD', "<cmd>Telescope lsp_workspace_diagnostics<cr>", {desc="Workspace Diagnostics" })
|
||||||
|
keymap.set('n', '<Leader>lf', "<cmd>LspFormatting<cr>", {desc="Format" })
|
||||||
|
keymap.set('n', '<Leader>lF', "<cmd>Lspsaga lsp_finder<cr>", {desc="LSP Finder" })
|
||||||
|
keymap.set('n', '<Leader>li', "<cmd>lua vim.lsp.buf.implementation()<cr>", {desc="implement" })
|
||||||
|
keymap.set('n', '<Leader>ll', "<cmd>lua vim.lsp.buf.hover()<cr>", {desc="hover" })
|
||||||
|
keymap.set('n', '<Leader>lL', "<cmd>Lspsaga show_line_diagnostics<cr>", {desc="Line Diagnostics" })
|
||||||
|
keymap.set('n', '<Leader>lk', "<cmd>: LspRestart<cr>", {desc="restart lsp server" })
|
||||||
|
keymap.set('n', '<Leader>ln', "<cmd>lua vim.lsp.diagnostic.goto_next()<cr>", {desc="next diagnostic" })
|
||||||
|
keymap.set('n', '<Leader>lo', "<cmd>: SymbolsOutline<cr>", {desc="symbols outline" })
|
||||||
|
keymap.set('n', '<Leader>lp', "<cmd>lua vim.lsp.diagnostic.goto_prev()<cr>", {desc="prev diagnostic" })
|
||||||
|
keymap.set('n', '<Leader>lP', "<cmd>Lspsaga preview_definition<cr>", {desc="Preview Definition" })
|
||||||
|
keymap.set('n', '<Leader>lq', "<cmd>Telescope quickfix<cr>", {desc="Quickfix" })
|
||||||
|
keymap.set('n', '<Leader>lr', "<cmd>lua vim.lsp.buf.references()<cr>", {desc="references" })
|
||||||
|
keymap.set('n', '<Leader>lR', "<cmd>Lspsaga rename<cr>", {desc="Rename" })
|
||||||
|
keymap.set('n', '<Leader>lt', "<cmd>LspTypeDefinition<cr>", {desc="Type Definition" })
|
||||||
|
keymap.set('n', '<Leader>lx', "<cmd>cclose<cr>", {desc="Close Quickfix" })
|
||||||
|
keymap.set('n', '<Leader>ls', "<cmd>Telescope lsp_document_symbols<cr>", {desc="Document Symbols" })
|
||||||
|
keymap.set('n', '<Leader>lS', "<cmd>Telescope lsp_dynamic_workspace_symbols<cr>", {desc="Workspace Symbols" })
|
||||||
|
keymap.set('n', '<Leader>lz', "<cmd>LspInfo<cr>", {desc="Info" })
|
||||||
|
keymap.set('n', '<Leader>l,', "<cmd>LspInstallInfo<cr>", {desc="LSP servers" })
|
||||||
|
|
||||||
|
-- <Leader>q
|
||||||
|
keymap.set('n', "<Leader>qq", "<cmd>qall<cr>", {desc= "quit" })
|
||||||
|
|
||||||
|
|
||||||
|
-- <Leader>s
|
||||||
|
keymap.set('n', "<Leader>sb", "<cmd>Telescope git_branches<cr>", {desc= "Checkout branch" })
|
||||||
|
keymap.set('n', "<Leader>sc", "<cmd>:nohl<cr>", {desc= "no highlight" })
|
||||||
|
keymap.set('n', "<Leader>sd", "<cmd>Telescope lsp_document_diagnostics<cr>", {desc= "Document Diagnostics" })
|
||||||
|
keymap.set('n', "<Leader>sD", "<cmd>Telescope lsp_workspace_diagnostics<cr>", {desc= "Workspace Diagnostics" })
|
||||||
|
keymap.set('n', "<Leader>sf", "<cmd>Telescope find_files<CR><cr>", {desc= "Find File" })
|
||||||
|
keymap.set('n', "<Leader>sr", function() require("telescope.builtin").oldfiles({ cwd = vim.loop.cwd() }) end, {desc= "Old File" })
|
||||||
|
keymap.set('n', "<Leader>sm", "<cmd>Telescope marks<cr>", {desc= "Marks" })
|
||||||
|
keymap.set('n', "<Leader>sM", "<cmd>Telescope man_pages<cr>", {desc= "Man Pages" })
|
||||||
|
keymap.set('n', "<Leader>sR", "<cmd>Telescope registers<cr>", {desc= "Registers" })
|
||||||
|
keymap.set('n', "<Leader>st", "<cmd>Telescope live_grep<cr>", {desc= "Text" })
|
||||||
|
keymap.set('n', "<Leader>sT", "<cmd>Telescope live_grep<cr>", {desc= "Text" })
|
||||||
|
keymap.set('n', "<Leader>s,", "<cmd>FzfLua grep_cword<cr>", {desc= "Search word under cursor" })
|
||||||
|
|
||||||
|
-- <Leader>S
|
||||||
|
keymap.set('n', "<Leader>Ss", "<cmd>SessionSave<cr>", {desc= "Save Session" })
|
||||||
|
keymap.set('n', "<Leader>Sl", "<cmd>SessionLoad<cr>", {desc= "Load Session" })
|
||||||
|
|
||||||
|
-- <Leader>t
|
||||||
|
keymap.set('n', "<Leader>ta", "<cmd>TestSuite -v -cover<cr>", {desc= "TestSuite" })
|
||||||
|
keymap.set('n', "<Leader>tt", "<cmd>lua require('neotest').run.run() <cr>", {desc= "TestNearest" })
|
||||||
|
keymap.set('n', "<Leader>tf", '<cmd>lua require("neotest").run.run(vim.fn.expand("%"))<cr>', {desc= "TestFile" })
|
||||||
|
keymap.set('n', "<Leader>tc", "<cmd>GoCover<cr>", {desc="go coverage" })
|
||||||
|
keymap.set('n', "<Leader>tC", "<cmd>GoCoverClear<cr>", {desc= "go coverage clear" })
|
||||||
|
keymap.set('n', "<Leader>tb", "<cmd>lua require'dap'.toggle_breakpoint()<cr>", {desc= "set break point" })
|
||||||
|
keymap.set('n', "<Leader>tr", "<cmd>lua require'dap'.continue()<cr>", {desc= "continue" })
|
||||||
|
keymap.set('n', "<Leader>zs", "<cmd>TZBottom<cr>", {desc="toggle status line" })
|
||||||
|
keymap.set('n', "<Leader>zt", "<cmd>TZTop<cr>", {desc= "toggle tab bar" })
|
||||||
|
keymap.set('n', "<Leader>zz", "<cmd>TZAtaraxis<cr>", {desc= "toggle zen" })
|
||||||
|
|
||||||
|
-- <Leader>;
|
||||||
keymap.set('n', '<Leader>;', ':Dashboard<CR>', { noremap = true, silent = true })
|
keymap.set('n', '<Leader>;', ':Dashboard<CR>', { noremap = true, silent = true })
|
||||||
|
|
||||||
-- Comments
|
-- Ctrl
|
||||||
keymap.set("n", "<Leader>b/", ":CommentToggle<CR>", { noremap = true, silent = true })
|
keymap.set('n', '<C-p>', ":Telescope find_files<CR>", { noremap = true, silent = true })
|
||||||
keymap.set("v", "<Leader>b/", ":CommentToggle<CR>", { noremap = true, silent = true })
|
|
||||||
|
|
||||||
-- close buffer
|
|
||||||
keymap.set("n", "<leader>c", ":BufferClose<CR>", { noremap = true, silent = true })
|
|
||||||
|
|
||||||
keymap.set('n', '-', ':RnvimrToggle<CR>', opts )
|
|
||||||
|
|
||||||
-- better window movement
|
-- better window movement
|
||||||
keymap.set('n', '<C-h>', '<C-w>h', { silent = true })
|
keymap.set('n', '<C-h>', '<C-w>h', { silent = true })
|
||||||
keymap.set('n', '<C-j>', '<C-w>j', { silent = true })
|
keymap.set('n', '<C-j>', '<C-w>j', { silent = true })
|
||||||
keymap.set('n', '<C-k>', '<C-w>k', { silent = true })
|
keymap.set('n', '<C-k>', '<C-w>k', { silent = true })
|
||||||
keymap.set('n', '<C-l>', '<C-w>l', { silent = true })
|
keymap.set('n', '<C-l>', '<C-w>l', { silent = true })
|
||||||
|
|
||||||
-- better edit
|
|
||||||
keymap.set('n', 'Y', 'y$', {})
|
|
||||||
|
|
||||||
-- resize with arrows
|
-- resize with arrows
|
||||||
keymap.set('n', '<C-Up>', ':resize -2<CR>', { silent = true })
|
keymap.set('n', '<C-Up>', ':resize -2<CR>', { silent = true })
|
||||||
keymap.set('n', '<C-Down>', ':resize +2<CR>', { silent = true })
|
keymap.set('n', '<C-Down>', ':resize +2<CR>', { silent = true })
|
||||||
keymap.set('n', '<C-Left>', ':vertical resize -2<CR>', { silent = true })
|
keymap.set('n', '<C-Left>', ':vertical resize -2<CR>', { silent = true })
|
||||||
keymap.set('n', '<C-Right>', ':vertical resize +2<CR>', { silent = true })
|
keymap.set('n', '<C-Right>', ':vertical resize +2<CR>', { silent = true })
|
||||||
|
|
||||||
|
keymap.set('n', '<C-q>', ':call QuickFixToggle()<CR>', { noremap = true, silent = true })
|
||||||
|
|
||||||
|
|
||||||
|
-- Other
|
||||||
|
-- better edit
|
||||||
|
keymap.set('n', 'Y', 'y$', {})
|
||||||
-- better indenting
|
-- better indenting
|
||||||
keymap.set('v', '<', '<gv', { noremap = true, silent = true })
|
keymap.set('v', '<', '<gv', { noremap = true, silent = true })
|
||||||
keymap.set('v', '>', '>gv', { noremap = true, silent = true })
|
keymap.set('v', '>', '>gv', { noremap = true, silent = true })
|
||||||
|
|
||||||
-- I hate escape
|
-- I hate escape
|
||||||
keymap.set('i', 'jk', '<ESC>', { noremap = true, silent = true })
|
keymap.set('i', 'jk', '<ESC>', { noremap = true, silent = true })
|
||||||
keymap.set('i', 'kj', '<ESC>', { noremap = true, silent = true })
|
keymap.set('i', 'kj', '<ESC>', { noremap = true, silent = true })
|
||||||
keymap.set('i', 'jj', '<ESC>', { noremap = true, silent = true })
|
keymap.set('i', 'jj', '<ESC>', { noremap = true, silent = true })
|
||||||
|
|
||||||
-- Tab switch buffer
|
-- Tab switch buffer
|
||||||
keymap.set('n', '<TAB>', ':BufferNext<CR>', { noremap = true, silent = true })
|
keymap.set('n', '<TAB>', ':BufferNext<CR>', { noremap = true, silent = true })
|
||||||
keymap.set('n', '<S-TAB>', ':BufferPrevious<CR>', { noremap = true, silent = true })
|
keymap.set('n', '<S-TAB>', ':BufferPrevious<CR>', { noremap = true, silent = true })
|
||||||
|
|
||||||
-- Move selected line / block of text in visual mode
|
-- Move selected line / block of text in visual mode
|
||||||
keymap.set('x', 'K', ':move \'<-2<CR>gv-gv', { noremap = true, silent = true })
|
keymap.set('x', 'K', ':move \'<-2<CR>gv-gv', { noremap = true, silent = true })
|
||||||
keymap.set('x', 'J', ':move \'>+1<CR>gv-gv', { noremap = true, silent = true })
|
keymap.set('x', 'J', ':move \'>+1<CR>gv-gv', { noremap = true, silent = true })
|
||||||
|
|
||||||
keymap.set('n', '<C-q>', ':call QuickFixToggle()<CR>', { noremap = true, silent = true })
|
|
||||||
|
|
||||||
-- keymap.set('n','<C-m>',":Lspsaga diagnostic_jump_prev<CR>", opts )
|
|
||||||
-- keymap.set('n','<C-n>',":Lspsaga diagnostic_jump_next<CR>", opts )
|
|
||||||
|
|
||||||
|
|
||||||
-- vim.cmd("nnoremap gd <cmd>lua vim.lsp.buf.definition()<CR>")
|
|
||||||
-- vim.cmd("nnoremap <silent> gD <cmd>lua vim.lsp.buf.declaration()<CR>")
|
|
||||||
-- vim.cmd("nnoremap <silent> gr <cmd>lua vim.lsp.buf.references()<CR>")
|
|
||||||
-- vim.cmd("nnoremap <silent> gi <cmd>lua vim.lsp.buf.implementation()<CR>")
|
|
||||||
-- vim.cmd("nnoremap <silent> ca :Lspsaga code_action<CR>")
|
|
||||||
-- vim.cmd("nnoremap <silent> K :Lspsaga hover_doc<CR>")
|
|
||||||
-- -- vim.cmd('nnoremap <silent> <C-k> <cmd>lua vim.lsp.buf.signature_help()<CR>')
|
|
||||||
-- vim.cmd("nnoremap <silent> <C-m> :Lspsaga diagnostic_jump_prev<CR>")
|
|
||||||
-- -- scroll down hover doc or scroll in definition preview
|
|
||||||
-- vim.cmd("nnoremap <silent> <C-f> <cmd>lua require('lspsaga.action').smart_scroll_with_saga(1)<CR>")
|
|
||||||
-- -- scroll up hover doc
|
|
||||||
-- vim.cmd("nnoremap <silent> <C-b> <cmd>lua require('lspsaga.action').smart_scroll_with_saga(-1)<CR>")
|
|
||||||
-- vim.cmd('command! -nargs=0 LspVirtualTextToggle lua require("lsp/virtual_text").toggle()')
|
|
||||||
|
|
||||||
-- -- Better nav for omnicomplete
|
|
||||||
-- vim.cmd('inoremap <expr> <c-j> (\"\\<C-n>\")')
|
|
||||||
-- vim.cmd('inoremap <expr> <c-k> (\"\\<C-p>\")')
|
|
||||||
|
|
||||||
-- vim.cmd('vnoremap p "0p')
|
|
||||||
-- vim.cmd('vnoremap P "0P')
|
|
||||||
|
|||||||
+27
-27
@@ -1,46 +1,46 @@
|
|||||||
vim.cmd('set iskeyword+=-') -- treat dash separated words as a word text object"
|
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 shortmess+=c') -- Don't pass messages to |ins-completion-menu|.
|
||||||
vim.cmd('set inccommand=split') -- Make substitution work in realtime
|
vim.cmd('set inccommand=split') -- Make substitution work in realtime
|
||||||
vim.o.hidden = true -- Required to keep multiple buffers open multiple buffers
|
vim.opt.hidden = true -- Required to keep multiple buffers open multiple buffers
|
||||||
vim.o.title = true
|
vim.opt.title = true
|
||||||
TERMINAL = vim.fn.expand('$TERMINAL')
|
TERMINAL = vim.fn.expand('$TERMINAL')
|
||||||
vim.cmd('let &titleold="'..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.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('set whichwrap+=<,>,[,],h,l') -- move to next line with theses keys
|
||||||
vim.cmd('syntax on') -- syntax highlighting
|
vim.cmd('syntax on') -- syntax highlighting
|
||||||
vim.o.pumheight = 10 -- Makes popup menu smaller
|
vim.opt.pumheight = 10 -- Makes popup menu smaller
|
||||||
vim.o.fileencoding = "utf-8" -- The encoding written to file
|
vim.opt.fileencoding = "utf-8" -- The encoding written to file
|
||||||
vim.o.cmdheight = 2 -- More space for displaying messages
|
vim.opt.cmdheight = 2 -- More space for displaying messages
|
||||||
vim.cmd('set colorcolumn=99999') -- fix indentline for now
|
vim.cmd('set colorcolumn=99999') -- fix indentline for now
|
||||||
vim.o.mouse = "a" -- Enable your mouse
|
vim.opt.mouse = "a" -- Enable your mouse
|
||||||
vim.o.splitbelow = true -- Horizontal splits will automatically be below
|
vim.opt.splitbelow = true -- Horizontal splits will automatically be below
|
||||||
vim.o.termguicolors = true -- set term gui colors most terminals support this
|
vim.opt.termguicolors = true -- set term gui colors most terminals support this
|
||||||
vim.o.splitright = true -- Vertical splits will automatically be to the right
|
vim.opt.splitright = true -- Vertical splits will automatically be to the right
|
||||||
-- vim.o.t_Co = "256" -- Support 256 colors
|
-- vim.opt.t_Co = "256" -- Support 256 colors
|
||||||
vim.o.conceallevel = 0 -- So that I can see `` in markdown files
|
vim.opt.conceallevel = 0 -- So that I can see `` in markdown files
|
||||||
vim.o.tabstop = 4
|
vim.o.tabstop = 4
|
||||||
vim.o.shiftwidth = 4
|
vim.opt.shiftwidth = 4
|
||||||
vim.o.expandtab = true
|
vim.opt.expandtab = true
|
||||||
vim.bo.smartindent = true -- Makes indenting smart
|
vim.bo.smartindent = true -- Makes indenting smart
|
||||||
vim.wo.number = true -- set numbered lines
|
vim.wo.number = true -- set numbered lines
|
||||||
vim.wo.relativenumber = true -- set relative number
|
vim.wo.relativenumber = true -- set relative number
|
||||||
vim.wo.cursorline = true -- Enable highlighting of the current line
|
vim.wo.cursorline = true -- Enable highlighting of the current line
|
||||||
vim.o.showtabline = 2 -- Always show tabs
|
vim.opt.showtabline = 2 -- Always show tabs
|
||||||
vim.o.showmode = false -- We don't need to see things like -- INSERT -- anymore
|
vim.opt.showmode = false -- We don't need to see things like -- INSERT -- anymore
|
||||||
vim.o.backup = false -- This is recommended by coc
|
vim.opt.backup = false -- This is recommended by coc
|
||||||
vim.o.writebackup = 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.wo.signcolumn = "yes" -- Always show the signcolumn, otherwise it would shift the text each time
|
||||||
vim.o.updatetime = 300 -- Faster completion
|
vim.opt.updatetime = 300 -- Faster completion
|
||||||
vim.o.timeoutlen = 100 -- By default timeoutlen is 1000 ms
|
vim.opt.timeoutlen = 100 -- By default timeoutlen is 1000 ms
|
||||||
vim.o.clipboard = "unnamedplus" -- Copy paste between vim and everything else
|
vim.opt.clipboard = "unnamedplus" -- Copy paste between vim and everything else
|
||||||
vim.cmd('filetype plugin on') -- filetype detection
|
vim.cmd('filetype plugin on') -- filetype detection
|
||||||
-- vim.o.guifont = "JetBrainsMono\\ Nerd\\ Font\\ Mono:h18"
|
-- vim.opt.guifont = "JetBrainsMono\\ Nerd\\ Font\\ Mono:h18"
|
||||||
-- vim.o.guifont = "Hack\\ Nerd\\ Font\\ Mono"
|
-- vim.opt.guifont = "Hack\\ Nerd\\ Font\\ Mono"
|
||||||
-- vim.o.guifont = "SauceCodePro Nerd Font:h17"
|
-- vim.opt.guifont = "SauceCodePro Nerd Font:h17"
|
||||||
vim.o.guifont = "FiraCode 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.vim_markdown_folding_disabled = 1
|
||||||
|
|
||||||
vim.g.vimspector_enable_mappings = 'HUMAN'
|
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')
|
-- vim.cmd('let g:nvcode_termcolors=256')
|
||||||
-- --local cc = 'gruvbox'
|
-- --local cc = 'gruvbox'
|
||||||
-- local cc = 'lunar'
|
-- local cc = 'lunar'
|
||||||
-- vim.o.background="dark"
|
-- vim.opt.background="dark"
|
||||||
-- vim.cmd('colorscheme ' .. cc)
|
-- vim.cmd('colorscheme ' .. cc)
|
||||||
@@ -18,6 +18,27 @@ return {
|
|||||||
sign_priority = 6,
|
sign_priority = 6,
|
||||||
update_debounce = 200,
|
update_debounce = 200,
|
||||||
status_formatter = nil, -- Use default
|
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", "<leader>gj", gs.next_hunk, "Next Hunk")
|
||||||
|
map("n", "<leader>gh", gs.prev_hunk, "Prev Hunk")
|
||||||
|
map({ "n", "v" }, "<leader>ghs", ":Gitsigns stage_hunk<CR>", "Stage Hunk")
|
||||||
|
map({ "n", "v" }, "<leader>ghr", ":Gitsigns reset_hunk<CR>", "Reset Hunk")
|
||||||
|
map("n", "<leader>ghS", gs.stage_buffer, "Stage Buffer")
|
||||||
|
map("n", "<leader>ghu", gs.undo_stage_hunk, "Undo Stage Hunk")
|
||||||
|
map("n", "<leader>ghR", gs.reset_buffer, "Reset Buffer")
|
||||||
|
map("n", "<leader>gp", gs.preview_hunk_inline, "Preview Hunk Inline")
|
||||||
|
map("n", "<leader>ghb", function() gs.blame_line({ full = true }) end, "Blame Line")
|
||||||
|
map("n", "<leader>ghd", gs.diffthis, "Diff This")
|
||||||
|
map("n", "<leader>ghD", function() gs.diffthis("~") end, "Diff This ~")
|
||||||
|
map({ "o", "x" }, "ih", ":<C-U>Gitsigns select_hunk<CR>", "GitSigns Select Hunk")
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -18,15 +18,15 @@ return {
|
|||||||
end,
|
end,
|
||||||
desc = "Find Plugin File",
|
desc = "Find Plugin File",
|
||||||
},
|
},
|
||||||
{
|
-- {
|
||||||
"<leader>sr",
|
-- "<leader>sr",
|
||||||
function()
|
-- function()
|
||||||
require("telescope.builtin").oldfiles({
|
-- require("telescope.builtin").oldfiles({
|
||||||
cwd = vim.loop.cwd()
|
-- cwd = vim.loop.cwd()
|
||||||
})
|
-- })
|
||||||
end,
|
-- end,
|
||||||
desc = "Find Recent File",
|
-- desc = "Find Recent File",
|
||||||
},
|
-- },
|
||||||
{
|
{
|
||||||
";f",
|
";f",
|
||||||
function()
|
function()
|
||||||
|
|||||||
@@ -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
|
|
||||||
Reference in New Issue
Block a user