diff --git a/config/nvim/lua/fs/config/indent-blankline.lua b/config/nvim/lua/fs/config/indent-blankline.lua deleted file mode 100644 index 025ceb5..0000000 --- a/config/nvim/lua/fs/config/indent-blankline.lua +++ /dev/null @@ -1,11 +0,0 @@ -local nmap = require'fs.util'.nmap - -local config = function() - require'indent_blankline'.setup { enabled = false } - - -- show/hide indent guides - nmap { 'si', ':IndentBlanklineToggle' } -end - -return { config = config } - diff --git a/config/nvim/lua/fs/config/nvim-tree.lua b/config/nvim/lua/fs/config/nvim-tree.lua deleted file mode 100644 index 899edb8..0000000 --- a/config/nvim/lua/fs/config/nvim-tree.lua +++ /dev/null @@ -1,33 +0,0 @@ -local nmap = require'fs.util'.nmap - -local 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 - }, - }, - } - - nmap { '', 'NvimTreeToggle' } - nmap { 'n', 'NvimTreeFindFileToggle' } -end - -return { config = config } - diff --git a/config/nvim/lua/fs/config/rainbow_parentheses.lua b/config/nvim/lua/fs/config/rainbow_parentheses.lua deleted file mode 100644 index 988c8df..0000000 --- a/config/nvim/lua/fs/config/rainbow_parentheses.lua +++ /dev/null @@ -1,11 +0,0 @@ -local nmap = require'fs.util'.nmap - -local config = function() - vim.g['rainbow#pairs'] = { {'(',')'}, {'[',']'}, {'{','}'} } - - -- show/hide rainbow parens - nmap { 'sp', 'RainbowParentheses!!' } -end - -return { config = config } - diff --git a/config/nvim/lua/fs/config/vim-better-whitespace.lua b/config/nvim/lua/fs/config/vim-better-whitespace.lua deleted file mode 100644 index b764b94..0000000 --- a/config/nvim/lua/fs/config/vim-better-whitespace.lua +++ /dev/null @@ -1,18 +0,0 @@ -local nmap = require'fs.util'.nmap - -local setup = function() - vim.g.better_whitespace_filetypes_blacklist = { - 'diff', 'git', 'gitcommit', 'help', 'fugitive' - } -end - -local config = function() - -- fix whitespace - nmap { 'w', 'StripWhitespace' } - - -- show/hide whitespace - nmap { 'sw', 'ToggleWhitespace' } -end - -return { config = config, setup = setup } - diff --git a/config/nvim/lua/fs/config/vim-colors-solarized.lua b/config/nvim/lua/fs/config/vim-colors-solarized.lua deleted file mode 100644 index 2ea3250..0000000 --- a/config/nvim/lua/fs/config/vim-colors-solarized.lua +++ /dev/null @@ -1,54 +0,0 @@ -local util = require'fs.util' -local C = util.colors() -local highlight = util.highlight - -local additional_highlights = { - -- Override the colorscheme for these ones: - Normal = { bg = 'NONE' }, -- transparent background - NonText = { fg = C.base02, attrs = 'NONE' }, -- very subtle EOL symbols - Whitespace = { fg = C.orange }, -- listchars - SpellBad = { fg = C.yellow }, -- spelling mistakes - QuickFixLine = { fg = C.yellow, bg = C.base02 }, -- selected quickfix item - CursorLineNr = { fg = C.yellow, attrs = 'NONE' }, -- current line number - - -- Trailing whitespace, from 'ntpeters/vim-better-whitespace': - ExtraWhitespace = { fg = C.orange, bg = C.orange }, - - -- Indentation guids, from 'lukas-reineke/indent-blankline.nvim': - IndentBlanklineChar = { fg = C.base01, bg = 'NONE' }, - - -- Virtual colorcolumn, from 'lukas-reineke/virt-column.nvim': - VirtColumn = { fg = C.base02, bg = 'NONE', attrs = 'NONE' }, - ColorColumn = { bg = 'NONE' }, -- otherwise this is visible behind VirtColumn - - -- Colors for 'kyazdani42/nvim-tree.lua': - NvimTreeSpecialFile = { fg = C.base2 }, - NvimTreeIndentMarker = { fg = C.base01 }, - NvimTreeGitStaged = { fg = C.green }, - NvimTreeGitRenamed = { fg = C.yellow }, - NvimTreeGitNew = { fg = C.yellow }, - NvimTreeGitDirty = { fg = C.yellow }, - NvimTreeGitDeleted = { fg = C.orange }, - NvimTreeGitMerge = { fg = C.red }, - - -- Colors for 'nvim-telescope/telescope.nvim': - TelescopeBorder = { fg = C.base01 }, - TelescopeTitle = { fg = C.base1 }, - TelescopePromptPrefix = { fg = C.red }, - TelescopePromptCounter = { fg = C.base1 }, - TelescopeMatching = { fg = C.red }, - TelescopeSelection = { fg = C.base2, bg = C.base02, attrs = 'NONE' }, - TelescopeMultiSelection = { fg = C.blue }, - TelescopeMultiIcon = { fg = C.blue }, -} - -local config = function() - vim.cmd [[silent! colorscheme solarized]] - - for group, hl in pairs(additional_highlights) do - highlight(group, hl) - end -end - -return { config = config } - diff --git a/config/nvim/lua/fs/config/vim-fugitive.lua b/config/nvim/lua/fs/config/vim-fugitive.lua deleted file mode 100644 index a55de0f..0000000 --- a/config/nvim/lua/fs/config/vim-fugitive.lua +++ /dev/null @@ -1,9 +0,0 @@ -local nmap = require'fs.util'.nmap - -local config = function() - nmap { 'gg', 'G' } - nmap { 'g', 'G ' } -end - -return { config = config } - diff --git a/config/nvim/lua/fs/config/vim-json.lua b/config/nvim/lua/fs/config/vim-json.lua deleted file mode 100644 index 1d89a37..0000000 --- a/config/nvim/lua/fs/config/vim-json.lua +++ /dev/null @@ -1,17 +0,0 @@ -local setup = function() - -- Disable quote concealling. - vim.g.vim_json_syntax_conceal = 0 -end - -local 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 - -return { setup = setup, config = config } - diff --git a/config/nvim/lua/fs/config/vim-markdown.lua b/config/nvim/lua/fs/config/vim-markdown.lua deleted file mode 100644 index c2c14e9..0000000 --- a/config/nvim/lua/fs/config/vim-markdown.lua +++ /dev/null @@ -1,22 +0,0 @@ -local nmap = require'fs.util'.nmap - -local setup = function() - -- Disable concealling on italic, bold, etc. - vim.g.vim_markdown_conceal = 0 - - -- Disable concealling on code blocks. - vim.g.vim_markdown_conceal_code_blocks = 0 - - -- Automatic insertion of bullets is buggy. so disable it. - vim.g.vim_markdown_auto_insert_bullets = 0 - vim.g.vim_markdown_new_list_item_indent = 0 -end - -local config = function() - nmap { '+', '.,.HeaderIncrease', { buffer = true } } - nmap { '=', '.,.HeaderIncrease', { buffer = true } } - nmap { '-', '.,.HeaderDecrease', { buffer = true } } -end - -return { setup = setup, config = config } - diff --git a/config/nvim/lua/fs/config/virt-column.lua b/config/nvim/lua/fs/config/virt-column.lua deleted file mode 100644 index 8d47992..0000000 --- a/config/nvim/lua/fs/config/virt-column.lua +++ /dev/null @@ -1,19 +0,0 @@ -local nmap = require'fs.util'.nmap - -local toggle = function() - if vim.o.colorcolumn == '' then - vim.o.colorcolumn = '+1' - else - vim.o.colorcolumn = '' - end -end - -local config = function() - require'virt-column'.setup { char = '│' } - - -- show/hide virtual colorcolumn - nmap { 'sc', [[lua require'fs.config.virt-column'.toggle()]] } -end - -return { config = config, toggle = toggle } - diff --git a/config/nvim/lua/fs/plugins.lua b/config/nvim/lua/fs/plugins.lua index 76a5a98..a6047f3 100644 --- a/config/nvim/lua/fs/plugins.lua +++ b/config/nvim/lua/fs/plugins.lua @@ -13,57 +13,240 @@ return packer().startup(function(use) use 'nvim-lua/plenary.nvim' -- Visuals ---------------------------------------------------------------- - use { 'altercation/vim-colors-solarized', - config = function() require'fs.config.vim-colors-solarized'.config() end, + + use { + 'altercation/vim-colors-solarized', + + config = function() + local C = require'fs.util'.colors() + local overrides = { + -- Override the colorscheme for these ones: + Normal = { bg = 'NONE' }, -- transparent background + NonText = { fg = C.base02, attrs = 'NONE' }, -- very subtle EOL symbols + Whitespace = { fg = C.orange }, -- listchars + SpellBad = { fg = C.yellow }, -- spelling mistakes + QuickFixLine = { fg = C.yellow, bg = C.base02 }, -- selected quickfix item + CursorLineNr = { fg = C.yellow, attrs = 'NONE' }, -- current line number + + -- Trailing whitespace, from 'ntpeters/vim-better-whitespace': + ExtraWhitespace = { fg = C.orange, bg = C.orange }, + + -- Indentation guids, from 'lukas-reineke/indent-blankline.nvim': + IndentBlanklineChar = { fg = C.base01, bg = 'NONE' }, + + -- Virtual colorcolumn, from 'lukas-reineke/virt-column.nvim': + VirtColumn = { fg = C.base02, bg = 'NONE', attrs = 'NONE' }, + ColorColumn = { bg = 'NONE' }, -- otherwise this is visible behind VirtColumn + + -- Colors for 'kyazdani42/nvim-tree.lua': + NvimTreeSpecialFile = { fg = C.base2 }, + NvimTreeIndentMarker = { fg = C.base01 }, + NvimTreeGitStaged = { fg = C.green }, + NvimTreeGitRenamed = { fg = C.yellow }, + NvimTreeGitNew = { fg = C.yellow }, + NvimTreeGitDirty = { fg = C.yellow }, + NvimTreeGitDeleted = { fg = C.orange }, + NvimTreeGitMerge = { fg = C.red }, + + -- Colors for 'nvim-telescope/telescope.nvim': + TelescopeBorder = { fg = C.base01 }, + TelescopeTitle = { fg = C.base1 }, + TelescopePromptPrefix = { fg = C.red }, + TelescopePromptCounter = { fg = C.base1 }, + TelescopeMatching = { fg = C.red }, + TelescopeSelection = { fg = C.base2, bg = C.base02, attrs = 'NONE' }, + TelescopeMultiSelection = { fg = C.blue }, + TelescopeMultiIcon = { fg = C.blue }, + } + + vim.cmd [[silent! colorscheme solarized]] + + local highlight = require'fs.util'.highlight + for group, spec in pairs(overrides) do + highlight(group, spec) + end + end, } + use 'kyazdani42/nvim-web-devicons' - use { 'nvim-lualine/lualine.nvim', + + use { + 'nvim-lualine/lualine.nvim', config = function() require'fs.config.lualine'.config() end, } - use { 'lukas-reineke/virt-column.nvim', - config = function() require'fs.config.virt-column'.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'fs.config.indent-blankline'.config() 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() require'fs.config.rainbow_parentheses'.config() 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', + + use { + 'nvim-telescope/telescope.nvim', config = function() require'fs.config.telescope'.config() end, } - use { 'kyazdani42/nvim-tree.lua', - config = function() require'fs.config.nvim-tree'.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() require'fs.config.vim-better-whitespace'.setup() end, - config = function() require'fs.config.vim-better-whitespace'.config() end, + + 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' + use 'tpope/vim-commentary' -- git -------------------------------------------------------------------- - use { 'tpope/vim-fugitive', - config = function() require'fs.config.vim-fugitive'.config() end, + + use { + 'tpope/vim-fugitive', + + config = function() + vim.keymap.set('n', 'gg', 'G') + vim.keymap.set('n', 'g', ':G ') + end, } -- Filetypes -------------------------------------------------------------- - use { 'elzr/vim-json', - setup = function() require'fs.config.vim-json'.setup() end, - config = function() require'fs.config.vim-json'.config() end, + + 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 { 'plasticboy/vim-markdown', - setup = function() require'fs.config.vim-markdown'.setup() end, - config = function() require'fs.config.vim-markdown'.config() end, + + use { + 'plasticboy/vim-markdown', + + setup = function() + -- Disable concealling on italic, bold, etc. + vim.g.vim_markdown_conceal = 0 + + -- Disable concealling on code blocks. + vim.g.vim_markdown_conceal_code_blocks = 0 + + -- Automatic insertion of bullets is buggy, so disable it. + vim.g.vim_markdown_auto_insert_bullets = 0 + vim.g.vim_markdown_new_list_item_indent = 0 + end, + + config = function() + local buf = { buffer = true } + vim.keymap.set('n', '+', '.,.HeaderIncrease', buf) + vim.keymap.set('n', '=', '.,.HeaderIncrease', buf) + vim.keymap.set('n', '-', '.,.HeaderDecrease', buf) + end, } + use 'keith/swift.vim' + use 'chr4/nginx.vim' -- Misc ------------------------------------------------------------------- + use 'milisims/nvim-luaref' end)