1
Fork 0
This commit is contained in:
Matei Adriel 2022-12-09 02:32:25 +01:00
parent 811660e30a
commit 01e4fe7095
22 changed files with 102 additions and 122 deletions

View file

@ -0,0 +1,4 @@
{
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
"Lua.workspace.checkThirdParty": false
}

View file

@ -1,14 +1,14 @@
local M = {}
local function swap(key)
vim.keymap.set("n", key, "g" .. key, { buffer = true })
vim.keymap.set("n", "g" .. key, key, { buffer = true })
vim.keymap.set("nv", key, "g" .. key, { buffer = true })
vim.keymap.set("nv", "g" .. key, key, { buffer = true })
end
-- Same as swap, but the key is aprt of an arpeggio chord
local function swapArpeggio(key)
vim.keymap.set("n", "<Plug>(arpeggio-default:" .. key .. ")", "g" .. key, { buffer = true })
vim.keymap.set("n", "g" .. key, key, { buffer = true })
vim.keymap.set("nv", "<Plug>(arpeggio-default:" .. key .. ")", "g" .. key, { buffer = true })
vim.keymap.set("nv", "g" .. key, key, { buffer = true })
end
function M.setup()

View file

@ -34,25 +34,27 @@ function M.delimitedTextobject(from, to, name, perhapsOpts)
end
function M.setup()
-- I rarely use macro stuff
M.move("q", "yq", { desc = "Record macro" })
M.move("Q", "yQ")
-- Free these up for easymotion-style plugins
-- vim.keymap.set("n", "s", "<Nop>")
-- vim.keymap.set("n", "S", "<Nop>")
M.move("<C-^>", "<Leader>a", { desc = "Go to previous file" })
vim.keymap.set({ "n", "v" }, "qn", function()
vim.keymap.set({ "n", "v" }, "<leader>q", function()
local buf = vim.api.nvim_win_get_buf(0)
-- Only save if file is writable
if vim.bo[buf].modifiable and not vim.bo[buf].readonly then
vim.cmd [[write]]
end
if vim.bo[buf].modifiable and not vim.bo[buf].readonly then vim.cmd [[write]] end
vim.cmd "q"
end, { desc = "Quit current buffer" })
vim.keymap.set("n", "Q", ":wqa<cr>", { desc = "Save all files and quit" })
vim.keymap.set("n", "<leader>rw", ":%s/<C-r><C-w>/", {
desc = "Replace word in file"
})
vim.keymap.set("n", "<leader>rw", ":%s/<C-r><C-w>/", { desc = "Replace word in file" })
M.delimitedTextobject("q", '"', "quotes")
M.delimitedTextobject("a", "'", "'")
@ -70,18 +72,10 @@ function M.setup()
if status then
wk.register({
["<leader>"] = {
f = {
name = "Files"
},
g = {
name = "Go to"
},
r = {
name = "Rename / Replace / Reload"
},
["<leader>"] = {
name = "Easymotion"
},
f = { name = "Files" },
g = { name = "Go to" },
r = { name = "Rename / Replace / Reload" },
l = { name = "Local" },
v = "which_key_ignore"
}
})

View file

@ -38,9 +38,10 @@ function M.setup()
"saadparwaiz1/cmp_luasnip", -- snippet support for cmp
"wakatime/vim-wakatime", -- track time usage
"vmchale/dhall-vim", -- dhall syntax highlighting
-- "folke/which-key.nvim", -- shows what other keys I can press to finish a command
"folke/which-key.nvim", -- shows what other keys I can press to finish a command
{ "psliwka/vim-smoothie", opt = true }, -- smooth scrolling
"easymotion/vim-easymotion", -- removes the need for spamming w or e
-- "easymotion/vim-easymotion", -- removes the need for spamming w or e
"ggandor/leap.nvim", -- removes the need for spamming w or e
"tpope/vim-surround", -- work with brackets, quotes, tags, etc
"MunifTanjim/nui.nvim", -- ui stuff required by idris2
"ShinKage/idris2-nvim", -- idris2 support

View file

@ -1,20 +0,0 @@
local M = {}
function M.setup()
local opts = function(desc)
return { desc = desc, silent = true }
end
local modes = { "n", "v", "o" }
vim.keymap.set(modes, "qf", "<Plug>(easymotion-bd-f)", opts("Hop to char"))
vim.keymap.set(modes, "qj", "<Plug>(easymotion-overwin-f2)", opts("Hop to char pair"))
vim.keymap.set(modes, "qw", "<Plug>(easymotion-bd-w)", opts("Hop to word"))
vim.keymap.set(modes, "qL", "<Plug>(easymotion-bd-L)", opts("Hop to line (?)"))
local status, wk = pcall(require, "which-key")
if status then wk.register({ q = { name = "Easymotion" } }, { mode = "o" }) end
end
return M

View file

@ -6,7 +6,6 @@ function M.setup()
require('fidget').setup()
require('dressing').setup()
require("my.plugins.easymotion").setup()
require("my.plugins.autopairs").setup()
require("my.plugins.telescope").setup()
require("my.plugins.surround").setup()
@ -49,6 +48,7 @@ function M.setup()
require("my.plugins.paperplanes").setup()
end
require("my.plugins.leap").setup()
require("my.plugins.hydra").setup()
require("my.plugins.clipboard-image").setup()
require("my.plugins.mind").setup()

View file

@ -0,0 +1,10 @@
local M = {}
function M.setup()
require("leap").add_default_mappings()
end
-- (something)
-- something
return M

View file

@ -1,9 +1,18 @@
local M = {}
function M.setup()
vim.g.neovide_floating_blur_amount_x = 2.0
vim.g.neovide_floating_blur_amount_y = 2.0
-- vim.g.neovide_transparency = 0.8
-- vim.g.neovide_floating_blur_amount_x = 3.0
-- vim.g.neovide_floating_blur_amount_y = 3.0
-- vim.g.neovide_transparency = 1.0
-- vim.g.pumblend = 30
-- vim.api.nvim_create_autocmd("WinEnter", {
-- group = vim.api.nvim_create_augroup("Setup transparency", {}),
-- pattern = "*",
-- callback = function()
-- vim.wo.winblend = 30
-- end
-- })
end
return M

View file

@ -19,17 +19,13 @@ local keybinds = {
{ "<Leader>fp", find_files_by_extension("purs"), "Find purescript files" },
{ "<Leader>d", "diagnostics", "Diagnostics" },
{ "<C-F>", "live_grep", "Search in project" },
{ "<Leader>t", "builtin", "Show builtin pickers" },
{ "<Leader>t", "builtin", "Show builtin pickers" }
}
local chords = {
{ "jp", "file_browser" }
}
local chords = { { "jp", "file_browser" } }
local function mkAction(action)
if not string.find(action, "theme=") then
action = with_theme(action, defaultTheme)
end
if not string.find(action, "theme=") then action = with_theme(action, defaultTheme) end
return ":Telescope " .. action .. "<cr>"
end
@ -39,9 +35,7 @@ local function setupKeybinds()
vim.keymap.set("n", mapping[1], mkAction(mapping[2]), { desc = mapping[3] })
end
for _, mapping in pairs(chords) do
arpeggio.chord("n", mapping[1], mkAction(mapping[2]))
end
for _, mapping in pairs(chords) do arpeggio.chord("n", mapping[1], mkAction(mapping[2])) end
end
function M.setup()
@ -50,11 +44,7 @@ function M.setup()
local settings = {
defaults = { mappings = { i = { ["<C-h>"] = "which_key" } } },
pickers = { find_files = { hidden = true } },
extensions = {
file_browser = {
path = "%:p:h"
}
}
extensions = { file_browser = { path = "%:p:h" } }
}
require("telescope").setup(settings)

View file

@ -4,7 +4,8 @@ local M = {}
function M.setup()
wk.setup({
triggers = { "<leader>", "d", "y", "q", "z", "g", "c" },
-- triggers = { "<leader>", "d", "y", "q", "z", "g", "c" },
triggers = {},
show_help = false,
show_keys = false
})