Skip to content

Commit 6b2ca9a

Browse files
authored
Merge pull request fastvim#34 from LambdaOrder/main
Major refactor
2 parents 63440b2 + 85b7e1e commit 6b2ca9a

File tree

13 files changed

+379
-666
lines changed

13 files changed

+379
-666
lines changed

init.lua

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
1-
require('fastvim.core.commands')
2-
require('fastvim.core.options')
1+
require "fastvim.core.commands"
2+
require "fastvim.core.options"
33

4-
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
4+
local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim"
55

66
if not vim.loop.fs_stat(lazypath) then
7-
vim.fn.system({
8-
"git",
9-
"clone",
10-
"--filter=blob:none",
11-
"https://github.com/folke/lazy.nvim.git",
12-
"--branch=stable",
13-
lazypath,
14-
})
7+
vim.fn.system {
8+
"git",
9+
"clone",
10+
"--filter=blob:none",
11+
"https://github.com/folke/lazy.nvim.git",
12+
"--branch=stable",
13+
lazypath,
14+
}
1515
end
1616

1717
vim.opt.rtp:prepend(lazypath)
18-
local plugins = require("fastvim.plugins")
18+
local plugins = require "fastvim.plugins"
1919

2020
require("lazy").setup(plugins)
2121

22-
vim.cmd("syntax enable")
23-
vim.cmd("colorscheme nekonight-dracula")
24-
require('fastvim.core.mappings')
25-
22+
vim.cmd "syntax enable"
23+
vim.cmd "colorscheme nekonight-dracula"
24+
require "fastvim.core.mappings"

lua/fastvim/configs/blink-cmp.lua

Lines changed: 82 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,94 @@
1-
local neokinds = require "neokinds"
1+
return {
2+
"saghen/blink.cmp",
3+
dependencies = "rafamadriz/friendly-snippets",
24

3-
require("blink-cmp").setup {
4-
completion = {
5-
-- TODO: fix this
6-
-- this block of code for some reason is breaking the whole plugin
7-
--list = {
8-
-- selection = {
9-
-- preselect = true,
10-
-- auto_insert = false,
11-
-- },
12-
-- },
13-
menu = {
14-
border = "rounded",
15-
winhighlight = "Normal:NormalFloat,FloatBorder:FloatBorder,CursorLine:PmenuSel,Search:None",
16-
draw = {
17-
components = {
18-
label = {
19-
text = require("colorful-menu").blink_components_text,
20-
highlight = require("colorful-menu").blink_components_highlight,
21-
},
22-
kind_icon = {
23-
text = function(ctx)
24-
local icon = neokinds.config.completion_kinds[ctx.kind] or ""
25-
return icon .. " " .. (ctx.kind or "")
26-
end,
27-
highlight = function(ctx)
28-
return "CmpItemKind" .. (ctx.kind or "Default")
29-
end,
5+
version = "*",
6+
---@module 'blink.cmp'
7+
---@type blink.cmp.Config
8+
config = function()
9+
local neokinds = require "neokinds"
10+
11+
require("blink-cmp").setup {
12+
completion = {
13+
-- TODO: fix this
14+
-- this block of code for some reason is breaking the whole plugin
15+
--list = {
16+
-- selection = {
17+
-- preselect = true,
18+
-- auto_insert = false,
19+
-- },
20+
-- },
21+
menu = {
22+
border = "rounded",
23+
winhighlight = "Normal:NormalFloat,FloatBorder:FloatBorder,CursorLine:PmenuSel,Search:None",
24+
draw = {
25+
components = {
26+
label = {
27+
text = require("colorful-menu").blink_components_text,
28+
highlight = require("colorful-menu").blink_components_highlight,
29+
},
30+
kind_icon = {
31+
text = function(ctx)
32+
local icon = neokinds.config.completion_kinds[ctx.kind] or ""
33+
return icon .. " " .. (ctx.kind or "")
34+
end,
35+
highlight = function(ctx)
36+
return "CmpItemKind" .. (ctx.kind or "Default")
37+
end,
38+
},
39+
},
3040
},
3141
},
3242
},
33-
},
34-
},
35-
keymap = {
36-
preset = "enter",
43+
keymap = {
44+
preset = "enter",
3745

38-
["<Up>"] = { "select_prev", "fallback" },
39-
["<Down>"] = { "select_next", "fallback" },
46+
["<Up>"] = { "select_prev", "fallback" },
47+
["<Down>"] = { "select_next", "fallback" },
4048

41-
["<C-space>"] = {
42-
function(cmp)
43-
cmp.show { providers = { "snippets" } }
44-
end,
45-
},
46-
["<C-y>"] = { "select_and_accept" },
47-
["<C-e>"] = { "hide" },
49+
["<C-space>"] = {
50+
function(cmp)
51+
cmp.show { providers = { "snippets" } }
52+
end,
53+
},
54+
["<C-y>"] = { "select_and_accept" },
55+
["<C-e>"] = { "hide" },
4856

49-
["<C-n>"] = { "select_next", "fallback" },
50-
["<C-p>"] = { "select_prev", "fallback" },
57+
["<C-n>"] = { "select_next", "fallback" },
58+
["<C-p>"] = { "select_prev", "fallback" },
5159

52-
["<C-b>"] = { "scroll_documentation_up", "fallback" },
53-
["<C-f>"] = { "scroll_documentation_down", "fallback" },
60+
["<C-b>"] = { "scroll_documentation_up", "fallback" },
61+
["<C-f>"] = { "scroll_documentation_down", "fallback" },
5462

55-
["<Tab>"] = { "snippet_forward", "fallback" },
56-
["<S-Tab>"] = { "snippet_backward", "fallback" },
57-
},
63+
["<Tab>"] = { "snippet_forward", "fallback" },
64+
["<S-Tab>"] = { "snippet_backward", "fallback" },
65+
},
5866

59-
appearance = {
60-
use_nvim_cmp_as_default = true,
61-
nerd_font_variant = "mono",
62-
use_nvim_cmp_as_default = true,
63-
},
64-
snippets = {
65-
expand = function(snippet)
66-
require("luasnip").lsp_expand(snippet)
67-
end,
68-
active = function(filter)
69-
if filter and filter.direction then
70-
return require("luasnip").jumpable(filter.direction)
71-
end
72-
return require("luasnip").in_snippet()
73-
end,
74-
jump = function(direction)
75-
require("luasnip").jump(direction)
76-
end,
77-
},
67+
appearance = {
68+
use_nvim_cmp_as_default = true,
69+
nerd_font_variant = "mono",
70+
use_nvim_cmp_as_default = true,
71+
},
72+
snippets = {
73+
expand = function(snippet)
74+
require("luasnip").lsp_expand(snippet)
75+
end,
76+
active = function(filter)
77+
if filter and filter.direction then
78+
return require("luasnip").jumpable(filter.direction)
79+
end
80+
return require("luasnip").in_snippet()
81+
end,
82+
jump = function(direction)
83+
require("luasnip").jump(direction)
84+
end,
85+
},
7886

79-
sources = {
80-
default = { "lsp", "path", "snippets", "buffer" },
81-
cmdline = {},
82-
},
83-
-- opts_extend = { "sources.default" },
87+
sources = {
88+
default = { "lsp", "path", "snippets", "buffer" },
89+
cmdline = {},
90+
},
91+
-- opts_extend = { "sources.default" },
92+
}
93+
end,
8494
}

lua/fastvim/configs/bufferline.lua

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
return {
2-
options = {
3-
themable = true,
4-
offsets = {
5-
{ filetype = "NvimTree", highlight = "NvimTreeNormal" },
6-
},
2+
"akinsho/bufferline.nvim",
3+
event = "BufReadPre",
4+
opts = {
5+
themable = true,
6+
offsets = {
7+
{ filetype = "NvimTree", highlight = "NvimTreeNormal" },
78
},
8-
}
9+
},
10+
}

lua/fastvim/configs/colorful-menu.lua

Lines changed: 41 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,42 @@
1-
require("colorful-menu").setup({
2-
ls = {
3-
lua_ls = {
4-
arguments_hl = "@comment",
5-
},
6-
gopls = {
7-
add_colon_before_type = false,
8-
},
9-
["typescript-language-server"] = {
10-
extra_info_hl = "@comment",
11-
},
12-
["typescript-tools"] = {
13-
extra_info_hl = "@comment",
14-
},
15-
ts_ls = {
16-
extra_info_hl = "@comment",
17-
},
18-
tsserver = {
19-
extra_info_hl = "@comment",
20-
},
21-
vtsls = {
22-
extra_info_hl = "@comment",
23-
},
24-
["rust-analyzer"] = {
25-
extra_info_hl = "@comment",
26-
},
27-
clangd = {
28-
extra_info_hl = "@comment",
29-
},
30-
roslyn = {
31-
extra_info_hl = "@comment",
32-
},
33-
fallback = true,
34-
},
35-
fallback_highlight = "@variable",
1+
return {
2+
"xzbdmw/colorful-menu.nvim",
3+
config = function()
4+
require("colorful-menu").setup {
5+
ls = {
6+
lua_ls = {
7+
arguments_hl = "@comment",
8+
},
9+
gopls = {
10+
add_colon_before_type = false,
11+
},
12+
["typescript-language-server"] = {
13+
extra_info_hl = "@comment",
14+
},
15+
["typescript-tools"] = {
16+
extra_info_hl = "@comment",
17+
},
18+
ts_ls = {
19+
extra_info_hl = "@comment",
20+
},
21+
tsserver = {
22+
extra_info_hl = "@comment",
23+
},
24+
vtsls = {
25+
extra_info_hl = "@comment",
26+
},
27+
["rust-analyzer"] = {
28+
extra_info_hl = "@comment",
29+
},
30+
clangd = {
31+
extra_info_hl = "@comment",
32+
},
33+
roslyn = {
34+
extra_info_hl = "@comment",
35+
},
36+
fallback = true,
37+
},
38+
fallback_highlight = "@variable",
3639
max_width = 60,
37-
})
38-
40+
}
41+
end,
42+
}

0 commit comments

Comments
 (0)