···11+tv init fish | source
22+bind \t __tv_complete
33+44+function __tv_complete -d 'fish completion widget with tv'
55+ # modified from https://github.com/junegunn/fzf/wiki/Examples-(fish)#completion
66+ # As of 2.6, fish's "complete" function does not understand
77+ # subcommands. Instead, we use the same hack as __fish_complete_subcommand and
88+ # extract the subcommand manually.
99+ set -l cmd (commandline -co) (commandline -ct)
1010+1111+ switch $cmd[1]
1212+ case env sudo
1313+ for i in (seq 2 (count $cmd))
1414+ switch $cmd[$i]
1515+ case '-*'
1616+ case '*=*'
1717+ case '*'
1818+ set cmd $cmd[$i..-1]
1919+ break
2020+ end
2121+ end
2222+ end
2323+2424+ set -l cmd_lastw $cmd[-1]
2525+ set cmd (string join -- ' ' $cmd)
2626+2727+ set -l complist (complete -C$cmd)
2828+ set -l result
2929+3030+ # do nothing if there is nothing to select from
3131+ test -z "$complist"; and return
3232+3333+ set -l compwc (echo $complist | wc -w)
3434+ if test $compwc -eq 1
3535+ # if there is only one option dont open fzf
3636+ set result "$complist"
3737+ else
3838+ set result (string join -- \n $complist | column -t -l 2 -o \t | tv --select-1 --no-status-bar --keybindings='tab="confirm_selection"' --inline --input-header "$cmd" | string split -m 2 -f 1 \t | string trim --right)
3939+ end
4040+4141+ set -l prefix (string sub -s 1 -l 1 -- (commandline -t))
4242+ for i in (seq (count $result))
4343+ set -l r $result[$i]
4444+ switch $prefix
4545+ case "'"
4646+ commandline -t -- (string escape -- $r)
4747+ case '"'
4848+ if string match '*"*' -- $r >/dev/null
4949+ commandline -t -- (string escape -- $r)
5050+ else
5151+ commandline -t -- '"'$r'"'
5252+ end
5353+ case '~'
5454+ commandline -t -- (string sub -s 2 (string escape -n -- $r))
5555+ case '*'
5656+ commandline -t -- $r
5757+ end
5858+ commandline -i ' '
5959+ end
6060+ commandline -f repaint
6161+end
···11--- NOTE: Plugins can also be configured to run Lua code when they are loaded.
22---
33--- This is often very useful to both group configuration, as well as handle
44--- lazy loading plugins that don't need to be loaded immediately at startup.
55---
66--- For example, in the following configuration, we use:
77--- event = 'VimEnter'
88---
99--- which loads which-key before all the UI elements are loaded. Events can be
1010--- normal autocommands events (`:help autocmd-events`).
1111---
1212--- Then, because we use the `opts` key (recommended), the configuration runs
1313--- after the plugin has been loaded as `require(MODULE).setup(opts)`.
1414-151return {
1616- { -- Useful plugin to show you pending keybinds.
22+ {
173 "folke/which-key.nvim",
184 event = "VimEnter", -- Sets the loading event to 'VimEnter'
195 opts = {
2020- -- delay between pressing a key and opening which-key (milliseconds)
2121- -- this setting is independent of vim.o.timeoutlen
2222- delay = 0,
2323- icons = {
2424- -- set icon mappings to true if you have a Nerd Font
2525- mappings = vim.g.have_nerd_font,
2626- -- If you are using a Nerd Font: set icons.keys to an empty table which will use the
2727- -- default which-key.nvim defined Nerd Font icons, otherwise define a string table
2828- keys = vim.g.have_nerd_font and {} or {
2929- Up = "<Up> ",
3030- Down = "<Down> ",
3131- Left = "<Left> ",
3232- Right = "<Right> ",
3333- C = "<C-…> ",
3434- M = "<M-…> ",
3535- D = "<D-…> ",
3636- S = "<S-…> ",
3737- CR = "<CR> ",
3838- Esc = "<Esc> ",
3939- ScrollWheelDown = "<ScrollWheelDown> ",
4040- ScrollWheelUp = "<ScrollWheelUp> ",
4141- NL = "<NL> ",
4242- BS = "<BS> ",
4343- Space = "<Space> ",
4444- Tab = "<Tab> ",
4545- F1 = "<F1>",
4646- F2 = "<F2>",
4747- F3 = "<F3>",
4848- F4 = "<F4>",
4949- F5 = "<F5>",
5050- F6 = "<F6>",
5151- F7 = "<F7>",
5252- F8 = "<F8>",
5353- F9 = "<F9>",
5454- F10 = "<F10>",
5555- F11 = "<F11>",
5656- F12 = "<F12>",
5757- },
66+ delay = 550,
77+ preset = "helix",
88+ keys = {
99+ scroll_down = "<c-n>",
1010+ scroll_up = "<c-p>",
5811 },
5959-6060- -- Document existing key chains
6112 spec = {
6213 -- { '<leader>s', group = '[S]earch' },
6314 -- { '<leader>t', group = '[T]oggle' },
+1
modules/vic/dots/config/nvim/lua/prelude.lua
···11vim.g.mapleader = " "
22vim.g.maplocalleader = " "
33vim.g.have_nerd_font = not vim.g.vscode
44+vim.api.nvim_create_user_command("Q", "qa!", { bang = true })