Skip to content

Commit

Permalink
refactor(shell_utils, neovim): universalize all file preview tools ke…
Browse files Browse the repository at this point in the history
…ymaps
  • Loading branch information
rudenkornk committed May 12, 2024
1 parent 5b99438 commit 25a124c
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 3 deletions.
16 changes: 16 additions & 0 deletions roles/neovim/files/lazy/lua/plugins/configs/telescope.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
local M = {}

M.opts = function(_, opts)
local actions = require("telescope.actions")

opts.defaults.scroll_strategy = "limit"
opts.extension_list = { "undo" }
opts.defaults.mappings = {
i = {
["<C-f>"] = actions.results_scrolling_down,
["<C-b>"] = actions.results_scrolling_up,
},
}
end

return M
4 changes: 1 addition & 3 deletions roles/neovim/files/lazy/lua/plugins/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@ return {
},
{
"nvim-telescope/telescope.nvim",
opts = {
extensions_list = { "undo" },
},
opts = require("plugins.configs.telescope").opts,
},
{
"stevearc/conform.nvim",
Expand Down
24 changes: 24 additions & 0 deletions roles/shell_utils/files/yazi_keymap.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[[manager.prepend_keymap]]
on = [ "?" ]
run = "help"
desc = "Show help"

[[manager.prepend_keymap]]
on = [ "<C-n>" ]
run = "arrow 1"
desc = "Next item"

[[manager.prepend_keymap]]
on = [ "<C-p>" ]
run = "arrow -1"
desc = "Prev item"

[[manager.prepend_keymap]]
on = [ "<C-d>" ]
run = "seek 10"
desc = "Scroll content down"

[[manager.prepend_keymap]]
on = [ "<C-u>" ]
run = "seek -10"
desc = "Scroll content up"
12 changes: 12 additions & 0 deletions roles/shell_utils/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,18 @@
state: link
loop: [ya, yazi]

- name: Create ~/.config/yazi directory
ansible.builtin.file:
dest: "{{ home }}/.config/yazi"
state: directory
mode: "0o755"

- name: Create symlink to yazi keymap
ansible.builtin.file:
src: "{{ remote_role_path }}/files/yazi_keymap.toml"
dest: "{{ home }}/.config/yazi/keymap.toml"
state: link

- name: Create symlink to fd on Ubuntu
ansible.builtin.file:
src: "/usr/bin/fdfind"
Expand Down

0 comments on commit 25a124c

Please sign in to comment.