44 -- blink.cmp (https://github.com/saghen/blink.cmp)
55 {
66 " saghen/blink.cmp" ,
7- event = " InsertEnter" ,
7+ event = { " InsertEnter" , " CmdlineEnter " } ,
88 version = not vim .g .lazyvim_blink_main and " *" ,
99 build = vim .g .lazyvim_blink_main and " cargo build --release" ,
1010 opts_extend = {
@@ -27,6 +27,20 @@ return {
2727 },
2828 cmdline = {
2929 enabled = false ,
30+ keymap = {
31+ preset = " cmdline" ,
32+ [" <Right>" ] = false ,
33+ [" <Left>" ] = false ,
34+ },
35+ completion = {
36+ list = { selection = { preselect = false } },
37+ menu = {
38+ auto_show = function (_ctx )
39+ return vim .fn .getcmdtype () == " :"
40+ end ,
41+ },
42+ ghost_text = { enabled = true },
43+ },
3044 },
3145 completion = {
3246 accept = {
@@ -566,7 +580,7 @@ return {
566580 -- nvim-lspconfig (https://github.com/neovim/nvim-lspconfig)
567581 {
568582 " neovim/nvim-lspconfig" ,
569- event = " VeryLazy " ,
583+ event = { " BufReadPre " , " BufNewFile " , " BufWritePre " } ,
570584 dependencies = {
571585 -- https://github.com/mason-org/mason.nvim
572586 { " mason-org/mason.nvim" , version = " ^1.0.0" },
@@ -703,6 +717,7 @@ return {
703717 },
704718 },
705719 nil_ls = {},
720+ rust_analyzer = { enabled = false },
706721 tailwindcss = {
707722 filetypes_exclude = { " markdown" },
708723 filetypes_include = {},
@@ -826,11 +841,10 @@ return {
826841 -- Specify * to use this function as a fallback for any server
827842 -- ["*"] = function(server, opts) end,
828843 tailwindcss = function (_ , opts )
829- local tw = require (" util.lsp" ).get_raw_config (" tailwindcss" )
830844 opts .filetypes = opts .filetypes or {}
831845
832846 -- Add default filetypes
833- vim .list_extend (opts .filetypes , tw . default_config .filetypes )
847+ vim .list_extend (opts .filetypes , vim . lsp . config . tailwindcss .filetypes )
834848
835849 -- Remove excluded filetypes
836850 --- @param ft string
@@ -859,14 +873,14 @@ return {
859873 local action , uri , range = unpack (command .arguments )
860874
861875 local function move (newf )
862- client . request (" workspace/executeCommand" , {
876+ client : request (" workspace/executeCommand" , {
863877 command = command .command ,
864878 arguments = { action , uri , range , newf },
865879 })
866880 end
867881
868882 local fname = vim .uri_to_fname (uri )
869- client . request (" workspace/executeCommand" , {
883+ client : request (" workspace/executeCommand" , {
870884 command = " typescript.tsserverRequest" ,
871885 arguments = {
872886 " getMoveToRefactoringFileSuggestions" ,
@@ -960,14 +974,13 @@ return {
960974 end
961975
962976 if type (opts .diagnostics .virtual_text ) == " table" and opts .diagnostics .virtual_text .prefix == " icons" then
963- opts .diagnostics .virtual_text .prefix = vim .fn .has (" nvim-0.10.0" ) == 0 and " ●"
964- or function (diagnostic )
965- for d , icon in pairs (icons ) do
966- if diagnostic .severity == vim .diagnostic .severity [d :upper ()] then
967- return icon
968- end
977+ opts .diagnostics .virtual_text .prefix = function (diagnostic )
978+ for d , icon in pairs (icons .diagnostics ) do
979+ if diagnostic .severity == vim .diagnostic .severity [d :upper ()] then
980+ return icon
969981 end
970982 end
983+ end
971984 end
972985
973986 vim .diagnostic .config (vim .deepcopy (opts .diagnostics ))
@@ -1084,13 +1097,15 @@ return {
10841097 " nix" ,
10851098 " regex" ,
10861099 " rust" ,
1100+ " ron" ,
10871101 " svelte" ,
10881102 " toml" ,
10891103 " tsx" ,
10901104 " typescript" ,
10911105 " vim" ,
10921106 " vimdoc" ,
10931107 " vue" ,
1108+ " yaml" ,
10941109 },
10951110 highlight = { enable = true },
10961111 indent = { enable = true },
@@ -1232,6 +1247,76 @@ return {
12321247 end ,
12331248 },
12341249
1250+ -- rustaceanvim (https://github.com/mrcjkb/rustaceanvim)
1251+ {
1252+ " mrcjkb/rustaceanvim" ,
1253+ ft = { " rust" },
1254+ opts = {
1255+ server = {
1256+ on_attach = function (_ , bufnr )
1257+ vim .keymap .set (" n" , " <leader>cR" , function ()
1258+ vim .cmd .RustLsp (" codeAction" )
1259+ end , { desc = " Code Action" , buffer = bufnr })
1260+ vim .keymap .set (" n" , " <leader>dr" , function ()
1261+ vim .cmd .RustLsp (" debuggables" )
1262+ end , { desc = " Rust Debuggables" , buffer = bufnr })
1263+ end ,
1264+ default_settings = {
1265+ -- rust-analyzer language server configuration
1266+ [" rust-analyzer" ] = {
1267+ cargo = {
1268+ allFeatures = true ,
1269+ loadOutDirsFromCheck = true ,
1270+ buildScripts = {
1271+ enable = true ,
1272+ },
1273+ },
1274+ checkOnSave = true ,
1275+ diagnostics = {
1276+ enable = true ,
1277+ },
1278+ procMacro = {
1279+ enable = true ,
1280+ },
1281+ files = {
1282+ exclude = {
1283+ " .direnv" ,
1284+ " .git" ,
1285+ " .jj" ,
1286+ " .github" ,
1287+ " .gitlab" ,
1288+ " bin" ,
1289+ " node_modules" ,
1290+ " target" ,
1291+ " venv" ,
1292+ " .venv" ,
1293+ },
1294+ -- Avoid Roots Scanned hanging, see https://github.com/rust-lang/rust-analyzer/issues/12613#issuecomment-2096386344
1295+ watcher = " client" ,
1296+ },
1297+ },
1298+ },
1299+ },
1300+ },
1301+ config = function (_ , opts )
1302+ -- if LazyVim.has("mason.nvim") then
1303+ -- local codelldb = vim.fn.exepath("codelldb")
1304+ -- local codelldb_lib_ext = io.popen("uname"):read("*l") == "Linux" and ".so" or ".dylib"
1305+ -- local library_path = vim.fn.expand("$MASON/opt/lldb/lib/liblldb" .. codelldb_lib_ext)
1306+ -- opts.dap = {
1307+ -- adapter = require("rustaceanvim.config").get_codelldb_adapter(codelldb, library_path),
1308+ -- }
1309+ -- end
1310+ vim .g .rustaceanvim = vim .tbl_deep_extend (" keep" , vim .g .rustaceanvim or {}, opts or {})
1311+ if vim .fn .executable (" rust-analyzer" ) == 0 then
1312+ require (" util.init" ).error (
1313+ " **rust-analyzer** not found in PATH, please install it.\n https://rust-analyzer.github.io/" ,
1314+ { title = " rustaceanvim" }
1315+ )
1316+ end
1317+ end ,
1318+ },
1319+
12351320 -- snacks.nvim (https://github.com/folke/snacks.nvim)
12361321 {
12371322 " folke/snacks.nvim" ,
0 commit comments