diff --git a/nvim/lua/config/cmp.lua b/nvim/lua/config/cmp.lua index 4c05bc99..31f5bc80 100644 --- a/nvim/lua/config/cmp.lua +++ b/nvim/lua/config/cmp.lua @@ -2,7 +2,7 @@ local cmp = require('cmp') cmp.setup({ completion = { - keyword_length = 1, -- TODO set this back 3, when fine with snippets + keyword_length = 3, }, snippet = { expand = function(args) @@ -27,7 +27,6 @@ cmp.setup({ { name = 'tmux', option = { all_panes = true } }, -- TODO 'true' makes things sloppy { name = 'calc' }, }), - formatting = { format = function(entry, vim_item) vim_item.menu = ({ @@ -42,3 +41,15 @@ cmp.setup({ end }, }) + +cmp.setup.cmdline(':', { + sources = { + { name = 'cmdline' } + } +}) + +cmp.setup.cmdline('/', { + sources = { + { name = 'buffer' } + } +}) diff --git a/nvim/lua/config/colorizer.lua b/nvim/lua/config/colorizer.lua new file mode 100644 index 00000000..ccc4f6cc --- /dev/null +++ b/nvim/lua/config/colorizer.lua @@ -0,0 +1,7 @@ +require'colorizer'.setup({ + 'css'; + 'scss'; + 'json'; + 'json5'; + 'javascript'; +}, { css = true }) diff --git a/nvim/lua/config/comment.lua b/nvim/lua/config/comment.lua new file mode 100644 index 00000000..50603199 --- /dev/null +++ b/nvim/lua/config/comment.lua @@ -0,0 +1 @@ +require('Comment').setup({}) diff --git a/nvim/lua/mappings.lua b/nvim/lua/mappings.lua index 427e6344..6ab3c61a 100644 --- a/nvim/lua/mappings.lua +++ b/nvim/lua/mappings.lua @@ -125,7 +125,7 @@ map('s', '', 'vsnip#available(-1) ? "(vsnip-jump-prev)" : ""', { map('n', 'j', 'lua require("hop").hint_words()') -- custom handy shortcuts -map('n', 'o', 'e =expand("%:p:h") . "/" ') +-- TODO broken map('n', 'o', 'e =expand("%:p:h") . "/" ') map('n', 've', 'e $MYVIMRC') map('n', 'vr', 'source $MYVIMRC') map('n', 'w', 'set wrap! wrap?') diff --git a/nvim/lua/plugins.lua b/nvim/lua/plugins.lua index 0f2823ec..40e5b979 100644 --- a/nvim/lua/plugins.lua +++ b/nvim/lua/plugins.lua @@ -22,9 +22,9 @@ return require('packer').startup(function(use) -- some will be used by via custom mappings use 'christoomey/vim-tmux-navigator' use 'editorconfig/editorconfig-vim' + use 'nvim-treesitter/nvim-treesitter-textobjects' use 'tpope/vim-apathy' - use 'tpope/vim-commentary' - use 'tpope/vim-fugitive' + use 'tpope/vim-fugitive' -- replace with? sindrets/diffview.nvim use 'tpope/vim-ragtag' use 'tpope/vim-repeat' use 'tpope/vim-surround' @@ -33,11 +33,17 @@ return require('packer').startup(function(use) use 'wincent/terminus' -- plugins without other dependencies - use { 'hrsh7th/vim-vsnip', config = get_config('vsnip') } 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') } - + + -- colorizer for nice css-colors + use { + "norcalli/nvim-colorizer.lua", + event = "BufReadPre", + config = get_config('colorizer'), + } + -- Treesitter use { 'nvim-treesitter/nvim-treesitter', @@ -49,43 +55,31 @@ return require('packer').startup(function(use) use { 'ibhagwan/fzf-lua', config = get_config('fzf'), - requires = { + requires = { { 'kyazdani42/nvim-web-devicons', opt = true }, }, } -- hop for easy navigation - use { - 'phaazon/hop.nvim', + use { + 'phaazon/hop.nvim', config = get_config('hop'), event = "BufReadPre", } --- TODO ---[[ - -use "nvim-treesitter/nvim-treesitter-textobjects" -sindrets/diffview.nvim -TimUntersberger/neogit -use { + -- comment + use { "numToStr/Comment.nvim", - opt = true, - keys = {"gc", "gcc"}, config = get_config("comment") -} - --- CMP: path, cmdline, spell ---]] - - + } -- nice status line use { 'nvim-lualine/lualine.nvim', config = get_config('lualine'), event = 'VimEnter', - requires = { - { 'kyazdani42/nvim-web-devicons', opt = true } + requires = { + { 'kyazdani42/nvim-web-devicons', opt = true } }, } @@ -96,15 +90,20 @@ use { requires = { 'andersevenrud/cmp-tmux', 'hrsh7th/cmp-buffer', + 'hrsh7th/cmp-cmdline', 'hrsh7th/cmp-calc', 'hrsh7th/cmp-nvim-lsp', 'hrsh7th/cmp-path', 'hrsh7th/cmp-vsnip', }, - } + } -- snippets - use { + use { + 'hrsh7th/vim-vsnip', + config = get_config('vsnip') + } + use { 'rafamadriz/friendly-snippets', requires = { 'hrsh7th/vim-vsnip', @@ -112,8 +111,8 @@ use { } -- colorscheme - use { - 'ellisonleao/gruvbox.nvim', + use { + 'ellisonleao/gruvbox.nvim', requires = { 'rktjmp/lush.nvim' , },