uConfig.lua 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. local M = {
  2. config_path = vim.fn.stdpath("config"),
  3. keys = {
  4. leader_key = " ",
  5. -- : 模式
  6. c_next_item = "<C-j>",
  7. c_prev_item = "<C-k>",
  8. -- normal 模式
  9. n_save = "<leader>w", -- :w
  10. n_save_quit = "<leader>wq", --:wq
  11. n_save_all = "<leader>wa", -- :wa
  12. -- n_save_all_quit = "<leader>qa", -- :wqa
  13. n_force_quit = "<leader>q", -- :qa!
  14. n_v_5j = "<C-j>",
  15. n_v_5k = "<C-k>",
  16. n_v_10k = "<C-u>",
  17. n_v_10j = "<C-d>",
  18. -- cmp 快捷键
  19. cmp_complete = "<A-.>",
  20. cmp_abort = "<A-,>",
  21. cmp_confirm = "<CR>",
  22. cmp_scroll_doc_up = "<C-u>",
  23. cmp_scroll_doc_down = "<C-d>",
  24. cmp_select_prev_item = "<C-k>",
  25. cmp_select_next_item = "<C-j>",
  26. -- luasnip
  27. snip_jump_next = "<C-l>",
  28. snip_jump_prev = "<C-h>",
  29. snip_next_choice = "<C-j>",
  30. snip_prev_choice = "<C-k>",
  31. s_windows = {
  32. enable = true,
  33. -- 窗口开关
  34. split_vertically = "sv",
  35. split_horizontally = "sh",
  36. close = "sc",
  37. close_others = "so",
  38. -- 窗口跳转
  39. jump_left = "<A-h>",
  40. jump_right = "<A-l>",
  41. jump_up = "<A-k>",
  42. jump_down = "<A-j>",
  43. -- <leader> + hjkl 窗口之间跳转
  44. -- jump_left = "<leader>h",
  45. -- jump_right = "<leader>j",
  46. -- jump_up = "<leader>k",
  47. -- jump_down = "<leader>l",
  48. -- 窗口比例控制
  49. width_decrease = "s,",
  50. width_increase = "s.",
  51. height_decrease = "sj",
  52. height_increase = "sk",
  53. size_equal = "s=",
  54. },
  55. s_tab = {
  56. split = "ts",
  57. prev = "th",
  58. next = "tl",
  59. first = "tj",
  60. last = "tk",
  61. close = "tc",
  62. },
  63. fold = {
  64. open = "Z",
  65. close = "zz",
  66. },
  67. format = "<leader>f",
  68. terminal_to_normal = "<Esc>",
  69. -- TODO
  70. -- proxy
  71. -- im-select
  72. },
  73. enable_magic_search = true,
  74. nvimTree = {
  75. enable = true,
  76. toggle = "<A-m>",
  77. -- toggle = "<leader>m"
  78. edit = { "o", "<2-LeftMouse>" },
  79. system_open = "<CR>",
  80. -- v分屏打开文件
  81. vsplit = "sv",
  82. -- h分屏打开文件
  83. split = "sh",
  84. -- toggle .gitignore (git enable)
  85. toggle_git_ignored = "i",
  86. -- Hide (dotfiles)
  87. toggle_dotfiles = ".",
  88. -- togglle custom config
  89. toggle_custom = "u",
  90. refresh = "R",
  91. -- 文件操作
  92. create = "a",
  93. remove = "d",
  94. rename = "r",
  95. cut = "x",
  96. copy = "c",
  97. paste = "p",
  98. copy_name = "y",
  99. copy_path = "Y",
  100. copy_absolute_path = "gy",
  101. toggle_file_info = "I",
  102. tabnew = "t",
  103. -- 进入下一级
  104. cd = "]",
  105. -- 进入上一级
  106. dir_up = "[",
  107. },
  108. bufferLine = {
  109. enable = true,
  110. prev = "<C-h>",
  111. next = "<C-l>",
  112. close = "<C-w>",
  113. -- close = "<leader>bc",
  114. close_left = "<leader>bh",
  115. close_right = "<leader>bl",
  116. close_others = "<leader>bo",
  117. close_pick = "<leader>bp",
  118. },
  119. telescope = {
  120. enable = true,
  121. find_files = "<C-p>",
  122. live_grep = "<C-f>",
  123. -- 上下移动
  124. move_selection_next = "<C-j>",
  125. move_selection_previous = "<C-k>",
  126. -- move_selection_next = "<C-n>",
  127. -- move_selection_previous = "<C-p>",
  128. -- 历史记录
  129. cycle_history_next = "<Down>",
  130. cycle_history_prev = "<Up>",
  131. -- 关闭窗口
  132. -- close = "<C-c>",
  133. close = "<esc>",
  134. -- 预览窗口上下滚动
  135. preview_scrolling_up = "<C-u>",
  136. preview_scrolling_down = "<C-d>",
  137. },
  138. mkdnflow = {
  139. enable = true,
  140. next_link = "gn",
  141. prev_link = "gp",
  142. next_heading = "gj",
  143. prev_heading = "gk",
  144. go_back = "<C-o>",
  145. follow_link = "gd",
  146. toggle_item = "tt",
  147. },
  148. comment = {
  149. enable = true,
  150. -- Normal 模式快捷键
  151. toggler = {
  152. line = "gcc", -- 行注释
  153. block = "gbc", -- 块注释
  154. },
  155. -- Visual 模式
  156. opleader = {
  157. line = "gc",
  158. bock = "gb",
  159. },
  160. },
  161. toggleterm = {
  162. enable = true,
  163. -- <leader>ta 浮动命令行窗口
  164. toggle_window_A = "<leader>ta",
  165. -- <leader>tb 右侧命令行窗口
  166. toggle_window_B = "<leader>tb",
  167. -- <leader>tc 下方命令行窗口
  168. toggle_window_C = "<leader>tc",
  169. },
  170. venn = {
  171. -- toggle keymappings for venn using <leader>v
  172. enable = true,
  173. -- venn.nvim: enable or disable keymappings
  174. toggle = "<leader>v",
  175. -- draw a box by pressing "f" with visual selection
  176. draw_box = "f",
  177. },
  178. zen = {
  179. enable = true,
  180. toggle = "<leader>z",
  181. },
  182. lsp = {
  183. rename = "<leader>rn",
  184. code_action = "<leader>ca",
  185. format = "<leader>f",
  186. definition = "gd",
  187. references = "gr",
  188. hover = "gh",
  189. -- diagnostic
  190. open_flow = "gp",
  191. goto_next = "gj",
  192. goto_prev = "gk",
  193. -- typescript
  194. ts_organize = "gs",
  195. ts_rename_file = "gR",
  196. ts_add_missing_import = "gi",
  197. ts_remove_unused = "gu",
  198. ts_fix_all = "gf",
  199. ts_goto_source = "gD",
  200. },
  201. }
  202. return M