aboutsummaryrefslogtreecommitdiff
path: root/lua/config
diff options
context:
space:
mode:
Diffstat (limited to 'lua/config')
-rw-r--r--lua/config/smoothcursor.lua30
-rw-r--r--lua/config/whichkey.lua64
2 files changed, 94 insertions, 0 deletions
diff --git a/lua/config/smoothcursor.lua b/lua/config/smoothcursor.lua
new file mode 100644
index 0000000..9c8927e
--- /dev/null
+++ b/lua/config/smoothcursor.lua
@@ -0,0 +1,30 @@
+require('smoothcursor').setup({
+ autostart = true,
+ cursor = "", -- cursor shape (need nerd font)
+ texthl = "SmoothCursor", -- highlight group, default is { bg = nil, fg = "#FFD400" }
+ linehl = nil, -- highlight sub-cursor line like 'cursorline', "CursorLine" recommended
+ type = "default", -- define cursor movement calculate function, "default" or "exp" (exponential).
+ fancy = {
+ enable = false, -- enable fancy mode
+ head = { cursor = "▷", texthl = "SmoothCursor", linehl = nil },
+ body = {
+ { cursor = "", texthl = "SmoothCursorRed" },
+ { cursor = "", texthl = "SmoothCursorOrange" },
+ { cursor = "●", texthl = "SmoothCursorYellow" },
+ { cursor = "●", texthl = "SmoothCursorGreen" },
+ { cursor = "•", texthl = "SmoothCursorAqua" },
+ { cursor = ".", texthl = "SmoothCursorBlue" },
+ { cursor = ".", texthl = "SmoothCursorPurple" },
+ },
+ tail = { cursor = nil, texthl = "SmoothCursor" }
+ },
+ flyin_effect = nil, -- "bottom" or "top"
+ speed = 25, -- max is 100 to stick to your current position
+ intervals = 35, -- tick interval
+ priority = 10, -- set marker priority
+ timeout = 3000, -- timout for animation
+ threshold = 3, -- animate if threshold lines jump
+ disable_float_win = false, -- disable on float window
+ enabled_filetypes = nil, -- example: { "lua", "vim" }
+ disabled_filetypes = nil, -- this option will be skipped if enabled_filetypes is set. example: { "TelescopePrompt", "NvimTree" }
+})
diff --git a/lua/config/whichkey.lua b/lua/config/whichkey.lua
new file mode 100644
index 0000000..2fb572f
--- /dev/null
+++ b/lua/config/whichkey.lua
@@ -0,0 +1,64 @@
+local M = {}
+
+function M.setup()
+ local whichkey = require "which-key"
+
+ local conf = {
+ window = {
+ border = "single", -- none, single, double, shadow
+ position = "bottom", -- bottom, top
+ },
+ }
+
+ local opts = {
+ mode = {"n", "v"}, -- Normal mode
+ prefix = " ",
+ buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings
+ silent = true, -- use `silent` when creating keymaps
+ noremap = true, -- use `noremap` when creating keymaps
+ nowait = true, -- use `nowait` when creating keymaps
+ }
+
+ local mappings = {
+ --["w"] = { "<cmd>update!<CR>", "Save" },
+ ["f"] = { "<cmd>Neotree<CR>", "fs"},
+ ["t"] = { "<cmd>UndotreeToggle<CR>", "clip tree"},
+ ["e"] = { "<cmd>TroubleToggle<CR>", "errors" },
+ ["g"] = {
+ name = "'games'",
+ ["q"] = { "<cmd>KillKillKill<CR>", "killer sheep" },
+ ["w"] = { "<cmd>Nvimesweeper<CR>", "minesweeper" },
+ ["e"] = { "<cmd>CellularAutomaton make_it_rain<CR>", "c_a make it rain" },
+ ["r"] = { "<cmd>CellularAutomaton game_of_life<CR>", "c_a conway gol" },
+ ["t"] = { "<cmd>Tetris<CR>", "tetris" },
+ ["y"] = { "<cmd>ShenzhenSolitaireNewGame<CR>", "solitaire" },
+ ["u"] = { "<cmd>BlackJackNewGame<CR>", "blackjack" },
+ ["i"] = { "<cmd>lua require('sudoku').setup{}<CR><cmd>Sudoku<CR>", "sudoku" },
+ },
+ ["n"] = {
+ name = "sci",
+ ["i"] = { "<cmd>lua require('nabla').toggle_virt({autogen=true})<CR>", "toggle" },
+ },
+ ["q"] = {
+ name = "quick chords",
+ ["l"] = { "0v$", "line" },
+ ["s"] = { "\"+y", "system grab" },
+ },
+ ["z"] = {
+ 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" },
+ },
+
+ }
+
+ whichkey.setup(conf)
+ whichkey.register(mappings, opts)
+end
+
+return M
+
+