1
Fork 0
This commit is contained in:
Matei Adriel 2022-11-14 01:16:10 +01:00
parent 7c61e64fa8
commit 01ee066c62
20 changed files with 182 additions and 657 deletions

View file

@ -2,25 +2,19 @@ local M = {}
function M.setup()
local opts = function(desc)
return {
desc = desc,
silent = true
}
return { desc = desc, silent = true }
end
vim.keymap.set({ "n", "v", "o" }, "qf", "<Plug>(easymotion-bd-f)", opts("Hop to char"))
vim.keymap.set({ "n", "v", "o" }, "qj", "<Plug>(easymotion-overwin-f2)", opts("Hop to char pair"))
vim.keymap.set({ "n", "v", "o" }, "qw", ":silent <Plug>(easymotion-bd-w)", opts("Hop to word"))
vim.keymap.set({ "n", "v", "o" }, "qL", "silent <Plug>(easymotion-bd-L)", opts("Hop to line (?)"))
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"
}
})
end
if status then wk.register({ q = { name = "Easymotion" } }, { mode = "o" }) end
end
return M

View file

@ -8,8 +8,6 @@ function M.setup()
}
}
}
print("Initialized firenvim")
end
return M

View file

@ -23,8 +23,8 @@ function M.setup()
for key, value in pairs(idrisChords) do
arpeggio.chord("n", "i" .. key,
":lua require('idris2.code_action')." ..
value .. "()<CR>", { settings = "b" })
":lua require('idris2.code_action')." .. value .. "()<CR>",
{ settings = "b" })
end
end
},

View file

@ -21,6 +21,7 @@ function M.setup()
require("toggleterm").setup()
require("my.plugins.neogit").setup()
require("my.plugins.noice").setup()
end)
require("my.plugins.dashboard").setup()
@ -31,6 +32,7 @@ function M.setup()
require("my.plugins.null-ls").setup()
require("my.plugins.vimtex").setup()
require("my.plugins.lean").setup()
require("my.plugins.notify").setup()
end)
if env.firevim.active() then
@ -40,7 +42,6 @@ function M.setup()
require("my.plugins.paperplanes").setup()
end
require("my.plugins.hydra").setup()
require("my.plugins.clipboard-image").setup()
require("my.plugins.mind").setup()

View file

@ -4,10 +4,7 @@ function M.on_attach(client, bufnr)
-- Enable completion triggered by <c-x><c-o>
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
if client.server_capabilities.documentFormattingProvider then
print("Initializing formatter...")
vim.api.nvim_create_autocmd("BufWritePre", {
group = vim.api.nvim_create_augroup("LspFormatting", {}),
buffer = bufnr,
@ -17,8 +14,6 @@ function M.on_attach(client, bufnr)
})
end
print("Setting up keybinds...")
local opts = function(desc)
return { noremap = true, silent = true, desc = desc }
end
@ -38,20 +33,17 @@ function M.on_attach(client, bufnr)
vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts("Rename"))
vim.keymap.set("n", "<leader>c", vim.lsp.buf.code_action, opts("Code actions"))
vim.keymap.set("n", "<leader>f", vim.lsp.buf.format, opts("Format"))
print("Initialized language server!")
end
local function on_attach_typescript(client, bufnr)
-- We handle formatting using null-ls and prettierd
client.server_capabilities.documentFormattingProvider = false
M.on_attach(client, bufnr)
end
-- General server config
local servers = {
tsserver = { on_attach = on_attach_typescript },
tsserver = {
on_attach = function(client, bufnr)
-- We handle formatting using null-ls and prettierd
client.server_capabilities.documentFormattingProvider = false
M.on_attach(client, bufnr)
end
},
dhall_lsp_server = {},
sumneko_lua = {
settings = {
@ -79,9 +71,7 @@ local servers = {
purescriptls = {
settings = {
purescript = {
censorWarnings = {
"UnusedName", "ShadowedName", "UserDefinedWarning"
},
censorWarnings = { "UnusedName", "ShadowedName", "UserDefinedWarning" },
formatter = "purs-tidy"
}
}
@ -112,9 +102,7 @@ local servers = {
}
function M.setup()
local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp
.protocol
.make_client_capabilities())
local capabilities = require('cmp_nvim_lsp').default_capabilities()
-- Setup basic language servers
for lsp, details in pairs(servers) do

View file

@ -0,0 +1,34 @@
local H = require("my.helpers")
local M = {}
local function skip_containing(string, opts)
local defaultOptions = { event = "msg_show", kind = "", find = string }
local filter = H.mergeTables(defaultOptions, opts or {})
return { filter = filter, opts = { skip = true } }
end
function M.setup()
-- s - search hit bottom messages
-- c - no pattern found and whatnot
vim.opt.shortmess:append("scC")
-- vim.opt.shortmess = "sc"
require("noice").setup({
cmdline = {
view = "cmdline",
format = {
search_down = { kind = "search", pattern = "^/", icon = "🔎", lang = "regex" },
search_up = { kind = "search", pattern = "^%?", icon = "🔎", lang = "regex" }
}
},
routes = {
-- Filter out "Written ..." messages
skip_containing("written"),
skip_containing("search hit", { event = "wmsg" }),
skip_containing("pattern not found", { event = "msg_show" })
},
lsp = { progres = { enabled = false } }
})
end
return M

View file

@ -0,0 +1,7 @@
local M = {}
function M.setup()
vim.notify = require("notify")
end
return M

View file

@ -9,12 +9,19 @@ function M.setup()
-- null_ls.builtins.formatting.prettierd.with({extra_filetypes = {}}), -- format ts files
null_ls.builtins.formatting.prettier.with({ extra_filetypes = {} }), -- format ts files
-- null_ls.builtins.formatting.lua_format -- format lua code
null_ls.builtins.formatting.lua_format.with({
-- extra_args = function(params)
-- return params.options and params.options.tabSize and
-- { "--indent-width=" .. params.options.tabSize }
-- end
}) -- format lua code
}
null_ls.setup({
sources = sources, on_attach = lspconfig.on_attach
, debug = true })
sources = sources,
on_attach = lspconfig.on_attach,
debug = true
})
end
return M

View file

@ -4,14 +4,12 @@ local M = {}
function M.setup()
wk.setup({
triggers = { "<leader>", "d", "y", "q", "z", "g", "c" }
triggers = { "<leader>", "d", "y", "q", "z", "g", "c" },
show_help = false,
show_keys = false
})
wk.register({
["<leader>l"] = {
name = "Local commands"
}
})
wk.register({ ["<leader>l"] = { name = "Local commands" } })
end
return M