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='mpv' floating=on
hc rule class='sim_arduboy' floating=on hc rule class='sim_arduboy' floating=on
hc rule class='XNots' floating=on hc rule class='XNots' floating=on
hc rule class='Pithos' floating=on
hc set tree_style '╾│ ├└╼─┐' hc set tree_style '╾│ ├└╼─┐'

View File

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

View File

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