Switch to Snippy

This commit is contained in:
Thomas Avé 2023-08-25 22:44:42 +02:00
parent 442227bbb6
commit cf358c74d6
4 changed files with 34 additions and 8 deletions

View File

@ -6,9 +6,7 @@
"cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"diffview.nvim": { "branch": "main", "commit": "db97e667e03294bfa9f15e544e78f3082247bf79" },
"editorconfig.nvim": { "branch": "master", "commit": "5b9e303e1d6f7abfe616ce4cc8d3fffc554790bf" },
"formatter.nvim": { "branch": "master", "commit": "44c89f09dcc220dc2a9b056e93c3a87c86e79804" },
"friendly-snippets": { "branch": "main", "commit": "377d45475b49e37460a902d6d569d2093d4037d0" },
"lazy.nvim": { "branch": "main", "commit": "dac844ed617dda4f9ec85eb88e9629ad2add5e05" },
"leap.nvim": { "branch": "main", "commit": "5efe985cf68fac3b6a6dfe7a75fbfaca8db2af9c" },
"lualine.nvim": { "branch": "master", "commit": "45e27ca739c7be6c49e5496d14fcf45a303c3a63" },
@ -23,14 +21,12 @@
"nvim-treesitter": { "branch": "master", "commit": "add1864bbf2d3b8e789ec6b4715bb5a4073e3b60" },
"nvim-web-devicons": { "branch": "master", "commit": "cfc8824cc1db316a276b36517f093baccb8e799a" },
"plenary.nvim": { "branch": "master", "commit": "267282a9ce242bbb0c5dc31445b6d353bed978bb" },
"supertab": { "branch": "master", "commit": "f0093ae12a9115498f887199809a6114659fc858" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "9bc8237565ded606e6c366a71c64c0af25cd7a50" },
"telescope-undo.nvim": { "branch": "main", "commit": "3dec002ea3e7952071d26fbb5d01e2038a58a554" },
"telescope.nvim": { "branch": "master", "commit": "2d92125620417fbea82ec30303823e3cd69e90e8" },
"trim.nvim": { "branch": "master", "commit": "2df124c2c2844d3143091ebd3ae8b49bbe06bc5e" },
"trouble.nvim": { "branch": "main", "commit": "40aad004f53ae1d1ba91bcc5c29d59f07c5f01d3" },
"undotree": { "branch": "master", "commit": "0e11ba7325efbbb3f3bebe06213afa3e7ec75131" },
"vim-bracketed-paste": { "branch": "master", "commit": "45411da73cc159e4fc2138d930553d247bbfbcdc" },
"vim-python-pep8-indent": { "branch": "master", "commit": "60ba5e11a61618c0344e2db190210145083c91f8" },
"vim-rooter": { "branch": "master", "commit": "4f52ca556a0b9e257bf920658714470ea0320b7a" },
"vim-vsnip": { "branch": "master", "commit": "7753ba9c10429c29d25abfd11b4c60b76718c438" },
"vim-vsnip-integ": { "branch": "master", "commit": "1914e72cf3de70df7f5dde476cd299aba2440aef" },

View File

@ -54,6 +54,15 @@ cmp.setup({
})
})
require('snippy').setup({
mappings = {
is = {
['<leader><Tab>'] = 'expand_or_advance',
['<leader><S-Tab>'] = 'previous',
},
},
})
-- Set configuration for specific filetype.
cmp.setup.filetype('gitcommit', {
sources = cmp.config.sources({

View File

@ -13,16 +13,14 @@ end
vim.opt.rtp:prepend(lazypath)
require('lazy').setup({
"rafamadriz/friendly-snippets",
'ConradIrwin/vim-bracketed-paste',
'airblade/vim-rooter',
'cappyzawa/trim.nvim',
'ggandor/leap.nvim',
'mhartington/formatter.nvim',
'gpanders/editorconfig.nvim',
'intrntbrn/awesomewm-vim-tmux-navigator',
'mbbill/undotree',
'numToStr/Comment.nvim',
'debugloop/telescope-undo.nvim',
{'vimwiki/vimwiki'},
'windwp/nvim-autopairs',
{'lervag/vimtex', ft='latex'},

View File

@ -40,11 +40,34 @@ require("telescope").setup{
["<C-k>"] = actions.move_selection_previous,
},
},
},
extensions = {
undo = {
side_by_side = true,
layout_strategy = "vertical",
layout_config = {
preview_height = 0.5,
},
mappings = {
i = {
-- IMPORTANT: Note that telescope-undo must be available when telescope is configured if
-- you want to replicate these defaults and use the following actions. This means
-- installing as a dependency of telescope in it's `requirements` and loading this
-- extension from there instead of having the separate plugin definition as outlined
-- above.
["<cr>"] = require("telescope-undo.actions").restore,
["<S-y>"] = require("telescope-undo.actions").yank_additions,
},
},
}
}
}
telescope.load_extension("undo")
telescope.load_extension('fzf')
vim.api.nvim_set_keymap("n", "<C-p>", "<CMD>lua require'telescope_config'.project_files()<CR>", {noremap = true, silent = true})
vim.api.nvim_set_keymap("n", "<C-O>", "<cmd>lua require('telescope_config').buffers()<cr>", { silent = true, noremap = true })
vim.api.nvim_set_keymap("n", "<C-f>", "<cmd>lua require('telescope.builtin').live_grep{ cwd = vim.fn.systemlist(\"git rev-parse --show-toplevel 2> /dev/null || pwd\")[1] }<cr>", { silent = true, noremap = true })