Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f0186eaefb | |||
| 6283ab3cfb | |||
| 22b880e642 | |||
| 2a68d143a8 | |||
| 05053a87b7 | |||
| 27dff38b7c | |||
| cabec5bd63 |
+12
-2
@@ -1,3 +1,6 @@
|
||||
|
||||
fish_vi_key_bindings
|
||||
|
||||
## set environment
|
||||
|
||||
# brew
|
||||
@@ -13,10 +16,14 @@ set -gx GOSUMDB "sum.golang.google.cn"
|
||||
set -gx PATH $PATH $HOME/go/bin
|
||||
set -gx PATH $PATH $HOME/.yarn/bin $HOME/.config/yarn/global/node_modules/.bin
|
||||
set -gx PATH $PATH /usr/local/sbin
|
||||
|
||||
# add nvim
|
||||
set -gx PATH $PATH /usr/local/nvim/bin /usr/local/osx-64/nvim/bin
|
||||
set -gx EDITOR vim
|
||||
|
||||
# add my script
|
||||
set -gx PATH $PATH $HOME/.dotfile/script $HOME/.app00/script
|
||||
|
||||
# alias
|
||||
# git
|
||||
alias gitb="git branch --show-current | tr -d '\n' | pbcopy"
|
||||
@@ -26,11 +33,14 @@ alias gtc="go test -gcflags=all=-l -cover ./..."
|
||||
alias swg="swag init -o docs -g "
|
||||
alias sws="swagger serve -F=swagger"
|
||||
|
||||
|
||||
function gtr
|
||||
go test -gcflags=all=-l -v -run="$1"
|
||||
go test -gcflags=all=-l -v -run=$argv
|
||||
end
|
||||
|
||||
|
||||
if test -f ~/.config/fish/custom.fish
|
||||
source ~/.config/fish/custom.fish
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -2,6 +2,9 @@ if vim.loader then
|
||||
vim.loader.enable()
|
||||
end
|
||||
|
||||
vim.g.loaded_netrw = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
|
||||
_G.dd = function(...)
|
||||
require("utils.debug").dump(...)
|
||||
end
|
||||
|
||||
+55
-50
@@ -1,67 +1,72 @@
|
||||
{
|
||||
"FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" },
|
||||
"LazyVim": { "branch": "main", "commit": "fe72424e77cb9c953084bbcaaa0eb7fe8056dc70" },
|
||||
"LuaSnip": { "branch": "master", "commit": "f3b3d3446bcbfa62d638b1903ff00a78b2b730a1" },
|
||||
"SchemaStore.nvim": { "branch": "main", "commit": "9bc9a3a19dc6047d79d6073082f3b0deb7002c99" },
|
||||
"LazyVim": { "branch": "main", "commit": "530e94a9fa19577401e968a9673282c3d79f01e3" },
|
||||
"LuaSnip": { "branch": "master", "commit": "b152822e1a4bafb6bdf11a16cc26525cbd95ee00" },
|
||||
"SchemaStore.nvim": { "branch": "main", "commit": "8c46453bdf84ad91877effb95e0b6c7b51ea7dda" },
|
||||
"barbar.nvim": { "branch": "master", "commit": "dd852401ee902745b67fc09a83d113b3fe82a96f" },
|
||||
"bufferline.nvim": { "branch": "main", "commit": "b15c6daf5a64426c69732b31a951f4e438cb6590" },
|
||||
"catppuccin": { "branch": "main", "commit": "c0de3b46811fe1ce3912e2245a9dfbea6b41c300" },
|
||||
"bufferline.nvim": { "branch": "main", "commit": "73540cb95f8d95aa1af3ed57713c6720c78af915" },
|
||||
"catppuccin": { "branch": "main", "commit": "6af91673ceccbd6e073b66c439e7fce239f72d24" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||
"cmp-emoji": { "branch": "main", "commit": "19075c36d5820253d32e2478b6aaf3734aeaafa0" },
|
||||
"cmp-emoji": { "branch": "main", "commit": "e8398e2adf512a03bb4e1728ca017ffeac670a9f" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
|
||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
|
||||
"conform.nvim": { "branch": "master", "commit": "192a6d2ddace343f1840a8f72efe2315bd392243" },
|
||||
"dashboard-nvim": { "branch": "master", "commit": "413442b12d85315fc626c44a0ce4929b213ef604" },
|
||||
"dressing.nvim": { "branch": "master", "commit": "6f212262061a2120e42da0d1e87326e8a41c0478" },
|
||||
"flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "dcd4a586439a1c81357d5b9d26319ae218cc9479" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "2c2463dbd82eddd7dbab881c3a62cfbfbe3c67ae" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "821a7acd88587d966f7e464b0b3031dfe7f5680c" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "28126922c9b54e35a192ac415788f202c3944c9f" },
|
||||
"lsp_signature.nvim": { "branch": "master", "commit": "fed2c8389c148ff1dfdcdca63c2b48d08a50dea0" },
|
||||
"lspsaga.nvim": { "branch": "main", "commit": "b1b140aa20a0cf353cd3e282870429b48b30a169" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "7d131a8d3ba5016229e8a1d08bf8782acea98852" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "21d33d69a81f6351e5a5f49078b2e4f0075c8e73" },
|
||||
"mason.nvim": { "branch": "main", "commit": "3b5068f0fc565f337d67a2d315d935f574848ee7" },
|
||||
"mini.ai": { "branch": "main", "commit": "ee9446a17c160aba6a04ff22097389c41872c878" },
|
||||
"conform.nvim": { "branch": "master", "commit": "6dc1603ea408f476a57937bbeaf7f86520a21a98" },
|
||||
"dashboard-nvim": { "branch": "master", "commit": "a0a78099658c7d4be3714f657b18ca8285d5d106" },
|
||||
"dressing.nvim": { "branch": "master", "commit": "5162edb1442a729a885c45455a07e9a89058be2f" },
|
||||
"flash.nvim": { "branch": "main", "commit": "7bb4a9c75d1e20cd24185afedeaa11681829ba23" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "3e9a3f5a0cfcef1741e352c37bda4e82e5eb846a" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "805610a9393fa231f2c2b49cb521bfa413fadb3d" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "bef521ac89c8d423f9d092e37b58e8af0c099309" },
|
||||
"lsp_signature.nvim": { "branch": "master", "commit": "c6aeb2f1d2538bbdfdaab1664d9d4c3c75aa9db8" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "05744f0f1967b5757bd05c08df4271ab8ec990aa" },
|
||||
"mason-nvim-dap.nvim": { "branch": "main", "commit": "67210c0e775adec55de9826b038e8b62de554afc" },
|
||||
"mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" },
|
||||
"mini.ai": { "branch": "main", "commit": "55e9b7217f29e62f734e239bfeed5731a065d801" },
|
||||
"mini.bufremove": { "branch": "main", "commit": "931a3bb514147d9e812767275c4beba6b779b1d3" },
|
||||
"mini.comment": { "branch": "main", "commit": "a4b7e46deb9ad2feb8902cc5dbf087eced112ee5" },
|
||||
"mini.indentscope": { "branch": "main", "commit": "cf07f19e718ebb0bcc5b00999083ce11c37b8d40" },
|
||||
"mini.pairs": { "branch": "main", "commit": "04f58f2545ed80ac3b52dd4826e93f33e15b2af6" },
|
||||
"mini.surround": { "branch": "main", "commit": "a1b590cc3b676512de507328d6bbab5e43794720" },
|
||||
"neo-tree.nvim": { "branch": "v3.x", "commit": "f3941c57ec85d7bdb44fa53fd858fd80f159018f" },
|
||||
"neoconf.nvim": { "branch": "main", "commit": "98980b5300e7a5e7f93e8dbf81c98cc3daa55df7" },
|
||||
"neodev.nvim": { "branch": "main", "commit": "84e0290f5600e8b89c0dfcafc864f45496a53400" },
|
||||
"neotest": { "branch": "master", "commit": "4440cc2227894c2ae9b0673a30e6cc6f1836e8c2" },
|
||||
"neotest-go": { "branch": "main", "commit": "6a2f996d89fe4631942e035b1c114544ee045043" },
|
||||
"mini.comment": { "branch": "main", "commit": "f9f1a646fd3d9df7397aa1b9550a875fe8189eb0" },
|
||||
"mini.indentscope": { "branch": "main", "commit": "a8274b6ea2d868198d27bd91a31ed5ea3a6a5744" },
|
||||
"mini.pairs": { "branch": "main", "commit": "5c975d8f68dc1e11bf4b20ced71e7987ed782513" },
|
||||
"mini.surround": { "branch": "main", "commit": "0f528eb2e1bab420c0569d9e52615144c51db920" },
|
||||
"neo-tree.nvim": { "branch": "v3.x", "commit": "7aad1bf3f6b849cbf108e02c55ad4d701cb4d33a" },
|
||||
"neoconf.nvim": { "branch": "main", "commit": "d4a48c2a6fdeec138605cee4eb6f8c6fafd0b3ed" },
|
||||
"neodev.nvim": { "branch": "main", "commit": "ce9a2e8eaba5649b553529c5498acb43a6c317cd" },
|
||||
"neotest": { "branch": "master", "commit": "5caac5cc235d495a2382bc2980630ef36ac87032" },
|
||||
"neotest-go": { "branch": "main", "commit": "27c80deab9cf5cb30b20ee407b3a6c7285518128" },
|
||||
"neotest-plenary": { "branch": "master", "commit": "dcaf5ed67a9e28a246e9783319e5aa6c9ea1c584" },
|
||||
"noice.nvim": { "branch": "main", "commit": "bf67d70bd7265d075191e7812d8eb42b9791f737" },
|
||||
"nui.nvim": { "branch": "main", "commit": "c3c7fd618dcb5a89e443a2e1033e7d11fdb0596b" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" },
|
||||
"nvim-lint": { "branch": "master", "commit": "4dade85ff26e4bad40f895a6cc6762b7036237f4" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "9553725789be682ecd945a527ec552e489ea8534" },
|
||||
"noice.nvim": { "branch": "main", "commit": "f4decbc7a80229ccc9f86026b74bdcf0c39e38a7" },
|
||||
"nui.nvim": { "branch": "main", "commit": "a3597dc88b53489d3fddbddbbd13787355253bb0" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "cd2cf0c124d3de577fb5449746568ee8e601afc8" },
|
||||
"nvim-dap": { "branch": "master", "commit": "5a2f7121869394502521c52b2bc581ab22c69447" },
|
||||
"nvim-dap-go": { "branch": "main", "commit": "5faf165f5062187320eaf9d177c3c1f647adc22e" },
|
||||
"nvim-dap-ui": { "branch": "master", "commit": "334cf3038c4756e6ab999cbac67c847fb654c190" },
|
||||
"nvim-dap-virtual-text": { "branch": "master", "commit": "3e8e207513e6ef520894950acd76b79902714103" },
|
||||
"nvim-lint": { "branch": "master", "commit": "861a04313501563bb1b11f125ae9b7237a517b9b" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "a3d9395455f2b2e3b50a0b0f37b8b4c23683f44a" },
|
||||
"nvim-nio": { "branch": "master", "commit": "8765cbc4d0c629c8158a5341e1b4305fd93c3a90" },
|
||||
"nvim-notify": { "branch": "master", "commit": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15" },
|
||||
"nvim-spectre": { "branch": "master", "commit": "3712ff0cdf4f9f877d9ca708d835a877d9a0abaf" },
|
||||
"nvim-tree.lua": { "branch": "master", "commit": "d52fdeb0a300ac42b9cfa65ae0600a299f8e8677" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "4a8901b0d5398b45e075fcdbf9b8fe546349cc14" },
|
||||
"nvim-treesitter-context": { "branch": "master", "commit": "b8d1ffe58a88e0356da56b167373e89c4579ce15" },
|
||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "95933e762e28f9d38b572d65e7e4da9d2f4d90cb" },
|
||||
"nvim-spectre": { "branch": "master", "commit": "4651801ba37a9407b7257287aec45b6653ffc5e9" },
|
||||
"nvim-tree.lua": { "branch": "master", "commit": "64f61e4c913047a045ff90bd188dd3b54ee443cf" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "3607d9c59cb16ed5368ecfed53e8ca1735bb98fb" },
|
||||
"nvim-treesitter-context": { "branch": "master", "commit": "2650e6431f7daba5d9c2c64134fa5eb2312eb3d7" },
|
||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "23b820146956b3b681c19e10d3a8bc0cbd9a1d4c" },
|
||||
"nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" },
|
||||
"nvim-ts-context-commentstring": { "branch": "main", "commit": "7ab799a9792f7cf3883cf28c6a00ad431f3d382a" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "0bb67ef952ea3eb7b1bac9c011281471d99a27bc" },
|
||||
"nvim-ts-context-commentstring": { "branch": "main", "commit": "0bdccb9c67a42a5e2d99384dc9bfa29b1451528f" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "5b9067899ee6a2538891573500e8fd6ff008440f" },
|
||||
"persistence.nvim": { "branch": "main", "commit": "4982499c1636eac254b72923ab826ee7827b3084" },
|
||||
"playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "08e301982b9a057110ede7a735dd1b5285eb341f" },
|
||||
"symbols-outline.nvim": { "branch": "master", "commit": "564ee65dfc9024bdde73a6621820866987cbb256" },
|
||||
"telescope-file-browser.nvim": { "branch": "master", "commit": "48ffb8de688a22942940f50411d5928631368848" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "d5c4d9856320a07d04607c9b3a0523bd3f373328" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "833d8dd8b07eeda37a09e99460f72a02616935cb" },
|
||||
"tokyonight.nvim": { "branch": "main", "commit": "610179f7f12db3d08540b6cc61434db2eaecbcff" },
|
||||
"trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" },
|
||||
"vim-illuminate": { "branch": "master", "commit": "305bf07b919ac526deb5193280379e2f8b599926" },
|
||||
"vim-startuptime": { "branch": "master", "commit": "308b0088a864c4711a96e45b6734cf9294074f65" },
|
||||
"telescope-file-browser.nvim": { "branch": "master", "commit": "4d5fd21bae12ee6e9a79232e1c377f43c419d0c5" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "fac83a556e7b710dc31433dec727361ca062dbe9" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "a7e39ae9e74f2c8c6dc4eea6d40c3971ae84752d" },
|
||||
"tokyonight.nvim": { "branch": "main", "commit": "67afeaf7fd6ebba000633e89f63c31694057edde" },
|
||||
"trouble.nvim": { "branch": "main", "commit": "b9cf677f20bb2faa2dacfa870b084e568dca9572" },
|
||||
"vim-illuminate": { "branch": "master", "commit": "e522e0dd742a83506db0a72e1ced68c9c130f185" },
|
||||
"vim-startuptime": { "branch": "master", "commit": "ac2cccb5be617672add1f4f3c0a55ce99ba34e01" },
|
||||
"vim-vsnip": { "branch": "master", "commit": "02a8e79295c9733434aab4e0e2b8c4b7cea9f3a9" },
|
||||
"vim-vsnip-integ": { "branch": "master", "commit": "1914e72cf3de70df7f5dde476cd299aba2440aef" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" }
|
||||
|
||||
+4
-4
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"extras": [
|
||||
"lazyvim.plugins.extras.lang.go",
|
||||
"lazyvim.plugins.extras.test.core"
|
||||
"lazyvim.plugins.extras.test.core",
|
||||
"lazyvim.plugins.extras.lang.go"
|
||||
],
|
||||
"news": {
|
||||
"NEWS.md": "2123"
|
||||
"NEWS.md": "3314"
|
||||
},
|
||||
"version": 2
|
||||
"version": 3
|
||||
}
|
||||
@@ -7,10 +7,12 @@ 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 = {"*.js","*.tsx","*.ts", "*.json", "*.jsonc", "*.markdown","*.md" },
|
||||
pattern = {"js","tsx","ts", "json", "jsonc", "markdown","md","css","html" },
|
||||
callback = function()
|
||||
vim.opt.conceallevel = 0
|
||||
vim.o.tabstop = 2
|
||||
vim.o.shiftwidth = 2
|
||||
vim.bo.tabstop = 2
|
||||
vim.bo.softtabstop = 2
|
||||
vim.bo.shiftwidth = 2
|
||||
vim.bo.expand = true
|
||||
end,
|
||||
})
|
||||
|
||||
@@ -12,6 +12,9 @@ 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" })
|
||||
|
||||
-- <Leader>c
|
||||
keymap.set('n', "<Leader>cs", "<cmd>SymbolsOutline<cr>", { desc = "Symbols Outline" })
|
||||
|
||||
-- <Leader>D
|
||||
keymap.set('n', "<Leader>Dt", "<cmd>TroubleToggle<cr>", {desc="trouble" })
|
||||
keymap.set('n', "<Leader>Dw", "<cmd>TroubleToggle lsp_workspace_diagnostics<cr>", {desc="workspace" })
|
||||
@@ -64,23 +67,24 @@ keymap.set('n', '<Leader>h', ':set hlsearch!<CR>', { noremap = true, silent = tr
|
||||
|
||||
-- <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','v'}, '<Leader>la', "<cmd>lua vim.lsp.buf.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>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>ln', "<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>ll', "<cmd>lua vim.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>lp', "<cmd>lua vim.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>lR', "<cmd>lua vim.lsp.buf.rename()<cr>", { desc = "Rename" })
|
||||
--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" })
|
||||
|
||||
@@ -14,6 +14,7 @@ require("lazy").setup({
|
||||
{ import = "lazyvim.plugins.extras.lang.typescript" },
|
||||
{ import = "lazyvim.plugins.extras.lang.json" },
|
||||
{ import = "lazyvim.plugins.extras.lang.go" },
|
||||
{ import = "lazyvim.plugins.extras.dap.core" },
|
||||
{ import = "lazyvim.plugins.extras.formatting.prettier" },
|
||||
-- { import = "lazyvim.plugins.extras.ui.mini-animate" },
|
||||
-- import/override with your plugins
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
vim.g.autoformat = true
|
||||
|
||||
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
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
-- npm i -g bash-language-server
|
||||
require'lspconfig'.bashls.setup {
|
||||
cmd = {DATA_PATH .. "/lspinstall/bash/node_modules/.bin/bash-language-server", "start"},
|
||||
on_attach = require'lsp'.common_on_attach,
|
||||
filetypes = { "sh", "zsh" }
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
-- npm install -g vscode-css-languageserver-bin
|
||||
require'lspconfig'.cssls.setup {
|
||||
cmd = {
|
||||
"node", DATA_PATH .. "/lspinstall/css/vscode-css/css-language-features/server/dist/node/cssServerMain.js",
|
||||
"--stdio"
|
||||
},
|
||||
on_attach = require'lsp'.common_on_attach
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
-- npm install -g dockerfile-language-server-nodejs
|
||||
require'lspconfig'.dockerls.setup {
|
||||
cmd = {DATA_PATH .. "/lspinstall/dockerfile/node_modules/.bin/docker-langserver", "--stdio"},
|
||||
on_attach = require'lsp'.common_on_attach,
|
||||
root_dir = vim.loop.cwd
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
local nvim_lsp = require'lspconfig'
|
||||
local configs = require'lspconfig/configs'
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||
|
||||
configs.emmet_ls = {
|
||||
default_config = {
|
||||
cmd = {'emmet-ls', '--stdio'};
|
||||
filetypes = {'html', 'css'};
|
||||
root_dir = function()
|
||||
return vim.loop.cwd()
|
||||
end;
|
||||
settings = {};
|
||||
};
|
||||
}
|
||||
|
||||
nvim_lsp.emmet_ls.setup{
|
||||
-- on_attach = on_attach;
|
||||
}
|
||||
@@ -1,156 +0,0 @@
|
||||
-- LSP
|
||||
require 'lspconfig'.gopls.setup {
|
||||
-- cmd = {DATA_PATH .. "/lspinstall/go/gopls"},
|
||||
cmd = { "gopls", "serve" }, -- use cmd in path, I can update it easily
|
||||
settings = {
|
||||
gopls = {
|
||||
analyses = {
|
||||
nilness = true,
|
||||
unusedparams = true,
|
||||
unusedwrite = true,
|
||||
useany = true,
|
||||
},
|
||||
staticcheck = false
|
||||
}
|
||||
},
|
||||
root_dir = require 'lspconfig'.util.root_pattern(".git", "go.mod", "go.work"),
|
||||
init_options = { usePlaceholders = true, completeUnimported = true },
|
||||
on_attach = require 'lsp'.common_on_attach
|
||||
}
|
||||
|
||||
--[[
|
||||
require'dap-install'.config("go_delve",{})
|
||||
|
||||
-- DAP
|
||||
local dap = require "dap"
|
||||
vim.fn.sign_define('DapBreakpoint', {text='🟥', texthl='', linehl='', numhl=''})
|
||||
--vim.fn.sign_define('DapStopped', {text='⭐️', texthl='', linehl='', numhl=''})
|
||||
|
||||
local M = {}
|
||||
|
||||
local ts_utils = require 'nvim-treesitter.ts_utils'
|
||||
|
||||
function M.get_node()
|
||||
local n = ts_utils.get_node_at_cursor()
|
||||
put(ts_utils.get_node_text(n))
|
||||
end
|
||||
|
||||
function M.get_node2()
|
||||
local current_node = ts_utils.get_node_at_cursor()
|
||||
if not current_node then
|
||||
return ""
|
||||
end
|
||||
|
||||
local expr = current_node
|
||||
|
||||
while expr do
|
||||
if expr:type() == 'function_definition' then
|
||||
put(expr:type())
|
||||
break
|
||||
end
|
||||
expr = expr:parent()
|
||||
end
|
||||
|
||||
if not expr then return "" end
|
||||
|
||||
put(ts_utils.get_node_text(expr))
|
||||
return (ts_utils.get_node_text(expr:child(1)))[1]
|
||||
end
|
||||
|
||||
return M
|
||||
|
||||
--[[
|
||||
-- https://github.com/go-delve/delve/blob/master/Documentation/usage/dlv_dap.md
|
||||
dap.configurations.go = {
|
||||
{
|
||||
type = "go",
|
||||
name = "Debug",
|
||||
request = "launch",
|
||||
program = "${file}"
|
||||
},
|
||||
-- works with go.mod packages and sub packagesfunction M.get_current_function_name() local current_node = ts_utils.get_node_at_cursor() if not current_node then return "" end
|
||||
|
||||
local expr = current_node
|
||||
|
||||
while expr do
|
||||
if expr:type() == 'function_definition' then
|
||||
break
|
||||
end
|
||||
expr = expr:parent()
|
||||
end
|
||||
|
||||
if not expr then return "" end
|
||||
|
||||
return (ts_utils.get_node_text(expr:child(1)))[1]
|
||||
end
|
||||
{
|
||||
type = "go",
|
||||
name = "Debug test (go.mod)",
|
||||
request = "launch",
|
||||
mode = "test",
|
||||
program = "./${relativeFileDirname}"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
--[[
|
||||
local dap = require('dap')
|
||||
|
||||
dap.adapters.go = function(callback, config)
|
||||
local stdout = vim.loop.new_pipe(false)
|
||||
local handle
|
||||
local pid_or_err
|
||||
local port = 38697
|
||||
local opts = {
|
||||
stdio = {nil, stdout},
|
||||
args = {"dap", "-l", "127.0.0.1:" .. port},
|
||||
detached = true
|
||||
}
|
||||
handle, pid_or_err = vim.loop.spawn("dlv", opts, function(code)
|
||||
stdout:close()
|
||||
handle:close()
|
||||
if code ~= 0 then
|
||||
print('dlv exited with code', code)
|
||||
end
|
||||
end)
|
||||
assert(handle, 'Error running dlv: ' .. tostring(pid_or_err))
|
||||
stdout:read_start(function(err, chunk)
|
||||
assert(not err, err)
|
||||
if chunk then
|
||||
vim.schedule(function()
|
||||
require('dap.repl').append(chunk)
|
||||
end)
|
||||
end
|
||||
end)
|
||||
-- Wait for delve to start
|
||||
vim.defer_fn(
|
||||
function()
|
||||
callback({type = "server", host = "127.0.0.1", port = port})
|
||||
end,
|
||||
100)
|
||||
end
|
||||
-- https://github.com/go-delve/delve/blob/master/Documentation/usage/dlv_dap.md
|
||||
dap.configurations.go = {
|
||||
{
|
||||
type = "go",
|
||||
name = "Debug",
|
||||
request = "launch",
|
||||
program = "${file}"
|
||||
},
|
||||
{
|
||||
type = "go",
|
||||
name = "Debug test", -- configuration for debugging test files
|
||||
request = "launch",
|
||||
mode = "test",
|
||||
program = "${file}"
|
||||
},
|
||||
-- works with go.mod packages and sub packages
|
||||
{
|
||||
type = "go",
|
||||
name = "Debug test (go.mod)",
|
||||
request = "launch",
|
||||
mode = "test",
|
||||
program = "./${relativeFileDirname}"
|
||||
}
|
||||
}
|
||||
]]
|
||||
@@ -1,9 +0,0 @@
|
||||
-- npm install -g vscode-html-languageserver-bin
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||
|
||||
require'lspconfig'.html.setup {
|
||||
cmd = {"node", DATA_PATH .. "/lspinstall/html/vscode-html/html-language-features/server/dist/node/htmlServerMain.js", "--stdio"},
|
||||
on_attach = require'lsp'.common_on_attach,
|
||||
capabilities = capabilities
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
-- npm install -g typescript typescript-language-server
|
||||
-- require'snippets'.use_suggested_mappings()
|
||||
-- local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
-- capabilities.textDocument.completion.completionItem.snippetSupport = true;
|
||||
-- local on_attach_common = function(client)
|
||||
-- print("LSP Initialized")
|
||||
-- require'completion'.on_attach(client)
|
||||
-- require'illuminate'.on_attach(client)
|
||||
-- end
|
||||
|
||||
require'lspconfig'.tsserver.setup {
|
||||
cmd = {DATA_PATH .. "/lspinstall/typescript/node_modules/.bin/typescript-language-server", "--stdio"},
|
||||
filetypes = { "javascript", "javascriptreact", "javascript.jsx", "typescript", "typescriptreact", "typescript.tsx" },
|
||||
on_attach = require'lsp'.tsserver_on_attach,
|
||||
-- This makes sure tsserver is not used for formatting (I prefer prettier)
|
||||
-- on_attach = require'lsp'.common_on_attach,
|
||||
root_dir = require('lspconfig/util').root_pattern("package.json", "tsconfig.json", "jsconfig.json", ".git"),
|
||||
settings = {documentFormatting = false},
|
||||
handlers = {
|
||||
["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {
|
||||
virtual_text = O.tsserver.diagnostics.virtual_text,
|
||||
signs = O.tsserver.diagnostics.signs,
|
||||
underline = O.tsserver.diagnostics.underline,
|
||||
update_in_insert = true
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
-- npm install -g vscode-json-languageserver
|
||||
require'lspconfig'.jsonls.setup {
|
||||
cmd = {
|
||||
"node", DATA_PATH .. "/lspinstall/json/vscode-json/json-language-features/server/dist/node/jsonServerMain.js",
|
||||
"--stdio"
|
||||
},
|
||||
on_attach = require'lsp'.common_on_attach,
|
||||
|
||||
commands = {
|
||||
Format = {
|
||||
function()
|
||||
vim.lsp.buf.range_formatting({}, {0, 0}, {vim.fn.line("$"), 0})
|
||||
end
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
require'lspconfig'.texlab.setup{
|
||||
cmd = {DATA_PATH .. "/lspinstall/latex/texlab"},
|
||||
on_attach = require'lsp'.common_on_attach
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
-- https://github.com/sumneko/lua-language-server/wiki/Build-and-Run-(Standalone)
|
||||
local brew_path = "/usr/local/Cellar/lua-language-server/2.5.5/libexec"
|
||||
local sumneko_root_path = brew_path
|
||||
local sumneko_binary = brew_path .. "/bin/lua-language-server"
|
||||
|
||||
require'lspconfig'.sumneko_lua.setup {
|
||||
cmd = {sumneko_binary, "-E", sumneko_root_path .. "/main.lua"},
|
||||
on_attach = require'lsp'.common_on_attach,
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
|
||||
version = 'LuaJIT',
|
||||
-- Setup your lua path
|
||||
path = vim.split(package.path, ';')
|
||||
},
|
||||
diagnostics = {
|
||||
-- Get the language server to recognize the `vim` global
|
||||
globals = {'vim'}
|
||||
},
|
||||
workspace = {
|
||||
-- Make the server aware of Neovim runtime files
|
||||
library = {[vim.fn.expand('$VIMRUNTIME/lua')] = true, [vim.fn.expand('$VIMRUNTIME/lua/vim/lsp')] = true},
|
||||
maxPreload = 10000
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
-- npm i -g pyright
|
||||
require'lspconfig'.pyright.setup {
|
||||
cmd = {DATA_PATH .. "/lspinstall/python/node_modules/.bin/pyright-langserver", "--stdio"},
|
||||
on_attach = require'lsp'.common_on_attach,
|
||||
handlers = {
|
||||
["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {
|
||||
virtual_text = O.python.diagnostics.virtual_text,
|
||||
signs = O.python.diagnostics.signs,
|
||||
underline = O.python.diagnostics.underline,
|
||||
update_in_insert = true
|
||||
})
|
||||
},
|
||||
settings = {
|
||||
python = {
|
||||
analysis = {
|
||||
typeCheckingMode = O.python.analysis.type_checking,
|
||||
autoSearchPaths = O.python.analysis.auto_search_paths,
|
||||
useLibraryCodeForTypes = O.python.analysis.use_library_code_types
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
require'lspconfig'.rust_analyzer.setup{
|
||||
cmd = {DATA_PATH .. "/lspinstall/rust/rust-analyzer"},
|
||||
on_attach = require'lsp'.common_on_attach
|
||||
}
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
-- npm install -g yaml-language-server
|
||||
require'lspconfig'.yamlls.setup{
|
||||
cmd = {DATA_PATH .. "/lspinstall/yaml/node_modules/.bin/yaml-language-server", "--stdio"},
|
||||
on_attach = require'lsp'.common_on_attach,
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
vim.api.nvim_set_keymap('n', '<TAB>', ':BufferNext<CR>', { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap('n', '<S-TAB>', ':BufferPrevious<CR>', { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap('n', '<S-x>', ':BufferClose<CR>', { noremap = true, silent = true })
|
||||
@@ -1,63 +0,0 @@
|
||||
--[[
|
||||
local dashboard = {
|
||||
custom_header = {
|
||||
' _..._ ',
|
||||
' .\' (_`. _ __ ___ ',
|
||||
' : . : | | _ _ _ __ __ _ _ _\\ \\ / (_)_ __ ___ ',
|
||||
' :) () : | | | | | | \'_ \\ / _` | \'__\\ \\ / /| | \'_ ` _ \\ ',
|
||||
' `. . .\' | |__| |_| | | | | (_| | | \\ V / | | | | | | |',
|
||||
' `-...-\' |_____\\__,_|_| |_|\\__,_|_| \\_/ |_|_| |_| |_|',
|
||||
},
|
||||
footer= {'Laily'}
|
||||
}
|
||||
]]
|
||||
|
||||
local dashboard = {
|
||||
custom_header = {
|
||||
'███╗ ██╗██╗ ██╗ ██████╗ ██████╗ ██████╗ ███████╗',
|
||||
'████╗ ██║██║ ██║██╔════╝██╔═══██╗██╔══██╗██╔════╝',
|
||||
'██╔██╗ ██║██║ ██║██║ ██║ ██║██║ ██║█████╗',
|
||||
'██║╚██╗██║╚██╗ ██╔╝██║ ██║ ██║██║ ██║██╔══╝',
|
||||
'██║ ╚████║ ╚████╔╝ ╚██████╗╚██████╔╝██████╔╝███████╗',
|
||||
'╚═╝ ╚═══╝ ╚═══╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝'
|
||||
},
|
||||
footer= {'Laily'},
|
||||
}
|
||||
-- vim.g.dashboard_custom_header = {
|
||||
--
|
||||
-- ' _..._ ',
|
||||
-- ' .\' `. ██ ██ ██ ███ ██ █████ ██████ ██ ██ ██ ███ ███ ',
|
||||
-- ' : : ██ ██ ██ ████ ██ ██ ██ ██ ██ ██ ██ ██ ████ ████ ',
|
||||
-- ' : : ██ ██ ██ ██ ██ ██ ███████ ██████ ██ ██ ██ ██ ████ ██ ',
|
||||
-- ' `. .\' ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ',
|
||||
-- ' `-...-\' ███████ ██████ ██ ████ ██ ██ ██ ██ ████ ██ ██ ██ ',
|
||||
--
|
||||
-- }
|
||||
|
||||
vim.g.dashboard_custom_header = dashboard.custom_header
|
||||
|
||||
vim.g.dashboard_default_executive = 'telescope'
|
||||
|
||||
vim.g.dashboard_custom_section = {
|
||||
a = {description = {' Find File '}, command = 'Telescope find_files'},
|
||||
b = {description = {' Recently Used Files'}, command = 'Telescope oldfiles'},
|
||||
c = {description = {' Load Last Session '}, command = 'SessionLoad'},
|
||||
d = {description = {' Find Word '}, command = 'Telescope live_grep'},
|
||||
e = {description = {' Settings '}, command = ':e '..CONFIG_PATH..'/lv-settings.lua'}
|
||||
-- e = {description = {' Marks '}, command = 'Telescope marks'}
|
||||
}
|
||||
|
||||
-- file_browser = {description = {' File Browser'}, command = 'Telescope find_files'},
|
||||
|
||||
-- vim.g.dashboard_custom_shortcut = {
|
||||
-- a = 'f',
|
||||
-- find_word = 'SPC f a',
|
||||
-- last_session = 'SPC s l',
|
||||
-- new_file = 'SPC c n',
|
||||
-- book_marks = 'SPC f b'
|
||||
-- }
|
||||
-- find_history = 'SPC f h',
|
||||
|
||||
-- vim.g.dashboard_session_directory = CACHE_PATH..'/session'
|
||||
vim.g.dashboard_custom_footer = dashboard.footer
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
require'fzf-lua'.setup {
|
||||
fzf_opts = { ['--keep-right'] = ''},
|
||||
fzf_cli_args = '--keep-right',
|
||||
--[[
|
||||
winopts = {
|
||||
preview = {
|
||||
layout = "vertical"
|
||||
}
|
||||
}
|
||||
]]
|
||||
}
|
||||
@@ -1,220 +0,0 @@
|
||||
local gl = require('galaxyline')
|
||||
-- get my theme in galaxyline repo
|
||||
-- local colors = require('galaxyline.theme').default
|
||||
local colors = {
|
||||
-- bg = '#2E2E2E',
|
||||
bg = '#292D38',
|
||||
yellow = '#DCDCAA',
|
||||
dark_yellow = '#D7BA7D',
|
||||
cyan = '#4EC9B0',
|
||||
green = '#608B4E',
|
||||
light_green = '#B5CEA8',
|
||||
string_orange = '#CE9178',
|
||||
orange = '#FF8800',
|
||||
purple = '#C586C0',
|
||||
magenta = '#D16D9E',
|
||||
grey = '#858585',
|
||||
blue = '#569CD6',
|
||||
vivid_blue = '#4FC1FF',
|
||||
light_blue = '#9CDCFE',
|
||||
red = '#D16969',
|
||||
error_red = '#F44747',
|
||||
info_yellow = '#FFCC66'
|
||||
}
|
||||
local condition = require('galaxyline.condition')
|
||||
local gls = gl.section
|
||||
gl.short_line_list = {'NvimTree', 'vista', 'dbui', 'packer'}
|
||||
|
||||
table.insert(gls.left, {
|
||||
ViMode = {
|
||||
provider = function()
|
||||
-- auto change color according the vim mode
|
||||
local mode_color = {
|
||||
n = colors.blue,
|
||||
i = colors.green,
|
||||
v = colors.purple,
|
||||
[''] = colors.purple,
|
||||
V = colors.purple,
|
||||
c = colors.magenta,
|
||||
no = colors.blue,
|
||||
s = colors.orange,
|
||||
S = colors.orange,
|
||||
[''] = colors.orange,
|
||||
ic = colors.yellow,
|
||||
R = colors.red,
|
||||
Rv = colors.red,
|
||||
cv = colors.blue,
|
||||
ce = colors.blue,
|
||||
r = colors.cyan,
|
||||
rm = colors.cyan,
|
||||
['r?'] = colors.cyan,
|
||||
['!'] = colors.blue,
|
||||
t = colors.blue
|
||||
}
|
||||
vim.api.nvim_command('hi GalaxyViMode guifg=' .. mode_color[vim.fn.mode()])
|
||||
return '▊ '
|
||||
end,
|
||||
highlight = {colors.red, colors.bg}
|
||||
}
|
||||
})
|
||||
print(vim.fn.getbufvar(0, 'ts'))
|
||||
vim.fn.getbufvar(0, 'ts')
|
||||
|
||||
table.insert(gls.left, {
|
||||
GitIcon = {
|
||||
provider = function()
|
||||
return ' '
|
||||
end,
|
||||
condition = condition.check_git_workspace,
|
||||
separator = ' ',
|
||||
separator_highlight = {'NONE', colors.bg},
|
||||
highlight = {colors.orange, colors.bg}
|
||||
}
|
||||
})
|
||||
|
||||
table.insert(gls.left, {
|
||||
GitBranch = {
|
||||
provider = 'GitBranch',
|
||||
condition = condition.check_git_workspace,
|
||||
separator = ' ',
|
||||
separator_highlight = {'NONE', colors.bg},
|
||||
highlight = {colors.grey, colors.bg}
|
||||
}
|
||||
})
|
||||
|
||||
table.insert(gls.left, {
|
||||
DiffAdd = {
|
||||
provider = 'DiffAdd',
|
||||
condition = condition.hide_in_width,
|
||||
icon = ' ',
|
||||
highlight = {colors.green, colors.bg}
|
||||
}
|
||||
})
|
||||
table.insert(gls.left, {
|
||||
DiffModified = {
|
||||
provider = 'DiffModified',
|
||||
condition = condition.hide_in_width,
|
||||
icon = ' 柳',
|
||||
highlight = {colors.blue, colors.bg}
|
||||
}
|
||||
})
|
||||
table.insert(gls.left, {
|
||||
DiffRemove = {
|
||||
provider = 'DiffRemove',
|
||||
condition = condition.hide_in_width,
|
||||
icon = ' ',
|
||||
highlight = {colors.red, colors.bg}
|
||||
}
|
||||
})
|
||||
|
||||
table.insert(gls.right, {
|
||||
DiagnosticError = {provider = 'DiagnosticError', icon = ' ', highlight = {colors.error_red, colors.bg}}
|
||||
})
|
||||
table.insert(gls.right, {DiagnosticWarn = {provider = 'DiagnosticWarn', icon = ' ', highlight = {colors.orange, colors.bg}}})
|
||||
|
||||
table.insert(gls.right, {
|
||||
DiagnosticHint = {provider = 'DiagnosticHint', icon = ' ', highlight = {colors.vivid_blue, colors.bg}}
|
||||
})
|
||||
|
||||
table.insert(gls.right, {DiagnosticInfo = {provider = 'DiagnosticInfo', icon = ' ', highlight = {colors.info_yellow, colors.bg}}})
|
||||
|
||||
table.insert(gls.right, {
|
||||
TreesitterIcon = {
|
||||
provider = function()
|
||||
if next(vim.treesitter.highlighter.active) ~= nil then return ' ' end
|
||||
return ''
|
||||
end,
|
||||
separator = ' ',
|
||||
separator_highlight = {'NONE', colors.bg},
|
||||
highlight = {colors.green, colors.bg}
|
||||
}
|
||||
})
|
||||
|
||||
table.insert(gls.right, {
|
||||
ShowLspClient = {
|
||||
provider = 'GetLspClient',
|
||||
condition = function()
|
||||
local tbl = {['dashboard'] = true, [' '] = true}
|
||||
if tbl[vim.bo.filetype] then return false end
|
||||
return true
|
||||
end,
|
||||
icon = ' ',
|
||||
highlight = {colors.grey, colors.bg}
|
||||
}
|
||||
})
|
||||
|
||||
table.insert(gls.right, {
|
||||
LineInfo = {
|
||||
provider = 'LineColumn',
|
||||
separator = ' ',
|
||||
separator_highlight = {'NONE', colors.bg},
|
||||
highlight = {colors.grey, colors.bg}
|
||||
}
|
||||
})
|
||||
|
||||
table.insert(gls.right, {
|
||||
PerCent = {
|
||||
provider = 'LinePercent',
|
||||
separator = ' ',
|
||||
separator_highlight = {'NONE', colors.bg},
|
||||
highlight = {colors.grey, colors.bg}
|
||||
}
|
||||
})
|
||||
|
||||
table.insert(gls.right, {
|
||||
Tabstop = {
|
||||
provider = function()
|
||||
return "Spaces: " .. vim.api.nvim_buf_get_option(0, "shiftwidth") .. " "
|
||||
end,
|
||||
condition = condition.hide_in_width,
|
||||
separator = ' ',
|
||||
separator_highlight = {'NONE', colors.bg},
|
||||
highlight = {colors.grey, colors.bg}
|
||||
}
|
||||
})
|
||||
|
||||
table.insert(gls.right, {
|
||||
BufferType = {
|
||||
provider = 'FileTypeName',
|
||||
condition = condition.hide_in_width,
|
||||
separator = ' ',
|
||||
separator_highlight = {'NONE', colors.bg},
|
||||
highlight = {colors.grey, colors.bg}
|
||||
}
|
||||
})
|
||||
|
||||
table.insert(gls.right, {
|
||||
FileEncode = {
|
||||
provider = 'FileEncode',
|
||||
condition = condition.hide_in_width,
|
||||
separator = ' ',
|
||||
separator_highlight = {'NONE', colors.bg},
|
||||
highlight = {colors.grey, colors.bg}
|
||||
}
|
||||
})
|
||||
|
||||
table.insert(gls.right, {
|
||||
Space = {
|
||||
provider = function()
|
||||
return ' '
|
||||
end,
|
||||
separator = ' ',
|
||||
separator_highlight = {'NONE', colors.bg},
|
||||
highlight = {colors.orange, colors.bg}
|
||||
}
|
||||
})
|
||||
|
||||
table.insert(gls.short_line_left, {
|
||||
BufferType = {
|
||||
provider = 'FileTypeName',
|
||||
separator = ' ',
|
||||
separator_highlight = {'NONE', colors.bg},
|
||||
highlight = {colors.grey, colors.bg}
|
||||
}
|
||||
})
|
||||
|
||||
table.insert(gls.short_line_left, {
|
||||
SFileName = {provider = 'SFileName', condition = condition.buffer_not_empty, highlight = {colors.grey, colors.bg}}
|
||||
})
|
||||
|
||||
--table.insert(gls.short_line_right[1] = {BufferIcon = {provider = 'BufferIcon', highlight = {colors.grey, colors.bg}}})
|
||||
@@ -1,18 +0,0 @@
|
||||
require('gitsigns').setup {
|
||||
signs = {
|
||||
-- TODO add hl to colorscheme
|
||||
add = {hl = 'GitSignsAdd' , text = '▎', numhl='GitSignsAddNr' , linehl='GitSignsAddLn'},
|
||||
change = {hl = 'GitSignsChange', text = '▎', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'},
|
||||
delete = {hl = 'GitSignsDelete', text = '契', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'},
|
||||
topdelete = {hl = 'GitSignsDelete', text = '契', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'},
|
||||
changedelete = {hl = 'GitSignsChange', text = '▎', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'},
|
||||
},
|
||||
numhl = false,
|
||||
linehl = false,
|
||||
watch_gitdir = {
|
||||
interval = 1000
|
||||
},
|
||||
sign_priority = 6,
|
||||
update_debounce = 200,
|
||||
status_formatter = nil, -- Use default
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
vim.api.nvim_set_keymap('n', 's', ":HopChar2<cr>", {silent = true})
|
||||
vim.api.nvim_set_keymap('n', 'S', ":HopWord<cr>", {silent = true})
|
||||
@@ -1,39 +0,0 @@
|
||||
-- source plugin config
|
||||
|
||||
require('pluginconfig/barbar')
|
||||
require('pluginconfig/dashboard-nvim')
|
||||
require('pluginconfig/galaxyline')
|
||||
require('pluginconfig/gitsigns')
|
||||
require('pluginconfig/hop')
|
||||
require('pluginconfig/mason')
|
||||
require('pluginconfig/neodev') -- must before lspconfig
|
||||
require('pluginconfig/mkdx')
|
||||
require('pluginconfig/neotest')
|
||||
require('pluginconfig/numb')
|
||||
require('pluginconfig/nvim-autopairs')
|
||||
require('pluginconfig/nvim-cmp')
|
||||
require('pluginconfig/nvim-colorizer')
|
||||
require('pluginconfig/nvim-lint')
|
||||
require('pluginconfig/fzf-lua')
|
||||
require('pluginconfig/nvim-tree') -- This plugin must be required somewhere before colorscheme. Placing it after will break navigation keymappings
|
||||
require('pluginconfig/nvim-treesitter')
|
||||
require('pluginconfig/rnvimr')
|
||||
require('pluginconfig/symbols-outline')
|
||||
require('pluginconfig/telescope')
|
||||
require('pluginconfig/toggleterm')
|
||||
require('pluginconfig/vim-matchup')
|
||||
require('pluginconfig/which-key')
|
||||
|
||||
|
||||
-- nvim_comment
|
||||
require('nvim_comment').setup()
|
||||
|
||||
-- lsp-rooter
|
||||
require("lsp-rooter").setup {
|
||||
-- your configuration comes here
|
||||
-- or leave it empty to use the default settings
|
||||
-- refer to the configuration section below
|
||||
}
|
||||
|
||||
-- lsp signature
|
||||
require("lsp_signature").setup()
|
||||
@@ -1 +0,0 @@
|
||||
require("mason").setup()
|
||||
@@ -1,7 +0,0 @@
|
||||
vim.cmd([[
|
||||
let g:mkdx#settings = { 'highlight': { 'enable': 1 },
|
||||
\ 'enter': { 'shift': 1 },
|
||||
\ 'links': { 'external': { 'enable': 1 } },
|
||||
\ 'toc': { 'text': 'Table of Contents', 'update_on_write': 1 },
|
||||
\ 'fold': { 'enable': 1 } }
|
||||
]])
|
||||
@@ -1,3 +0,0 @@
|
||||
require("neodev").setup({
|
||||
-- add any options here, or leave empty to use the default settings
|
||||
})
|
||||
@@ -1,10 +0,0 @@
|
||||
require("neotest").setup({
|
||||
adapters = {
|
||||
require("neotest-go")({
|
||||
experimental = {
|
||||
test_table = true,
|
||||
},
|
||||
args = { "-gcflags=all=-l", "-count=1", "-timeout=60s" }
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -1,4 +0,0 @@
|
||||
require('numb').setup{
|
||||
show_numbers = true, -- Enable 'number' for the window while peeking
|
||||
show_cursorline = true -- Enable 'cursorline' for the window while peeking
|
||||
}
|
||||
@@ -1,123 +0,0 @@
|
||||
-- require('nvim-autopairs').setup()
|
||||
-- local npairs = require('nvim-autopairs')
|
||||
|
||||
-- local function imap(lhs, rhs, opts)
|
||||
-- local options = {noremap = false}
|
||||
-- if opts then options = vim.tbl_extend('force', options, opts) end
|
||||
-- vim.api.nvim_set_keymap('i', lhs, rhs, options)
|
||||
-- end
|
||||
|
||||
-- _G.MUtils = {}
|
||||
|
||||
-- -- TEST
|
||||
-- vim.g.completion_confirm_key = ""
|
||||
-- MUtils.completion_confirm = function()
|
||||
-- if vim.fn.pumvisible() ~= 0 then
|
||||
-- if vim.fn.complete_info()["selected"] ~= -1 then
|
||||
-- vim.fn["compe#confirm"]()
|
||||
-- -- return npairs.esc("<c-y>")
|
||||
-- return npairs.esc("")
|
||||
-- else
|
||||
-- vim.defer_fn(function()
|
||||
-- vim.fn["compe#confirm"]("<cr>")
|
||||
-- end, 20)
|
||||
-- return npairs.esc("<c-n>")
|
||||
-- end
|
||||
-- else
|
||||
-- return npairs.check_break_line_char()
|
||||
-- end
|
||||
-- end
|
||||
-- -- TEST
|
||||
|
||||
-- MUtils.completion_confirm = function()
|
||||
-- if vim.fn.pumvisible() ~= 0 then
|
||||
-- if vim.fn.complete_info()["selected"] ~= -1 then
|
||||
-- vim.fn["compe#confirm"]()
|
||||
-- return npairs.esc("")
|
||||
-- else
|
||||
-- vim.api.nvim_select_popupmenu_item(0, false, false, {})
|
||||
-- vim.fn["compe#confirm"]()
|
||||
-- return npairs.esc("<c-n>")
|
||||
-- end
|
||||
-- else
|
||||
-- return npairs.check_break_line_char()
|
||||
-- end
|
||||
-- end
|
||||
|
||||
-- MUtils.tab = function()
|
||||
-- if vim.fn.pumvisible() ~= 0 then
|
||||
-- return npairs.esc("<C-n>")
|
||||
-- else
|
||||
-- if vim.fn["vsnip#available"](1) ~= 0 then
|
||||
-- vim.fn.feedkeys(string.format('%c%c%c(vsnip-expand-or-jump)', 0x80, 253, 83))
|
||||
-- return npairs.esc("")
|
||||
-- else
|
||||
-- return npairs.esc("<Tab>")
|
||||
-- end
|
||||
-- end
|
||||
-- end
|
||||
|
||||
-- MUtils.s_tab = function()
|
||||
-- if vim.fn.pumvisible() ~= 0 then
|
||||
-- return npairs.esc("<C-p>")
|
||||
-- else
|
||||
-- if vim.fn["vsnip#jumpable"](-1) ~= 0 then
|
||||
-- vim.fn.feedkeys(string.format('%c%c%c(vsnip-jump-prev)', 0x80, 253, 83))
|
||||
-- return npairs.esc("")
|
||||
-- else
|
||||
-- return npairs.esc("<C-h>")
|
||||
-- end
|
||||
-- end
|
||||
-- end
|
||||
|
||||
-- -- Autocompletion and snippets
|
||||
-- vim.api.nvim_set_keymap('i', '<CR>', 'v:lua.MUtils.completion_confirm()', {expr = true, noremap = true})
|
||||
-- -- imap("<CR>", "v:lua.MUtils.completion_confirm()", {expr = true, noremap = true})
|
||||
-- imap("<Tab>", "v:lua.MUtils.tab()", {expr = true, noremap = true})
|
||||
-- imap("<S-Tab>", "v:lua.MUtils.s_tab()", {expr = true, noremap = true})
|
||||
|
||||
local remap = vim.api.nvim_set_keymap
|
||||
local npairs = require('nvim-autopairs')
|
||||
local Rule = require('nvim-autopairs.rule')
|
||||
|
||||
-- skip it, if you use another global object
|
||||
_G.MUtils= {}
|
||||
|
||||
vim.g.completion_confirm_key = ""
|
||||
MUtils.completion_confirm=function()
|
||||
if vim.fn.pumvisible() ~= 0 then
|
||||
if vim.fn.complete_info()["selected"] ~= -1 then
|
||||
return vim.fn["compe#confirm"](npairs.esc("<cr>"))
|
||||
else
|
||||
return npairs.esc("<cr>")
|
||||
end
|
||||
else
|
||||
return npairs.autopairs_cr()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
remap('i' , '<CR>','v:lua.MUtils.completion_confirm()', {expr = true , noremap = true})
|
||||
|
||||
npairs.setup({
|
||||
check_ts = true,
|
||||
ts_config = {
|
||||
lua = {'string'},-- it will not add pair on that treesitter node
|
||||
javascript = {'template_string'},
|
||||
java = false,-- don't check treesitter on java
|
||||
}
|
||||
})
|
||||
|
||||
require('nvim-treesitter.configs').setup {
|
||||
autopairs = {enable = true}
|
||||
}
|
||||
|
||||
local ts_conds = require('nvim-autopairs.ts-conds')
|
||||
|
||||
-- press % => %% is only inside comment or string
|
||||
npairs.add_rules({
|
||||
Rule("%", "%", "lua")
|
||||
:with_pair(ts_conds.is_ts_node({'string','comment'})),
|
||||
Rule("$", "$", "lua")
|
||||
:with_pair(ts_conds.is_not_ts_node({'function'}))
|
||||
})
|
||||
@@ -1,92 +0,0 @@
|
||||
local lspkind = require('lspkind')
|
||||
local cmp = require 'cmp'
|
||||
|
||||
local function keymapping(cmp)
|
||||
return {
|
||||
-- 上一个
|
||||
['<C-k>'] = cmp.mapping.select_prev_item(),
|
||||
-- 下一个
|
||||
['<C-j>'] = cmp.mapping.select_next_item(),
|
||||
-- 出现补全
|
||||
['<A-.>'] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }),
|
||||
-- 取消
|
||||
['<A-,>'] = cmp.mapping({
|
||||
i = cmp.mapping.abort(),
|
||||
c = cmp.mapping.close(),
|
||||
}),
|
||||
-- 确认
|
||||
-- Accept currently selected item. If none selected, `select` first item.
|
||||
-- Set `select` to `false` to only confirm explicitly selected items.
|
||||
['<CR>'] = cmp.mapping.confirm({
|
||||
select = true,
|
||||
behavior = cmp.ConfirmBehavior.Replace
|
||||
}),
|
||||
-- ['<C-y>'] = cmp.config.disable, -- Specify `cmp.config.disable` if you want to remove the default `<C-y>` mapping.
|
||||
['<C-u>'] = cmp.mapping(cmp.mapping.scroll_docs(-4), { 'i', 'c' }),
|
||||
['<C-d>'] = cmp.mapping(cmp.mapping.scroll_docs(4), { 'i', 'c' }),
|
||||
}
|
||||
end
|
||||
|
||||
cmp.setup {
|
||||
-- 指定 snippet 引擎
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
-- For `vsnip` users.
|
||||
vim.fn["vsnip#anonymous"](args.body)
|
||||
|
||||
-- For `luasnip` users.
|
||||
-- require('luasnip').lsp_expand(args.body)
|
||||
|
||||
-- For `ultisnips` users.
|
||||
-- vim.fn["UltiSnips#Anon"](args.body)
|
||||
|
||||
-- For `snippy` users.
|
||||
-- require'snippy'.expand_snippet(args.body)
|
||||
end,
|
||||
},
|
||||
-- 来源
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'nvim_lsp' },
|
||||
-- For vsnip users.
|
||||
{ name = 'vsnip' },
|
||||
-- For luasnip users.
|
||||
-- { name = 'luasnip' },
|
||||
--For ultisnips users.
|
||||
-- { name = 'ultisnips' },
|
||||
-- -- For snippy users.
|
||||
-- { name = 'snippy' },
|
||||
}, { { name = 'buffer' },
|
||||
{ name = 'path' }
|
||||
}),
|
||||
|
||||
-- 快捷键
|
||||
mapping = keymapping(cmp),
|
||||
-- 使用lspkind-nvim显示类型图标
|
||||
formatting = {
|
||||
format = lspkind.cmp_format({
|
||||
with_text = true, -- do not show text alongside icons
|
||||
maxwidth = 50, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters)
|
||||
before = function(entry, vim_item)
|
||||
-- Source 显示提示来源
|
||||
vim_item.menu = "[" .. string.upper(entry.source.name) .. "]"
|
||||
return vim_item
|
||||
end
|
||||
})
|
||||
},
|
||||
}
|
||||
|
||||
-- Use buffer source for `/`.
|
||||
cmp.setup.cmdline('/', {
|
||||
sources = {
|
||||
{ name = 'buffer' }
|
||||
}
|
||||
})
|
||||
|
||||
-- Use cmdline & path source for ':'.
|
||||
cmp.setup.cmdline(':', {
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'path' }
|
||||
}, {
|
||||
{ name = 'cmdline' }
|
||||
})
|
||||
})
|
||||
@@ -1,13 +0,0 @@
|
||||
require'colorizer'.setup(
|
||||
{'*';},
|
||||
{
|
||||
RGB = true; -- #RGB hex codes
|
||||
RRGGBB = true; -- #RRGGBB hex codes
|
||||
RRGGBBAA = true; -- #RRGGBBAA hex codes
|
||||
rgb_fn = true; -- CSS rgb() and rgba() functions
|
||||
hsl_fn = true; -- CSS hsl() and hsla() functions
|
||||
css = true; -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB
|
||||
css_fn = true; -- Enable all CSS *functions*: rgb_fn, hsl_fn
|
||||
})
|
||||
-- names = true; -- "Name" codes like Blue
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
local lint_lib = require('lint')
|
||||
|
||||
lint_lib.linters_by_ft = {
|
||||
go = {'golangcilint'}
|
||||
}
|
||||
|
||||
local golangcilint = lint_lib.linters.golangcilint
|
||||
golangcilint.args = {
|
||||
'run',
|
||||
'--config',
|
||||
'~/.dotfile/.golangci_strict.yml',
|
||||
'--out-format',
|
||||
'json',
|
||||
}
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
|
||||
callback = function()
|
||||
require("lint").try_lint()
|
||||
end,
|
||||
})
|
||||
@@ -1,55 +0,0 @@
|
||||
local function my_on_attach(bufnr)
|
||||
local api = require "nvim-tree.api"
|
||||
|
||||
local function opts(desc)
|
||||
return { desc = "nvim-tree: " .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true }
|
||||
end
|
||||
|
||||
-- default mappings
|
||||
api.config.mappings.default_on_attach(bufnr)
|
||||
|
||||
-- custom mappings
|
||||
vim.keymap.set('n', '<C-t>', api.tree.change_root_to_parent, opts('Up'))
|
||||
vim.keymap.set('n', '?', api.tree.toggle_help, opts('Help'))
|
||||
vim.keymap.set('n', 'l', api.node.open.edit, opts('Edit'))
|
||||
vim.keymap.set('n', 'h', api.node.navigate.parent_close, opts('Parent Close'))
|
||||
vim.keymap.set('n', 's', api.node.open.horizontal, opts('Horizontal Split'))
|
||||
vim.keymap.set('n', 'v', api.node.open.vertical, opts('Vertical Split'))
|
||||
end
|
||||
|
||||
require'nvim-tree'.setup {
|
||||
on_attach = my_on_attach,
|
||||
disable_netrw = true,
|
||||
hijack_netrw = true,
|
||||
--auto_close = false,
|
||||
filters = {
|
||||
dotfiles = false,
|
||||
custom = {}
|
||||
},
|
||||
git = {
|
||||
enable = true,
|
||||
ignore = false,
|
||||
timeout = 500,
|
||||
},
|
||||
update_focused_file = {
|
||||
-- enables the feature
|
||||
enable = true,
|
||||
-- update the root directory of the tree to the one of the folder containing the file if the file is not under the current root directory
|
||||
-- only relevant when `update_focused_file.enable` is true
|
||||
update_cwd = false,
|
||||
-- list of buffer names / filetypes that will not update the cwd if the file isn't found under the current root directory
|
||||
-- only relevant when `update_focused_file.update_cwd` is true and `update_focused_file.enable` is true
|
||||
ignore_list = {}
|
||||
},
|
||||
}
|
||||
|
||||
vim.g.nvim_tree_indent_markers = 1 -- "0 by default, this option shows indent markers when folders are open
|
||||
vim.g.nvim_tree_auto_ignore_ft = 'startify' --empty by default, don't auto open tree on specific filetypes.
|
||||
|
||||
vim.g.nvim_tree_icons = {
|
||||
default = '',
|
||||
symlink = '',
|
||||
git = {unstaged = "", staged = "✓", unmerged = "", renamed = "➜", untracked = ""},
|
||||
folder = {default = "", open = "", empty = "", empty_open = "", symlink = ""}
|
||||
}
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
local treesitter = {
|
||||
ensure_installed = "all",
|
||||
highlight = { enabled = true },
|
||||
playground = { enabled = true },
|
||||
rainbow = { enabled = false },
|
||||
}
|
||||
|
||||
require 'nvim-treesitter.configs'.setup {
|
||||
ensure_installed = treesitter.ensure_installed, -- one of "all", "maintained" (parsers with maintainers), or a list of languages
|
||||
ignore_install = { "haskell", "markdown", "swift" },
|
||||
matchup = {
|
||||
enable = true, -- mandatory, false will disable the whole extension
|
||||
-- disable = { "c", "ruby" }, -- optional, list of language that will be disabled
|
||||
},
|
||||
highlight = {
|
||||
enable = true, -- false will disable the whole extension
|
||||
disable = { "markdown" },
|
||||
},
|
||||
context_commentstring = {
|
||||
enable = true,
|
||||
config = {
|
||||
css = '// %s'
|
||||
}
|
||||
},
|
||||
-- indent = {enable = true, disable = {"python", "html", "javascript"}},
|
||||
-- TODO seems to be broken
|
||||
indent = { enable = { "javascriptreact" } },
|
||||
autotag = { enable = true },
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
-- Make Ranger replace netrw and be the file explorer
|
||||
-- vim.g.rnvimr_ex_enable = 1
|
||||
vim.g.rnvimr_draw_border = 1
|
||||
vim.g.rnvimr_pick_enable = 1
|
||||
vim.g.rnvimr_bw_enable = 1
|
||||
vim.api.nvim_set_keymap('n', '-', ':RnvimrToggle<CR>', {noremap = true, silent = true})
|
||||
@@ -1 +0,0 @@
|
||||
require("symbols-outline").setup()
|
||||
@@ -1,81 +0,0 @@
|
||||
local actions = require('telescope.actions')
|
||||
local trouble = require("trouble.providers.telescope")
|
||||
-- Global remapping
|
||||
------------------------------
|
||||
-- '--color=never',
|
||||
require('telescope').setup {
|
||||
defaults = {
|
||||
--find_command = {'rg', '--no-heading', '--with-filename', '--line-number', '--column', '--smart-case'},
|
||||
vimgrep_arguments = { 'rg', '--color=never', '--no-heading', '--with-filename', '--line-number', '--column', '--smart-case' },
|
||||
-- prompt_prefix = " ",
|
||||
prompt_prefix = " ",
|
||||
selection_caret = " ",
|
||||
entry_prefix = " ",
|
||||
initial_mode = "insert",
|
||||
-- initial_mode = "insert",
|
||||
selection_strategy = "reset",
|
||||
sorting_strategy = "descending",
|
||||
layout_strategy = "horizontal",
|
||||
layout_config= {horizontal = {mirror = false}, vertical = {mirror = false}, width = 0.75,prompt_position = "bottom", preview_cutoff = 120},
|
||||
file_sorter = require'telescope.sorters'.get_fzy_sorter,
|
||||
file_ignore_patterns = {},
|
||||
generic_sorter = require'telescope.sorters'.get_generic_fuzzy_sorter,
|
||||
-- shorten_path = true,
|
||||
path_display = {shroten = 2},
|
||||
winblend = 0,
|
||||
border = {},
|
||||
borderchars = {'─', '│', '─', '│', '╭', '╮', '╯', '╰'},
|
||||
color_devicons = true,
|
||||
use_less = true,
|
||||
set_env = {['COLORTERM'] = 'truecolor'}, -- default = nil,
|
||||
file_previewer = require'telescope.previewers'.vim_buffer_cat.new,
|
||||
grep_previewer = require'telescope.previewers'.vim_buffer_vimgrep.new,
|
||||
qflist_previewer = require'telescope.previewers'.vim_buffer_qflist.new,
|
||||
|
||||
-- Developer configurations: Not meant for general override
|
||||
buffer_previewer_maker = require'telescope.previewers'.buffer_previewer_maker,
|
||||
mappings = {
|
||||
i = {
|
||||
["<C-c>"] = actions.close,
|
||||
["<ESC>"] = actions.close,
|
||||
["<C-j>"] = actions.move_selection_next,
|
||||
["<C-k>"] = actions.move_selection_previous,
|
||||
["<c-t>"] = trouble.open_with_trouble,
|
||||
["<C-q>"] = actions.smart_send_to_qflist + actions.open_qflist,
|
||||
-- To disable a keymap, put [map] = false
|
||||
-- So, to not map "<C-n>", just put
|
||||
-- ["<c-x>"] = false,
|
||||
-- ["<esc>"] = actions.close,
|
||||
|
||||
-- Otherwise, just set the mapping to the function that you want it to be.
|
||||
-- ["<C-i>"] = actions.select_horizontal,
|
||||
|
||||
-- Add up multiple actions
|
||||
["<CR>"] = actions.select_default + actions.center
|
||||
|
||||
-- You can perform as many actions in a row as you like
|
||||
-- ["<CR>"] = actions.select_default + actions.center + my_cool_custom_action,
|
||||
},
|
||||
n = {
|
||||
["<C-j>"] = actions.move_selection_next,
|
||||
["<C-k>"] = actions.move_selection_previous,
|
||||
["<c-t>"] = trouble.open_with_trouble,
|
||||
["<C-q>"] = actions.smart_send_to_qflist + actions.open_qflist
|
||||
-- ["<C-i>"] = my_cool_custom_action,
|
||||
}
|
||||
}
|
||||
},
|
||||
extensions = {
|
||||
fzf = {
|
||||
fuzzy = true, -- false will only do exact matching
|
||||
override_generic_sorter = true, -- override the generic sorter
|
||||
override_file_sorter = true, -- override the file sorter
|
||||
case_mode = "smart_case", -- or "ignore_case" or "respect_case"
|
||||
-- the default case_mode is "smart_case"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
--require('telescope').load_extension('fzf')
|
||||
require'telescope'.load_extension('project')
|
||||
require("telescope").load_extension "file_browser"
|
||||
@@ -1,50 +0,0 @@
|
||||
require("toggleterm").setup {
|
||||
-- size can be a number or function which is passed the current terminal
|
||||
size = function(term)
|
||||
if term.direction == "horizontal" then
|
||||
return 15
|
||||
elseif term.direction == "vertical" then
|
||||
return vim.o.columns * 0.4
|
||||
end
|
||||
end,
|
||||
open_mapping = [[<c-\>]],
|
||||
hide_numbers = true, -- hide the number column in toggleterm buffers
|
||||
shade_filetypes = {},
|
||||
shade_terminals = true,
|
||||
shading_factor = '1', -- the degree by which to darken to terminal colour, default: 1 for dark backgrounds, 3 for light
|
||||
start_in_insert = true,
|
||||
insert_mappings = true, -- whether or not the open mapping applies in insert mode
|
||||
persist_size = true,
|
||||
-- direction = 'vertical' | 'horizontal' | 'window' | 'float',
|
||||
direction = 'float',
|
||||
close_on_exit = true, -- close the terminal window when the process exits
|
||||
shell = vim.o.shell, -- change the default shell
|
||||
-- This field is only relevant if direction is set to 'float'
|
||||
float_opts = {
|
||||
-- The border key is *almost* the same as 'nvim_open_win'
|
||||
-- see :h nvim_open_win for details on borders however
|
||||
-- the 'curved' border is a custom border type
|
||||
-- not natively supported but implemented in this plugin.
|
||||
-- border = 'single' | 'double' | 'shadow' | 'curved' -- ... other options supported by win open
|
||||
border = 'single',
|
||||
-- width = <value>,
|
||||
-- height = <value>,
|
||||
winblend = 3,
|
||||
highlights = {
|
||||
border = "Normal",
|
||||
background = "Normal",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-- function _G.set_terminal_keymaps()
|
||||
-- local opts = {noremap = true}
|
||||
-- vim.api.nvim_buf_set_keymap(0, 't', '<esc>', [[<C-\><C-n>]], opts)
|
||||
-- vim.api.nvim_buf_set_keymap(0, 't', 'jk', [[<C-\><C-n>]], opts)
|
||||
-- vim.api.nvim_buf_set_keymap(0, 't', '<C-h>', [[<C-\><C-n><C-W>h]], opts)
|
||||
-- vim.api.nvim_buf_set_keymap(0, 't', '<C-j>', [[<C-\><C-n><C-W>j]], opts)
|
||||
-- vim.api.nvim_buf_set_keymap(0, 't', '<C-k>', [[<C-\><C-n><C-W>k]], opts)
|
||||
-- vim.api.nvim_buf_set_keymap(0, 't', '<C-l>', [[<C-\><C-n><C-W>l]], opts)
|
||||
-- end
|
||||
|
||||
-- vim.cmd('autocmd! TermOpen term://* lua set_terminal_keymaps()')
|
||||
@@ -1,2 +0,0 @@
|
||||
vim.g.matchup_matchparen_offscreen = {method = 'popup'}
|
||||
|
||||
@@ -1,250 +0,0 @@
|
||||
require("which-key").setup {
|
||||
plugins = {
|
||||
marks = true, -- shows a list of your marks on ' and `
|
||||
registers = true, -- shows your registers on " in NORMAL or <C-r> in INSERT mode
|
||||
-- the presets plugin, adds help for a bunch of default keybindings in Neovim
|
||||
-- No actual key bindings are created
|
||||
presets = {
|
||||
operators = false, -- adds help for operators like d, y, ...
|
||||
motions = false, -- adds help for motions
|
||||
text_objects = false, -- help for text objects triggered after entering an operator
|
||||
windows = true, -- default bindings on <c-w>
|
||||
nav = true, -- misc bindings to work with windows
|
||||
z = true, -- bindings for folds, spelling and others prefixed with z
|
||||
g = true -- bindings for prefixed with g
|
||||
}
|
||||
},
|
||||
icons = {
|
||||
breadcrumb = "»", -- symbol used in the command line area that shows your active key combo
|
||||
separator = "➜", -- symbol used between a key and it's label
|
||||
group = "+" -- symbol prepended to a group
|
||||
},
|
||||
window = {
|
||||
border = "single", -- none, single, double, shadow
|
||||
position = "bottom", -- bottom, top
|
||||
margin = { 1, 0, 1, 0 }, -- extra window margin [top, right, bottom, left]
|
||||
padding = { 2, 2, 2, 2 } -- extra window padding [top, right, bottom, left]
|
||||
},
|
||||
layout = {
|
||||
height = { min = 4, max = 25 }, -- min and max height of the columns
|
||||
width = { min = 20, max = 50 }, -- min and max width of the columns
|
||||
spacing = 3 -- spacing between columns
|
||||
},
|
||||
hidden = { "<silent>", "<cmd>", "<Cmd>", "<CR>", "call", "lua", "^:", "^ " }, -- hide mapping boilerplate
|
||||
show_help = true -- show help message on the command line when the popup is visible
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
-- Set leader
|
||||
vim.api.nvim_set_keymap('n', '<Space>', '<NOP>', { noremap = true, silent = true })
|
||||
vim.g.mapleader = ' '
|
||||
|
||||
-- no hl
|
||||
vim.api.nvim_set_keymap('n', '<Leader>h', ':set hlsearch!<CR>', { noremap = true, silent = true })
|
||||
|
||||
-- explorer
|
||||
vim.api.nvim_set_keymap('n', '<Leader>e', ':NvimTreeToggle<CR>', { noremap = true, silent = true })
|
||||
|
||||
-- telescope
|
||||
--vim.api.nvim_set_keymap('n', '<C-p>', ":lua require 'telescope'.extensions.file_browser.file_browser()<CR>", {noremap = true, silent = true})
|
||||
-- vim.api.nvim_set_keymap('n', '<C-p>', ":lua require'telescope.builtin'.find_files()<CR>", {noremap = true, silent = true})
|
||||
vim.api.nvim_set_keymap('n', '<C-p>', ":FzfLua files<CR>", { noremap = true, silent = true })
|
||||
|
||||
-- dashboard
|
||||
vim.api.nvim_set_keymap('n', '<Leader>;', ':Dashboard<CR>', { noremap = true, silent = true })
|
||||
|
||||
-- Comments
|
||||
vim.api.nvim_set_keymap("n", "<Leader>b/", ":CommentToggle<CR>", { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap("v", "<Leader>b/", ":CommentToggle<CR>", { noremap = true, silent = true })
|
||||
|
||||
-- close buffer
|
||||
vim.api.nvim_set_keymap("n", "<leader>c", ":BufferClose<CR>", { noremap = true, silent = true })
|
||||
|
||||
-- open projects
|
||||
--vim.api.nvim_set_keymap('n', '<leader>p', ":lua require'telescope'.extensions.project.project{}<CR>", {noremap = true, silent = true})
|
||||
-- vim.api.nvim_set_keymap('n', '<leader>p', ":lua require 'telescope'.extensions.file_browser.file_browser()<CR>", {noremap = true, silent = true})
|
||||
-- TODO create entire treesitter section
|
||||
|
||||
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",
|
||||
n = { "<cmd>BufferNext<cr>", "next buffer" },
|
||||
p = { "<cmd>BufferPrevious<cr>", "previous 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>Fzflua files<cr>", "Find File" },
|
||||
m = { "<cmd>Telescope marks<cr>", "Marks" },
|
||||
M = { "<cmd>Telescope man_pages<cr>", "Man Pages" },
|
||||
r = { "<cmd>FzfLua oldfiles<cr>", "Open Recent File" },
|
||||
R = { "<cmd>Telescope registers<cr>", "Registers" },
|
||||
t = { "<cmd>FzfLua 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)
|
||||
@@ -1,5 +1,6 @@
|
||||
return {
|
||||
{
|
||||
-- tabline
|
||||
'romgrk/barbar.nvim',
|
||||
dependencies = {
|
||||
'lewis6991/gitsigns.nvim', -- OPTIONAL: for git status
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
return {
|
||||
-- for format
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
opts = {
|
||||
formatters_by_ft = {
|
||||
go = { "gofmt"},
|
||||
go = { "goimports"},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
return {
|
||||
{
|
||||
'nvimdev/lspsaga.nvim',
|
||||
config = function()
|
||||
require('lspsaga').setup({})
|
||||
end,
|
||||
dependencies = {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
'nvim-tree/nvim-web-devicons' -- optional
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -75,7 +75,8 @@ end
|
||||
|
||||
return {
|
||||
{
|
||||
"nvim-cmp",
|
||||
"hrsh7th/nvim-cmp",
|
||||
enable = false,
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-emoji",
|
||||
'hrsh7th/vim-vsnip',
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
return {
|
||||
"leoluz/nvim-dap-go",
|
||||
keys = {
|
||||
{ "<F5>", function() require("dap").continue({ before = get_args }) end, desc = "Run with Args" },
|
||||
{ "<F6>",":lua require('dap-go').debug_test()<cr>", desc = "Debug Test" },
|
||||
{ "<F9>", function() require("dap").toggle_breakpoint() end, desc = "Toggle Breakpoint" },
|
||||
{ "<F10>", function() require("dap").step_over() end, desc = "Step Over" },
|
||||
{ "<F11>", function() require("dap").step_into() end, desc = "Step Into" },
|
||||
{ "<S-F11>", function() require("dap").step_out() end, desc = "Step Out" },
|
||||
}
|
||||
}
|
||||
@@ -117,7 +117,6 @@ return {
|
||||
},
|
||||
},
|
||||
gopls = {
|
||||
setup = {
|
||||
cmd = { "gopls", "serve" }, -- use cmd in path, I can update it easily
|
||||
settings = {
|
||||
gopls = {
|
||||
@@ -127,13 +126,24 @@ return {
|
||||
unusedwrite = true,
|
||||
useany = true,
|
||||
},
|
||||
staticcheck = false
|
||||
staticcheck = false,
|
||||
usePlaceholders = false,
|
||||
}
|
||||
},
|
||||
root_dir = require 'lspconfig'.util.root_pattern(".git", "go.mod", "go.work"),
|
||||
init_options = { usePlaceholders = true, completeUnimported = true },
|
||||
},
|
||||
pylsp = {
|
||||
cmd = { "pylyzer", "--server" },
|
||||
filetypes = { "python" },
|
||||
settings = {
|
||||
python = {
|
||||
checkOnType = false,
|
||||
diagnostics = false,
|
||||
inlayHints = true,
|
||||
smartCompletion = true
|
||||
}
|
||||
},
|
||||
single_file_support = true,
|
||||
}
|
||||
},
|
||||
setup = {},
|
||||
},
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
#!/bin/bash
|
||||
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
docker system prune -a
|
||||
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
cd ~/Downloads/
|
||||
wget https://github.com/tonsky/FiraCode/releases/download/6.2/Fira_Code_v6.2.zip
|
||||
|
||||
echo '1. unzip Fira_Code_v6.2.zip'
|
||||
echo '2. select all file and install it'
|
||||
|
||||
open ~/Downloads/
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo /usr/local/bin/fish | sudo tee -a /etc/shells
|
||||
chsh -s /usr/local/bin/fish
|
||||
Reference in New Issue
Block a user