replace vsnip with luasnip,clean some confs

This commit is contained in:
siduck76 2021-06-26 18:20:25 +05:30
parent 3523eb277b
commit 9da869feee
4 changed files with 49 additions and 25 deletions

View File

@ -16,10 +16,23 @@ M.config = function()
documentation = true,
source = {
buffer = {kind = "", true},
vsnip = {kind = ""},
nvim_lsp = true
luasnip = {kind = "", true},
nvim_lsp = true,
nvim_lua = true,
}
}
end
M.snippets = function()
local ls = require("luasnip")
ls.config.set_config(
{
history = true,
updateevents = "TextChanged,TextChangedI"
}
)
require("luasnip/loaders/from_vscode").load()
end
return M

View File

@ -30,8 +30,8 @@ map("n", "<C-a>", [[ <Cmd> %y+<CR>]], opt)
map("n", "<leader>n", [[ <Cmd> set nu!<CR>]], opt)
-- Truezen.nvim
map("n", "<leader>z", [[ <Cmd> TZAtaraxis<CR>]], opt)
map("n", "<leader>m", [[ <Cmd> TZMinimalist<CR>]], opt)
map("n", "<leader>z", ":TZAtaraxis<CR>", opt)
map("n", "<leader>m", ":TZMinimalist<CR>", opt)
map("n", "<C-s>", [[ <Cmd> w <CR>]], opt)
-- vim.cmd("inoremap jh <Esc>")
@ -40,6 +40,8 @@ map("n", "<C-s>", [[ <Cmd> w <CR>]], opt)
map("n", "<leader>/", ":CommentToggle<CR>", {noremap = true, silent = true})
map("v", "<leader>/", ":CommentToggle<CR>", {noremap = true, silent = true})
map("n","<C-q>",":BufDel", opt)
-- compe stuff
local t = function(str)

View File

@ -1,7 +1,6 @@
local opt = vim.opt
opt.ruler = false
opt.showmode = false
opt.hidden = true
opt.ignorecase = true
opt.splitbelow = true
@ -50,4 +49,18 @@ end
-- file extension specific tabbing
-- vim.cmd([[autocmd Filetype python setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4]])
-- blankline config
M.blankline = function()
vim.g.indentLine_enabled = 1
vim.g.indent_blankline_char = ""
vim.g.indent_blankline_filetype_exclude = {"help", "terminal", "dashboard"}
vim.g.indent_blankline_buftype_exclude = {"terminal"}
vim.g.indent_blankline_show_trailing_blankline_indent = false
vim.g.indent_blankline_show_first_indent_level = false
end
return M

View File

@ -45,7 +45,19 @@ return packer.startup(
event = "InsertEnter",
config = function()
require("compe-completion").config()
end
end,
wants = {"LuaSnip"},
requires = {
{
"L3MON4D3/LuaSnip",
wants = "friendly-snippets",
event = "InsertCharPre",
config = function()
require("compe-completion").snippets()
end
},
"rafamadriz/friendly-snippets"
}
}
use {
@ -53,13 +65,6 @@ return packer.startup(
cmd = "Neoformat"
}
-- snippet support
use {
"hrsh7th/vim-vsnip",
event = "InsertCharPre"
}
use "rafamadriz/friendly-snippets"
-- file managing , picker etc
use {
"kyazdani42/nvim-tree.lua",
@ -79,9 +84,7 @@ return packer.startup(
{"nvim-telescope/telescope-fzf-native.nvim", run = "make"},
{"nvim-telescope/telescope-media-files.nvim"}
},
cmd = {
"Telescope"
},
cmd = "Telescope",
config = function()
require("telescope-nvim").config()
end
@ -132,7 +135,7 @@ return packer.startup(
use {"tweekmonster/startuptime.vim", cmd = "StartupTime"}
-- load autosave plugin only if its globally enabled
-- load autosave only if its globally enabled
use {
"907th/vim-auto-save",
cond = function()
@ -164,14 +167,7 @@ return packer.startup(
branch = "lua",
event = "BufRead",
setup = function()
vim.g.indentLine_enabled = 1
vim.g.indent_blankline_char = ""
vim.g.indent_blankline_filetype_exclude = {"help", "terminal", "dashboard"}
vim.g.indent_blankline_buftype_exclude = {"terminal"}
vim.g.indent_blankline_show_trailing_blankline_indent = false
vim.g.indent_blankline_show_first_indent_level = false
require("misc-utils").blankline()
end
}
end,