This commit is contained in:
2023-04-20 15:28:34 +02:00
parent 73b7b3916a
commit f8fc4a1f14
18 changed files with 2262 additions and 162 deletions

View File

@ -1,120 +1,3 @@
-- local plugins = {
--
-- {
-- dir = "~/Projects/sudoku.nvim",
-- cmd = "Sudoku",
-- config = function()
-- require("sudoku").setup({
-- custom_highlights = {
-- square = { fg = "red" }
-- }
-- })
-- vim.cmd("hi SudokuSquare guibg=red")
-- end
-- },
--
--
--
-- {
-- "shortcuts/no-neck-pain.nvim",
-- cmd = "NoNeckPain",
-- config = true
-- },
-- ,
-- {
-- "stevearc/dressing.nvim",
-- enabled = false,
-- lazy = true,
-- },
-- {
-- "simrat39/symbols-outline.nvim",
-- cmd = "SymbolsOutline",
-- config = true,
-- },
-- ---------------------
-- -- Code Navigation --
-- ---------------------
-- ---------------
-- -- Lsp Setup --
-- ---------------
-- {
-- "glepnir/lspsaga.nvim",
-- event = "BufRead",
-- config = function()
-- require("lspsaga").setup({
-- symbol_in_winbar = {
-- enable = false,
-- },
-- })
-- end,
-- },
-- {
-- "folke/trouble.nvim",
-- cmd = "TroubleToggle",
-- dependencies = "nvim-tree/nvim-web-devicons",
-- config = function()
-- require("trouble").setup({})
-- end,
-- },
-- -------------------
-- -- Autocomplete --
-- -------------------
-- {
-- "nat-418/boole.nvim",
-- event = "InsertEnter",
-- config = function()
-- require("boole").setup({
-- mappings = {
-- increment = '+',
-- decrement = '-'
-- },
-- additions = {
-- { "const", "let", "var" },
-- { "absolute", "relative", "fixed", "sticky" }
-- }
-- })
-- end,
-- },
-- {
-- "gaoDean/autolist.nvim",
-- event = "InsertEnter",
-- config = true,
-- },
-- -------------------------
-- -- Syntax Highlighting --
-- -------------------------
-- {
-- "norcalli/nvim-colorizer.lua",
-- config = true,
-- event = "BufReadPost",
-- },
-- {
-- "folke/todo-comments.nvim",
-- config = true,
-- event = "VeryLazy",
-- },
-- --------------------
-- -- IDE Type Stuff --
-- --------------------
-- {
-- "rest-nvim/rest.nvim",
-- lazy = false,
-- dependencies = { "nvim-lua/plenary.nvim" },
-- config = function()
-- require("rest-nvim").setup({})
-- end,
-- },
-- {
-- "jackMort/ChatGPT.nvim",
-- cmd = "ChatGPT",
-- config = true,
-- dependencies = {
-- "MunifTanjim/nui.nvim",
-- },
-- },
-- --Dap Debugger -- Have not yet been able to set this up
-- }
local opts = {
defaults = { lazy = true },
install = { colorscheme = { require("max.plugins.theme").name } },
@ -125,27 +8,6 @@ local opts = {
performance = {
rtp = {
reset = true,
disabled_plugins = {
"gzip",
"zip",
"zipPlugin",
"fzf",
"tar",
"tarPlugin",
"getscript",
"getscriptPlugin",
"vimball",
"vimballPlugin",
"2html_plugin",
"matchit",
"matchparen",
"logiPat",
"rrhelper",
"netrw",
"netrwPlugin",
"netrwSettings",
"netrwFileHandlers",
},
},
}
}

View File

@ -15,6 +15,9 @@ return {
},
config = function()
local luasnip = require("luasnip")
luasnip.config.set_config {
enable_autosnippets = true,
}
require("max.plugins.autocomplete.snippets")
local lspkind = require("lspkind")

View File

@ -19,7 +19,7 @@ ls.config.set_config({
-- Update more often, :h events for more info.
updateevents = "TextChanged,TextChangedI",
ext_opts = {
[types.choiceNode] = {
[types.choiceNode] = {
active = {
virt_text = { { "choiceNode", "Comment" } },
},
@ -51,6 +51,42 @@ local function simple_restore(args, _)
return sn(nil, { i(1, args[1]) })
end
ls.add_snippets('lua', {
s(
{
trig = 'if',
condition = function()
local ignored_nodes = { 'string', 'comment' }
local pos = vim.api.nvim_win_get_cursor(0)
-- Use one column to the left of the cursor to avoid a "chunk" node
-- type. Not sure what it is, but it seems to be at the end of lines in
-- some cases.
local row, col = pos[1] - 1, pos[2] - 1
local node_type = vim.treesitter
.get_node({
pos = { row, col },
})
:type()
return not vim.tbl_contains(ignored_nodes, node_type)
end,
},
fmt(
[[
if {} then
{}
end
]],
{ i(1), i(2) }
)
),
}, {
type = 'autosnippets',
})
ls.add_snippets("svelte", {
s("slt", {
t({ '<script lang="ts">', "" }),

View File

@ -0,0 +1,5 @@
return {
"gaoDean/autolist.nvim",
event = "InsertEnter",
config = true,
}

View File

@ -0,0 +1,14 @@
return {
"nat-418/boole.nvim",
event = "InsertEnter",
opts = {
mappings = {
increment = '+',
decrement = '-'
},
additions = {
{ "const", "let", "var" },
{ "absolute", "relative", "fixed", "sticky" }
}
}
}

View File

@ -0,0 +1,5 @@
return {
"norcalli/nvim-colorizer.lua",
config = true,
event = "BufReadPost",
}

View File

@ -29,6 +29,10 @@ return {
sources = {
null_ls.builtins.diagnostics.eslint_d,
},
should_attach = function()
return lsp.util.root_pattern(".eslintrc", ".eslintrc.js", ".eslintrc.cjs", ".eslintrc.yaml", ".eslintrc.json")(
vim.fn.expand("%:p")) ~= nil;
end,
})
mason.setup()
@ -37,6 +41,22 @@ return {
})
local function on_attach(client)
local active_clients = vim.lsp.get_active_clients()
if client.name == 'denols' then
for _, client_ in pairs(active_clients) do
-- stop tsserver if denols is already active
if client_.name == 'tsserver' then
client_.stop()
end
end
elseif client.name == 'tsserver' then
for _, client_ in pairs(active_clients) do
-- prevent tsserver from starting if denols is already active
if client_.name == 'denols' then
client.stop()
end
end
end
require("lsp-format").on_attach(client)
end
@ -53,6 +73,10 @@ return {
root_dir = lsp.util.root_pattern("tsconfig.json", "package.json", "jsconfig.json", ".git"),
}
custom_lsp.denols = {
root_dir = lsp.util.root_pattern("deno.json", "deno.jsonc"),
}
local runtime_path = vim.split(package.path, ";")
table.insert(runtime_path, "lua/?.lua")
table.insert(runtime_path, "lua/?/init.lua")

View File

@ -0,0 +1,9 @@
return {
"glepnir/lspsaga.nvim",
event = "BufRead",
opts = {
symbol_in_winbar = {
enable = false,
},
},
}

View File

@ -0,0 +1,4 @@
return {
"stevearc/oil.nvim",
config = true
}

View File

@ -0,0 +1,5 @@
return {
"rest-nvim/rest.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
config = true,
}

View File

@ -0,0 +1,9 @@
return {
dir = "~/Projects/sudoku.nvim",
cmd = "Sudoku",
opts = {
custom_highlights = {
square = { fg = "red" }
}
}
}

View File

@ -0,0 +1,5 @@
return {
"folke/todo-comments.nvim",
config = true,
event = "VeryLazy",
}

View File

@ -0,0 +1,6 @@
return {
"folke/trouble.nvim",
cmd = "TroubleToggle",
dependencies = "nvim-tree/nvim-web-devicons",
config = true,
}