diff --git a/data/nvim/init.lua b/data/nvim/init.lua index 2671d78..a5f2217 100644 --- a/data/nvim/init.lua +++ b/data/nvim/init.lua @@ -43,17 +43,15 @@ vim.keymap.set("n", "'", "", { remap = true }) vim.keymap.set("n", "q", ":q") -- Keymap for plugin -vim.keymap.set("n", "f", ":FZF") -vim.keymap.set("n", "rg", ":FZFRg") -vim.keymap.set("n", "cm", ":FZFCommands") +vim.keymap.set("n", "f", ":FzfLua files") +vim.keymap.set("n", "rg", ":FzfLua live_grep_native") +vim.keymap.set("n", "ds", ":FzfLua lsp_document_symbols") vim.keymap.set("n", "", ":NvimTreeToggle") vim.keymap.set("n", "n", ":NvimTreeFindFile") vim.keymap.set("n", "tr", ":lua MiniTrailspace.trim()") +vim.keymap.set("n", "nf", ":Neoformat") vim.keymap.set("n", "lr", ":LspRestart") --- Use plugin fzf.vim -vim.g.fzf_command_prefix = "FZF" - -- Use plugin nvim-tree.lua vim.g.loaded_netrw = 1 vim.g.loaded_netrwPlugin = 1 @@ -116,7 +114,15 @@ require("lazy").setup({ -- https://github.com/junegunn/fzf.vim "junegunn/fzf", - "junegunn/fzf.vim", + + -- https://github.com/ibhagwan/fzf-lua + { + "ibhagwan/fzf-lua", + dependencies = { + "junegunn/fzf", + "neovim/nvim-lspconfig", + }, + }, -- https://github.com/nvim-lualine/lualine.nvim { @@ -176,10 +182,17 @@ require("lazy").setup({ "neovim/nvim-lspconfig", "hrsh7th/cmp-nvim-lsp", "hrsh7th/cmp-buffer", + "hrsh7th/cmp-vsnip", + "hrsh7th/vim-vsnip", }, config = function() local cmp = require("cmp") cmp.setup({ + snippet = { + expand = function(args) + vim.fn["vsnip#anonymous"](args.body) + end, + }, mapping = cmp.mapping.preset.insert({ [""] = cmp.mapping.complete(), [""] = cmp.mapping.confirm({