aboutsummaryrefslogtreecommitdiffhomepage
path: root/vim/mini.lua
diff options
context:
space:
mode:
authorHsieh Chin Fan <pham@topo.tw>2024-08-05 18:41:51 +0800
committerHsieh Chin Fan <pham@topo.tw>2024-08-05 18:41:51 +0800
commitb57c461014f585655d897abf0e0ac982807396b7 (patch)
treed3b10761cb75d52ff41b0822bc646c9d1c08d935 /vim/mini.lua
parentcc96870ff94afba7b0f2dc18f0209611ff7201f7 (diff)
Update
Diffstat (limited to 'vim/mini.lua')
-rw-r--r--vim/mini.lua212
1 files changed, 133 insertions, 79 deletions
diff --git a/vim/mini.lua b/vim/mini.lua
index 1b5507d..8a19d63 100644
--- a/vim/mini.lua
+++ b/vim/mini.lua
@@ -325,20 +325,30 @@ require("mini.pairs").setup()
325-- -- suda {{{ 325-- -- suda {{{
326-- add { source = "lambdalisue/suda.vim" } 326-- add { source = "lambdalisue/suda.vim" }
327-- }}} 327-- }}}
328-- -- true-zen {{{
329-- Add({
330-- source = "Pocco81/true-zen.nvim",
331-- })
332-- vim.keymap.set("n", "<leader>z", ":TZAtaraxis<CR>")
333-- -- }}}
334-- marks.nvim {{{ 328-- marks.nvim {{{
335Add { 329Add {
336 source = "chentoast/marks.nvim" 330 source = "chentoast/marks.nvim"
337} 331}
338require('marks').setup { 332require('marks').setup {
333 bookmark_0 = {
334 sign = "⚑",
335 virt_text = "hello world",
336 -- explicitly prompt for a virtual line annotation when setting a bookmark from this group.
337 -- defaults to false.
338 annotate = false,
339 },
339} 340}
340vim.cmd("hi MarkSignHL gui=bold guifg=#f85e84 guibg=#37343a") 341vim.cmd("hi MarkSignHL gui=bold guifg=#f85e84 guibg=#37343a")
341-- }}} 342-- }}}
343-- highlight-match-under-cursor {{{
344Add {
345 source = "adamheins/vim-highlight-match-under-cursor"
346}
347-- }}}
348Add {
349 source ='shime/vim-livedown'
350}
351
342 352
343-- Install Lazy {{{ 353-- Install Lazy {{{
344-- Bootstrap lazy.nvim 354-- Bootstrap lazy.nvim
@@ -513,7 +523,9 @@ require("lazy").setup({
513 end, 523 end,
514 config = function() 524 config = function()
515 require('lualine').setup(opts) 525 require('lualine').setup(opts)
516 vim.cmd('set laststatus=0') 526 if vim.o.lines < 20 then
527 vim.o.laststatus=0
528 end
517 end 529 end
518 }, 530 },
519 -- }}} 531 -- }}}
@@ -826,7 +838,7 @@ require("lazy").setup({
826 persist_size = false, 838 persist_size = false,
827 direction = "float", 839 direction = "float",
828 }) 840 })
829 -- 841
830 vim.keymap.set({ "n", "t" }, "<A-i>", function() 842 vim.keymap.set({ "n", "t" }, "<A-i>", function()
831 vim.cmd("ToggleTerm direction=float") 843 vim.cmd("ToggleTerm direction=float")
832 end, { desc = "terminal toggle floating term" }) 844 end, { desc = "terminal toggle floating term" })
@@ -836,6 +848,10 @@ require("lazy").setup({
836 vim.keymap.set({ "n", "t" }, "<A-v>", function() 848 vim.keymap.set({ "n", "t" }, "<A-v>", function()
837 vim.cmd("ToggleTerm direction=horizontal") 849 vim.cmd("ToggleTerm direction=horizontal")
838 end, { desc = "terminal toggle floating term" }) 850 end, { desc = "terminal toggle floating term" })
851 vim.keymap.set("v", ",s", function()
852 require("toggleterm").send_lines_to_terminal("single_line", trim_spaces, { args = vim.v.count })
853 vim.cmd("ToggleTerm direction=float")
854 end)
839 end, 855 end,
840 }, 856 },
841 --}}} 857 --}}}
@@ -945,68 +961,89 @@ require("lazy").setup({
945 end, 961 end,
946 }, 962 },
947-- }}} 963-- }}}
948 964 -- -- markview.nvim {{{
949 -- -- lspconfig {{{
950 -- -- Use :help lspconfig-all to check servers
951 -- { 965 -- {
952 -- "neovim/nvim-lspconfig", 966 -- "OXY2DEV/markview.nvim",
953 -- lazy = false, 967 -- enable = false,
954 -- config = function() 968 -- ft = "markdown",
955 -- local lspconfig = require "lspconfig" 969 --
956 -- --
957 -- -- typescript
958 -- lspconfig.lua_ls.setup {}
959 -- lspconfig.tsserver.setup {}
960 -- lspconfig.vimls.setup {}
961 -- lspconfig.html.setup {}
962 -- --
963 -- vim.keymap.set("n", "<leader>F", function()
964 -- vim.lsp.buf.format()
965 -- end, { desc = "format files" })
966 -- end,
967 -- },
968 -- -- }}}
969 -- -- Mason {{{
970 -- {
971 -- "williamboman/mason.nvim",
972 -- dependencies = { 970 -- dependencies = {
973 -- "williamboman/mason-lspconfig.nvim", 971 -- -- You may not need this if you don't lazy load
972 -- -- Or if the parsers are in your $RUNTIMEPATH
973 -- "nvim-treesitter/nvim-treesitter",
974 --
975 -- "nvim-tree/nvim-web-devicons"
974 -- }, 976 -- },
975 -- config = function() 977 -- },-- }}}
976 -- require('mason').setup { 978
977 -- automatically_installation = true, 979 -- lspconfig {{{
978 -- ensure_installed = { 980 -- Use :help lspconfig-all to check servers
979 -- "vim-language-server", 981 {
980 -- "lua-language-server", 982 "neovim/nvim-lspconfig",
981 -- "css-lsp", 983 lazy = false,
982 -- "html-lsp", 984 config = function()
983 -- "prettier", 985 local lspconfig = require "lspconfig"
984 -- "stylua", 986 --
985 -- }, 987 -- typescript
986 -- } 988 lspconfig.lua_ls.setup {}
987 -- end 989 lspconfig.tsserver.setup {}
988 -- }, 990 lspconfig.vimls.setup {}
989 -- -- }}} 991 lspconfig.html.setup {}
990 -- -- treesitter {{{ 992 --
991 -- { 993 vim.keymap.set("n", "<leader>F", function()
992 -- "nvim-treesitter/nvim-treesitter", 994 vim.lsp.buf.format()
993 -- event = { "BufReadPost", "BufNewFile" }, 995 end, { desc = "format files" })
994 -- cmd = { "TSInstall", "TSBufEnable", "TSBufDisable", "TSModuleInfo" }, 996 end,
995 -- build = ":TSUpdate", 997 },
996 -- config = function() 998 -- }}}
997 -- require("nvim-treesitter.configs").setup({ 999 -- Mason {{{
998 -- ensure_installed = { "lua", "luadoc", "printf", "vim", "vimdoc" }, 1000 {
999 -- -- 1001 "williamboman/mason.nvim",
1000 -- highlight = { 1002 dependencies = {
1001 -- enable = true, 1003 "williamboman/mason-lspconfig.nvim",
1002 -- use_languagetree = true, 1004 },
1003 -- }, 1005 config = function()
1004 -- -- 1006 require('mason').setup {
1005 -- indent = { enable = true }, 1007 automatically_installation = true,
1006 -- }) 1008 ensure_installed = {
1007 -- end, 1009 "vim-language-server",
1008 -- }, 1010 "lua-language-server",
1009 -- -- }}} 1011 "css-lsp",
1012 "html-lsp",
1013 "prettier",
1014 "stylua",
1015 },
1016 }
1017 end
1018 },
1019 -- }}}
1020 -- treesitter {{{
1021 {
1022 "nvim-treesitter/nvim-treesitter",
1023 event = { "BufReadPost", "BufNewFile" },
1024 cmd = { "TSInstall", "TSBufEnable", "TSBufDisable", "TSModuleInfo" },
1025 build = ":TSUpdate",
1026 config = function()
1027 require("nvim-treesitter.configs").setup({
1028 ensure_installed = { "markdown", "markdown_inline", "lua", "luadoc", "printf", "vim", "vimdoc" },
1029
1030 highlight = {
1031 enable = true,
1032 use_languagetree = true,
1033 additional_vim_regex_highlighting = true,
1034 },
1035
1036 indent = { enable = true },
1037 })
1038 vim.cmd([[
1039 syn match MarkdownHtmlDetails '^<details>' conceal cchar=▶
1040 syn match MarkdownHtmlSummary '<summary>' conceal cchar=
1041 syn match MarkdownHtmlSummaryEnd '</summary>' conceal
1042 syn match MarkdownHtmlDetailsEnd '^</details>' conceal cchar=E
1043 ]])
1044 end,
1045 },
1046 -- }}}
1010 -- nvim-cmp {{{ 1047 -- nvim-cmp {{{
1011 { 1048 {
1012 "hrsh7th/nvim-cmp", 1049 "hrsh7th/nvim-cmp",
@@ -1133,18 +1170,35 @@ require("lazy").setup({
1133 }, 1170 },
1134 1171
1135 -- }}} 1172 -- }}}
1136 -- -- lspsaga {{{ 1173 -- lspsaga {{{
1137 -- { 1174 {
1138 -- 'nvimdev/lspsaga.nvim', 1175 'nvimdev/lspsaga.nvim',
1139 -- dependencies = { 1176 dependencies = {
1140 -- 'nvim-treesitter/nvim-treesitter', -- optional 1177 'nvim-treesitter/nvim-treesitter', -- optional
1141 -- 'nvim-tree/nvim-web-devicons', -- optional 1178 'nvim-tree/nvim-web-devicons', -- optional
1142 -- }, 1179 },
1143 -- config = function() 1180 config = function()
1144 -- require('lspsaga').setup({}) 1181 require('lspsaga').setup({
1145 -- end, 1182 autochdir = true,
1146 -- }, 1183 })
1147 -- -- }}} 1184 vim.api.nvim_create_autocmd("LspAttach", {
1185 group = custom_autocommands,
1186 pattern = "*",
1187 callback = function(args)
1188 local map = vim.api.nvim_buf_set_keymap
1189 map(0, "n", "gd", "<cmd>Lspsaga goto_definition<cr>", {silent = true, noremap = true})
1190 map(0, "n", "gr", "<cmd>Lspsaga rename<cr>", {silent = true, noremap = true})
1191 map(0, "n", "gx", "<cmd>Lspsaga code_action<cr>", {silent = true, noremap = true})
1192 map(0, "x", "gx", ":<c-u>Lspsaga range_code_action<cr>", {silent = true, noremap = true})
1193 map(0, "n", "K", "<cmd>Lspsaga hover_doc<cr>", {silent = true, noremap = true})
1194 map(0, "n", "go", "<cmd>Lspsaga show_line_diagnostics<cr>", {silent = true, noremap = true})
1195 map(0, "n", "gj", "<cmd>Lspsaga diagnostic_jump_next<cr>", {silent = true, noremap = true})
1196 map(0, "n", "gk", "<cmd>Lspsaga diagnostic_jump_prev<cr>", {silent = true, noremap = true})
1197 end,
1198 })
1199 end
1200 },
1201 -- }}}
1148 -- -- conform {{{ 1202 -- -- conform {{{
1149 -- { 1203 -- {
1150 -- "stevearc/conform.nvim", 1204 -- "stevearc/conform.nvim",