@@ -267,7 +267,7 @@ vim.keymap.set('i', '<C-k>', vim.lsp.buf.signature_help)
267267-- Enable number in netrw
268268vim .g .netrw_bufsettings = ' noma nomod nu rnu nobl nowrap ro'
269269
270- -- NOTE: Some terminals have coliding keymaps or are not able to send distinct keycodes
270+ -- NOTE: Some terminals have colliding keymaps or are not able to send distinct keycodes
271271-- vim.keymap.set("n", "<C-S-h>", "<C-w>H", { desc = "Move window to the left" })
272272-- vim.keymap.set("n", "<C-S-l>", "<C-w>L", { desc = "Move window to the right" })
273273-- vim.keymap.set("n", "<C-S-j>", "<C-w>J", { desc = "Move window to the lower" })
@@ -426,7 +426,6 @@ require('lazy').setup({
426426 { -- Fuzzy Finder (files, lsp, etc)
427427 ' nvim-telescope/telescope.nvim' ,
428428 event = ' VimEnter' ,
429- branch = ' 0.1.x' ,
430429 dependencies = {
431430 ' nvim-lua/plenary.nvim' ,
432431 { -- If encountering errors, see telescope-fzf-native README for installation instructions
@@ -555,8 +554,8 @@ require('lazy').setup({
555554 -- Useful status updates for LSP.
556555 { ' j-hui/fidget.nvim' , opts = {} },
557556
558- -- Allows extra capabilities provided by nvim- cmp
559- ' hrsh7th/ cmp-nvim-lsp ' ,
557+ -- Allows extra capabilities provided by blink. cmp
558+ ' saghen/blink. cmp' ,
560559 },
561560 config = function ()
562561 -- Brief aside: **What is LSP?**
@@ -733,10 +732,9 @@ require('lazy').setup({
733732
734733 -- LSP servers and clients are able to communicate to each other what features they support.
735734 -- By default, Neovim doesn't support everything that is in the LSP specification.
736- -- When you add nvim-cmp, luasnip, etc. Neovim now has *more* capabilities.
737- -- So, we create new capabilities with nvim cmp, and then broadcast that to the servers.
738- local capabilities = vim .lsp .protocol .make_client_capabilities ()
739- capabilities = vim .tbl_deep_extend (' force' , capabilities , require (' cmp_nvim_lsp' ).default_capabilities ())
735+ -- When you add blink.cmp, luasnip, etc. Neovim now has *more* capabilities.
736+ -- So, we create new capabilities with blink.cmp, and then broadcast that to the servers.
737+ local capabilities = require (' blink.cmp' ).get_lsp_capabilities ()
740738
741739 -- Enable the following language servers
742740 -- Feel free to add/remove any LSPs that you want here. They will automatically be installed.
@@ -959,12 +957,14 @@ require('lazy').setup({
959957 },
960958
961959 { -- Autocompletion
962- ' hrsh7th/nvim-cmp' ,
963- event = ' InsertEnter' ,
960+ ' saghen/blink.cmp' ,
961+ event = ' VimEnter' ,
962+ version = ' 1.*' ,
964963 dependencies = {
965- -- Snippet Engine & its associated nvim-cmp source
964+ -- Snippet Engine
966965 {
967966 ' L3MON4D3/LuaSnip' ,
967+ version = ' 2.*' ,
968968 build = (function ()
969969 -- Build Step is needed for regex support in snippets.
970970 -- This step is not supported in many windows environments.
@@ -985,98 +985,74 @@ require('lazy').setup({
985985 end ,
986986 },
987987 },
988+ opts = {},
988989 },
989- ' saadparwaiz1/cmp_luasnip' ,
990-
991- -- Adds other completion capabilities.
992- -- nvim-cmp does not ship with all sources by default. They are split
993- -- into multiple repos for maintenance purposes.
994- ' hrsh7th/cmp-nvim-lsp' ,
995- ' hrsh7th/cmp-path' ,
996- ' hrsh7th/cmp-nvim-lsp-signature-help' ,
990+ ' folke/lazydev.nvim' ,
997991 },
998- config = function ()
999- -- See `:help cmp`
1000- local cmp = require ' cmp'
1001- local luasnip = require ' luasnip'
1002- luasnip .config .setup {}
1003-
1004- cmp .setup {
1005- -- https://github.com/hrsh7th/cmp-nvim-lsp-signature-help/issues/17
1006- -- preselect = cmp.PreselectMode.None,
1007- snippet = {
1008- expand = function (args )
1009- luasnip .lsp_expand (args .body )
1010- end ,
1011- },
1012- completion = { completeopt = ' menu,menuone,noinsert,noselect' },
1013-
1014- -- For an understanding of why these mappings were
1015- -- chosen, you will need to read `:help ins-completion`
992+ --- @module ' blink.cmp'
993+ --- @type blink.cmp.Config
994+ opts = {
995+ keymap = {
996+ -- 'default' (recommended) for mappings similar to built-in completions
997+ -- <c-y> to accept ([y]es) the completion.
998+ -- This will auto-import if your LSP supports it.
999+ -- This will expand snippets if the LSP sent a snippet.
1000+ -- 'super-tab' for tab to accept
1001+ -- 'enter' for enter to accept
1002+ -- 'none' for no mappings
1003+ --
1004+ -- For an understanding of why the 'default' preset is recommended,
1005+ -- you will need to read `:help ins-completion`
10161006 --
10171007 -- No, but seriously. Please read `:help ins-completion`, it is really good!
1018- mapping = cmp .mapping .preset .insert {
1019- -- Select the [n]ext item
1020- -- ['<C-n>'] = cmp.mapping.select_next_item(),
1021- -- Select the [p]revious item
1022- -- ['<C-p>'] = cmp.mapping.select_prev_item(),
1023-
1024- -- Scroll the documentation window [b]ack / [f]orward
1025- [' <C-b>' ] = cmp .mapping .scroll_docs (- 4 ),
1026- [' <C-f>' ] = cmp .mapping .scroll_docs (4 ),
1027-
1028- -- Accept ([y]es) the completion.
1029- -- This will auto-import if your LSP supports it.
1030- -- This will expand snippets if the LSP sent a snippet.
1031- -- ['<C-y>'] = cmp.mapping.confirm { select = true },
1032-
1033- -- If you prefer more traditional completion keymaps,
1034- -- you can uncomment the following lines
1035- [' <CR>' ] = cmp .mapping .confirm { select = false },
1036- -- ['<Tab>'] = cmp.mapping.select_next_item(),
1037- -- ['<S-Tab>'] = cmp.mapping.select_prev_item(),
1038-
1039- -- Manually trigger a completion from nvim-cmp.
1040- -- Generally you don't need this, because nvim-cmp will display
1041- -- completions whenever it has completion options available.
1042- [' <C-Space>' ] = cmp .mapping .complete {},
1043-
1044- -- Think of <c-l> as moving to the right of your snippet expansion.
1045- -- So if you have a snippet that's like:
1046- -- function $name($args)
1047- -- $body
1048- -- end
1049- --
1050- -- <c-l> will move you to the right of each of the expansion locations.
1051- -- <c-h> is similar, except moving you backwards.
1052- [' <C-l>' ] = cmp .mapping (function ()
1053- if luasnip .expand_or_locally_jumpable () then
1054- luasnip .expand_or_jump ()
1055- end
1056- end , { ' i' , ' s' }),
1057- [' <C-h>' ] = cmp .mapping (function ()
1058- if luasnip .locally_jumpable (- 1 ) then
1059- luasnip .jump (- 1 )
1060- end
1061- end , { ' i' , ' s' }),
1008+ --
1009+ -- All presets have the following mappings:
1010+ -- <tab>/<s-tab>: move to right/left of your snippet expansion
1011+ -- <c-space>: Open menu or open docs if already open
1012+ -- <c-n>/<c-p> or <up>/<down>: Select next/previous item
1013+ -- <c-e>: Hide menu
1014+ -- <c-k>: Toggle signature help
1015+ --
1016+ -- See :h blink-cmp-config-keymap for defining your own keymap
1017+ preset = ' default' ,
10621018
1063- -- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see:
1064- -- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
1065- },
1066- sources = {
1067- -- { name = 'copilot', group_index = 2 },
1068- {
1069- name = ' lazydev' ,
1070- -- set group index to 0 to skip loading LuaLS completions as lazydev recommends it
1071- group_index = 0 ,
1072- },
1073- { name = ' nvim_lsp' },
1074- { name = ' luasnip' },
1075- { name = ' path' },
1076- { name = ' nvim_lsp_signature_help' },
1019+ -- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see:
1020+ -- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
1021+ },
1022+
1023+ appearance = {
1024+ -- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
1025+ -- Adjusts spacing to ensure icons are aligned
1026+ nerd_font_variant = ' mono' ,
1027+ },
1028+
1029+ completion = {
1030+ -- By default, you may press `<c-space>` to show the documentation.
1031+ -- Optionally, set `auto_show = true` to show the documentation after a delay.
1032+ documentation = { auto_show = false , auto_show_delay_ms = 500 },
1033+ },
1034+
1035+ sources = {
1036+ default = { ' lsp' , ' path' , ' snippets' , ' lazydev' },
1037+ providers = {
1038+ lazydev = { module = ' lazydev.integrations.blink' , score_offset = 100 },
10771039 },
1078- }
1079- end ,
1040+ },
1041+
1042+ snippets = { preset = ' luasnip' },
1043+
1044+ -- Blink.cmp includes an optional, recommended rust fuzzy matcher,
1045+ -- which automatically downloads a prebuilt binary when enabled.
1046+ --
1047+ -- By default, we use the Lua implementation instead, but you may enable
1048+ -- the rust implementation via `'prefer_rust_with_warning'`
1049+ --
1050+ -- See :h blink-cmp-config-fuzzy for more information
1051+ fuzzy = { implementation = ' lua' },
1052+
1053+ -- Shows a signature help window while you type arguments for a function
1054+ signature = { enabled = true },
1055+ },
10801056 },
10811057
10821058 { -- You can easily change to a different colorscheme.
0 commit comments