Add more plugins/config to vim

main
Steffen Rademacker 3 years ago
parent 5a684a33d0
commit 2b4b7ba3a2

@ -2,7 +2,7 @@ local cmp = require('cmp')
cmp.setup({ cmp.setup({
completion = { completion = {
keyword_length = 1, -- TODO set this back 3, when fine with snippets keyword_length = 3,
}, },
snippet = { snippet = {
expand = function(args) expand = function(args)
@ -27,7 +27,6 @@ cmp.setup({
{ name = 'tmux', option = { all_panes = true } }, -- TODO 'true' makes things sloppy { name = 'tmux', option = { all_panes = true } }, -- TODO 'true' makes things sloppy
{ name = 'calc' }, { name = 'calc' },
}), }),
formatting = { formatting = {
format = function(entry, vim_item) format = function(entry, vim_item)
vim_item.menu = ({ vim_item.menu = ({
@ -42,3 +41,15 @@ cmp.setup({
end end
}, },
}) })
cmp.setup.cmdline(':', {
sources = {
{ name = 'cmdline' }
}
})
cmp.setup.cmdline('/', {
sources = {
{ name = 'buffer' }
}
})

@ -0,0 +1,7 @@
require'colorizer'.setup({
'css';
'scss';
'json';
'json5';
'javascript';
}, { css = true })

@ -0,0 +1 @@
require('Comment').setup({})

@ -125,7 +125,7 @@ map('s', '<C-j>', 'vsnip#available(-1) ? "<Plug>(vsnip-jump-prev)" : "<C-j>"', {
map('n', '<leader>j', '<cmd>lua require("hop").hint_words()<cr>') map('n', '<leader>j', '<cmd>lua require("hop").hint_words()<cr>')
-- custom handy shortcuts -- custom handy shortcuts
map('n', '<leader>o', '<cmd>e <C-R>=expand("%:p:h") . "/" <cr>') -- TODO broken map('n', '<leader>o', '<cmd>e <C-R>=expand("%:p:h") . "/" <cr>')
map('n', '<leader>ve', '<cmd>e $MYVIMRC<cr>') map('n', '<leader>ve', '<cmd>e $MYVIMRC<cr>')
map('n', '<leader>vr', '<cmd>source $MYVIMRC<cr>') map('n', '<leader>vr', '<cmd>source $MYVIMRC<cr>')
map('n', '<leader>w', '<cmd>set wrap! wrap?<cr>') map('n', '<leader>w', '<cmd>set wrap! wrap?<cr>')

@ -22,9 +22,9 @@ return require('packer').startup(function(use)
-- some will be used by via custom mappings -- some will be used by via custom mappings
use 'christoomey/vim-tmux-navigator' use 'christoomey/vim-tmux-navigator'
use 'editorconfig/editorconfig-vim' use 'editorconfig/editorconfig-vim'
use 'nvim-treesitter/nvim-treesitter-textobjects'
use 'tpope/vim-apathy' use 'tpope/vim-apathy'
use 'tpope/vim-commentary' use 'tpope/vim-fugitive' -- replace with? sindrets/diffview.nvim
use 'tpope/vim-fugitive'
use 'tpope/vim-ragtag' use 'tpope/vim-ragtag'
use 'tpope/vim-repeat' use 'tpope/vim-repeat'
use 'tpope/vim-surround' use 'tpope/vim-surround'
@ -33,11 +33,17 @@ return require('packer').startup(function(use)
use 'wincent/terminus' use 'wincent/terminus'
-- plugins without other dependencies -- plugins without other dependencies
use { 'hrsh7th/vim-vsnip', config = get_config('vsnip') }
use { 'neovim/nvim-lspconfig', config = get_config('lspconfig') } use { 'neovim/nvim-lspconfig', config = get_config('lspconfig') }
use { 'voldikss/vim-floaterm', config = get_config('floaterm') } use { 'voldikss/vim-floaterm', config = get_config('floaterm') }
use { 'windwp/nvim-autopairs', config = get_config('autopairs') } use { 'windwp/nvim-autopairs', config = get_config('autopairs') }
-- colorizer for nice css-colors
use {
"norcalli/nvim-colorizer.lua",
event = "BufReadPre",
config = get_config('colorizer'),
}
-- Treesitter -- Treesitter
use { use {
'nvim-treesitter/nvim-treesitter', 'nvim-treesitter/nvim-treesitter',
@ -49,43 +55,31 @@ return require('packer').startup(function(use)
use { use {
'ibhagwan/fzf-lua', 'ibhagwan/fzf-lua',
config = get_config('fzf'), config = get_config('fzf'),
requires = { requires = {
{ 'kyazdani42/nvim-web-devicons', opt = true }, { 'kyazdani42/nvim-web-devicons', opt = true },
}, },
} }
-- hop for easy navigation -- hop for easy navigation
use { use {
'phaazon/hop.nvim', 'phaazon/hop.nvim',
config = get_config('hop'), config = get_config('hop'),
event = "BufReadPre", event = "BufReadPre",
} }
-- TODO -- comment
--[[ use {
use "nvim-treesitter/nvim-treesitter-textobjects"
sindrets/diffview.nvim
TimUntersberger/neogit
use {
"numToStr/Comment.nvim", "numToStr/Comment.nvim",
opt = true,
keys = {"gc", "gcc"},
config = get_config("comment") config = get_config("comment")
} }
-- CMP: path, cmdline, spell
--]]
-- nice status line -- nice status line
use { use {
'nvim-lualine/lualine.nvim', 'nvim-lualine/lualine.nvim',
config = get_config('lualine'), config = get_config('lualine'),
event = 'VimEnter', event = 'VimEnter',
requires = { requires = {
{ 'kyazdani42/nvim-web-devicons', opt = true } { 'kyazdani42/nvim-web-devicons', opt = true }
}, },
} }
@ -96,15 +90,20 @@ use {
requires = { requires = {
'andersevenrud/cmp-tmux', 'andersevenrud/cmp-tmux',
'hrsh7th/cmp-buffer', 'hrsh7th/cmp-buffer',
'hrsh7th/cmp-cmdline',
'hrsh7th/cmp-calc', 'hrsh7th/cmp-calc',
'hrsh7th/cmp-nvim-lsp', 'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-path', 'hrsh7th/cmp-path',
'hrsh7th/cmp-vsnip', 'hrsh7th/cmp-vsnip',
}, },
} }
-- snippets -- snippets
use { use {
'hrsh7th/vim-vsnip',
config = get_config('vsnip')
}
use {
'rafamadriz/friendly-snippets', 'rafamadriz/friendly-snippets',
requires = { requires = {
'hrsh7th/vim-vsnip', 'hrsh7th/vim-vsnip',
@ -112,8 +111,8 @@ use {
} }
-- colorscheme -- colorscheme
use { use {
'ellisonleao/gruvbox.nvim', 'ellisonleao/gruvbox.nvim',
requires = { requires = {
'rktjmp/lush.nvim' , 'rktjmp/lush.nvim' ,
}, },

Loading…
Cancel
Save