Skip to content

cpkio/nvim-fzf-commands-win

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 

Repository files navigation

nvim-fzf commands for Windows

Environment variables I use by default:

BAT_STYLE=numbers,changes

FZF_DEFAULT_OPTS=--no-mouse --layout=default --preview-window=hidden:border-left --margin=0 --padding=1 --pointer=⏵ --marker=+ --info=inline --tabstop=4 --no-bold --bind=f2:toggle-preview,f3:toggle-preview-wrap,shift-down:preview-down,shift-up:preview-up,ctrl-d:half-page-down,ctrl-u:half-page-up,ctrl-f:page-down,ctrl-b:page-up,ctrl-a:toggle-all,ctrl-l:clear-query,ctrl-s:toggle-sort

FZF_DEFAULT_COMMAND=rg --files --no-ignore --hidden --follow --glob "!.git/*" --color=auto

FZF_PREVIEW_COMMAND=bat --decorations=always --paging=never --italic-text=never --color=always --theme=ansi --wrap=never

How to use

I map commands to keyboard shortcuts directly:

local map = vim.api.nvim_set_keymap
local options = { noremap = true, silent = true }
local common_fzf_opts = '{ border = false, relative = "editor", width=280, noautocmd = true }'
map('n','<C-d>f', '<CMD>lua require("fzf-commands-windows").files({ fzf = function(contents, options) return require("fzf").fzf(contents, options, ' .. common_fzf_opts ..') end })<CR>', options)

Universal Ctags settings for Ctags command

Use --excmd=combine to add line numbers to tags file.

TODO

  1. Files

    • CTRL-S to open file in a split
    • CTRL-V to open file in a vertical split
    • CTRL-T to open file in a new tab
  2. Marks

    • CTRL-Q to delete mark(s)
    • CTRL-S to open mark(s) location in a split
    • CTRL-V to open mark(s) location in a vertical split
    • CTRL-T to open mark(s) location in a new tab
  3. Registers

    • CTRL-Q to delete register(s)
    • CTRL-P to paste register(s) before
    • ENTER to paste register(s)
  4. Buffers

    • ENTER to go to ONE single selected buffer (hidden opens in curent window, active moves focus to tab and window of the buffer)
    • CTRL-Q to delete buffer(s)
    • CTRL-S to open buffer(s) in a split
    • CTRL-V to open buffer(s) in a vertical split
    • CTRL-T to open buffer(s) in a new tab
  5. BLines = lines from current buffer

    • Multiple selections go to quickfix list on ENTER and location list on ALT-ENTER
  6. Lines = lines from all buffers

    • CTRL-S to open buffer in a split and go to this line
    • CTRL-V to open buffer in a vertical split and go to this line
    • CTRL-T to open buffer in a new tab (get file name from buffer, open in new tab) go to this line
    • Multiple selections go to quickfix list on ENTER
  7. Filetypes

  8. Rg

    • Push to QuickFix list on Enter if multiple items selected
    • :Rg command to search by Ripgrep regex
  9. UGrep

    • Push to QuickFix list on Enter if multiple items selected
    • :Ug command to search by uGrep regex
  10. GDiff = find all the Git-changes for current file

    • Open chosen commit file in a vertical split with diff on (if you want something from it to your current file)
  11. Ctags: Show all tags from a current tags file and go to each tags location. Tags format is defined in my config and includes lines numbers to parse

  12. Commands History

  13. Search History

  14. Directories

    • ENTER to change current tab directory,
    • CTRL-L (local) to change current window directory,
    • CTRL-G (global) to change directory of Neovim instance
  15. PGrep = PowerGrep functionality for searching unique entries by regular expression. Usage: :PGrep <regex>

  16. LSP = Work in Progress, only Diagnostics available for now

About

nvim-fzf commands for Windows

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages