Skip to content

Commit 8ff9185

Browse files
committed
refactor(plug): use opts for all plugins in a seprate file each
1 parent d851cfb commit 8ff9185

File tree

13 files changed

+382
-392
lines changed

13 files changed

+382
-392
lines changed

init.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
-- Neo(vim) the less is more
55
-- @pwnwriter/pwnvim
66

7+
if vim.loader then
8+
vim.loader.enable()
9+
end
10+
711
require("opts").initial()
812

913
local lazy_path = vim.fn.stdpath "data" .. "/lazy/lazy.nvim"
@@ -15,4 +19,4 @@ end
1519

1620
vim.opt.rtp:prepend(lazy_path)
1721

18-
require "plugins"
22+
require "lazy_spec"

lazy-lock.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
2-
"blink.cmp": { "branch": "main", "commit": "cc2f10e9d8b6420324d4743a4d9a428de427e2cf" },
3-
"catppuccin": { "branch": "main", "commit": "0b2437bcc12b4021614dc41fcea9d0f136d94063" },
4-
"dropbar": { "branch": "master", "commit": "682197523c5b13031fda38e0991dd9043f6fb0cc" },
2+
"blink.cmp": { "branch": "main", "commit": "dcda20d3aa345025699a920c45b0a0603551f41d" },
3+
"catppuccin": { "branch": "main", "commit": "5b5e3aef9ad7af84f463d17b5479f06b87d5c429" },
4+
"dropbar": { "branch": "master", "commit": "009c214b6eadf49ec50fc81055ceb08ca3fcb8e1" },
55
"friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" },
6-
"lazy.nvim": { "branch": "main", "commit": "e5e9bf48211a13d9ee6c1077c88327c49c1ab4a0" },
7-
"lazydev.nvim": { "branch": "main", "commit": "a1b78b2ac6f978c72e76ea90ae92a94edf380cfc" },
8-
"lspconfig": { "branch": "master", "commit": "7af2c37192deae28d1305ae9e68544f7fb5408e1" },
9-
"mini": { "branch": "main", "commit": "4dd209e4f03bacd46d6d87408b2529a8823112fb" },
10-
"render-markdown.nvim": { "branch": "main", "commit": "e05a9f22f31c088ece3fa5928daf546a015b66ee" },
11-
"snacks": { "branch": "main", "commit": "b02cb5e8826179b385b870edbda1631213391cf1" },
12-
"treesitter": { "branch": "master", "commit": "00a513f87ee3c339c2024b08db3eb63ba7736ed6" }
6+
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
7+
"lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" },
8+
"lspconfig": { "branch": "master", "commit": "84e0cd5a3c58e88ef706fdf4a1eed59ded1d3ce2" },
9+
"mini": { "branch": "main", "commit": "22a7bcc9e67a86379e95edf00f62ed643f48f5e0" },
10+
"render-markdown.nvim": { "branch": "main", "commit": "b56fa1bc7b513f16a1c361b81438f4944b420a32" },
11+
"snacks": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" },
12+
"treesitter": { "branch": "master", "commit": "71ac531a6301b6d5f4dc4d7157ffd8bd8d6d769e" }
1313
}

lua/lazy_spec.lua

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
require("lazy").setup("plugins", {
2+
concurrency = 4,
3+
defaults = {
4+
lazy = true,
5+
},
6+
install = {
7+
colorscheme = { "catppuccin" },
8+
},
9+
dev = {
10+
path = vim.env.NVIM_DEV,
11+
},
12+
performance = {
13+
cache = {
14+
enabled = true,
15+
},
16+
reset_packpath = true,
17+
rtp = {
18+
disabled_plugins = {
19+
"osc52",
20+
"parser",
21+
"gzip",
22+
"netrwPlugin",
23+
"health",
24+
"man",
25+
"matchit",
26+
"rplugin",
27+
"tarPlugin",
28+
"tohtml",
29+
"tutor",
30+
"zipPlugin",
31+
"shadafile",
32+
"spellfile",
33+
"editorconfig",
34+
},
35+
},
36+
},
37+
ui = {
38+
border = "solid",
39+
title = "lazy.nvim",
40+
size = { width = 0.9, height = 0.9 },
41+
},
42+
})

lua/lsp.lua

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
local capabilities = vim.lsp.protocol.make_client_capabilities()
2+
3+
capabilities = require("blink.cmp").get_lsp_capabilities(capabilities)
4+
capabilities = vim.tbl_deep_extend("force", capabilities, {
5+
workspace = {
6+
didChangeWatchedFiles = {
7+
relativePatternSupport = true,
8+
},
9+
},
10+
})
11+
12+
local lspconfig = require "lspconfig"
13+
14+
lspconfig.rust_analyzer.setup {}
15+
16+
lspconfig.lua_ls.setup {
17+
filetypes = { "lua" },
18+
settings = {
19+
Lua = {
20+
runtime = {
21+
version = "LuaJIT",
22+
},
23+
completion = {
24+
callSnippet = "Replace",
25+
},
26+
diagnostics = {
27+
globals = { "vim" },
28+
},
29+
format = {
30+
defaultConfig = {
31+
},
32+
},
33+
hint = {
34+
enable = true,
35+
arrayIndex = 'Enable',
36+
},
37+
},
38+
},
39+
}
40+
41+
lspconfig.bashls.setup {}
42+
43+
lspconfig.gopls.setup {}
44+
45+
lspconfig.ts_ls.setup {
46+
settings = {
47+
completions = {
48+
completeFunctionCalls = true,
49+
},
50+
},
51+
}
52+
53+
lspconfig.nixd.setup({
54+
cmd = { "nixd" },
55+
settings = {
56+
nixd = {
57+
nixpkgs = {
58+
expr = "import <nixpkgs> { }",
59+
},
60+
formatting = {
61+
command = { "nixfmt" },
62+
},
63+
options = {
64+
home_manager = {
65+
expr = '(builtins.getFlake \"/Users/pwnwriter/.local/nix\").homeConfigurations.earlymoon.options',
66+
},
67+
nix_darwin = {
68+
expr = '(builtins.getFlake \"/Users/pwnwriter/.local/nix\").darwinConfigurations.earlymoon.options',
69+
},
70+
},
71+
},
72+
},
73+
})
74+
75+
76+
lspconfig.gleam.setup {}
77+
78+
lspconfig.zls.setup {}

lua/mappings.lua

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,6 @@ M.mini = function()
7777
builtin.grep_live()
7878
end, "Grep live")
7979

80-
vim.b[0].miniindentscope_disable = true
81-
82-
map({ "n" }, "<leader>tb", function()
83-
vim.b[0].miniindentscope_disable = not vim.b[0].miniindentscope_disable -- Toggle blankline animations
84-
end, "Toggle blankline animations")
85-
8680
map({ "n" }, "<leader>e", function()
8781
local _ = require("mini.files").close() or require("mini.files").open()
8882
end, "Toggle minifiles")
File renamed without changes.

lua/plugins/blink.lua

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
return
2+
{
3+
"saghen/blink.cmp",
4+
version = '*',
5+
event = { "LspAttach" },
6+
dependencies = {
7+
"rafamadriz/friendly-snippets",
8+
},
9+
opts = {
10+
keymap = { preset = 'enter' },
11+
sources = {
12+
default = { "lazydev", "lsp", "path", "snippets", "buffer" },
13+
providers = {
14+
cmdline = {
15+
min_keyword_length = 2,
16+
},
17+
lazydev = {
18+
name = "LazyDev",
19+
module = "lazydev.integrations.blink",
20+
score_offset = 100,
21+
},
22+
},
23+
},
24+
completion = {
25+
menu = {
26+
border = vim.g.border_style,
27+
scrolloff = 1,
28+
scrollbar = false,
29+
-- draw = {
30+
-- treesitter = { 'lsp' },
31+
-- }
32+
},
33+
documentation = {
34+
auto_show_delay_ms = 0,
35+
auto_show = true,
36+
window = {
37+
border = vim.g.border_style,
38+
},
39+
},
40+
},
41+
},
42+
}

lua/plugins/cpt.lua

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
return {
2+
"catppuccin/nvim",
3+
lazy = true,
4+
priority = 1000,
5+
name = "catppuccin",
6+
init = function()
7+
vim.cmd.colorscheme "catppuccin"
8+
end,
9+
opts = {
10+
transparent_background = not vim.g.neovide,
11+
compile_path = vim.fn.stdpath "cache" .. "/catppuccin",
12+
compile = true,
13+
flavour = "mocha",
14+
integrations = {
15+
snacks = true,
16+
treesitter = true,
17+
mason = true,
18+
blink_cmp = true,
19+
native_lsp = {
20+
enabled = true,
21+
virtual_text = {
22+
errors = { "italic" },
23+
hints = { "italic" },
24+
warnings = { "italic" },
25+
information = { "italic" },
26+
},
27+
underlines = {
28+
errors = { "undercurl" },
29+
hints = { "undercurl" },
30+
warnings = { "undercurl" },
31+
information = { "undercurl" },
32+
},
33+
},
34+
mini = {
35+
enabled = true,
36+
},
37+
},
38+
39+
},
40+
}

0 commit comments

Comments
 (0)