many updates, added hardmode

This commit is contained in:
RingOfStorms (Joshua Bell) 2024-10-18 01:56:44 -05:00
parent 99fb25e145
commit 1f41fc3018
8 changed files with 237 additions and 80 deletions

View file

@ -15,10 +15,6 @@ return {
},
},
"saadparwaiz1/cmp_luasnip",
-- Adds other completion capabilities.
-- nvim-cmp does not ship with all sources by default. They are split
-- into multiple repos for maintenance purposes.
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
@ -26,10 +22,7 @@ return {
"zbirenbaum/copilot.lua",
cmd = "Copilot",
event = "InsertEnter",
opts = {
-- suggestion = { enabled = false, auto_trigger = false },
-- panel = { enabled = false, auto_trigger = false },
},
opts = {},
main = "copilot",
},
{ "zbirenbaum/copilot-cmp", opts = {}, main = "copilot_cmp" },
@ -91,21 +84,22 @@ return {
{
name = "copilot",
priority = 9,
keyword_length = 1,
filter = function(keyword)
-- Check if keyword length is some number and not just whitespace
if #keyword < 2 or keyword:match("^%s*$") then
return false
end
return true
end,
-- keyword_length = 1,
-- filter = function(keyword)
-- -- Check if keyword length is some number and not just whitespace
-- if #keyword < 2 or keyword:match("^%s*$") then
-- return false
-- end
-- return true
-- end,
-- max_item_count = 3,
},
{ name = "nvim_lsp", priority = 8, max_item_count = 100 },
{ name = "luasnip", priority = 7 },
{ name = "luasnip", priority = 7, max_item_count = 5 },
-- This source provides file path completions, helping you to complete file paths in your code
{ name = "path", priority = 7 },
{ name = "path", priority = 7, max_item_count = 3 },
-- This source provides completion items from the current buffer, meaning it suggests words that have already been typed in the same file.
{ name = "buffer", priority = 6 },
{ name = "buffer", priority = 6, max_item_count = 5 },
-- Rust crates.io integration
{ name = "crates" },
},

6
lua/plugins/hardtime.lua Normal file
View file

@ -0,0 +1,6 @@
return {
"m4xshen/hardtime.nvim",
event = "VeryLazy",
dependencies = { "MunifTanjim/nui.nvim", "nvim-lua/plenary.nvim" },
opts = {},
}

View file

@ -34,6 +34,7 @@ return {
},
main = "lsp-inlayhints",
},
{ "b0o/schemastore.nvim" },
-- Automatically install LSPs and related tools to stdpath for Neovim
{ "williamboman/mason.nvim", enabled = not NIX, config = true }, -- NOTE: Must be loaded before dependants
{ "williamboman/mason-lspconfig.nvim", enabled = not NIX },
@ -68,6 +69,7 @@ return {
U.safeRequire("cmp_nvim_lsp", function(c)
capabilities = vim.tbl_deep_extend("force", capabilities, c.default_capabilities())
end)
local schemastore = require("schemastore")
-- TODO finish porting over lsp configs: https://github.com/RingOfStorms/nvim/blob/master/lua/plugins/lsp.lua
local servers = {
@ -77,6 +79,7 @@ return {
-- But for many setups, the LSP (`tsserver`) will work just fine
-- Note that `rust-analyzer` is done via mrcjkb/rustaceanvim plugin above, do not register it here.
lua_ls = {
capabilities = capabilities,
settings = {
Lua = {
runtime = {
@ -110,8 +113,22 @@ return {
},
},
},
rust_analyzer = {},
nil_ls = {},
-- rust_analyzer = {
-- capabilities = capabilities,
-- settings = {
-- ["rust-analyzer"] = {
-- check = {
-- command = "clippy",
-- },
-- diagnostics = {
-- enable = true,
-- },
-- },
-- },
-- },
nil_ls = { -- nix
capabilities = capabilities,
},
-- tsserver = {
-- -- typescript/javascript
-- implicitProjectConfiguration = {
@ -120,12 +137,14 @@ return {
-- },
ts_ls = {
-- typescript/javascript
capabilities = capabilities,
implicitProjectConfiguration = {
checkJs = true,
},
},
tailwindcss = {
-- tailwind css
capabilities = capabilities,
-- https://www.tailwind-variants.org/docs/getting-started#intellisense-setup-optional
tailwindCSS = {
experimental = {
@ -137,24 +156,46 @@ return {
},
cssls = {
-- css
capabilities = capabilities,
},
jsonls = {
-- json
capabilities = capabilities,
settings = {
json = {
schemas = schemastore.json.schemas(),
validate = { enable = true },
},
},
},
pyright = {
-- python
capabilities = capabilities,
},
marksman = {
-- markdown
capabilities = capabilities,
},
taplo = {
-- toml
capabilities = capabilities,
},
yamlls = {
-- yaml
capabilities = capabilities,
settings = {
yaml = {
schemas = schemastore.yaml.schemas(),
schemaStore = {
enable = false,
url = "",
},
},
},
},
lemminx = {
-- xml
capabilities = capabilities,
},
}
if NIX then

View file

@ -0,0 +1,19 @@
vim.g.rustaceanvim = {
tools = {
enable_clippy = true,
enable_nextest = true,
reload_workspace_from_cargo_toml = true,
},
server = {
-- cmd = { "nix", "run", "nixpkgs#rust-analyzer" },
},
}
return {
"mrcjkb/rustaceanvim",
version = "^5",
lazy = false, -- already lazy
ft = { "rust" },
keys = {},
command = "RustLsp",
}

View file

@ -2,8 +2,8 @@ return {
"nvim-telescope/telescope.nvim",
dependencies = {
{ "nvim-lua/plenary.nvim" },
{ "nvim-telescope/telescope-fzf-native.nvim" },
{ "nvim-telescope/telescope-ui-select.nvim" },
{ "nvim-telescope/telescope-fzf-native.nvim", event = "VeryLazy" },
{ "nvim-telescope/telescope-ui-select.nvim", event = "VeryLazy" },
},
init = function()
U.cmd_executable("rg", {

View file

@ -0,0 +1,21 @@
return {
"nvim-treesitter/nvim-treesitter-context",
event = "BufRead",
opts = {
enable = true, -- Enable this plugin (Can be enabled/disabled later via commands)
max_lines = 0, -- How many lines the window should span. Values <= 0 mean no limit.
min_window_height = 0, -- Minimum editor window height to enable context. Values <= 0 mean no limit.
line_numbers = true,
multiline_threshold = 20, -- Maximum number of lines to show for a single context
trim_scope = "outer", -- Which context lines to discard if `max_lines` is exceeded. Choices: 'inner', 'outer'
mode = "cursor", -- Line used to calculate context. Choices: 'cursor', 'topline'
-- Separator between context and content. Should be a single character string, like '-'.
-- When separator is set, the context will only show up when there are at least 2 lines above cursorline.
separator = nil,
zindex = 20, -- The Z-index of the context window
on_attach = nil, -- (fun(buf: integer): boolean) return false to disable attaching
},
config = function(_, opts)
require("treesitter-context").setup(opts)
end,
}