From e1609c825f5cf904fc9453a23ccd0bf2ba1306ac Mon Sep 17 00:00:00 2001 From: Pim Kunis Date: Fri, 20 Jan 2023 00:16:35 +0100 Subject: [PATCH] add neovim package manager and dial.nvim --- README.md | 7 +++++-- roles/neovim/files/init.lua | 15 +++++++++++++++ roles/neovim/tasks/main.yml | 16 +++++++++++++++- 3 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 roles/neovim/files/init.lua diff --git a/README.md b/README.md index a872853..8cfc57c 100644 --- a/README.md +++ b/README.md @@ -11,11 +11,9 @@ My current setup is [Regolith OS](https://regolith-desktop.com/) which is basica ## TODO - Telegram (maybe only possible to download) -- Cool neovim setup - thunderbird config - some kind of tag setup with: bootstrap, update, etc. - i3 app shortcuts -- default git branch master - Configuration for desktop at uni. It should be really similar, except syncthing should have a new keypair. Also some applications are not necessary, e.g. nicotine+ and virtualbox. Would like Ansible Vault to check in keypair for syncthing. @@ -27,6 +25,11 @@ However, keepass cannot run secret service as Ubuntu already runs one. But if I disable that, my SSH agent does not work anymore. As an intermediate solution, I can just put the password in keepass... +#### Neovim + +- More cool plugins :) +- How to configure dial.nvim? + ## Long-term TODO - Move away from GNOME because it is quite slow and configuration is pretty bad. This would also mean moving away from Regolith unfortunately. I would probably move to KDE with i3. Maybe there is some distro that does this OOTB? diff --git a/roles/neovim/files/init.lua b/roles/neovim/files/init.lua new file mode 100644 index 0000000..025c0d1 --- /dev/null +++ b/roles/neovim/files/init.lua @@ -0,0 +1,15 @@ +return require('packer').startup(function(use) + use 'wbthomason/packer.nvim' + use { + 'monaqa/dial.nvim', + config = function () + vim.api.nvim_set_keymap("n", "", require("dial.map").inc_normal(), {noremap = true}) + vim.api.nvim_set_keymap("n", "", require("dial.map").dec_normal(), {noremap = true}) + vim.api.nvim_set_keymap("v", "", require("dial.map").inc_visual(), {noremap = true}) + vim.api.nvim_set_keymap("v", "", require("dial.map").dec_visual(), {noremap = true}) + vim.api.nvim_set_keymap("v", "g", require("dial.map").inc_gvisual(), {noremap = true}) + vim.api.nvim_set_keymap("v", "g", require("dial.map").dec_gvisual(), {noremap = true}) + end + + } +end) diff --git a/roles/neovim/tasks/main.yml b/roles/neovim/tasks/main.yml index 6de79ed..458cdb9 100644 --- a/roles/neovim/tasks/main.yml +++ b/roles/neovim/tasks/main.yml @@ -1,6 +1,6 @@ - name: Download Neovim PPA signing key become: true - ansible.builtin.apt_key: + apt_key: keyserver: keyserver.ubuntu.com id: 9DBB0BE9366964F134855E2255F96FCF8231B6DD keyring: /etc/apt/keyrings/neovim.gpg @@ -18,3 +18,17 @@ become: true apt: name: neovim +- name: Create pack directory + file: + path: ~/.config/nvim/pack/packer/start + state: directory + recurse: true +- name: Clone packer repository + git: + repo: https://github.com/wbthomason/packer.nvim + dest: ~/.config/nvim/pack/packer/start/packer.nvim + depth: 1 +- name: Copy init.lua + copy: + src: "{{ role_path }}/files/init.lua" + dest: ~/.config/nvim/init.lua