local packer = function() local path = vim.fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim' if vim.fn.empty(vim.fn.glob(path)) > 0 then local url = 'https://github.com/wbthomason/packer.nvim' vim.fn.system({'git', 'clone', '--depth', '1', url, path}) end return require('packer') end return packer().startup(function(use) use 'wbthomason/packer.nvim' use 'nvim-lua/plenary.nvim' -- Visuals ---------------------------------------------------------------- use { 'tjdevries/colorbuddy.nvim', config = function() require'fs.solarized'.setup() end, } use 'kyazdani42/nvim-web-devicons' use { 'nvim-lualine/lualine.nvim', config = function() require'fs.lualine'.config() end, } use { 'lukas-reineke/virt-column.nvim', config = function() require'virt-column'.setup { char = '│' } -- show/hide virtual colorcolumn vim.keymap.set('n', 'sc', function() if vim.o.colorcolumn == '' then vim.o.colorcolumn = '+1' else vim.o.colorcolumn = '' end end) end, } use { 'lukas-reineke/indent-blankline.nvim', config = function() require'indent_blankline'.setup { enabled = false } -- show/hide indent guides vim.keymap.set('n', 'si', ':IndentBlanklineToggle') end, } use { 'junegunn/rainbow_parentheses.vim', config = function() vim.g['rainbow#pairs'] = { {'(',')'}, {'[',']'}, {'{','}'} } -- show/hide rainbow parens vim.keymap.set('n', 'sp', 'RainbowParentheses!!') end, } -- Navigation ------------------------------------------------------------- use { 'nvim-telescope/telescope.nvim', config = function() require'fs.telescope'.config() end, } use { 'kyazdani42/nvim-tree.lua', config = function() require'nvim-tree'.setup { git = { ignore = false, -- don't hide files from .gitignore }, view = { width = 35, -- a little wider than the default 30 }, filters = { dotfiles = false, -- show files starting with a . custom = { '.git' }, -- don't show .git directory }, renderer = { add_trailing = true, -- add trailing / to folders group_empty = true, -- folders that contain only one folder are grouped highlight_git = true, -- enable highlight based on git attributes indent_markers = { enable = true, -- show indent markers }, }, } vim.keymap.set('n', '', 'NvimTreeToggle') vim.keymap.set('n', 'n', 'NvimTreeFindFileToggle') end, } -- Editing ---------------------------------------------------------------- use { 'ntpeters/vim-better-whitespace', setup = function() vim.g.better_whitespace_filetypes_blacklist = { 'diff', 'fugitive', 'git', 'gitcommit', 'help', } end, config = function() -- fix whitespace vim.keymap.set('n', 'w', 'StripWhitespace') -- show/hide whitespace vim.keymap.set('n', 'sw', 'ToggleWhitespace') end, } use { 'godlygeek/tabular', config = function() vim.cmd [[AddTabularPattern first_comma /^[^,]*\zs,/l0c1l0]] end, } use 'tpope/vim-commentary' -- git -------------------------------------------------------------------- use { 'tpope/vim-fugitive', config = function() vim.keymap.set('n', 'gs', 'below Git') vim.keymap.set('n', 'gb', 'Git blame') end, } -- Filetypes -------------------------------------------------------------- use { 'elzr/vim-json', setup = function() -- Disable quote concealling. vim.g.vim_json_syntax_conceal = 0 end, config = function() -- Make numbers and booleans stand out. vim.cmd [[ highlight link jsonBraces Text highlight link jsonNumber Identifier highlight link jsonBoolean Identifier highlight link jsonNull Identifier ]] end, } use 'keith/swift.vim' use 'chr4/nginx.vim' -- Misc ------------------------------------------------------------------- use 'milisims/nvim-luaref' end)