switched nvim to luasnip

This commit is contained in:
Rudis Muiznieks 2023-01-14 07:51:16 -06:00
parent db491adb58
commit defbc1320f
Signed by: rudism
GPG key ID: CABF2F86EF7884F9
4 changed files with 30 additions and 8 deletions

View file

@ -157,6 +157,7 @@ hc rule class='nvim-zen' fullscreen=on
hc rule class='mpv' floating=on
hc rule class='sim_arduboy' floating=on
hc rule class='XNots' floating=on
hc rule class='Pithos' floating=on
hc set tree_style '╾│ ├└╼─┐'

View file

@ -12,6 +12,11 @@ vim.g.catppuccin_flavour = 'mocha'
require('catppuccin').setup()
vim.cmd [[colorscheme catppuccin]]
-- load snippets
require('luasnip.loaders.from_snipmate').lazy_load({
paths = "~/.config/nvim/snippets"
})
-- replace built in selector with telescope
require('telescope').setup {
extensions = {
@ -29,7 +34,7 @@ local cmp = require 'cmp'
cmp.setup {
snippet = {
expand = function(args)
vim.fn["vsnip#anonymous"](args.body)
require'luasnip'.lsp_expand(args.body)
end,
},
mapping = {
@ -43,7 +48,8 @@ cmp.setup {
preselect = cmp.PreselectMode.None,
confirmation = { get_commit_characters = function(_) return {} end },
sources = {
{ name = 'nvim_lsp', },
{ name = 'luasnip' },
{ name = 'nvim_lsp' },
{ name = 'buffer' },
{ name = 'path' },
},

View file

@ -15,12 +15,16 @@ return require('packer').startup(function()
use 'nvim-telescope/telescope-ui-select.nvim' -- selector
use 'gpanders/editorconfig.nvim'
use 'neovim/nvim-lspconfig'
use 'hrsh7th/nvim-cmp' -- autocomplete
use 'hrsh7th/cmp-vsnip' -- autocomplete
use 'hrsh7th/vim-vsnip' -- autocomplete
use 'hrsh7th/cmp-nvim-lsp' -- lsp autocomplete
use 'hrsh7th/cmp-buffer' -- buffer autocomplete
use 'hrsh7th/cmp-path' -- path autocompletes
use 'L3MON4D3/LuaSnip' -- snipets
use {
'hrsh7th/nvim-cmp', -- autocomplete
requires = {
{'saadparwaiz1/cmp_luasnip'}, -- autocomplete snips
{'hrsh7th/cmp-nvim-lsp'}, -- lsp autocomplete
{'hrsh7th/cmp-buffer'}, -- buffer autocomplete
{'hrsh7th/cmp-path'}, -- path autocompletes
}
}
use { -- gitgutter replacement
'lewis6991/gitsigns.nvim',
requires = {

11
nvim/snippets/cs.snippets Normal file
View file

@ -0,0 +1,11 @@
# inline xml documentation
snippet ///
/// <summary>
/// ${0}
/// </summary>
snippet <p
<param name="${1}">${2:$1}</param>
snippet <r
<returns>${1}</returns>
snippet <rem
<remarks>${1}</remarks>