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, documentation = true,
source = { source = {
buffer = {kind = "", true}, buffer = {kind = "", true},
vsnip = {kind = ""}, luasnip = {kind = "", true},
nvim_lsp = true nvim_lsp = true,
nvim_lua = true,
} }
} }
end 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 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) map("n", "<leader>n", [[ <Cmd> set nu!<CR>]], opt)
-- Truezen.nvim -- Truezen.nvim
map("n", "<leader>z", [[ <Cmd> TZAtaraxis<CR>]], opt) map("n", "<leader>z", ":TZAtaraxis<CR>", opt)
map("n", "<leader>m", [[ <Cmd> TZMinimalist<CR>]], opt) map("n", "<leader>m", ":TZMinimalist<CR>", opt)
map("n", "<C-s>", [[ <Cmd> w <CR>]], opt) map("n", "<C-s>", [[ <Cmd> w <CR>]], opt)
-- vim.cmd("inoremap jh <Esc>") -- 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("n", "<leader>/", ":CommentToggle<CR>", {noremap = true, silent = true})
map("v", "<leader>/", ":CommentToggle<CR>", {noremap = true, silent = true}) map("v", "<leader>/", ":CommentToggle<CR>", {noremap = true, silent = true})
map("n","<C-q>",":BufDel", opt)
-- compe stuff -- compe stuff
local t = function(str) local t = function(str)

View File

@ -1,7 +1,6 @@
local opt = vim.opt local opt = vim.opt
opt.ruler = false opt.ruler = false
opt.showmode = false
opt.hidden = true opt.hidden = true
opt.ignorecase = true opt.ignorecase = true
opt.splitbelow = true opt.splitbelow = true
@ -50,4 +49,18 @@ end
-- file extension specific tabbing -- file extension specific tabbing
-- vim.cmd([[autocmd Filetype python setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4]]) -- 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 return M

View File

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