Bars! Well, good enough.

prenix
Geoffrey Frogeye 2021-07-04 22:47:10 +02:00
parent 51fa9fa0b0
commit cc79262336
Signed by: geoffrey
GPG Key ID: C72403E7F82E6AD8
17 changed files with 277 additions and 11 deletions

View File

@ -3,6 +3,7 @@
vim_variants:
- vim
- nvim
tags: g
# TODO vim-minimal for bsh
# TODO Select those in a clever way
@ -53,3 +54,4 @@
loop: "{{ vim_variants }}"
loop_control:
loop_var: variant
tags: g

View File

@ -21,6 +21,3 @@ source ~/.config/{{ variant }}/plugininstall.vim
{% include 'pluginconfig.j2' %}
" THEME CONFIGURATION
source ~/.config/vim/theme.vim

View File

@ -9,14 +9,22 @@
" Visuals
{{ use_plugin('base16') }}
{{ use_plugin('airline') }}
{{ use_plugin('devicons') }}
{% if variant == 'nvim' %}
{{ use_plugin('lightbulb') }}
{{ use_plugin('ts-rainbow') }}
{{ use_plugin('specs') }}
{{ use_plugin('scrollview') }}
{% endif %}
" Theme
source ~/.config/vim/theme.vim
" Status/tab lines
{% if variant == 'nvim' %}
{{ use_plugin('barbar') }}
{{ use_plugin('feline') }}
{% else %}
{{ use_plugin('airline') }}
{% endif %}
" Goto utilities
{% if variant == 'nvim' %}
@ -36,13 +44,24 @@
{{ use_plugin('shot_f') }}
{{ use_plugin('quick_scope') }}
" Tags
" Registers
{{ use_plugin('registers') }}
" Tags/Symbols
{{ use_plugin('gutentags') }}
{% if variant == 'nvim' %}
{{ use_plugin('symbols-outline') }}
{% else %}
{{ use_plugin('vista') }}
{% endif %}
" Language Server Client
{% if variant == 'nvim' %}
{{ use_plugin('nvim_lspconfig') }}
{{ use_plugin('lightbulb') }}
{{ use_plugin('lspkind') }}
{{ use_plugin('lsp_signature') }}
{% else %}
{{ use_plugin('vim_lsp') }}
{% endif %}
@ -50,6 +69,7 @@
" Treesitter
{% if variant == 'nvim' %}
{{ use_plugin('treesitter') }}
{{ use_plugin('ts-rainbow') }}
{% endif %}
" Snippets
@ -80,6 +100,7 @@
{{ use_plugin('pandoc') }}
{% if variant == 'nvim' %}
{{ use_plugin('dap') }}
{{ use_plugin('colorizer') }}
{% else %}
{% if 'c' in dev_stuffs or 'c++' in dev_stuffs %}
{{ use_plugin('vebugger') }}

View File

@ -3,7 +3,9 @@
set noshowmode
set laststatus=2
let g:airline_powerline_fonts = 1
{% if variant != 'nvim' %}
let g:airline#extensions#tabline#enabled = 1
{% endif %}
let g:airline_section_a = airline#section#create(['mode'])
let g:airline_section_b = airline#section#create(['branch', 'hunks'])

View File

@ -0,0 +1,21 @@
{{ add_source('romgrk/barbar.nvim') -}}
" Move to previous/next
nmap <silent> <C-H> :BufferPrevious<CR>
nmap <silent> <C-L> :BufferNext<CR>
" Re-order to previous/next
nmap <silent> <Space><C-H> :BufferMovePrevious<CR>
nmap <silent> <Space><C-L> :BufferMoveNext<CR>
" Goto buffer in position...
nmap <silent> <C-1> :BufferGoto 1<CR>
nmap <silent> <C-2> :BufferGoto 2<CR>
nmap <silent> <C-3> :BufferGoto 3<CR>
nmap <silent> <C-4> :BufferGoto 4<CR>
nmap <silent> <C-5> :BufferGoto 5<CR>
nmap <silent> <C-6> :BufferGoto 6<CR>
nmap <silent> <C-7> :BufferGoto 7<CR>
nmap <silent> <C-8> :BufferGoto 8<CR>
nmap <silent> <C-0> :BufferGoto 0<CR>
nmap <silent> <C-0> :BufferLast<CR>
nmap <silent> gb :BufferPick<CR>

View File

@ -0,0 +1,7 @@
{# Display the actual color for color codes " #}
{{ add_source('norcalli/nvim-colorizer.lua') -}}
set termguicolors
lua << EOF
require'colorizer'.setup()
EOF
{# TODO Enable for css functions too #}

View File

@ -0,0 +1,169 @@
{# Customisable status line #}
{{ add_source('famiu/feline.nvim') -}}
set noshowmode
set laststatus=2
lua << EOF
local base16_colors = require('base16-colorscheme').colors
local vi_mode_utils = require('feline.providers.vi_mode')
local lsp = require('feline.providers.lsp')
require('feline').setup({
default_bg = 'base01',
default_fg = 'base04',
colors = {
base00 = base16_colors.base00,
base01 = base16_colors.base01,
base02 = base16_colors.base02,
base03 = base16_colors.base03,
base04 = base16_colors.base04,
base05 = base16_colors.base05,
base06 = base16_colors.base06,
base07 = base16_colors.base07,
base08 = base16_colors.base08,
base09 = base16_colors.base09,
base0A = base16_colors.base0A,
base0B = base16_colors.base0B,
base0C = base16_colors.base0C,
base0D = base16_colors.base0D,
base0E = base16_colors.base0E,
base0F = base16_colors.base0F,
},
components = {
left = {
active = {
{
provider = function() return string.format(' %d ', vim.fn.line('$')) end,
-- If you can, make it depend on the actual bar size
left_sep = {
{str = 'block', fg = 'base05'}
},
hl = {
fg = 'base01',
bg = 'base04',
},
},
{
provider = 'vi_mode',
hl = function()
return {
name = vi_mode_utils.get_mode_highlight_name(),
bg = vi_mode_utils.get_mode_color(),
fg = 'white',
style = 'bold',
}
end,
left_sep = {'█'},
right_sep = {'█'},
},
{
provider='',
hl = function()
return {
bg = vi_mode_utils.get_mode_color(),
fg = (vim.bo.modified and 'base09') or 'base0D',
}
end,
},
{
provider = 'file_info',
type = 'relative',
hl = function()
return {
fg = 'base06',
bg = (vim.bo.modified and 'base09') or 'base0D',
style = 'bold',
}
end,
left_sep = {'█'},
right_sep = {'█'},
},
{
provider='',
hl = function()
return {
bg = 'base02',
fg = (vim.bo.modified and 'base09') or 'base0D',
}
end,
},
{
provider = 'position',
hl = { fg = 'base05', bg = 'base02' },
right_sep = {'█'},
},
-- If it miraculously became easy to do, add LSP position here
{
provider='',
hl = { bg = 'base01', fg = 'base02' },
},
}
},
right = {
active = {
{
provider='',
hl = { bg = 'base03', fg = 'base01', },
},
{
provider='z',
enabled = function() return next(vim.lsp.buf_get_clients()) == nil end,
hl = { bg = 'base03', fg = 'base01', },
left_sep = '█',
},
{
provider = 'diagnostic_errors',
enabled = function() return lsp.diagnostics_exist('Error') end,
hl = { fg = 'red', bg = 'base03', },
left_sep = '█',
},
{
provider = 'diagnostic_warnings',
enabled = function() return lsp.diagnostics_exist('Warning') end,
hl = { fg = 'yellow', bg = 'base03', },
left_sep = '█',
},
{
provider = 'diagnostic_hints',
enabled = function() return lsp.diagnostics_exist('Hint') end,
hl = { fg = 'cyan', bg = 'base03', },
left_sep = '█',
},
{
provider = 'diagnostic_info',
enabled = function() return lsp.diagnostics_exist('Information') end,
hl = { fg = 'skyblue', bg = 'base03', },
left_sep = '█',
},
{
provider='█',
hl = { bg = 'base02', fg = 'base03', },
},
{
provider = 'git_diff_added',
hl = { fg = 'green', bg = 'base02', },
left_sep = '█',
enabled = function() return vim.b.gitsigns_status_dict end,
},
{
provider = 'git_diff_changed',
hl = { fg = 'orange', bg = 'base02', },
left_sep = '█',
enabled = function() return vim.b.gitsigns_status_dict end,
},
{
provider = 'git_diff_removed',
hl = { fg = 'red', bg = 'base02', },
left_sep = '█',
enabled = function() return vim.b.gitsigns_status_dict end,
},
{
provider = 'git_branch',
hl = { fg = 'base05', bg = 'base02', style = 'bold', },
right_sep = '█',
left_sep = '█',
enabled = function() return vim.b.gitsigns_status_dict end,
},
}
},
}
})
EOF

View File

@ -0,0 +1,8 @@
{# Show argument documentation when typing a function #}
{{ add_source('ray-x/lsp_signature.nvim') -}}
lua << EOF
require'lsp_signature'.on_attach({
hint_enable = false,
})
EOF

View File

@ -0,0 +1,6 @@
{# Add icons to LSP completions #}
{{ add_source('onsails/lspkind-nvim') -}}
lua << EOF
require('lspkind').init()
EOF

View File

@ -0,0 +1,2 @@
{# Show register content when pressing " #}
{{ add_source('tversteeg/registers.nvim') -}}

View File

@ -0,0 +1,2 @@
{# Customisable status line #}
{{ add_source('dstein64/nvim-scrollview') -}}

View File

@ -1,3 +1,4 @@
{# Flashes under the cursor when moving far #}
{{ add_source('edluffy/specs.nvim') -}}
lua << EOF
require('specs').setup{

View File

@ -0,0 +1,26 @@
{# Show a symbol panel on the right #}
{{ add_source('simrat39/symbols-outline.nvim') -}}
nmap <space>s :SymbolsOutline<CR>
lua << EOF
vim.g.symbols_outline = {
highlight_hovered_item = true,
show_guides = true,
auto_preview = true,
position = 'right',
show_numbers = false,
show_relative_numbers = false,
show_symbol_details = true,
keymaps = {
close = "<Esc>",
goto_location = "<Cr>",
focus_location = "o",
hover_symbol = "<C-space>",
rename_symbol = "r",
code_actions = "a",
},
lsp_blacklist = {},
}
EOF
{# TODO Should be hierarchical, doesn't seem to be :/ #}

View File

@ -5,7 +5,7 @@
noremap gF <cmd>Telescope find_files<cr>
noremap gf <cmd>Telescope git_files<cr>
noremap gb <cmd>Telescope buffers<cr>
noremap gB <cmd>Telescope buffers<cr>
noremap gl <cmd>Telescope current_buffer_fuzzy_find<cr>
noremap gL <cmd>Telescope live_grep<cr>
noremap gT <cmd>Telescope tags<cr>

View File

@ -1,2 +1,3 @@
{# Navigate undo #}
{{ add_source('mbbill/undotree') -}}
nmap <F7> :UndotreeToggle<CR>
nmap <space>u :UndotreeToggle<CR>

View File

@ -1,9 +1,9 @@
{# Tag bar #}
{{ add_source('liuchengxu/vista.vim') -}}
nmap <F8> :Vista!!<CR>
nmap <space>s :Vista!!<CR>
let g:vista_icon_indent = ["▸ ", ""]
let g:vista#renderer#enable_icon = 0
let g:vista#renderer#enable_icon = 1
" The default icons can't be suitable for all the filetypes, you can extend it as you wish.
let g:vista#renderer#icons = {

View File

@ -1,3 +1,4 @@
{{ add_source('hrsh7th/vim-vsnip') -}}
{{ add_source('hrsh7th/vim-vsnip-integ') -}}
{{ add_source('rafamadriz/friendly-snippets') -}}
{# TODO Ansible snippets? #}