Compare commits
9 Commits
3230e6d872
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3e85812630 | ||
|
|
a968cdc50a | ||
|
|
d7df92eb95 | ||
|
|
6d75acf6f2 | ||
|
|
e3ce7dccd4 | ||
|
|
0dceca82a1 | ||
|
|
e55dd790eb | ||
|
|
54bf8fdd78 | ||
|
|
eddb023767 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -8,3 +8,5 @@ omz-custom/plugins
|
||||
omz-custom/vrm.sh
|
||||
omz
|
||||
testDir
|
||||
tmuxinator/*.yml
|
||||
!tmuxinator/template.yml.temp
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"copilot.lua":"1.13.0"}
|
||||
{"copilot.lua":"1.384.0"}
|
||||
|
||||
13
nvim/lsp/luals.lua
Normal file
13
nvim/lsp/luals.lua
Normal file
@@ -0,0 +1,13 @@
|
||||
return {
|
||||
cmd = { "lua-language-server" },
|
||||
filetypes = { "lua" },
|
||||
root_markers = { ".luarc.json", ".luarc.jsonc" },
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
version = "LuaJIT",
|
||||
},
|
||||
signatureHelp = { enabled = true },
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
local configs = require 'lspconfig.configs'
|
||||
local util = require 'lspconfig.util'
|
||||
|
||||
configs.prolog_lsp = {
|
||||
default_config = {
|
||||
cmd = {"swipl",
|
||||
"-g", "use_module(library(lsp_server)).",
|
||||
"-g", "lsp_server:main",
|
||||
"-t", "halt",
|
||||
"--", "stdio"};
|
||||
filetypes = {"prolog"};
|
||||
root_dir = util.root_pattern("pack.pl");
|
||||
};
|
||||
docs = {
|
||||
description = [[
|
||||
https://github.com/jamesnvc/prolog_lsp
|
||||
|
||||
Prolog Language Server
|
||||
]];
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,3 @@ require("olinpin.commands")
|
||||
|
||||
-- this needs to be set after lazy
|
||||
vim.o.timeoutlen = 0
|
||||
-- setup prolog
|
||||
require('lspconfig/prolog_lsp')
|
||||
require('lspconfig').prolog_lsp.setup{}
|
||||
-- require('olinpin.intro').open()
|
||||
|
||||
36
nvim/lua/olinpin/plugins/attempt.lua
Normal file
36
nvim/lua/olinpin/plugins/attempt.lua
Normal file
@@ -0,0 +1,36 @@
|
||||
return {
|
||||
"m-demare/attempt.nvim",
|
||||
config = function()
|
||||
local attempt = require("attempt")
|
||||
|
||||
attempt.setup({
|
||||
initial_content = {
|
||||
php = "<?php\n\n",
|
||||
py = "",
|
||||
},
|
||||
ext_options = { "js", "py", "php", "" },
|
||||
format_opts = {
|
||||
js = "JavaScript",
|
||||
py = "Python",
|
||||
[""] = "[None]",
|
||||
},
|
||||
})
|
||||
|
||||
local cmd_map = {
|
||||
py = "python3",
|
||||
js = "node",
|
||||
php = "php",
|
||||
}
|
||||
|
||||
vim.keymap.set("n", "<leader>ss", attempt.new_select, { desc = "Attempt: Open Attempt" })
|
||||
vim.keymap.set("n", "<leader>si", attempt.new_input_ext, { desc = "Attempt: New Attempt with Input" })
|
||||
vim.keymap.set("n", "<leader>sr", function()
|
||||
local ext = vim.fn.expand("%:e")
|
||||
local cmd = cmd_map[ext] or 'echo "unsupported"'
|
||||
vim.cmd("split | terminal " .. cmd .. " %")
|
||||
end, { desc = "Attempt: Run Attempt" })
|
||||
vim.keymap.set("n", "<leader>sd", attempt.delete_buf, { desc = "Attempt: Delete Attempt from Current Buffer" })
|
||||
vim.keymap.set("n", "<leader>sc", attempt.rename_buf, { desc = "Attempt: Rename Attempt from Current Buffer" })
|
||||
vim.keymap.set("n", "<leader>sf", ":Telescope attempt<CR>", { desc = "Attempt: List Attempts with Telescope" })
|
||||
end,
|
||||
}
|
||||
58
nvim/lua/olinpin/plugins/completion.lua
Normal file
58
nvim/lua/olinpin/plugins/completion.lua
Normal file
@@ -0,0 +1,58 @@
|
||||
return {
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
event = "InsertEnter",
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-buffer",
|
||||
"hrsh7th/cmp-path",
|
||||
"L3MON4D3/LuaSnip",
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
},
|
||||
config = function()
|
||||
local cmp = require("cmp")
|
||||
local luasnip = require("luasnip")
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
["<C-e>"] = cmp.mapping.abort(),
|
||||
["<CR>"] = cmp.mapping.confirm({ select = true }),
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif luasnip.jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" },
|
||||
}, {
|
||||
{ name = "buffer" },
|
||||
{ name = "path" },
|
||||
}),
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,40 +1,34 @@
|
||||
return {
|
||||
"stevearc/conform.nvim",
|
||||
event = "BufWritePre",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
opts = {
|
||||
lsp_fallback = true,
|
||||
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
|
||||
javascript = { "prettier" },
|
||||
typescript = { "prettier" },
|
||||
json = { "prettier" },
|
||||
css = { "prettier" },
|
||||
html = { "prettier" },
|
||||
|
||||
sh = { "shfmt" },
|
||||
|
||||
go = { "goimports", "gofumpt" },
|
||||
php = { "php-cs-fixer" },
|
||||
python = { "black" },
|
||||
},
|
||||
|
||||
-- format_on_save = function(bufnr)
|
||||
-- local filetype = vim.bo[bufnr].filetype
|
||||
-- if filetype == "javascript" then
|
||||
-- return nil
|
||||
-- end
|
||||
-- if filetype == "vue" then
|
||||
-- return nil
|
||||
-- end
|
||||
-- if filetype == "less" then
|
||||
-- return nil
|
||||
-- end
|
||||
-- if filetype == "php" then
|
||||
-- return nil
|
||||
-- end
|
||||
--
|
||||
-- return {
|
||||
-- timeout_ms = 500,
|
||||
-- lsp_fallback = true,
|
||||
-- }
|
||||
-- end,
|
||||
format_on_save = false,
|
||||
|
||||
default_format_opts = { lsp_fallback = true },
|
||||
},
|
||||
|
||||
config = function(_, opts)
|
||||
require("conform").setup(opts)
|
||||
|
||||
-- manual formatting keymap
|
||||
vim.keymap.set({ "n", "x" }, "=", function()
|
||||
require("conform").format({
|
||||
async = true,
|
||||
lsp_fallback = true,
|
||||
})
|
||||
end, { desc = "Format file or range" })
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
return {
|
||||
"xavierchow/vim-sequence-diagram"
|
||||
}
|
||||
66
nvim/lua/olinpin/plugins/gx.lua
Normal file
66
nvim/lua/olinpin/plugins/gx.lua
Normal file
@@ -0,0 +1,66 @@
|
||||
return {
|
||||
"chrishrb/gx.nvim",
|
||||
keys = { { "gx", "<cmd>Browse<cr>", mode = { "n", "x" } } },
|
||||
cmd = { "Browse" },
|
||||
init = function()
|
||||
vim.g.netrw_nogx = 1 -- disable netrw gx
|
||||
end,
|
||||
dependencies = { "nvim-lua/plenary.nvim" }, -- Required for Neovim < 0.10.0
|
||||
config = true, -- default settings
|
||||
submodules = false, -- not needed, submodules are required only for tests
|
||||
|
||||
-- -- you can specify also another config if you want
|
||||
-- config = function()
|
||||
-- require("gx").setup {
|
||||
-- open_browser_app = "os_specific", -- specify your browser app; default for macOS is "open", Linux "xdg-open" and Windows "powershell.exe"
|
||||
-- open_browser_args = { "--background" }, -- specify any arguments, such as --background for macOS' "open".
|
||||
-- handlers = {
|
||||
-- plugin = true, -- open plugin links in lua (e.g. packer, lazy, ..)
|
||||
-- github = true, -- open github issues
|
||||
-- brewfile = true, -- open Homebrew formulaes and casks
|
||||
-- package_json = true, -- open dependencies from package.json
|
||||
-- search = true, -- search the web/selection on the web if nothing else is found
|
||||
-- go = true, -- open pkg.go.dev from an import statement (uses treesitter)
|
||||
-- jira = { -- custom handler to open Jira tickets (these have higher precedence than builtin handlers)
|
||||
-- name = "jira", -- set name of handler
|
||||
-- handle = function(mode, line, _)
|
||||
-- local ticket = require("gx.helper").find(line, mode, "(%u+-%d+)")
|
||||
-- if ticket and #ticket < 20 then
|
||||
-- return "http://jira.company.com/browse/" .. ticket
|
||||
-- end
|
||||
-- end,
|
||||
-- },
|
||||
-- rust = { -- custom handler to open rust's cargo packages
|
||||
-- name = "rust", -- set name of handler
|
||||
-- filetype = { "toml" }, -- you can also set the required filetype for this handler
|
||||
-- filename = "Cargo.toml", -- or the necessary filename
|
||||
-- handle = function(mode, line, _)
|
||||
-- local crate = require("gx.helper").find(line, mode, "(%w+)%s-=%s")
|
||||
|
||||
-- if crate then
|
||||
-- return "https://crates.io/crates/" .. crate
|
||||
-- end
|
||||
-- end,
|
||||
-- },
|
||||
-- },
|
||||
-- handler_options = {
|
||||
-- search_engine = "google", -- you can select between google, bing, duckduckgo, ecosia and yandex
|
||||
-- search_engine = "https://search.brave.com/search?q=", -- or you can pass in a custom search engine
|
||||
-- select_for_search = false, -- if your cursor is e.g. on a link, the pattern for the link AND for the word will always match. This disables this behaviour for default so that the link is opened without the select option for the word AND link
|
||||
|
||||
-- git_remotes = { "upstream", "origin" }, -- list of git remotes to search for git issue linking, in priority
|
||||
-- git_remotes = function(fname) -- you can also pass in a function
|
||||
-- if fname:match("myproject") then
|
||||
-- return { "mygit" }
|
||||
-- end
|
||||
-- return { "upstream", "origin" }
|
||||
-- end,
|
||||
|
||||
-- git_remote_push = false, -- use the push url for git issue linking,
|
||||
-- git_remote_push = function(fname) -- you can also pass in a function
|
||||
-- return fname:match("myproject")
|
||||
-- end,
|
||||
-- },
|
||||
-- }
|
||||
-- end,
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
return {
|
||||
"ggandor/leap.nvim",
|
||||
config = function ()
|
||||
require('leap')
|
||||
vim.keymap.set("n", "<leader>s", "<Plug>(leap-forward-to)", { desc = "Leap forward to" })
|
||||
-- default mapping: `s`
|
||||
|
||||
vim.keymap.set("n", "<leader>S", "<Plug>(leap-backward-to)", { desc = "Leap backward to" })
|
||||
-- arguments: `{ backward = true }`
|
||||
-- default mapping: `S`
|
||||
|
||||
vim.keymap.set("n", "<leader>b", "<Plug>(leap-forward-till)", { desc = "Leap forward till" } )
|
||||
-- arguments: `{ offset = -1, inclusive_op = true }`
|
||||
-- default mapping: `x` (Visual and Operator-pending mode only)
|
||||
|
||||
vim.keymap.set("n", "<leader>B", "<Plug>(leap-backward-till)", { desc = "Leap backward till" })
|
||||
-- arguments: `{ backward = true, offset = 2 }`
|
||||
-- default mapping: `X` (Visual and Operator-pending mode only)
|
||||
|
||||
-- <Plug>(leap-from-window)
|
||||
-- arguments: `{ target_windows = require('leap.util').get_enterable_windows() }`
|
||||
-- default mapping: `gs`
|
||||
end
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
return {
|
||||
'VonHeikemen/lsp-zero.nvim',
|
||||
branch = 'v2.x',
|
||||
dependencies = {
|
||||
-- LSP Support
|
||||
{'neovim/nvim-lspconfig'}, -- Required
|
||||
{'williamboman/mason.nvim'}, -- Optional
|
||||
{'williamboman/mason-lspconfig.nvim'}, -- Optional
|
||||
|
||||
-- Autocompletion
|
||||
{'hrsh7th/nvim-cmp'}, -- Required
|
||||
{'hrsh7th/cmp-nvim-lsp'}, -- Required
|
||||
{'L3MON4D3/LuaSnip'}, -- Required
|
||||
},
|
||||
config = function()
|
||||
local lsp = require('lsp-zero')
|
||||
|
||||
lsp.preset('recommended')
|
||||
|
||||
lsp.on_attach(function(client, bufnr)
|
||||
-- see :help lsp-zero-keybindings
|
||||
-- to learn the available actions
|
||||
lsp.default_keymaps({buffer = bufnr})
|
||||
end)
|
||||
|
||||
lsp.setup_servers({'ts_ls', 'eslint', 'html', 'hls', 'gopls'})
|
||||
|
||||
-- require("lspconfig").html.setup({
|
||||
-- filetypes = { "html", "htmldjango" },
|
||||
-- init_options = {
|
||||
-- configurationSection = { "html", "css", "javascript" },
|
||||
-- embeddedLanguages = {
|
||||
-- css = true,
|
||||
-- javascript = true,
|
||||
-- },
|
||||
-- provideFormatter = true,
|
||||
-- },
|
||||
-- })
|
||||
|
||||
require('lspconfig').lua_ls.setup(lsp.nvim_lua_ls())
|
||||
lsp.set_sign_icons({
|
||||
error = '✘',
|
||||
warn = '▲',
|
||||
hint = '⚑',
|
||||
info = '»'
|
||||
})
|
||||
lsp.setup()
|
||||
end
|
||||
}
|
||||
@@ -1,6 +1,225 @@
|
||||
return {
|
||||
"williamboman/mason.nvim",
|
||||
config = function()
|
||||
require("mason").setup()
|
||||
end
|
||||
-- Install LSP servers and 3rd-party tools
|
||||
-- source: https://github.com/ruicsh/nvim-config/blob/main/lua/plugins/mason.lua
|
||||
-- sauce: https://github.com/ruicsh/nvim-config/blob/main/lua/plugins/mason.lua
|
||||
-- https://github.com/williamboman/mason.nvim
|
||||
|
||||
-- https://mason-registry.dev/registry/list
|
||||
local PACKAGES = {
|
||||
-- LSP
|
||||
"angular-language-server",
|
||||
"ansible-language-server",
|
||||
"css-lsp",
|
||||
"cssmodules-language-server",
|
||||
"css-variables-language-server",
|
||||
"dockerfile-language-server",
|
||||
"harper-ls",
|
||||
"html-lsp",
|
||||
"json-lsp",
|
||||
"lua-language-server",
|
||||
"pyright",
|
||||
"typescript-language-server",
|
||||
"yaml-language-server",
|
||||
-- Format
|
||||
"black",
|
||||
"flake8",
|
||||
"prettierd",
|
||||
"stylua",
|
||||
-- Lint
|
||||
"eslint-lsp",
|
||||
"pylint",
|
||||
"jq",
|
||||
"php-cs-fixer",
|
||||
"intelephense",
|
||||
"prettier",
|
||||
}
|
||||
|
||||
local function install(pack, version)
|
||||
local notifyOpts = { title = "Mason", icon = "", id = "mason.install" }
|
||||
|
||||
local msg = version and ("[%s] updating to %s…"):format(pack.name, version)
|
||||
or ("[%s] installing…"):format(pack.name)
|
||||
vim.defer_fn(function()
|
||||
vim.notify(msg, nil, notifyOpts)
|
||||
end, 0)
|
||||
|
||||
pack:once("install:success", function()
|
||||
local msg2 = ("[%s] %s"):format(pack.name, version and "updated." or "installed.")
|
||||
notifyOpts.icon = " "
|
||||
vim.defer_fn(function()
|
||||
vim.notify(msg2, nil, notifyOpts)
|
||||
end, 0)
|
||||
end)
|
||||
|
||||
pack:once("install:failed", function()
|
||||
local error = "Failed to install [" .. pack.name .. "]"
|
||||
vim.defer_fn(function()
|
||||
vim.notify(error, vim.log.levels.ERROR, notifyOpts)
|
||||
end, 0)
|
||||
end)
|
||||
|
||||
pack:install({ version = version })
|
||||
end
|
||||
|
||||
local function syncPackages(ensurePacks)
|
||||
local masonReg = require("mason-registry")
|
||||
|
||||
local function refreshCallback()
|
||||
-- Auto-install missing packages & auto-update installed ones
|
||||
vim.iter(ensurePacks):each(function(packName)
|
||||
-- Extract package name and pinned version if specified
|
||||
local name, pinnedVersion = packName:match("([^@]+)@?(.*)")
|
||||
if not masonReg.has_package(name) then
|
||||
return
|
||||
end
|
||||
local pack = masonReg.get_package(name)
|
||||
if pack:is_installed() then
|
||||
-- Only check for updates if no version was pinned
|
||||
if pinnedVersion == "" then
|
||||
local latest_version = pack:get_latest_version()
|
||||
-- Check if the latest version is different from the installed one
|
||||
if latest_version and latest_version ~= pack:get_installed_version() then
|
||||
local msg = ("[%s] updating to %s…"):format(pack.name, latest_version)
|
||||
vim.defer_fn(function()
|
||||
vim.notify(msg, nil, { title = "Mason", icon = "" })
|
||||
end, 0)
|
||||
-- Install the latest version
|
||||
pack:install({ version = latest_version })
|
||||
end
|
||||
end
|
||||
else
|
||||
-- Install with pinned version if specified
|
||||
install(pack, pinnedVersion ~= "" and pinnedVersion or nil)
|
||||
end
|
||||
end)
|
||||
|
||||
-- Auto-clean unused packages
|
||||
local installedPackages = masonReg.get_installed_package_names()
|
||||
vim.iter(installedPackages):each(function(packName)
|
||||
-- Check if installed package is in our ensure list (without version suffix)
|
||||
local isEnsured = vim.iter(ensurePacks):any(function(ensurePack)
|
||||
local name = ensurePack:match("([^@]+)")
|
||||
return name == packName
|
||||
end)
|
||||
|
||||
if not isEnsured then
|
||||
masonReg.get_package(packName):uninstall()
|
||||
local msg = ("[%s] uninstalled."):format(packName)
|
||||
vim.defer_fn(function()
|
||||
vim.notify(msg, nil, { title = "Mason", icon = "" })
|
||||
end, 0)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
masonReg.refresh(refreshCallback)
|
||||
end
|
||||
|
||||
return {
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
init = function()
|
||||
-- Do not crowd home directory with NPM cache folder
|
||||
vim.env.npm_config_cache = vim.env.HOME .. "/.cache/npm"
|
||||
end,
|
||||
opts = {
|
||||
ui = {
|
||||
border = "rounded",
|
||||
height = 0.85,
|
||||
width = 0.8,
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("mason").setup(opts)
|
||||
|
||||
-- Filter out disabled packages
|
||||
local packages = {}
|
||||
for _, package in ipairs(PACKAGES) do
|
||||
table.insert(packages, package)
|
||||
end
|
||||
|
||||
vim.defer_fn(function()
|
||||
syncPackages(packages)
|
||||
end, 3000)
|
||||
end,
|
||||
|
||||
event = { "VeryLazy" },
|
||||
},
|
||||
{
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
dependencies = { "williamboman/mason.nvim" },
|
||||
config = function()
|
||||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||
|
||||
local on_attach = function(client, bufnr)
|
||||
local opts = { buffer = bufnr, silent = true }
|
||||
|
||||
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
|
||||
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts)
|
||||
vim.keymap.set("n", "gi", vim.lsp.buf.implementation, opts)
|
||||
vim.keymap.set("n", "go", vim.lsp.buf.type_definition, opts)
|
||||
vim.keymap.set("n", "gr", vim.lsp.buf.references, opts)
|
||||
vim.keymap.set("n", "gs", vim.lsp.buf.signature_help, opts)
|
||||
vim.keymap.set("n", "<F2>", vim.lsp.buf.rename, opts)
|
||||
vim.keymap.set({ "n", "x" }, "<F3>", function()
|
||||
vim.lsp.buf.format({ async = true })
|
||||
end, opts)
|
||||
vim.keymap.set("n", "<F4>", vim.lsp.buf.code_action, opts)
|
||||
end
|
||||
|
||||
-- Configure LSP servers using new vim.lsp.config API
|
||||
vim.lsp.config("lua_ls", {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = { version = "LuaJIT" },
|
||||
diagnostics = { globals = { "vim" } },
|
||||
workspace = {
|
||||
library = vim.api.nvim_get_runtime_file("", true),
|
||||
checkThirdParty = false,
|
||||
},
|
||||
telemetry = { enable = false },
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
vim.lsp.config("ts_ls", { on_attach = on_attach, capabilities = capabilities })
|
||||
vim.lsp.config("pyright", { on_attach = on_attach, capabilities = capabilities })
|
||||
vim.lsp.config("html", { on_attach = on_attach, capabilities = capabilities })
|
||||
vim.lsp.config("cssls", { on_attach = on_attach, capabilities = capabilities })
|
||||
vim.lsp.config("jsonls", { on_attach = on_attach, capabilities = capabilities })
|
||||
vim.lsp.config("yamlls", { on_attach = on_attach, capabilities = capabilities })
|
||||
vim.lsp.config("intelephense", {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
intelephense = {
|
||||
format = {
|
||||
enable = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
vim.lsp.config("eslint", { on_attach = on_attach, capabilities = capabilities })
|
||||
|
||||
require("mason-lspconfig").setup({
|
||||
ensure_installed = {
|
||||
"lua_ls",
|
||||
"ts_ls",
|
||||
"pyright",
|
||||
"html",
|
||||
"cssls",
|
||||
"jsonls",
|
||||
"yamlls",
|
||||
"intelephense",
|
||||
"eslint",
|
||||
},
|
||||
automatic_installation = true,
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = { "williamboman/mason-lspconfig.nvim" },
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
return {
|
||||
"jay-babu/mason-null-ls.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
dependencies = {
|
||||
"williamboman/mason.nvim",
|
||||
"jose-elias-alvarez/null-ls.nvim",
|
||||
},
|
||||
config = function ()
|
||||
|
||||
require("mason-null-ls").setup({
|
||||
ensure_installed = {
|
||||
"stylua",
|
||||
"jq",
|
||||
"php-cs-fixer",
|
||||
"intelephense",
|
||||
"black",
|
||||
"prettier",
|
||||
}
|
||||
})
|
||||
|
||||
local null_ls = require("null-ls")
|
||||
local format = null_ls.builtins.formatting
|
||||
|
||||
null_ls.setup({
|
||||
sources = {
|
||||
format.black,
|
||||
format.stylua,
|
||||
format.prettier
|
||||
}
|
||||
})
|
||||
vim.keymap.set({"n", "x"}, "=", function() vim.cmd('LspZeroFormat') end, { desc = "Format" })
|
||||
end
|
||||
}
|
||||
63
nvim/lua/olinpin/plugins/profile.lua
Normal file
63
nvim/lua/olinpin/plugins/profile.lua
Normal file
@@ -0,0 +1,63 @@
|
||||
return {
|
||||
{
|
||||
"Kurama622/profile.nvim",
|
||||
config = function()
|
||||
local comp = require("profile.components")
|
||||
require("profile").setup({
|
||||
avatar_opts = {
|
||||
force_blank = false,
|
||||
},
|
||||
disable_keys = {},
|
||||
cursor_pos = { 17, 48 },
|
||||
format = function()
|
||||
local header = {
|
||||
[[⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣤⣴⣶⣶⣶⣶⣦⣤⡀⠀⠀⠀⠀]],
|
||||
[[⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⠟⠉⠉⠉⠉⠉⠛⠻⢿⣷⣄⠀⠀]],
|
||||
[[⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣼⣿⠟⠁⠀⠀⢠⣤⣄⠀⠀⠀⠀⠙⣿⣷⠀]],
|
||||
[[⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣾⣿⠏⠀⠀⠀⠀⠘⠻⠋⠀⠀⠀⠀⠀⢸⣿⡇]],
|
||||
[[⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⣿⡏⠀⠀⣀⣀⣀⣠⣤⣤⣤⣤⣿⣄⠀⢠⣿⣧]],
|
||||
[[⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣿⣿⠀⠀⠀⠈⠻⣿⣶⠶⣶⣤⣤⣜⣿⣦⡈⢿⣿]],
|
||||
[[⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⠀⠀⠀⠀⠀⠈⠙⠻⢶⣤⣭⣛⣿⣿⣷⣼⣿]],
|
||||
[[⠀⠀⠀⠀⠀⣰⣶⣾⠿⠿⢿⣷⣶⣄⠀⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠙⠛⠛⢛⣿⣿]],
|
||||
[[⠀⠀⠀⠀⠀⢹⣿⣆⠀⠀⠀⠈⠻⢿⣿⣿⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣾⣿⡏]],
|
||||
[[⠀⠀⠀⠀⠀⣸⣿⣿⠀⠀⠀⠀⠀⠀⢀⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⠀]],
|
||||
[[⠀⠀⠀⢀⣾⣿⣿⡇⠀⠀⠀⠀⠀⠀⢸⠟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⡇⠀]],
|
||||
[[⠀⠀⠀⣼⣿⠃⠹⣿⣷⣄⠀⠀⠀⠀⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⠇⠀]],
|
||||
[[⠀⠀⠀⣿⡿⠀⠀⠈⠻⣿⣧⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⠀⠀]],
|
||||
[[⠀⠀⢸⣿⣧⠀⠀⠀⠀⠸⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⡷⠀⠀]],
|
||||
[[⠀⠀⠈⣿⣿⡄⠀⠀⠀⠀⢻⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⣿⡀⠀]],
|
||||
[[⠀⠀⠀⣿⣿⣿⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣧⠀]],
|
||||
[[⠀⠀⠀⢻⣿⡟⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢿⣿⡇]],
|
||||
[[⠀⠀⠀⠘⣿⣿⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣾⣿⡿]],
|
||||
[[⠀⠀⠀⣤⣸⣿⣿⡷⠂⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⠃]],
|
||||
[[⠀⠀⠘⣿⡿⠿⣿⣿⣿⣷⡶⢶⣆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣰⣿⣿⠏⠀]],
|
||||
[[⠀⠀⢀⣿⡟⠀⠀⠀⠀⠀⠀⠈⣿⣇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⡿⠟⠉⠀⠀]],
|
||||
[[⠀⠀⣼⣿⠇⠀⣴⣄⠀⠀⠀⠀⢹⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣶⣿⠟⠁⠀⠀⠀⠀]],
|
||||
[[⢀⣼⣿⠋⠀⠀⠘⣿⣧⠀⠀⠀⢸⣿⣧⣄⣀⠀⠀⠀⢀⣀⣤⣶⣿⣿⠋⠁⠀⠀⠀⠀⠀⠀]],
|
||||
[[⢾⣯⣁⠀⠀⠀⠀⠈⢿⡄⠀⠀⣸⡿⠉⠙⠛⠛⠛⠛⢻⣿⡏⢹⣿⡟⠀⠀⠀⠀⠀⠀⠀⠀]],
|
||||
[[⠀⠛⢿⣷⣦⣤⣀⡀⠀⠀⠀⣠⣿⣷⣶⣶⣶⣶⣶⣦⣤⣿⣿⡜⣿⡄⠀⠀⠀⠀⠀⠀⠀⠀]],
|
||||
[[⠀⠀⠀⠈⠙⠛⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⢻⡿⣷⣶⣤⣀⠀⠀⠀⠀]],
|
||||
[[⠀⠀⠀⠀⠀⠀⠸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣏⣁⡸⠟⠈⣩⣿⣿⣿⠶⠀⠀]],
|
||||
[[⠀⠀⠀⣠⣴⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣿⠟⠋⠁⠀⠀⠀⠀]],
|
||||
[[⠀⠀⠀⠙⠿⣿⣿⣿⣿⣿⣿⣿⣿⡟⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠋⠉⠀⠀⠀⠀⠀⠀⠀⠀]],
|
||||
[[⠀⠀⠀⠀⠀⠀⠈⠉⠉⠉⠉⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀]],
|
||||
[[ WADDLE WADDLE WADDLE ]],
|
||||
}
|
||||
for _, line in ipairs(header) do
|
||||
comp:text_component_render({ comp:text_component(line, "center", "ProfileBlue") })
|
||||
end
|
||||
|
||||
comp:separator_render()
|
||||
handle = io.popen("curl -s -m 3 https://vtip.43z.one")
|
||||
result = handle:read("*a")
|
||||
handle:close()
|
||||
comp:text_component_render({
|
||||
comp:text_component("Neovim Tip of the Day:", "center", "ProfileGreen"),
|
||||
comp:text_component(result or "Could not fetch tip.", "center", "ProfileGreen"),
|
||||
})
|
||||
end,
|
||||
})
|
||||
vim.api.nvim_set_keymap("n", "<leader>p", "<cmd>Profile<cr>", { silent = true })
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -45,14 +45,7 @@ return {
|
||||
additional_vim_regex_highlighting = {"markdown"}
|
||||
},
|
||||
}
|
||||
require'lspconfig'.sourcekit.setup{
|
||||
cmd = {'/usr/bin/sourcekit-lsp'}
|
||||
}
|
||||
require('lspconfig')['hls'].setup{
|
||||
filetypes = { 'haskell', 'lhaskell', 'cabal' },
|
||||
}
|
||||
|
||||
-- vim.keymap.set('n','gd',vim.lsp.buf.definition)
|
||||
end
|
||||
|
||||
}
|
||||
|
||||
@@ -17,6 +17,8 @@ alias gch="git checkout"
|
||||
|
||||
alias lg="ls | grep"
|
||||
|
||||
alias gdc="git diff --cached"
|
||||
|
||||
function gas() {
|
||||
git add --all
|
||||
git status
|
||||
|
||||
Reference in New Issue
Block a user