Compare commits

...

3 commits

Author SHA1 Message Date
Geoffrey Frogeye 97d8d3d0b4
nvim 0.5 plugins 2021-07-04 09:54:33 +02:00
Geoffrey Frogeye 0170055efb
Prefer reduced motions
Would be cool to be able to disable gifs but hey
2021-07-04 09:53:24 +02:00
Geoffrey Frogeye 68298bf3f1
Nerd fonts 2021-07-04 09:52:16 +02:00
20 changed files with 307 additions and 34 deletions

View file

@ -22,7 +22,7 @@ URxvt*scrollBar: false
! Font declaration ! 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 ! Font spacing
URxvt.letterSpace: 0 URxvt.letterSpace: 0

View file

@ -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*dynamicColors: true
xterm*utf8: 2 xterm*utf8: 2
xterm*eightBitInput: true xterm*eightBitInput: true

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -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') -}} {{ add_source('chriskempson/base16-vim') -}}
{#
{% endif %}
#}
colorscheme base16-default-dark colorscheme base16-default-dark
" let base16colorspace=256 " let base16colorspace=256

View file

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

View file

@ -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

View file

@ -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

View file

@ -1,4 +1,7 @@
{# Use TAB for autocompletion #} {# Use TAB for autocompletion #}
{{ add_source('ervandew/supertab') -}} {{ 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:SuperTabDefaultCompletionType = "<c-n>" " Go down when completing
let g:SuperTabContextDefaultCompletionType = "<c-n>" let g:SuperTabContextDefaultCompletionType = "<c-n>"

View file

@ -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

View file

@ -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 #}

View file

@ -4,14 +4,6 @@
" (providers are automatically detected thanks to vim-lsp-settings. " (providers are automatically detected thanks to vim-lsp-settings.
" You can even install some locally using :LspInstallServer) " 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_signs_enabled = 1
let g:lsp_diagnostics_echo_cursor = 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_signs_hint = {'text': '?'}
let g:lsp_highlight_references_enabled = 1 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

View file

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

View file

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

View file

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

View file

@ -53,7 +53,7 @@ module-margin-right = 1
font-0 = "Font Awesome:size=10;0" font-0 = "Font Awesome:size=10;0"
font-1 = "DejaVu Sans: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 modules-left = i3

View file

@ -54,6 +54,9 @@ c.url.searchengines = {
# Only allow first party cookies # Only allow first party cookies
config.set("content.cookies.accept", "no-3rdparty", "chrome://*/*") 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. # Page(s) to open at the start.
# Type: List of FuzzyUrl, or FuzzyUrl # Type: List of FuzzyUrl, or FuzzyUrl
c.url.start_pages = "https://geoffrey.frogeye.fr/blank.html" c.url.start_pages = "https://geoffrey.frogeye.fr/blank.html"