diff options
author | Yigit Sever | 2024-02-09 01:40:58 +0300 |
---|---|---|
committer | Yigit Sever | 2024-02-09 01:40:58 +0300 |
commit | 8aecc1b1a2b11065099060f6695682420ffaac1e (patch) | |
tree | d216da280a786ff20c96b69a8d81c682aa2097df | |
parent | c818bf2a6758580063aecf97860bdb1d02789d60 (diff) | |
download | dotfiles-8aecc1b1a2b11065099060f6695682420ffaac1e.tar.gz dotfiles-8aecc1b1a2b11065099060f6695682420ffaac1e.tar.bz2 dotfiles-8aecc1b1a2b11065099060f6695682420ffaac1e.zip |
nvim: switch to vim-snippets luasnip fork
https://www.reddit.com/r/neovim/comments/18w0ule/luasnip_snippet_collection_from_vimsnippets/
-rw-r--r-- | .config/nvim/lazy-lock.json | 54 | ||||
-rw-r--r-- | .config/nvim/lua/plugins/cmp.lua | 39 | ||||
-rw-r--r-- | .config/nvim/lua/plugins/lsp.lua | 3 |
3 files changed, 53 insertions, 43 deletions
diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 4cb8082..12bfba2 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json | |||
@@ -1,8 +1,8 @@ | |||
1 | { | 1 | { |
2 | "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, | 2 | "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, |
3 | "LuaSnip": { "branch": "master", "commit": "8ae1dedd988eb56441b7858bd1e8554dfadaa46d" }, | 3 | "LuaSnip": { "branch": "master", "commit": "8ae1dedd988eb56441b7858bd1e8554dfadaa46d" }, |
4 | "barbar.nvim": { "branch": "master", "commit": "4ba9ac54f0c5d82131905160afff94172e3325e6" }, | 4 | "barbar.nvim": { "branch": "master", "commit": "71ac376acd000743146b1e08e62151b4d887bbac" }, |
5 | "catppuccin": { "branch": "main", "commit": "5e36ca599f4aa41bdd87fbf2c5aae4397ac55074" }, | 5 | "catppuccin": { "branch": "main", "commit": "c2034f7b549152e5cc757820426341ea5000bc7a" }, |
6 | "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, | 6 | "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, |
7 | "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, | 7 | "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, |
8 | "cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "3d8912ebeb56e5ae08ef0906e3a54de1c66b92f1" }, | 8 | "cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "3d8912ebeb56e5ae08ef0906e3a54de1c66b92f1" }, |
@@ -10,45 +10,45 @@ | |||
10 | "cmp-omni": { "branch": "main", "commit": "4ef610bbd85a5ee4e97e09450c0daecbdc60de86" }, | 10 | "cmp-omni": { "branch": "main", "commit": "4ef610bbd85a5ee4e97e09450c0daecbdc60de86" }, |
11 | "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, | 11 | "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, |
12 | "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, | 12 | "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, |
13 | "dashboard-nvim": { "branch": "master", "commit": "63df28409d940f9cac0a925df09d3dc369db9841" }, | 13 | "dashboard-nvim": { "branch": "master", "commit": "04a48b2e230bc5e50dd099d839443703023b0472" }, |
14 | "dial.nvim": { "branch": "master", "commit": "27eb570085db2ef44bff4f620d3806039184651c" }, | 14 | "dial.nvim": { "branch": "master", "commit": "27eb570085db2ef44bff4f620d3806039184651c" }, |
15 | "fidget.nvim": { "branch": "main", "commit": "a4a7edfea37e557dbff5509ee374ffb57051bba9" }, | 15 | "fidget.nvim": { "branch": "main", "commit": "ad8873c16faa123fe3f9fd6539c41dfb0f97a9e9" }, |
16 | "gitsigns.nvim": { "branch": "main", "commit": "d195f0c35ced5174d3ecce1c4c8ebb3b5bc23fa9" }, | 16 | "gitsigns.nvim": { "branch": "main", "commit": "2c2463dbd82eddd7dbab881c3a62cfbfbe3c67ae" }, |
17 | "indent-blankline.nvim": { "branch": "master", "commit": "5da5546947f3125dfd6aa85ab21074dc83f776d5" }, | 17 | "indent-blankline.nvim": { "branch": "master", "commit": "12e92044d313c54c438bd786d11684c88f6f78cd" }, |
18 | "lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" }, | 18 | "lazy.nvim": { "branch": "main", "commit": "aedcd79811d491b60d0a6577a9c1701063c2a609" }, |
19 | "leap.nvim": { "branch": "main", "commit": "2d6bb13978482e1220dd5903d8f72a75a0b6623b" }, | 19 | "leap.nvim": { "branch": "main", "commit": "46e9b1a1d7438ac72794b0857b20cad4390b827c" }, |
20 | "ltex-extra.nvim": { "branch": "master", "commit": "9bed99b2b8488cc2daf66c76d2e0cf051ee80d13" }, | 20 | "ltex-extra.nvim": { "branch": "master", "commit": "42dd3572cb09b52a137e91e515f2dff5eb631b1e" }, |
21 | "lualine.nvim": { "branch": "master", "commit": "566b7036f717f3d676362742630518a47f132fff" }, | 21 | "lualine.nvim": { "branch": "master", "commit": "7d131a8d3ba5016229e8a1d08bf8782acea98852" }, |
22 | "neodev.nvim": { "branch": "main", "commit": "7cb4f7f29c6bf6f1d21a37f6dd6d12ba64266b09" }, | 22 | "luasnip-snippets": { "branch": "main", "commit": "26eba1b626fea8747babead4c20ee164c3b10b03" }, |
23 | "nvim-autopairs": { "branch": "master", "commit": "9fd41181693dd4106b3e414a822bb6569924de81" }, | 23 | "neodev.nvim": { "branch": "main", "commit": "0ee95ecefc8ea45898a0383364f736e098c8703f" }, |
24 | "nvim-cmp": { "branch": "main", "commit": "538e37ba87284942c1d76ed38dd497e54e65b891" }, | 24 | "nvim-autopairs": { "branch": "master", "commit": "096d0baecc34f6c5d8a6dd25851e9d5ad338209b" }, |
25 | "nvim-lspconfig": { "branch": "master", "commit": "9bedcfed749755e43fc8bed46f85ce2044fe3b77" }, | 25 | "nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" }, |
26 | "nvim-lspconfig": { "branch": "master", "commit": "1bc83418927003552505ec66fa5d6cffae953f6a" }, | ||
26 | "nvim-surround": { "branch": "main", "commit": "703ec63aa798e5e07d309b35e42def34bebe0174" }, | 27 | "nvim-surround": { "branch": "main", "commit": "703ec63aa798e5e07d309b35e42def34bebe0174" }, |
27 | "nvim-tree.lua": { "branch": "master", "commit": "f1b3e6a7eb92da492bd693257367d9256839ed3d" }, | 28 | "nvim-tree.lua": { "branch": "master", "commit": "8cbb1db8e90b62fc56f379992e622e9f919792ce" }, |
28 | "nvim-treesitter": { "branch": "master", "commit": "e49f1e8ef3e8450a8446cb1f2bbb53c919f60b6d" }, | 29 | "nvim-treesitter": { "branch": "master", "commit": "cbf0dfd92f3149a378164ab781d0b0a13da5b04a" }, |
29 | "nvim-treesitter-textobjects": { "branch": "master", "commit": "85b9d0cbd4ff901abcda862b50dbb34e0901848b" }, | 30 | "nvim-treesitter-textobjects": { "branch": "master", "commit": "dd0b2036c3a27cb6e6486f8bd24188c6ca43af0b" }, |
30 | "nvim-ufo": { "branch": "main", "commit": "c6d88523f574024b788f1c3400c5d5b9bb1a0407" }, | 31 | "nvim-ufo": { "branch": "main", "commit": "b0741a647efd98d9abb6cb653e056d24a07e4581" }, |
31 | "nvim-web-devicons": { "branch": "master", "commit": "cff25ce621e6d15fae0b0bfe38c00be50ce38468" }, | 32 | "nvim-web-devicons": { "branch": "master", "commit": "313d9e7193354c5de7cdb1724f9e2d3f442780b0" }, |
32 | "plenary.nvim": { "branch": "master", "commit": "55d9fe89e33efd26f532ef20223e5f9430c8b0c0" }, | 33 | "plenary.nvim": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" }, |
33 | "promise-async": { "branch": "main", "commit": "94f6f03c6c1e2aab551aacdf0c1e597a7269abb6" }, | 34 | "promise-async": { "branch": "main", "commit": "94f6f03c6c1e2aab551aacdf0c1e597a7269abb6" }, |
34 | "rust-tools.nvim": { "branch": "master", "commit": "0cc8adab23117783a0292a0c8a2fbed1005dc645" }, | 35 | "rust-tools.nvim": { "branch": "master", "commit": "676187908a1ce35ffcd727c654ed68d851299d3e" }, |
35 | "substitute.nvim": { "branch": "main", "commit": "17ffaeb5a1dc2dbef39cf0865d8a4b6000836714" }, | 36 | "substitute.nvim": { "branch": "main", "commit": "17ffaeb5a1dc2dbef39cf0865d8a4b6000836714" }, |
36 | "tabular": { "branch": "master", "commit": "339091ac4dd1f17e225fe7d57b48aff55f99b23a" }, | 37 | "tabular": { "branch": "master", "commit": "339091ac4dd1f17e225fe7d57b48aff55f99b23a" }, |
37 | "targets.vim": { "branch": "master", "commit": "642d3a4ce306264b05ea3219920b13ea80931767" }, | 38 | "targets.vim": { "branch": "master", "commit": "642d3a4ce306264b05ea3219920b13ea80931767" }, |
38 | "telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" }, | 39 | "telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" }, |
39 | "telescope.nvim": { "branch": "master", "commit": "3466159b0fcc1876483f6f53587562628664d850" }, | 40 | "telescope.nvim": { "branch": "master", "commit": "236083884cfe6c874e03e6cb4e7cb08809c1333c" }, |
40 | "trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" }, | 41 | "trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" }, |
41 | "turkish-deasciifier.vim": { "branch": "master", "commit": "5b3a0bfef7424d218df7ab3dac8ee9dab42a105e" }, | 42 | "turkish-deasciifier.vim": { "branch": "master", "commit": "5b3a0bfef7424d218df7ab3dac8ee9dab42a105e" }, |
42 | "vim-characterize": { "branch": "master", "commit": "7fc5b75e7a9e46676cf736b56d99dd32004ff3d6" }, | 43 | "vim-characterize": { "branch": "master", "commit": "7fc5b75e7a9e46676cf736b56d99dd32004ff3d6" }, |
43 | "vim-cutlass": { "branch": "master", "commit": "7afd649415541634c8ce317fafbc31cd19d57589" }, | 44 | "vim-cutlass": { "branch": "master", "commit": "7afd649415541634c8ce317fafbc31cd19d57589" }, |
44 | "vim-fugitive": { "branch": "master", "commit": "59659093581aad2afacedc81f009ed6a4bfad275" }, | 45 | "vim-fugitive": { "branch": "master", "commit": "fab00f7c0f3a08e860e39c7adeb8fbe849921a98" }, |
45 | "vim-illuminate": { "branch": "master", "commit": "3bd2ab64b5d63b29e05691e624927e5ebbf0fb86" }, | 46 | "vim-illuminate": { "branch": "master", "commit": "305bf07b919ac526deb5193280379e2f8b599926" }, |
46 | "vim-move": { "branch": "master", "commit": "3c4195de0748da9bba25c54d78d959d349e93c55" }, | 47 | "vim-move": { "branch": "master", "commit": "3c4195de0748da9bba25c54d78d959d349e93c55" }, |
47 | "vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" }, | 48 | "vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" }, |
48 | "vim-snippets": { "branch": "master", "commit": "ba72b08e04e184ecd0a2a1b8012a81ddb040dbc3" }, | ||
49 | "vim-unimpaired": { "branch": "master", "commit": "6d44a6dc2ec34607c41ec78acf81657248580bf1" }, | 49 | "vim-unimpaired": { "branch": "master", "commit": "6d44a6dc2ec34607c41ec78acf81657248580bf1" }, |
50 | "vimtex": { "branch": "master", "commit": "930804866f1fecd0b337c0f3e7333c6dd46ba149" }, | 50 | "vimtex": { "branch": "master", "commit": "cb0fd1b437a6b3797ed4dfd01a0aa0ae97b23871" }, |
51 | "vimwiki": { "branch": "dev", "commit": "5f0a6c7523df3a15cc0331dc050a680ee4ddff04" }, | 51 | "vimwiki": { "branch": "dev", "commit": "5f0a6c7523df3a15cc0331dc050a680ee4ddff04" }, |
52 | "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" }, | 52 | "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" }, |
53 | "yanky.nvim": { "branch": "main", "commit": "6bb9ffd3cad4c9876bda54e19d0659de28a4f84f" } | 53 | "yanky.nvim": { "branch": "main", "commit": "7c5cbf0122ff2dfbb6a92f14885894f65949cc8b" } |
54 | } \ No newline at end of file | 54 | } \ No newline at end of file |
diff --git a/.config/nvim/lua/plugins/cmp.lua b/.config/nvim/lua/plugins/cmp.lua index 6a93009..2e8fade 100644 --- a/.config/nvim/lua/plugins/cmp.lua +++ b/.config/nvim/lua/plugins/cmp.lua | |||
@@ -10,7 +10,6 @@ return { | |||
10 | "hrsh7th/cmp-nvim-lsp-signature-help", | 10 | "hrsh7th/cmp-nvim-lsp-signature-help", |
11 | "L3MON4D3/LuaSnip", | 11 | "L3MON4D3/LuaSnip", |
12 | "saadparwaiz1/cmp_luasnip", | 12 | "saadparwaiz1/cmp_luasnip", |
13 | "honza/vim-snippets", | ||
14 | }, | 13 | }, |
15 | config = function() | 14 | config = function() |
16 | local cmp = require("cmp") | 15 | local cmp = require("cmp") |
@@ -142,27 +141,41 @@ return { | |||
142 | end, | 141 | end, |
143 | }, | 142 | }, |
144 | { | 143 | { |
144 | 'mireq/luasnip-snippets', | ||
145 | dependencies = {'L3MON4D3/LuaSnip'}, | ||
146 | init = function() | ||
147 | require('luasnip_snippets.common.snip_utils').setup() | ||
148 | end | ||
149 | |||
150 | }, | ||
151 | { | ||
145 | "L3MON4D3/LuaSnip", | 152 | "L3MON4D3/LuaSnip", |
146 | version = "v2.*", | 153 | version = "v2.*", |
147 | dependencies = { | 154 | dependencies = { |
148 | "honza/vim-snippets", | 155 | 'nvim-treesitter/nvim-treesitter', |
149 | }, | 156 | }, |
150 | build = "make install_jsregexp", | 157 | build = "make install_jsregexp", |
151 | keys = { | ||
152 | { | ||
153 | "<C-l>", | ||
154 | function() require("luasnip").expand_or_jump() end, | ||
155 | mode = { "i", "s" }, | ||
156 | }, | ||
157 | }, | ||
158 | opts = { | 158 | opts = { |
159 | history = false, | 159 | history = false, |
160 | region_check_events = 'InsertEnter', | 160 | region_check_events = 'InsertEnter', |
161 | delete_check_events = 'InsertLeave', | 161 | delete_check_events = 'InsertLeave', |
162 | }, | 162 | }, |
163 | config = function(_, opts) | 163 | init = function() |
164 | require("luasnip").setup(opts) | 164 | local ls = require('luasnip') |
165 | require("luasnip.loaders.from_snipmate").lazy_load() | 165 | ls.setup({ |
166 | end, | 166 | -- Required to automatically include base snippets, like "c" snippets for "cpp" |
167 | load_ft_func = require('luasnip_snippets.common.snip_utils').load_ft_func, | ||
168 | ft_func = require('luasnip_snippets.common.snip_utils').ft_func, | ||
169 | -- To enable auto expansin | ||
170 | enable_autosnippets = true, | ||
171 | -- Uncomment to enable visual snippets triggered using <c-x> | ||
172 | -- store_selection_keys = '<c-x>', | ||
173 | }) | ||
174 | -- LuaSnip key bindings | ||
175 | vim.keymap.set({"i", "s"}, "<C-l>", function() if ls.expand_or_jumpable() then ls.expand_or_jump() else vim.api.nvim_input('<C-l>') end end, {silent = true}) | ||
176 | vim.keymap.set({"i", "s"}, "<C-k>", function() ls.jump(-1) end, {silent = true}) | ||
177 | vim.keymap.set({"i", "s"}, "<C-E>", function() if ls.choice_active() then ls.change_choice(1) end end, {silent = true}) | ||
178 | end | ||
179 | |||
167 | }, | 180 | }, |
168 | } | 181 | } |
diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua index 95f09f1..029a0f1 100644 --- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua | |||
@@ -72,9 +72,6 @@ return { | |||
72 | local capabilities = vim.lsp.protocol.make_client_capabilities() | 72 | local capabilities = vim.lsp.protocol.make_client_capabilities() |
73 | capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities) | 73 | capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities) |
74 | 74 | ||
75 | -- pkgbuild | ||
76 | require("lspconfig").pkgbuild_language_server.setup({}) | ||
77 | |||
78 | -- lua | 75 | -- lua |
79 | require("lspconfig")["lua_ls"].setup({ | 76 | require("lspconfig")["lua_ls"].setup({ |
80 | on_attach = on_attach, | 77 | on_attach = on_attach, |