3 Commits

Author SHA1 Message Date
Geoffrey Frogeye 97d8d3d0b4
nvim 0.5 plugins 5 months ago
Geoffrey Frogeye 0170055efb
Prefer reduced motions 5 months ago
Geoffrey Frogeye 68298bf3f1
Nerd fonts 5 months ago
  1. 2
      config/Xresources/urxvt
  2. 2
      config/Xresources/xterm
  3. 24
      config/alacritty/alacritty.yml.j2
  4. 19
      config/automatrop/roles/desktop_environment/tasks/main.yml
  5. 2
      config/automatrop/roles/software/templates/snippets/pm_dev_common.j2
  6. 7
      config/automatrop/roles/vim/templates/editor.j2
  7. 25
      config/automatrop/roles/vim/templates/pluginlist.j2
  8. 9
      config/automatrop/roles/vim/templates/plugins/base16.j2
  9. 5
      config/automatrop/roles/vim/templates/plugins/devicons.j2
  10. 84
      config/automatrop/roles/vim/templates/plugins/nvim_compe.j2
  11. 70
      config/automatrop/roles/vim/templates/plugins/nvim_lspconfig.j2
  12. 3
      config/automatrop/roles/vim/templates/plugins/supertab.j2
  13. 39
      config/automatrop/roles/vim/templates/plugins/telescope.j2
  14. 6
      config/automatrop/roles/vim/templates/plugins/treesitter.j2
  15. 32
      config/automatrop/roles/vim/templates/plugins/vim_lsp.j2
  16. 3
      config/automatrop/roles/vim/templates/plugins/vsnip.j2
  17. 2
      config/lemonbar/display.py
  18. 2
      config/lemonbar/pip.py
  19. 2
      config/polybar/config
  20. 3
      config/qutebrowser/config.py

2
config/Xresources/urxvt

@ -22,7 +22,7 @@ URxvt*scrollBar: false
! Font declaration
URxvt.font: xft:DejaVu Sans Mono for Powerline:size=12:antialias=true,xft:Twemoji:size=12:antialias=true,xft:symbola:size=12:minspace=False
URxvt.font: xft:DejaVuSansMono Nerd Font Mono:size=12:antialias=true,xft:Twemoji:size=12:antialias=true,xft:symbola:size=12:minspace=False
! Font spacing
URxvt.letterSpace: 0

2
config/Xresources/xterm

@ -1,4 +1,4 @@
xterm*faceName : DejaVu Sans Mono for Powerline:size=12:antialias=true
xterm*faceName : DejaVuSansMono Nerd Font Mono:size=12:antialias=true
xterm*dynamicColors: true
xterm*utf8: 2
xterm*eightBitInput: true

24
config/alacritty/alacritty.yml.j2

@ -105,50 +105,50 @@ window:
# Font configuration
font:
# Normal (roman) font face
#normal:
normal:
# Font family
#
# Default:
# - (macOS) Menlo
# - (Linux/BSD) monospace
# - (Windows) Consolas
#family: monospace
family: DejaVuSansMono Nerd Font Mono
# The `style` can be specified to pick a specific face.
#style: Regular
style: Regular
# Bold font face
#bold:
bold:
# Font family
#
# If the bold family is not specified, it will fall back to the
# value specified for the normal font.
#family: monospace
family: DejaVuSansMono Nerd Font Mono
# The `style` can be specified to pick a specific face.
#style: Bold
style: Bold
# Italic font face
#italic:
italic:
# Font family
#
# If the italic family is not specified, it will fall back to the
# value specified for the normal font.
#family: monospace
family: DejaVuSansMono Nerd Font Mono
# The `style` can be specified to pick a specific face.
#style: Italic
style: Oblique
# Bold italic font face
#bold_italic:
bold_italic:
# Font family
#
# If the bold italic family is not specified, it will fall back to the
# value specified for the normal font.
#family: monospace
family: DejaVuSansMono Nerd Font Mono
# The `style` can be specified to pick a specific face.
#style: Bold Italic
style: Bold Oblique
# Point size
size: 12.0

19
config/automatrop/roles/desktop_environment/tasks/main.yml

@ -12,22 +12,27 @@
- ".config/tridactyl/themes"
# Download fonts
- name: Download terminal fonts
- name: Download Nerd fonts
get_url:
url: "http://raw.githubusercontent.com/powerline/fonts/master/DejaVuSansMono/{{ item | urlencode }}"
dest: "{{ ansible_user_dir }}/.local/share/fonts/{{ item }}"
url: "https://raw.githubusercontent.com/ryanoasis/nerd-fonts/master/patched-fonts/DejaVuSansMono/{{ item.folder }}/complete/{{ item.filename | urlencode }}"
dest: "{{ ansible_user_dir }}/.local/share/fonts/{{ item.filename }}"
mode: "u=rw,g=r,o=r"
loop:
- DejaVu Sans Mono Bold for Powerline.ttf
- DejaVu Sans Mono Bold Oblique for Powerline.ttf
- DejaVu Sans Mono for Powerline.ttf
- DejaVu Sans Mono Oblique for Powerline.ttf
- filename: DejaVu Sans Mono Bold Nerd Font Complete Mono.ttf
folder: Bold
- filename: DejaVu Sans Mono Bold Oblique Nerd Font Complete Mono.ttf
folder: Bold-Italic
- filename: DejaVu Sans Mono Nerd Font Complete Mono.ttf
folder: Regular
- filename: DejaVu Sans Mono Oblique Nerd Font Complete Mono.ttf
folder: Italic
- name: Download icon fonts
get_url:
url: "https://raw.githubusercontent.com/FortAwesome/Font-Awesome/a8386aae19e200ddb0f6845b5feeee5eb7013687/fonts/fontawesome-webfont.ttf"
dest: "{{ ansible_user_dir }}/.local/share/fonts/fontawesome-webfont.ttf"
mode: "u=rw,g=r,o=r"
# TODO Either replace with ForkAwesome or Nerd Fonts
- name: Install python dependencies for lemonbar
pip:

2
config/automatrop/roles/software/templates/snippets/pm_dev_common.j2

@ -9,3 +9,5 @@ universal-ctags
{% if not termux %}
highlight
{% endif %}
{# For nvim's :Telescope live_grep #}
ripgrep

7
config/automatrop/roles/vim/templates/editor.j2

@ -67,10 +67,15 @@ filetype on
filetype plugin on
filetype indent on
set wildmode=longest,list
set wildmode=longest:full,full
set wildmenu
set showcmd
" Completion
" Avoid showing message extra message when using completion
set shortmess+=c
" Close the file explorer once you select a file
let g:netrw_fastbrowse = 0

25
config/automatrop/roles/vim/templates/pluginlist.j2

@ -7,12 +7,17 @@
" END PLUGIN CONFIG {{ name }}
{%- endmacro -%}
" Theming
" Visuals
{{ use_plugin('base16') }}
{{ use_plugin('airline') }}
{{ use_plugin('devicons') }}
" Goto utilities
{% if variant == 'nvim' %}
{{ use_plugin('telescope') }}
{% else %}
{{ use_plugin('fzf') }}
{% endif %}
" Search/replace
{{ use_plugin('abolish') }}
@ -30,11 +35,27 @@
{{ use_plugin('vista') }}
" Language Server Client
{% if variant == 'nvim' %}
{{ use_plugin('nvim_lspconfig') }}
{% else %}
{{ use_plugin('vim_lsp') }}
{% endif %}
" Treesitter
{% if variant == 'nvim' %}
{{ use_plugin('treesitter') }}
{% endif %}
" Snippets
{{ use_plugin('vsnip') }}
" Auto-completion
{% if variant == 'nvim' %}
{{ use_plugin('nvim_compe') }}
{% else %}
{{ use_plugin('deoplete') }}
{{ use_plugin('supertab') }}
{% endif %}
" Undo management
{{ use_plugin('undotree') }}
@ -50,9 +71,11 @@
{% if 'c' in dev_stuffs or 'c++' in dev_stuffs %}
{{ use_plugin('vebugger') }}
{% endif %}
{#
{% if 'python' in dev_stuffs and variant == 'nvim' %}
{{ use_plugin('semshi') }}
{% endif %}
#}
{% if 'ansible' in dev_stuffs %}
{{ use_plugin('ansible') }}
{% endif %}

9
config/automatrop/roles/vim/templates/plugins/base16.j2

@ -1,4 +1,13 @@
{#
" nvim plugin doesn't support terminal colors
{% if variant == 'nvim' %}
{{ add_source('RRethy/nvim-base16') -}}
{% else %}
#}
{{ add_source('chriskempson/base16-vim') -}}
{#
{% endif %}
#}
colorscheme base16-default-dark
" let base16colorspace=256

5
config/automatrop/roles/vim/templates/plugins/devicons.j2

@ -0,0 +1,5 @@
{% if variant == 'nvim' %}
{{ add_source('kyazdani42/nvim-web-devicons') -}}
{% else %}
{{ add_source('ryanoasis/vim-devicons') -}}
{% endif %}

84
config/automatrop/roles/vim/templates/plugins/nvim_compe.j2

@ -0,0 +1,84 @@
{{ add_source('hrsh7th/nvim-compe') -}}
{# I'm a bit lost with all this, so this is the default recommended config,
using vim-vsnip because the proposed configuration for tab-completion uses it, so… #}
lua << EOF
require'compe'.setup {
enabled = true;
autocomplete = true;
debug = false;
min_length = 1;
preselect = 'enable';
throttle_time = 80;
source_timeout = 200;
resolve_timeout = 800;
incomplete_delay = 400;
max_abbr_width = 100;
max_kind_width = 100;
max_menu_width = 100;
documentation = {
border = { '', '' ,'', ' ', '', '', '', ' ' }, -- the border option is the same as `|help nvim_open_win|`
winhighlight = "NormalFloat:CompeDocumentation,FloatBorder:CompeDocumentationBorder",
max_width = 120,
min_width = 60,
max_height = math.floor(vim.o.lines * 0.3),
min_height = 1,
};
source = {
path = true;
buffer = true;
calc = true;
nvim_lsp = true;
vsnip = true;
};
}
EOF
set completeopt=menuone,noselect
inoremap <silent><expr> <C-Space> compe#complete()
inoremap <silent><expr> <CR> compe#confirm('<CR>')
inoremap <silent><expr> <C-e> compe#close('<C-e>')
inoremap <silent><expr> <C-f> compe#scroll({ 'delta': +4 })
inoremap <silent><expr> <C-d> compe#scroll({ 'delta': -4 })
lua << EOF
local t = function(str)
return vim.api.nvim_replace_termcodes(str, true, true, true)
end
local check_back_space = function()
local col = vim.fn.col('.') - 1
return col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') ~= nil
end
-- Use (s-)tab to:
--- move to prev/next item in completion menuone
--- jump to prev/next snippet's placeholder
_G.tab_complete = function()
if vim.fn.pumvisible() == 1 then
return t "<C-n>"
elseif vim.fn['vsnip#available'](1) == 1 then
return t "<Plug>(vsnip-expand-or-jump)"
elseif check_back_space() then
return t "<Tab>"
else
return vim.fn['compe#complete']()
end
end
_G.s_tab_complete = function()
if vim.fn.pumvisible() == 1 then
return t "<C-p>"
elseif vim.fn['vsnip#jumpable'](-1) == 1 then
return t "<Plug>(vsnip-jump-prev)"
else
-- If <S-Tab> is not working in your terminal, change it to <C-h>
return t "<S-Tab>"
end
end
vim.api.nvim_set_keymap("i", "<Tab>", "v:lua.tab_complete()", {expr = true})
vim.api.nvim_set_keymap("s", "<Tab>", "v:lua.tab_complete()", {expr = true})
vim.api.nvim_set_keymap("i", "<S-Tab>", "v:lua.s_tab_complete()", {expr = true})
vim.api.nvim_set_keymap("s", "<S-Tab>", "v:lua.s_tab_complete()", {expr = true})
EOF

70
config/automatrop/roles/vim/templates/plugins/nvim_lspconfig.j2

@ -0,0 +1,70 @@
{# LSP client for neovim ≥ 0.5 #}
{{ add_source('neovim/nvim-lspconfig') -}}
lua << EOF
local nvim_lsp = require('lspconfig')
-- Use an on_attach function to only map the following keys
-- after the language server attaches to the current buffer
local on_attach = function(client, bufnr)
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
vim.lsp.diagnostic.on_publish_diagnostics, {
-- disable virtual text
virtual_text = false,
-- show signs
signs = true,
-- delay update diagnostics
update_in_insert = false,
}
)
local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end
local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end
--Enable completion triggered by <c-x><c-o>
buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')
-- Mappings.
local opts = { noremap=true, silent=true }
-- See `:help vim.lsp.*` for documentation on any of the below functions
buf_set_keymap('n', 'gD', '<Cmd>lua vim.lsp.buf.declaration()<CR>', opts)
-- buf_set_keymap('n', 'gd', '<Cmd>lua vim.lsp.buf.definition()<CR>', opts)
buf_set_keymap('n', 'K', '<Cmd>lua vim.lsp.buf.hover()<CR>', opts)
buf_set_keymap('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts)
buf_set_keymap('n', '<C-K>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
buf_set_keymap('n', '<space>wa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', opts)
buf_set_keymap('n', '<space>wr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', opts)
buf_set_keymap('n', '<space>wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', opts)
buf_set_keymap('n', '<space>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
buf_set_keymap('n', '<space>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
-- buf_set_keymap('n', '<space>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts)
-- buf_set_keymap('n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>', opts)
buf_set_keymap('n', '<space>d', '<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>', opts)
buf_set_keymap('n', '[d', '<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>', opts)
buf_set_keymap('n', ']d', '<cmd>lua vim.lsp.diagnostic.goto_next()<CR>', opts)
-- buf_set_keymap('n', '<space>q', '<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>', opts)
buf_set_keymap("n", "<space>f", "<cmd>lua vim.lsp.buf.formatting()<CR>", opts)
buf_set_keymap("v", "<space>f", "<cmd>lua vim.lsp.buf.range_formatting()<CR><Esc>", opts)
end
-- Use a loop to conveniently call 'setup' on multiple servers and
-- map buffer local keybindings when the language server attaches
local servers = {
{% if 'python' in dev_stuffs %}
"pyls",
{% endif %}
}
for _, lsp in ipairs(servers) do
nvim_lsp[lsp].setup {
on_attach = on_attach,
flags = {
debounce_text_changes = 150,
}
}
end
EOF

3
config/automatrop/roles/vim/templates/plugins/supertab.j2

@ -1,4 +1,7 @@
{# Use TAB for autocompletion #}
{{ add_source('ervandew/supertab') -}}
let g:SuperTabLongestEnhanced = 1
let g:SuperTabLongestHighlight = 1
{# TODO longest doesn't work, even when longest is set in completeopt #}
let g:SuperTabDefaultCompletionType = "<c-n>" " Go down when completing
let g:SuperTabContextDefaultCompletionType = "<c-n>"

39
config/automatrop/roles/vim/templates/plugins/telescope.j2

@ -0,0 +1,39 @@
{{ add_source('nvim-telescope/telescope.nvim') -}}
{# Dependencies #}
{{ add_source('nvim-lua/popup.nvim') -}}
{{ add_source('nvim-lua/plenary.nvim') -}}
noremap gF <cmd>Telescope find_files<cr>
noremap gf <cmd>Telescope git_files<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>
noremap gt <cmd>Telescope treesitter<cr>
noremap gm <cmd>Telescope marks<cr>
noremap gh <cmd>Telescope oldfiles<cr>
noremap gH <cmd>Telescope command_history<cr>
noremap gS <cmd>Telescope search_history<cr>
noremap gc <cmd>Telescope commands<cr>
noremap gr <cmd>Telescope lsp_references<cr>
noremap ga <cmd>Telescope lsp_code_actions<cr>
vnoremap ga <cmd>Telescope lsp_range_code_actions<cr>
noremap gq <cmd>Telescope lsp_document_diagnostics<cr>
noremap gQ <cmd>Telescope lsp_workspace_diagnostics<cr>
noremap gd <cmd>Telescope lsp_definitions<cr>
lua << EOF
require('telescope').setup{
defaults = {
vimgrep_arguments = {
'rg',
'--color=never',
'--no-heading',
'--with-filename',
'--line-number',
'--column',
'--smart-case'
},
}
}
EOF

6
config/automatrop/roles/vim/templates/plugins/treesitter.j2

@ -0,0 +1,6 @@
{# Allow for better syntax highlighting. Bit experimental #}
{{ add_source('nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}) -}}
{# To check if it's really working
{{ add_source('nvim-treesitter/playground') -}}
#}
{# TODO Find a way to run `:TSInstall all` non-interactively #}

32
config/automatrop/roles/vim/templates/plugins/vim_lsp.j2

@ -4,14 +4,6 @@
" (providers are automatically detected thanks to vim-lsp-settings.
" You can even install some locally using :LspInstallServer)
nnoremap gd :LspDefinition<CR>
nnoremap gD :LspDeclaration<CR>
nnoremap <F3> :LspDocumentFormat<CR>
vnoremap <F3> :LspDocumentRangeFormat<CR>
nnoremap gE :LspNextDiagnostic<CR>
nnoremap ge :LspNextError<CR>
nnoremap <F2> :LspRename<CR>
let g:lsp_signs_enabled = 1
let g:lsp_diagnostics_echo_cursor = 1
@ -21,3 +13,27 @@ let g:lsp_signs_information = {'text': 'ℹ'}
let g:lsp_signs_hint = {'text': '?'}
let g:lsp_highlight_references_enabled = 1
function! s:on_lsp_buffer_enabled() abort
setlocal omnifunc=lsp#complete
setlocal signcolumn=yes
if exists('+tagfunc') | setlocal tagfunc=lsp#tagfunc | endif
nmap <buffer> gd <plug>(lsp-definition)
nmap <buffer> gD <plug>(lsp-declaration)
nmap <buffer> gr <plug>(lsp-references)
nmap <buffer> gi <plug>(lsp-implementation)
nmap <buffer> <space>rn <plug>(lsp-rename)
nmap <buffer> [d <plug>(lsp-previous-diagnostic)
nmap <buffer> ]d <plug>(lsp-next-diagnostic)
nmap <buffer> K <plug>(lsp-hover)
nmap <buffer> <space>f <plug>(lsp-document-format)
vmap <buffer> <space>f <plug>(lsp-document-range-format)
inoremap <buffer> <expr><c-f> lsp#scroll(+4)
inoremap <buffer> <expr><c-d> lsp#scroll(-4)
endfunction
augroup lsp_install
au!
" call s:on_lsp_buffer_enabled only for languages that has the server registered.
autocmd User lsp_buffer_enabled call s:on_lsp_buffer_enabled()
augroup END

3
config/automatrop/roles/vim/templates/plugins/vsnip.j2

@ -0,0 +1,3 @@
{{ add_source('hrsh7th/vim-vsnip') -}}
{{ add_source('hrsh7th/vim-vsnip-integ') -}}
{{ add_source('rafamadriz/friendly-snippets') -}}

2
config/lemonbar/display.py

@ -54,7 +54,7 @@ class Bar:
"""
# Constants
FONTS = ["DejaVu Sans Mono for Powerline", "Font Awesome"]
FONTS = ["DejaVuSansMono Nerd Font Mono", "Font Awesome"]
FONTSIZE = 10
@staticmethod

2
config/lemonbar/pip.py

@ -13,7 +13,7 @@ import i3ipc
import difflib
# Constants
FONT = "DejaVu Sans Mono for Powerline"
FONT = "DejaVuSansMono Nerd Font Mono"
# TODO Update to be in sync with base16
thm = [

2
config/polybar/config

@ -53,7 +53,7 @@ module-margin-right = 1
font-0 = "Font Awesome:size=10;0"
font-1 = "DejaVu Sans:size=10;0"
font-2 = "DejaVu Sans Mono for Powerline:pixelsize=10;0"
font-2 = "DejaVuSansMono Nerd Font Mono:pixelsize=10;0"
modules-left = i3

3
config/qutebrowser/config.py

@ -54,6 +54,9 @@ c.url.searchengines = {
# Only allow first party cookies
config.set("content.cookies.accept", "no-3rdparty", "chrome://*/*")
# Request websites to reduce non-essential motion/animations
config.set("content.prefers_reduced_motion", True)
# Page(s) to open at the start.
# Type: List of FuzzyUrl, or FuzzyUrl
c.url.start_pages = "https://geoffrey.frogeye.fr/blank.html"

Loading…
Cancel
Save