diff --git a/config/automatrop/roles/vim/tasks/main.yml b/config/automatrop/roles/vim/tasks/main.yml index fb63c5f..def3f1e 100644 --- a/config/automatrop/roles/vim/tasks/main.yml +++ b/config/automatrop/roles/vim/tasks/main.yml @@ -1,37 +1,3 @@ -- name: Set vim variants to use - set_fact: - vim_variants: - - vim - - nvim -# TODO vim-minimal for bsh -# TODO Select those in a clever way - -- name: Create vim configuration directory - file: - state: directory - path: "{{ ansible_user_dir }}/.config/{{ item }}" - mode: "u=rwx,g=rx,o=rx" - loop: "{{ vim_variants }}" - -- name: Install vim-plug - get_url: - url: https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim - dest: "{{ ansible_user_dir }}/.config/vim/plug.vim" - mode: "u=rw,g=r,o=r" - -- name: Install loader - template: - src: loader.j2 - dest: "{{ ansible_user_dir }}/.config/vim/loader.vim" - mode: "u=rw,g=r,o=r" - -- name: Install theme - template: - src: theme.j2 - dest: "{{ ansible_user_dir }}/.config/vim/theme.vim" - mode: "u=rw,g=r,o=r" - tags: - - color - name: Configure vim plugin list template: diff --git a/config/automatrop/roles/vim/templates/loader.j2 b/config/automatrop/roles/vim/templates/loader.j2 deleted file mode 100644 index 0417ff5..0000000 --- a/config/automatrop/roles/vim/templates/loader.j2 +++ /dev/null @@ -1,6 +0,0 @@ -if has('nvim') - let $MYVIMRC="~/.config/nvim/init.vim" -else - let $MYVIMRC="~/.config/vim/init.vim" -endif -source $MYVIMRC diff --git a/config/automatrop/roles/vim/templates/pluginlist.j2 b/config/automatrop/roles/vim/templates/pluginlist.j2 index 3725f9f..1203064 100644 --- a/config/automatrop/roles/vim/templates/pluginlist.j2 +++ b/config/automatrop/roles/vim/templates/pluginlist.j2 @@ -8,11 +8,9 @@ {%- endmacro -%} " Visuals -{{ use_plugin('base16') }} {{ use_plugin('devicons') }} {% if variant == 'nvim' %} {{ use_plugin('specs') }} -{{ use_plugin('scrollview') }} {% endif %} " Theme @@ -20,7 +18,6 @@ source ~/.config/vim/theme.vim " Status/tab lines {% if variant == 'nvim' %} -{{ use_plugin('barbar') }} {{ use_plugin('feline') }} {% else %} {{ use_plugin('airline') }} diff --git a/config/automatrop/roles/vim/templates/plugins/barbar.j2 b/config/automatrop/roles/vim/templates/plugins/barbar.j2 deleted file mode 100644 index ca9167e..0000000 --- a/config/automatrop/roles/vim/templates/plugins/barbar.j2 +++ /dev/null @@ -1,21 +0,0 @@ -{{ add_source('romgrk/barbar.nvim') -}} - -" Move to previous/next -nmap :BufferPrevious -nmap :BufferNext -" Re-order to previous/next -nmap :BufferMovePrevious -nmap :BufferMoveNext -" Goto buffer in position... -nmap :BufferGoto 1 -nmap :BufferGoto 2 -nmap :BufferGoto 3 -nmap :BufferGoto 4 -nmap :BufferGoto 5 -nmap :BufferGoto 6 -nmap :BufferGoto 7 -nmap :BufferGoto 8 -nmap :BufferGoto 0 -nmap :BufferLast - -nmap gb :BufferPick diff --git a/config/automatrop/roles/vim/templates/plugins/base16.j2 b/config/automatrop/roles/vim/templates/plugins/base16.j2 deleted file mode 100644 index 54f96a1..0000000 --- a/config/automatrop/roles/vim/templates/plugins/base16.j2 +++ /dev/null @@ -1,7 +0,0 @@ -{% if variant == 'nvim' %} -{# Beware, doesn't work without RGB colors #} -{{ add_source('RRethy/nvim-base16') -}} -{% else %} -{{ add_source('chriskempson/base16-vim') -}} -{% endif %} - diff --git a/config/automatrop/roles/vim/templates/plugins/scrollview.j2 b/config/automatrop/roles/vim/templates/plugins/scrollview.j2 deleted file mode 100644 index c443dd8..0000000 --- a/config/automatrop/roles/vim/templates/plugins/scrollview.j2 +++ /dev/null @@ -1,2 +0,0 @@ -{# Customisable status line #} -{{ add_source('dstein64/nvim-scrollview') -}} diff --git a/config/automatrop/roles/vim/templates/plugins/specs.j2 b/config/automatrop/roles/vim/templates/plugins/specs.j2 index 5eb5504..6177dbc 100644 --- a/config/automatrop/roles/vim/templates/plugins/specs.j2 +++ b/config/automatrop/roles/vim/templates/plugins/specs.j2 @@ -2,8 +2,6 @@ {{ add_source('edluffy/specs.nvim') -}} lua << EOF require('specs').setup{ - show_jumps = true, - min_jump = 5, popup = { delay_ms = 0, -- delay before popup displays inc_ms = 10, -- time increments used for fade/resize effects @@ -13,9 +11,5 @@ require('specs').setup{ fader = require('specs').pulse_fader, resizer = require('specs').shrink_resizer }, - ignore_filetypes = {}, - ignore_buftypes = { - nofile = true, - }, } EOF diff --git a/config/automatrop/roles/vim/templates/theme.j2 b/config/automatrop/roles/vim/templates/theme.j2 deleted file mode 100644 index 8300fcc..0000000 --- a/config/automatrop/roles/vim/templates/theme.j2 +++ /dev/null @@ -1 +0,0 @@ -colorscheme base16-{{ base16_scheme }} diff --git a/config/nix/hm/common.nix b/config/nix/hm/common.nix index 274152a..0d5b816 100644 --- a/config/nix/hm/common.nix +++ b/config/nix/hm/common.nix @@ -11,12 +11,14 @@ enableSyntaxHighlighting = true; # syntaxHighlighting.enable = true; # 23.11 syntax }; - neovim = { - enable = true; - defaultEditor = true; - vimAlias = true; - viAlias = true; - }; + # neovim = { + # enable = true; + # defaultEditor = true; + # vimAlias = true; + # viAlias = true; + # vimdiffAlias = true; + # }; + # FIXME Still want this despite using nixvim gpg = { enable = true; homedir = "${config.xdg.dataHome}/gnupg"; @@ -87,6 +89,7 @@ borgbackup # cleanup + ncdu jdupes duperemove optipng diff --git a/config/nix/hm/loader.nix b/config/nix/hm/loader.nix index 717f6c9..2e4ade4 100644 --- a/config/nix/hm/loader.nix +++ b/config/nix/hm/loader.nix @@ -6,5 +6,6 @@ ./dev.nix ./extra.nix ./style.nix + ./vim.nix ]; } diff --git a/config/nix/hm/style.nix b/config/nix/hm/style.nix index c9a855c..6b33a1a 100644 --- a/config/nix/hm/style.nix +++ b/config/nix/hm/style.nix @@ -9,12 +9,23 @@ in imports = [ (import stylix).homeManagerModules.stylix ]; stylix = { + # FIXME Changeable at runtime base16Scheme = "${pkgs.base16-schemes}/share/themes/solarized-dark.yaml"; image = builtins.fetchurl { url = "https://get.wallhere.com/photo/sunlight-abstract-minimalism-green-simple-circle-light-leaf-wave-material-line-wing-computer-wallpaper-font-close-up-macro-photography-124350.png"; sha256 = "sha256:1zfq3f3v34i45mi72pkfqphm8kbhczsg260xjfl6dbydy91d7y93"; }; # FIXME This doesn't work + + # fonts.monospace = { + # package = pkgs.nerdfonts; + # name = "DejaVu Sans Mono Nerd Font"; + # }; + # FIXME We want this, but now we get weird kerning in Alacritty... + # Something I've seen before and probably already fixed, + # maybe something in Alacritty config, which is not imported yet? + + targets.vim.enable = false; # FIXME Not compatible with nixvim for now (there's a MR) }; # Fix https://nix-community.github.io/home-manager/index.html#_why_do_i_get_an_error_message_about_literal_ca_desrt_dconf_literal_or_literal_dconf_service_literal diff --git a/config/nix/hm/vim.nix b/config/nix/hm/vim.nix new file mode 100644 index 0000000..4106e72 --- /dev/null +++ b/config/nix/hm/vim.nix @@ -0,0 +1,59 @@ +{ pkgs, lib, ... }: +let + nixvim = import (builtins.fetchGit { + url = "https://github.com/nix-community/nixvim"; + ref = "nixos-23.05"; + }); +in +{ + imports = [ + nixvim.homeManagerModules.nixvim + ]; + + programs.nixvim = { + enable = true; + colorschemes.base16 = { + # FIXME Dynamic... or use stylix + enable = true; + colorscheme = "solarized-light"; + + }; + plugins = { + # Catches attention when cursor changed position + # TODO Unmapped, do I still want to use it? + specs = { + enable = true; + min_jump = 5; + }; + + # Tabline + barbar.enable = true; + }; + extraPlugins = with pkgs.vimPlugins; [ + nvim-scrollview + ]; + # 23.11: Use keymaps, seems better + maps = { + # barbar + normal."" = { action = "BufferPrevious"; silent = true; }; + normal."" = { action = "BufferNext"; silent = true; }; + # TODO https://www.reddit.com/r/neovim/comments/mbj8m5/how_to_setup_ctrlshiftkey_mappings_in_neovim_and/ + normal."" = { action = "BufferMovePrevious"; silent = true; }; + normal."" = { action = "BufferMoveNext"; silent = true; }; + # TODO gotos don't work + normal."" = { action = "BufferGoto 1"; silent = true; }; + normal."" = { action = "BufferGoto 2"; silent = true; }; + normal."" = { action = "BufferGoto 3"; silent = true; }; + normal."" = { action = "BufferGoto 4"; silent = true; }; + normal."" = { action = "BufferGoto 5"; silent = true; }; + normal."" = { action = "BufferGoto 6"; silent = true; }; + normal."" = { action = "BufferGoto 7"; silent = true; }; + normal."" = { action = "BufferGoto 8"; silent = true; }; + normal."" = { action = "BufferGoto 9"; silent = true; }; + normal."" = { action = "BufferLast"; silent = true; }; + normal."gb" = { action = "BufferPick"; silent = true; }; + # TODO Other useful options? + + }; + }; +} diff --git a/config/nix/us_qwerty-fr b/config/nix/us_qwerty-fr deleted file mode 100644 index a18b0ea..0000000 --- a/config/nix/us_qwerty-fr +++ /dev/null @@ -1,65 +0,0 @@ - -partial alphanumeric_keys -xkb_symbols "qwerty-fr" -{ - include "us(basic)" - include "level3(ralt_switch)" - include "keypad(oss)" - - name[Group1]= "US keyboard with french symbols - AltGr combination"; - - key { [ grave, asciitilde, dead_grave, dead_tilde ] }; - key { [ 1, exclam, onesuperior, exclamdown ] }; - key { [ 2, at, twosuperior, dead_doubleacute ] }; - key { [ 3, numbersign, ecircumflex, Ecircumflex ] }; - key { [ 4, dollar, EuroSign, dead_currency ] }; // FIXME: dead_currency has a different mapping than the one we want for qwerty-fr. Need to define a custom dead key instead. See Windows layout for dead key definition. - key { [ 5, percent, dead_macron, dead_abovedot ] }; - key { [ 6, asciicircum, dead_circumflex, dead_caron ] }; - key { [ 7, ampersand, ucircumflex, Ucircumflex ] }; - key { [ 8, asterisk, icircumflex, Icircumflex ] }; - key { [ 9, parenleft, ocircumflex, Ocircumflex ] }; - key { [ 0, parenright, oslash, Oslash ] }; - key { [ minus, underscore, endash, emdash ] }; - key { [ equal, plus, notequal, approxeq ] }; - - key { [ q, Q, acircumflex, Acircumflex ] }; - key { [ w, W, eacute, Eacute ] }; - key { [ e, E, egrave, Egrave ] }; - key { [ r, R, registered, copyright ] }; - key { [ t, T, thorn, THORN ] }; - key { [ y, Y, dead_invertedbreve, dead_breve ] }; - key { [ u, U, ugrave, Ugrave ] }; - key { [ i, I, igrave, Igrave ] }; - key { [ o, O, ograve, Ograve ] }; - key { [ p, P, oe, OE ] }; - key { [ bracketleft, braceleft, guillemotleft, leftdoublequotemark ] }; - key { [ bracketright, braceright, guillemotright, rightdoublequotemark ] }; - - key { [ a, A, agrave, Agrave ] }; - key { [ s, S, ae, AE ] }; - key { [ d, D, ediaeresis, Ediaeresis ] }; - key { [ f, F, VoidSymbol, VoidSymbol ] }; - key { [ g, G, dead_greek, VoidSymbol ] }; // FIXME: dead_greek has a different mapping than the one we want for qwerty-fr. Need to define a custom dead key instead. See Windows layout for dead key definition. - key { [ h, H, ydiaeresis, Ydiaeresis ] }; - key { [ j, J, udiaeresis, Udiaeresis ] }; - key { [ k, K, idiaeresis, Idiaeresis ] }; - key { [ l, L, odiaeresis, Odiaeresis ] }; - key { [ semicolon, colon, dead_acute, dead_abovering ] }; - key { [ apostrophe, quotedbl, dead_grave, dead_diaeresis ] }; - key { [ backslash, bar, VoidSymbol, doublelowquotemark ] }; // „ - - key { [ less, greater, lessthanequal, greaterthanequal ] }; - key { [ z, Z, adiaeresis, Adiaeresis ] }; - key { [ x, X, multiply, division ] }; - key { [ c, C, ccedilla, Ccedilla ] }; - key { [ v, V, VoidSymbol, VoidSymbol ] }; - key { [ b, B, ssharp, U1E9E ] }; // ß, ẞ (capital) - key { [ n, N, ntilde, Ntilde ] }; - key { [ m, M, VoidSymbol, VoidSymbol ] }; - key { [ comma, less, dead_cedilla, dead_ogonek ] }; - key { [ period, greater, periodcentered, ellipsis ] }; // ., >, ·, … - key { [ slash, question, rightsinglequotemark, questiondown ] }; // /, ?, ’, ¿ - key { [ space, space, nobreakspace, 0x100202F ] }; // espace insécable fine - -}; -